@syncfusion/ej2-navigations 28.1.35 → 28.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-navigations.min.js +1 -10
- package/dist/ej2-navigations.umd.min.js +1 -10
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +23 -5
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +23 -5
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +1 -10
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +6 -10
- package/src/carousel/carousel.js +3 -0
- package/src/common/menu-base.d.ts +1 -0
- package/src/common/menu-base.js +18 -3
- package/src/treeview/treeview.js +2 -2
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-navigations.min.js
|
|
3
|
-
* version : 28.1.35
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
|
-
this.ej=this.ej||{},this.ej.navigations=function(e,t,i,s,n,r,o){"use strict";function a(e,t,i,s,n,r){var o,a,d=t.parentElement;if("vscroll"===s?(o=r||t.getBoundingClientRect().height,a=i.getBoundingClientRect().height):(o=t.getBoundingClientRect().width,a=i.getBoundingClientRect().width),o<a)return l(e,t,i,s,n,r);if(d){var h=d.getBoundingClientRect().width;return h<o&&"hscroll"===s?(a=h,t.style.maxWidth=h+"px",l(e,t,i,s,n,r)):i}return i}function l(e,i,s,n,r,o){var a=e("div",{className:"e-menu-"+n});i.appendChild(a),a.appendChild(s),o?(a.style.overflow="hidden",a.style.height=o+"px"):(a.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new m({enableRtl:r},a).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new p({enableRtl:r},a).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,a}function d(e,i,s){if(e){var n=t.select(".e-menu-parent",i);n?s&&s!==n||(e.destroy(),i.parentElement.appendChild(n),t.detach(i)):(e.destroy(),t.detach(i))}}var h=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)}}(),c=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},p=function(e){function i(t,i){return e.call(this,t,i)||this}return h(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var i=this.element,s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"hScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",i.classList.remove("e-hscroll"),i.classList.remove("e-scroll-device"),i.classList.remove("e-rtl");var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,o=[].slice.call(this.scrollItems.children);r<o.length;r++){var a=o[r];i.appendChild(a)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:"e-scroll-overlay e-scroll-right-overlay"}),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),n=this.createElement("div",{id:t.concat("_right"),className:s}),r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"});n.appendChild(r);var o=this.createElement("div",{className:"e-scroll-overlay e-scroll-left-overlay"});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(o,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},n=this.createElement("div",{className:i,attrs:s});n.setAttribute("aria-disabled","false");var r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"}),o="e-"+e.id.concat("_nav e-scroll-nav e-scroll-left-nav"),a={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},l=this.createElement("div",{className:o+" e-overlay",attrs:a});l.setAttribute("aria-disabled","true");var d=this.createElement("div",{className:"e-nav-left-arrow e-nav-arrow e-icons"});l.appendChild(d),n.appendChild(r),e.appendChild(n),e.insertBefore(l,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),l.classList.add("e-ie-align")),this.eventBinding([n,l])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains("e-scroll-nav")&&(n=t.querySelector(".e-nav-arrow").classList),this.contains(s,"e-rtl")&&this.browserCheck&&(e=-e),!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?n.contains("e-nav-right-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains("e-nav-left-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Left"===e.swipeDirection?i.scrollLeft+=t*r:"Right"===e.swipeDirection&&(i.scrollLeft-=t*r),s-=.5,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&this.scrollEle.scrollLeft>0&&(this.scrollEle.scrollLeft=0)},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetWidth});var r=function(){var t,s;n.contains(n.element,"e-rtl")&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,"e-rtl")&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-right-arrow"],["e-nav-left-arrow"]):t.classList(s,["e-nav-left-arrow"],["e-nav-right-arrow"])}else e&&i&&(e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0"));this.repeatScroll()},i.prototype.scrollHandler=function(e){var t=e.target,i=t.offsetWidth,s=(this.element,this.element.querySelector(".e-scroll-left-nav")),n=this.element.querySelector(".e-scroll-right-nav"),r=this.element.querySelector(".e-scroll-left-overlay"),o=this.element.querySelector(".e-scroll-right-overlay"),a=t.scrollLeft;if(a<=0&&(a=-a),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(r=this.element.querySelector(".e-scroll-right-overlay"),o=this.element.querySelector(".e-scroll-left-overlay")),r.style.width=a<40?a+"px":"40px",t.scrollWidth-Math.ceil(i+a)<40?o.style.width=t.scrollWidth-Math.ceil(i+a)+"px":o.style.width="40px"),0===a)this.arrowDisabling(s,n);else if(Math.ceil(i+a+.1)>=t.scrollWidth)this.arrowDisabling(n,s);else{var l=this.element.querySelector(".e-scroll-nav.e-overlay");l&&(l.classList.remove("e-overlay"),l.setAttribute("aria-disabled","false"),l.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),u=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 n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},m=function(e){function i(t,i){return e.call(this,t,i)||this}return u(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),t.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=t.createElement("div",{className:"e-vscroll-content"}),i=t.createElement("div",{className:"e-vscroll-bar"});i.setAttribute("tabindex","-1");for(var s=this.element,n=0,r=[].slice.call(s.children);n<r.length;n++){var o=r[n];e.appendChild(o)}i.appendChild(e),s.appendChild(i),i.style.overflow="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll","e-scroll-device","e-rtl"]);var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,o=[].slice.call(this.scrollItems.children);r<o.length;r++){var a=o[r];i.appendChild(a)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlayElement=function(e){var i=e.id.concat("_nav"),s=t.createElement("div",{className:"e-scroll-overlay e-scroll-down-overlay"}),n="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),r=t.createElement("div",{id:i.concat("down"),className:n}),o=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"});r.appendChild(o);var a=t.createElement("div",{className:"e-scroll-overlay e-scroll-up-overlay"});this.ieCheck&&r.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(r),e.insertBefore(a,e.firstChild),this.eventBinding([r])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var r=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"}),o="e-"+e.id.concat("_nav e-scroll-nav e-scroll-up-nav"),a=t.createElement("div",{id:i.concat("_up"),className:o+" e-overlay"});a.setAttribute("aria-disabled","true");var l=t.createElement("div",{className:"e-nav-up-arrow e-nav-arrow e-icons"});a.appendChild(l),n.appendChild(r),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(a,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),a.classList.add("e-ie-align")),this.eventBinding([n,a])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;s.contains("e-scroll-nav")&&(s=t.querySelector(".e-nav-arrow").classList),s.contains("e-nav-down-arrow")?this.frameScrollRequest(e,"add",i):s.contains("e-nav-up-arrow")&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Up"===e.swipeDirection?i.scrollTop+=t*r:"Down"===e.swipeDirection&&(i.scrollTop-=t*r),s-=.02,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetHeight});var r=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-down-arrow"],["e-nav-up-arrow"]):t.classList(s,["e-nav-up-arrow"],["e-nav-down-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var t=e.target,i=t.offsetHeight,s=this.element.querySelector(".e-scroll-up-nav"),n=this.element.querySelector(".e-scroll-down-nav"),r=this.element.querySelector(".e-scroll-up-overlay"),o=this.element.querySelector(".e-scroll-down-overlay"),a=t.scrollTop;if(a<=0&&(a=-a),this.isDevice&&(r.style.height=a<40?a+"px":"40px",t.scrollHeight-Math.ceil(i+a)<40?o.style.height=t.scrollHeight-Math.ceil(i+a)+"px":o.style.height="40px"),0===a)this.arrowDisabling(s,n);else if(Math.ceil(i+a+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var l=this.element.querySelector(".e-scroll-nav.e-overlay");l&&(l.classList.remove("e-overlay"),l.setAttribute("aria-disabled","false"),l.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},f([t.Property(null)],i.prototype,"scrollStep",void 0),i=f([t.NotifyPropertyChanges],i)}(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)}}(),v=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},y="e-focused",b="e-menu-header",C="e-selected",S="e-menu-item",I="e-menu-hide",x="e-menu-popup",E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property("id")],i.prototype,"itemId",void 0),v([t.Property("parentId")],i.prototype,"parentId",void 0),v([t.Property("text")],i.prototype,"text",void 0),v([t.Property("iconCss")],i.prototype,"iconCss",void 0),v([t.Property("url")],i.prototype,"url",void 0),v([t.Property("separator")],i.prototype,"separator",void 0),v([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property(null)],i.prototype,"iconCss",void 0),v([t.Property("")],i.prototype,"id",void 0),v([t.Property(!1)],i.prototype,"separator",void 0),v([t.Collection([],i)],i.prototype,"items",void 0),v([t.Property("")],i.prototype,"text",void 0),v([t.Property("")],i.prototype,"url",void 0),v([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property("SlideDown")],i.prototype,"effect",void 0),v([t.Property(400)],i.prototype,"duration",void 0),v([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),w=function(e){function n(i,s){var n=e.call(this,i,s)||this;return n.navIdx=[],n.animation=new t.Animation({}),n.isTapHold=!1,n.tempItem=[],n.showSubMenuOn="Auto",n.isAnimationNone=!1,n}return g(n,e),n.prototype.preRender=function(){if(!this.isMenu){r=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var e=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=r,t.setValue("ej2_instances",e,this.element)}else{r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),r);var i=this.element.nextElementSibling;i?this.element.parentElement.insertBefore(r,i):this.element.parentElement.appendChild(r),this.clonedElement=r}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var s=this.element,n=t.getValue("ej2_instances",s),r=this.createElement("ul"),o=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),a=0,l=s.attributes.length;a<l;a++)r.setAttribute(s.attributes[a].nodeName,s.attributes[a].nodeValue);s.parentNode.insertBefore(o,s),t.detach(s),s=r,o.appendChild(s),t.setValue("ej2_instances",n,s),this.clonedElement=o,this.element=s,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete();var t=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){a(e.createElement,t,e.element,"hscroll",e.enableRtl)})},n.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):document.body.appendChild(e)),this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add("e-rtl"),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},n.prototype.renderItems=function(){if(!this.items.length){var e=i.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}});this.setProperties({items:e},!0),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML=""}var s=this.createItems(this.items);if(t.append(Array.prototype.slice.call(s.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu){if(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling){var n=this.getWrapper();this.element.classList.contains("e-vertical")?a(this.createElement,n,this.element,"vscroll",this.enableRtl):a(this.createElement,n,this.element,"hscroll",this.enableRtl)}}else this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu")},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),r=0,o=n.length;r<o;r++)i=n[r],this.isMenu?t.EventHandler.add(i,"click",this.menuHeaderClickHandler,this):t.Browser.isIos?new t.Touch(i,{tapHold:this.touchHandler.bind(this)}):t.EventHandler.add(i,"contextmenu",this.cmenuHandler,this);if(this.targetElement=i,!this.isMenu){t.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var a=0,l=s.getScrollableParent(this.targetElement);a<l.length;a++){var d=l[a];t.EventHandler.add(d,"scroll",this.scrollHandler,this)}}}t.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),t.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),t.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),this.isMenu||this.target||t.EventHandler.add(document,"scroll",this.scrollHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+S})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:"downarrow",uparrow:"uparrow",enter:"enter",leftarrow:"leftarrow",rightarrow:"rightarrow",escape:"escape"};this.isMenu&&(i.home="home",i.end="end",i.tab="tab"),new t.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:i})},n.prototype.mouseDownHandler=function(e){t.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||t.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},n.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},n.prototype.keyBoardHandler=function(e){var i="",s=e.target,n=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&s.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([y,C],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case"rightarrow":i="rightarrow",e.action="downarrow";break;case"leftarrow":i="leftarrow",e.action="uparrow";break;case"downarrow":i="downarrow",e.action="rightarrow";break;case"uparrow":i="uparrow",e.action=""}else if(this.enableRtl)switch(e.action){case"leftarrow":n=!0,i="leftarrow",e.action="rightarrow";break;case"rightarrow":n=!0,i="rightarrow",e.action="leftarrow"}switch(e.action){case"downarrow":case"uparrow":case"end":case"home":case"tab":this.upDownKeyHandler(e);break;case"rightarrow":this.rightEnterKeyHandler(e);break;case"leftarrow":this.leftEscKeyHandler(e);break;case"enter":this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e);break;case"escape":this.leftEscKeyHandler(e)}n&&(e.action=i)},n.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i="downarrow"===e.action||"home"===e.action||"tab"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,y);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(y),"end"!==e.action&&"home"!==e.action&&("downarrow"===e.action?s++:s--,s===("downarrow"===e.action?t.childElementCount:-1)&&(s=i)));var r=t.children[s];s=this.isValidLI(r,s,e.action),t.children[s].classList.add(y),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n="downarrow"===i||"home"===i||"tab"===i?0:s.childElementCount-1;return(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(I))&&("downarrow"===i&&t===s.childElementCount-1?t=n:"uparrow"===i&&0===t?t=n:"downarrow"===i||"rightarrow"===i?t++:"tab"===i&&e.classList.contains("e-separator")?t++:t--),(e=s.children[t])&&(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(I))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){var i=this;if(void 0===e&&(e=this.navIdx.length),this.isMenu){var s=[this.getWrapper()].concat([].slice.call(t.selectAll("."+x)))[e],n=[];return t.selectAll("."+x).forEach(function(e){(i.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&n.push(e)}),s=[this.getWrapper()].concat([].slice.call(n))[e],t.isNullOrUndefined(s)?null:t.select(".e-menu-parent",s)}return document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},n.prototype.rightEnterKeyHandler=function(e){var t,i=this.getUlByNavIdx(),s=this.getLIByClass(i,y);if(s){var n=this.getIdx(i,s),r=this.navIdx.concat(n),o=this.getItem(r);if(o.items.length)this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,o,-1,-1,e);else if("enter"===e.action){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([C],[this.getWrapper()]):s.classList.remove(y),s.classList.add(C),t={element:s,item:o,event:e},this.trigger("select",t);var a=s.querySelector(".e-menu-url");if(o.url&&a)switch(a.getAttribute("target")){case"_blank":window.open(o.url,"_blank");break;case"_parent":window.parent.location.href=o.url;break;default:window.location.href=o.url}this.closeMenu(null,e);var l=this.getLIByClass(this.getUlByNavIdx(),C);l&&(l.classList.add(y),l.focus())}}},n.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):"escape"===e.action&&this.closeMenu(null,e)},n.prototype.scrollHandler=function(e){this.closeMenu(null,e)},n.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},n.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},n.prototype.closeMenu=function(e,i,n){var r=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var o,a,l=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,g=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&g.classList.contains("e-menu")&&((l=this.getLIByClass(g,C))&&l.classList.remove(C),u=!0),!u){var v=i&&i.target&&this.getLI(i.target);this.cli=v||g.children[0],o=this.navIdx.length?this.getItem(this.navIdx):null,a=o?o.items:this.items,c={element:g,parentItem:o,items:a,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(l){var c,p,u,f="",b=!l.cancel;(b||r.isCMenu)&&(r.isMenu?(c=t.closest(g,"."+x),r.hamburgerMode&&(c.parentElement.style.minHeight="",t.closest(g,".e-menu-item").setAttribute("aria-expanded","false")),r.unWireKeyboardEvent(c),d(t.getInstance(c.children[0],m),c.children[0]),(u=t.getInstance(c,s.Popup)).hide(),f=c.id,u.destroy(),t.detach(c)):(r.isContextMenuClosed=!1,r.toggleAnimation(g,!1)),p={element:g,parentItem:o,items:a},r.trigger("onClose",p),r.navIdx.pop(),0===r.navIdx.length&&i&&"keyup"===i.type&&(r.showSubMenu=!1),r.isMenu||(t.EventHandler.remove(g,"keydown",r.keyHandler),"right"===r.keyType&&(r.keyType=""))),r.updateReactTemplate();var S,I,E,N=r.getWrapper()&&r.getUlByNavIdx();r.isCMenu&&(r.canOpen(i.target)&&r.openMenu(null,null,r.pageY,r.pageX,i),r.isCMenu=!1),r.isMenu&&N&&f.length?(S=new RegExp("(.*)-ej2menu-"+r.element.id+"-popup").exec(f)[1],I=N.querySelector('[id="'+S+'"]'),E=v&&N.querySelector('[id="'+v.id+'"]')):N&&(I=N.querySelector(".e-menu-item.e-selected"),E=v&&N.querySelector('[id="'+v.id+'"]'));var O=v&&v.querySelectorAll(".e-menu-item");if(b&&r.hamburgerMode&&e&&!O.length)r.afterCloseMenu(i);else if(b&&!r.hamburgerMode&&I&&!E&&"left"!==r.keyType&&(r.navIdx.length||!r.isMenu&&0===r.navIdx.length)){var w=i&&i.target.classList&&(i.target.classList.contains("e-vscroll")||i.target.classList.contains("e-scroll-nav"))?t.closest(i.target,".e-menu-wrapper"):null;w?(w=w.querySelector(".e-menu-item"),(r.showItemOnClick||w&&r.getIndex(w.id,!0).length<=r.navIdx.length)&&r.closeMenu(r.navIdx[r.navIdx.length-1],i,!0)):i&&i.target.classList&&i.target.classList.contains("e-nav-arrow")||r.closeMenu(r.navIdx[r.navIdx.length-1],i)}else if(b&&!n&&!e&&(r.hamburgerMode&&r.navIdx.length||1===r.navIdx.length&&v&&N!==v.parentElement))r.closeMenu(null,i);else if(b&&t.isNullOrUndefined(e)&&r.navIdx.length)r.closeMenu(null,i);else if(!b||r.isMenu||e||0!==r.navIdx.length||r.isMenusClosed||r.isCmenuHover)if(b&&r.isMenu&&i&&i.target&&0!==r.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))r.closeMenu(0,i);else if(b&&!r.isMenu&&t.selectAll(".e-menu-parent",h)[e-1]&&3===i.which)r.closeMenu(null,i);else{if(!b||"right"!==r.keyType&&"click"!==r.keyType){var L=r.getUlByNavIdx(),k=r.getLIByClass(L,C);if(k&&(k.setAttribute("aria-expanded","false"),k.classList.remove(C),(l.isFocused&&v||"left"===r.keyType)&&(k.classList.add(y),i.target&&i.target.classList.contains("e-edit-template")||k.focus())),!b&&r.hamburgerMode&&v&&"false"===v.getAttribute("aria-expanded")&&"true"===v.getAttribute("aria-haspopup")){t.closest(v,".e-menu-parent.e-control")?r.navIdx=[]:r.navIdx.pop(),r.navIdx.push(r.cliIdx);var A=r.getItem(r.navIdx);v.setAttribute("aria-expanded","true"),r.openMenu(v,A,-1,-1,i)}}else r.afterCloseMenu(i);r.navIdx.length<1&&("Hover"!==r.showSubMenuOn&&"Click"!==r.showSubMenuOn||(r.showItemOnClick=r.defaultOption,r.showSubMenuOn="Auto"))}else r.isMenusClosed=!0,r.closeMenu(0,i);r.removeStateWrapper()})}}},n.prototype.updateReactTemplate=function(){if(this.isReact&&this.template&&0===this.navIdx.length){var e=void 0;this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates()}},n.prototype.getMenuItemModel=function(e,i){if(t.isNullOrUndefined(e))return null;t.isNullOrUndefined(i)&&(i=0);var s=this.getFields(i);return{text:e[s.text],id:e[s.id],items:e[s.child],separator:e[s.separator],iconCss:e[s.iconCss],url:e[s.url]}},n.prototype.getPopups=function(){var e=this,i=[];return[].slice.call(document.querySelectorAll("."+x)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+S))&&e.getIndex(s.querySelector("."+S).id,!0).length&&i.push(s)}),i},n.prototype.isMenuVisible=function(){return this.navIdx.length>0||this.element.classList.contains("e-contextmenu")&&t.isVisible(this.element).valueOf()},n.prototype.canOpen=function(e){var i=!0;if(this.filter){i=!1;for(var s=this.filter.split(" "),n=0,r=s.length;n<r;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,r,o,a){var l=this;void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=this.targetElement);var d=this.getWrapper();this.lItem=e;var h=""!==this.element.id?this.element.id:"menu";if(this.isMenusClosed=!1,t.isNullOrUndefined(n)&&(n=-1),t.isNullOrUndefined(r)&&(r=-1),e){if(this.uList=this.createItems(i[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&t.Browser.isDevice){d.lastChild.style.display="none";var c={text:i[this.getField("text")].toString(),iconCss:"e-icons e-previous"};this.template&&(i.iconCss=(i.iconCss||"")+"e-icons e-previous");var p=new N(this.items[0],"items",this.template?i:c,!0),u=this.createItems([p]).children[0];u.classList.add(b),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+x,id:e.id+"-ej2menu-"+h+"-popup"}),this.hamburgerMode?(n=e.offsetHeight,e.appendChild(this.popupWrapper)):document.body.appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&t.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,o,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,i,o,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,d.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,i,o,n,r,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,o,n,r,"none"))}else if(this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(a||this.element).toString(),t.isNullOrUndefined(o)){var f=document.createEvent("MouseEvents");f.initEvent("click",!0,!1);var m=this.copyObject(f,{});m.target=m.srcElement=a,m.currentTarget=a,this.triggerBeforeOpen(e,this.uList,i,m,n,r,"none")}else this.triggerBeforeOpen(e,this.uList,i,o,n,r,"none")},n.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},n.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),s=parseInt(i.textIndent,10);this.navIdx.length<2&&!t.classList.contains("e-blankicon")?s*=2:s+=s/4,e.style.textIndent=s+"px";var n=e.querySelectorAll(".e-blankicon");if(n&&n.length)for(var r=e.querySelector(".e-menu-icon"),o=getComputedStyle(r),a=parseInt(o.marginRight,10)+r.offsetWidth+s,l=0;l<n.length;l++)n[l].style.textIndent=a+"px"},n.prototype.generatePopup=function(e,i,n,r){var o=this,a=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:r||this.enableRtl?"none":"flip",Y:"fit"},position:r&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:i,open:function(){var e=t.select(".e-menu-vscroll",a.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",a.element);a.element.style.maxHeight="",i.focus(),o.triggerOpen(i)}});return a},n.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var i=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.title):this.title,n=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:s}),r=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(r),e.insertBefore(i,this.element)},n.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},n.prototype.closeHamburgerMenu=function(e){var t=this,i={element:this.element,parentItem:null,event:e,items:this.items,cancel:!1};this.trigger("beforeClose",i,function(i){i.cancel||(t.closeMenu(null,e),t.element.classList.add("e-hide-menu"),t.trigger("onClose",{element:t.element,parentItem:null,items:t.items}))})},n.prototype.callFit=function(e,t,i,n,r){return s.fit(e,null,{X:t,Y:i},{top:n,left:r})},n.prototype.triggerBeforeOpen=function(e,i,s,n,r,o,l){var d=this,h=e?s[this.getField("children",this.navIdx.length-1)]:this.items,c={element:i,items:h,parentItem:s,event:n,cancel:!1,top:r,left:o,showSubMenuOn:"Auto"},p=l;this.trigger("beforeOpen",c,function(r){switch(p){case"menu":d.hamburgerMode||("Auto"!==r.showSubMenuOn&&(d.showItemOnClick=!d.defaultOption,d.showSubMenuOn=r.showSubMenuOn),d.top=r.top,d.left=r.left),d.popupWrapper.style.display="block",d.hamburgerMode||(d.popupWrapper.style.maxHeight=d.popupWrapper.getBoundingClientRect().height+"px",d.enableScrolling&&a(d.createElement,d.popupWrapper,d.uList,"vscroll",d.enableRtl),d.checkScrollOffset(n)),d.hamburgerMode||d.left||d.top?(d.popupObj.collision={X:"none",Y:"none"},d.popupWrapper.style.display=""):(d.popupObj.refreshPosition(d.lItem,!0),d.left=parseInt(d.popupWrapper.style.left,10),d.top=parseInt(d.popupWrapper.style.top,10),d.enableRtl&&(d.left=d.isNestedOrVertical?d.left-d.popupWrapper.offsetWidth-d.lItem.parentElement.offsetWidth+2:d.left-d.popupWrapper.offsetWidth+d.lItem.offsetWidth),d.template&&(d.isReact||d.isAngular)?requestAnimationFrame(function(){d.collision(),d.popupWrapper.style.display=""}):(d.collision(),d.popupWrapper.style.display=""));break;case"none":d.top=r.top,d.left=r.left,d.isContextMenuClosed=!0;break;case"hamburger":r.cancel||(d.element.classList.remove("e-hide-menu"),d.triggerOpen(d.element))}if("hamburger"!==p)if(r.cancel)d.isMenu?(d.popupObj.destroy(),t.detach(d.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),d.navIdx.pop();else if(d.isMenu)if(d.hamburgerMode)d.popupWrapper.style.top=d.top+"px",d.popupWrapper.style.left="0px",d.toggleAnimation(d.popupWrapper);else{d.setBlankIconStyle(d.popupWrapper),d.wireKeyboardEvent(d.popupWrapper),t.rippleEffect(d.popupWrapper,{selector:"."+S}),d.popupWrapper.style.left=d.left+"px",d.popupWrapper.style.top=d.top+"px";var o="None"!==d.animationSettings.effect?{name:d.animationSettings.effect,duration:d.animationSettings.duration,timingFunction:d.animationSettings.easing}:null;d.popupObj.show(o,d.lItem),t.Browser.isDevice&&(d.popupWrapper.style.left=d.left+"px")}else d.setBlankIconStyle(d.uList),d.setPosition(d.lItem,d.uList,d.top,d.left),d.toggleAnimation(d.uList);if("right"===d.keyType){var l=d.getUlByNavIdx();if(e.classList.remove(y),d.isMenu&&1===d.navIdx.length&&d.removeLIStateByClass([C],[d.getWrapper()]),e.classList.add(C),"enter"===d.action){var h={element:e,item:s,event:n};d.trigger("select",h)}e.focus(),l=d.getUlByNavIdx();var c=d.isValidLI(l.children[0],0,d.action);l.children[c].classList.add(y),l.children[c].focus()}})},n.prototype.collision=function(){var e;if(e=s.isCollide(this.popupWrapper,null,this.left,this.top),(this.isNestedOrVertical||this.enableRtl)&&(e.indexOf("right")>-1||e.indexOf("left")>-1)){this.popupObj.collision.X="none";var i=t.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth;this.left=this.enableRtl?s.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-i+2}((e=s.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")>-1||e.indexOf("right")>-1)&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},n.prototype.setBlankIconStyle=function(e){var t=[].slice.call(e.getElementsByClassName("e-blankicon"));if(t.length){var i=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)");if(i){var s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},r=getComputedStyle(s),o=parseInt(r.fontSize,10);parseInt(r.width,10)&&parseInt(r.width,10)>o&&(o=parseInt(r.width,10));var a=o+parseInt(r[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=a})}}}},n.prototype.checkScrollOffset=function(e){var i=this.getWrapper();if(i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length){var s=t.isNullOrUndefined(e)?this.element:t.closest(e.target,"."+S),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var r=n.scrollLeft+n.offsetWidth,o=s.offsetLeft+s.offsetWidth;r<o&&(n.scrollLeft+=o-r)}},n.prototype.setPosition=function(e,i,n,r){if(this.toggleVisiblity(i),i===this.element||r>-1&&n>-1){if((c=s.isCollide(i,null,r,n)).indexOf("right")>-1&&(r-=i.offsetWidth),c.indexOf("bottom")>-1&&(n=(h=this.callFit(i,!1,!0,n,r)).top-20)<0){var o=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;o>-1&&(n=o)}(c=s.isCollide(i,null,r,n)).indexOf("left")>-1&&(r=(h=this.callFit(i,!0,!1,n,r)).left)}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),r=Number(this.element.style.left.replace("px",""));else{var l=this.enableRtl?"left":"right",h=s.calculatePosition(e,l,"top");n=h.top,r=h.left;var c=s.isCollide(i,null,this.enableRtl?r-i.offsetWidth:r,n),p=c.indexOf("left")>-1||c.indexOf("right")>-1;p&&(r=(h=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||p)&&(r=this.enableRtl&&p?r:r-i.offsetWidth),c.indexOf("bottom")>-1&&(n=(h=this.callFit(i,!1,!0,n,r)).top)}this.toggleVisiblity(i,!1);var u=t.closest(this.element,".e-"+this.getModuleName()+"-wrapper");if(!this.isMenu&&this.enableScrolling&&i&&u&&u.offsetHeight>0){var f=t.closest(i,".e-menu-vscroll");i.style.display="block",f&&d(t.getInstance(f,m),f);var g=Math.ceil(this.getMenuWidth(i,i.offsetWidth,this.enableRtl)),v=a(this.createElement,u,i,"vscroll",this.enableRtl,u.offsetHeight);Object.assign(v.style,{top:n+"px",left:r+"px",width:g+"px",position:"absolute",display:"none"})}else i.style.top=n+"px",i.style.left=r+"px"},n.prototype.getMenuWidth=function(e,t,i){var s=e.getElementsByClassName("e-caret")[0];return s&&(t+=parseInt(getComputedStyle(s)[i?"marginRight":"marginLeft"],10)),t<120?120:t},n.prototype.toggleVisiblity=function(e,t){void 0===t&&(t=!0),e.style.visibility=t?"hidden":"",e.style.display=t?"block":"none"},n.prototype.createItems=function(e){var s=this,n=this.navIdx?this.navIdx.length:0,r=this.getFields(n),o=this.hasField(e,this.getField("iconCss",n)),a={showIcon:o,moduleName:"menu",fields:r,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[r.id]]||(e.curData[e.fields[r.id]]=t.getUniqueID("menuitem")),t.isNullOrUndefined(e.curData.htmlAttributes)&&(e.curData.htmlAttributes={}),t.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]?e.curData[e.fields.text]:e.curData[e.fields.id])),""===e.curData[e.fields[r.iconCss]]&&(e.curData[e.fields[r.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add("e-separator"),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator")),!o||e.curData[e.fields.iconCss]||e.curData[s.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length){var t=s.createElement("span",{className:"e-icons e-caret"});e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")}s.isMenu&&s.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"),e.item.removeAttribute("aria-level"));var i={item:e.curData,element:e.item};s.trigger("beforeItemRender",i)}};this.setProperties({items:this.items},!0),this.isMenu&&(a.templateID=this.element.id+"Template");var l=i.ListBase.createList(this.createElement,e,a,!this.template,this);return l.setAttribute("tabindex","0"),this.isMenu?l.setAttribute("role","menu"):l.setAttribute("role","menubar"),l},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i,this.isMenu||(this.isCmenuHover=!0);var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),r=this.getWrapper(),o=new RegExp("-ej2menu-(.*)-popup"),a=!1;if(n){if((""!==n.id?o.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([y,C],[this.getWrapper()]),!this.navIdx.length)return;a=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!a?(this.removeLIStateByClass([y],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([y],this.isMenu?[r].concat(this.getPopups()):[r]),s.classList.add(y),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!a&&this.removeLIStateByClass([y],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||i.parentElement===n||t.closest(i,".e-"+this.getModuleName()+"-popup")||s&&(!s||this.getIndex(s.id,!0).length)||"Hover"===this.showSubMenuOn?a&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([y],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},n.prototype.removeStateWrapper=function(){if(this.liTrgt){var e=t.closest(this.liTrgt,".e-menu-vscroll");"DIV"===this.liTrgt.tagName&&e&&this.removeLIStateByClass([y,C],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=0;n<i.length;n++)!function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})}(n)},n.prototype.getField=function(e,t){void 0===t&&(t=0);var i=this.fields[""+e];return"string"==typeof i?i:i[t]?i[t].toString():i[i.length-1].toString()},n.prototype.getFields=function(e){return void 0===e&&(e=0),{id:this.getField("itemId",e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},n.prototype.menuHeaderClickHandler=function(e){var i=t.closest(e.target,".e-menu-wrapper");i&&i.querySelector("ul.e-menu-parent").id!==this.element.id||(this.element.className.indexOf("e-hide-menu")>-1?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){this.isTapHold=!this.isTapHold&&this.isTapHold;var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),o=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,a=n&&o&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===o.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([y],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&o&&this.isMenu){var l=o.id?r.exec(o.id)[1]:o.querySelector(".e-menu-parent").id;if(this.element.id!==l)return}if(a&&"click"===e.type&&!n.classList.contains(b)){this.setLISelected(n);var d=this.getIndex(n.id,!0),h={element:n,item:this.getItem(d),event:e};this.trigger("select",h)}if(a&&("mouseover"===e.type||t.Browser.isDevice||this.showItemOnClick)){var c=void 0;if(n.classList.contains(b))c=i.children[this.navIdx.length-1],this.toggleAnimation(c),(f=this.getLIByClass(c,C))&&f.classList.remove(C),t.detach(n.parentNode),this.navIdx.pop();else if(!n.classList.contains("e-separator")){this.showSubMenu=!0;var p=n.parentNode;if(t.isNullOrUndefined(p))return;if(this.cliIdx=this.getIdx(p,n),this.isMenu||!t.Browser.isDevice){var u=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),t.closest(p,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,p);if(this.navIdx[u]===this.cliIdx&&(this.showSubMenu=!1),u!==this.navIdx.length&&("mouseover"!==e.type||this.showSubMenu)){var f=this.getLIByClass(p,C);f&&f.classList.remove(C),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(u+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if("DIV"===s.tagName&&t.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)){var m=this.isMenu?t.closest(s,"."+x):t.closest(s,".e-menu-vscroll"),g=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),m)+1:this.getIdx(i,t.select("ul.e-menu-parent",m));g<this.navIdx.length&&(this.closeMenu(g+1,e),m&&this.removeLIStateByClass([y,C],[m]))}else this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+S).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([C],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector(".e-caret"))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||navigator.platform.toUpperCase().indexOf("MAC")>=0&&!e.ctrlKey)&&this.closeMenu(null,e))},n.prototype.afterCloseMenu=function(e){if(!t.isNullOrUndefined(e)){var i;if(this.showSubMenu){i=this.showItemOnClick&&0===this.navIdx.length?t.closest(e.target,".e-menu-parent.e-control"):t.closest(this.element,".e-menu-parent.e-control");var s=this.navIdx.concat(this.cliIdx),n=this.getItem(s);if(n&&n[this.getField("children",s.length-1)]&&n[this.getField("children",s.length-1)].length?(("mouseover"===e.type||t.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&i||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,n,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!i){var r=this.getUlByNavIdx(),o=this.getLIByClass(r,C);o&&(o.setAttribute("aria-expanded","false"),o.classList.remove(C))}}this.keyType=""}},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,C);t&&t.classList.remove(C),this.isMenu||e.classList.remove(y),e.classList.add(C)},n.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},n.prototype.getItemIndex=function(e,t){var i;i="string"==typeof e?e:e.id;var s=!1!==t;return this.getIndex(i,s)},n.prototype.setItem=function(e,t,i){var s;s=i?t||e.id:t||e.text;var n=this.getIndex(s,i),r=this.getItem(n);Object.assign(r,e)},n.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},n.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},n.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},n.prototype.getIdx=function(e,i,s){void 0===s&&(s=!0);var n=!this.isMenu&&this.enableScrolling&&t.select(".e-menu-vscroll",e)?t.selectAll(".e-menu-parent",e):Array.from(e.children),r=Array.prototype.indexOf.call(n,i);return s&&e.children[0].classList.contains(b)&&r--,r},n.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:t.closest(e,"li.e-menu-item")},n.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},n.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},n.prototype.onPropertyChanged=function(e,i){for(var s=this,n=this.getWrapper(),r=this,o=0,l=Object.keys(e);o<l.length;o++)!function(o){switch(o){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":r.enableRtl?n.classList.add("e-rtl"):n.classList.remove("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var l;r.element.classList.contains("e-vertical")?a(r.createElement,n,r.element,"vscroll",r.enableRtl):a(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){l=t.select(".e-ul",e),a(s.createElement,e,l,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")||!r.isMenu?d(t.getInstance(h,m),h):d(t.getInstance(h,p),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,m),h),e.style.overflow=""})}break;case"items":var c=void 0,u=void 0,f=void 0;if(r.isReact&&r.template&&r.clearTemplate(["template"]),Object.keys(i.items).length)for(var g=Object.keys(e.items),v=0;v<g.length;v++)(u=r.getChangedItemIndex(e,[],Number(g[v]))).length<=r.getWrapper().children.length&&(c=u.pop(),f=r.getItems(u),r.insertAfter([f[c]],f[c].text),r.removeItem(f,u,c),r.setItems(f,u)),u.length=0;else{if(r.updateItem(r.element,r.items),r.enableScrolling&&r.element.parentElement.classList.contains("e-custom-scroll")&&(r.element.classList.contains("e-vertical")?a(r.createElement,n,r.element,"vscroll",r.enableRtl):a(r.createElement,n,r.element,"hscroll",r.enableRtl)),!r.hamburgerMode)for(var v=1,y=n.childElementCount;v<y;v++)t.detach(n.lastElementChild);r.navIdx=[]}}}(l[o])},n.prototype.updateItem=function(e,i){if(t.isBlazor()&&!this.isMenu)e=this.removeChildElement(e);else{if(this.enableScrolling){var s=this.getWrapper().children[0];this.element.classList.contains("e-vertical")?d(t.getInstance(s,m),s):d(t.getInstance(s,p),s)}e.innerHTML=""}[].slice.call(this.createItems(i).children).forEach(function(t){e.appendChild(t)})},n.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();if("items"===s){var n=e.items[i],r=Object.keys(n.items).pop();r&&this.getChangedItemIndex(n,t,Number(r))}else"isParentArray"===s&&t.length>1&&t.pop();return t},n.prototype.removeItem=function(e,i,s){e.splice(s,1);var n=this.getWrapper().children;i.length<n.length&&t.detach(n[i.length].children[s])},n.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var i=this.getWrapper();if(e){for(var n=void 0,r=void 0,o=t.selectAll(e),a=0,l=o.length;a<l;a++)n=o[a],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(r=t.getInstance(n,t.Touch))&&r.destroy():t.EventHandler.remove(n,"contextmenu",this.cmenuHandler);if(!this.isMenu){t.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var d=0,h=s.getScrollableParent(this.targetElement);d<h.length;d++){var c=h[d];t.EventHandler.remove(c,"scroll",this.scrollHandler)}}}t.Browser.isDevice||(t.EventHandler.remove(this.isMenu?document:i,"mouseover",this.delegateMoverHandler),t.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),this.isMenu||this.target||t.EventHandler.remove(document,"scroll",this.scrollHandler)),t.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(i),this.rippleFn()},n.prototype.unWireKeyboardEvent=function(e){var i=t.getInstance(e,t.KeyboardEvents);i&&i.destroy()},n.prototype.toggleAnimation=function(e,i){var s=this;void 0===i&&(i=!0);var n,r,o=this.enableScrolling&&!this.isMenu&&t.closest(e,".e-menu-vscroll")?t.closest(e,".e-menu-vscroll"):e;"None"!==this.animationSettings.effect&&i?this.animation.animate(o,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){s.hamburgerMode?(r=e.element.parentElement,e.element.style.position="absolute",r&&(n=r.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",r&&(r.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=s.isMenu?e.element.getBoundingClientRect().height+"px":e.element.scrollHeight+"px")},progress:function(e){s.hamburgerMode&&r&&(r.style.minHeight=n+e.element.offsetHeight+"px")},end:function(e){s.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",r&&(r.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),s.triggerOpen(e.element.children[0])):s.end(e.element,i)}}):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,i))},n.prototype.triggerOpen=function(e){var i=this.navIdx.length?this.getItem(this.navIdx):null,s={element:e,parentItem:i,items:i?i.items:this.items};this.trigger("onOpen",s),this.isMenu||t.EventHandler.add(e,"keydown",this.keyHandler,this)},n.prototype.end=function(e,i){if(i&&this.isContextMenuClosed)if((this.isMenu||!t.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&t.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(n=this.enableScrolling&&!this.isMenu?t.closest(e,".e-menu-vscroll"):null)&&(n.style.display="block"),this.triggerOpen(e),e.querySelector("."+y))e.querySelector("."+y).focus();else{var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];this.currentTarget?this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName||(s?s.querySelector("."+C).focus():this.element.focus()):s?s.querySelector("."+C).focus():this.element.focus()}else{var n=this.enableScrolling&&!this.isMenu?t.closest(e,".e-menu-vscroll"):null;if(n&&d(t.getInstance(n,m),n),e===this.element){var r=this.getLIByClass(this.element,y);r&&r.classList.remove(y);var o=this.getLIByClass(this.element,C);o&&o.classList.remove(C),e.style.display="none",this.isAnimationNone=!1}else t.detach(e)}},n.prototype.getPersistData=function(){return""},n.prototype.getWrapper=function(){return t.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},n.prototype.getIndex=function(e,t,i,s,n,r){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===r&&(r=0);var o;r=n?r+1:0;for(var a=0,l=i.length;a<l;a++){o=i[a];var d=t?o[this.getField("itemId",r)]:o[this.getField("text",r)];if((o.htmlAttributes&&"id"in o.htmlAttributes?o.htmlAttributes.id:d)===e){s.push(a);break}if(o[this.getField("children",r)]&&o[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,o[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(a);break}a!==l-1&&s.pop()}else a===l-1&&s.push(-1)}return n||-1!==s[0]?s:[]},n.prototype.enableItems=function(e,i,s){void 0===i&&(i=!0);for(var n,r,o,a,l="e-disabled",d=0;d<e.length;d++){if(o=this.getIndex(e[d],s),this.navIdx.length){if(1!==o.length){a=!1;for(var h=0,c=o.length-1;h<c;h++)if(o[h]!==this.navIdx[h]){a=!0;break}if(a)continue}}else if(1!==o.length)continue;r=o.pop(),(n=this.getUlByNavIdx(o.length))&&!t.isNullOrUndefined(r)&&(i?this.isMenu?(n.children[r].classList.remove(l),n.children[r].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(l):n.children[r].classList.remove(l):this.isMenu?(n.children[r].classList.add(l),n.children[r].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(l):n.children[r].classList.add(l))}},n.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},n.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},n.prototype.showHideItems=function(e,t,i){for(var s,n,r,o,a=0;a<e.length;a++)if(r=this.getIndex(e[a],i),n=r.pop(),s=this.getUlByNavIdx(r.length),o=this.getItems(r),s){var l=i?s.children[n].id:o[n].text.toString();t&&l===e[a]?s.children[n].classList.add(I):t||l!==e[a]||s.children[n].classList.remove(I)}},n.prototype.removeItems=function(e,i){for(var s,n,r,o=0;o<e.length;o++)s=(n=this.getIndex(e[o],i)).pop(),r=this.getItems(n),t.isNullOrUndefined(s)||this.removeItem(r,n,s)},n.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},n.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},n.prototype.insertItems=function(e,i,s,n){void 0===n&&(n=!0);for(var r,o,a,l,d,h=0;h<e.length;h++){o=(a=this.getIndex(i,s)).pop(),l=this.getItems(a),(d=new N(l[0],"items",e[h],!0)).parentObj=l[0].parentObj,l.splice(n?o+1:o,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(!t.isNullOrUndefined(o)&&a.length<c.length){o=n?o+1:o,r=this.createItems(l).children[o];var p=this.isMenu?t.select(".e-menu-parent",c[a.length]):c[a.length];p.insertBefore(r,p.children[o]),h!==e.length-1||this.isMenu||"block"!==p.style.display||(this.setPosition(null,p,parseFloat(p.style.top),parseFloat(p.style.left)),p.style.display="block")}}},n.prototype.removeAttributes=function(){var e=this;["top","left","display","z-index"].forEach(function(t){e.element.style.removeProperty(t)}),["role","tabindex","class","style"].forEach(function(t){"class"===t&&e.element.classList.contains("e-menu-parent")&&e.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(t)&&e.element.getAttribute(t)||e.element.removeAttribute(t),e.isMenu&&"class"===t&&e.element.classList.contains("e-vertical")&&e.element.classList.remove("e-vertical")})},n.prototype.destroy=function(){var i=this.getWrapper();if(i){if(this.unWireEvents(),this.isMenu)this.closeMenu(),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),i.parentNode.insertBefore(this.element,i),this.clonedElement=null;else{if(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName)t.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement;else if(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)){var s=this.clonedElement.nextElementSibling;s&&s!==i?this.clonedElement.parentElement.insertBefore(this.element,s):this.clonedElement.parentElement.appendChild(this.element),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",t.append([].slice.call(this.clonedElement.children),this.element),t.detach(this.clonedElement),this.removeAttributes()}this.clonedElement=null}t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}this.rippleFn=null},v([t.Event()],n.prototype,"beforeItemRender",void 0),v([t.Event()],n.prototype,"beforeOpen",void 0),v([t.Event()],n.prototype,"onOpen",void 0),v([t.Event()],n.prototype,"beforeClose",void 0),v([t.Event()],n.prototype,"onClose",void 0),v([t.Event()],n.prototype,"select",void 0),v([t.Event()],n.prototype,"created",void 0),v([t.Property("")],n.prototype,"cssClass",void 0),v([t.Property(0)],n.prototype,"hoverDelay",void 0),v([t.Property(!1)],n.prototype,"showItemOnClick",void 0),v([t.Property("")],n.prototype,"target",void 0),v([t.Property("")],n.prototype,"filter",void 0),v([t.Property(null)],n.prototype,"template",void 0),v([t.Property(!1)],n.prototype,"enableScrolling",void 0),v([t.Property(!0)],n.prototype,"enableHtmlSanitizer",void 0),v([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},E)],n.prototype,"fields",void 0),v([t.Collection([],N)],n.prototype,"items",void 0),v([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},O)],n.prototype,"animationSettings",void 0),n=v([t.NotifyPropertyChanges],n)}(t.Component),L=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(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)}}(),k=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},A="e-toolbar-items",T="e-toolbar-item",P="e-toolbar-popup",D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),k([t.Property("")],i.prototype,"id",void 0),k([t.Property("")],i.prototype,"text",void 0),k([t.Property("auto")],i.prototype,"width",void 0),k([t.Property("")],i.prototype,"cssClass",void 0),k([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),k([t.Property(!1)],i.prototype,"disabled",void 0),k([t.Property("")],i.prototype,"prefixIcon",void 0),k([t.Property("")],i.prototype,"suffixIcon",void 0),k([t.Property(!0)],i.prototype,"visible",void 0),k([t.Property("None")],i.prototype,"overflow",void 0),k([t.Property("")],i.prototype,"template",void 0),k([t.Property("Button")],i.prototype,"type",void 0),k([t.Property("Both")],i.prototype,"showTextOn",void 0),k([t.Property(null)],i.prototype,"htmlAttributes",void 0),k([t.Property("")],i.prototype,"tooltipText",void 0),k([t.Property("Left")],i.prototype,"align",void 0),k([t.Event()],i.prototype,"click",void 0),k([t.Property(-1)],i.prototype,"tabIndex",void 0),i}(t.ChildProperty),M=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.resizeContext=s.resize.bind(s),s.orientationChangeContext=s.orientationChange.bind(s),s.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return L(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular)&&this.clearTemplate();var s=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(s).forEach(function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.ej2_instances)||t.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),t.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},i.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains("e-vertical"),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},i.prototype.wireKeyboardEvent=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),t.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},i.prototype.updateTabIndex=function(e){var i=this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )");if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.firstElementChild)){var s=i.firstElementChild.getAttribute("data-tabindex");s&&"-1"===s&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)}},i.prototype.unwireKeyboardEvent=function(){this.keyModule&&(t.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},i.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var i=!t.isNullOrUndefined(this.popObj)&&t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&i&&this.popObj.hide({name:"FadeOut",duration:100}),(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},i.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},i.prototype.docEvent=function(e){var i=t.closest(e.target,".e-popup");this.popObj&&t.isVisible(this.popObj.element)&&!i&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},i.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,"e-tbar-pos"),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+T)).forEach(function(e){t.detach(e)}),this.tbarAlign){var e=this.element.querySelector("."+A);[].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,"e-tbar-pos")}this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,"e-rtl"),this.destroyScroll()),this.remove(this.element,"e-tbar-extended"),this.remove(this.element,"e-extended-toolbar");var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,"e-toolbar-multirow"),this.popObj&&this.popupRefresh(this.popObj.element,!0)},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},i.prototype.clstElement=function(e,i){return e&&this.popObj&&t.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+T):this.element===i||e?this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )"):t.closest(i,"."+T)},i.prototype.keyHandling=function(e,i,s,n,r){var o,a,l=this.popObj,d=this.element,h={name:"FadeOut",duration:100},c="moveUp"===i.action?"previous":"next";switch(i.action){case"moveRight":if(this.isVertical)return;d===s?this.elementFocus(e):n||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;n||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var p=t.closest(e,".e-popup"),u=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&u&&u.classList.contains("e-popup-open")&&(p="end"===i.action?u:null),p?t.isVisible(this.popObj.element)&&(a=[].slice.call(p.children),o="home"===i.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)):(a=this.element.querySelectorAll("."+A+" ."+T+":not(.e-separator)"),o="home"===i.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)),o&&this.elementFocus(o)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(l&&t.closest(s,".e-popup")){var f=l.element,m=f.firstElementChild;"previous"===c&&m===e?f.lastElementChild.firstChild.focus():"next"===c&&f.lastElementChild===e?m.firstChild.focus():this.eleFocus(e,c)}else"moveDown"===i.action&&l&&t.isVisible(l.element)&&this.elementFocus(e);break;case"tab":if(!r&&!n){var g=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(g),g.focus()))}break;case"popupClose":l&&"Extended"!==this.overflowMode&&l.hide(h);break;case"popupOpen":if(!n)return;l&&!t.isVisible(l.element)?(l.element.style.top=d.offsetHeight+"px",l.show({name:"FadeIn",duration:100})):l.hide(h)}},i.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains("e-overlay")){e.preventDefault();var i=t.classList.contains("e-hor-nav"),s=t.classList.contains("e-scroll-nav"),n=this.clstElement(i,t);(n||s)&&this.keyHandling(n,e,t,i,s)}},i.prototype.disable=function(e){var i=this.element;e?i.classList.add("e-overlay"):i.classList.remove("e-overlay"),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),i.querySelector("#"+i.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},i.prototype.eleContains=function(e){return e.classList.contains("e-separator")||e.classList.contains("e-overlay")||e.getAttribute("disabled")||e.classList.contains("e-hidden")||!t.isVisible(e)||!e.classList.contains(T)},i.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains("e-hidden")&&!i.classList.contains("e-overlay"))return i;t++}},i.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;t>=0;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains("e-hidden")&&!i.classList.contains("e-overlay"))return i;t--}},i.prototype.eleFocus=function(e,i){var s=Object(e)[i+"ElementSibling"];if(s){if(this.eleContains(s))return void this.eleFocus(s,i);this.elementFocus(s)}else if(this.tbarAlign){var n=Object(e.parentElement)[i+"ElementSibling"];if(t.isNullOrUndefined(n)||0!==n.children.length||(n=Object(n)[i+"ElementSibling"]),!t.isNullOrUndefined(n)&&n.children.length>0)if("next"===i){r=n.querySelector("."+T);this.eleContains(r)?this.eleFocus(r,i):(r.firstElementChild.focus(),this.activeEleSwitch(r))}else{var r=n.lastElementChild;this.eleContains(r)?this.eleFocus(r,i):this.elementFocus(r)}}else if(!t.isNullOrUndefined(e)){var o=this.element.querySelectorAll("."+A+" ."+T+":not(.e-separator):not(.e-overlay):not(.e-hidden)");"next"===i&&o?this.elementFocus(o[0]):"previous"===i&&o&&this.elementFocus(o[o.length-1])}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,r=!t.isNullOrUndefined(t.closest(s,".e-toolbar-pop")),o=s.classList,a=t.closest(s,".e-hor-nav");a||(a=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!o.contains("e-hor-nav")||(o=s.querySelector(".e-icons").classList),(o.contains("e-popup-up-icon")||o.contains("e-popup-down-icon"))&&this.popupClickHandler(n,a,"e-rtl");var l,d=t.closest(e.target,"."+T);if(!t.isNullOrUndefined(d)&&!d.classList.contains("e-overlay")||a.classList.contains("e-hor-nav")){d&&(l=this.items[this.tbarEle.indexOf(d)]);var h={originalEvent:e,item:l};(l&&!t.isNullOrUndefined(l.click)&&"object"==typeof l.click?!t.isNullOrUndefined(l.click.observers)&&l.click.observers.length>0:!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(l.click))&&this.trigger("items["+this.tbarEle.indexOf(d)+"].click",h),h.cancel||this.trigger("clicked",h,function(e){!t.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})}},i.prototype.popupClickHandler=function(e,i,s){var n=this.popObj;t.isVisible(n.element)?(i.classList.remove("e-nav-active"),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(s)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(s)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(n.element.style.minHeight="0px",n.width=this.getToolbarPopupWidth(this.element)),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px",i.classList.add("e-nav-active"),n.show({name:"FadeIn",duration:100}))},i.prototype.getToolbarPopupWidth=function(e){var t=window.getComputedStyle(e);return parseFloat(t.width)+2*parseFloat(t.borderRightWidth)},i.prototype.render=function(){var e=this;this.initialize(),this.renderControl(),this.wireEvents(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderComplete(),this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){e.refreshOverflow()})},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);"msie"===t.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||t.setStyleAttribute(this.element,{height:i}),t.setStyleAttribute(this.element,{width:e});var s={role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};t.attributes(this.element,s),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},i.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},i.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},i.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),(s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s.appendChild(i)):t.appendChild(i);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},i.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove("e-vertical"),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add("e-vertical"),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),t.setStyleAttribute(this.element,{height:t.formatUnit(this.height),width:t.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},i.prototype.initScroll=function(e,i){if(!this.scrollModule&&this.checkOverflow(e,i[0])){this.tbarAlign&&this.element.querySelector("."+A+" .e-toolbar-center").removeAttribute("style"),this.isVertical?this.scrollModule=new m({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new p({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.cssClass&&t.addClass([i[0]],this.cssClass.split(" "));var s=this.scrollModule.element.querySelector(".e-hscroll-bar, .e-vscroll-bar");s&&s.removeAttribute("tabindex"),this.remove(this.scrollModule.element,"e-tbar-pos"),t.setStyleAttribute(this.element,{overflow:"hidden"})}},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+T,e)).forEach(function(e){t.isVisible(e)&&(i=window.getComputedStyle(e),n+=s.isVertical?e.offsetHeight:e.offsetWidth,n+=parseFloat(s.isVertical?i.marginTop:i.marginRight),n+=parseFloat(s.isVertical?i.marginBottom:i.marginLeft))}),n},i.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},i.prototype.checkOverflow=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||!t.isVisible(e))return!1;var s=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?i.offsetHeight:i.offsetWidth;(this.tbarAlign||this.scrollModule||s===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(i):i));var r=e.querySelector(".e-hor-nav"),o=e.querySelector(".e-scroll-nav"),a=0;return r?a=this.isVertical?r.offsetHeight:r.offsetWidth:o&&(a=this.isVertical?2*o.offsetHeight:2*o.offsetWidth),n>s-a},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,"e-tbar-pos"),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+A),s=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===t.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":t.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(A)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,i)||s)&&this.setOverflowAttributes(e),this.toolbarAlign(i);break;case"MultiRow":this.add(i,"e-toolbar-multirow"),this.checkOverflow(e,i)&&this.tbarAlign&&(this.removePositioning(),this.add(i,"e-multirow-pos")),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==t.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,"e-extended-toolbar"),(this.checkOverflow(e,i)||s)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(i)}},i.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(t.selectAll("."+A+" ."+T,e)));var i={tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"};t.attributes(this.element.querySelector(".e-hor-nav"),i)},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll(".e-separator")),i=e.querySelector(".e-multirow-separator"),s=e.querySelector(".e-extended-separator"),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove("e-multirow-separator"):"Extended"===this.overflowMode&&n.classList.remove("e-extended-separator"));for(var r=0;r<=t.length-1;r++)t[parseInt(r.toString(),10)].offsetLeft<30&&0!==t[parseInt(r.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(r.toString(),10)].classList.add("e-multirow-separator"):"Extended"===this.overflowMode&&t[parseInt(r.toString(),10)].classList.add("e-extended-separator"))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector(".e-hor-nav"),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector(".e-hor-nav");var r=n?s.offsetHeight:s.offsetWidth,o=(n?e.offsetHeight:e.offsetWidth)-r;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,o,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,r){var o=e.element,a=[].slice.call(t.selectAll("."+P,o.querySelector("."+A))),l=t.selectAll(".e-overflow-show",s),d=0,h=0;a.forEach(function(o,a){l=t.selectAll(".e-overflow-show",s),o.classList.contains("e-overflow-show")&&l.length>0?e.tbResize&&l.length>a?(s.insertBefore(o,l[parseInt(a.toString(),10)]),++h):(s.insertBefore(o,s.children[l.length]),++h):o.classList.contains("e-overflow-show")?(s.insertBefore(o,s.firstChild),++h):e.tbResize&&o.classList.contains("e-overflow-hide")&&s.children.length>0&&0===l.length?(s.insertBefore(o,s.firstChild),++h):o.classList.contains("e-overflow-hide")?i.push(o):e.tbResize?(s.insertBefore(o,s.childNodes[d+h]),++d):s.appendChild(o),o.classList.contains("e-separator")?t.setStyleAttribute(o,{display:"",height:r+"px"}):t.setStyleAttribute(o,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+T,o.querySelector("."+A)),p=c.length-1;p>=0;p--){var u=c[parseInt(p.toString(),10)];if(!u.classList.contains("e-separator")||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,i,s=this.element;"Extended"===this.overflowMode&&(i=s.querySelector(".e-separator"),e="auto"===s.style.height||""===s.style.height?null:i&&i.offsetHeight);var n,r=s.querySelector("."+T+":not(.e-separator):not(."+P+")"),o="auto"===s.style.height||""===s.style.height?null:r&&r.offsetHeight,a=[];if(t.select("#"+s.id+"_popup.e-toolbar-pop",s))n=t.select("#"+s.id+"_popup.e-toolbar-pop",s);else{var l=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop e-toolbar-extended"}),d=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop"});n="Extended"===this.overflowMode?l:d}this.pushingPoppedEle(this,a,n,o,e),this.popupInit(s,n)},i.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},i.prototype.popupInit=function(e,i){if(this.popObj){if("Extended"!==this.overflowMode){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}}else{e.appendChild(i),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),t.setStyleAttribute(this.element,{overflow:""});var r=new s.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if("Extended"===this.overflowMode&&(r.width=this.getToolbarPopupWidth(this.element),r.offsetX=0),r.appendTo(i),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(r.element.style.maxHeight=r.element.offsetHeight+"px"),this.isVertical&&(r.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector(".e-hor-nav");o.classList.add("e-nav-active"),t.classList(o.firstElementChild,["e-popup-up-icon"],["e-popup-down-icon"]),this.element.querySelector(".e-toolbar-extended").classList.add("e-popup-open")}else r.hide();this.popObj=r}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,"e-tbar-extended"):this.remove(this.element,"e-tbar-extended"))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,o=r.querySelector(".e-hor-nav");o.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?i.element.style.minHeight="":(t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px");var a=n.offsetTop+n.offsetHeight+s.calculatePosition(r).top,l=o.firstElementChild;o.classList.add("e-nav-active"),t.classList(l,["e-popup-up-icon"],["e-popup-down-icon"]),this.tbarPopupHandler(!0);var d=t.isNullOrUndefined(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+d<a&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(a-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[parseInt(c.toString(),10)];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}"Extended"!==this.overflowMode&&t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical&&"Extended"!==this.overflowMode){var u=this.element.getBoundingClientRect();t.setStyleAttribute(i.element,{maxHeight:u.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(i){var f=n.getBoundingClientRect();f.right>document.documentElement.clientWidth&&f.width>r.getBoundingClientRect().width&&(i.collision={Y:"none"},i.dataBind()),i.refreshPosition()}},i.prototype.popupClose=function(e){var i=this.element.querySelector(".e-hor-nav");i.setAttribute("aria-expanded","false");var s=i.firstElementChild;i.classList.remove("e-nav-active"),t.classList(s,["e-popup-down-icon"],["e-popup-up-icon"]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var r,o=this.popupPriCount>0,a=s,l=0,d=0,h=0,c=function(e,t){var i=!1;return t.forEach(function(t){e.classList.contains(t)&&(i=!0)}),i},p=i.length-1;p>=0;p--){var u=void 0,f=window.getComputedStyle(i[parseInt(p.toString(),10)]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[parseInt(p.toString(),10)]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),r=this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth;var g=m?r+u:r;if(c(i[parseInt(p.toString(),10)],["e-popup-alone"])&&o&&(i[parseInt(p.toString(),10)].classList.add(P),this.isVertical?t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minHeight:g+"px"}):t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minWidth:g+"px"}),h++),this.isVertical?i[parseInt(p.toString(),10)].offsetTop+i[parseInt(p.toString(),10)].offsetHeight+u>s:i[parseInt(p.toString(),10)].offsetLeft+i[parseInt(p.toString(),10)].offsetWidth+u>s){if(i[parseInt(p.toString(),10)].classList.contains("e-separator")){if("Extended"===this.overflowMode)c(v=i[parseInt(p.toString(),10)],["e-separator","e-ignore"])&&(i[parseInt(p.toString(),10)].classList.add(P),h++),d++;else if("Popup"===this.overflowMode){if(l>0&&d===h){var v=i[p+d+(l-1)];c(v,["e-separator","e-ignore"])&&t.setStyleAttribute(v,{display:"none"})}l++,d=0,h=0}}else d++;i[parseInt(p.toString(),10)].classList.contains("e-overflow-show")&&n?s-=(this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth)+u:c(i[parseInt(p.toString(),10)],["e-separator","e-ignore"])?s-=(this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth)+u:(i[parseInt(p.toString(),10)].classList.add(P),this.isVertical?t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minHeight:g+"px"}):t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minWidth:g+"px"}),h++)}}if(n){var y=t.selectAll("."+T+":not(."+P+")",this.element);this.checkPriority(e,y,a,!1)}},i.prototype.createPopupIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-hor-nav");s="Extended"===this.overflowMode?s+" e-expended-nav":s;var n=this.createElement("div",{id:i,className:s});"msie"!==t.Browser.info.name&&"edge"!==t.Browser.info.name||n.classList.add("e-ie-align");var r=this.createElement("div",{className:"e-popup-down-icon e-icons"});n.appendChild(r),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,r,o,a,l,d){var h=l,c=this.popObj.element,p=t.selectAll("."+P+":not(.e-overflow-show)",c).length,u=function(e,t){return e.classList.contains(t)};if(0===t.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length){var f=e.children[i-(i-s)-1],m=!t.isNullOrUndefined(f)&&u(f,"e-ignore");if(!t.isNullOrUndefined(f)&&u(f,"e-separator")&&!t.isVisible(f)||m){f.style.display="unset";var g=f.offsetWidth+2*parseFloat(window.getComputedStyle(f).marginRight),v=f.previousElementSibling;o+g<a||r?(e.insertBefore(n,e.children[i+h-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):(t.setStyleAttribute(n,d),v.classList.contains("e-separator")&&(v.style.display="none")),f.style.display=""}else e.insertBefore(n,e.children[i+h-(i-s)])}else e.insertBefore(n,e.children[i+h-p])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,r=this.isVertical,o=n.querySelector("."+A),a=n.querySelector(".e-hor-nav");if(!t.isNullOrUndefined(a)){o.removeAttribute("style"),e.style.display="block";var l;l=r?n.offsetHeight-(a.offsetHeight+o.offsetHeight):n.offsetWidth-(a.offsetWidth+o.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),l+(r?a.offsetHeight:a.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(l,e,i),e.style.display="",0===e.children.length&&a&&this.popObj&&(t.detach(a),a=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null)}},i.prototype.ignoreEleFetch=function(e,t){var i=[].slice.call(t.querySelectorAll(".e-ignore")),s=[],n=0;return i.length>0?(i.forEach(function(e){s.push([].slice.call(t.children).indexOf(e))}),s.forEach(function(t){t<=e&&n++}),n):0},i.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var s=e.offsetWidth-e.querySelector(".e-hor-nav").offsetWidth,n=e.querySelector("."+A).offsetWidth;return t.style.removeProperty("display"),s>i+n},i.prototype.popupEleWidth=function(e){e.style.position="absolute";var i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains("e-popup-text")){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains("e-popup-text")?s.style.display="none":!t.isNullOrUndefined(s)&&e.classList.contains("e-toolbar-text")&&(s.style.display="block"),n.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),n.style.minWidth="",n.style.minHeight="",t.isNullOrUndefined(s)||(s.style.display="")}return i},i.prototype.popupEleRefresh=function(e,i,s){for(var n,r,o=this.popupPriCount>0,a=this.tbarEle,l=this.element.querySelector("."+A),d=0,h=this,c=0,p=[].slice.call(i.children);c<p.length&&"break"!==function(i){if(i.classList.contains("e-popup-alone")&&o&&!s)return"continue";var c=h.popupEleWidth(i);if(i===h.tbarEle[0]&&(c+=h.tbarEleMrgn),i.style.position="",!(c<e||s))return"break";var p={minWidth:i.style.minWidth,height:i.style.height,minHeight:i.style.minHeight};if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains("e-overflow-hide")||i.classList.remove(P),r=h.tbarEle.indexOf(i),h.tbarAlign){var u=h.items[parseInt(r.toString(),10)].align;r=h.tbarAlgEle[(u+"s").toLowerCase()].indexOf(i),a=h.tbarAlgEle[(u+"s").toLowerCase()],l=h.element.querySelector("."+A+" .e-toolbar-"+u.toLowerCase())}var f=0;"Extended"!==h.overflowMode&&a.slice(0,r).forEach(function(t){(t.classList.contains("e-overflow-show")||t.classList.contains("e-separator"))&&(t.classList.contains("e-separator")&&(t.style.display="",e-=t.offsetWidth),f++)}),d=h.ignoreEleFetch(r,l),i.classList.contains("e-overflow-show")?(h.tbarPriRef(l,r,f,i,s,c,e,d,p),e-=i.offsetWidth):0===r?(l.insertBefore(i,l.firstChild),e-=i.offsetWidth):(n=t.selectAll(".e-overflow-show",h.popObj.element).length,l.insertBefore(i,l.children[r+d-n]),e-=i.offsetWidth),i.style.height=""}(p[c]);c++);this.checkOverflow(this.element,this.element.getElementsByClassName(A)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+A);if(!t.isNullOrUndefined(e)&&e.classList.contains("e-tbar-pos")){this.remove(e,"e-tbar-pos");var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+A);this.add(e,"e-tbar-pos"),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+A);if(!t.isNullOrUndefined(i)&&i.classList.contains("e-tbar-pos")){var s,n=this.element.querySelector(".e-hor-nav");if(this.scrollModule){var r=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+r).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var o=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){o-=this.isVertical?n.offsetHeight:n.offsetWidth;var a=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=a:s[2].style.bottom=a:this.enableRtl?s[2].style.left=a:s[2].style.right=a}if(!(o<=e)){var l=(o-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+l+"px";this.isVertical?this.enableRtl?s[1].style.marginBottom=d:s[1].style.marginTop=d:this.enableRtl?s[1].style.marginRight=d:s[1].style.marginLeft=d}}},i.prototype.tbarItemAlign=function(e,t,i){var s=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var n=[];if(n.push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),n.push(this.createElement("div",{className:"e-toolbar-center",attrs:{role:"group"}})),n.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align)n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,"e-tbar-pos");else if("Left"!==e.align){var r=t.childNodes,o=n[0];[].slice.call(r).forEach(function(e){s.tbarAlgEle.lefts.push(e),o.appendChild(e)}),t.appendChild(o),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,"e-tbar-pos")}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,A),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(i){"DIV"===i.tagName&&(e.tbarEle.push(i),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","false"),e.add(i,T))})},i.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var i=void 0;e&&e.children.length>0&&(i=e.querySelector("."+A)),i||(i=this.createElement("div",{className:A})),this.itemsAlign(t,i),e.appendChild(i)}},i.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},i.prototype.enableItems=function(e,i){var s,n=e,r=n.length;t.isNullOrUndefined(i)&&(i=!0);var o=function(e,i){e?(i.classList.remove("e-overlay"),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","false")):(i.classList.add("e-overlay"),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(r)&&r>=1){for(var a=0,l=[].slice.call(n);a<r;a++){var d=l[parseInt(a.toString(),10)];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[parseInt(a.toString(),10)]=s}else s=d;o(i,s)}i?t.removeClass(n,"e-overlay"):t.addClass(n,"e-overlay")}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;o(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},i.prototype.addItems=function(e,i){var s;this.extendedOpen();var n=this.element.querySelector("."+A);if(t.isNullOrUndefined(n))return void this.itemsRerender(e);var r,o="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==o||(o=e.align)});for(var a=0,l=e;a<l.length;a++){var d=l[a];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+T,this.element),d.align=o,r=this.renderSubComponent(d,i),this.tbarEle.length>=i&&s.length>=0){t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var h="L"===d.align[0]?0:"C"===d.align[0]?1:2,c=void 0;this.tbarAlign||"Left"===o?this.tbarAlign?((c=t.closest(s[0],"."+A).children[parseInt(h.toString(),10)]).insertBefore(r,c.children[parseInt(i.toString(),10)]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,r),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+A,this.element))[0].appendChild(r):s[0].parentNode.insertBefore(r,s[parseInt(i.toString(),10)]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+A).children[parseInt(h.toString(),10)]).appendChild(r),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(r),this.refreshPositioning()),this.items.splice(i,0,d),d.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(i,0,r),i++,this.offsetWid=n.offsetWidth}}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.removeItems=function(e){var i,s=e,n=[].slice.call(t.selectAll("."+T,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var r=0,o=[].slice.call(s);r<o.length;r++){a=o[r];i=this.tbarEle.indexOf(a),this.removeItemByIndex(i,n),n=t.selectAll("."+T,this.element)}else{var a=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(a),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[parseInt(e.toString(),10)]&&i[parseInt(e.toString(),10)]){var s=this.tbarEle.indexOf(i[parseInt(e.toString(),10)]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[parseInt(s.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(s.toString(),10)]);this.tbarAlgEle[(this.items[parseInt(s.toString(),10)].align+"s").toLowerCase()].splice(parseInt(n.toString(),10),1)}this.isReact&&this.clearToolbarTemplate(i[parseInt(e.toString(),10)]);var r=i[parseInt(e.toString(),10)].querySelector(".e-control.e-btn");t.isNullOrUndefined(r)||t.isNullOrUndefined(r.ej2_instances[0])||r.ej2_instances[0].isDestroyed||r.ej2_instances[0].destroy(),t.detach(i[parseInt(e.toString(),10)]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var r,o=s.type,a=e;if("object"==typeof e&&(r="function"==typeof a.appendTo),"string"!=typeof e&&r){if("Input"===o){var l=this.createElement("input");s.id?l.id=s.id:l.id=t.getUniqueID("tbr-ipt"),i.appendChild(l),a.appendTo(l)}}else{var d=void 0,h=e,c=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);h="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName))if("string"==typeof e&&c.test(h))i.innerHTML=h;else if(document.querySelectorAll(h).length){var p=(l=document.querySelector(h)).outerHTML.trim();i.appendChild(l),l.style.display="",t.isNullOrUndefined(p)||this.tempId.push(h)}else d=t.compile(h);else i.appendChild(e)}catch(e){d=t.compile(h)}var u=void 0;t.isNullOrUndefined(d)||(u=d({},this,"template",this.element.id+n+"_template",this.isStringTemplate,void 0,void 0,this.root)),!t.isNullOrUndefined(u)&&u.length>0&&[].slice.call(u).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template");var f=i.firstElementChild;t.isNullOrUndefined(f)||(f.setAttribute("tabindex",t.isNullOrUndefined(f.getAttribute("tabIndex"))?"-1":this.getDataTabindex(f)),f.setAttribute("data-tabindex",t.isNullOrUndefined(f.getAttribute("tabIndex"))?"-1":this.getDataTabindex(f))),this.tbarEle.push(i)},i.prototype.buttonRendering=function(e,i){var s=this.createElement("button",{className:"e-tbar-btn"});s.setAttribute("type","button");var r,o,a=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var l=this.createElement("span",{className:"e-tbar-btn-text"});a?(l.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(a):a,s.appendChild(l),s.classList.add("e-tbtn-txt")):this.add(i,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(r=e.prefixIcon+" e-icons",o="Left"):(r=e.suffixIcon+" e-icons",o="Right"));var d=new n.Button({iconCss:r,iconPosition:o});return d.createElement=this.createElement,d.appendTo(s),e.width&&t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),s},i.prototype.renderSubComponent=function(e,i){var s,n=this.createElement("div",{className:T}),r=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!t.isNullOrUndefined(e.tooltipText)?t.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",r.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,i);else switch(e.type){case"Button":(s=this.buttonRendering(e,n)).setAttribute("tabindex",t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),s.setAttribute("data-tabindex",t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),s.setAttribute("aria-label",e.text||e.tooltipText),s.setAttribute("aria-disabled","false"),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,"e-separator")}if(e.showTextOn){var o=e.showTextOn;"Toolbar"===o?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===o&&this.add(n,"e-popup-text")}if(e.overflow){var a=e.overflow;"Show"===a?this.add(n,"e-overflow-show"):"Hide"===a&&(n.classList.contains("e-separator")||this.add(n,"e-overflow-hide"))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains("e-separator")&&(this.add(n,"e-popup-alone"),this.popupPriCount++),e.disabled&&this.add(n,"e-overlay"),!1===e.visible&&this.add(n,"e-hidden"),n},i.prototype.getDataTabindex=function(e){return t.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},i.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){var i=this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )");if(t.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle))if(t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")){if(!t.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")){this.updateTabIndex("0");var s="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i);i.setAttribute("tabindex",s)}else this.updateTabIndex("-1");e.removeAttribute("tabindex")}else{var n=parseInt(this.getDataTabindex(this.activeEle),10)+1;this.activeEle.setAttribute("tabindex",n.toString())}},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"toolbar"},i.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var i=this.checkOverflow(e,e.getElementsByClassName(A)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+A);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,"e-tbar-pos"))}i&&this.scrollModule&&this.offsetWid===e.offsetWidth||((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()),this.element.querySelector(".e-hscroll-bar")&&(this.scrollStep=this.element.querySelector(".e-hscroll-bar").offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator())},i.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},i.prototype.extendedOpen=function(){var e=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var o=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===o?r.firstElementChild.setAttribute("tabindex","0"):o!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",o);break}r=n[++s]}},i.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var i=this.registeredTemplate,s=0;s<i.template.length;s++){var n=i.template[parseInt(s.toString(),10)].rootNodes[0],r=t.closest(n,"."+T);if(!t.isNullOrUndefined(r)&&r===e){this.clearTemplate(["template"],[i.template[parseInt(s.toString(),10)]]);break}}else if(this.portals&&this.portals.length>0)for(var o=this.portals,s=0;s<o.length;s++){var a=o[parseInt(s.toString(),10)],r=t.closest(a.containerInfo,"."+T);if(!t.isNullOrUndefined(r)&&r===e){this.clearTemplate(["template"],s);break}}},i.prototype.onPropertyChanged=function(e,i){var s=this.element;this.extendedOpen();for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&i.items instanceof Array)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var l=parseInt(Object.keys(e.items)[parseInt(a.toString(),10)],10),d=Object.keys(e.items[parseInt(l.toString(),10)])[0],h=Object(e.items[parseInt(l.toString(),10)])[""+d];if(this.tbarAlign||"align"===d){this.refresh(),this.trigger("created");break}var c="showAlwaysInPopup"===d&&!h,p="overflow"===d&&0!==this.popupPriCount;(c||this.items[parseInt(l.toString(),10)].showAlwaysInPopup&&p)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var u=[].slice.call(t.selectAll("."+A+" ."+T,s));this.isReact&&this.items[parseInt(l.toString(),10)].template&&this.clearToolbarTemplate(u[parseInt(l.toString(),10)]),t.detach(u[parseInt(l.toString(),10)]),this.tbarEle.splice(l,1),this.addItems([this.items[parseInt(l.toString(),10)]],l),this.items.splice(l,1),this.items[parseInt(l.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.refreshOverflow();break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(s,"e-rtl"),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl"),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,"e-rtl"):this.remove(this.scrollModule.element,"e-rtl")),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,"e-rtl"):this.remove(this.popObj.element,"e-rtl")),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},i.prototype.hideItem=function(e,i){var s,n="object"==typeof e,r=e;if(n||!t.isNullOrUndefined(r)){var o=[].slice.call(t.selectAll("."+T,this.element));n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(t.selectAll("."+T,this.element))[parseInt(r.toString(),10)]),s&&(i?(s.classList.add("e-hidden"),s.classList.contains("e-separator")||(t.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))||"-1"!==s.firstElementChild.getAttribute("tabindex"))&&this.updateHideEleTabIndex(s,i,n,r,o)):(s.classList.remove("e-hidden"),s.classList.contains("e-separator")||this.updateHideEleTabIndex(s,i,n,r,o)),this.refreshOverflow())}},k([t.Collection([],D)],i.prototype,"items",void 0),k([t.Property("auto")],i.prototype,"width",void 0),k([t.Property("auto")],i.prototype,"height",void 0),k([t.Property("")],i.prototype,"cssClass",void 0),k([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),k([t.Property()],i.prototype,"scrollStep",void 0),k([t.Property(!0)],i.prototype,"enableCollision",void 0),k([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),k([t.Property(!0)],i.prototype,"allowKeyboard",void 0),k([t.Event()],i.prototype,"clicked",void 0),k([t.Event()],i.prototype,"created",void 0),k([t.Event()],i.prototype,"destroyed",void 0),k([t.Event()],i.prototype,"beforeCreate",void 0),i=k([t.NotifyPropertyChanges],i)}(t.Component),H=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)}}(),U=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},R="e-acrdn-item",B="e-acrdn-header",j="e-acrdn-header-content",q="e-acrdn-panel",F="e-acrdn-content",W=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Property("SlideDown")],i.prototype,"effect",void 0),U([t.Property(400)],i.prototype,"duration",void 0),U([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},W)],i.prototype,"collapse",void 0),U([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},W)],i.prototype,"expand",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Property(null)],i.prototype,"content",void 0),U([t.Property(null)],i.prototype,"header",void 0),U([t.Property(null)],i.prototype,"cssClass",void 0),U([t.Property(null)],i.prototype,"iconCss",void 0),U([t.Property(!1)],i.prototype,"expanded",void 0),U([t.Property(!0)],i.prototype,"visible",void 0),U([t.Property(!1)],i.prototype,"disabled",void 0),U([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),z=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},s}return H(i,e),i.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var i=this.element;if(e.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(i.children).forEach(function(e){i.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)i.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}i.classList.remove("e-acrdn-root"),i.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+q);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains("e-accordion")&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add("e-acrdn-root"),this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);t.setStyleAttribute(this.element,{width:e,height:i}),t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices)},i.prototype.renderControl=function(){this.trgtEle=this.element.children.length>0?t.select("div",this.element):null,this.renderItems(),this.initItemExpand()},i.prototype.wireFocusEvents=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+R));e<i.length;e++){var s=i[e],n=s.querySelector("."+B);s.childElementCount>0&&n&&(t.EventHandler.clearEvents(n),t.EventHandler.add(n,"focus",this.focusIn,this),t.EventHandler.add(n,"blur",this.focusOut,this))}},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+B})),this.isNested||(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},i.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},i.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},i.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},i.prototype.getItemTemplate=function(){return this.itemTemplateFn},i.prototype.focusIn=function(e){e.target.parentElement.classList.add("e-item-focus")},i.prototype.focusOut=function(e){e.target.parentElement.classList.remove("e-item-focus")},i.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e,i=t.select(".e-accordion-container",this.element);e=i?i.children:this.element.children;var s=[];[].slice.call(e).forEach(function(e){s.push({header:e.childElementCount>0&&e.children[0]?e.children[0]:"",content:e.childElementCount>1&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),i&&this.element.removeChild(i),this.setProperties({items:s},!0)},i.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:"e-toggle-icon"}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},i.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0)this.dataSource.forEach(function(e,r){i=s.renderInnerItem(e,r),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+B),"blur",s.focusOut,s))});else{var r=this.items;n&&r.length>0&&r.forEach(function(i,r){e=s.renderInnerItem(i,r),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+B),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=e.target,n=this.getItems(),r={};if(t.closest(s,".e-accordion")===this.element){s.classList.add("e-target");var o=t.closest(s,"."+R),a=t.closest(s,"."+B),l=t.closest(s,"."+q);o&&(t.isNullOrUndefined(a)||t.isNullOrUndefined(l))&&(a=o.children[0],l=o.children[1]),a&&(i=t.select(".e-toggle-icon",a));var d;a?d=t.closest(a,"."+R):l&&(d=t.closest(l,"."+R));var h=this.getIndexByItem(o);d&&(r.item=n[this.getIndexByItem(d)]),r.originalEvent=e,!(!t.isNullOrUndefined(i)&&o.childElementCount<=1)||!t.isNullOrUndefined(l)&&t.isNullOrUndefined(t.select(".e-acrdn-header .e-toggle-icon",d))?this.afterContentRender(s,r,o,a,l,d):(o.appendChild(this.contentRendering(h)),this.ariaAttrUpdate(o),this.afterContentRender(s,r,o,a,l,d)),this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,r,o){var a=this,l=[];this.trigger("clicked",i,function(i){if(!i.cancel){var d=r&&!t.isNullOrUndefined(t.select(".e-target",r)),h=r&&!t.isNullOrUndefined(t.select(".e-accordion",r))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=r&&t.isNullOrUndefined(t.select(".e-accordion",r))||!(t.closest(e,".e-accordion")===a.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(q)||e.classList.contains(F)||d)){var p=a.element.querySelector(".e-accordion-container"),u=p?p.children:a.element.children;[].slice.call(u).forEach(function(e){e.classList.contains("e-active")&&l.push(e)});var f=[].slice.call(a.element.querySelectorAll(".e-acrdn-item [e-animate]"));if(f.length>0)for(var m=0,g=f;m<g.length;m++){var v=g[m];l.push(v.parentElement)}var y=-1!==l.indexOf(o)&&"true"===r.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+q,s),S=t.closest(s,".e-acrdn-root").querySelector(".e-expand-state");if(t.isNullOrUndefined(C))return;b=S===s,!t.isVisible(C)||y&&!o.classList.contains("e-selected")?(l.length>0&&"Single"===a.expandMode&&!y&&l.forEach(function(e){a.collapse(t.select("."+q,e)),e.classList.remove("e-expand-state")}),a.expand(C)):a.collapse(C),t.isNullOrUndefined(S)||b||S.classList.remove("e-expand-state")}}}})},i.prototype.eleMoveFocus=function(e,i,s){var n,r=t.closest(s,"."+R);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+B):s.classList.contains(B)&&(r="moveUp"===e?r.previousElementSibling:r.nextElementSibling)&&(n=t.select("."+B,r)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,B);if(!t.isNullOrUndefined(s)||i.classList.contains("e-accordion")||i.classList.contains(B)){var n,r=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,r,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(q)?"true"!==n.getAttribute("e-animate")&&i.click():i.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?r.firstElementChild.children[0]:r.lastElementChild.children[0]).focus(),e.preventDefault()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:B,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:R,id:e.id||t.getUniqueID("acrdn_item")});if(this.headerTemplate){var n=this.headerEleGenerate(),r=this.createElement("div",{className:j});return n.appendChild(r),t.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),s.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(s,"e-select"),s}if(e.header&&this.angularnativeCondiCheck(e,"header")){var o=e.header;this.enableHtmlSanitizer&&"string"==typeof e.header&&(o=t.SanitizeHtmlHelper.sanitize(e.header));var n=this.headerEleGenerate(),r=this.createElement("div",{className:j});n.appendChild(r),n.appendChild(this.fetchElement(r,o,i)),s.appendChild(n)}var a=t.select("."+B,s);if(!e.expanded||t.isNullOrUndefined(i)||this.enablePersistence||-1===this.initExpand.indexOf(i)&&this.initExpand.push(i),e.cssClass&&t.addClass([s],e.cssClass.split(" ")),e.disabled&&t.addClass([s],"e-overlay"),!1===e.visible&&t.addClass([s],"e-hide"),e.iconCss){var l=this.createElement("div",{className:"e-acrdn-header-icon"}),d=this.createElement("span",{className:e.iconCss+" e-icons"});l.appendChild(d),t.isNullOrUndefined(a)?((a=this.headerEleGenerate()).appendChild(l),s.appendChild(a)):a.insertBefore(l,a.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var h=this.toggleIconGenerate();t.isNullOrUndefined(a)&&(a=this.headerEleGenerate(),s.appendChild(a)),a.appendChild(h),this.add(s,"e-select")}return s},i.prototype.angularnativeCondiCheck=function(e,i){var s="content"===i?e.content:e.header;if(this.isAngular&&!t.isNullOrUndefined(s.elementRef)){var n=s.elementRef.nativeElement.data;if(t.isNullOrUndefined(n)||""===n||-1===n.indexOf("bindings="))return!0;var r=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(r)&&"false"===r["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s){var n,r;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);r=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}else n=t.compile(i)}catch(s){"string"==typeof i?e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(e.appendChild(i),this.trgtEle&&(e.firstElementChild.style.display="")):n=t.compile(i)}var a;if(!t.isNullOrUndefined(n)){this.isReact&&this.renderReactTemplates();var l=void 0,d=void 0;e.classList.contains(j)?(l=this.element.id+s+"_header",d="header"):e.classList.contains(F)&&(l=this.element.id+s+"_content",d="content"),a=n({},this,d,l,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+B,e),s=t.select("."+q,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","region")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:q+" e-content-hide",id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:F});if(!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0)this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s);else{var n=this.items[parseInt(e.toString(),10)].content;this.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),i.appendChild(this.fetchElement(s,n,e))}return i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+R);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains("e-overlay"))){var r=t.closest(n,".e-acrdn-root").querySelector(".e-expand-state"),o={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},a=t.select(".e-toggle-icon",n).firstElementChild,l={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+q),isExpanded:!0};this.trigger("expanding",l,function(s){s.cancel||(a.classList.add("e-toggle-animation"),i.expandedItemsPush(n),t.isNullOrUndefined(r)||r.classList.remove("e-expand-state"),n.classList.add("e-expand-state"),"None"===o.name&&"Enable"!==t.animationMode||"Disable"===t.animationMode?(i.expandProgress("begin",a,e,n,s),i.expandProgress("end",a,e,n,s)):i.expandAnimation(o.name,a,e,n,o,s))})}},i.prototype.expandAnimation=function(e,i,s,n,r,o){var a=this;"None"===e&&"Enable"===t.animationMode&&(e="SlideDown",r.name="SlideDown");var l;this.lastActiveItemId=n.id,"SlideDown"===e?(r.begin=function(){a.expandProgress("begin",i,s,n,o),s.style.position="absolute",l=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},r.progress=function(){n.style.minHeight=l+s.offsetHeight+"px"},r.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,o)}):(r.begin=function(){a.expandProgress("begin",i,s,n,o)},r.end=function(){a.expandProgress("end",i,s,n,o)}),new t.Animation(r).animate(s)},i.prototype.expandProgress=function(e,i,s,n,r){this.remove(s,"e-content-hide"),this.add(n,"e-selected"),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,"e-active"),s.setAttribute("aria-hidden","false"),t.attributes(s.previousElementSibling,{"aria-expanded":"true"}),i.classList.remove("e-toggle-animation"),this.trigger("expanded",r))},i.prototype.expandedItemsPush=function(e){var t=this.getIndexByItem(e);if(-1===this.expandedIndices.indexOf(t)){var i=[].slice.call(this.expandedIndices);i.push(t),this.setProperties({expandedIndices:i},!0)}},i.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},i.prototype.getItemElements=function(){var e=[],t=this.element.children;return[].slice.call(t).forEach(function(t){t.classList.contains(R)&&e.push(t)}),e},i.prototype.expandedItemsPop=function(e){var t=this.getIndexByItem(e),i=[].slice.call(this.expandedIndices);i.splice(i.indexOf(t),1),this.setProperties({expandedIndices:i},!0)},i.prototype.collapse=function(e){var i=this;if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=t.closest(e,"."+R);if(t.isVisible(e)&&!n.classList.contains("e-overlay")){var r={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},o=t.select(".e-toggle-icon",n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+q),isExpanded:!1};this.trigger("expanding",a,function(s){s.cancel||(i.expandedItemsPop(n),n.classList.remove("e-expand-state"),o.classList.add("e-toggle-animation"),"None"===r.name&&"Enable"!==t.animationMode||"Disable"===t.animationMode?(i.collapseProgress("begin",o,e,n,s),i.collapseProgress("end",o,e,n,s)):i.collapseAnimation(r.name,e,n,o,r,s))})}}},i.prototype.collapseAnimation=function(e,i,s,n,r,o){var a=this;"None"===e&&"Enable"===t.animationMode&&(e="SlideUp",r.name="SlideUp");var l,d,h,c;this.lastActiveItemId=s.id,"SlideUp"===e?(r.begin=function(){h=s.offsetHeight,s.style.minHeight=h+"px",i.style.position="absolute",l=s.offsetHeight,d=i.offsetHeight,i.style.maxHeight=d+"px",a.collapseProgress("begin",n,i,s,o)},r.progress=function(){(c=l-(d-i.offsetHeight))<h&&(s.style.minHeight=c+"px")},r.end=function(){i.style.display="none",a.collapseProgress("end",n,i,s,o),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(r.begin=function(){a.collapseProgress("begin",n,i,s,o)},r.end=function(){a.collapseProgress("end",n,i,s,o)}),new t.Animation(r).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,r){this.remove(i,"e-expand-icon"),this.remove(n,"e-selected"),"end"===e&&(this.add(s,"e-content-hide"),i.classList.remove("e-toggle-animation"),this.remove(n,"e-active"),s.setAttribute("aria-hidden","true"),t.attributes(s.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",r))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.getItems=function(){return this.itemTemplate&&this.headerTemplate?this.dataSource:this.items},i.prototype.addItem=function(e,i){var s=this,n=this.element,r=this.getItemElements(),o=this.getItems();t.isNullOrUndefined(i)&&(i=o.length),n.childElementCount>=i&&(e instanceof Array?e:[e]).forEach(function(e,a){var l=i+a;o.splice(l,0,e);var d=s.renderInnerItem(e,l);n.childElementCount===l?n.appendChild(d):n.insertBefore(d,r[parseInt(l.toString(),10)]),t.EventHandler.add(d.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+B),"blur",s.focusOut,s),s.expandedIndices=[],s.expandedItemRefresh(),e&&e.expanded&&s.expandItem(!0,l)}),this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(){var e=this,t=this.getItemElements();[].slice.call(t).forEach(function(t){t.classList.contains("e-selected")&&e.expandedItemsPush(t)})},i.prototype.removeItem=function(e){if(this.isReact||this.isAngular){var i=t.selectAll("."+R,this.element)[parseInt(e.toString(),10)],s=t.select("."+j,i),n=t.select("."+F,i);this.clearAccordionTemplate(s,this.dataSource.length>0?"headerTemplate":"header",j),this.clearAccordionTemplate(n,this.dataSource.length>0?"itemTemplate":"content",F)}var r=this.getItemElements()[parseInt(e.toString(),10)],o=this.getItems();t.isNullOrUndefined(r)||(this.restoreContent(e),t.detach(r),o.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},i.prototype.select=function(e){var i=this.getItemElements()[parseInt(e.toString(),10)];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+B,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[parseInt(e.toString(),10)];t.isNullOrUndefined(s)||(t.isNullOrUndefined(i)&&(i=!0),i?this.add(s,"e-hide"):this.remove(s,"e-hide"))},i.prototype.enableItem=function(e,i){var s=this.getItemElements()[parseInt(e.toString(),10)];if(!t.isNullOrUndefined(s)){var n=s.firstElementChild;i?(this.remove(s,"e-overlay"),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains("e-active")&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,"e-overlay"),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){a=n[n.length-1];this.itemExpand(e,a,this.getIndexByItem(a))}else{var r=t.select("#"+this.lastActiveItemId,this.element);[].slice.call(n).forEach(function(t){s.itemExpand(e,t,s.getIndexByItem(t)),t.classList.remove("e-expand-state")});var o=t.select(".e-expand-state",this.element);o&&o.classList.remove("e-expand-state"),r&&r.classList.add("e-expand-state")}else{var a=n[parseInt(i.toString(),10)];if(t.isNullOrUndefined(a)||!a.classList.contains("e-select")||a.classList.contains("e-active")&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,a,i)}},i.prototype.itemExpand=function(e,i,s){var n=i.children[1];i.classList.contains("e-overlay")||(t.isNullOrUndefined(n)&&e?(n=this.contentRendering(s),i.appendChild(n),this.ariaAttrUpdate(i),this.expand(n)):t.isNullOrUndefined(n)||(e?this.expand(n):this.collapse(n)),this.isReact&&this.renderReactTemplates())},i.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+R)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+R)[parseInt(e.toString(),10)],this.templateEle.forEach(function(e){t.isNullOrUndefined(i.querySelector(e))||(document.body.appendChild(i.querySelector(e)).style.display="none")})},i.prototype.updateItem=function(e,i){if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=s[parseInt(i.toString(),10)];s.splice(i,1),this.restoreContent(i);var r=t.select("."+j,e),o=t.select("."+F,e);(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(r,"header",j),this.clearAccordionTemplate(o,"content",F)),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.clearAccordionTemplate=function(e,i,s){if(this.registeredTemplate&&this.registeredTemplate[""+i])for(var n=this.registeredTemplate,r=0;r<n[""+i].length;r++){var o=n[""+i][parseInt(r.toString(),10)].rootNodes[0],a=t.closest(o,"."+s);if(!t.isNullOrUndefined(a)&&a===e||t.isNullOrUndefined(o.parentNode)){this.clearTemplate([i],[n[""+i][parseInt(r.toString(),10)]]);break}}else if(this.portals&&this.portals.length>0)for(var l=this.portals,r=0;r<l.length;r++){var d=l[parseInt(r.toString(),10)],a=t.closest(d.containerInfo,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],r);break}}},i.prototype.getPersistData=function(){var e=["expandedIndices"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"items":if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var a=Object.keys(e.items),l=0;l<a.length;l++)for(var d=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),h=Object.keys(e.items[parseInt(d.toString(),10)]),c=0;c<h.length;c++){var p=t.selectAll("."+R,this.element)[parseInt(d.toString(),10)],u=Object(i.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]],f=Object(e.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]],m=h[parseInt(c.toString(),10)],g=t.select("."+F,p);if(("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===u)&&this.updateItem(p,d),"cssClass"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||(u&&t.removeClass([p],u.split(" ")),f&&t.addClass([p],f.split(" "))),"visible"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||(!1===Object(e.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]]?p.classList.add("e-hide"):p.classList.remove("e-hide")),"disabled"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||this.enableItem(d,!f),h.indexOf("header")<0&&"content"===h[parseInt(c.toString(),10)]&&!t.isNullOrUndefined(p)&&2===p.children.length)if("function"==typeof f){(this.isAngular||this.isReact)&&this.clearAccordionTemplate(g,h[parseInt(c.toString(),10)],F);var v=p.querySelector("."+F);v.innerHTML="",this.setTemplate(f,v,d)}else p.classList.contains("e-selected")&&this.expandItem(!1,d),t.detach(p.querySelector("."+q))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),n=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),n=!0;break;case"itemTemplate":this.initializeItemTemplate(),n=!0;break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl");break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>1&&this.expandItem(!1)}n&&(this.initExpand=[],!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},U([t.Collection([],_)],i.prototype,"items",void 0),U([t.Property([])],i.prototype,"dataSource",void 0),U([t.Property()],i.prototype,"itemTemplate",void 0),U([t.Property()],i.prototype,"headerTemplate",void 0),U([t.Property("100%")],i.prototype,"width",void 0),U([t.Property("auto")],i.prototype,"height",void 0),U([t.Property([])],i.prototype,"expandedIndices",void 0),U([t.Property("Multiple")],i.prototype,"expandMode",void 0),U([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),U([t.Complex({},V)],i.prototype,"animation",void 0),U([t.Event()],i.prototype,"clicked",void 0),U([t.Event()],i.prototype,"expanding",void 0),U([t.Event()],i.prototype,"expanded",void 0),U([t.Event()],i.prototype,"created",void 0),U([t.Event()],i.prototype,"destroyed",void 0),i=U([t.NotifyPropertyChanges],i)}(t.Component),K=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)}}(),X=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Y=function(e){function i(t,i){return e.call(this,t,i)||this}return K(i,e),i.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||t.getUniqueID("ej2-contextmenu"),e.prototype.preRender.call(this)},i.prototype.initialize=function(){this.template=this.itemTemplate?this.itemTemplate:null,e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=s.getZindexPartial(this.element).toString()},i.prototype.open=function(t,i,s){e.prototype.openMenu.call(this,null,null,t,i,null,s)},i.prototype.close=function(){e.prototype.closeMenu.call(this)},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"filter":this.close(),this.filter=t.filter;break;case"target":this.unWireEvents(i.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=t.itemTemplate,this.refresh()}},i.prototype.getModuleName=function(){return"contextmenu"},X([t.Property("")],i.prototype,"target",void 0),X([t.Property("")],i.prototype,"filter",void 0),X([t.Collection([],N)],i.prototype,"items",void 0),X([t.Property(null)],i.prototype,"itemTemplate",void 0),X([t.Property(!1)],i.prototype,"enableScrolling",void 0),i=X([t.NotifyPropertyChanges],i)}(w),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 n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},J="e-vertical",Z=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return G(i,e),i.prototype.getModuleName=function(){return"menu"},i.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||t.getUniqueID("ej2-menu"),this.template){try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items)}else this.updateMenuItems(this.items);e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(J),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(J),this.element.setAttribute("aria-orientation","vertical")):t.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add("e-hamburger"),"Horizontal"===this.orientation&&this.element.classList.add("e-hide-menu"))},i.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},i.prototype.onPropertyChanged=function(i,s){for(var n=this,r=0,o=Object.keys(i);r<o.length;r++)switch(o[r]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(J),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(J),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(J),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(J),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(s.items).length||this.updateMenuItems(i.items);break;case"hamburgerMode":this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),i.hamburgerMode?(this.element.parentElement.classList.add("e-hamburger"),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove("e-hamburger"),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(J),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(J):this.element.previousElementSibling.classList.remove(J),this.element.classList[i.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(i.title=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title):i.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=i.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(s.target),this.wireEvents(),"Horizontal"===this.orientation&&(i.target?this.element.previousElementSibling.classList.add(J):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(J)),this.element.classList.add("e-hide-menu")));break;case"template":this.template=i.template,this.refresh()}e.prototype.onPropertyChanged.call(this,i,s)},i.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[""+n]){for(t=this.getIndex(e[""+n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},i.prototype.open=function(){e.prototype.openHamburgerMenu.call(this)},i.prototype.close=function(){e.prototype.closeHamburgerMenu.call(this)},Q([t.Property("Horizontal")],i.prototype,"orientation",void 0),Q([t.Property("")],i.prototype,"target",void 0),Q([t.Property(null)],i.prototype,"template",void 0),Q([t.Property(!1)],i.prototype,"enableScrolling",void 0),Q([t.Property(!1)],i.prototype,"hamburgerMode",void 0),Q([t.Property("Menu")],i.prototype,"title",void 0),Q([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),Q([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},E)],i.prototype,"fields",void 0),i=Q([t.NotifyPropertyChanges],i)}(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)}}(),ee=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},te="e-tab-header",ie="e-tab-wrap",se="e-toolbar-items",ne="e-toolbar-item",re="e-toolbar-popup",oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),ee([t.Property(600)],i.prototype,"duration",void 0),ee([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},oe)],i.prototype,"previous",void 0),ee([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},oe)],i.prototype,"next",void 0),i}(t.ChildProperty),le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property("")],i.prototype,"text",void 0),ee([t.Property("")],i.prototype,"iconCss",void 0),ee([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Complex({},le)],i.prototype,"header",void 0),ee([t.Property(null)],i.prototype,"headerTemplate",void 0),ee([t.Property("")],i.prototype,"content",void 0),ee([t.Property("")],i.prototype,"cssClass",void 0),ee([t.Property(!1)],i.prototype,"disabled",void 0),ee([t.Property(!0)],i.prototype,"visible",void 0),ee([t.Property()],i.prototype,"id",void 0),ee([t.Property(-1)],i.prototype,"tabIndex",void 0),i}(t.ChildProperty),he=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.show={},s.hide={},s.maxHeight=0,s.title="Close",s.isInteracted=!1,s.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActiveTabBorder.bind(s),s.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},s}return $(i,e),i.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var i=t.select(".e-tab > .e-content",this.element);this.element.classList.remove("e-template"),t.isNullOrUndefined(i)||(i.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var s=0;s<this.draggableItems.length;s++)this.draggableItems[s].destroy(),this.draggableItems[s]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.refreshOverflow=function(){t.isNullOrUndefined(this.tbObj)||this.tbObj.refreshOverflow()},i.prototype.preRender=function(){var e=t.closest(this.element,".e-content");this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" .e-tab-header":this.dragArea),t.isNullOrUndefined(e)||(e.parentElement.classList.add("e-nested"),this.isNested=!0);var i=t.Browser.info.name,s="msie"===i?"e-ie":"edge"===i?"e-edge":"safari"===i?"e-safari":"";t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),t.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:"e-icons e-close-icon",attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:t.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){e.refreshOverflow(),e.refreshActiveBorder()})},i.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach(function(e,i){t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(e.setProperties)&&e.setProperties({id:"tabitem_"+i.toString()},!0)}),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:"e-content"})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:te})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add("e-template");var i=e.querySelector(".e-tab-header");i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select(".e-tab-header",this.element))&&!t.isNullOrUndefined(t.select(".e-content",this.element))){if(this.renderHeader(),this.tbItems=t.select(".e-tab-header ."+se,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+ne,this.element).length>0){this.tbItems=t.select(".e-tab-header ."+se,this.element),this.bdrLine=this.createElement("div",{className:"e-indicator e-hidden e-ignore"});var s=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(s)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):s.insertBefore(this.bdrLine,s.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}this.setRTL(this.enableRtl)}},i.prototype.renderHeader=function(){var e=this,i=this.headerPlacement,s=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(te)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,r=[],o=0;o<n;o++)r.push(this.hdrEle.children.item(o));if(n>0){var a=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(a),r.forEach(function(i,s){e.lastIndex=s;var n={className:"e-item",id:"e-item"+e.tabId+"_"+s},r=e.createElement("span",{className:"e-tab-text",attrs:{role:"presentation"}}).outerHTML,o=e.createElement("div",{className:"e-text-wrap",innerHTML:r+e.btnCls.outerHTML}).outerHTML,l=e.createElement("div",{className:ie,innerHTML:o,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":"e-content"+e.tabId+"_"+s,"aria-disabled":"false"}});l.querySelector(".e-tab-text").appendChild(i),a.appendChild(e.createElement("div",n)),t.selectAll(".e-item",a)[s].appendChild(l)})}}else s=this.parseObject(this.items,0);this.tbObj=new M({width:"Left"===i||"Right"===i?"auto":"100%",height:"Left"===i||"Right"===i?"100%":"auto",overflowMode:this.overflowMode,items:0!==s.length?s:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{role:"tablist"}),t.isNullOrUndefined(this.element.getAttribute("aria-label"))?t.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.setCloseButton(this.showCloseButton);var l=this.tbObj.element.querySelector("."+se);t.isNullOrUndefined(l)||(t.isNullOrUndefined(l.id)||""===l.id)&&(l.id=this.element.id+"_tab_header_items")},i.prototype.createContentElement=function(e){var i=this.createElement("div",{id:"e-content"+this.tabId+"_"+e,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===Number(this.extIndex(this.itemIndexArray[0])))&&t.addClass([i],"e-active"),i},i.prototype.renderContent=function(){this.cntEle=t.select(".e-content",this.element);var e=t.selectAll("."+ne,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var i=this.cntEle.children,s=0;s<e.length;s++)i.length-1>=s&&(t.addClass([i.item(s)],"e-item"),t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+s}),i.item(s).id="e-content"+this.tabId+"_"+s)}else if(t.selectAll("."+ne,this.element).length>0)if("Init"===this.loadOn)for(s=0;s<this.itemIndexArray.length;s++)this.itemIndexArray[s]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[s]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(this.selectedItem>0?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},i.prototype.parseObject=function(e,i){var s=this,n=Array.prototype.slice.call(t.selectAll(".e-tab-header ."+ne,this.element)),r=this.lastIndex;!this.isReplace&&n.length>0&&(r=this.getMaxIndicesFromItems(n));var o,a=[],l=[];return e.forEach(function(e,d){var h=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,c=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;if(t.isNullOrUndefined(e.headerTemplate)&&(t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===c))return void l.push(d);var p=e.headerTemplate||e.header.text;"string"==typeof p&&s.enableHtmlSanitizer&&(p=t.SanitizeHtmlHelper.sanitize(p));var u;s.isReplace&&!t.isNullOrUndefined(s.tbId)&&""!==s.tbId?(u=parseInt(s.tbId.substring(s.tbId.lastIndexOf("_")+1),10),s.tbId=""):u=i+d,s.lastIndex=0===n.length?d:s.isReplace?u:r+1+d;var f=e.disabled?" e-disable e-overlay":"",m=!1===e.visible?" e-hidden":"";o=s.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});var g=p instanceof Object?p.outerHTML:p,v=!t.isNullOrUndefined(g)&&""!==g;t.isNullOrUndefined(p.tagName)?s.headerTextCompile(o,p,d):o.appendChild(p);var y=s.createElement("span",{className:"e-icons e-tab-icon e-icon-"+h+" "+c}),b=s.createElement("div",{className:"e-text-wrap"});b.appendChild(o),""!==p&&void 0!==p&&""!==c?("left"===h||"top"===h?b.insertBefore(y,b.firstElementChild):b.appendChild(y),o,s.isIconAlone=!1):(""===c?o:y)===y&&(t.detach(o),b.appendChild(y),s.isIconAlone=!0);var C=t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),S=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:C,"data-tabindex":C,role:"tab","aria-selected":"false","aria-disabled":"false"};b.appendChild(s.btnCls.cloneNode(!0));var I=s.createElement("div",{className:ie,attrs:S});I.appendChild(b),s.itemIndexArray instanceof Array&&s.itemIndexArray.splice(i+d,0,"e-item"+s.tabId+"_"+s.lastIndex);var x={htmlAttributes:{id:"e-item"+s.tabId+"_"+s.lastIndex,"data-id":e.id},template:I};x.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+f+" "+m+" "+(""!==c?"e-i"+h:"")+" "+(v?"":"e-icon"),"top"!==h&&"bottom"!==h||s.element.classList.add("e-vertical-icon"),a.push(x),d++}),this.isAdd||l.forEach(function(e){s.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),a},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll(".e-toolbar-item.e-active",e);[].slice.call(i).forEach(function(e){return e.classList.remove("e-active")}),[].slice.call(i).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")})}},i.prototype.checkPopupOverflow=function(e){this.tbPop=t.select(".e-toolbar-pop",this.element);var i=t.select(".e-hor-nav",this.element),s=t.select("."+se,this.element),n=s.lastChild,r=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?r=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(r=!0),r&&(e.classList.add(re),this.tbPop.insertBefore(e,t.selectAll("."+re,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+ie).classList.remove("e-ripple")),this.tbItem=t.selectAll(".e-toolbar-items ."+ne,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(re),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(s)){var n=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(n)}this.isPopup=!0}return t.selectAll("."+ne,this.tbItems).length-1},i.prototype.setCloseButton=function(e){var i=t.select(".e-tab-header",this.element);!0===e?i.classList.add("e-close-show"):i.classList.remove("e-close-show"),this.refreshOverflow(),this.refreshActiveTabBorder()},i.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains("e-rtl");return this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},i.prototype.triggerPrevAnimation=function(e,i){var s=this,n=this.prevCtnAnimation(i,this.selectedItem);t.isNullOrUndefined(n)?e.classList.remove("e-active"):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add("e-progress"),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove("e-active"),e.classList.remove("e-progress"),e.classList.remove("e-view"),t.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||s.isTemplate||t.detach(e)},new t.Animation(n).animate(e))},i.prototype.triggerAnimation=function(e,i){var s,n=this,r=this.prevIndex;[].slice.call(this.element.querySelector(".e-content").children).forEach(function(e){e.id===n.prevActiveEle&&(s=e)});var o=this.tbItem[r],a=this.getTrgContent(this.cntEle,this.extIndex(e));if(t.isNullOrUndefined(s)&&!t.isNullOrUndefined(o)){var l=this.extIndex(o.id);s=this.getTrgContent(this.cntEle,l)}t.isNullOrUndefined(a)||(this.prevActiveEle=a.id);var d=t.isNullOrUndefined(this.animation)||t.isNullOrUndefined(this.animation.next.effect)||t.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect;if(this.initRender||!1===i||d)return void(s&&s!==a&&s.classList.remove("e-active"));var h,c=t.select(".e-content",this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var p=this.animation.previous.effect;h={name:"None"===p?"":"SlideLeftIn"!==p?p:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===t.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var u=this.animation.next.effect;h={name:"None"===u?"":"SlideRightIn"!==u?u:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===t.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}}h.progress=function(){c.classList.add("e-progress"),n.setActiveBorder()},h.end=function(){c.classList.remove("e-progress"),a.classList.add("e-active")},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,r),this.isPopup=!1,""===h.name?a.classList.add("e-active"):new t.Animation(h).animate(a)},i.prototype.keyPressed=function(e){var i=t.closest(e,".e-tab-header ."+ne),s=this.getEleIndex(i);!t.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():t.isNullOrUndefined(i)||!1!==i.classList.contains("e-active")||(this.selectTab(s,null,!0),t.isNullOrUndefined(this.popEle)||this.popObj.hide(this.hide))},i.prototype.getTabHeader=function(){if(!t.isNullOrUndefined(this.element)){var e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(te)});if(e.length>0)return e[0];var i=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0];if(i)return[].slice.call(i.children).filter(function(e){return e.classList.contains(te)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+ne,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace("e-item"+this.tabId+"_","")},i.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},i.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach(function(i){t.isNullOrUndefined(e.element.querySelector(i))||(document.body.appendChild(e.element.querySelector(i)).style.display="none")})},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},i.prototype.compileElement=function(e,i,s,n){var r;"string"==typeof i?(i=i.trim(),this.isVue?r=t.compile(this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):r=t.compile(i);var o;t.isNullOrUndefined(r)||(o=r({},this,s)),!t.isNullOrUndefined(r)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},i.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},i.prototype.getContent=function(e,i,s,n){var r;if("string"==typeof(i=t.isNullOrUndefined(i)?"":i)||t.isNullOrUndefined(i.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var o=document.querySelector(i);r=o.outerHTML.trim(),"clone"===s?e.appendChild(o.cloneNode(!0)):(e.appendChild(o),o.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains("e-nested")?t.select(".e-nested> .e-content > #e-content"+this.tabId+"_"+i,this.element):this.findEle(e.children,"e-content"+this.tabId+"_"+i)},i.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},i.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},i.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?"e-vertical-left":"e-vertical-right";t.addClass([this.hdrEle],["e-vertical",e]),this.element.classList.contains("e-nested")?t.addClass([this.hdrEle],["e-vertical-tab",e]):t.addClass([this.element],["e-vertical-tab",e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],["e-horizontal-bottom"])},i.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},i.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var i=this.hdrEle.querySelector(".e-active"),s=!!this.hdrEle.classList.contains("e-vertical");t.removeClass([this.element],["e-vertical-tab"]),t.removeClass([this.hdrEle],["e-vertical","e-vertical-left","e-vertical-right"]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(re)&&this.popupHandler(i)),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},i.prototype.focusItem=function(){var e=t.select(" #e-item"+this.tabId+"_"+this.selectedItem,this.hdrEle);t.isNullOrUndefined(e)||e.firstElementChild.focus()},i.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},i.prototype.setOrientation=function(e,i){var s=Array.prototype.indexOf.call(this.element.children,i),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector(".e-content"));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],["e-horizontal-bottom"]),this.element.insertBefore(i,t.select(".e-content",this.element)))},i.prototype.setCssClass=function(e,i,s){if(""!==i&&!t.isNullOrUndefined(i))for(var n=i.split(" "),r=0;r<n.length;r++)s?e.classList.add(n[r]):e.classList.remove(n[r])},i.prototype.loadContentInitMode=function(e){if(e){if("Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t);this.prevIndex!==this.selectedItem&&e.classList.remove("e-active")}},i.prototype.loadContentElement=function(){if(!this.isTemplate){var e=this.cntEle.children.item(0);this.loadContentInitMode(e)}},i.prototype.setContentHeight=function(e){if(this.element.classList.contains("e-fill-mode")&&t.removeClass([this.element],["e-fill-mode"]),!t.isNullOrUndefined(this.cntEle)){var i=this.getTabHeader();if("None"===this.heightAdjustMode){if(this.loadContentElement(),"auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],["e-fill-mode"]),t.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var s=t.selectAll(".e-content > .e-item",this.element),n=0;n<s.length;n++)s[n].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(s[n])),s[n].style.removeProperty("display"),s[n].style.removeProperty("visibility");else{this.cntEle=t.select(".e-content",this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var r=this.cntEle.children.item(0),n=0;n<this.items.length;n++)for(this.getContent(r,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(r));r.firstChild;)r.removeChild(r.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(r,this.items[0].content,"render",0),this.loadContentInitMode(r)}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),t.setStyleAttribute(this.cntEle,{height:"auto"})}},i.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},i.prototype.setActiveBorder=function(){var e=this.getTabHeader(),i=t.select(".e-toolbar-item.e-active",e);if(!t.isNullOrUndefined(i)){this.reorderActiveTab?e&&e.classList.remove("e-reorder-active-item"):(i.classList.contains(re)&&!this.bdrLine.classList.contains("e-hidden")&&this.bdrLine.classList.add("e-hidden"),e&&!e.classList.contains("e-reorder-active-item")&&e.classList.add("e-reorder-active-item"));var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+se,e);var n=t.select(".e-indicator",e),r=t.select(".e-toolbar-items ."+this.scrCntClass,e);if(this.isVertical())t.setStyleAttribute(n,{left:"",right:""}),0!==(t.isNullOrUndefined(r)?this.tbItems.offsetHeight:r.offsetHeight)?t.setStyleAttribute(n,{top:i.offsetTop+"px",height:i.offsetHeight+"px"}):t.setStyleAttribute(n,{top:0,height:0});else{if("MultiRow"===this.overflowMode){var o="Bottom"===this.headerPlacement?i.offsetTop:i.offsetHeight+i.offsetTop;t.setStyleAttribute(n,{top:o+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var a=t.isNullOrUndefined(r)?this.tbItems.offsetWidth:r.offsetWidth;0!==a?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:a-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||i.classList.contains(re)||this.bdrLine.classList.remove("e-hidden")}}},i.prototype.setActive=function(e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1),this.tbItem=t.selectAll("."+ne,this.getTabHeader());var n=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!t.isNullOrUndefined(n)&&n.classList.contains("e-disable"))){if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),n.classList.contains("e-active"))return void this.setActiveBorder();this.isTemplate||t.attributes(n.firstElementChild,{"aria-controls":"e-content"+this.tabId+"_"+this.extIndex(n.id)});var r=n.id;this.removeActiveClass(),n.classList.add("e-active"),n.firstElementChild.setAttribute("aria-selected","true");var o=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle="e-content"+this.tabId+"_"+o),this.isTemplate){if(t.select(".e-content",this.element).children.length>0){var a=this.findEle(t.select(".e-content",this.element).children,"e-content"+this.tabId+"_"+o);t.isNullOrUndefined(a)||a.classList.add("e-active"),this.triggerAnimation(r,this.enableAnimation)}}else{for(this.cntEle=t.select(".e-tab > .e-content",this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var l=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(l)){this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_"+this.extIndex(r),className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+this.extIndex(r)}}));var d=this.getTrgContent(this.cntEle,this.extIndex(r)),h=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(d,this.items[h].content,"render",h)}else l.classList.add("e-active");this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(n),!this.initRender&&!i){var c={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:n,selectedIndex:e,selectedContent:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:s,preventFocus:!1};this.trigger("selected",c,function(e){e.preventFocus||n.firstElementChild.focus()})}}},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+se,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},i.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,"e-rtl",e),this.refreshActiveBorder()},i.prototype.refreshActiveBorder=function(){t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.setActiveBorder()},i.prototype.showPopup=function(e){var i=t.select(".e-popup.e-toolbar-pop",this.hdrEle);if(i&&i.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement||this.element.classList.contains("e-rtl")?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector(".e-tab-header");t&&Array.prototype.slice.call(t.querySelectorAll("."+ne)).forEach(function(t){e.initializeDrag(t)})}},i.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),t.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},i.prototype.unWireEvents=function(){t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),t.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),t.isNullOrUndefined(this.cntEle)||t.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove("e-rtl"),this.element.classList.remove("e-focused")},i.prototype.clickHandler=function(e){this.element.classList.remove("e-focused");var i=e.originalEvent.target,s=t.closest(i,"."+ne),n=this.getEleIndex(s);i.classList.contains("e-close-icon")?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,t.isNullOrUndefined(s)||n===this.selectedItem||this.selectTab(n,e.originalEvent,!0))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var i=this.element.querySelector('[data-swipe="true"]');if(i)return void i.removeAttribute("data-swipe");if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var s=this.selectedItem-1;s>=0;s--)if(!this.tbItem[s].classList.contains("e-hidden")){this.selectTab(s,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+ne,this.element).length-1)for(var n=this.selectedItem+1;n<this.tbItem.length;n++)if(!this.tbItem[n].classList.contains("e-hidden")){this.selectTab(n,null,!0);break}this.isSwiped=!1}},i.prototype.spaceKeyDown=function(e){if(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which){var i=t.closest(e.target,".e-tab-header");t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains("e-disable")){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select(".e-active",s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var r=t.closest(document.activeElement,"."+ne),o=t.closest(i,"."+ne);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains("e-disable"))return;if("enter"===e.action&&i.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(i);break;case"tab":case"shiftTab":i.classList.contains(ie)&&!1===t.closest(i,"."+ne).classList.contains("e-active")&&i.setAttribute("tabindex",i.getAttribute("data-tabindex")),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),t.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":t.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!t.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!t.isNullOrUndefined(o)){var a=o.nextSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ne)&&a.firstElementChild.focus(),this.removeTab(this.getEleIndex(o))}this.setActiveBorder()}}},i.prototype.refreshItemVisibility=function(e){var i=t.select("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!t.isNullOrUndefined(i)){var s=t.select(".e-hscroll-bar",this.tbItems),n=s.scrollLeft,r=n+s.offsetWidth,o=e.offsetLeft,a=e.offsetWidth,l=e.offsetLeft+e.offsetWidth;if(n<o&&r<l){d=r-o;s.scrollLeft=n+(a-d)}else if(n>o&&r>l){var d=l-n;s.scrollLeft=n-(a-d)}}},i.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains("e-close-icon")&&i.setAttribute("title",new t.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},i.prototype.evalOnPropertyChangeItems=function(e,i){var s=this;if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var n=t.select(".e-tab > .e-content",this.element);n.firstElementChild;)t.detach(n.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var r=Object.keys(e.items),o=0;o<r.length;o++)for(var a=parseInt(Object.keys(e.items)[o],10),l=Object.keys(e.items[a]),d=0;d<l.length;d++){var h=Object(i.items[a])[l[d]],c=Object(e.items[a])[l[d]],p=this.element.querySelectorAll("."+ne)[a],u=void 0;u=p&&!t.isNullOrUndefined(p.id)&&""!==p.id?this.getIndexFromEle(p.id):a;var f=t.select(".e-toolbar-items #e-item"+this.tabId+"_"+u,this.element),m=t.select(".e-content #e-content"+this.tabId+"_"+u,this.element);if("header"===l[d]||"headerTemplate"===l[d]){var g=t.isNullOrUndefined(this.items[a].header)||t.isNullOrUndefined(this.items[a].header.iconCss)?"":this.items[a].header.iconCss,v=this.items[a].headerTemplate||this.items[a].header.text;if("headerTemplate"===l[d]&&this.clearTabTemplate(f,l[d],ne),""===v&&""===g)this.removeTab(a);else{this.tbId=p.id;var y=[];y.push(this.items[a]),this.items.splice(a,1),this.itemIndexArray.splice(a,1),this.tbObj.items.splice(a,1);var b=f.classList.contains("e-hidden");t.detach(f),this.isReplace=!0,this.addTab(y,a),b&&this.hideTab(a),this.isReplace=!1}}if("content"===l[d]&&!t.isNullOrUndefined(m))if(("string"==typeof c||t.isNullOrUndefined(c.innerHTML))&&("."===c[0]||"#"===c[0])&&c.length){var C=document.querySelector(c);m.appendChild(C),C.style.display=""}else""===c&&"#"===h[0]?(document.body.appendChild(this.element.querySelector(h)).style.display="none",m.innerHTML=c):this.isAngular||this.isReact?(this.clearTabTemplate(m,l[d],"e-item"),m.innerHTML="",this.templateCompile(m,c,a)):"function"!=typeof c&&(m.innerHTML=c);"cssClass"===l[d]&&(t.isNullOrUndefined(f)||(f.classList.remove(h),f.classList.add(c)),t.isNullOrUndefined(m)||(m.classList.remove(h),m.classList.add(c))),"disabled"===l[d]&&this.enableTab(a,!0!==c),"visible"===l[d]&&this.hideTab(a,!0!==c)}this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){s.refreshActiveTabBorder()})}},i.prototype.clearTabTemplate=function(e,i,s){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[i])for(var n=this.registeredTemplate,r=0;r<n[i].length;r++){var o=n[i][r].rootNodes[0],a=t.closest(o,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],[n[i][r]]);break}}else if(this.portals&&this.portals.length>0)for(var l=this.portals,r=0;r<l.length;r++){var d=l[r],a=t.closest(d.containerInfo,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],r);break}}},i.prototype.initializeDrag=function(e){var i=this,s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+ne,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,r=i.getEleIndex(i.dragItem),o={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+ne),clonedElement:i.cloneElement,index:r};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||".e-tab-header"===i.dragArea){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+ie).style.visibility="hidden",i.cloneElement.classList.contains("e-hidden")&&t.removeClass([i.cloneElement],"e-hidden")):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],"e-hidden"),i.dragItem.classList.contains("e-hidden")&&t.removeClass([i.dragItem],"e-hidden"),i.dragItem.querySelector("."+ie).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var a=i.element.querySelector(".e-scroll-right-nav"),l=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(a)&&Math.abs(a.offsetWidth/2+a.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(l)&&Math.abs(l.offsetLeft+l.offsetWidth-i.cloneElement.offsetLeft)>l.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none",n=t.closest(e.target,".e-toolbar-item.e-draggable");var h=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(h=i.element.querySelector(".e-hscroll-content").offsetWidth),null!=n&&!n.isSameNode(i.dragItem)&&n.closest(".e-tab").isSameNode(i.dragItem.closest(".e-tab"))&&((s=i.getEleIndex(n))<r&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,r,s),s>r&&Math.abs(n.offsetWidth/2)+n.offsetLeft-h<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,r,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",o)}else i.trigger("dragging",o)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(s)},i.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),t.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector(".e-tab-header").classList.contains("e-close-show")&&t.addClass([this.cloneElement],"e-close-show"),t.removeClass([this.cloneElement.querySelector("."+ie)],"e-ripple"),t.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||t.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},i.prototype.itemDragStart=function(e){var i=this;this.draggingItems=this.items.map(function(e){return e}),this.dragItem=e.element;var s={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",s,function(s){if(s.cancel){var n=e.element.ej2_instances[0];t.isNullOrUndefined(n)||n.intDestroy(e.event),t.detach(i.cloneElement)}else i.removeActiveClass(),t.addClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.dragItem.querySelector("."+ie).style.visibility="hidden"})},i.prototype.dragAction=function(e,t,i){if(this.items.length>0){var s=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>i)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(e.parentElement.lastChild,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var n=e.parentElement.lastChild;if(e.isSameNode(n)){var r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(n,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},i.prototype.itemDragStop=function(e){var i=this;t.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+ie).style.visibility="visible",document.body.style.cursor="";var s={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",s,function(e){e.cancel?i.refresh():i.items.length>0&&i.draggingItems.length>0?(i.items=i.draggingItems,i.selectedItem=t.isNullOrUndefined(i.droppedIndex)?i.getEleIndex(i.dragItem):i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+ie).style.visibility="",t.removeClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.droppedIndex=t.isNullOrUndefined(i.droppedIndex)?i.getEleIndex(i.dragItem):i.droppedIndex,i.selectTab(i.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+ne,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove("e-disable","e-overlay"),s.firstElementChild.setAttribute("tabindex",s.firstElementChild.getAttribute("data-tabindex"))):(s.classList.add("e-disable","e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains("e-active")&&this.select(e+1)),t.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!i,this.dataBind()),s.firstElementChild.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};if(this.isReplace)this.addingTabContent(e,t);else{for(var n=0,r=e;n<r.length;n++){var o=r[n];o.disabled=o.disabled||!1,o.visible=o.visible||!0}this.trigger("adding",s,function(s){s.cancel||i.addingTabContent(e,t)})}this.isReact&&this.renderReactTemplates()},i.prototype.addingTabContent=function(e,i){var s=this,n=0;if(this.hdrEle=t.select(".e-tab-header",this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var r=Array.from(t.selectAll(".e-tab-header ."+ne,this.element)),o=r.length;if(0!==o&&(n=this.getMaxIndicesFromItems(r)+1),t.isNullOrUndefined(i)&&(i=o-1),o<i||i<0||isNaN(i))return;0!==o||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.tbItems=t.select("."+se,this.getTabHeader()),this.isAdd=!0;var a=this.parseObject(e,i);this.isAdd=!1;var l,d=0;e.forEach(function(e,r){if(l=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(l)||0===l.length&&!t.isNullOrUndefined(e.header)&&t.isNullOrUndefined(e.header.iconCss)||(a[r]&&(t.isNullOrUndefined(e.id)&&(e.id="e-item"+s.tabId+"_tabitem_"+(n+r).toString()),a[r].htmlAttributes["data-id"]=e.id),s.items.splice(i+d,0,e),d++),!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)&&(s.isTemplate||"Init"===s.loadOn)){var o=n+r,h=s.createElement("div",{id:"e-content"+s.tabId+"_"+o,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item_"+o}});s.cntEle.insertBefore(h,s.cntEle.children[i+r]);var c=s.getTrgContent(s.cntEle,o.toString());s.getContent(c,e.content,"render",i)}}),this.tbObj.addItems(a,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):(this.setActiveBorder(),this.tbItem=t.selectAll("."+ne,this.getTabHeader())),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+ne,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){var r=t.select("#e-item"+i.tabId+"_"+i.extIndex(s.id),t.select("."+se,i.element));t.isNullOrUndefined(r)||i.clearTabTemplate(r,"headerTemplate",ne),i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id));var o=i.itemIndexArray.indexOf(s.id);i.items.splice(o,1),i.itemIndexArray.splice(o,1),i.refreshActiveBorder();var a=t.select("#e-content"+i.tabId+"_"+i.extIndex(s.id),t.select(".e-content",i.element));t.isNullOrUndefined(a)||(i.clearTabTemplate(a,"content","e-item"),t.detach(a)),i.trigger("removed",n),i.draggableItems&&i.draggableItems.length>0&&(i.draggableItems[e].destroy(),i.draggableItems[e]=null,i.draggableItems.splice(e,1)),s.classList.contains("e-active")?(e=e>t.selectAll(".e-toolbar-item:not(.e-toolbar-popup)",i.element).length-1?e-1:e,i.enableAnimation=!1,i.tbItem=t.selectAll("."+ne,i.getTabHeader()),e=i.getSelectingTabIndex(e),e=!isNaN(e)&&e>=0&&i.tbItem.length>e?e:0,i.selectedItem=e,i.select(e)):e!==i.selectedItem&&(e<i.selectedItem&&(e=i.itemIndexArray.indexOf(i.tbItem[i.selectedItem].id),i.setProperties({selectedItem:e>-1?e:i.selectedItem},!0),i.prevIndex=i.selectedItem),i.tbItem=t.selectAll("."+ne,i.getTabHeader())),0===t.selectAll("."+ne,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+ne,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add("e-hidden"),!0===i)if(n.classList.add("e-hidden"),0!==(s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems)).length&&n.classList.contains("e-active")){if(0!==e)for(var r=e-1;r>=0;r--){if(!this.tbItem[r].classList.contains("e-hidden")){this.select(r);break}if(0===r)for(o=e+1;o<this.tbItem.length;o++)if(!this.tbItem[o].classList.contains("e-hidden")){this.select(o);break}}else for(var o=e+1;o<this.tbItem.length;o++)if(!this.tbItem[o].classList.contains("e-hidden")){this.select(o);break}}else 0===s.length&&this.element.classList.add("e-hidden");else this.element.classList.remove("e-hidden"),s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems),n.classList.remove("e-hidden"),0===s.length&&this.select(e);this.setActiveBorder(),t.isNullOrUndefined(this.items[e])||(this.items[e].visible=!i,this.dataBind()),t.isNullOrUndefined(n.firstElementChild)||n.firstElementChild.setAttribute("aria-hidden",""+i),"Popup"===this.overflowMode&&this.refreshOverflow()}},i.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1),this.isInteracted=i,this.select(e,t)},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+se,n),this.tbItem=t.selectAll("."+ne,n),this.content=t.select(".e-content",this.element),this.prevItem=this.tbItem[this.prevIndex],t.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var r=this.tbItem[e];t.isNullOrUndefined(r)?this.selectedID="0":this.selectingID=this.extIndex(r.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains("e-disable")||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex"));var o={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectedID,this.content),selectingItem:r,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",o,function(t){t.cancel||s.selectingContent(e,s.isInteracted)}),this.isInteracted=!1},i.prototype.getSelectingTabIndex=function(e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains("e-disable")||this.tbItem[e].classList.contains("e-hidden")))for(var i=e+1;i<this.items.length;i++){if(!1===this.items[i].disabled&&!0===this.items[i].visible){e=i;break}e=0}return e},i.prototype.selectingContent=function(e,i){if("number"==typeof e)if(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(re)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,i),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll(".e-toolbar-items ."+ne,this.hdrEle);var s=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,s);var n=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,n)}}else this.setActive(e,null,i);else this.setActive(0,null,i);else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,i)},i.prototype.getItemIndex=function(e){for(var t,i=0;i<this.tbItem.length;i++)if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}return t},i.prototype.disable=function(e){this.setCssClass(this.element,"e-disable",e),this.element.setAttribute("aria-disabled",""+e)},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},i.prototype.getModuleName=function(){return"tab"},i.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,r=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});n<r.length;n++)switch(r[n]){case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var o=this.element.querySelector(".e-tab-header");""===i.cssClass||t.isNullOrUndefined(i.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(o)||this.setCssClass(o,e.cssClass,!0)):(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(o)||(this.setCssClass(o,i.cssClass,!1),this.setCssClass(o,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=i.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+se),i=this.element.querySelector(".e-toolbar-item.e-active"),s=this.getIndexFromEle(i.id),n=i.innerText,r=this.element.querySelector(".e-content").querySelector(".e-active").children[0],o=r.innerHTML;t.detach(i),t.detach(r);var a={className:ne+" e-template e-active",id:"e-item"+this.tabId+"_"+s},l=this.createElement("span",{className:"e-tab-text",innerHTML:n,attrs:{role:"presentation"}}).outerHTML,d=this.createElement("div",{className:"e-text-wrap",innerHTML:l+this.btnCls.outerHTML}).outerHTML,h=i.firstElementChild.getAttribute("data-tabindex"),c=this.createElement("div",{className:ie,innerHTML:d,attrs:{tabIndex:h,"data-tabindex":h,role:"tab","aria-controls":"e-content"+this.tabId+"_"+s,"aria-selected":"true","aria-disabled":"false"}});e.insertBefore(this.createElement("div",a),e.children[s+1]),this.element.querySelector(".e-toolbar-item.e-active").appendChild(c);S=this.createElement("div",{innerHTML:o});this.element.querySelector(".e-content").querySelector(".e-active").appendChild(S)}else if(this.element.querySelector(".e-toolbar-item.e-active")){t.detach(this.element.querySelector(".e-toolbar-item.e-active").children[0]),t.detach(this.element.querySelector(".e-content").querySelector(".e-active").children[0]);var p=this.items[this.selectedItem],u=t.isNullOrUndefined(p.header)||t.isNullOrUndefined(p.header.iconPosition)?"":p.header.iconPosition,f=t.isNullOrUndefined(p.header)||t.isNullOrUndefined(p.header.iconCss)?"":p.header.iconCss,m=p.headerTemplate||p.header.text,g=this.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});t.isNullOrUndefined(m.tagName)?this.headerTextCompile(g,m,this.selectedItem):g.appendChild(m);var v=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+u+" "+f}),y=this.createElement("div",{className:"e-text-wrap"});y.appendChild(g),""!==m&&void 0!==m&&""!==f?("left"===u||"top"===u?y.insertBefore(v,y.firstElementChild):y.appendChild(v),g,this.isIconAlone=!1):(""===f?g:v)===v&&(t.detach(g),y.appendChild(v),this.isIconAlone=!0);var h=t.isNullOrUndefined(p.tabIndex)?"-1":p.tabIndex.toString(),b=p.disabled?{}:{tabIndex:h,"data-tabindex":h,role:"tab","aria-selected":"true","aria-disabled":"false"};y.appendChild(this.btnCls.cloneNode(!0));var C=this.createElement("div",{className:ie,attrs:b});C.appendChild(y),"top"!==u&&"bottom"!==u||this.element.classList.add("e-vertical-icon"),this.element.querySelector(".e-toolbar-item.e-active").appendChild(C);var S=this.createElement("div"),I=p.content,x=void 0;if("string"==typeof I||t.isNullOrUndefined(I.innerHTML))if("string"==typeof I&&this.enableHtmlSanitizer&&(I=t.SanitizeHtmlHelper.sanitize(I)),"."===I[0]||"#"===I[0])if(document.querySelectorAll(I).length){var E=document.querySelector(I);x=E.outerHTML.trim(),S.appendChild(E),E.style.display=""}else this.compileElement(S,I,"content",this.selectedItem);else this.compileElement(S,I,"content",this.selectedItem);else S.appendChild(I);t.isNullOrUndefined(x)||-1===this.templateEle.indexOf(I.toString())&&this.templateEle.push(I.toString()),this.element.querySelector(".e-item.e-active").appendChild(S)}this.isReact&&this.renderReactTemplates()},i.prototype.refreshActiveTabBorder=function(){var e=t.select(".e-toolbar-item.e-toolbar-popup.e-active",this.element);!t.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},ee([t.Collection([],de)],i.prototype,"items",void 0),ee([t.Property("100%")],i.prototype,"width",void 0),ee([t.Property("Both")],i.prototype,"swipeMode",void 0),ee([t.Property("auto")],i.prototype,"height",void 0),ee([t.Property("")],i.prototype,"cssClass",void 0),ee([t.Property(0)],i.prototype,"selectedItem",void 0),ee([t.Property("Top")],i.prototype,"headerPlacement",void 0),ee([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),ee([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),ee([t.Property("Demand")],i.prototype,"loadOn",void 0),ee([t.Property(!1)],i.prototype,"enablePersistence",void 0),ee([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),ee([t.Property(!1)],i.prototype,"showCloseButton",void 0),ee([t.Property(!0)],i.prototype,"reorderActiveTab",void 0),ee([t.Property()],i.prototype,"scrollStep",void 0),ee([t.Property()],i.prototype,"dragArea",void 0),ee([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),ee([t.Property(!0)],i.prototype,"clearTemplates",void 0),ee([t.Complex({},ae)],i.prototype,"animation",void 0),ee([t.Event()],i.prototype,"created",void 0),ee([t.Event()],i.prototype,"adding",void 0),ee([t.Event()],i.prototype,"added",void 0),ee([t.Event()],i.prototype,"selecting",void 0),ee([t.Event()],i.prototype,"selected",void 0),ee([t.Event()],i.prototype,"removing",void 0),ee([t.Event()],i.prototype,"removed",void 0),ee([t.Event()],i.prototype,"onDragStart",void 0),ee([t.Event()],i.prototype,"dragging",void 0),ee([t.Event()],i.prototype,"dragged",void 0),ee([t.Event()],i.prototype,"destroyed",void 0),i=ee([t.NotifyPropertyChanges],i)}(t.Component),ce=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)}}(),pe=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},ue="e-treeview",fe="e-icon-collapsible",me="e-icon-expandable",ge="e-list-item",ve="e-list-text",ye="e-list-parent",be="e-active",Ce="e-icons-spinner",Se="e-process",Ie="e-icons",xe="e-text-content",Ee="e-drop-in",Ne="e-drop-next",Oe="e-fullrow",we="e-disable",Le="e-check",ke="e-treeview-checkbox",Ae="e-node-focus",Te={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("child")],i.prototype,"child",void 0),pe([t.Property([])],i.prototype,"dataSource",void 0),pe([t.Property("expanded")],i.prototype,"expanded",void 0),pe([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),pe([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),pe([t.Property("iconCss")],i.prototype,"iconCss",void 0),pe([t.Property("id")],i.prototype,"id",void 0),pe([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),pe([t.Property("isChecked")],i.prototype,"isChecked",void 0),pe([t.Property("parentID")],i.prototype,"parentID",void 0),pe([t.Property(null)],i.prototype,"query",void 0),pe([t.Property("selectable")],i.prototype,"selectable",void 0),pe([t.Property("selected")],i.prototype,"selected",void 0),pe([t.Property(null)],i.prototype,"tableName",void 0),pe([t.Property("text")],i.prototype,"text",void 0),pe([t.Property("tooltip")],i.prototype,"tooltip",void 0),pe([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("SlideDown")],i.prototype,"effect",void 0),pe([t.Property(400)],i.prototype,"duration",void 0),pe([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},De)],i.prototype,"collapse",void 0),pe([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},De)],i.prototype,"expand",void 0),i}(t.ChildProperty),He=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.isRefreshed=!1,s.preventExpand=!1,s.checkedElement=[],s.disableNode=[],s.validArr=[],s.validNodes=[],s.expandChildren=[],s.isFieldChange=!1,s.changeDataSource=!1,s.hasTemplate=!1,s.isFirstRender=!1,s.isNodeDropped=!1,s.isInteracted=!1,s.isRightClick=!1,s.mouseDownStatus=!1,s.isDropIn=!1,s.OldCheckedData=[],s.isHiddenItem=!1,s}ce(a,e),l=a,a.prototype.getModuleName=function(){return"treeview"},a.prototype.preRender=function(){var e=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",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",ctrlA:"ctrl+A",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",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:me,ariaAttributes:Te,expandIconPosition:"Left",itemCreated:function(t){e.beforeNodeCreate(t)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new t.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),t.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),t.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),t.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},a.prototype.getPersistData=function(){var e=["selectedNodes","checkedNodes","expandedNodes"];return this.addOnPersist(e)},a.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},a.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},a.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add("e-disabled"),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove("e-disabled"),this.element.setAttribute("aria-disabled","false"))},a.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},a.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+xe+" > ."+Ie+",.e-input-group,.e-input, ."+ke};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+xe+" > ."+Ie,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},a.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},a.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},a.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},a.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof r.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(t){i.treeList.pop(),i.treeData=t.result,i.isNumberTypeId=i.getType(),i.setRootData(),e&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),t.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},a.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,o=[];if(e.query)n=e.query.clone();else{n=new r.Query;for(var a=this.getActualProperties(e),l=0,d=Object.keys(a);l<d.length;l++){var h=d[l];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[""+h]&&"url"!==h&&-1===o.indexOf(e[""+h])&&o.push(e[""+h])}n.select(o),Object.prototype.hasOwnProperty.call(a,"tableName")&&n.from(e.tableName)}return i.ListBase.addSorting(this.sortOrder,e.text,n),t.isNullOrUndefined(s)||t.isNullOrUndefined(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(s):s),n},a.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},a.prototype.setRootData=function(){if(this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType){this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID);var e=this.getChildNodes(this.treeData,void 0,!0);t.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e}else this.rootData=this.treeData},a.prototype.isChildObject=function(){return"object"==typeof this.fields.child},a.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var s=this.getSortedData(this.rootData);this.ulElement=i.ListBase.createList(this.createElement,e?this.rootData:s,this.listBaseOption),this.element.appendChild(this.ulElement);var n=this.ulElement.querySelectorAll(".e-list-item");if(!1===this.loadOnDemand)for(var r=0;r<n.length;)this.renderChildNodes(n[parseInt(r.toString(),10)],!0,null,!0),r++;(1===t.selectAll("."+ye,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},a.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,i=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.isChecked,"equal",!0,!1)),s=0;s<i.length;s++){var n=i[parseInt(s.toString(),10)][this.fields.id]?i[parseInt(s.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(n)||this.isLoaded||this.checkDisabledState(n,i[s]),i[parseInt(s.toString(),10)][this.fields.hasChildren])for(var o=i[parseInt(s.toString(),10)][this.fields.id],a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.parentID,"equal",o,!1)),l=0;l<a.length;l++){var d=a[parseInt(l.toString(),10)][this.fields.id]?a[parseInt(l.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(d)&&this.autoCheck&&this.checkDisabledState(d,a[l])}}for(s=0;s<this.checkedNodes.length;s++){var h=this.fields,c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(h.id,"equal",this.checkedNodes[parseInt(s.toString(),10)],!0));if(c[0]&&this.autoCheck&&(this.getCheckedNodeDetails(h,c),this.checkIndeterminateState(c[0])),c.length>0){f=c[0][this.fields.id]?c[0][this.fields.id].toString():null;this.checkedNodes.indexOf(f)>-1&&-1===this.validNodes.indexOf(f)&&this.validNodes.push(f)}for(var p=new r.DataManager(this.treeData).executeLocal((new r.Query).where(h.parentID,"equal",this.checkedNodes[parseInt(s.toString(),10)],!0)),u=0;u<p.length;u++){var f=p[parseInt(u.toString(),10)][this.fields.id]?p[parseInt(u.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(f)&&this.autoCheck&&this.checkDisabledState(f,p[u]),this.checkedNodes.indexOf(f)>-1&&-1===this.validNodes.indexOf(f)&&this.validNodes.push(f)}}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline){for(u=0;u<this.treeData.length;u++){var m=this.treeData[parseInt(u.toString(),10)][this.fields.id]?this.treeData[parseInt(u.toString(),10)][this.fields.id].toString():"";this.treeData[parseInt(u.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(m)&&this.checkDisabledState(m,this.treeData[u]),this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m);var g=t.getValue(this.fields.child.toString(),this.treeData[parseInt(u.toString(),10)]);g&&this.updateChildCheckState(g,this.treeData[parseInt(u.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},a.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,o=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),a=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(o||a)a&&(t.select("."+Le,a)||this.changeState(a,"indeterminate",null,!0,!0));else{-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var l=this.getChildNodes(this.treeData,s),d=0;d<l.length;d++){var h=l[parseInt(d.toString(),10)][this.fields.id]?l[parseInt(d.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===l.length&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s)}var c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},a.prototype.updateParentCheckState=function(){var e,i=t.selectAll(".e-stop",this.element),s=this.treeData;this.element.classList.contains("e-filtering")&&(s=this.DDTTreeData);for(var n=0;n<i.length;n++){var o=t.closest(i[parseInt(n.toString(),10)],"."+ge),a=o.getAttribute("data-uid").toString(),l=void 0;this.element.classList.contains("e-filtering")&&(l=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("parentID","equal",a,!0)));var d=0;if(e=1===this.dataType?new r.DataManager(s).executeLocal((new r.Query).where(this.fields.parentID,"equal",a,!0)):this.getChildNodes(s,a)){for(var h=this,c=0;c<e.length;c++)!function(t){var i=e[parseInt(t.toString(),10)][h.fields.id].toString();-1!==h.checkedNodes.indexOf(i)?d++:h.element.classList.contains("e-filtering")&&-1!==l.findIndex(function(e){return e.id===i})&&d++}(c);if(d===e.length){var p=o.getAttribute("data-uid");-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p),this.changeState(o,"check",null,!0,!0)}else 0===d&&0===this.checkedNodes.length&&this.changeState(o,"uncheck",null,!0,!0)}}},a.prototype.checkIndeterminateState=function(e){var t;(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]'))?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},a.prototype.updateChildCheckState=function(e,i){for(var s=0,n=i[this.fields.id]?i[this.fields.id].toString():"",r=0;r<e.length;r++){var o=e[parseInt(r.toString(),10)][this.fields.id]?e[parseInt(r.toString(),10)][this.fields.id].toString():"";e[parseInt(r.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(o)&&this.checkDisabledState(o,e[r]),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.autoCheck&&this.checkDisabledState(o,e[r]),-1!==this.checkedNodes.indexOf(o)&&this.autoCheck&&s++,this.checkedNodes.indexOf(o)>-1&&-1===this.validNodes.indexOf(o)&&this.validNodes.push(o);var a=t.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]);a&&a.length&&(-1===this.parentCheckData.indexOf(i)&&this.parentCheckData.push(i),this.updateChildCheckState(a,e[parseInt(r.toString(),10)])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkDisabledState(n,i)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var l=0;l<this.parentCheckData.length;l++)i!==this.parentCheckData[parseInt(l.toString(),10)]&&this.parentCheckData[parseInt(l.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(l.toString(),10)])}this.parentCheckData=[]},a.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.classList.add(ke);var s=t.select("div."+me+", div."+fe,e.item),r=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var o=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(r)>-1?(t.select(".e-frame",i).classList.add(Le),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(o)||"true"!==o.toString()?e.item.setAttribute("aria-checked","false"):(t.select(".e-frame",i).classList.add(Le),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item));var a=t.select(".e-frame",i);t.EventHandler.add(a,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(a,"mouseup",this.frameMouseHandler,this)}this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains("e-selected")&&e.item.setAttribute("aria-selected","false");var l=e.fields;if(this.addActionClass(e,l.selected,"e-selected"),this.addActionClass(e,l.expanded,"e-expanded"),e.item.setAttribute("tabindex","-1"),t.EventHandler.add(e.item,"focus",this.focusIn,this),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+ve),h=e.item.getAttribute("data-uid");d.innerHTML="",this.renderNodeTemplate(e.curData,d,h)}var c={node:e.item,nodeData:e.curData,text:e.text};this.isRefreshed||(this.trigger("drawNode",c),!1!==e.curData[this.fields.selectable]||this.showCheckBox||(e.item.classList.add("e-prevent"),e.item.firstElementChild.setAttribute("style","cursor: not-allowed")))},a.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},a.prototype.addActionClass=function(e,i,s){var n=e.curData,r=t.getValue(i,n);t.isNullOrUndefined(r)||"false"===r.toString()||e.item.classList.add(s)},a.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof r.DataManager){for(s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[parseInt(s.toString(),10)])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)])))return 1;return 2}for(var s=0,n=e.length;s<n;s++){if("string"==typeof i.child&&(!t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(s.toString(),10)],i.child)))return 2;if(this.isChildObject())return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[parseInt(s.toString(),10)]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[parseInt(s.toString(),10)])))return 1}return 1},a.prototype.getGroupedData=function(e,t){for(var s=(new r.Query).group(t),n=i.ListBase.getDataSource(e,s),o=[],a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].items;o.push(l)}return o},a.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},a.prototype.finalizeNode=function(e,i,s){var n=this;if(i||this.updateAttributes(e),!s){var o=t.selectAll(".e-expanded",e);if(!this.loadOnDemand&&this.fields.dataSource instanceof r.DataManager&&(this.isInitalExpand=this.treeData.filter(function(e){return!0===e[n.fields.expanded]}).length>0||this.isInitalExpand),!this.isInitalExpand)for(var a=0;a<o.length;a++)this.renderChildNodes(o[parseInt(a.toString(),10)]);t.removeClass(o,"e-expanded")}i||this.updateList(),this.isLoaded&&this.updateCheckedProp()},a.prototype.updateAttributes=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[parseInt(s.toString(),10)].setAttribute("alt","e-list-img");if(this.isLoaded){for(var n=t.selectAll(".e-selected",e),r=0;r<n.length;r++){this.selectNode(n[parseInt(r.toString(),10)],null);break}t.removeClass(n,"e-selected")}for(var o=t.selectAll(".e-list-item:not(.e-expanded)",e),a=0;a<o.length;a++){var l=t.select("div."+Ie,o[parseInt(a.toString(),10)]);l&&l.classList.contains(me)&&this.disableExpandAttr(o[parseInt(a.toString(),10)])}},a.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},a.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[parseInt(i.toString(),10)].classList.contains(ge)&&(t.select("."+ye,e[parseInt(i.toString(),10)])?this.ensureParentCheckState(e[parseInt(i.toString(),10)]):this.ensureChildCheckState(e[parseInt(i.toString(),10)]));else for(var s=t.selectAll(".e-stop",this.element),i=0;i<s.length;i++)s[parseInt(i.toString(),10)].classList.remove("e-stop")},a.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(ue))return;var i=e;e.classList.contains(ge)&&(i=t.select("."+ye,e));var s=t.selectAll("."+ke+" ."+Le,i),n=t.selectAll(".e-stop",i),o=t.selectAll(this.checkDisabledChildren?"."+ge:".e-list-item:not(.e-disable)",i),a=e.getElementsByClassName(ke)[0],l=o.length,d=s.length,h=[],c=[],p=e.getAttribute("data-uid"),u=!0,f=!1;o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?f=!0:u=!1)});var m=!1;if(this.element.classList.contains("e-filtering")){d=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("parentID","equal",p,!0)).length;var g=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("hasChildren","equal",!0,!0));g.length>0&&this.OldCheckedData.some(function(e){return e.id===p})&&f&&(d=g.length,m=!0);l=(1===this.dataType?new r.DataManager(this.DDTTreeData).executeLocal((new r.Query).where(this.fields.parentID,"equal",p,!0)):this.getChildNodes(this.DDTTreeData,p)).length}if(!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof r.DataManager||(h=this.getSelectedChildNodeDetails(p),c=new r.DataManager(this.checkActionNodes).executeLocal((new r.Query).where("parentID","equal",p,!0))),0===l&&0===d)return;l===d||m&&l>0&&c.length===h.length&&0!==c.length&&0!==h.length&&u&&this.autoCheck&&this.showCheckBox?this.changeState(a,"check",null,!0,!0):d>0&&!m&&this.autoCheck&&this.showCheckBox?this.changeState(a,"indeterminate",null,!0,!0):d>0||n.length>0?this.changeState(a,"indeterminate",null,!0,!0):0===d&&this.changeState(a,"uncheck",null,!0,!0);var v=t.closest(e,"."+ye);if(!t.isNullOrUndefined(v)){var y=t.closest(v,"."+ge);this.ensureParentCheckState(y)}}},a.prototype.getSelectedChildNodeDetails=function(e){var i=this;return this.checkedNodes.map(function(e){return new r.DataManager(i.DDTTreeData).executeLocal((new r.Query).where("id","equal",e,!0))[0]}).filter(function(i){if(i&&"object"==typeof i&&"pid"in i){var s=i.pid;if(!t.isNullOrUndefined(s))return s.toString()===e}return!1})},a.prototype.ensureChildCheckState=function(e,i,s){var n=this;if(!t.isNullOrUndefined(e)){var r=t.select("."+ye,e),o=void 0;if(!t.isNullOrUndefined(r)){var a=Array.from(r.querySelectorAll("li"));o=t.selectAll("."+ke,r),this.isFilter&&(o=Array.from(o).filter(function(e){var t=e.closest("li").getAttribute("data-uid");return null!==t&&-1!==n.checkedNodes.indexOf(t)}),a=Array.from(a).filter(function(e){var t=e.getAttribute("data-uid");return null!==t&&-1!==n.checkedNodes.indexOf(t)}),0===o.length&&(o=t.selectAll("."+ke,r),a=Array.from(r.querySelectorAll("li"))));for(var l=e.getElementsByClassName("e-frame")[0].classList.contains(Le),d=e.getElementsByClassName("e-frame")[0].classList.contains("e-stop"),h=void 0,c=0;c<o.length;c++){var p=a[parseInt(c.toString(),10)].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[parseInt(c.toString(),10)]))){var u=o[parseInt(c.toString(),10)].getElementsByClassName("e-frame")[0].classList.contains(Le);l?h="check":u&&!this.isLoaded?h="check":-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(d||l)?h="check":a[parseInt(c.toString(),10)].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||d)&&-1!==this.parentNodeCheck.indexOf(p)?(h="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||d)&&-1!==this.parentNodeCheck.indexOf(p)?(h="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):h="uncheck"}else h=t.getValue(this.fields.isChecked,this.currentLoadData[parseInt(c.toString(),10)])?"check":"uncheck",-1!==this.ele&&(h=l?"check":"uncheck"),"uncheck"===h&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),h="indeterminate");this.changeState(o[parseInt(c.toString(),10)],h,i,!0,!0)}}this.autoCheck&&this.isLoaded&&!s&&this.updateParentCheckState()}},a.prototype.doCheckBoxAction=function(e,i){if(t.isNullOrUndefined(e)){var s=t.selectAll("."+ke,this.element);if(this.loadOnDemand)for(n=0;n<s.length;n++)this.updateFieldChecked(s[parseInt(n.toString(),10)],i),this.changeState(s[parseInt(n.toString(),10)],i?"check":"uncheck",null,null,null,i);else for(var n=0;n<s.length;n++)this.updateFieldChecked(s[parseInt(n.toString(),10)],i),this.changeState(s[parseInt(n.toString(),10)],i?"check":"uncheck")}else{e.reverse();for(var r=e.length-1;r>=0;r--){var o=this.getElement(e[parseInt(r.toString(),10)]);if(t.isNullOrUndefined(o)){if(""!==(u=e[r-e.length]?e[r-e.length].toString():e[parseInt(r.toString(),10)]?e[parseInt(r.toString(),10)].toString():null)&&i&&u)this.setValidCheckedNode(u,e),this.dynamicCheckState(u,i);else if(-1!==this.checkedNodes.indexOf(u)&&""!==u&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(u),1);var a=this.getChildNodes(this.treeData,u);if(a){for(var l=0;l<a.length;l++){var d=a[parseInt(l.toString(),10)][this.fields.id]?a[parseInt(l.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(d)){this.checkedNodes.splice(this.checkedNodes.indexOf(d),1);var h=this.element.querySelector('[data-uid="'+d+'"]');h&&this.changeState(h,"uncheck",null)}}-1!==this.parentNodeCheck.indexOf(u)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(u),1)}u&&this.dynamicCheckState(u,i),this.updateField(this.treeData,this.fields,u,"isChecked",null)}}else{var c=t.select(".e-list-parent ."+ke,o);this.validateCheckNode(c,!i,o,null)}}}if(e)for(var p=0;p<e.length-1;p++){var u=e[parseInt(p.toString(),10)]?e[parseInt(p.toString(),10)].toString():"";i||this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},a.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+ge),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},a.prototype.dynamicCheckState=function(e,i){if(1===this.dataType){var s=0,n=new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var o=n[0][this.fields.id]?n[0][this.fields.id].toString():null,a=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,l=this.element.querySelector('[data-uid="'+a+'"]'),d=this.element.querySelector('[data-uid="'+o+'"]'),h=this.getChildNodes(this.treeData,a);if(h)for(u=0;u<h.length;u++){var c=h[parseInt(u.toString(),10)][this.fields.id]?h[parseInt(u.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(c)&&s++}-1!==this.checkedNodes.indexOf(e)&&l&&o===e&&this.autoCheck?this.changeState(l,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&o===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&o===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&l&&o===e&&this.autoCheck&&0!==s?this.changeState(l,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&l&&o===e&&this.autoCheck&&0===s?this.changeState(l,"uncheck",null):d||l||o!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(var o=void 0,l=void 0,p=void 0,u=0;u<this.treeData.length;u++){o=this.treeData[parseInt(u.toString(),10)][this.fields.id]?this.treeData[parseInt(u.toString(),10)][this.fields.id].toString():"",p=(l=this.element.querySelector('[data-uid="'+o+'"]'))?t.select("."+Le,l):null,-1===this.checkedNodes.indexOf(o)&&l&&p&&!i&&this.changeState(l,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[parseInt(u.toString(),10)]);f&&this.updateChildIndeterminate(f,o,e,i,o)}},a.prototype.updateIndeterminate=function(e,t){var i,s=this.getTreeData(e),n=0;1===this.dataType&&(i=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null);var r=this.getChildNodes(this.treeData,i);if(r)for(var o=0;o<r.length;o++){var a=r[parseInt(o.toString(),10)][this.fields.id]?r[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(a)&&n++}var l=this.element.querySelector('[data-uid="'+i+'"]');l&&t?this.changeState(l,"indeterminate",null):!t&&l&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(l,"indeterminate",null):!t&&l&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(l,"uncheck",null):l||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)?this.parentNodeCheck.push(i):t||-1===this.checkedNodes.indexOf(i)||-1!==this.parentNodeCheck.indexOf(i)||0===n||this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1))},a.prototype.updateChildIndeterminate=function(e,i,s,n,r){for(var o=0,a=0;a<e.length;a++){var l=e[parseInt(a.toString(),10)][this.fields.id]?e[parseInt(a.toString(),10)][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(l)&&o++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+Le,d):null,p=this.element.querySelector('[data-uid="'+l+'"]'),u=p?t.select("."+Le,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&l===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||l!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&l===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&l===s&&this.autoCheck&&0===o&&!n)h.classList.remove("e-stop");else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&l===s&&0===o)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(l)&&p&&u&&0===o)this.changeState(p,"uncheck",null);else if(!p&&!d&&l===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+r+'"]');n&&0!==o?this.changeState(f,"indeterminate",null):n&&o===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkDisabledState(i):n||0!==o||-1===this.parentNodeCheck.indexOf(i)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i)),-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i)}}else this.autoCheck?this.changeState(d,"uncheck",null):0!==o?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[parseInt(a.toString(),10)]);m&&this.updateChildIndeterminate(m,l,s,n,r)}},a.prototype.changeState=function(e,i,s,n,r,o){var a,l=this,d=t.closest(e,"."+ge);!this.checkDisabledChildren&&d&&(d.classList.contains(we)||this.disableNode&&-1!==this.disableNode.indexOf(d.getAttribute("data-uid")))||(e===d&&(e=t.select("."+ke,d)),n?this.nodeCheckAction(e,i,d,a,s,n,r,o):(this.checkActionNodes=[],a=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",a,function(t){t.cancel||l.nodeCheckAction(e,i,d,t,s,n,r,o)})))},a.prototype.nodeCheckAction=function(e,i,s,n,r,o,a,l){var d,h=e.getElementsByClassName("e-frame")[0];if("check"!==i||h.classList.contains(Le)?"uncheck"===i&&(h.classList.contains(Le)||h.classList.contains("e-stop"))?(t.removeClass([h],[Le,"e-stop"]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(Le),h.classList.add("e-stop"),this.removeCheck(s),d="mixed"):(h.classList.remove("e-stop"),h.classList.add(Le),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||s.setAttribute("aria-checked",d),a){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,r),t.isUndefined(o)&&(n.data=c)}void 0!==l&&this.ensureStateChange(s,l),o||t.isNullOrUndefined(d)||(s.setAttribute("aria-checked",d),n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},a.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkDisabledState(i)},a.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},a.prototype.getCheckEvent=function(e,i,s){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,data:n}},a.prototype.finalize=function(){var e=t.select("."+ye,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",Te.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+ge,this.element);i&&(i.setAttribute("tabindex","0"),this.updateIdAttr(null,i)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction()}},a.prototype.setTextWrap=function(){(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-text-wrap"),t.Browser.isIE&&(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-ie-wrap")},a.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var i=e?t.selectAll("."+ge,e):this.liList,s=i.length,n=0;n<s;n++)this.calculateWrap(i[parseInt(n.toString(),10)])},a.prototype.calculateWrap=function(e){var i=t.select("."+Oe,e);i&&i.nextElementSibling&&(i.style.height=this.allowTextWrap?i.nextElementSibling.offsetHeight+"px":"")},a.prototype.doExpandAction=function(){var e=this,i=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof r.DataManager&&(this.isInitalExpand=this.treeData.filter(function(t){return!0===t[e.fields.expanded]}).length>0||this.isInitalExpand),this.isInitalExpand&&i.length>0)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof r.DataManager)this.expandGivenNodes(i);else{for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[parseInt(s.toString(),10)]+'"]',this.element);if(t.isNullOrUndefined(n))i[parseInt(s.toString(),10)]&&-1===this.expandChildren.indexOf(i[parseInt(s.toString(),10)])&&this.expandChildren.push(i[parseInt(s.toString(),10)].toString());else{var o=t.select("."+me,t.select("."+xe,n));t.isNullOrUndefined(o)||this.expandAction(n,o,null)}}this.afterFinalized()}else this.afterFinalized()},a.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){++t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),this.index>0&&(this.index=0)},a.prototype.expandCallback=function(e,i){var s=t.select('[data-uid="'+e+'"]',this.element);if(t.isNullOrUndefined(s))i();else{var n=t.select("."+me,t.select("."+xe,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null,!1,i),i()}},a.prototype.afterFinalized=function(){if(this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,(!this.isLoaded||this.isFieldChange)&&!this.isNodeDropped){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0,this.isNodeDropped=!1},a.prototype.doSelectionAction=function(){var e=t.selectAll(".e-selected",this.element),i=this.selectedNodes;if(i.length>0){this.setProperties({selectedNodes:[]},!0);for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[parseInt(s.toString(),10)]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[parseInt(s.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,"e-selected")},a.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},a.prototype.clickHandler=function(e){var i=t.Browser.isDevice&&e.originalEvent.changedTouches&&!t.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+ge);if(n&&(!n.classList.contains("e-prevent")||s.contains(me)||s.contains(fe))){if(3!==e.originalEvent.which){var r=t.select(".e-ripple-element",n),o=t.select("."+Ie,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var a=t.closest(i,"."+ke);if(!t.isNullOrUndefined(a)){var l=t.select(".e-frame",a);return this.validateCheckNode(a,l.classList.contains(Le),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(me)?this.expandAction(n,i,e):s.contains(fe)?this.collapseNode(n,i,e):r&&o?o.classList.contains("e-ripple")&&o.classList.contains(me)?this.expandAction(n,o,e):o.classList.contains("e-ripple")&&o.classList.contains(fe)?this.collapseNode(n,o,e):s.contains(ye)||s.contains(ge)||this.toggleSelect(n,e.originalEvent,!1):s.contains(ye)||s.contains(ge)||this.toggleSelect(n,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,n)}}},a.prototype.nodeCheckedEvent=function(e,t,i){var s=this.getCheckEvent(e,t?"uncheck":"check",i);s.data=s.data.splice(0,s.data.length-1),this.trigger("nodeChecked",s)},a.prototype.updateOldCheckedData=function(e){var t=this,i=new r.DataManager(e),s=i.executeLocal((new r.Query).where("isChecked","equal","true",!0)),n=i.executeLocal((new r.Query).where("isChecked","equal","false",!0));if(n.length>0&&-1!==(a=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id}))){this.OldCheckedData.splice(a,1);var o=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id});return void(o.length>0&&o.forEach(function(e){var i=t.OldCheckedData.findIndex(function(t){return t.id===e.id});-1!==i&&t.OldCheckedData.splice(i,1)}))}if(s.length>0){var a=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id});if(-1===a)return void this.OldCheckedData.push(s[0])}},a.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},a.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Ce)&&this.hideSpinner(i),this.initialRender||i.classList.add("interaction"),!0!==s||!0===s&&e.classList.contains("e-expanded")){if(!0!==this.preventExpand){t.removeClass([i],me),t.addClass([i],fe);var o=0,a=0,l=t.select("."+ye,e),d=e;if(this.isAnimate&&!this.isRefreshed){this.setHeight(d,l);var h=t.select(".e-list-item."+be,e);this.aniObj.animate(l,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===t.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add("e-animation-active"),o=d.offsetHeight,a=t.select("."+xe,e).offsetHeight},progress:function(e){e.element.style.display="block",n.animateHeight(e,o,a)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove("e-animation-active"),n.expandedNode(d,l,i)}})}else this.expandedNode(d,l,i)}}else t.select("."+ye,e).style.display="none",this.fields.dataSource instanceof r.DataManager==!0&&(this.preventExpand=!1);this.initialRender&&i.classList.add("interaction")},a.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Se),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},a.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),t.removeClass([e],"e-node-collapsed");var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.expandedNodes.indexOf(i)||this.expandedNodes.push(i)},a.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Se)){t.addClass([i],Se);var r;this.isLoaded?(r=this.getExpandEvent(e,s),this.isInteracted=r.isInteracted,this.trigger("nodeCollapsing",r,function(s){s.cancel?t.removeClass([i],Se):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,r)}},a.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],fe),t.addClass([i],me);var r=0,o=0,a=t.select("."+ye,e),l=e,d=t.select(".e-list-item."+be,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===t.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){l.style.overflow="hidden",!t.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add("e-animation-active"),r=t.select("."+xe,e).offsetHeight,o=l.offsetHeight},progress:function(e){n.animateHeight(e,r,o)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove("e-animation-active"),n.collapsedNode(l,a,i,s)}}):this.collapsedNode(l,a,i,s)},a.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Se),this.removeExpand(e),this.isLoaded&&((n=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",n))},a.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);var i=this.expandedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.expandedNodes.splice(i,1)},a.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],"e-node-collapsed")},a.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},a.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},a.prototype.renderChildNodes=function(e,s,n,o,a){var l=this,d=t.select("div."+Ie,e);if(!t.isNullOrUndefined(d)){this.showSpinner(d);var h;if(this.fields.dataSource instanceof r.DataManager){var c=this.parents(e,"."+ye).length,p=this.getChildFields(this.fields,c,1);if(t.isNullOrUndefined(p)||t.isNullOrUndefined(p.dataSource))return t.detach(d),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager&&this.isOffline?(this.treeList.pop(),h=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(h,p,d,e,s,n,o)):p.dataSource.executeQuery(this.getQuery(p,e.getAttribute("data-uid"))).then(function(t){l.treeList.pop(),h=t.result,1===l.dataType&&(l.dataType=2),l.loadChild(h,p,d,e,s,n,o)}).catch(function(e){l.trigger("actionFailure",{error:e})})}else{if(h=this.getChildNodes(this.treeData,e.getAttribute("data-uid"),!1,parseFloat(e.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(h),t.isNullOrUndefined(h)||0===h.length)return t.detach(d),d.classList.contains(Ce)&&this.hideSpinner(d),void this.removeExpand(e,!0);this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(e,d,o),this.setSelectionForChildNodes(h),this.ensureCheckNode(e,a),this.finalizeNode(e,a,s),this.disableTreeNodes(h),this.renderSubChild(e,s,o,a)}}},a.prototype.loadChild=function(e,s,n,o,a,l,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(o,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof r.DataManager&&!this.isOffline){var h=o.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(o.getAttribute("aria-level"))+1,o.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(o,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(o),this.finalizeNode(o),this.disableTreeNodes(e),this.renderSubChild(o,a,d)}l&&l(),a&&this.expandedNodes.push(o.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},a.prototype.disableTreeNodes=function(e){if(!t.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var i=0;i<e.length;){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(s)&&this.doDisableAction([s]),i++}},a.prototype.setSelectionForChildNodes=function(e){if(!t.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length){var i;for(i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(s)&&this.doSelectionAction()}}},a.prototype.ensureCheckNode=function(e,i){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e,null,i),(!i||(t.select("."+Le,this.element)||t.select(".e-stop",this.element)))&&this.ensureParentCheckState(e))),this.currentLoadData=null},a.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},a.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},a.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},a.prototype.getChildNodes=function(e,i,s,n){var r=this;void 0===s&&(s=!1);var o;if(t.isNullOrUndefined(e))return o;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,i)||this.findNestedChildNodes(e,i,n)||[];if(this.isChildObject()){for(var a=t.isNullOrUndefined(n)?this.fields.child:this.fields,l=1;l<n&&!t.isNullOrUndefined(a.child);)a=a.child,l++;this.updateListProp(a);var d=e.findIndex(function(e){return t.getValue(r.fields.id,e)&&t.getValue(r.fields.id,e).toString()===i});if(-1!==d)return t.getValue("child",e[parseInt(d.toString(),10)]);if(-1===d)for(var h=0,c=e.length;h<c;h++){var p=t.getValue("child",e[parseInt(h.toString(),10)]),u=t.isNullOrUndefined(p)?-1:p.findIndex(function(e){return t.getValue(r.fields.child.id,e)&&t.getValue(r.fields.child.id,e).toString()===i});if(-1!==u)return t.getValue("child",p[parseInt(u.toString(),10)]);if(!t.isNullOrUndefined(p)&&void 0!==(o=this.getChildNodes(p,i,!1,n)))break}}return o},a.prototype.findChildNodes=function(e,i,s){var n=e.findIndex(function(e){var n=t.getValue(i,e);return n&&n.toString()===s});return-1!==n?t.getValue(this.fields.child,e[n]):null},a.prototype.findNestedChildNodes=function(e,i,s){for(var n=0,r=e;n<r.length;n++){var o=r[n],a=t.getValue(this.fields.child,o);if(!t.isNullOrUndefined(a)){var l=this.findChildNodes(a,this.fields.id,i);if(l)return l;var d=this.getChildNodes(a,i,!1,s);if(d&&d.length>0)return d}}},a.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++){if(t.isNullOrUndefined(e[parseInt(n.toString(),10)][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0])))return s?e[parseInt(n.toString(),10)]:[];if(t.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]).toString()===i)return e[parseInt(n.toString(),10)]}},a.prototype.renderSubChild=function(e,i,s,n){if(i)for(var r=t.selectAll("."+me,e),o=0,a=r.length;o<a;o++){var l=r[parseInt(o.toString(),10)];if(e.querySelector(".e-icons")!==r[parseInt(o.toString(),10)]){var d=t.closest(l,"."+ge);this.expandArgs=this.getExpandEvent(d,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(d,i,null,s,n)}}},a.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},a.prototype.isActive=function(e){return!!e.classList.contains(be)},a.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))return void this.setFocusElement(e);var r;this.isLoaded?(r=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",r,function(t){t.cancel||t.node.classList.contains("e-prevent")||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,r,s)},a.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey||i.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var r=this.liList.indexOf(this.startNode),o=this.liList.indexOf(e);if(r>o){var a=r;r=o,o=a}for(var l=r;l<=o;l++){var d=this.liList[parseInt(l.toString(),10)];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s),this.isRightClick=!1),this.isRightClick=!1},a.prototype.unselectNode=function(e,t){var i,s=this;this.isLoaded?(i=this.getSelectEvent(e,"un-select",t),this.trigger("nodeSelecting",i,function(t){t.cancel||s.nodeUnselectAction(e,t)})):this.nodeUnselectAction(e,i)},a.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},a.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&(t.removeClass([i],Ae),i.setAttribute("tabindex","-1")),t.addClass([e],Ae),e.setAttribute("tabindex","0"),t.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(i,e)}},a.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],be);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},a.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],be);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},a.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+be),i=0,s=e;i<s.length;i++){var n=s[i];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}t.removeClass(e,be),this.setProperties({selectedNodes:[]},!0)},a.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},a.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},a.prototype.expandHandler=function(e){var i=t.Browser.isDevice&&e.originalEvent.changedTouches&&!t.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ge)||i.classList.contains(Ie)||this.showCheckBox&&t.closest(i,"."+ke)||this.expandCollapseAction(t.closest(i,"."+ge),e)},a.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+Ie,e);if(s&&!s.classList.contains(Se)){var n=s.classList;n.contains(me)?this.expandAction(e,s,i):n.contains(fe)&&this.collapseNode(e,s,i)}},a.prototype.expandAction=function(e,i,s,n,r,o){var a=this;i.classList.contains(Se)||(t.addClass([i],Se),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Se):a.nodeExpandAction(e,i,n,r,o)})):this.nodeExpandAction(e,i,n,r,o))},a.prototype.nodeExpandAction=function(e,i,s,n,r){var o=t.select("."+ye,e);if(o&&"UL"===o.nodeName)this.expandNode(e,i);else{this.isFirstRender=!0,this.renderChildNodes(e,s,n,null,r);for(var a=t.selectAll("."+ge,e),l=0;l<a.length;l++){var d=this.getId(a[parseInt(l.toString(),10)]);if(-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren){var h=t.select("."+me,t.select("."+xe,a[parseInt(l.toString(),10)]));t.isNullOrUndefined(h)||this.expandAction(a[parseInt(l.toString(),10)],h,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1)}}}},a.prototype.keyActionHandler=function(e){var i=this,s=e.target,n=this.getFocusedNode();if(s&&s.classList.contains("e-input")){var r=s;return void("enter"===e.action?r.blur():"escape"===e.action&&(r.value=this.oldText,r.blur()))}e.preventDefault();var o={cancel:!1,event:e,node:n};this.trigger("keyPress",o,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox?i.checkNode(e):i.toggleSelect(n,e);break;case"moveRight":i.openNode(!i.enableRtl,e);break;case"moveLeft":i.openNode(!!i.enableRtl,e);break;case"shiftDown":i.shiftKeySelect(!0,e);break;case"moveDown":case"ctrlDown":case"csDown":i.navigateNode(!0);break;case"shiftUp":i.shiftKeySelect(!1,e);break;case"moveUp":case"ctrlUp":case"csUp":i.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":i.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":i.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n);break;case"ctrlA":if(i.allowMultiSelection){var r=t.selectAll(".e-list-item:not(.e-active)",i.element);i.selectGivenNodes(r)}}})},a.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+xe),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var r=n.getBoundingClientRect();s.bottom>r.bottom?n.scrollTop+=s.bottom-r.bottom:s.top<r.top&&(n.scrollTop-=r.top-s.top)}this.isVisibleInViewport(i)||i.scrollIntoView(e)},a.prototype.isVisibleInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},a.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},a.prototype.shiftKeySelect=function(e,t){if(this.allowMultiSelection){var i=this.getFocusedNode(),s=e?this.getNextNode(i):this.getPrevNode(i);this.removeHover(),this.setFocusElement(s),this.toggleSelect(s,t,!1),this.navigateToFocus(!e)}else this.navigateNode(e)},a.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+ke,i),n=t.select(" .e-frame",s).classList.contains(Le);i.classList.contains("e-disable")||0===i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},a.prototype.validateCheckNode=function(e,i,s,n){var r=this,o=t.closest(e,"."+ge);this.checkActionNodes=[];var a=i?"false":"true";t.isNullOrUndefined(a)||o.setAttribute("aria-checked",a);var l=this.getCheckEvent(o,i?"uncheck":"check",n);this.trigger("nodeChecking",l,function(t){t.cancel||r.nodeCheckingAction(e,i,s,t,n)})},a.prototype.nodeCheckingAction=function(e,i,s,n,r){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))&&(this.checkedElement.push(s.getAttribute("data-uid")),this.autoCheck)){var o=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==o?this.allCheckNode(o,this.checkedElement,null,null,!1):o=null}if(this.changeState(e,i?"uncheck":"check",r,!0),this.autoCheck){this.ensureChildCheckState(s),this.updateOldCheckedData([this.getNodeData(s)]),this.ensureParentCheckState(t.closest(t.closest(s,"."+ye),"."+ge));var a=void 0;"check"===n.action?a=!0:"uncheck"===n.action&&(a=!1),this.ensureStateChange(s,a)}this.nodeCheckedEvent(e,i,r)},a.prototype.ensureStateChange=function(e,i){var s=this,n=t.select("."+ye,e),o=e.getAttribute("data-uid"),a=this.fields;if(1===this.dataType&&this.autoCheck){var l=new r.DataManager(this.treeData).executeLocal((new r.Query).where(a.parentID,"equal",o,!0)),d=l.filter(function(e){return-1!==s.checkedNodes.indexOf(e[a.id].toString())},this);-1!==this.checkedNodes.indexOf(o)&&d.length!==l.length&&this.isFilter&&d.length>0&&(l=d);for(v=0;v<l.length;v++){var h=l[parseInt(v.toString(),10)][this.fields.id]?l[parseInt(v.toString(),10)][this.fields.id].toString():null,c=l[parseInt(v.toString(),10)][this.fields.isChecked]?l[parseInt(v.toString(),10)][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(o)&&-1===this.checkedNodes.indexOf(h)){this.checkDisabledState(h,l[v]);u=this.getChildNodes(this.treeData,h);this.getChildItems(u,i),-1!==this.parentNodeCheck.indexOf(h)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)}else if(-1===this.checkedNodes.indexOf(o)&&null===n&&-1!==this.checkedNodes.indexOf(h)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(h),1),"true"===c&&this.updateField(this.treeData,this.fields,h,"isChecked",null),-1===this.checkedNodes.indexOf(o)&&null===n||-1!==this.parentNodeCheck.indexOf(h)){var p=this.getChildNodes(this.treeData,h);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(h)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)}}else{var u=this.getChildNodes(this.treeData,h);this.getChildItems(u,i)}}}else if(1!==this.dataType||this.autoCheck){if(u=this.getChildNodes(this.treeData,o)){var f=u.filter(function(e){var t=String(e[Object.keys(e)[0]]);return-1!==s.checkedNodes.indexOf(t)});f.length>0&&u.length&&this.isFilter&&(u=f),this.childStateChange(u,o,n,i)}}else if(i)for(v=0;v<this.treeData.length;v++){var m=this.treeData[parseInt(v.toString(),10)][this.fields.id]?this.treeData[parseInt(v.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(m)&&this.checkDisabledState(m,this.treeData[v])}else{for(var g=new r.DataManager(this.treeData).executeLocal((new r.Query).where(a.isChecked,"equal",!0,!1)),v=0;v<g.length;v++){var y=g[parseInt(v.toString(),10)][this.fields.id]?g[parseInt(v.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(y)&&this.checkedNodes.splice(this.checkedNodes.indexOf(y),1),this.updateField(this.treeData,this.fields,y,"isChecked",null)}this.checkedNodes=[]}},a.prototype.checkDisabledState=function(e,i){var s=this.checkDisabledChildren;if(!s){var n=!0;if(this.loadOnDemand&&this.fields.htmlAttributes&&(i=t.isNullOrUndefined(i)?i:this.getNodeObject(e),!t.isNullOrUndefined(i))){var r=i[this.fields.htmlAttributes];r&&!t.isNullOrUndefined(r.class)&&-1!==r.class.indexOf(we)&&(n=!1)}var o=t.select('[data-uid="'+e+'"]',this.element);s=o?!o.classList.contains(we):-1===this.disableNode.indexOf(e)&&n}s&&this.checkedNodes.push(e)},a.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null;-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null);var r=this.getChildNodes(this.treeData,s);r.length>0&&this.getChildItems(r,t)}},a.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",o=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===o&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[]));var a=this.getChildNodes([e[parseInt(n.toString(),10)]],r);a&&this.childStateChange(a,t,i,s)}},a.prototype.allCheckNode=function(e,i,s,n,r){if(e)for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.id,e[parseInt(o.toString(),10)]),l=this.element.querySelector('[data-uid="'+a+'"]');!1!==r&&-1===this.checkedElement.indexOf(a.toString())&&(null===l&&!t.isNullOrUndefined(e[parseInt(o.toString(),10)][this.fields.isChecked])&&-1===i.indexOf(a.toString())||0===n||2===s)&&(!1!==e[parseInt(o.toString(),10)][this.fields.isChecked]||2===s?i.push(a.toString()):n=null,n=!1!==e[parseInt(o.toString(),10)][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(a.toString())&&t.isNullOrUndefined(s)&&i.push(a.toString());var d=t.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]);if(!0===t.getValue(this.fields.hasChildren,e[parseInt(o.toString(),10)])||d){var h=t.getValue(this.fields.id,e[parseInt(o.toString(),10)]),c=void 0;(c=1===this.dataType?this.getChildNodes(this.treeData,h.toString()):d)&&(t.isNullOrUndefined(r)?this.allCheckNode(c,i,s,n):this.allCheckNode(c,i,s,n,r),n=null)}n=null}},a.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+Ie,s);if(e){if(!n)return;n.classList.contains(me)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(fe))this.collapseNode(s,n,i);else{var r=t.closest(t.closest(s,"."+ye),"."+ge);if(!r)return;r.classList.contains("e-disable")||(this.setFocus(s,r),this.navigateToFocus(!0))}},a.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},a.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},a.prototype.getFocusedNode=function(){var e,i=t.select('.e-list-item[tabindex="0"]',this.element);if(!t.isNullOrUndefined(i)){var s=i.getAttribute("aria-checked");"mixed"!==s&&"false"!==s||(this.isFilter=!1)}return t.isNullOrUndefined(i)&&(e=t.select("."+ge,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},a.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);if(this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")){var s=i.lastChild;null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")?this.focusNextNode(i,!1):null==i.nextSibling&&s.classList.contains(xe)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},a.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[parseInt(s.toString(),10)],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},a.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[parseInt(s.toString(),10)],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},a.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[parseInt(i.toString(),10)],i++}while(!t.isVisible(e));return e},a.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[parseInt(i.toString(),10)],i--}while(!t.isVisible(e));return e},a.prototype.setFocus=function(e,i){t.removeClass([e],Ae),e.setAttribute("tabindex","-1"),i.classList.contains("e-disable")||(t.addClass([i],Ae),i.setAttribute("tabindex","0"),i.focus(),t.EventHandler.add(i,"blur",this.focusOut,this),this.updateIdAttr(e,i))},a.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},a.prototype.focusIn=function(){if(!this.mouseDownStatus){var e=this.getFocusedNode();e.classList.contains("e-disable")?(e.setAttribute("tabindex","-1"),this.navigateNode(!0)):(e.setAttribute("tabindex","0"),t.addClass([e],Ae),t.EventHandler.add(e,"blur",this.focusOut,this)),this.mouseDownStatus=!1}},a.prototype.focusOut=function(e){var i=this.getFocusedNode();e.target===i&&(t.removeClass([i],Ae),t.EventHandler.remove(i,"blur",this.focusOut))},a.prototype.onMouseOver=function(e){if(!t.Browser.isDevice){var i=e.target,s=i.classList,n=t.closest(i,"."+ge);if(!n||s.contains(ye)||s.contains(ge))return void this.removeHover();n&&!n.classList.contains("e-disable")&&this.setHover(n)}},a.prototype.setHover=function(e){e.classList.contains("e-hover")||e.classList.contains("e-prevent")||(this.removeHover(),t.addClass([e],"e-hover"))},a.prototype.onMouseLeave=function(){this.removeHover()},a.prototype.removeHover=function(){var e=t.selectAll(".e-hover",this.element);e&&e.length&&t.removeClass(e,"e-hover")},a.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(ge)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(ue)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),r=t.closest(e.parentNode,"."+ge),o=r?r.getAttribute("data-uid"):null,a=e.classList.contains(be),l=!e.classList.contains("e-prevent"),d="true"===e.getAttribute("aria-expanded"),h=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+me,e)||t.select("."+fe,e)),c=null,p=t.select("."+ke,e);return this.showCheckBox&&p&&(c=e.getAttribute("aria-checked")),{id:s,text:n,parentID:o,selected:a,selectable:l,expanded:d,isChecked:c,hasChildren:h}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},a.prototype.getText=function(e,i){if(i){var s=this.getNodeObject(e.getAttribute("data-uid")),n=parseFloat(e.getAttribute("aria-level")),r=this.getFields(this.fields,n,1);return t.getValue(r.text,s)}return t.select("."+ve,e).textContent},a.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},a.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i,this.root);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},a.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},a.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",t.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},a.prototype.setCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},a.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ge)||i.classList.contains(Ie)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+ge);this.createTextbox(s)}},a.prototype.createTextbox=function(e){var i=this,s=t.select(".e-tree-input",this.element);s&&s.blur();var n=t.select("."+ve,e);this.updateOldText(e);var r=this.createElement("input",{className:"e-tree-input",attrs:{value:this.oldText}}),o=this.getEditEvent(e,null,r.outerHTML);this.trigger("nodeEditing",o,function(s){if(!s.cancel){var r="width:"+(n.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(i.nodeTemplateFn)||i.destroyTemplate(e),i.isReact?setTimeout(function(){i.renderTextBox(o,n,r)},5):i.renderTextBox(o,n,r)}})},a.prototype.renderTextBox=function(e,i,s){i.innerHTML=e.innerHtml;var n=t.select(".e-tree-input",i);this.inputObj=o.Input.createInput({element:n,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.setAttribute("style",s),n.focus();var r=n;r.setSelectionRange(0,r.value.length),this.wireInputEvents(n)},a.prototype.updateOldText=function(e){var i=e.getAttribute("data-uid");this.editData=this.getNodeObject(i);var s=parseFloat(e.getAttribute("aria-level"));this.editFields=this.getFields(this.fields,s,1),this.oldText=t.getValue(this.editFields.text,this.editData)},a.prototype.inputFocusOut=function(e){if(t.select(".e-tree-input",this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+ve),a=t.closest(i,"."+ge);t.detach(this.inputObj.container),o.Input.destroy({element:i,properties:this.properties}),this.fields.dataSource instanceof r.DataManager&&!this.isOffline?this.crudOperation("update",null,a,s,null,null,!0):this.appendNewText(a,n,s,!0),t.EventHandler.remove(i,"blur",this.inputFocusOut),this.inputObj=null,t.detach(i),i=null}},a.prototype.appendNewText=function(e,t,i,s){var n=this,r=this.getEditEvent(e,i,null);this.trigger("nodeEdited",r,function(r){i=r.cancel?r.oldText:r.newText,n.updateText(e,t,i,s),r.oldText!==i&&n.triggerEvent("nodeEdited",[n.getNode(e)])})},a.prototype.updateText=function(e,i,s,n){var r=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))this.enableHtmlSanitizer?i.innerText=t.SanitizeHtmlHelper.sanitize(s):i.innerHTML=s;else{i.innerText="";var o=e.getAttribute("data-uid");this.renderNodeTemplate(r,i,o),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),e.focus(),t.EventHandler.add(e,"blur",this.focusOut,this),t.addClass([e],Ae)),this.allowTextWrap&&this.calculateWrap(e)},a.prototype.getElement=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?t.getElement(e):null},a.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},a.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},a.prototype.getNodeObject=function(e){if(!t.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var i=0,s=this.treeData.length;i<s;i++){var n=t.getValue(this.fields.id,this.treeData[parseInt(i.toString(),10)]);if(!t.isNullOrUndefined(this.treeData[parseInt(i.toString(),10)])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[parseInt(i.toString(),10)]}}},a.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var o=0,a=e.length;o<a;o++){var l=t.getValue(i.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&l&&l.toString()===s)return e[parseInt(o.toString(),10)];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(o.toString(),10)]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[parseInt(o.toString(),10)]),this.getChildMapper(i),s)))break}else if(this.isChildObject()){d=t.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[parseInt(o.toString(),10)]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},a.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},a.prototype.initializeDrag=function(){var e,i=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+xe,enableTapHold:!0,tapHoldThreshold:100,helper:function(s){i.dragTarget=s.sender.target;var n=t.closest(i.dragTarget,"."+ue),r=t.closest(i.dragTarget,"."+xe);if(i.dragLi=t.closest(i.dragTarget,"."+ge),i.fullRowSelect&&!r&&i.dragTarget.classList.contains(Oe)&&(r=i.dragTarget.nextElementSibling),!i.dragTarget||!s.element.isSameNode(n)||!r||i.dragTarget.classList.contains(ue)||i.dragTarget.classList.contains(ye)||i.dragTarget.classList.contains(ge)||i.dragLi.classList.contains("e-disable"))return!1;var o=r.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+Ie,o))){var a=i.createElement("div",{className:Ie+" "+me});o.insertBefore(a,o.children[0])}var l="e-drag-item "+ue+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=i.createElement("div",{className:l})).appendChild(o);var d=i.selectedNodes.length;if(d>1&&i.allowMultiSelection&&i.dragLi.classList.contains(be)){var h=i.createElement("span",{className:"e-drop-count",innerHTML:""+d});e.appendChild(h)}return document.body.appendChild(e),document.body.style.cursor="",i.dragData=i.getNodeData(i.dragLi),e},dragStart:function(s){t.addClass([i.element],"e-dragging");var n,r=t.closest(s.target,".e-list-item");r&&(n=parseInt(r.getAttribute("aria-level"),10));var o=i.getDragEvent(s.event,i,null,s.target,null,e,n);o.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",o,function(t){t.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0})},drag:function(s){i.dragObj.setProperties({cursorAt:{top:!t.isNullOrUndefined(s.event.targetTouches)||t.Browser.isDevice?60:-20}}),i.dragAction(s,e)},dragStop:function(e){t.removeClass([i.element],"e-dragging"),e.target.classList.contains("e-sibling")||i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable");s&&n||(t.detach(e.helper),document.body.style.cursor="");var r,o=t.closest(s,".e-list-item");o&&(r=parseInt(o.getAttribute("aria-level"),10));var a=i.getDragEvent(e.event,i,s,s,null,e.helper,r);a.preventTargetExpand=!1,i.trigger("nodeDragStop",a,function(n){i.dragParent=n.draggedParentNode,i.preventExpand=n.preventTargetExpand,n.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor="",s.classList.contains("e-sibling")&&i.removeVirtualEle()),i.dragStartAction=!1})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){!t.isNullOrUndefined(e)&&!e.target.classList.contains("e-sibling")&&i.dropObj.dragData.default&&i.dropObj.dragData.default.helper.classList.contains(ue)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){i.dropAction(e),i.removeVirtualEle()}})},a.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],"e-dragging"),this.dragStartAction=!1},a.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&i.length>0?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},a.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&i.length>0?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},a.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+xe),r=t.select("div."+Ie,i);t.removeClass([r],[Ee,Ne,"e-drop-out","e-no-drop"]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="";var o=e.target.classList,a=e.event,l=this.getOffsetY(a,e.target),d=this.getOffsetX(a,e.target);if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(o)&&o.contains(Oe)&&(n=e.target.nextElementSibling),s){var h=t.closest(e.target,"."+ge),c=t.closest(e.target,"."+ke),p=t.closest(e.target,"."+fe),u=t.closest(e.target,"."+me);if(!s.classList.contains(ue)||n&&!h.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,h))if(this.hasTemplate&&h){var f=t.select(this.fullRowSelect?"."+Oe:"."+xe,h);if(e&&!u&&!p&&l<7&&!c||u&&l<5||p&&d<3){m=this.fullRowSelect?1:0;this.appendIndicator(h,r,m)}else if(e&&!u&&!p&&!c&&f&&l>f.offsetHeight-10||u&&l>19||p&&d>19){m=this.fullRowSelect?2:1;this.appendIndicator(h,r,m)}else t.addClass([r],Ee),this.isDropIn=!0}else if(h&&e&&!u&&!p&&l<7&&!c||u&&l<5||p&&d<3){m=this.fullRowSelect?1:0;this.appendIndicator(h,r,m)}else if(h&&e&&!u&&!p&&e.target.offsetHeight>0&&l>e.target.offsetHeight-10&&!c||u&&l>19||p&&d>19){var m=this.fullRowSelect?2:1;this.appendIndicator(h,r,m)}else t.addClass([r],Ee),this.isDropIn=!0;else"LI"!==e.target.nodeName||h.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,h)?e.target.classList.contains("e-sibling")?t.addClass([r],Ne):t.addClass([r],"e-drop-out"):(t.addClass([r],Ne),this.renderVirtualEle(e))}else t.addClass([r],"e-no-drop"),document.body.style.cursor="not-allowed";var g,v=t.closest(e.target,".e-list-item");v&&(g=parseInt(v.getAttribute("aria-level"),10));var y=this.getDragEvent(e.event,this,e.target,e.target,null,i,g);y.dropIndicator&&t.removeClass([r],y.dropIndicator),this.trigger("nodeDragging",y),y.dropIndicator&&t.addClass([r],y.dropIndicator)},a.prototype.appendIndicator=function(e,i,s){t.addClass([i],Ne);var n=this.createElement("div",{className:"e-sibling"});e.insertBefore(n,e.children[parseInt(s.toString(),10)])},a.prototype.dropAction=function(e){for(var i,s,n=e.event,o=this.getOffsetY(n,e.target),a=e.target,d=!1,h=[],c=[],p=e.dragData.draggable,u=0;u<p.ej2_instances.length;u++)if(p.ej2_instances[parseInt(u.toString(),10)]instanceof l){i=p.ej2_instances[parseInt(u.toString(),10)];break}if(i&&i.dragTarget){var f=i.dragTarget,m=t.closest(f,"."+ge),g=t.closest(a,"."+ge);if(c.push(m),null==g&&a.classList.contains(ue)&&(g=a.firstElementChild),t.detach(e.droppedElement),document.body.style.cursor="",!g||g.isSameNode(m)||this.isDescendant(m,g))return void(this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1));if(i.allowMultiSelection&&m.classList.contains(be)){var v=t.selectAll("."+be,i.element);if(c=v,e.target.offsetHeight<=33&&o>e.target.offsetHeight-10&&o>6)for(u=v.length-1;u>=0;u--)g.isSameNode(v[parseInt(u.toString(),10)])||this.isDescendant(v[parseInt(u.toString(),10)],g)||this.appendNode(a,v[parseInt(u.toString(),10)],g,e,i,o);else for(u=0;u<v.length;u++)g.isSameNode(v[parseInt(u.toString(),10)])||this.isDescendant(v[parseInt(u.toString(),10)],g)||this.appendNode(a,v[parseInt(u.toString(),10)],g,e,i,o)}else this.appendNode(a,m,g,e,i,o);s=parseInt(m.getAttribute("aria-level"),10),d=!0}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1);for(u=0;u<c.length;u++)h.push(this.getNode(c[parseInt(u.toString(),10)]));this.trigger("nodeDropped",this.getDragEvent(e.event,i,a,e.target,e.dragData.draggedElement,null,s,d)),i.element.id!==this.element.id&&(i.triggerEvent("nodeDropped",h),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",h)},a.prototype.appendNode=function(e,i,s,n,r,o){var a=t.closest(e,"."+ke),l=t.closest(n.target,"."+fe),d=t.closest(n.target,"."+me);i.classList.contains("e-disable")||a||!(d&&n.event.offsetY<5||l&&n.event.offsetX<3||d&&n.event.offsetY>19||l&&n.event.offsetX>19||!d&&!l)?this.dropAsChildNode(i,s,r,null,n,o,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,r):e.firstElementChild&&e.classList.contains(ue)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,r):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,r):this.dropAsChildNode(i,s,r,null,n,o,null,e),this.showCheckBox&&this.ensureIndeterminate()},a.prototype.dropAsSiblingNode=function(e,i,s,n){var r,o=t.closest(i,"."+ye),a=t.closest(e,"."+ye),l=t.closest(a,"."+ge);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?r=!1:s.event.offsetY<2?r=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?r=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(r=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");o.insertBefore(e,r?d:d.nextElementSibling)}else o.insertBefore(e,r?s.target:s.target.nextElementSibling);this.moveData(e,i,o,r,n),this.updateElement(a,l),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},a.prototype.dropAsChildNode=function(e,i,s,n,r,o,a,l){var d,h=t.closest(e,"."+ye),c=t.closest(h,"."+ge),p=t.closest(i,"."+ye);if(r&&r.target&&(d=t.select(this.fullRowSelect?"."+Oe:"."+xe,i)),r&&(o<7&&!l.classList.contains("e-sibling")||l.classList.contains("e-sibling")&&!i.lastChild.classList.contains("e-sibling"))&&!a)p.insertBefore(e,i),this.moveData(e,i,p,!0,s);else if(r&&r.target.offsetHeight>0&&o>r.target.offsetHeight-10&&!a&&!this.hasTemplate)p.insertBefore(e,i.nextElementSibling),this.moveData(e,i,p,!1,s);else if(this.hasTemplate&&d&&o>d.offsetHeight-10&&!a)p.insertBefore(e,i.nextElementSibling),this.moveData(e,i,p,!1,s);else{var u=this.expandParent(i),f=t.isNullOrUndefined(n)?null:u.childNodes[parseInt(n.toString(),10)];u.insertBefore(e,f),this.moveData(e,f,u,!0,s)}this.updateElement(h,c),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},a.prototype.moveData=function(e,i,s,n,r){var o=t.closest(s,"."+ge),a=this.getId(e),l=r.updateChildField(r.treeData,r.fields,a,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(o);if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);var p=t.isNullOrUndefined(h)?this.treeData.length:n?h:h+1;if(t.isNullOrUndefined(c)&&!this.hasPid)delete l[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,l[0])}if(this.treeData.splice(p,0,l[0]),r.element.id!==this.element.id){var f=r.removeChildNodes(a);p++;for(var m=0,g=f.length;m<g;m++)this.treeData.splice(p,0,f[parseInt(m.toString(),10)]),p++;r.groupedData=r.getGroupedData(r.treeData,r.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,c,l,n?h:h+1)},a.prototype.expandParent=function(e){var s=t.select("div."+me+", div."+fe,e);s&&s.classList.contains(me)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+ye,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+ye,e),t.isNullOrUndefined(n)||!0!==this.preventExpand||(n.style.display="none"),t.isNullOrUndefined(n)||!1!==this.preventExpand||(n.style.display="block"),t.isNullOrUndefined(n)&&!0===this.preventExpand&&(t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),(o=t.select("div."+me+", div."+fe,e))&&o.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),o?t.removeClass([o],fe):i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),t.isNullOrUndefined(n)){var r=this.expandArgs;(t.isNullOrUndefined(r)||r&&"nodeExpanding"!==r.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption);var o=t.select("div."+me+", div."+fe,e);o?t.removeClass([o],me):(i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption),o=t.select("div."+Ie,e),t.removeClass([o],me)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}var a=t.select("div."+fe,e);return!t.isNullOrUndefined(n)&&a&&this.preventExpand&&(t.removeClass([a],fe),e.setAttribute("aria-expanded","false"),t.addClass([a],me)),n},a.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+Ie,i);t.detach(e),t.detach(s);var n=this.getId(i);this.updateField(this.treeData,this.fields,n,"hasChildren",!1),this.removeExpand(i,!0)}},a.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+ye).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,e),i+1)},a.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)];o.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,o),i+1)}},a.prototype.renderVirtualEle=function(e){var t,i=e.event,s=this.getOffsetY(i,e.target);s>e.target.offsetHeight-2?t=!1:s<2&&(t=!0);var n=this.createElement("div",{className:"e-sibling"}),r=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(n,e.target.children[parseInt(r.toString(),10)])},a.prototype.removeVirtualEle=function(){var e=t.select(".e-sibling");e&&t.detach(e)},a.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},a.prototype.getDragEvent=function(e,i,s,n,o,a,l,d){var h=s?t.closest(s,"."+ge):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:o,u=i?i.dragData:null,f=s?this.parents(s,"."+ge):null,m=i.dragLi.parentElement,g=i.dragLi?t.closest(m,"."+ge):null,v=null,y=null,b=[Ne,Ee,"e-drop-out","e-no-drop"],C=null,S=!0===d?p:h,I=S?t.closest(S,".e-list-parent"):null,x=0,E=null;if(g=i.dragLi&&null===g?t.closest(m,"."+ue):g,g=!0===d?this.dragParent:g,a)for(;x<4;){if(t.select("."+Ie,a).classList.contains(b[parseInt(x.toString(),10)])){C=b[parseInt(x.toString(),10)];break}x++}if(I){var N=0;for(x=0;x<I.childElementCount;x++){if(N=!0!==d&&I.children[parseInt(x.toString(),10)]===p&&h!==p?++N:N,!0!==d&&I.children[parseInt(x.toString(),10)].classList.contains("e-hover")){y=e.offsetY>=23?x+1:x;break}if(I.children[parseInt(x.toString(),10)]===S){e.offsetY,y=x;break}}y=0!==N?--y:y,E=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}if(s&&(v=0===f.length?null:s.classList.contains(ge)?f[0]:f[1]),h===p&&(v=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(v=h,!0!==d)){l=++l;var O=v?t.select(".e-list-parent",v):null;if(y=O?O.children.length:0,!(this.fields.dataSource instanceof r.DataManager)&&null===O&&v){var w=v.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,v.getAttribute("data-uid").toString()):null;y=w?w.length:0}}return{cancel:!1,clonedNode:a,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:l,draggedParentNode:g,dropTarget:v,dropIndicator:C,target:n,position:E}},a.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(s=0;s<i;s++)this.createFullRow(this.liList[parseInt(s.toString(),10)]);else for(var s=0;s<i;s++){var n=t.select("."+Oe,this.liList[parseInt(s.toString(),10)]);t.detach(n)}},a.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Oe});e.insertBefore(t,e.childNodes[0])},a.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=n=t.selectAll('.e-list-item:not([aria-selected="true"])',this.element);i<s.length;i++)(a=s[i]).setAttribute("aria-selected","false");else for(var n=t.selectAll('.e-list-item[aria-selected="false"]',this.element),r=0,o=n;r<o.length;r++){var a=o[r];a.removeAttribute("aria-selected")}},a.prototype.collapseByLevel=function(e,i,s,n){if(n=t.isNullOrUndefined(n)?1:n,i>0&&!t.isNullOrUndefined(e))for(var r=this.getVisibleNodes(s,e.childNodes),o=0,a=r.length;o<a;o++){var l=r[parseInt(o.toString(),10)],d=t.select("."+fe,t.select("."+xe,l));n>=i&&!t.isNullOrUndefined(d)&&this.collapseNode(l,d,null),this.collapseByLevel(t.select("."+ye,l),i,s,n+1)}},a.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+fe,this.element)),s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)],o=t.closest(r,"."+ge);this.collapseNode(o,r,null)}},a.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,o=n.length;r<o;r++){var a=n[parseInt(r.toString(),10)],l=t.select("."+me,t.select("."+xe,a));t.isNullOrUndefined(l)||this.expandAction(a,l,null),this.expandByLevel(t.select("."+ye,a),i-1,s)}},a.prototype.expandAllNodes=function(e){for(var i=0,s=this.getVisibleNodes(e,t.selectAll("."+me,this.element));i<s.length;i++){var n=s[i],r=t.closest(n,"."+ge);this.expandAction(r,n,null,!0,null,!0)}},a.prototype.getVisibleNodes=function(e,i){var s=Array.prototype.slice.call(i);if(e)for(var n=0;n<s.length;n++)t.isVisible(s[parseInt(n.toString(),10)])||(s.splice(n,1),n--);return s},a.prototype.removeNode=function(e){var i=t.closest(e,"."+ye),s=t.closest(i,"."+ge);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.removeData(e)},a.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},a.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+ge,this.element))},a.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=t.selectAll("."+be,this.element);this.selectGivenNodes(e)},a.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=t.selectAll('[aria-expanded="true"]',this.element),i=0,s=e.length;i<s;i++)this.addExpand(e[parseInt(i.toString(),10)])},a.prototype.removeData=function(e){if(1===this.dataType){var t=new r.DataManager(this.treeData),i=this.getId(e),s={},n=this.isNumberTypeId?parseFloat(i):i;s[this.fields.id]=n,t.remove(this.fields.id,s),this.removeChildNodes(i)}else{i=this.getId(e);this.updateChildField(this.treeData,this.fields,i,null,null,!0)}},a.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,o=i.length;n<o;n++){var a=new r.DataManager(this.treeData),l=t.getValue(this.fields.id,i[parseInt(n.toString(),10)]).toString(),d={},h=this.isNumberTypeId?parseFloat(l):l;d[this.fields.id]=h;var c=a.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(l)}return s},a.prototype.doGivenAction=function(e,i,s){for(var n=0,r=e.length;n<r;n++){var o=this.getElement(e[parseInt(n.toString(),10)]);if(!t.isNullOrUndefined(o)){var a=t.select("."+i,t.select("."+xe,o));t.isNullOrUndefined(a)||(s?this.expandAction(o,a,null):this.collapseNode(o,a,null))}}},a.prototype.addGivenNodes=function(e,s,n,r,o){if(0!==e.length){var a=this.getSortedData(e),l=s?parseFloat(s.getAttribute("aria-level"))+1:1;r&&this.updateMapper(l);var d,h=i.ListBase.createListItemFromJson(this.createElement,a,this.listBaseOption,l),c=this.getId(s);t.isNullOrUndefined(s)||(d=t.select("div."+Ie,s)),1===this.dataType&&d&&d.classList.contains(me)&&this.preventExpand&&!t.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,c,e,n),this.isFirstRender=!1);var p;p=o||(s?this.expandParent(s):t.select("."+ye,this.element));var u=t.isNullOrUndefined(n)?null:p.childNodes[parseInt(n.toString(),10)];if(!this.isFirstRender||1===this.dataType){var f=this.expandArgs;if(u||"None"===this.sortOrder){for(v=0;v<h.length;v++)p.insertBefore(h[parseInt(v.toString(),10)],u);1!==this.dataType||t.isNullOrUndefined(s)||this.preventExpand||t.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(m=t.select("div."+Ie,s))&&m.classList.contains(me)&&(t.isNullOrUndefined(f)||"nodeExpanding"!==f.name)&&this.expandAction(s,m,null))}if(!u&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===p.childNodes.length){for(v=0;v<h.length;v++)p.insertBefore(h[parseInt(v.toString(),10)],u);if(!(1!==this.dataType||t.isNullOrUndefined(s)||this.preventExpand||t.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager"))){this.preventExpand=!1;var m=t.select("div."+Ie,s);m&&m.classList.contains(me)&&(t.isNullOrUndefined(f)||"nodeExpanding"!==f.name)&&this.expandAction(s,m,null)}}else for(var g=p.childNodes,v=0;v<h.length;v++)for(C=0;C<g.length;C++){if("Ascending"===this.sortOrder?g[parseInt(C.toString(),10)].textContent.toUpperCase()>h[parseInt(v.toString(),10)].innerText.toUpperCase():g[parseInt(C.toString(),10)].textContent.toUpperCase()<h[parseInt(v.toString(),10)].innerText.toUpperCase()){p.insertBefore(h[parseInt(v.toString(),10)],g[parseInt(C.toString(),10)]);break}p.insertBefore(h[parseInt(v.toString(),10)],g[g.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);for(var y=this.getId(u),b=t.isNullOrUndefined(y)?this.treeData.length:this.getDataPos(this.treeData,this.fields,y),C=0;C<e.length;C++){if(!t.isNullOrUndefined(c)){var S=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,S,e[parseInt(C.toString(),10)])}this.treeData.splice(b,0,e[parseInt(C.toString(),10)]),b++}}this.finalizeNode(p)}},a.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},a.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(t,"navigateUrl")?t.navigateUrl:"navigateUrl"},a.prototype.getDataPos=function(e,i,s){for(var n=null,o=0,a=e.length;o<a;o++){var l=t.getValue(i.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&l&&l.toString()===s)return o;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(o.toString(),10)]))){var d=t.getValue("child",e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},a.prototype.addChildData=function(e,i,s,n,o){var a;if(t.isNullOrUndefined(s)){o=t.isNullOrUndefined(o)?e.length:o;for(var l=0,d=n.length;l<d;l++)e.splice(o,0,n[parseInt(l.toString(),10)]),o++;return a}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[parseInt(h.toString(),10)]);if(e[parseInt(h.toString(),10)]&&p&&p.toString()===s){if("string"==typeof i.child&&Object.prototype.hasOwnProperty.call(e[parseInt(h.toString(),10)],i.child)&&null!==e[parseInt(h.toString(),10)][i.child]||this.fields.dataSource instanceof r.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(h.toString(),10)],"child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[parseInt(h.toString(),10)]);t.isNullOrUndefined(f)&&(f=[]),o=t.isNullOrUndefined(o)?f.length:o;for(var l=0,d=n.length;l<d;l++)f.splice(o,0,n[parseInt(l.toString(),10)]),o++}else{u="string"==typeof i.child?i.child:"child";e[parseInt(h.toString(),10)][""+u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(h.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(h.toString(),10)]))){f=t.getValue("child",e[parseInt(h.toString(),10)]);if(void 0!==(a=this.addChildData(f,this.getChildMapper(i),s,n,o)))break}}else{var m=t.getValue(i.child,e[parseInt(h.toString(),10)]);if(void 0!==(a=this.addChildData(m,this.getChildMapper(i),s,n,o)))break}}return a},a.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)][this.fields.id].toString();o&&-1===this.disableNode.indexOf(o)&&this.disableNode.push(o);var a=this.getElement(o);a&&(a.setAttribute("aria-disabled","true"),t.addClass([a],we))}},a.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var r=this.getElement(i[parseInt(s.toString(),10)]),o=i[parseInt(s.toString(),10)];o&&-1!==this.disableNode.indexOf(o)&&this.disableNode.splice(this.disableNode.indexOf(o),1),r&&(r.removeAttribute("aria-disabled"),t.removeClass([r],we))}},a.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},a.prototype.checkValidId=function(e){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(t){return-1!==e.indexOf(t[i.fields.id]?t[i.fields.id].toString():null)});else if(2===this.dataType)for(var s=0;s<this.treeData.length;s++){var n=this.treeData[parseInt(s.toString(),10)][this.fields.id]?this.treeData[parseInt(s.toString(),10)][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[parseInt(s.toString(),10)]);var r=t.getValue(this.fields.child.toString(),this.treeData[parseInt(s.toString(),10)]);r&&this.filterNestedChild(r,e)}return this.validArr},a.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[parseInt(s.toString(),10)][this.fields.id]?e[parseInt(s.toString(),10)][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[parseInt(s.toString(),10)]);var r=t.getValue(this.fields.child.toString(),e[parseInt(s.toString(),10)]);r&&this.filterNestedChild(r,i)}},a.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},a.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var o=this.checkedNodes,a=0,r=o.length;a<r;a++)this.updateField(this.treeData,this.fields,o[parseInt(a.toString(),10)],"isChecked",!0)}},a.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,o=e.length;n<o;n++){for(var a=0;a<s.length;a++){var l=this.getMapperProp(i,s[parseInt(a.toString(),10)]);t.isNullOrUndefined(e[parseInt(n.toString(),10)][""+l])||delete e[parseInt(n.toString(),10)][""+l]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(n.toString(),10)]))?this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(n.toString(),10)]))&&this.removeField(t.getValue("child",e[parseInt(n.toString(),10)]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[parseInt(n.toString(),10)]),this.getChildMapper(i),s)}},a.prototype.getMapperProp=function(e,i){switch(i){case"selected":return t.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return t.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return t.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return t.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return i}},a.prototype.updateField=function(e,i,s,n,o){if(!t.isNullOrUndefined(s))if(1===this.dataType){var a=this.isNumberTypeId?parseFloat(s):s,l=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",a,!1));t.setValue(this.getMapperProp(i,n),o,l[0])}else this.updateChildField(e,i,s,n,o)},a.prototype.updateChildField=function(e,i,s,n,o,a){var l;if(t.isNullOrUndefined(e))return l;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[parseInt(d.toString(),10)]);if(e[parseInt(d.toString(),10)]&&!t.isNullOrUndefined(c)&&c.toString()===s)return a?l=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),o,e[parseInt(d.toString(),10)]),l=[]),l;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(d.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(d.toString(),10)]))){var p=t.getValue("child",e[parseInt(d.toString(),10)]);if(void 0!==(l=this.updateChildField(p,this.getChildMapper(i),s,n,o,a)))break}}else{var u=t.getValue(i.child,e[parseInt(d.toString(),10)]);if(void 0!==(l=this.updateChildField(u,this.getChildMapper(i),s,n,o,a)))break}}return l},a.prototype.triggerEvent=function(e,i){if(this.renderReactTemplates(),"addNodes"===e){for(var s=[],n=0;n<i.length;n++)s.push(this.getNode(this.getElement(t.isNullOrUndefined(i[parseInt(n.toString(),10)][this.fields.id])?t.getValue(this.fields.id,i[parseInt(n.toString(),10)]).toString():null)));i=s}var r={data:this.treeData,action:e,nodeData:i};this.trigger("dataSourceChanged",r)},a.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},a.prototype.wireEditingEvents=function(e){var i=this;e&&!this.disabled?this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),i.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},a.prototype.wireClickEvent=function(e){var i=this;e?this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},a.prototype.wireExpandOnEvent=function(e){var i=this;e?this.touchExpandObj=new t.Touch(this.element,{tap:function(e){("Click"===i.expandOnType||"DblClick"===i.expandOnType&&i.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&i.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},a.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&t.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},a.prototype.preventContextMenu=function(e){e.preventDefault()},a.prototype.wireEvents=function(){t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},a.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},a.prototype.parents=function(e,i){for(var s=[],n=e.parentNode;!t.isNullOrUndefined(n);)t.matches(n,i)&&s.push(n),n=n.parentNode;return s},a.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+ge):2===e.tapCount&&(i=t.closest(s,"."+ge))),this.firstTap===i},a.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},a.prototype.showSpinner=function(e){t.addClass([e],Ce),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},a.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Ce)},a.prototype.setCheckedNodes=function(e){(e=JSON.parse(JSON.stringify(e))).length>1&&"function"==typeof this.nodeChecked&&this.nodeChecked.length>0&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},a.prototype.setValidCheckedNode=function(e,i){if(void 0===i&&(i=[]),1===this.dataType){var s=this.fields,n=new r.DataManager(this.treeData).executeLocal((new r.Query).where(s.id,"equal",e,!0));if(n[0]&&(this.setChildCheckState(n,e,n[0],i),this.autoCheck)){for(var o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=this.getChildNodes(this.treeData,o),l=0,d=0;d<a.length;d++){var h=a[parseInt(d.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(h)&&l++}l===a.length&&-1===this.checkedNodes.indexOf(o)&&o&&this.checkDisabledState(o)}}else if(2===this.dataType)for(var c=0;c<this.treeData.length;c++){if((this.treeData[parseInt(c.toString(),10)][this.fields.id]?this.treeData[parseInt(c.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var p=t.getValue(this.fields.child.toString(),this.treeData[parseInt(c.toString(),10)]);p&&this.setChildCheckState(p,e,this.treeData[parseInt(c.toString(),10)],i)}},a.prototype.setChildCheckState=function(e,i,s,n){void 0===n&&(n=[]);var r,o=0;if(1===this.dataType){s&&(r=s[this.fields.id]?s[this.fields.id].toString():null);for(h=0;h<e.length;h++){var a=e[parseInt(h.toString(),10)][this.fields.id]?e[parseInt(h.toString(),10)][this.fields.id].toString():null;s&&r&&this.autoCheck&&-1!==this.checkedNodes.indexOf(r)&&-1===this.checkedNodes.indexOf(a)&&this.checkDisabledState(a,e[h]),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i);var l=this.getChildNodes(this.treeData,a),d=1===n.length&&n[0]===a;(l.length===i.length||d)&&this.setChildCheckState(l,i,s)}}else{s&&(r=s[this.fields.id]?s[this.fields.id].toString():"");for(var h=0;h<e.length;h++){var c=e[parseInt(h.toString(),10)][this.fields.id]?e[parseInt(h.toString(),10)][this.fields.id].toString():"",d=1===[i].length&&0===n.length;s&&r&&this.autoCheck&&(-1===this.checkedNodes.indexOf(r)||-1!==this.checkedNodes.indexOf(c)||c!==i&&!d||this.checkDisabledState(c,e[h])),c===i&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i),(l=t.getValue(this.fields.child.toString(),e[parseInt(h.toString(),10)]))&&this.setChildCheckState(l,i,e[parseInt(h.toString(),10)]),-1!==this.checkedNodes.indexOf(c)&&this.autoCheck&&o++,o===e.length&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,s)}}},a.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},a.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var r=0;r<s.length;r++)this.treeData.splice(n,0,s[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},a.prototype.updateChildPosition=function(e,i,s,n,o){for(var a,l=0,d=e.length;l<d;l++){var h=t.getValue(i.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&h&&h.toString()===s)return e[parseInt(l.toString(),10)]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(l.toString(),10)]))){var c=t.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(a=this.updateChildPosition(c,this.getChildMapper(i),s,n,o)))break}}else{var p=t.getValue(i.child,e[parseInt(l.toString(),10)]);if(void 0!==(a=this.updateChildPosition(p,this.getChildMapper(i),s,n,o)))break}}return a},a.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},a.prototype.crudOperation=function(e,i,s,n,r,o,a){var l,d=this,h=this.fields.dataSource,c=[],p=this.getQuery(this.fields),u=this.fields.id,f={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];i?m=this.nodeType(i):s&&("string"==typeof s?m[0]=s.toString():"object"==typeof s&&(m[0]=s.getAttribute("data-uid").toString()));for(var g=0,v=m.length;g<v;g++){var y=this.getElement(m[parseInt(g.toString(),10)]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[parseInt(g.toString(),10)]);c.push(b)}}switch(e){case"delete":1===i.length?l=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,l=h.saveChanges(f,u,p.fromTable,p)),l.then(function(){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(l=h.update(u,c[0],p.fromTable,p)).then(function(){return d.editSucess(s,n,a)}).catch(function(e){return d.dmFailure(e,s,a)});break;case"insert":if(1===r.length)l=h.insert(r[0],p.fromTable,p);else{for(var C=[],g=0,v=r.length;g<v;g++)C.push(r[parseInt(g.toString(),10)]);f.addedRecords=C,l=h.saveChanges(f,u,p.fromTable,p)}l.then(function(){var e=d.getElement(s);d.addSuccess(r,e,o),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},a.prototype.deleteSuccess=function(e){for(var i=[],s=0,n=e.length;s<n;s++){var r=this.getElement(e[parseInt(s.toString(),10)]);i.push(this.getNode(r)),t.isNullOrUndefined(r)||this.removeNode(r)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent("removeNode",i)},a.prototype.editSucess=function(e,i,s){var n=this.getElement(e),r=t.select("."+ve,n);this.appendNewText(n,r,i,s)},a.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+Ie):null;t&&r&&r.classList.contains(me)&&null===t.querySelector("."+ye)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+ye),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},a.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},a.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+ve,s);this.updateText(s,n,this.oldText,i)},a.prototype.getHierarchicalParentId=function(e,i,s){var n=this,r=i.findIndex(function(t){return t[n.fields.id]&&t[n.fields.id].toString()===e});if(-1===r)for(var o=0;o<i.length;o++){var a=t.getValue(this.fields.child.toString(),i[parseInt(o.toString(),10)]);if(!t.isNullOrUndefined(a)){if(-1!==(r=a.findIndex(function(t){return t[n.fields.id]&&t[n.fields.id].toString()===e}))){s.push(i[parseInt(o.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(i[parseInt(o.toString(),10)][this.fields.id].toString(),this.treeData,s);break}this.getHierarchicalParentId(e,a,s)}}return s},a.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":if(this.selectedNodes.length>1){var o=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(o,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=i.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(i.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:t.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.isReact&&(!this.isReact||this.fields.dataSource instanceof r.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var a=this.element.querySelectorAll("li"),l=0;l<a.length;)"true"!==a[parseInt(l.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(a[parseInt(l.toString(),10)],!0,null,!0),l++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},a.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,e.prototype.destroy.call(this)},a.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var o=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof r.DataManager)this.isOffline?this.addSuccess(e,o,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,o,s);else{if(o)this.addGivenNodes(e,o,s);else{e=this.getSortedData(e);for(var a=0;a<e.length;a++){var l=t.getValue(this.fields.parentID,e[parseInt(a.toString(),10)]);o=l?this.getElement(l.toString()):l,!t.isNullOrUndefined(l)&&t.isNullOrUndefined(o)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(l),this.preventExpand=n,this.isHiddenItem=!1,o=this.getElement(l.toString())),this.addGivenNodes([e[parseInt(a.toString(),10)]],o,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&o&&this.ensureParentCheckState(o),this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},a.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i)},a.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},a.prototype.collapseAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.collapseByLevel(t.select("."+ye,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,fe,!1)},a.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},a.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},a.prototype.ensureVisible=function(e){var i=[];if(1===this.dataType)for(var s=this.getTreeData(e);0!==s.length&&!t.isNullOrUndefined(s[0][this.fields.parentID]);)i.push(s[0][this.fields.parentID].toString()),s=this.getTreeData(s[0][this.fields.parentID].toString());else 2===this.dataType&&(i=this.getHierarchicalParentId(e,this.treeData,i));this.expandAll(i.reverse(),null,null,this.isHiddenItem);var n=this.getElement(e);if(!t.isNullOrUndefined(n)){if("object"==typeof e){var r=this.parents(n,"."+ge);this.expandAll(r)}setTimeout(function(){n.scrollIntoView({behavior:"smooth"})},450)}},a.prototype.expandAll=function(e,i,s,n){this.isAnimate=!n,t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+ye,this.element),i,s):(this.expandAllNodes(s),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,me,!0),this.isAnimate=!0},a.prototype.getAllCheckedNodes=function(){return this.checkedNodes},a.prototype.getDisabledNodes=function(){return this.disableNode},a.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},a.prototype.getTreeData=function(e){var i=this.getId(e);if(this.updatePersistProp(),t.isNullOrUndefined(i))return this.treeData;var s=this.getNodeObject(i);return t.isNullOrUndefined(s)?[]:[s]},a.prototype.moveNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)&&0!==e.length){var o=this.getElement(i),a=[];t.isNullOrUndefined(o)&&(this.isHiddenItem=!0,this.ensureVisible(i),this.isHiddenItem=!1,o=this.getElement(i));for(var l=0;l<e.length;l++){var d=this.getElement(e[parseInt(l.toString(),10)]);a.push(this.getNode(d)),t.isNullOrUndefined(d)||o.isSameNode(d)||this.isDescendant(d,o)||(this.preventExpand=n,this.dropAsChildNode(d,o,this,s,null,null,null,o))}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",a)}},a.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n=!1;if(1===this.dataType&&s.length>1)n=!0;else if(2===this.dataType&&1===s.length){var r=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(r)||(n=!0)}var o=this.getElement(e),a=o?o.getAttribute("data-uid"):e?e.toString():null;this.refreshData=this.getNodeObject(a),s=JSON.parse(JSON.stringify(s));var l,d;if(1===this.dataType&&n){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[parseInt(h.toString(),10)][this.fields.parentID])){d=s[parseInt(h.toString(),10)],s.splice(h,1);break}l=t.extend({},this.refreshData,d)}else l=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))return void this.updatePosition(a,l,n,s);this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[l],this.listBaseOption,c),u=t.select("."+ye,o),f=t.getValue(this.fields.child.toString(),l);if(n&&u||n&&!t.isNullOrUndefined(f)){var m=o.parentElement,g=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[parseInt(g.toString(),10)]),this.updatePosition(a,l,n,s),n&&u&&this.expandAll([a])}else{var v=t.select("."+xe,o),y=t.select("."+xe,p[0]),b=t.select("div."+Ie,v),C=t.select("div."+Ie,y);b&&C&&(C.classList.contains(me)&&b.classList.contains(fe)?(t.removeClass([C],me),t.addClass([C],fe)):C.classList.contains(fe)&&b.classList.contains(me)?(t.removeClass([C],fe),t.addClass([C],me)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(v);var S=t.select("."+Oe,o);S.parentNode.insertBefore(y,S.nextSibling),this.updatePosition(a,l,n,s)}if(o=this.getElement(e),l[this.fields.tooltip]&&o.setAttribute("title",l[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(l,this.fields.htmlAttributes)&&l[this.fields.htmlAttributes]){var I={};t.merge(I,l[this.fields.htmlAttributes]),I.class?(t.addClass([o],I.class.split(" ")),delete I.class):t.attributes(o,I)}-1!==this.selectedNodes.indexOf(a)&&(o.setAttribute("aria-selected","true"),t.addClass([o],be)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(o)])}},a.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof r.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},a.prototype.updateNode=function(e,i){var s=this;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&this.allowEditing){var n=this.getElement(e);if(!t.isNullOrUndefined(n)){var o=t.select("."+ve,n);this.updateOldText(n);var a=this.getEditEvent(n,null,null);this.trigger("nodeEditing",a,function(t){t.cancel||(s.fields.dataSource instanceof r.DataManager&&!s.isOffline?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,o,i,!1))})}}},a.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var l;return pe([t.Property(!1)],a.prototype,"allowDragAndDrop",void 0),pe([t.Property(!1)],a.prototype,"allowEditing",void 0),pe([t.Property(!1)],a.prototype,"allowMultiSelection",void 0),pe([t.Property(!1)],a.prototype,"allowTextWrap",void 0),pe([t.Complex({},Me)],a.prototype,"animation",void 0),pe([t.Property()],a.prototype,"checkedNodes",void 0),pe([t.Property(!0)],a.prototype,"checkDisabledChildren",void 0),pe([t.Property("")],a.prototype,"cssClass",void 0),pe([t.Property(!1)],a.prototype,"disabled",void 0),pe([t.Property(null)],a.prototype,"dragArea",void 0),pe([t.Property(!0)],a.prototype,"enableHtmlSanitizer",void 0),pe([t.Property(!1)],a.prototype,"enablePersistence",void 0),pe([t.Property()],a.prototype,"expandedNodes",void 0),pe([t.Property("Auto")],a.prototype,"expandOn",void 0),pe([t.Complex({},Pe)],a.prototype,"fields",void 0),pe([t.Property(!0)],a.prototype,"fullRowSelect",void 0),pe([t.Property(!0)],a.prototype,"loadOnDemand",void 0),pe([t.Property()],a.prototype,"locale",void 0),pe([t.Property()],a.prototype,"nodeTemplate",void 0),pe([t.Property()],a.prototype,"selectedNodes",void 0),pe([t.Property("None")],a.prototype,"sortOrder",void 0),pe([t.Property(!1)],a.prototype,"showCheckBox",void 0),pe([t.Property(!0)],a.prototype,"autoCheck",void 0),pe([t.Property(!1)],a.prototype,"fullRowNavigable",void 0),pe([t.Event()],a.prototype,"actionFailure",void 0),pe([t.Event()],a.prototype,"created",void 0),pe([t.Event()],a.prototype,"dataBound",void 0),pe([t.Event()],a.prototype,"dataSourceChanged",void 0),pe([t.Event()],a.prototype,"drawNode",void 0),pe([t.Event()],a.prototype,"destroyed",void 0),pe([t.Event()],a.prototype,"keyPress",void 0),pe([t.Event()],a.prototype,"nodeChecked",void 0),pe([t.Event()],a.prototype,"nodeChecking",void 0),pe([t.Event()],a.prototype,"nodeClicked",void 0),pe([t.Event()],a.prototype,"nodeCollapsed",void 0),pe([t.Event()],a.prototype,"nodeCollapsing",void 0),pe([t.Event()],a.prototype,"nodeDragging",void 0),pe([t.Event()],a.prototype,"nodeDragStart",void 0),pe([t.Event()],a.prototype,"nodeDragStop",void 0),pe([t.Event()],a.prototype,"nodeDropped",void 0),pe([t.Event()],a.prototype,"nodeEdited",void 0),pe([t.Event()],a.prototype,"nodeEditing",void 0),pe([t.Event()],a.prototype,"nodeExpanded",void 0),pe([t.Event()],a.prototype,"nodeExpanding",void 0),pe([t.Event()],a.prototype,"nodeSelected",void 0),pe([t.Event()],a.prototype,"nodeSelecting",void 0),a=l=pe([t.NotifyPropertyChanges],a)}(t.Component),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)}}(),Re=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Be="e-close",je="e-open",qe="e-right",Fe="e-left",We="e-over",Ve="e-push",_e="e-sidebar-context",ze=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.documentClickContext=s.documentclickHandler.bind(s),s}return Ue(i,e),i.prototype.preRender=function(){this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.setEnableRTL=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},i.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),t.addClass([this.element],"e-sidebar-absolute"),t.addClass([this.target],_e),this.targetEle=this.getTargetElement())},i.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!t.isNullOrUndefined(e)&&e.classList.contains("e-sidebar");)e=e.nextElementSibling;return e},i.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},i.prototype.setWidth=function(){this.enableDock&&"Left"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock&&"Right"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||t.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},i.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},i.prototype.setZindex=function(){t.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},i.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&t.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");t.isNullOrUndefined(e||this.targetEle)||t.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||t.addClass([this.element],["e-visibility"]),t.removeClass([this.element],[je,Be,qe,Fe,"e-slide",Ve,We]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?qe:Fe),this.enableDock&&t.addClass([this.element],"e-dock"),t.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],[Be,"e-disable-animation"]):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Be)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,t.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},i.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!t.isNullOrUndefined(this.defaultBackdropDiv)?t.removeClass([this.defaultBackdropDiv],"e-sidebar-overlay"):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},i.prototype.hide=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Be))return;i.element.classList.contains(je)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Be),t.removeClass([i.element],je),t.setStyleAttribute(i.element,{width:t.formatUnit(i.enableDock?i.dockSize:i.width)}),i.setType(i.type);var s=document.querySelector(".e-main-content")||i.targetEle;!i.enableDock&&s&&(s.style.transform="translateX(0px)",s.style["Left"===i.position?"marginLeft":"marginRight"]="0px"),i.destroyBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.remove("e-sidebar-overflow"),i.setProperties({isOpen:!1},!0),i.enableDock&&setTimeout(function(){return i.setTimeOut()},50),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(je)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(Be)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],["e-visibility","e-disable-animation"]),i.element.classList.contains(je))return;i.element.classList.contains(Be)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[je,"e-transition"]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Be),t.setStyleAttribute(i.element,{width:t.formatUnit(i.width)}),i.setType(i.type),i.createBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.add("e-sidebar-overflow"),i.setProperties({isOpen:!0},!0),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setAnimation=function(){this.animate?t.removeClass([this.element],"e-disable-animation"):t.addClass([this.element],"e-disable-animation")},i.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},i.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?t.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&t.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(Be)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=this.target,i=document.querySelector(".e-main-content")||this.targetEle;this.defaultBackdropDiv=this.createElement("div"),t.addClass([this.defaultBackdropDiv],"e-sidebar-overlay"),t.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),i.appendChild(this.defaultBackdropDiv)}else this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className="e-sidebar-overlay",this.modal.style.display="block",document.body.appendChild(this.modal))},i.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},i.prototype.getModuleName=function(){return"sidebar"},i.prototype.toggle=function(){this.element.classList.contains(je)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(je)},i.prototype.setMediaQuery=function(){if(this.mediaQuery){("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery).matches:this.mediaQuery.matches)&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide()}},i.prototype.resize=function(){t.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],We):t.addClass([this.element],Ve)),this.setMediaQuery(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.documentclickHandler=function(e){t.closest(e.target,".e-control.e-sidebar")||this.hide(e)},i.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&e.distanceX>=50&&e.velocity>=.5?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection?this.hide(e.originalEvent):this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&e.distanceX>=50&&e.velocity>=.5&&this.show()},i.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new t.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new t.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},i.prototype.wireEvents=function(){this.setEnableGestures(),t.EventHandler.add(window,"resize",this.resize,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.resize),t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},i.prototype.onPropertyChanged=function(i,s){for(var n=document.querySelector(".e-main-content")||this.targetEle,r=this.isServerRendered,o=0,a=Object.keys(i);o<a.length;o++)switch(a[o]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),t.removeClass([this.element],["e-visibility"]),this.addClass(),t.addClass([this.element],"Auto"===this.type?t.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),n&&(n.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(t.removeClass([this.element],Fe),t.addClass([this.element],qe)):(t.removeClass([this.element],qe),t.addClass([this.element],Fe)),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),t.isNullOrUndefined(this.target)&&(t.removeClass([this.element],"e-sidebar-absolute"),t.removeClass([s.target],_e),t.setStyleAttribute(n,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,e.prototype.refresh.call(this),this.isServerRendered=r;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock();break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}},i.prototype.setType=function(e){var i=this.element.getBoundingClientRect().width;this.setZindex();var s=document.querySelector(".e-main-content")||this.targetEle;s&&(s.style.transform="translateX(0px)",t.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),r="Left"===this.position?i:-i;switch(t.removeClass([this.element],[Ve,We,"e-slide"]),e){case"Push":t.addClass([this.element],[Ve]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style.transform="translateX("+r+"px)");break;case"Over":t.addClass([this.element],[We]),this.enableDock&&(this.element.classList.contains(Be)||this.isOpen)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":t.addClass([this.element],["e-transition"]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],Ve)):t.addClass([this.element],We):(t.addClass([this.element],Ve),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.target&&t.removeClass([this.target],_e),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[je,Be,Ve,"e-slide",We,Fe,qe,"e-transition","e-disable-animation"]),t.removeClass([this.element],"e-sidebar-absolute"),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",t.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var i=document.querySelector(".e-main-content")||this.targetEle;t.isNullOrUndefined(i)||(i.style.margin="",i.style.transform=""),this.unWireEvents()},Re([t.Property("auto")],i.prototype,"dockSize",void 0),Re([t.Property(null)],i.prototype,"mediaQuery",void 0),Re([t.Property(!1)],i.prototype,"enableDock",void 0),Re([t.Property("en-US")],i.prototype,"locale",void 0),Re([t.Property(!1)],i.prototype,"enablePersistence",void 0),Re([t.Property(!0)],i.prototype,"enableGestures",void 0),Re([t.Property(!1)],i.prototype,"isOpen",void 0),Re([t.Property(!1)],i.prototype,"enableRtl",void 0),Re([t.Property(!0)],i.prototype,"animate",void 0),Re([t.Property("auto")],i.prototype,"height",void 0),Re([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),Re([t.Property("Left")],i.prototype,"position",void 0),Re([t.Property(null)],i.prototype,"target",void 0),Re([t.Property(!1)],i.prototype,"showBackdrop",void 0),Re([t.Property("Auto")],i.prototype,"type",void 0),Re([t.Property("auto")],i.prototype,"width",void 0),Re([t.Property(1e3)],i.prototype,"zIndex",void 0),Re([t.Event()],i.prototype,"created",void 0),Re([t.Event()],i.prototype,"close",void 0),Re([t.Event()],i.prototype,"open",void 0),Re([t.Event()],i.prototype,"change",void 0),Re([t.Event()],i.prototype,"destroyed",void 0),i=Re([t.NotifyPropertyChanges],i)}(t.Component),Ke=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)}}(),Xe=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Ye="e-icon-right",Ge="e-breadcrumb-menu",Qe="e-breadcrumb-wrap-mode",Je="e-breadcrumb-scroll-mode";!function(e){e.Hidden="Hidden",e.Collapsed="Collapsed",e.Menu="Menu",e.Wrap="Wrap",e.Scroll="Scroll",e.None="None"}(e.BreadcrumbOverflowMode||(e.BreadcrumbOverflowMode={}));var Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ke(i,e),Xe([t.Property("")],i.prototype,"text",void 0),Xe([t.Property("")],i.prototype,"id",void 0),Xe([t.Property("")],i.prototype,"url",void 0),Xe([t.Property(null)],i.prototype,"iconCss",void 0),Xe([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),$e=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.isPopupCreated=!1,s}return Ke(n,e),n.prototype.preRender=function(){},n.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},n.prototype.initialize=function(){this._maxItems=this.maxItems,t.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&t.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add("e-disabled"),this.element.setAttribute("aria-disabled","true")),"Wrap"===this.overflowMode?this.element.classList.add(Qe):"Scroll"===this.overflowMode&&this.element.classList.add(Je),this.initItems(),this.initPvtProps()},n.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&this._maxItems>0&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(this._maxItems>=0?(this.startIndex=this._maxItems>1?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},n.prototype.getEndIndex=function(){var e,t=this;return this.activeItem?this.items.forEach(function(i,s){i.url!==t.activeItem&&i.text!==t.activeItem||(e=s)}):e=this.items.length-1,e},n.prototype.initItems=function(){if(!this.items.length){var e=void 0,t=void 0,i=[];if(this.url){var s=new URL(this.url,window.location.origin);e=s.origin+"/",t=s.href.split(e)[1].split("/")}else e=window.location.origin+"/",t=window.location.href.split(e)[1].split("/");i.push({iconCss:"e-icons e-home",url:e});for(var n=0;n<t.length;n++)t[n]&&(i.push({text:t[n],url:e+t[n]}),e+=t[n]+"/");this.setProperties({items:i},!0)}},n.prototype.renderItems=function(e){var s,n,r=this,o=this.element.classList.contains(Ye),a=e.length;if(a){var l,d=void 0,h=void 0,c=0,p=void 0,u=2*a-1,f=!1,m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),g=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),v=this.hasField(e,"iconCss"),y="Collapsed"===this.overflowMode&&this._maxItems>0&&a>this._maxItems&&!this.isExpanded,b="Hidden"===this.overflowMode&&this._maxItems>0;"Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML="");for(var C={moduleName:this.getModuleName(),showIcon:v,itemNavigable:!0,itemCreated:function(e){var i=e.curData.isLastItem;i&&e.item.children.length&&!r.itemTemplate&&(delete e.curData.isLastItem,l||r.enableActiveItemNavigation||(e.item.innerHTML=r.createElement("span",{className:"e-breadcrumb-text",innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||r.itemTemplate||e.item.classList.add("e-icon-item"),b&&e.item.setAttribute("item-index",c.toString());var s={item:t.extend({},e.curData.properties?e.curData.properties:e.curData),element:e.item,cancel:!1};r.trigger("beforeItemRender",s),f=s.cancel;var n=o||s.element.classList.contains(Ye);n&&e.curData.iconCss&&!r.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(".e-breadcrumb-icon")),s.item.disabled&&(e.item.setAttribute("aria-disabled","true"),e.item.classList.add("e-disabled")),s.item.id&&e.item.setAttribute("id",s.item.id),(s.item.disabled||r.disabled)&&e.item.children.length&&!r.itemTemplate&&e.item.children[0].setAttribute("tabindex","-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),!(!i||i&&r.enableActiveItemNavigation)||s.item.disabled||r.disabled||(e.item.children[0].setAttribute("tabindex","0"),t.EventHandler.add(e.item.children[0],"keydown",r.keyDownHandler,r))),e.item.removeAttribute("role"),i&&e.item.setAttribute("data-active-item",""),r.itemTemplate||r.beforeItemRenderChanges(e.curData,s.item,e.item,n)}},S=0;S<u;S%2&&c++,S++)if(d=this.activeItem&&(this.activeItem===e[c].url||this.activeItem===e[c].text),!(y&&S>1&&S<u-2)&&(!b||!(c<this.startIndex||c>this.endIndex)||S%2&&c===this.startIndex-1||0===c)){S%2?(p=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||t.isNullOrUndefined(this.separatorTemplate)?C.template=t.initializeCSPTemplate(function(){return"/"}):C.template=this.separatorTemplate,C.itemClass="e-breadcrumb-separator",n=!1,s=[{previousItem:e[c],nextItem:e[c+1]}]):(C.itemClass="",this.itemTemplate?(C.template=this.itemTemplate,n=!1):n=!0,(s=[t.extend({},e[c].properties?e[c].properties:e[c])])[0].url||this.itemTemplate||(s=[t.extend({},s[0],{isEmptyUrl:!0,url:"#"})]),h=(b||"Menu"===this.overflowMode)&&c===this.endIndex,((S===u-1||h)&&!this.itemTemplate||d)&&(s[0].isLastItem=!0));var I=m,x=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(c>=this.startIndex&&c<=x&&(!(S%2)||!(c===x))&&this.endIndex>=this._maxItems&&this._maxItems>0||0===this._maxItems)){if(S%2)continue;I=this.popupUl,h&&(l=!0)}else"Wrap"===this.overflowMode&&(I=0===S?g:p);var E=i.ListBase.createList(this.createElement,s,C,n,this).childNodes;if(f){if(b||y||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(c,1),this.initPvtProps(),this.reRenderItems();(S===u-1||h)&&t.remove(I.lastElementChild)}else t.append(E,I);if("Wrap"===this.overflowMode&&0!==S&&S%2==0&&m.appendChild(p),y&&1===S){var N=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}});t.EventHandler.add(N,"keyup",this.expandHandler,this),m.appendChild(N)}if("Menu"===this.overflowMode&&this.startIndex===S&&this.endIndex>=this._maxItems&&this._maxItems>=0){var O=this.getMenuElement();t.EventHandler.add(O,"keyup",this.keyDownHandler,this),m.appendChild(O)}if(d||h)break;f&&S++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){r.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(g),this.element.appendChild(m),this.isReact||this.calculateMaxItems()}},n.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e=void 0,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);if("Menu"===this.overflowMode){var r=this.getMenuElement();this.element.appendChild(r),n+=r.offsetWidth,t.remove(r)}for(o=0;o<s.length-2;o++){if(n>i){if(e=Math.ceil((o-1)/2)+("Menu"===this.overflowMode&&o<=2?0:1),(this.maxItems>e&&!(this.maxItems>-1&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===o&&(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth)>i)return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[o].classList.contains(Ge)||(n+=s[o].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&this._maxItems>0){i=0;if((s=this.element.querySelectorAll(".e-breadcrumb-item")).length>this._maxItems+this._maxItems-1){for(var o="Wrap"===this.overflowMode?1:0;o<this._maxItems+this._maxItems-1;o++)i+=s[o].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},n.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},n.prototype.beforeItemRenderChanges=function(e,i,s,n){var r=s.querySelector(".e-anchor-wrap");if(r&&r.parentElement.setAttribute("aria-label","home"),i.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=i.text)}),i.iconCss!==e.iconCss&&r){var o=s.querySelector(".e-breadcrumb-icon");if(o)i.iconCss?(t.removeClass([o],e.iconCss.split(" ")),t.addClass([o],i.iconCss.split(" "))):t.remove(o);else if(i.iconCss){var a=this.createElement("span",{className:"e-breadcrumb-icon "+i.iconCss});n?t.append([a],r):r.insertBefore(a,r.childNodes[0])}}if(i.url!==e.url&&this.enableNavigation){var l=s.querySelector("a.e-breadcrumb-text");l&&(i.url?l.setAttribute("href",i.url):l.removeAttribute("href"))}},n.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},n.prototype.clickHandler=function(e){var i=t.closest(e.target,".e-breadcrumb-item:not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),i&&(t.closest(e.target,".e-breadcrumb-text")||this.itemTemplate)){var s=void 0;s="Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(".e-breadcrumb-item")).indexOf(i):[].slice.call(i.parentElement.children).indexOf(i),"Menu"===this.overflowMode?t.closest(e.target,".e-breadcrumb-popup")?(s+=this.startIndex,this.endIndex=s,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector("."+Ge)?s>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector("."+Ge))?(s+=2*this.popupUl.childElementCount-2,s=Math.floor(s/2),this.endIndex=s):this.startIndex=this.endIndex=s:(s=Math.floor(s/2),this.startIndex=this.endIndex=s):s=Math.floor(s/2),"Hidden"===this.overflowMode&&this._maxItems>0&&0!==this.endIndex&&(s=parseInt(i.getAttribute("item-index"),10),this.startIndex>1&&(this.startIndex-=this.endIndex-s),this.endIndex=s);var n={element:i,item:this.items[s],event:e,cancel:!1};if(this.trigger("itemClick",n),n.cancel)return;this.items[s]&&(this.activeItem=this.items[s].url||this.items[s].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Ge)&&!this.isPopupCreated&&this.renderPopup()},n.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:"e-breadcrumb-popup "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new s.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector("."+Ge),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},n.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!t.closest(e.target,"."+Ge)&&!t.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element))},n.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},n.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},n.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},n.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},n.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===i.overflowMode?this.element.classList.remove(Qe):"Wrap"===e.overflowMode&&this.element.classList.add(Qe),"Scroll"===i.overflowMode?this.element.classList.remove(Je):"Scroll"===e.overflowMode&&this.element.classList.add(Je);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(i.cssClass&&i.cssClass.indexOf(Ye)>-1&&!(e.cssClass&&e.cssClass.indexOf(Ye)>-1)||!(i.cssClass&&i.cssClass.indexOf(Ye)>-1)&&e.cssClass&&e.cssClass.indexOf(Ye)>-1)&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle("e-disabled"),this.element.setAttribute("aria-disabled",e.disabled+"")}},n.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHanlder,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},n.prototype.popupWireEvents=function(){t.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),t.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(document,"click",this.delegateClickHanlder),t.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(t.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),t.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},n.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},n.prototype.getModuleName=function(){return"breadcrumb"},n.prototype.destroy=function(){var i=this;this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element));var s=[],n=["aria-label"];this.cssClass&&s.concat(this.cssClass.split(" ")),this.enableRtl&&s.push("e-rtl"),this.disabled&&(s.push("e-disabled"),n.push("aria-disabled")),"Wrap"===this.overflowMode?s.push(Qe):"Scroll"===this.overflowMode&&s.push(Je),this.unWireEvents(),this.element.innerHTML="",t.removeClass([this.element],s),n.forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Xe([t.Property("")],n.prototype,"url",void 0),Xe([t.Collection([],Ze)],n.prototype,"items",void 0),Xe([t.Property("")],n.prototype,"activeItem",void 0),Xe([t.Property(-1)],n.prototype,"maxItems",void 0),Xe([t.Property("Menu")],n.prototype,"overflowMode",void 0),Xe([t.Property("")],n.prototype,"cssClass",void 0),Xe([t.Property(null)],n.prototype,"itemTemplate",void 0),Xe([t.Property("/")],n.prototype,"separatorTemplate",void 0),Xe([t.Property(!0)],n.prototype,"enableNavigation",void 0),Xe([t.Property(!1)],n.prototype,"enableActiveItemNavigation",void 0),Xe([t.Property(!1)],n.prototype,"disabled",void 0),Xe([t.Property("")],n.prototype,"locale",void 0),Xe([t.Event()],n.prototype,"beforeItemRender",void 0),Xe([t.Event()],n.prototype,"itemClick",void 0),Xe([t.Event()],n.prototype,"created",void 0),n=Xe([t.NotifyPropertyChanges],n)}(t.Component),et=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)}}(),tt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},it="e-carousel-item",st="e-carousel-navigators",nt="e-carousel-hover";!function(e){e[e.Touch=1]="Touch",e[e.Mouse=2]="Mouse"}(e.CarouselSwipeMode||(e.CarouselSwipeMode={}));var rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return et(i,e),tt([t.Property()],i.prototype,"cssClass",void 0),tt([t.Property()],i.prototype,"interval",void 0),tt([t.Property()],i.prototype,"template",void 0),tt([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),ot=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isSwipe=!1,s}return et(s,i),s.prototype.getModuleName=function(){return"e-carousel".replace("e-","")},s.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},s.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};var e={nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"};this.localeObj=new t.L10n(this.getModuleName(),e,this.locale)},s.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},s.prototype.onPropertyChanged=function(i,s){for(var n,r,o=0,a=Object.keys(i);o<a.length;o++){var l=a[o];switch(l){case"animationEffect":this.applyAnimation();break;case"cssClass":t.classList(this.element,[i.cssClass],[s.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,s.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector(".e-carousel-items")&&this.renderTouchActions();break;case"loop":this.loop&&t.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),(this.partialVisible||this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse))&&this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),i.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":if((r=[].slice.call(this.element.querySelectorAll(".e-previous-button,\n .e-next-button, .e-play-button"))).push(this.element),this.enableRtl?t.addClass(r,"e-rtl"):t.removeClass(r,"e-rtl"),this.partialVisible||this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse)){var d=this.loop?this.getNumOfItems():0,h=this.itemsContainer.firstElementChild.clientWidth;this.itemsContainer.style.transform=this.getTranslateX(h,this.selectedIndex+d)}break;case"buttonsVisibility":if(n=this.element.querySelector("."+st))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),t.remove(n);break;case"VisibleOnHover":t.addClass([].slice.call(n.childNodes),"e-hover-arrows");break;case"Visible":t.removeClass([].slice.call(n.childNodes),"e-hover-arrows")}else this.renderNavigators(),this.renderPlayButton();break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(this.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&t.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(n=this.element.querySelector(".e-carousel-indicators"))&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(n)),this.renderIndicators();break;case"showPlayButton":n=this.element.querySelector(".e-play-pause"),!this.showPlayButton&&n&&(t.remove(n),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var c="dataSource"===l?this.dataSource:this.items;!t.isNullOrUndefined(c)&&c.length>0&&this.selectedIndex>=c.length&&(this.setActiveSlide(c.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?t.addClass([this.element],"e-partial"):t.removeClass([this.element],"e-partial"),this.reRenderSlides();break;case"swipeMode":t.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),t.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),t.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},s.prototype.reRenderSlides=function(){var e=this.element.querySelector(".e-carousel-items");e&&(this.resetTemplates(["itemTemplate"]),t.remove(e)),this.renderSlides()},s.prototype.reRenderIndicators=function(){var e=this.element.querySelector(".e-carousel-indicators");e&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(e)),this.renderIndicators()},s.prototype.initialize=function(){var i=[];i.push("e-carousel"),this.cssClass&&i.push(this.cssClass),this.enableRtl&&i.push("e-rtl"),this.partialVisible&&i.push("e-partial"),this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse)&&i.push("e-swipe"),t.addClass([this.element],i),t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),t.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},s.prototype.renderSlides=function(){var e=this,i=this.element.querySelector(".e-carousel-slide-container");i||(i=this.createElement("div",{className:"e-carousel-slide-container",attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(i)),this.itemsContainer=this.createElement("div",{className:"e-carousel-items",attrs:{"aria-live":this.autoPlay?"off":"polite"}}),i.appendChild(this.itemsContainer);var s=this.getNumOfItems();s>0&&this.loop&&(this.items.length>0?this.items.slice(-s).forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer,!0)}):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.dataSource.slice(-s).forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer,!0)})),this.items.length>0?(this.slideItems=this.items,this.items.forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer)})):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer)})),s>0&&this.loop&&(this.items.length>0?this.items.slice(0,s).forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer,!0)}):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.dataSource.slice(0,s).forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length);var n=t.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth;this.itemsContainer.style.transitionProperty="none";var r=this.loop?s:0;this.itemsContainer.style.transform=this.getTranslateX(n,this.selectedIndex+r),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},s.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},s.prototype.renderSlide=function(e,i,s,n,r){void 0===r&&(r=!1);var o=this.createElement("div",{id:t.getUniqueID("carousel_item"),className:it+" "+(e.cssClass?e.cssClass:"")+" "+(this.selectedIndex!==s||r?"":"e-active"),attrs:{"aria-hidden":this.selectedIndex!==s||r?"true":"false","data-index":s.toString(),role:"group","aria-roledescription":"slide"}});r&&o.classList.add("e-cloned"),t.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,o);var a=this.element.id+"_template",l=this.templateParser(i)(e,this,"itemTemplate",a,!1);t.append(l,o),n.appendChild(o)},s.prototype.renderNavigators=function(){if("Hidden"!==this.buttonsVisibility){var e=this.createElement("div",{className:st});this.element.querySelector(".e-carousel-slide-container").insertAdjacentElement("afterend",e),!t.isNullOrUndefined(this.slideItems)&&this.slideItems.length>1&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates()}},s.prototype.renderNavigatorButton=function(e){var i=this.createElement("div",{className:("Previous"===e?"e-previous":"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?"e-hover-arrows":"")});if("Previous"===e&&this.previousButtonTemplate){t.addClass([i],"e-template");var s=this.element.id+"_previousButtonTemplate",r=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",s,!1);t.append(r,i)}else if("Next"===e&&this.nextButtonTemplate){t.addClass([i],"e-template");var s=this.element.id+"_nextButtonTemplate",r=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",s,!1);t.append(r,i)}else{var o=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}});new n.Button({cssClass:"e-flat e-round "+("Previous"===e?"e-previous-button":"e-next-button"),iconCss:"e-icons "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(o),i.appendChild(o)}this.element.querySelector("."+st).appendChild(i),t.EventHandler.add(i,"click",this.navigatorClickHandler,this)},s.prototype.renderPlayButton=function(){if(!(t.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1)){var e=this.createElement("div",{className:"e-play-pause "+("VisibleOnHover"===this.buttonsVisibility?"e-hover-arrows":"")});if(this.playButtonTemplate){t.addClass([e],"e-template");var i=this.element.id+"_playButtonTemplate",s=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",i,!1);t.append(s,e)}else{var r=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),o=this.selectedIndex===this.slideItems.length-1&&!this.loop,a=new n.Button({cssClass:"e-flat e-round e-play-button",iconCss:"e-icons "+(this.autoPlay&&!o?"e-pause-icon":"e-play-icon"),isToggle:!0,enableRtl:this.enableRtl});o&&(this.setProperties({autoPlay:!1},!0),r.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),a.appendTo(r),e.appendChild(r)}var l=this.element.querySelector("."+st);l.insertBefore(e,l.lastElementChild),this.renderTemplates(),t.EventHandler.add(e,"click",this.playButtonClickHandler,this)}},s.prototype.renderIndicators=function(){var e=this;if(this.showIndicators&&!t.isNullOrUndefined(this.indicatorsType)){var i="e-default";this.indicatorsTemplate||(i="e-"+this.indicatorsType.toLowerCase());var s=this.createElement("div",{className:"e-carousel-indicators "+i}),r=this.createElement("div",{className:"e-indicator-bars"});s.appendChild(r);var o;if(this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(r,this.selectedIndex+1):r.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(r,this.selectedIndex+1):((o=this.createElement("div",{className:"e-indicator-bar"})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),o.style.setProperty("--carousel-items-count",""+this.slideItems.length),r.appendChild(o));break;case"Default":case"Dynamic":this.slideItems.forEach(function(i,s){var o=e.createElement("div",{className:"e-indicator-bar "+(e.selectedIndex===s?"e-active":e.selectedIndex-1===s?"e-prev":e.selectedIndex+1===s?"e-next":""),attrs:{"data-index":s.toString(),"aria-current":e.selectedIndex===s?"true":"false"}});if(o.style.setProperty("--carousel-items-current",""+e.selectedIndex),e.indicatorsTemplate)e.renderIndicatorTemplate(o,s);else if("Default"===e.indicatorsType){var a=e.createElement("button",{className:"e-indicator",attrs:{type:"button","aria-label":e.localeObj.getConstant("slide")+" "+(s+1)+" "+e.localeObj.getConstant("of")+" "+e.slideItems.length}});o.appendChild(a),a.appendChild(e.createElement("div",{})),new n.Button({cssClass:"e-flat e-small"}).appendTo(a)}r.appendChild(o),"Default"===e.indicatorsType&&t.EventHandler.add(o,"click",e.indicatorClickHandler,e)})}this.element.appendChild(s)}},s.prototype.renderIndicatorTemplate=function(e,i){void 0===i&&(i=0),t.addClass([e],"e-template");var s=this.element.id+"_indicatorsTemplate",n=this.templateParser(this.indicatorsTemplate)({index:i,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",s,!1);t.append(n,e)},s.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},s.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new t.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},s.prototype.applyAnimation=function(){switch(t.removeClass([this.element],["e-carousel-custom-animation","e-carousel-fade-animation","e-carousel-slide-animation","e-carousel-animation-none"]),this.animationEffect){case"Slide":t.addClass([this.element],"e-carousel-slide-animation");break;case"Fade":t.addClass([this.element],"e-carousel-fade-animation");break;case"None":t.addClass([this.element],"e-carousel-animation-none");break;case"Custom":t.addClass([this.element],"e-carousel-custom-animation")}},s.prototype.autoSlide=function(){t.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},s.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+it+".e-active")||this.element.querySelector(".e-carousel-indicators .e-active");if(!t.isNullOrUndefined(e)){var i=parseInt(e.dataset.index,10);if(this.loop||i!==this.slideItems.length-1){var s=(i+1)%this.slideItems.length;this.element.classList.contains(nt)||this.setActiveSlide(s,"Next"),this.autoSlide()}else this.resetSlideInterval()}},s.prototype.applySlideInterval=function(){var e=this;if(this.autoPlay&&!this.element.classList.contains(nt)){var i=this.interval;this.items.length>0&&!t.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(i=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return e.autoSlideChange()},i)}},s.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},s.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},s.prototype.setActiveSlide=function(e,i,s){var n=this;if(void 0===s&&(s=!1),!(this.element.querySelectorAll("."+it+".e-prev,."+it+".e-next").length>0)){e=t.isNullOrUndefined(e)?0:e;var r=[].slice.call(this.element.querySelectorAll("."+it+":not(.e-cloned)")),o=this.element.querySelector("."+it+".e-active");if(t.isNullOrUndefined(o)&&this.showIndicators){var a=this.element.querySelector(".e-indicator-bar.e-active"),l=parseInt(a.dataset.index,10);return void t.addClass([r[parseInt(l.toString(),10)]],"e-active")}if(t.isNullOrUndefined(o))return void t.addClass([r[parseInt(e.toString(),10)]],"e-active");var d=parseInt(o.dataset.index,10),h=r[parseInt(e.toString(),10)],c={currentIndex:d,nextIndex:e,currentSlide:o,nextSlide:h,slideDirection:i,isSwiped:s,cancel:!1};this.trigger("slideChanging",c,function(o){if(!o.cancel){n.setProperties({selectedIndex:e},!0),t.attributes(o.currentSlide,{"aria-hidden":"true"}),t.attributes(o.nextSlide,{"aria-hidden":"false"}),n.refreshIndicators(d,e),n.slideChangedEventArgs={currentIndex:o.nextIndex,previousIndex:o.currentIndex,currentSlide:o.nextSlide,previousSlide:o.currentSlide,slideDirection:i,isSwiped:s};var a=r[parseInt(e.toString(),10)].clientWidth,l=n.getNumOfItems();n.isSwipe||(n.itemsContainer.style.transitionDuration="0.6s"),n.isSwipe=!1,"Fade"===n.animationEffect?n.itemsContainer.classList.add("e-fade-in-out"):n.itemsContainer.style.transitionProperty="transform",n.loop?0===n.slideChangedEventArgs.currentIndex&&"Next"===n.slideChangedEventArgs.slideDirection?n.itemsContainer.style.transform=n.getTranslateX(a,r.length+l):n.slideChangedEventArgs.currentIndex===n.slideItems.length-1&&"Previous"===n.slideChangedEventArgs.slideDirection?n.itemsContainer.style.transform=n.partialVisible?n.getTranslateX(a):"translateX(0px)":n.itemsContainer.style.transform=n.getTranslateX(a,e+l):n.itemsContainer.style.transform=n.getTranslateX(a,e),"Slide"===n.animationEffect?"Previous"===i?(t.addClass([o.nextSlide],"e-prev"),o.nextSlide.setAttribute("data-slide-height",o.nextSlide.offsetHeight.toString()),t.addClass([o.currentSlide,o.nextSlide],"e-transition-end")):(t.addClass([o.nextSlide],"e-next"),o.nextSlide.setAttribute("data-slide-height",o.nextSlide.offsetHeight.toString()),t.addClass([o.currentSlide,o.nextSlide],"e-transition-start")):"Fade"===n.animationEffect?(t.removeClass([o.currentSlide],"e-active"),t.addClass([o.nextSlide],"e-active")):"Custom"===n.animationEffect?"Previous"===i?(t.addClass([o.nextSlide],"e-next"),t.addClass([o.currentSlide],"e-prev")):(t.addClass([o.currentSlide],"e-prev"),t.addClass([o.nextSlide],"e-next")):n.onTransitionEnd(),n.handleNavigatorsActions(e)}})}},s.prototype.onTransitionEnd=function(){var e=this;t.removeClass(this.element.querySelectorAll(".e-carousel-items"),"e-fade-in-out");var i=this.getNumOfItems();if(this.slideChangedEventArgs){if(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)){var s=this.slideChangedEventArgs.currentSlide.clientWidth;this.itemsContainer.style.transform=this.getTranslateX(s,this.slideChangedEventArgs.currentIndex+i)}t.addClass([this.slideChangedEventArgs.currentSlide],"e-active"),t.removeClass([this.slideChangedEventArgs.previousSlide],"e-active"),this.trigger("slideChanged",this.slideChangedEventArgs,function(){t.removeClass(e.element.querySelectorAll("."+it),["e-prev","e-next","e-transition-start","e-transition-end"]),e.slideChangedEventArgs=null})}},s.prototype.refreshIndicators=function(e,i){var s=this,n=this.element.querySelector(".e-indicator-bars");if(!t.isNullOrUndefined(n)){var r=[].slice.call(n.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":t.attributes(r[parseInt(e.toString(),10)],{"aria-current":"false"}),t.attributes(r[parseInt(i.toString(),10)],{"aria-current":"true"}),t.removeClass(r,["e-active","e-prev","e-next"]),t.addClass([r[parseInt(i.toString(),10)]],"e-active"),r[i-1]&&t.addClass([r[i-1]],"e-prev"),r[i+1]&&t.addClass([r[i+1]],"e-next"),r.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+s.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(n.children.length>0&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,i+1)):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(n.children.length>0&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,i+1)):n.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},s.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var r=n[s];"class"===r?t.addClass([i],e[""+r]):i.setAttribute(r,e[""+r])}},s.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},s.prototype.getNavigatorState=function(e,i){var s=e.querySelector("."+(i?"e-previous-button":"e-next-button"));return!!s&&t.getInstance(s,n.Button).disabled},s.prototype.navigatorClickHandler=function(e){var t=e.currentTarget;if(!this.getNavigatorState(t,t.classList.contains("e-previous"))){var i=t.classList.contains("e-previous")?"Previous":"Next";this.setActiveSlide(this.getSlideIndex(i),i),this.autoSlide()}},s.prototype.indicatorClickHandler=function(e){var i=t.closest(e.target,".e-indicator-bar"),s=parseInt(i.dataset.index,10);this.selectedIndex!==s&&(this.setActiveSlide(s,this.selectedIndex>s?"Previous":"Next"),this.autoSlide())},s.prototype.playButtonClickHandler=function(e,i){void 0===i&&(i=!1);var s=this.element.querySelector(".e-play-button");if(s){var r=t.getInstance(s,n.Button);i||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),r.iconCss="e-icons "+(this.autoPlay?"e-pause-icon":"e-play-icon"),r.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide()}},s.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var i,s,n=!1,r=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&r.classList.contains("e-indicator")?r.click():r.classList.contains("e-carousel")||r.classList.contains("e-play-button")?this.playButtonClickHandler(e):r.classList.contains("e-next-button")?this.next():r.classList.contains("e-previous-button")&&this.prev();break;case"end":s=this.slideItems.length-1,i="Next",n=!0;break;case"home":s=0,i="Previous",n=!0;break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&t.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),i="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",s=this.getSlideIndex(i),n=!this.isSuspendSlideTransition(s,i)}n&&(this.setActiveSlide(s,i),this.autoSlide(),n=!1)}},s.prototype.swipeHandler=function(e){if(!(this.element.classList.contains(nt)||t.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1)){var i="Right"===e.swipeDirection?"Previous":"Next",s=this.getSlideIndex(i);this.isSuspendSlideTransition(s,i)||(this.setActiveSlide(s,i,!0),this.autoSlide())}},s.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},s.prototype.handleNavigatorsActions=function(e){if("Hidden"!==this.buttonsVisibility){if(this.showPlayButton){var i=this.element.querySelector(".e-play-button"),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,r=t.isNullOrUndefined(this.playButtonTemplate)&&i&&s;t.isNullOrUndefined(this.playButtonTemplate)&&i&&!s&&(r=!i.classList.contains("e-active")),r&&(this.setProperties({autoPlay:!s},!0),i.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(l=t.getInstance(i,n.Button)).iconCss="e-icons "+(this.autoPlay?"e-pause-icon":"e-play-icon"),l.dataBind())}var o=this.element.querySelector(".e-previous-button");o&&t.isNullOrUndefined(this.previousButtonTemplate)&&((l=t.getInstance(o,n.Button)).disabled=!this.loop&&0===e,l.dataBind());var a=this.element.querySelector(".e-next-button");if(a&&t.isNullOrUndefined(this.nextButtonTemplate)){var l=t.getInstance(a,n.Button);l.disabled=!this.loop&&e===this.slideItems.length-1,l.dataBind()}}},s.prototype.onHoverActions=function(e){var i=this.element.querySelector("."+st);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&i&&t.removeClass([].slice.call(i.childNodes),"e-hover-arrows"),this.pauseOnHover&&t.addClass([this.element],nt);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&i&&t.addClass([].slice.call(i.childNodes),"e-hover-arrows"),t.removeClass([this.element],nt)}this.autoSlide()},s.prototype.onFocusActions=function(e){switch(e.type){case"focusin":t.addClass([this.element],nt);break;case"focusout":t.removeClass([this.element],nt)}this.autoSlide()},s.prototype.destroyButtons=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<i.length;e++){var s=i[e],r=t.getInstance(s,n.Button);r&&r.destroy()}},s.prototype.getNumOfItems=function(){return this.partialVisible?2:1},s.prototype.getTranslateValue=function(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0},s.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=e.touches?e.touches[0].pageX:e.pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},s.prototype.swiping=function(e){if(this.itemsContainer.classList.contains("e-swipe-start")){this.isSwipe=!0,e.preventDefault();var t=e.touches?e.touches[0].pageX:e.pageX,i=this.prevPageX-t;!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&i>0||this.selectedIndex===this.itemsContainer.childElementCount-1&&i<0)||!this.enableRtl&&(0===this.selectedIndex&&i<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&i>0))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?i:-i))+"px)")}},s.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,i=this.getTranslateValue(this.itemsContainer)-this.initialTranslate;if(i=i<0?-1*i:i,this.isSwipe){var s=i*(t.Browser.isDevice?6:1.66);this.itemsContainer.style.transitionDuration=(t.Browser.isDevice?i:s)/e/10+"s"}var n=this.itemsContainer.firstElementChild.clientWidth/2;this.itemsContainer.classList.remove("e-swipe-start");var r=this.getTranslateValue(this.itemsContainer);r-this.initialTranslate<-n?this.swipeNavigation(!this.enableRtl):r-this.initialTranslate>n?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},s.prototype.swipeNavigation=function(e){e?this.next():this.prev()},s.prototype.swipeModehandlers=function(){(this.swipeMode&e.CarouselSwipeMode.Touch)===e.CarouselSwipeMode.Touch&&(t.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&e.CarouselSwipeMode.Mouse)===e.CarouselSwipeMode.Mouse&&(t.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&e.CarouselSwipeMode.Mouse&e.CarouselSwipeMode.Touch)==(e.CarouselSwipeMode.Mouse&e.CarouselSwipeMode.Touch)&&(t.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},s.prototype.resizeHandler=function(){if(this.itemsContainer&&this.itemsContainer.firstElementChild){var e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth;this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex)}},s.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.enableTouchSwipe&&this.swipeModehandlers(),t.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),t.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),t.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),t.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),t.EventHandler.add(window,"resize",this.resizeHandler,this)},s.prototype.unWireEvents=function(){var e=this;[].slice.call(this.element.querySelectorAll(".e-indicator-bar")).forEach(function(i){t.EventHandler.remove(i,"click",e.indicatorClickHandler)}),[].slice.call(this.element.querySelectorAll(".e-previous,.e-next")).forEach(function(i){t.EventHandler.remove(i,"click",e.navigatorClickHandler)});var i=this.element.querySelector(".e-play-pause");i&&t.EventHandler.remove(i,"click",this.playButtonClickHandler),t.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),t.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),t.EventHandler.clearEvents(this.element),t.EventHandler.clearEvents(this.itemsContainer),t.EventHandler.remove(window,"resize",this.resizeHandler)},s.prototype.prev=function(){if(this.loop||0!==this.selectedIndex){var e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1;this.setActiveSlide(e,"Previous"),this.autoSlide()}},s.prototype.next=function(){if(this.loop||this.selectedIndex!==this.slideItems.length-1){var e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1;this.setActiveSlide(e,"Next"),this.autoSlide()}},s.prototype.play=function(){var e=this.element.querySelector(".e-play-icon");this.showPlayButton&&e&&(t.classList(e,["e-pause-icon"],["e-play-icon"]),this.element.querySelector(".e-play-button").setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},s.prototype.pause=function(){var e=this.element.querySelector(".e-pause-icon");this.showPlayButton&&e&&(this.element.querySelector(".e-play-button").setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),t.classList(e,["e-play-icon"],["e-pause-icon"])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},s.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},s.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},s.prototype.destroy=function(){var e=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(t){e.element.removeChild(t)}),t.removeClass([this.element],["e-carousel",this.cssClass,"e-rtl","e-swipe"]),["role","style"].forEach(function(t){e.element.removeAttribute(t)}),this.itemsContainer=null,i.prototype.destroy.call(this)},tt([t.Collection([],rt)],s.prototype,"items",void 0),tt([t.Property("Slide")],s.prototype,"animationEffect",void 0),tt([t.Property()],s.prototype,"previousButtonTemplate",void 0),tt([t.Property()],s.prototype,"nextButtonTemplate",void 0),tt([t.Property()],s.prototype,"indicatorsTemplate",void 0),tt([t.Property()],s.prototype,"playButtonTemplate",void 0),tt([t.Property()],s.prototype,"cssClass",void 0),tt([t.Property([])],s.prototype,"dataSource",void 0),tt([t.Property()],s.prototype,"itemTemplate",void 0),tt([t.Property(0)],s.prototype,"selectedIndex",void 0),tt([t.Property("100%")],s.prototype,"width",void 0),tt([t.Property("100%")],s.prototype,"height",void 0),tt([t.Property(5e3)],s.prototype,"interval",void 0),tt([t.Property(!0)],s.prototype,"autoPlay",void 0),tt([t.Property(!0)],s.prototype,"pauseOnHover",void 0),tt([t.Property(!0)],s.prototype,"loop",void 0),tt([t.Property(!1)],s.prototype,"showPlayButton",void 0),tt([t.Property(!0)],s.prototype,"enableTouchSwipe",void 0),tt([t.Property(!0)],s.prototype,"allowKeyboardInteraction",void 0),tt([t.Property(!0)],s.prototype,"showIndicators",void 0),tt([t.Property("Default")],s.prototype,"indicatorsType",void 0),tt([t.Property("Visible")],s.prototype,"buttonsVisibility",void 0),tt([t.Property(!1)],s.prototype,"partialVisible",void 0),tt([t.Property(e.CarouselSwipeMode.Touch)],s.prototype,"swipeMode",void 0),tt([t.Property()],s.prototype,"htmlAttributes",void 0),tt([t.Event()],s.prototype,"slideChanging",void 0),tt([t.Event()],s.prototype,"slideChanged",void 0),s=tt([t.NotifyPropertyChanges],s)}(t.Component),at=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)}}(),lt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},dt=function(e){function i(t,i){return e.call(this,t,i)||this}return at(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.element.classList.remove("e-appbar"),this.element.removeAttribute("style"),this.element.removeAttribute("role")},i.prototype.getModuleName=function(){return"appbar"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.preRender=function(){},i.prototype.render=function(){this.element.classList.add("e-appbar"),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add("e-horizontal-bottom"),this.isSticky&&this.element.classList.add("e-sticky"),this.enableRtl&&this.element.classList.add("e-rtl"),this.setHeightMode(),this.setColorMode(),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"mode":t.removeClass([this.element],["e-dense","e-prominent"]),this.setHeightMode();break;case"position":"Bottom"===this.position?t.addClass([this.element],"e-horizontal-bottom"):t.removeClass([this.element],"e-horizontal-bottom");break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?t.addClass([this.element],"e-sticky"):t.removeClass([this.element],"e-sticky");break;case"htmlAttributes":if(!t.isNullOrUndefined(this.htmlAttributes)){if(!t.isNullOrUndefined(i.htmlAttributes))for(var r=0,o=Object.keys(i.htmlAttributes);r<o.length;r++){var a=o[r];"class"===a?t.removeClass([this.element],i.htmlAttributes[""+a]):this.element.removeAttribute(a)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":t.removeClass([this.element],["e-dark","e-primary","e-inherit","e-light"]),this.setColorMode();break;case"enableRtl":this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")}},i.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var r=n[s];"class"===r?t.addClass([i],e[""+r]):i.setAttribute(r,e[""+r])}},i.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add("e-prominent"):"Dense"===this.mode&&this.element.classList.add("e-dense")},i.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add("e-light");break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add("e-primary");break;case"Inherit":this.element.classList.add("e-inherit")}},lt([t.Property("Regular")],i.prototype,"mode",void 0),lt([t.Property("Top")],i.prototype,"position",void 0),lt([t.Property()],i.prototype,"cssClass",void 0),lt([t.Property(!1)],i.prototype,"isSticky",void 0),lt([t.Property()],i.prototype,"htmlAttributes",void 0),lt([t.Property("Light")],i.prototype,"colorMode",void 0),lt([t.Event()],i.prototype,"created",void 0),lt([t.Event()],i.prototype,"destroyed",void 0),i=lt([t.NotifyPropertyChanges],i)}(t.Component),ht=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)}}(),ct=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};!function(e){e.NotStarted="NotStarted",e.InProgress="InProgress",e.Completed="Completed"}(e.StepStatus||(e.StepStatus={}));var pt=function(i){function s(){return null!==i&&i.apply(this,arguments)||this}return ht(s,i),ct([t.Property("")],s.prototype,"cssClass",void 0),ct([t.Property(!1)],s.prototype,"disabled",void 0),ct([t.Property("")],s.prototype,"iconCss",void 0),ct([t.Property(null)],s.prototype,"isValid",void 0),ct([t.Property("")],s.prototype,"label",void 0),ct([t.Property(!1)],s.prototype,"optional",void 0),ct([t.Property(e.StepStatus.NotStarted)],s.prototype,"status",void 0),ct([t.Property("")],s.prototype,"text",void 0),s}(t.ChildProperty);!function(e){e.Horizontal="Horizontal",e.Vertical="Vertical"}(e.StepperOrientation||(e.StepperOrientation={}));var ut=function(i){function s(e,t){return i.call(this,e,t)||this}return ht(s,i),s.prototype.preRender=function(){},s.prototype.getModuleName=function(){return"stepperBase"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.render=function(){},s.prototype.updateOrientaion=function(e){(e.classList.contains("e-horizontal")||e.classList.contains("e-vertical"))&&e.classList.remove("e-horizontal","e-vertical"),t.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},s.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t=e.querySelector("li").querySelector(".e-step-label-container");if(this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains("e-vertical"))if(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")){var i=e.querySelector(".e-stepper-steps");this.progressStep.style.setProperty("--progress-position",i.offsetWidth/2+"px")}else this.progressStep.style.setProperty("--progress-position",this.progressBarPosition/2-1+"px");t&&t.classList.contains("e-label-before")&&this.progressStep.style.setProperty("--progress-position",this.progressBarPosition-1+5+"px"),e.classList.contains("e-horizontal")&&this.setProgressPosition(e)},s.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild;if(!0!==t){var n=0;n=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",n+"px")}var r=e.querySelector(".e-stepper-steps").lastChild.firstChild;if(e.classList.contains("e-rtl")){var o=s.offsetLeft+s.offsetWidth-e.querySelector(".e-stepper-steps").offsetWidth;this.progressStep.style.setProperty("--progress-left-position",Math.abs(o)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(r.offsetLeft-s.offsetLeft)+"px")}else this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",r.offsetWidth+r.offsetLeft-2-(s.offsetLeft+2)+"px")},s.prototype.onPropertyChanged=function(e,t){},ct([t.Collection([],pt)],s.prototype,"steps",void 0),ct([t.Property("")],s.prototype,"cssClass",void 0),ct([t.Property(!1)],s.prototype,"readOnly",void 0),ct([t.Property(e.StepperOrientation.Horizontal)],s.prototype,"orientation",void 0),ct([t.Event()],s.prototype,"created",void 0),s=ct([t.NotifyPropertyChanges],s)}(t.Component),ft=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)}}(),mt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},gt="e-indicator",vt="e-step-text-container",yt="e-step-selected",bt="e-step-inprogress",Ct="e-step-notstarted",St="e-step-focus",It="e-step-completed",xt="e-step-disabled",Et="e-stepper-readonly",Nt="e-label-before",Ot="e-step-item",wt="e-step-type-indicator",Lt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ft(i,e),mt([t.Property(!0)],i.prototype,"enable",void 0),mt([t.Property(2e3)],i.prototype,"duration",void 0),mt([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty);!function(e){e.Top="Top",e.Bottom="Bottom",e.Start="Start",e.End="End"}(e.StepLabelPosition||(e.StepLabelPosition={})),function(e){e.Default="Default",e.Label="Label",e.Indicator="Indicator"}(e.StepType||(e.StepType={}));var kt=function(i){function n(e,t){var s=i.call(this,e,t)||this;return s.stepperItemElements=[],s}return ft(n,i),n.prototype.preRender=function(){this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()));var e={optional:"Optional"};this.l10n=new t.L10n("stepper",e,this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},n.prototype.getModuleName=function(){return"stepper"},n.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},n.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&t.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add(Et),this.enableRtl&&this.element.classList.add("e-rtl"),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),this.steps.length>0&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},n.prototype.initiateProgressBar=function(){var e=this;this.steps.length>1&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},n.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},n.prototype.renderDefault=function(e){var t=this.steps[parseInt(e.toString(),10)];return!t.iconCss&&!t.text&&!t.label},n.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?(this.animation.duration>=0&&e&&e.style.setProperty("--duration",this.animation.duration+"ms"),this.animation.delay>=0&&e&&e.style.setProperty("--delay",this.animation.delay+"ms")):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},n.prototype.updateStepType=function(){if(!t.isNullOrUndefined(this.stepType)){var e=this.stepType.toLowerCase();-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition())}},n.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.updateResize,this),t.EventHandler.add(window,"click",this.updateStepFocus,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.updateResize),t.EventHandler.remove(window,"click",this.updateStepFocus)},n.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains("e-horizontal")&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},n.prototype.updateStepFocus=function(){if(this.isKeyNavFocus){this.isKeyNavFocus=!1;var e=this.element.querySelector("."+St);e&&(e.classList.remove(St),this.element.classList.remove("e-steps-focus"))}},n.prototype.updateStepperStatus=function(t){for(var i=0;i<this.steps.length;i++){var s=this.steps[parseInt(i.toString(),10)],n=s.status.toLowerCase();if(t&&0===this.activeStep&&0===i){a=this.isProtectedOnChange;this.isProtectedOnChange=!0,s.status=e.StepStatus.InProgress,this.isProtectedOnChange=a}if(s&&"notstarted"!==n&&i===this.activeStep)for(var r=0;r<this.steps.length;r++){var o=this.stepperItemElements[parseInt(r.toString(),10)];o.classList.remove(yt,bt,It,Ct);var a=this.isProtectedOnChange;this.isProtectedOnChange=!0,"completed"===n?this.updateStatusClass(r,i,o):this.updateStatusClass(r,i,o,!0),this.isProtectedOnChange=a}else s&&"notstarted"!==n&&i!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},n.prototype.updateStatusClass=function(t,i,s,n){var r=this.steps[parseInt(t.toString(),10)];t<i?(s.classList.add(It),r.status=e.StepStatus.Completed):t===i?s.classList.add(n?bt:It,yt):s.classList.add(Ct)},n.prototype.renderItems=function(){for(var e,i=this,s=this.element.classList.contains("e-horizontal"),n=this.element.classList.contains("e-vertical"),r=t.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),o=0;o<this.steps.length;o++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var a=this.createElement("span",{className:"e-step"}),l=this.steps[parseInt(o.toString(),10)],d=!!l.label,h=!!l.text,c=this.element.classList.contains(wt);if(this.stepperItemContainer.classList[0===o?"add":"remove"](yt,bt),this.stepperItemContainer.classList[0!==o?"add":"remove"](Ct),s&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(o)&&(t.isNullOrUndefined(this.template)||""===this.template)){var p=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase();p&&a.classList.add("e-icons","e-step-indicator"),p||null!=l.isValid||(a.classList.add("e-step-content"),a.innerHTML=(o+1).toString()),this.stepperItemContainer.appendChild(a)}else if(t.isNullOrUndefined(this.template)||""===this.template){var u=!0;if((l.iconCss||!l.iconCss&&h&&d)&&(!h&&!d||!this.element.classList.contains("e-step-type-label"))){if(l.iconCss){var f=l.iconCss.trim().split(" ");(e=a.classList).add.apply(e,[gt].concat(f)),this.stepperItemContainer.classList.add(Ot)}else!l.iconCss&&h&&d&&(a.classList.add(gt),a.innerHTML=l.text,this.stepperItemContainer.classList.add(Ot));this.stepperItemContainer.appendChild(a),(s&&("start"===r||"end"===r)&&d||n&&("top"===r||"bottom"===r)&&d)&&!c&&(this.element.classList.add("e-label-"+r),this.createTextLabelElement(l.label),u=!1)}if(!h||l.iconCss&&c||!u||l.iconCss&&d||(!l.iconCss&&c||(!l.iconCss||this.element.classList.contains("e-step-type-label"))&&!d?(l.iconCss||d||this.element.classList.add("e-step-type-indicator"),this.checkValidState(l,a),d=!1):(d||this.createTextLabelElement(l.text),d&&this.element.classList.contains("e-step-type-label")&&(this.createElement("span",{className:"e-text"}).innerText=l.label),h=!d)),d&&d&&(!l.iconCss||!c)&&u)if(l.iconCss||h||!c){if((!this.element.classList.contains("e-step-type-label")||!h||this.element.classList.contains("e-step-type-label")&&d)&&(this.createTextLabelElement(l.label,!0),this.updateLabelPosition(),(!l.iconCss&&!h&&!this.stepperItemContainer.classList.contains(Ot)||this.element.classList.contains("e-step-type-label"))&&(this.stepperItemContainer.classList.add("e-step-label-only"),null!==l.isValid))){var m=this.createElement("span",{className:"e-step-validation-icon e-icons"});this.labelContainer.appendChild(m)}}else this.checkValidState(l,a,!0)}if(l.optional){var g=this.createElement("span",{className:"e-step-label-optional"});this.l10n.setLocale(this.locale);var v=this.l10n.getConstant("optional");g.innerText=v,d&&this.labelContainer&&(this.element.classList.contains("e-label-after")&&!this.stepperItemContainer.classList.contains("e-step-label-only")||s&&this.element.classList.contains(Nt)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||n&&this.element.classList.contains(Nt)?this.labelContainer.appendChild(g):this.stepperItemContainer.appendChild(g),null!==l.isValid&&this.stepperItemContainer.classList.add(l.isValid?"e-step-valid":"e-step-error")}l.cssClass&&t.addClass([this.stepperItemContainer],l.cssClass.trim().split(" ")),l.disabled&&(this.stepperItemContainer.classList[l.disabled?"add":"remove"](xt),t.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==l.isValid&&(l.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(o,!1),this.stepperItemContainer.classList.contains(bt)?t.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):t.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,o),this.stepperItemElements.push(this.stepperItemContainer);var y={element:this.stepperItemContainer,index:o};this.trigger("beforeStepRender",y,function(e){i.stepperItemList.appendChild(e.element)}),n&&(this.isAngular&&this.template?setTimeout(function(){i.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(n&&this.element.classList.contains(Nt))for(var b=this.stepperItemList.querySelectorAll(".e-label"),C=0;C<b.length;C++)b[parseInt(C.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},n.prototype.createTextLabelElement=function(e,t){void 0===t&&(t=!1);var i=this.createElement("span",{className:t?"e-label":vt+" e-text"});i.innerText=e,t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer.appendChild(i)):this.stepperItemContainer.appendChild(i),this.stepperItemContainer.classList.add(t?"e-step-label":"e-step-text")},n.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(Nt),t=this.stepperItemContainer.classList.contains(Ot)&&!this.stepperItemContainer.classList.contains("e-step-text")&&!this.stepperItemContainer.classList.contains("e-step-label"),i=this.stepperItemContainer.querySelector("."+vt);if(i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e){var s=this.stepperItemContainer.querySelector(".e-label").offsetWidth+15;this.beforeLabelWidth=Math.max(this.beforeLabelWidth,s);var n=this.element.querySelector("ol").lastChild.querySelector("."+gt),r=this.stepperItemContainer.querySelector("."+vt);if(n||r){var o=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+gt)||r).offsetWidth/2;this.progressBarPosition=Math.max(this.progressBarPosition,o)}else this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)}else{var a=this.element.querySelector("ol").lastChild,l=t?this.stepperItemContainer.offsetWidth:a.firstChild.offsetWidth;this.progressBarPosition=Math.max(this.progressBarPosition,l)}},n.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label?e.label:e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(gt),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(Ot))},n.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains("e-horizontal")?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},n.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},n.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(t.removeClass([this.labelContainer],e),t.removeClass([this.element],e))},n.prototype.checkValidStep=function(){for(var e=this.element.classList.contains(wt),t=this,i=0;i<this.steps.length;i++)!function(i){var s=t.steps[parseInt(i.toString(),10)],n=t.stepperItemElements[parseInt(i.toString(),10)];if(null!==s.isValid){var r,o=void 0;e&&!s.iconCss?o=n.querySelector("."+gt):r=n.querySelector("."+gt),!o&&e&&t.renderDefault(i)&&(o=n.querySelector(".e-step-indicator"));var a=n.querySelector(".e-step-validation-icon"),l=s.iconCss.trim().split(" "),d=n.classList.contains("e-step-valid"),h=d?"e-check":"e-circle-info";if(o&&(o.classList.remove("e-step-indicator"),""!==o.innerHTML&&(o.innerHTML=""),o.classList.add("e-icons",h,gt)),t.renderDefault(i)&&!e&&n.querySelector(".e-step").classList.add("e-icons",h,gt),r&&(""!==r.innerHTML?r.innerHTML="":l.length>0&&l.forEach(function(e){r.classList.remove(e)}),r.classList.add("e-icons",h)),a&&(a.classList.add(d?"e-circle-check":"e-circle-info"),t.element.classList.contains("e-vertical"))){var c=n.querySelector(".e-label"),p=n.querySelector(".e-text"),u=p?p.offsetWidth+p.getBoundingClientRect().left:c.offsetWidth+c.getBoundingClientRect().left;n.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",u+20+"px")}}}(i)},n.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new s.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-stepper-tooltip "+this.cssClass:"e-stepper-tooltip",position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):t.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},n.prototype.wireItemsEvents=function(e,i){t.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,i),this),t.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,i),this),t.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},n.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var i=this.stepperItemElements[parseInt(e.toString(),10)];t.EventHandler.remove(i,"click",this.linearModeHandler.bind(this,i,e)),t.EventHandler.remove(i,"mouseover",this.openStepperTooltip.bind(this,e)),t.EventHandler.remove(i,"mouseleave",this.closeStepperTooltip)}},n.prototype.linearModeHandler=function(e,t,i){if(this.linear){var s=t-this.activeStep;1===Math.abs(s)&&this.stepClickHandler(t,i,e)}else this.stepClickHandler(t,i,e)},n.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];if(this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen){if(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)){var i="inprogress"===t.status.toLowerCase()?"e-stepper-tooltip e-step-inprogress-tip "+(this.cssClass?this.cssClass:""):"e-stepper-tooltip "+(this.cssClass?this.cssClass:"");this.tooltipObj.setProperties({cssClass:i.trim()})}this.tooltipOpen=!0}},n.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},n.prototype.updateTooltipContent=function(e){if(this.showTooltip){this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]);var i=void 0,s=this.steps[parseInt(e.toString(),10)];if(this.tooltipTemplate){i=this.createElement("span",{className:"e-stepper-tooltip-content"});var n=this.getTemplateFunction(this.tooltipTemplate);t.append(n({value:s},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),i),this.tooltipObj.setProperties({content:i},!0)}else{var r=s.label?s.label:s.text;this.tooltipObj.setProperties({content:t.initializeCSPTemplate(function(){return r})},!0)}this.renderReactTemplates()}},n.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},n.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},n.prototype.renderItemContent=function(e,i){var s=this.stepperItemList.querySelectorAll("li");if(i&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template){i?s[parseInt(e.toString(),10)].classList.add("e-step-template"):this.stepperItemContainer.classList.add("e-step-template");var n=this.steps[parseInt(e.toString(),10)];t.append(this.templateFunction({step:n,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),i?s[parseInt(e.toString(),10)]:this.stepperItemContainer)}this.renderReactTemplates()},n.prototype.removeItemContent=function(e){e.classList.remove("e-step-template");for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},n.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},n.prototype.getTemplateFunction=function(e){if("string"==typeof e){var i="";try{var s=t.select(e);i=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:e}catch(t){i=e}return t.compile(i)}return t.compile(e)},n.prototype.navigateToStep=function(e,t,i,s,n){var r=this,o={element:i,event:t,isInteracted:s,previousStep:this.activeStep,activeStep:e,cancel:!1};if(!1!==n){var a=this.activeStep;this.trigger("stepChanging",o,function(n){if(!n.cancel){r.navigationHandler(e);var o={element:i,event:t,isInteracted:s,previousStep:a,activeStep:r.activeStep};r.trigger("stepChanged",o)}})}else this.navigationHandler(e)},n.prototype.navigationHandler=function(i,s,n){i=Math.min(i,this.steps.length-1);var r=this.stepperItemElements.length;i>=0&&i<r-1&&(i=this.stepperItemElements[parseInt(i.toString(),10)].classList.contains(xt)?this.activeStep:i);var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.activeStep=parseInt(i.toString(),10),this.isProtectedOnChange=o;for(var a=0;a<this.steps.length;a++){var l=this.stepperItemElements[parseInt(a.toString(),10)],d=this.steps[parseInt(a.toString(),10)];l.classList.remove(yt,bt,It,Ct),a===this.activeStep&&l.classList.add(yt),this.activeStep>=0&&this.progressbar?this.element.classList.contains("e-horizontal")?this.calculateProgressbarPos():this.progressbar.style.setProperty("--progress-value",100/(this.steps.length-1)*i+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty("--progress-value","0%"),a===this.activeStep?l.classList.add(bt):this.activeStep>0&&a<this.activeStep?l.classList.add(It):l.classList.add(Ct),l.classList.contains(bt)?t.attributes(l,{tabindex:"0","aria-current":"true"}):t.attributes(l,{tabindex:"-1","aria-current":"false"});var h=this.isProtectedOnChange;this.isProtectedOnChange=!0,!1!==n&&(a<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===d.status.toLowerCase()?d.status=e.StepStatus.Completed:a===this.activeStep?d.status=e.StepStatus.InProgress:a>this.activeStep&&(d.status=e.StepStatus.NotStarted),s&&this.activeStep===a&&(d.status=s),"completed"===d.status.toLowerCase()&&(l.classList.remove(yt,bt,Ct),l.classList.add(It)),"notstarted"===d.status.toLowerCase()&&(l.classList.remove(yt,bt,It),l.classList.add(Ct))),this.isProtectedOnChange=h,this.updateIndicatorStatus(a,l)}this.updateStepInteractions()},n.prototype.calculateProgressbarPos=function(){var e=this;if((this.element.classList.contains(Nt)||this.element.classList.contains("e-label-after"))&&!this.element.classList.contains(wt)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(Ot)){var t=this.element.querySelector(".e-stepper-progressbar"),i=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,s=0===this.activeStep?0:(i.offsetLeft-t.offsetLeft+i.offsetWidth/2)/t.offsetWidth*100;this.element.classList.contains("e-rtl")?(s=(t.getBoundingClientRect().right-i.getBoundingClientRect().right+i.offsetWidth/2)/t.offsetWidth*100,this.progressbar.style.setProperty("--progress-value",s+"%")):this.progressbar.style.setProperty("--progress-value",s+"%")}else{var n=0,r=0;this.stepperItemElements.forEach(function(t,i){var s=t.offsetWidth;n+=s,i<=e.activeStep&&(r+=i===e.activeStep&&0!==i?s/2:s)});var o=(this.stepperItemList.offsetWidth-n)/(this.stepperItemElements.length-1),a=(r+o*this.activeStep)/this.stepperItemList.offsetWidth*100;this.progressbar.style.setProperty("--progress-value",a+"%")}},n.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(wt)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(It)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(gt,"e-icons","e-check")):(t.classList.contains(bt)||t.classList.contains(Ct))&&(t.firstChild.classList.remove(gt,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},n.prototype.updateStepInteractions=function(){var e=this;this.element.classList.toggle("e-linear",this.linear),this.stepperItemElements.forEach(function(t,i){t.classList.toggle("e-previous",i===e.activeStep-1),t.classList.toggle("e-next",i===e.activeStep+1)})},n.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)t.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},n.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},n.prototype.previousStep=function(){this.activeStep>0&&this.navigateToStep(this.activeStep-1,null,null,!1)},n.prototype.reset=function(){if(0===this.activeStep)this.updateStepInteractions();else{var e=!!this.stepperItemElements[0].classList.contains(xt);this.navigateToStep(e?-1:0,null,null,!1)}},n.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},n.prototype.updateElementClassArray=function(){var e=["e-rtl",Et,"e-steps-focus","e-label-after",Nt,"e-label-top","e-label-bottom","e-label-start","e-label-end",wt,"e-step-type-label","e-vertical","e-horizontal","e-linear"];t.removeClass([this.element],e)},n.prototype.destroy=function(){i.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&t.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&t.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},n.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},n.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains("e-horizontal")?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},n.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=this.element.querySelector("."+St);s||(s=this.element.querySelector("."+yt));var n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(St))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(St),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){var o=r;for(r=e?r+1:r-1;r>=0&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(xt);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(o.toString(),10)].classList.contains(St)&&n[parseInt(o.toString(),10)].classList.remove(St),"home"!==t.action&&"end"!==t.action||(r="home"===t.action?i?n.length-1:0:i?0:n.length-1),r>=0&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(St)}else if("space"===t.action||"enter"===t.action){var a=!1;if(this.linear){var l=this.activeStep-r;1===Math.abs(l)&&(this.navigateToStep(r,null,null,!0),a=!0)}else this.navigateToStep(r,null,null,!0),a=!0;a&&(this.updateStepFocus(),this.stepperItemElements[r].focus())}},n.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains(Et)&&this.element.classList.add(Et),this.enableRtl&&!this.element.classList.contains("e-rtl")&&this.element.classList.add("e-rtl"),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},n.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,o=0;o<r;o++){var a=Object.keys(e[n])[o];"status"===a?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===a&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},n.prototype.updateDynamicActiveStep=function(e,t){if(this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,this.activeStep>=0&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(xt)&&(this.activeStep=t),this.linear){var i=t-this.activeStep;1===Math.abs(i)&&this.navigateToStep(this.activeStep,null,null,!0)}else this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},n.prototype.updateDynamicCssClass=function(e,i){i&&t.removeClass([this.element],i.trim().split(" ")),e&&t.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-stepper-tooltip "+this.cssClass:"e-stepper-tooltip"})},n.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"](Et);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},mt([t.Property(0)],n.prototype,"activeStep",void 0),mt([t.Complex({},Lt)],n.prototype,"animation",void 0),mt([t.Property(!1)],n.prototype,"linear",void 0),mt([t.Property(!1)],n.prototype,"showTooltip",void 0),mt([t.Property("")],n.prototype,"template",void 0),mt([t.Property("")],n.prototype,"tooltipTemplate",void 0),mt([t.Property(e.StepLabelPosition.Bottom)],n.prototype,"labelPosition",void 0),mt([t.Property(e.StepType.Default)],n.prototype,"stepType",void 0),mt([t.Event()],n.prototype,"stepChanged",void 0),mt([t.Event()],n.prototype,"stepChanging",void 0),mt([t.Event()],n.prototype,"stepClick",void 0),mt([t.Event()],n.prototype,"beforeStepRender",void 0),n=mt([t.NotifyPropertyChanges],n)}(ut);return e.Accordion=z,e.AccordionActionSettings=W,e.AccordionAnimationSettings=V,e.AccordionItem=_,e.ActionSettings=De,e.AppBar=dt,e.Breadcrumb=$e,e.BreadcrumbItem=Ze,e.Carousel=ot,e.CarouselItem=rt,e.ContextMenu=Y,e.FieldSettings=E,e.FieldsSettings=Pe,e.HScroll=p,e.Header=le,e.Item=D,e.Menu=Z,e.MenuAnimationSettings=O,e.MenuItem=N,e.NodeAnimationSettings=Me,e.Sidebar=ze,e.Step=pt,e.Stepper=kt,e.StepperAnimationSettings=Lt,e.StepperBase=ut,e.Tab=he,e.TabActionSettings=oe,e.TabAnimationSettings=ae,e.TabItem=de,e.Toolbar=M,e.TreeView=He,e.VScroll=m,e.addScrolling=a,e.destroyScroll=d,e}({},ej.base,ej.lists,ej.popups,ej.buttons,ej.data,ej.inputs),this.ejs=ej;
|
|
1
|
+
this.ej=this.ej||{},this.ej.navigations=function(e,t,i,s,n,r,o){"use strict";function a(e,t,i,s,n,r){var o,a,d=t.parentElement;if("vscroll"===s?(o=r||t.getBoundingClientRect().height,a=i.getBoundingClientRect().height):(o=t.getBoundingClientRect().width,a=i.getBoundingClientRect().width),o<a)return l(e,t,i,s,n,r);if(d){var h=d.getBoundingClientRect().width;return h<o&&"hscroll"===s?(a=h,t.style.maxWidth=h+"px",l(e,t,i,s,n,r)):i}return i}function l(e,i,s,n,r,o){var a=e("div",{className:"e-menu-"+n});i.appendChild(a),a.appendChild(s),o?(a.style.overflow="hidden",a.style.height=o+"px"):(a.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new m({enableRtl:r},a).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new p({enableRtl:r},a).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,a}function d(e,i,s){if(e){var n=t.select(".e-menu-parent",i);n?s&&s!==n||(e.destroy(),i.parentElement.appendChild(n),t.detach(i)):(e.destroy(),t.detach(i))}}var h=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)}}(),c=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},p=function(e){function i(t,i){return e.call(this,t,i)||this}return h(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var i=this.element,s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"hScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",i.classList.remove("e-hscroll"),i.classList.remove("e-scroll-device"),i.classList.remove("e-rtl");var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,o=[].slice.call(this.scrollItems.children);r<o.length;r++){var a=o[r];i.appendChild(a)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:"e-scroll-overlay e-scroll-right-overlay"}),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),n=this.createElement("div",{id:t.concat("_right"),className:s}),r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"});n.appendChild(r);var o=this.createElement("div",{className:"e-scroll-overlay e-scroll-left-overlay"});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(o,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},n=this.createElement("div",{className:i,attrs:s});n.setAttribute("aria-disabled","false");var r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"}),o="e-"+e.id.concat("_nav e-scroll-nav e-scroll-left-nav"),a={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},l=this.createElement("div",{className:o+" e-overlay",attrs:a});l.setAttribute("aria-disabled","true");var d=this.createElement("div",{className:"e-nav-left-arrow e-nav-arrow e-icons"});l.appendChild(d),n.appendChild(r),e.appendChild(n),e.insertBefore(l,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),l.classList.add("e-ie-align")),this.eventBinding([n,l])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains("e-scroll-nav")&&(n=t.querySelector(".e-nav-arrow").classList),this.contains(s,"e-rtl")&&this.browserCheck&&(e=-e),!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?n.contains("e-nav-right-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains("e-nav-left-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Left"===e.swipeDirection?i.scrollLeft+=t*r:"Right"===e.swipeDirection&&(i.scrollLeft-=t*r),s-=.5,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&this.scrollEle.scrollLeft>0&&(this.scrollEle.scrollLeft=0)},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetWidth});var r=function(){var t,s;n.contains(n.element,"e-rtl")&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,"e-rtl")&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-right-arrow"],["e-nav-left-arrow"]):t.classList(s,["e-nav-left-arrow"],["e-nav-right-arrow"])}else e&&i&&(e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0"));this.repeatScroll()},i.prototype.scrollHandler=function(e){var t=e.target,i=t.offsetWidth,s=(this.element,this.element.querySelector(".e-scroll-left-nav")),n=this.element.querySelector(".e-scroll-right-nav"),r=this.element.querySelector(".e-scroll-left-overlay"),o=this.element.querySelector(".e-scroll-right-overlay"),a=t.scrollLeft;if(a<=0&&(a=-a),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(r=this.element.querySelector(".e-scroll-right-overlay"),o=this.element.querySelector(".e-scroll-left-overlay")),r.style.width=a<40?a+"px":"40px",t.scrollWidth-Math.ceil(i+a)<40?o.style.width=t.scrollWidth-Math.ceil(i+a)+"px":o.style.width="40px"),0===a)this.arrowDisabling(s,n);else if(Math.ceil(i+a+.1)>=t.scrollWidth)this.arrowDisabling(n,s);else{var l=this.element.querySelector(".e-scroll-nav.e-overlay");l&&(l.classList.remove("e-overlay"),l.setAttribute("aria-disabled","false"),l.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),u=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 n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},m=function(e){function i(t,i){return e.call(this,t,i)||this}return u(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),t.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=t.createElement("div",{className:"e-vscroll-content"}),i=t.createElement("div",{className:"e-vscroll-bar"});i.setAttribute("tabindex","-1");for(var s=this.element,n=0,r=[].slice.call(s.children);n<r.length;n++){var o=r[n];e.appendChild(o)}i.appendChild(e),s.appendChild(i),i.style.overflow="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll","e-scroll-device","e-rtl"]);var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,o=[].slice.call(this.scrollItems.children);r<o.length;r++){var a=o[r];i.appendChild(a)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlayElement=function(e){var i=e.id.concat("_nav"),s=t.createElement("div",{className:"e-scroll-overlay e-scroll-down-overlay"}),n="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),r=t.createElement("div",{id:i.concat("down"),className:n}),o=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"});r.appendChild(o);var a=t.createElement("div",{className:"e-scroll-overlay e-scroll-up-overlay"});this.ieCheck&&r.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(r),e.insertBefore(a,e.firstChild),this.eventBinding([r])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var r=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"}),o="e-"+e.id.concat("_nav e-scroll-nav e-scroll-up-nav"),a=t.createElement("div",{id:i.concat("_up"),className:o+" e-overlay"});a.setAttribute("aria-disabled","true");var l=t.createElement("div",{className:"e-nav-up-arrow e-nav-arrow e-icons"});a.appendChild(l),n.appendChild(r),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(a,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),a.classList.add("e-ie-align")),this.eventBinding([n,a])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;s.contains("e-scroll-nav")&&(s=t.querySelector(".e-nav-arrow").classList),s.contains("e-nav-down-arrow")?this.frameScrollRequest(e,"add",i):s.contains("e-nav-up-arrow")&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Up"===e.swipeDirection?i.scrollTop+=t*r:"Down"===e.swipeDirection&&(i.scrollTop-=t*r),s-=.02,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetHeight});var r=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-down-arrow"],["e-nav-up-arrow"]):t.classList(s,["e-nav-up-arrow"],["e-nav-down-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var t=e.target,i=t.offsetHeight,s=this.element.querySelector(".e-scroll-up-nav"),n=this.element.querySelector(".e-scroll-down-nav"),r=this.element.querySelector(".e-scroll-up-overlay"),o=this.element.querySelector(".e-scroll-down-overlay"),a=t.scrollTop;if(a<=0&&(a=-a),this.isDevice&&(r.style.height=a<40?a+"px":"40px",t.scrollHeight-Math.ceil(i+a)<40?o.style.height=t.scrollHeight-Math.ceil(i+a)+"px":o.style.height="40px"),0===a)this.arrowDisabling(s,n);else if(Math.ceil(i+a+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var l=this.element.querySelector(".e-scroll-nav.e-overlay");l&&(l.classList.remove("e-overlay"),l.setAttribute("aria-disabled","false"),l.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},f([t.Property(null)],i.prototype,"scrollStep",void 0),i=f([t.NotifyPropertyChanges],i)}(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)}}(),v=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},y="e-focused",b="e-menu-header",C="e-selected",S="e-menu-item",I="e-menu-hide",x="e-menu-popup",E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property("id")],i.prototype,"itemId",void 0),v([t.Property("parentId")],i.prototype,"parentId",void 0),v([t.Property("text")],i.prototype,"text",void 0),v([t.Property("iconCss")],i.prototype,"iconCss",void 0),v([t.Property("url")],i.prototype,"url",void 0),v([t.Property("separator")],i.prototype,"separator",void 0),v([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property(null)],i.prototype,"iconCss",void 0),v([t.Property("")],i.prototype,"id",void 0),v([t.Property(!1)],i.prototype,"separator",void 0),v([t.Collection([],i)],i.prototype,"items",void 0),v([t.Property("")],i.prototype,"text",void 0),v([t.Property("")],i.prototype,"url",void 0),v([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return g(i,e),v([t.Property("SlideDown")],i.prototype,"effect",void 0),v([t.Property(400)],i.prototype,"duration",void 0),v([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),w=function(e){function n(i,s){var n=e.call(this,i,s)||this;return n.navIdx=[],n.animation=new t.Animation({}),n.isTapHold=!1,n.tempItem=[],n.showSubMenuOn="Auto",n.isAnimationNone=!1,n}return g(n,e),n.prototype.preRender=function(){if(!this.isMenu){r=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var e=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=r,t.setValue("ej2_instances",e,this.element)}else{r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),r);var i=this.element.nextElementSibling;i?this.element.parentElement.insertBefore(r,i):this.element.parentElement.appendChild(r),this.clonedElement=r}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var s=this.element,n=t.getValue("ej2_instances",s),r=this.createElement("ul"),o=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),a=0,l=s.attributes.length;a<l;a++)r.setAttribute(s.attributes[a].nodeName,s.attributes[a].nodeValue);s.parentNode.insertBefore(o,s),t.detach(s),s=r,o.appendChild(s),t.setValue("ej2_instances",n,s),this.clonedElement=o,this.element=s,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete();var t=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){a(e.createElement,t,e.element,"hscroll",e.enableRtl)})},n.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):document.body.appendChild(e)),this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add("e-rtl"),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},n.prototype.renderItems=function(){if(!this.items.length){var e=i.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}});this.setProperties({items:e},!0),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML=""}var s=this.createItems(this.items);if(t.append(Array.prototype.slice.call(s.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu){if(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling){var n=this.getWrapper();this.element.classList.contains("e-vertical")?a(this.createElement,n,this.element,"vscroll",this.enableRtl):a(this.createElement,n,this.element,"hscroll",this.enableRtl)}}else this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu")},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),r=0,o=n.length;r<o;r++)i=n[r],this.isMenu?t.EventHandler.add(i,"click",this.menuHeaderClickHandler,this):t.Browser.isIos?new t.Touch(i,{tapHold:this.touchHandler.bind(this)}):t.EventHandler.add(i,"contextmenu",this.cmenuHandler,this);if(this.targetElement=i,!this.isMenu){t.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var a=0,l=s.getScrollableParent(this.targetElement);a<l.length;a++){var d=l[a];t.EventHandler.add(d,"scroll",this.scrollHandler,this)}}}t.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),t.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),t.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),t.EventHandler.add(document,"keydown",this.domKeyHandler,this),this.isMenu||this.target||t.EventHandler.add(document,"scroll",this.scrollHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+S})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:"downarrow",uparrow:"uparrow",enter:"enter",leftarrow:"leftarrow",rightarrow:"rightarrow",escape:"escape"};this.isMenu&&(i.home="home",i.end="end",i.tab="tab"),new t.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:i})},n.prototype.mouseDownHandler=function(e){t.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||t.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},n.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},n.prototype.domKeyHandler=function(e){27===e.keyCode&&(e.action="escape",this.leftEscKeyHandler(e))},n.prototype.keyBoardHandler=function(e){var i="",s=e.target,n=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&s.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([y,C],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case"rightarrow":i="rightarrow",e.action="downarrow";break;case"leftarrow":i="leftarrow",e.action="uparrow";break;case"downarrow":i="downarrow",e.action="rightarrow";break;case"uparrow":i="uparrow",e.action=""}else if(this.enableRtl)switch(e.action){case"leftarrow":n=!0,i="leftarrow",e.action="rightarrow";break;case"rightarrow":n=!0,i="rightarrow",e.action="leftarrow"}switch(e.action){case"downarrow":case"uparrow":case"end":case"home":case"tab":this.upDownKeyHandler(e);break;case"rightarrow":this.rightEnterKeyHandler(e);break;case"leftarrow":this.leftEscKeyHandler(e);break;case"enter":this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}n&&(e.action=i)},n.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i="downarrow"===e.action||"home"===e.action||"tab"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,y);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(y),"end"!==e.action&&"home"!==e.action&&("downarrow"===e.action?s++:s--,s===("downarrow"===e.action?t.childElementCount:-1)&&(s=i)));var r=t.children[s];s=this.isValidLI(r,s,e.action),t.children[s].classList.add(y),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n="downarrow"===i||"home"===i||"tab"===i?0:s.childElementCount-1;return(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(I))&&("downarrow"===i&&t===s.childElementCount-1?t=n:"uparrow"===i&&0===t?t=n:"downarrow"===i||"rightarrow"===i?t++:"tab"===i&&e.classList.contains("e-separator")?t++:t--),(e=s.children[t])&&(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(I))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){var i=this;if(void 0===e&&(e=this.navIdx.length),this.isMenu){var s=[this.getWrapper()].concat([].slice.call(t.selectAll("."+x)))[e],n=[];return t.selectAll("."+x).forEach(function(e){(i.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&n.push(e)}),s=[this.getWrapper()].concat([].slice.call(n))[e],t.isNullOrUndefined(s)?null:t.select(".e-menu-parent",s)}return document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},n.prototype.rightEnterKeyHandler=function(e){var t,i=this.getUlByNavIdx(),s=this.getLIByClass(i,y);if(s){var n=this.getIdx(i,s),r=this.navIdx.concat(n),o=this.getItem(r);if(o.items.length)this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,o,-1,-1,e);else if("enter"===e.action){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([C],[this.getWrapper()]):s.classList.remove(y),s.classList.add(C),t={element:s,item:o,event:e},this.trigger("select",t);var a=s.querySelector(".e-menu-url");if(o.url&&a)switch(a.getAttribute("target")){case"_blank":window.open(o.url,"_blank");break;case"_parent":window.parent.location.href=o.url;break;default:window.location.href=o.url}this.closeMenu(null,e);var l=this.getLIByClass(this.getUlByNavIdx(),C);l&&(l.classList.add(y),l.focus())}}},n.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):"escape"===e.action&&this.closeMenu(null,e)},n.prototype.scrollHandler=function(e){this.closeMenu(null,e)},n.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},n.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},n.prototype.closeMenu=function(e,i,n){var r=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var o,a,l=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,g=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&g.classList.contains("e-menu")&&((l=this.getLIByClass(g,C))&&l.classList.remove(C),u=!0),!u){var v=i&&i.target&&this.getLI(i.target);this.cli=v||g.children[0],o=this.navIdx.length?this.getItem(this.navIdx):null,a=o?o.items:this.items,c={element:g,parentItem:o,items:a,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(l){var c,p,u,f="",b=!l.cancel;(b||r.isCMenu)&&(r.isMenu?(c=t.closest(g,"."+x),r.hamburgerMode&&(c.parentElement.style.minHeight="",t.closest(g,".e-menu-item").setAttribute("aria-expanded","false")),r.unWireKeyboardEvent(c),d(t.getInstance(c.children[0],m),c.children[0]),(u=t.getInstance(c,s.Popup)).hide(),f=c.id,u.destroy(),t.detach(c)):(r.isContextMenuClosed=!1,r.toggleAnimation(g,!1)),p={element:g,parentItem:o,items:a},r.trigger("onClose",p),r.navIdx.pop(),0===r.navIdx.length&&i&&"keyup"===i.type&&(r.showSubMenu=!1),r.isMenu||(t.EventHandler.remove(g,"keydown",r.keyHandler),"right"===r.keyType&&(r.keyType=""))),r.updateReactTemplate();var S,I,E,N=r.getWrapper()&&r.getUlByNavIdx();r.isCMenu&&(r.canOpen(i.target)&&r.openMenu(null,null,r.pageY,r.pageX,i),r.isCMenu=!1),r.isMenu&&N&&f.length?(S=new RegExp("(.*)-ej2menu-"+r.element.id+"-popup").exec(f)[1],I=N.querySelector('[id="'+S+'"]'),E=v&&N.querySelector('[id="'+v.id+'"]')):N&&(I=N.querySelector(".e-menu-item.e-selected"),E=v&&N.querySelector('[id="'+v.id+'"]'));var O=v&&v.querySelectorAll(".e-menu-item");if(b&&r.hamburgerMode&&e&&!O.length)r.afterCloseMenu(i);else if(b&&!r.hamburgerMode&&I&&!E&&"left"!==r.keyType&&(r.navIdx.length||!r.isMenu&&0===r.navIdx.length)){var w=i&&i.target.classList&&(i.target.classList.contains("e-vscroll")||i.target.classList.contains("e-scroll-nav"))?t.closest(i.target,".e-menu-wrapper"):null;w?(w=w.querySelector(".e-menu-item"),(r.showItemOnClick||w&&r.getIndex(w.id,!0).length<=r.navIdx.length)&&r.closeMenu(r.navIdx[r.navIdx.length-1],i,!0)):i&&i.target.classList&&i.target.classList.contains("e-nav-arrow")||r.closeMenu(r.navIdx[r.navIdx.length-1],i)}else if(b&&!n&&!e&&(r.hamburgerMode&&r.navIdx.length||1===r.navIdx.length&&v&&N!==v.parentElement))r.closeMenu(null,i);else if(b&&t.isNullOrUndefined(e)&&r.navIdx.length)r.closeMenu(null,i);else if(!b||r.isMenu||e||0!==r.navIdx.length||r.isMenusClosed||r.isCmenuHover)if(b&&r.isMenu&&i&&i.target&&0!==r.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))r.closeMenu(0,i);else if(b&&!r.isMenu&&t.selectAll(".e-menu-parent",h)[e-1]&&3===i.which)r.closeMenu(null,i);else{if(!b||"right"!==r.keyType&&"click"!==r.keyType){var L=r.getUlByNavIdx(),k=r.getLIByClass(L,C);if(k&&(k.setAttribute("aria-expanded","false"),k.classList.remove(C),(l.isFocused&&v||"left"===r.keyType)&&(k.classList.add(y),i.target&&i.target.classList.contains("e-edit-template")||k.focus())),!b&&r.hamburgerMode&&v&&"false"===v.getAttribute("aria-expanded")&&"true"===v.getAttribute("aria-haspopup")){t.closest(v,".e-menu-parent.e-control")?r.navIdx=[]:r.navIdx.pop(),r.navIdx.push(r.cliIdx);var A=r.getItem(r.navIdx);v.setAttribute("aria-expanded","true"),r.openMenu(v,A,-1,-1,i)}}else r.afterCloseMenu(i);r.navIdx.length<1&&("Hover"!==r.showSubMenuOn&&"Click"!==r.showSubMenuOn||(r.showItemOnClick=r.defaultOption,r.showSubMenuOn="Auto"))}else r.isMenusClosed=!0,r.closeMenu(0,i);r.removeStateWrapper()})}}},n.prototype.updateReactTemplate=function(){if(this.isReact&&this.template&&0===this.navIdx.length){var e=void 0;this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates()}},n.prototype.getMenuItemModel=function(e,i){if(t.isNullOrUndefined(e))return null;t.isNullOrUndefined(i)&&(i=0);var s=this.getFields(i);return{text:e[s.text],id:e[s.id],items:e[s.child],separator:e[s.separator],iconCss:e[s.iconCss],url:e[s.url]}},n.prototype.getPopups=function(){var e=this,i=[];return[].slice.call(document.querySelectorAll("."+x)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+S))&&e.getIndex(s.querySelector("."+S).id,!0).length&&i.push(s)}),i},n.prototype.isMenuVisible=function(){return this.navIdx.length>0||this.element.classList.contains("e-contextmenu")&&t.isVisible(this.element).valueOf()},n.prototype.canOpen=function(e){var i=!0;if(this.filter){i=!1;for(var s=this.filter.split(" "),n=0,r=s.length;n<r;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,r,o,a){var l=this;void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=this.targetElement);var d=this.getWrapper();this.lItem=e;var h=""!==this.element.id?this.element.id:"menu";if(this.isMenusClosed=!1,t.isNullOrUndefined(n)&&(n=-1),t.isNullOrUndefined(r)&&(r=-1),e){if(this.uList=this.createItems(i[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&t.Browser.isDevice){d.lastChild.style.display="none";var c={text:i[this.getField("text")].toString(),iconCss:"e-icons e-previous"};this.template&&(i.iconCss=(i.iconCss||"")+"e-icons e-previous");var p=new N(this.items[0],"items",this.template?i:c,!0),u=this.createItems([p]).children[0];u.classList.add(b),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+x,id:e.id+"-ej2menu-"+h+"-popup"}),this.hamburgerMode?(n=e.offsetHeight,e.appendChild(this.popupWrapper)):document.body.appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&t.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,o,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,i,o,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,d.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,i,o,n,r,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,o,n,r,"none"))}else if(this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(a||this.element).toString(),t.isNullOrUndefined(o)){var f=document.createEvent("MouseEvents");f.initEvent("click",!0,!1);var m=this.copyObject(f,{});m.target=m.srcElement=a,m.currentTarget=a,this.triggerBeforeOpen(e,this.uList,i,m,n,r,"none")}else this.triggerBeforeOpen(e,this.uList,i,o,n,r,"none")},n.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},n.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),s=parseInt(i.textIndent,10);this.navIdx.length<2&&!t.classList.contains("e-blankicon")?s*=2:s+=s/4,e.style.textIndent=s+"px";var n=e.querySelectorAll(".e-blankicon");if(n&&n.length)for(var r=e.querySelector(".e-menu-icon"),o=getComputedStyle(r),a=parseInt(o.marginRight,10)+r.offsetWidth+s,l=0;l<n.length;l++)n[l].style.textIndent=a+"px"},n.prototype.generatePopup=function(e,i,n,r){var o=this,a=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:r||this.enableRtl?"none":"flip",Y:"fit"},position:r&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:i,open:function(){var e=t.select(".e-menu-vscroll",a.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",a.element);a.element.style.maxHeight="",i.focus(),o.triggerOpen(i)}});return a},n.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var i=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.title):this.title,n=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:s}),r=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(r),e.insertBefore(i,this.element)},n.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},n.prototype.closeHamburgerMenu=function(e){var t=this,i={element:this.element,parentItem:null,event:e,items:this.items,cancel:!1};this.trigger("beforeClose",i,function(i){i.cancel||(t.closeMenu(null,e),t.element.classList.add("e-hide-menu"),t.trigger("onClose",{element:t.element,parentItem:null,items:t.items}))})},n.prototype.callFit=function(e,t,i,n,r){return s.fit(e,null,{X:t,Y:i},{top:n,left:r})},n.prototype.triggerBeforeOpen=function(e,i,s,n,r,o,l){var d,h=this,c=e?s[this.getField("children",this.navIdx.length-1)]:this.items,p={element:i,items:c,parentItem:s,event:n,cancel:!1,top:r,left:o,showSubMenuOn:"Auto"},u=l;this.trigger("beforeOpen",p,function(r){switch(u){case"menu":h.hamburgerMode||("Auto"!==r.showSubMenuOn&&(h.showItemOnClick=!h.defaultOption,h.showSubMenuOn=r.showSubMenuOn),h.top=r.top,h.left=r.left),h.popupWrapper.style.display="block",h.hamburgerMode||(h.popupWrapper.style.maxHeight=h.popupWrapper.getBoundingClientRect().height+"px",h.enableScrolling&&a(h.createElement,h.popupWrapper,h.uList,"vscroll",h.enableRtl),h.checkScrollOffset(n)),h.hamburgerMode||h.left||h.top?(h.popupObj.collision={X:"none",Y:"none"},h.popupWrapper.style.display=""):(h.popupObj.refreshPosition(h.lItem,!0),h.left=parseInt(h.popupWrapper.style.left,10),h.top=parseInt(h.popupWrapper.style.top,10),h.enableRtl&&(h.left=h.isNestedOrVertical?h.left-h.popupWrapper.offsetWidth-h.lItem.parentElement.offsetWidth+2:h.left-h.popupWrapper.offsetWidth+h.lItem.offsetWidth),h.template&&(h.isReact||h.isAngular)?requestAnimationFrame(function(){h.collision(),h.popupWrapper.style.display=""}):(h.collision(),h.popupWrapper.style.display=""));break;case"none":h.top=r.top,h.left=r.left,h.isContextMenuClosed=!0,d=r.element,h.enableScrolling&&h.isCMenu&&d&&d.parentElement&&(d.style.height=d.parentElement.style.height);break;case"hamburger":r.cancel||(h.element.classList.remove("e-hide-menu"),h.triggerOpen(h.element))}if("hamburger"!==u)if(r.cancel)h.isMenu?(h.popupObj.destroy(),t.detach(h.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),h.navIdx.pop();else if(h.isMenu)if(h.hamburgerMode)h.popupWrapper.style.top=h.top+"px",h.popupWrapper.style.left="0px",h.toggleAnimation(h.popupWrapper);else{h.setBlankIconStyle(h.popupWrapper),h.wireKeyboardEvent(h.popupWrapper),t.rippleEffect(h.popupWrapper,{selector:"."+S}),h.popupWrapper.style.left=h.left+"px",h.popupWrapper.style.top=h.top+"px";var o="None"!==h.animationSettings.effect?{name:h.animationSettings.effect,duration:h.animationSettings.duration,timingFunction:h.animationSettings.easing}:null;h.popupObj.show(o,h.lItem),t.Browser.isDevice&&(h.popupWrapper.style.left=h.left+"px")}else h.setBlankIconStyle(h.uList),h.setPosition(h.lItem,h.uList,h.top,h.left),h.toggleAnimation(h.uList);if("right"===h.keyType){var l=h.getUlByNavIdx();if(e.classList.remove(y),h.isMenu&&1===h.navIdx.length&&h.removeLIStateByClass([C],[h.getWrapper()]),e.classList.add(C),"enter"===h.action){var c={element:e,item:s,event:n};h.trigger("select",c)}e.focus(),l=h.getUlByNavIdx();var p=h.isValidLI(l.children[0],0,h.action);l.children[p].classList.add(y),l.children[p].focus()}})},n.prototype.collision=function(){var e;if(e=s.isCollide(this.popupWrapper,null,this.left,this.top),(this.isNestedOrVertical||this.enableRtl)&&(e.indexOf("right")>-1||e.indexOf("left")>-1)){this.popupObj.collision.X="none";var i=t.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth;this.left=this.enableRtl?s.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-i+2}((e=s.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")>-1||e.indexOf("right")>-1)&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},n.prototype.setBlankIconStyle=function(e){var t=[].slice.call(e.getElementsByClassName("e-blankicon"));if(t.length){var i=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)");if(i){var s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},r=getComputedStyle(s),o=parseInt(r.fontSize,10);parseInt(r.width,10)&&parseInt(r.width,10)>o&&(o=parseInt(r.width,10));var a=o+parseInt(r[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=a})}}}},n.prototype.checkScrollOffset=function(e){var i=this.getWrapper();if(i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length){var s=t.isNullOrUndefined(e)?this.element:t.closest(e.target,"."+S),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var r=n.scrollLeft+n.offsetWidth,o=s.offsetLeft+s.offsetWidth;r<o&&(n.scrollLeft+=o-r)}},n.prototype.setPosition=function(e,i,n,r){if(this.toggleVisiblity(i),i===this.element||r>-1&&n>-1){if((c=s.isCollide(i,null,r,n)).indexOf("right")>-1&&(r-=i.offsetWidth),c.indexOf("bottom")>-1&&(n=(h=this.callFit(i,!1,!0,n,r)).top-20)<0){var o=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;o>-1&&(n=o)}(c=s.isCollide(i,null,r,n)).indexOf("left")>-1&&(r=(h=this.callFit(i,!0,!1,n,r)).left)}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),r=Number(this.element.style.left.replace("px",""));else{var l=this.enableRtl?"left":"right",h=s.calculatePosition(e,l,"top");n=h.top,r=h.left;var c=s.isCollide(i,null,this.enableRtl?r-i.offsetWidth:r,n),p=c.indexOf("left")>-1||c.indexOf("right")>-1;p&&(r=(h=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||p)&&(r=this.enableRtl&&p?r:r-i.offsetWidth),c.indexOf("bottom")>-1&&(n=(h=this.callFit(i,!1,!0,n,r)).top)}this.toggleVisiblity(i,!1),this.isCMenu&&this.enableScrolling&&i&&(i.style.height="");var u=t.closest(this.element,".e-"+this.getModuleName()+"-wrapper");if(!this.isMenu&&this.enableScrolling&&i&&u&&u.offsetHeight>0){var f=t.closest(i,".e-menu-vscroll");i.style.display="block",f&&d(t.getInstance(f,m),f);var g=Math.ceil(this.getMenuWidth(i,i.offsetWidth,this.enableRtl)),v=a(this.createElement,u,i,"vscroll",this.enableRtl,u.offsetHeight);Object.assign(v.style,{top:n+"px",left:r+"px",width:g+"px",position:"absolute",display:"none"})}else i.style.top=n+"px",i.style.left=r+"px"},n.prototype.getMenuWidth=function(e,t,i){var s=e.getElementsByClassName("e-caret")[0];return s&&(t+=parseInt(getComputedStyle(s)[i?"marginRight":"marginLeft"],10)),t<120?120:t},n.prototype.toggleVisiblity=function(e,t){void 0===t&&(t=!0),e.style.visibility=t?"hidden":"",e.style.display=t?"block":"none"},n.prototype.createItems=function(e){var s=this,n=this.navIdx?this.navIdx.length:0,r=this.getFields(n),o=this.hasField(e,this.getField("iconCss",n)),a={showIcon:o,moduleName:"menu",fields:r,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[r.id]]||(e.curData[e.fields[r.id]]=t.getUniqueID("menuitem")),t.isNullOrUndefined(e.curData.htmlAttributes)&&(e.curData.htmlAttributes={}),t.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]?e.curData[e.fields.text]:e.curData[e.fields.id])),""===e.curData[e.fields[r.iconCss]]&&(e.curData[e.fields[r.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add("e-separator"),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator")),!o||e.curData[e.fields.iconCss]||e.curData[s.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length){var t=s.createElement("span",{className:"e-icons e-caret"});e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")}s.isMenu&&s.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"),e.item.removeAttribute("aria-level"));var i={item:e.curData,element:e.item};s.trigger("beforeItemRender",i)}};this.setProperties({items:this.items},!0),this.isMenu&&(a.templateID=this.element.id+"Template");var l=i.ListBase.createList(this.createElement,e,a,!this.template,this);return l.setAttribute("tabindex","0"),this.isMenu?l.setAttribute("role","menu"):l.setAttribute("role","menubar"),l},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i,this.isMenu||(this.isCmenuHover=!0);var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),r=this.getWrapper(),o=new RegExp("-ej2menu-(.*)-popup"),a=!1;if(n){if((""!==n.id?o.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([y,C],[this.getWrapper()]),!this.navIdx.length)return;a=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!a?(this.removeLIStateByClass([y],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([y],this.isMenu?[r].concat(this.getPopups()):[r]),s.classList.add(y),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!a&&this.removeLIStateByClass([y],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||i.parentElement===n||t.closest(i,".e-"+this.getModuleName()+"-popup")||s&&(!s||this.getIndex(s.id,!0).length)||"Hover"===this.showSubMenuOn?a&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([y],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},n.prototype.removeStateWrapper=function(){if(this.liTrgt){var e=t.closest(this.liTrgt,".e-menu-vscroll");"DIV"===this.liTrgt.tagName&&e&&this.removeLIStateByClass([y,C],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=0;n<i.length;n++)!function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})}(n)},n.prototype.getField=function(e,t){void 0===t&&(t=0);var i=this.fields[""+e];return"string"==typeof i?i:i[t]?i[t].toString():i[i.length-1].toString()},n.prototype.getFields=function(e){return void 0===e&&(e=0),{id:this.getField("itemId",e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},n.prototype.menuHeaderClickHandler=function(e){var i=t.closest(e.target,".e-menu-wrapper");i&&i.querySelector("ul.e-menu-parent").id!==this.element.id||(this.element.className.indexOf("e-hide-menu")>-1?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){this.isTapHold=!this.isTapHold&&this.isTapHold;var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),o=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,a=n&&o&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===o.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([y],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&o&&this.isMenu){var l=o.id?r.exec(o.id)[1]:o.querySelector(".e-menu-parent").id;if(this.element.id!==l)return}if(a&&"click"===e.type&&!n.classList.contains(b)){this.setLISelected(n);var d=this.getIndex(n.id,!0),h={element:n,item:this.getItem(d),event:e};this.trigger("select",h)}if(a&&("mouseover"===e.type||t.Browser.isDevice||this.showItemOnClick)){var c=void 0;if(n.classList.contains(b))c=i.children[this.navIdx.length-1],this.toggleAnimation(c),(f=this.getLIByClass(c,C))&&f.classList.remove(C),t.detach(n.parentNode),this.navIdx.pop();else if(!n.classList.contains("e-separator")){this.showSubMenu=!0;var p=n.parentNode;if(t.isNullOrUndefined(p))return;if(this.cliIdx=this.getIdx(p,n),this.isMenu||!t.Browser.isDevice){var u=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),t.closest(p,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,p);if(this.navIdx[u]===this.cliIdx&&(this.showSubMenu=!1),u!==this.navIdx.length&&("mouseover"!==e.type||this.showSubMenu)){var f=this.getLIByClass(p,C);f&&f.classList.remove(C),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(u+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if("DIV"===s.tagName&&t.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)){var m=this.isMenu?t.closest(s,"."+x):t.closest(s,".e-menu-vscroll"),g=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),m)+1:this.getIdx(i,t.select("ul.e-menu-parent",m));g<this.navIdx.length&&(this.closeMenu(g+1,e),m&&this.removeLIStateByClass([y,C],[m]))}else this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+S).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([C],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector(".e-caret"))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||navigator.platform.toUpperCase().indexOf("MAC")>=0&&!e.ctrlKey)&&this.closeMenu(null,e))},n.prototype.afterCloseMenu=function(e){if(!t.isNullOrUndefined(e)){var i;if(this.showSubMenu){i=this.showItemOnClick&&0===this.navIdx.length?t.closest(e.target,".e-menu-parent.e-control"):t.closest(this.element,".e-menu-parent.e-control");var s=this.navIdx.concat(this.cliIdx),n=this.getItem(s);if(n&&n[this.getField("children",s.length-1)]&&n[this.getField("children",s.length-1)].length?(("mouseover"===e.type||t.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&i||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,n,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!i){var r=this.getUlByNavIdx(),o=this.getLIByClass(r,C);o&&(o.setAttribute("aria-expanded","false"),o.classList.remove(C))}}this.keyType=""}},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,C);t&&t.classList.remove(C),this.isMenu||e.classList.remove(y),e.classList.add(C)},n.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},n.prototype.getItemIndex=function(e,t){var i;i="string"==typeof e?e:e.id;var s=!1!==t;return this.getIndex(i,s)},n.prototype.setItem=function(e,t,i){var s;s=i?t||e.id:t||e.text;var n=this.getIndex(s,i),r=this.getItem(n);Object.assign(r,e)},n.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},n.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},n.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},n.prototype.getIdx=function(e,i,s){void 0===s&&(s=!0);var n=!this.isMenu&&this.enableScrolling&&t.select(".e-menu-vscroll",e)?t.selectAll(".e-menu-parent",e):Array.from(e.children),r=Array.prototype.indexOf.call(n,i);return s&&e.children[0].classList.contains(b)&&r--,r},n.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:t.closest(e,"li.e-menu-item")},n.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},n.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},n.prototype.onPropertyChanged=function(e,i){for(var s=this,n=this.getWrapper(),r=this,o=0,l=Object.keys(e);o<l.length;o++)!function(o){switch(o){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":r.enableRtl?n.classList.add("e-rtl"):n.classList.remove("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var l;r.element.classList.contains("e-vertical")?a(r.createElement,n,r.element,"vscroll",r.enableRtl):a(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){l=t.select(".e-ul",e),a(s.createElement,e,l,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")||!r.isMenu?d(t.getInstance(h,m),h):d(t.getInstance(h,p),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,m),h),e.style.overflow=""})}break;case"items":var c=void 0,u=void 0,f=void 0;if(r.isReact&&r.template&&r.clearTemplate(["template"]),Object.keys(i.items).length)for(var g=Object.keys(e.items),v=0;v<g.length;v++)(u=r.getChangedItemIndex(e,[],Number(g[v]))).length<=r.getWrapper().children.length&&(c=u.pop(),f=r.getItems(u),r.insertAfter([f[c]],f[c].text),r.removeItem(f,u,c),r.setItems(f,u)),u.length=0;else{if(r.updateItem(r.element,r.items),r.enableScrolling&&r.element.parentElement.classList.contains("e-custom-scroll")&&(r.element.classList.contains("e-vertical")?a(r.createElement,n,r.element,"vscroll",r.enableRtl):a(r.createElement,n,r.element,"hscroll",r.enableRtl)),!r.hamburgerMode)for(var v=1,y=n.childElementCount;v<y;v++)t.detach(n.lastElementChild);r.navIdx=[]}}}(l[o])},n.prototype.updateItem=function(e,i){if(t.isBlazor()&&!this.isMenu)e=this.removeChildElement(e);else{if(this.enableScrolling){var s=this.getWrapper().children[0];this.element.classList.contains("e-vertical")?d(t.getInstance(s,m),s):d(t.getInstance(s,p),s)}e.innerHTML=""}[].slice.call(this.createItems(i).children).forEach(function(t){e.appendChild(t)})},n.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();if("items"===s){var n=e.items[i],r=Object.keys(n.items).pop();r&&this.getChangedItemIndex(n,t,Number(r))}else"isParentArray"===s&&t.length>1&&t.pop();return t},n.prototype.removeItem=function(e,i,s){e.splice(s,1);var n=this.getWrapper().children;i.length<n.length&&t.detach(n[i.length].children[s])},n.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var i=this.getWrapper();if(e){for(var n=void 0,r=void 0,o=t.selectAll(e),a=0,l=o.length;a<l;a++)n=o[a],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(r=t.getInstance(n,t.Touch))&&r.destroy():t.EventHandler.remove(n,"contextmenu",this.cmenuHandler);if(!this.isMenu){t.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var d=0,h=s.getScrollableParent(this.targetElement);d<h.length;d++){var c=h[d];t.EventHandler.remove(c,"scroll",this.scrollHandler)}}}t.Browser.isDevice||(t.EventHandler.remove(this.isMenu?document:i,"mouseover",this.delegateMoverHandler),t.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),t.EventHandler.remove(document,"keydown",this.domKeyHandler),this.isMenu||this.target||t.EventHandler.remove(document,"scroll",this.scrollHandler)),t.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(i),this.rippleFn()},n.prototype.unWireKeyboardEvent=function(e){var i=t.getInstance(e,t.KeyboardEvents);i&&i.destroy()},n.prototype.toggleAnimation=function(e,i){var s=this;void 0===i&&(i=!0);var n,r,o=this.enableScrolling&&!this.isMenu&&t.closest(e,".e-menu-vscroll")?t.closest(e,".e-menu-vscroll"):e;"None"!==this.animationSettings.effect&&i?this.animation.animate(o,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){s.hamburgerMode?(r=e.element.parentElement,e.element.style.position="absolute",r&&(n=r.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",r&&(r.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=s.isMenu?e.element.getBoundingClientRect().height+"px":e.element.scrollHeight+"px")},progress:function(e){s.hamburgerMode&&r&&(r.style.minHeight=n+e.element.offsetHeight+"px")},end:function(e){s.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",r&&(r.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),s.triggerOpen(e.element.children[0])):s.end(e.element,i)}}):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,i))},n.prototype.triggerOpen=function(e){var i=this.navIdx.length?this.getItem(this.navIdx):null,s={element:e,parentItem:i,items:i?i.items:this.items};this.trigger("onOpen",s),this.isMenu||t.EventHandler.add(e,"keydown",this.keyHandler,this)},n.prototype.end=function(e,i){if(i&&this.isContextMenuClosed)if((this.isMenu||!t.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&t.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(n=this.enableScrolling&&!this.isMenu?t.closest(e,".e-menu-vscroll"):null)&&(n.style.display="block"),this.triggerOpen(e),e.querySelector("."+y))e.querySelector("."+y).focus();else{var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];this.currentTarget?this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName||(s?s.querySelector("."+C).focus():this.element.focus()):s?s.querySelector("."+C).focus():this.element.focus()}else{var n=this.enableScrolling&&!this.isMenu?t.closest(e,".e-menu-vscroll"):null;if(n&&d(t.getInstance(n,m),n),e===this.element){var r=this.getLIByClass(this.element,y);r&&r.classList.remove(y);var o=this.getLIByClass(this.element,C);o&&o.classList.remove(C),e.style.display="none",this.isAnimationNone=!1}else t.detach(e)}},n.prototype.getPersistData=function(){return""},n.prototype.getWrapper=function(){return t.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},n.prototype.getIndex=function(e,t,i,s,n,r){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===r&&(r=0);var o;r=n?r+1:0;for(var a=0,l=i.length;a<l;a++){o=i[a];var d=t?o[this.getField("itemId",r)]:o[this.getField("text",r)];if((o.htmlAttributes&&"id"in o.htmlAttributes?o.htmlAttributes.id:d)===e){s.push(a);break}if(o[this.getField("children",r)]&&o[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,o[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(a);break}a!==l-1&&s.pop()}else a===l-1&&s.push(-1)}return n||-1!==s[0]?s:[]},n.prototype.enableItems=function(e,i,s){void 0===i&&(i=!0);for(var n,r,o,a,l="e-disabled",d=0;d<e.length;d++){if(o=this.getIndex(e[d],s),this.navIdx.length){if(1!==o.length){a=!1;for(var h=0,c=o.length-1;h<c;h++)if(o[h]!==this.navIdx[h]){a=!0;break}if(a)continue}}else if(1!==o.length)continue;r=o.pop(),(n=this.getUlByNavIdx(o.length))&&!t.isNullOrUndefined(r)&&(i?this.isMenu?(n.children[r].classList.remove(l),n.children[r].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(l):n.children[r].classList.remove(l):this.isMenu?(n.children[r].classList.add(l),n.children[r].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(l):n.children[r].classList.add(l))}},n.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},n.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},n.prototype.showHideItems=function(e,t,i){for(var s,n,r,o,a=0;a<e.length;a++)if(r=this.getIndex(e[a],i),n=r.pop(),s=this.getUlByNavIdx(r.length),o=this.getItems(r),s){var l=i?s.children[n].id:o[n].text.toString();t&&l===e[a]?s.children[n].classList.add(I):t||l!==e[a]||s.children[n].classList.remove(I)}},n.prototype.removeItems=function(e,i){for(var s,n,r,o=0;o<e.length;o++)s=(n=this.getIndex(e[o],i)).pop(),r=this.getItems(n),t.isNullOrUndefined(s)||this.removeItem(r,n,s)},n.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},n.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},n.prototype.insertItems=function(e,i,s,n){void 0===n&&(n=!0);for(var r,o,a,l,d,h=0;h<e.length;h++){o=(a=this.getIndex(i,s)).pop(),l=this.getItems(a),(d=new N(l[0],"items",e[h],!0)).parentObj=l[0].parentObj,l.splice(n?o+1:o,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(!t.isNullOrUndefined(o)&&a.length<c.length){o=n?o+1:o,r=this.createItems(l).children[o];var p=this.isMenu?t.select(".e-menu-parent",c[a.length]):c[a.length];p.insertBefore(r,p.children[o]),h!==e.length-1||this.isMenu||"block"!==p.style.display||(this.setPosition(null,p,parseFloat(p.style.top),parseFloat(p.style.left)),p.style.display="block")}}},n.prototype.removeAttributes=function(){var e=this;["top","left","display","z-index"].forEach(function(t){e.element.style.removeProperty(t)}),["role","tabindex","class","style"].forEach(function(t){"class"===t&&e.element.classList.contains("e-menu-parent")&&e.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(t)&&e.element.getAttribute(t)||e.element.removeAttribute(t),e.isMenu&&"class"===t&&e.element.classList.contains("e-vertical")&&e.element.classList.remove("e-vertical")})},n.prototype.destroy=function(){var i=this.getWrapper();if(i){if(this.unWireEvents(),this.isMenu)this.closeMenu(),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),i.parentNode.insertBefore(this.element,i),this.clonedElement=null;else{if(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName)t.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement;else if(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)){var s=this.clonedElement.nextElementSibling;s&&s!==i?this.clonedElement.parentElement.insertBefore(this.element,s):this.clonedElement.parentElement.appendChild(this.element),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",t.append([].slice.call(this.clonedElement.children),this.element),t.detach(this.clonedElement),this.removeAttributes()}this.clonedElement=null}t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}this.rippleFn=null},v([t.Event()],n.prototype,"beforeItemRender",void 0),v([t.Event()],n.prototype,"beforeOpen",void 0),v([t.Event()],n.prototype,"onOpen",void 0),v([t.Event()],n.prototype,"beforeClose",void 0),v([t.Event()],n.prototype,"onClose",void 0),v([t.Event()],n.prototype,"select",void 0),v([t.Event()],n.prototype,"created",void 0),v([t.Property("")],n.prototype,"cssClass",void 0),v([t.Property(0)],n.prototype,"hoverDelay",void 0),v([t.Property(!1)],n.prototype,"showItemOnClick",void 0),v([t.Property("")],n.prototype,"target",void 0),v([t.Property("")],n.prototype,"filter",void 0),v([t.Property(null)],n.prototype,"template",void 0),v([t.Property(!1)],n.prototype,"enableScrolling",void 0),v([t.Property(!0)],n.prototype,"enableHtmlSanitizer",void 0),v([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},E)],n.prototype,"fields",void 0),v([t.Collection([],N)],n.prototype,"items",void 0),v([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},O)],n.prototype,"animationSettings",void 0),n=v([t.NotifyPropertyChanges],n)}(t.Component),L=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(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)}}(),k=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},A="e-toolbar-items",T="e-toolbar-item",P="e-toolbar-popup",D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),k([t.Property("")],i.prototype,"id",void 0),k([t.Property("")],i.prototype,"text",void 0),k([t.Property("auto")],i.prototype,"width",void 0),k([t.Property("")],i.prototype,"cssClass",void 0),k([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),k([t.Property(!1)],i.prototype,"disabled",void 0),k([t.Property("")],i.prototype,"prefixIcon",void 0),k([t.Property("")],i.prototype,"suffixIcon",void 0),k([t.Property(!0)],i.prototype,"visible",void 0),k([t.Property("None")],i.prototype,"overflow",void 0),k([t.Property("")],i.prototype,"template",void 0),k([t.Property("Button")],i.prototype,"type",void 0),k([t.Property("Both")],i.prototype,"showTextOn",void 0),k([t.Property(null)],i.prototype,"htmlAttributes",void 0),k([t.Property("")],i.prototype,"tooltipText",void 0),k([t.Property("Left")],i.prototype,"align",void 0),k([t.Event()],i.prototype,"click",void 0),k([t.Property(-1)],i.prototype,"tabIndex",void 0),i}(t.ChildProperty),M=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.resizeContext=s.resize.bind(s),s.orientationChangeContext=s.orientationChange.bind(s),s.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return L(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular)&&this.clearTemplate();var s=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(s).forEach(function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.ej2_instances)||t.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),t.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},i.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains("e-vertical"),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},i.prototype.wireKeyboardEvent=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),t.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},i.prototype.updateTabIndex=function(e){var i=this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )");if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.firstElementChild)){var s=i.firstElementChild.getAttribute("data-tabindex");s&&"-1"===s&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)}},i.prototype.unwireKeyboardEvent=function(){this.keyModule&&(t.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},i.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var i=!t.isNullOrUndefined(this.popObj)&&t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&i&&this.popObj.hide({name:"FadeOut",duration:100}),(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},i.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},i.prototype.docEvent=function(e){var i=t.closest(e.target,".e-popup");this.popObj&&t.isVisible(this.popObj.element)&&!i&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},i.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,"e-tbar-pos"),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+T)).forEach(function(e){t.detach(e)}),this.tbarAlign){var e=this.element.querySelector("."+A);[].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,"e-tbar-pos")}this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,"e-rtl"),this.destroyScroll()),this.remove(this.element,"e-tbar-extended"),this.remove(this.element,"e-extended-toolbar");var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,"e-toolbar-multirow"),this.popObj&&this.popupRefresh(this.popObj.element,!0)},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},i.prototype.clstElement=function(e,i){return e&&this.popObj&&t.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+T):this.element===i||e?this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )"):t.closest(i,"."+T)},i.prototype.keyHandling=function(e,i,s,n,r){var o,a,l=this.popObj,d=this.element,h={name:"FadeOut",duration:100},c="moveUp"===i.action?"previous":"next";switch(i.action){case"moveRight":if(this.isVertical)return;d===s?this.elementFocus(e):n||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;n||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var p=t.closest(e,".e-popup"),u=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&u&&u.classList.contains("e-popup-open")&&(p="end"===i.action?u:null),p?t.isVisible(this.popObj.element)&&(a=[].slice.call(p.children),o="home"===i.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)):(a=this.element.querySelectorAll("."+A+" ."+T+":not(.e-separator)"),o="home"===i.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)),o&&this.elementFocus(o)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(l&&t.closest(s,".e-popup")){var f=l.element,m=f.firstElementChild;"previous"===c&&m===e?f.lastElementChild.firstChild.focus():"next"===c&&f.lastElementChild===e?m.firstChild.focus():this.eleFocus(e,c)}else"moveDown"===i.action&&l&&t.isVisible(l.element)&&this.elementFocus(e);break;case"tab":if(!r&&!n){var g=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(g),g.focus()))}break;case"popupClose":l&&"Extended"!==this.overflowMode&&l.hide(h);break;case"popupOpen":if(!n)return;l&&!t.isVisible(l.element)?(l.element.style.top=d.offsetHeight+"px",l.show({name:"FadeIn",duration:100})):l.hide(h)}},i.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains("e-overlay")){e.preventDefault();var i=t.classList.contains("e-hor-nav"),s=t.classList.contains("e-scroll-nav"),n=this.clstElement(i,t);(n||s)&&this.keyHandling(n,e,t,i,s)}},i.prototype.disable=function(e){var i=this.element;e?i.classList.add("e-overlay"):i.classList.remove("e-overlay"),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),i.querySelector("#"+i.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},i.prototype.eleContains=function(e){return e.classList.contains("e-separator")||e.classList.contains("e-overlay")||e.getAttribute("disabled")||e.classList.contains("e-hidden")||!t.isVisible(e)||!e.classList.contains(T)},i.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains("e-hidden")&&!i.classList.contains("e-overlay"))return i;t++}},i.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;t>=0;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains("e-hidden")&&!i.classList.contains("e-overlay"))return i;t--}},i.prototype.eleFocus=function(e,i){var s=Object(e)[i+"ElementSibling"];if(s){if(this.eleContains(s))return void this.eleFocus(s,i);this.elementFocus(s)}else if(this.tbarAlign){var n=Object(e.parentElement)[i+"ElementSibling"];if(t.isNullOrUndefined(n)||0!==n.children.length||(n=Object(n)[i+"ElementSibling"]),!t.isNullOrUndefined(n)&&n.children.length>0)if("next"===i){r=n.querySelector("."+T);this.eleContains(r)?this.eleFocus(r,i):(r.firstElementChild.focus(),this.activeEleSwitch(r))}else{var r=n.lastElementChild;this.eleContains(r)?this.eleFocus(r,i):this.elementFocus(r)}}else if(!t.isNullOrUndefined(e)){var o=this.element.querySelectorAll("."+A+" ."+T+":not(.e-separator):not(.e-overlay):not(.e-hidden)");"next"===i&&o?this.elementFocus(o[0]):"previous"===i&&o&&this.elementFocus(o[o.length-1])}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,r=!t.isNullOrUndefined(t.closest(s,".e-toolbar-pop")),o=s.classList,a=t.closest(s,".e-hor-nav");a||(a=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!o.contains("e-hor-nav")||(o=s.querySelector(".e-icons").classList),(o.contains("e-popup-up-icon")||o.contains("e-popup-down-icon"))&&this.popupClickHandler(n,a,"e-rtl");var l,d=t.closest(e.target,"."+T);if(!t.isNullOrUndefined(d)&&!d.classList.contains("e-overlay")||a.classList.contains("e-hor-nav")){d&&(l=this.items[this.tbarEle.indexOf(d)]);var h={originalEvent:e,item:l};(l&&!t.isNullOrUndefined(l.click)&&"object"==typeof l.click?!t.isNullOrUndefined(l.click.observers)&&l.click.observers.length>0:!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(l.click))&&this.trigger("items["+this.tbarEle.indexOf(d)+"].click",h),h.cancel||this.trigger("clicked",h,function(e){!t.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})}},i.prototype.popupClickHandler=function(e,i,s){var n=this.popObj;t.isVisible(n.element)?(i.classList.remove("e-nav-active"),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(s)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(s)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(n.element.style.minHeight="0px",n.width=this.getToolbarPopupWidth(this.element)),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px",i.classList.add("e-nav-active"),n.show({name:"FadeIn",duration:100}))},i.prototype.getToolbarPopupWidth=function(e){var t=window.getComputedStyle(e);return parseFloat(t.width)+2*parseFloat(t.borderRightWidth)},i.prototype.render=function(){var e=this;this.initialize(),this.renderControl(),this.wireEvents(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderComplete(),this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){e.refreshOverflow()})},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);"msie"===t.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||t.setStyleAttribute(this.element,{height:i}),t.setStyleAttribute(this.element,{width:e});var s={role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};t.attributes(this.element,s),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},i.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},i.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},i.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),(s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s.appendChild(i)):t.appendChild(i);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},i.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove("e-vertical"),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add("e-vertical"),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),t.setStyleAttribute(this.element,{height:t.formatUnit(this.height),width:t.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},i.prototype.initScroll=function(e,i){if(!this.scrollModule&&this.checkOverflow(e,i[0])){this.tbarAlign&&this.element.querySelector("."+A+" .e-toolbar-center").removeAttribute("style"),this.isVertical?this.scrollModule=new m({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new p({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.cssClass&&t.addClass([i[0]],this.cssClass.split(" "));var s=this.scrollModule.element.querySelector(".e-hscroll-bar, .e-vscroll-bar");s&&s.removeAttribute("tabindex"),this.remove(this.scrollModule.element,"e-tbar-pos"),t.setStyleAttribute(this.element,{overflow:"hidden"})}},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+T,e)).forEach(function(e){t.isVisible(e)&&(i=window.getComputedStyle(e),n+=s.isVertical?e.offsetHeight:e.offsetWidth,n+=parseFloat(s.isVertical?i.marginTop:i.marginRight),n+=parseFloat(s.isVertical?i.marginBottom:i.marginLeft))}),n},i.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},i.prototype.checkOverflow=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||!t.isVisible(e))return!1;var s=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?i.offsetHeight:i.offsetWidth;(this.tbarAlign||this.scrollModule||s===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(i):i));var r=e.querySelector(".e-hor-nav"),o=e.querySelector(".e-scroll-nav"),a=0;return r?a=this.isVertical?r.offsetHeight:r.offsetWidth:o&&(a=this.isVertical?2*o.offsetHeight:2*o.offsetWidth),n>s-a},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,"e-tbar-pos"),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+A),s=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===t.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":t.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(A)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,i)||s)&&this.setOverflowAttributes(e),this.toolbarAlign(i);break;case"MultiRow":this.add(i,"e-toolbar-multirow"),this.checkOverflow(e,i)&&this.tbarAlign&&(this.removePositioning(),this.add(i,"e-multirow-pos")),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==t.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,"e-extended-toolbar"),(this.checkOverflow(e,i)||s)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(i)}},i.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(t.selectAll("."+A+" ."+T,e)));var i={tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"};t.attributes(this.element.querySelector(".e-hor-nav"),i)},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll(".e-separator")),i=e.querySelector(".e-multirow-separator"),s=e.querySelector(".e-extended-separator"),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove("e-multirow-separator"):"Extended"===this.overflowMode&&n.classList.remove("e-extended-separator"));for(var r=0;r<=t.length-1;r++)t[parseInt(r.toString(),10)].offsetLeft<30&&0!==t[parseInt(r.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(r.toString(),10)].classList.add("e-multirow-separator"):"Extended"===this.overflowMode&&t[parseInt(r.toString(),10)].classList.add("e-extended-separator"))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector(".e-hor-nav"),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector(".e-hor-nav");var r=n?s.offsetHeight:s.offsetWidth,o=(n?e.offsetHeight:e.offsetWidth)-r;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,o,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,r){var o=e.element,a=[].slice.call(t.selectAll("."+P,o.querySelector("."+A))),l=t.selectAll(".e-overflow-show",s),d=0,h=0;a.forEach(function(o,a){l=t.selectAll(".e-overflow-show",s),o.classList.contains("e-overflow-show")&&l.length>0?e.tbResize&&l.length>a?(s.insertBefore(o,l[parseInt(a.toString(),10)]),++h):(s.insertBefore(o,s.children[l.length]),++h):o.classList.contains("e-overflow-show")?(s.insertBefore(o,s.firstChild),++h):e.tbResize&&o.classList.contains("e-overflow-hide")&&s.children.length>0&&0===l.length?(s.insertBefore(o,s.firstChild),++h):o.classList.contains("e-overflow-hide")?i.push(o):e.tbResize?(s.insertBefore(o,s.childNodes[d+h]),++d):s.appendChild(o),o.classList.contains("e-separator")?t.setStyleAttribute(o,{display:"",height:r+"px"}):t.setStyleAttribute(o,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+T,o.querySelector("."+A)),p=c.length-1;p>=0;p--){var u=c[parseInt(p.toString(),10)];if(!u.classList.contains("e-separator")||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,i,s=this.element;"Extended"===this.overflowMode&&(i=s.querySelector(".e-separator"),e="auto"===s.style.height||""===s.style.height?null:i&&i.offsetHeight);var n,r=s.querySelector("."+T+":not(.e-separator):not(."+P+")"),o="auto"===s.style.height||""===s.style.height?null:r&&r.offsetHeight,a=[];if(t.select("#"+s.id+"_popup.e-toolbar-pop",s))n=t.select("#"+s.id+"_popup.e-toolbar-pop",s);else{var l=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop e-toolbar-extended"}),d=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop"});n="Extended"===this.overflowMode?l:d}this.pushingPoppedEle(this,a,n,o,e),this.popupInit(s,n)},i.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},i.prototype.popupInit=function(e,i){if(this.popObj){if("Extended"!==this.overflowMode){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}}else{e.appendChild(i),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),t.setStyleAttribute(this.element,{overflow:""});var r=new s.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if("Extended"===this.overflowMode&&(r.width=this.getToolbarPopupWidth(this.element),r.offsetX=0),r.appendTo(i),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(r.element.style.maxHeight=r.element.offsetHeight+"px"),this.isVertical&&(r.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector(".e-hor-nav");o.classList.add("e-nav-active"),t.classList(o.firstElementChild,["e-popup-up-icon"],["e-popup-down-icon"]),this.element.querySelector(".e-toolbar-extended").classList.add("e-popup-open")}else r.hide();this.popObj=r}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,"e-tbar-extended"):this.remove(this.element,"e-tbar-extended"))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,o=r.querySelector(".e-hor-nav");o.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?i.element.style.minHeight="":(t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px");var a=n.offsetTop+n.offsetHeight+s.calculatePosition(r).top,l=o.firstElementChild;o.classList.add("e-nav-active"),t.classList(l,["e-popup-up-icon"],["e-popup-down-icon"]),this.tbarPopupHandler(!0);var d=t.isNullOrUndefined(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+d<a&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(a-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[parseInt(c.toString(),10)];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}"Extended"!==this.overflowMode&&t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical&&"Extended"!==this.overflowMode){var u=this.element.getBoundingClientRect();t.setStyleAttribute(i.element,{maxHeight:u.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(i){var f=n.getBoundingClientRect();f.right>document.documentElement.clientWidth&&f.width>r.getBoundingClientRect().width&&(i.collision={Y:"none"},i.dataBind()),i.refreshPosition()}},i.prototype.popupClose=function(e){var i=this.element.querySelector(".e-hor-nav");i.setAttribute("aria-expanded","false");var s=i.firstElementChild;i.classList.remove("e-nav-active"),t.classList(s,["e-popup-down-icon"],["e-popup-up-icon"]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var r,o=this.popupPriCount>0,a=s,l=0,d=0,h=0,c=function(e,t){var i=!1;return t.forEach(function(t){e.classList.contains(t)&&(i=!0)}),i},p=i.length-1;p>=0;p--){var u=void 0,f=window.getComputedStyle(i[parseInt(p.toString(),10)]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[parseInt(p.toString(),10)]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),r=this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth;var g=m?r+u:r;if(c(i[parseInt(p.toString(),10)],["e-popup-alone"])&&o&&(i[parseInt(p.toString(),10)].classList.add(P),this.isVertical?t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minHeight:g+"px"}):t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minWidth:g+"px"}),h++),this.isVertical?i[parseInt(p.toString(),10)].offsetTop+i[parseInt(p.toString(),10)].offsetHeight+u>s:i[parseInt(p.toString(),10)].offsetLeft+i[parseInt(p.toString(),10)].offsetWidth+u>s){if(i[parseInt(p.toString(),10)].classList.contains("e-separator")){if("Extended"===this.overflowMode)c(v=i[parseInt(p.toString(),10)],["e-separator","e-ignore"])&&(i[parseInt(p.toString(),10)].classList.add(P),h++),d++;else if("Popup"===this.overflowMode){if(l>0&&d===h){var v=i[p+d+(l-1)];c(v,["e-separator","e-ignore"])&&t.setStyleAttribute(v,{display:"none"})}l++,d=0,h=0}}else d++;i[parseInt(p.toString(),10)].classList.contains("e-overflow-show")&&n?s-=(this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth)+u:c(i[parseInt(p.toString(),10)],["e-separator","e-ignore"])?s-=(this.isVertical?i[parseInt(p.toString(),10)].offsetHeight:i[parseInt(p.toString(),10)].offsetWidth)+u:(i[parseInt(p.toString(),10)].classList.add(P),this.isVertical?t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minHeight:g+"px"}):t.setStyleAttribute(i[parseInt(p.toString(),10)],{display:"none",minWidth:g+"px"}),h++)}}if(n){var y=t.selectAll("."+T+":not(."+P+")",this.element);this.checkPriority(e,y,a,!1)}},i.prototype.createPopupIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-hor-nav");s="Extended"===this.overflowMode?s+" e-expended-nav":s;var n=this.createElement("div",{id:i,className:s});"msie"!==t.Browser.info.name&&"edge"!==t.Browser.info.name||n.classList.add("e-ie-align");var r=this.createElement("div",{className:"e-popup-down-icon e-icons"});n.appendChild(r),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,r,o,a,l,d){var h=l,c=this.popObj.element,p=t.selectAll("."+P+":not(.e-overflow-show)",c).length,u=function(e,t){return e.classList.contains(t)};if(0===t.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length){var f=e.children[i-(i-s)-1],m=!t.isNullOrUndefined(f)&&u(f,"e-ignore");if(!t.isNullOrUndefined(f)&&u(f,"e-separator")&&!t.isVisible(f)||m){f.style.display="unset";var g=f.offsetWidth+2*parseFloat(window.getComputedStyle(f).marginRight),v=f.previousElementSibling;o+g<a||r?(e.insertBefore(n,e.children[i+h-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):(t.setStyleAttribute(n,d),v.classList.contains("e-separator")&&(v.style.display="none")),f.style.display=""}else e.insertBefore(n,e.children[i+h-(i-s)])}else e.insertBefore(n,e.children[i+h-p])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,r=this.isVertical,o=n.querySelector("."+A),a=n.querySelector(".e-hor-nav");if(!t.isNullOrUndefined(a)){o.removeAttribute("style"),e.style.display="block";var l;l=r?n.offsetHeight-(a.offsetHeight+o.offsetHeight):n.offsetWidth-(a.offsetWidth+o.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),l+(r?a.offsetHeight:a.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(l,e,i),e.style.display="",0===e.children.length&&a&&this.popObj&&(t.detach(a),a=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null)}},i.prototype.ignoreEleFetch=function(e,t){var i=[].slice.call(t.querySelectorAll(".e-ignore")),s=[],n=0;return i.length>0?(i.forEach(function(e){s.push([].slice.call(t.children).indexOf(e))}),s.forEach(function(t){t<=e&&n++}),n):0},i.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var s=e.offsetWidth-e.querySelector(".e-hor-nav").offsetWidth,n=e.querySelector("."+A).offsetWidth;return t.style.removeProperty("display"),s>i+n},i.prototype.popupEleWidth=function(e){e.style.position="absolute";var i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains("e-popup-text")){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains("e-popup-text")?s.style.display="none":!t.isNullOrUndefined(s)&&e.classList.contains("e-toolbar-text")&&(s.style.display="block"),n.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),n.style.minWidth="",n.style.minHeight="",t.isNullOrUndefined(s)||(s.style.display="")}return i},i.prototype.popupEleRefresh=function(e,i,s){for(var n,r,o=this.popupPriCount>0,a=this.tbarEle,l=this.element.querySelector("."+A),d=0,h=this,c=0,p=[].slice.call(i.children);c<p.length&&"break"!==function(i){if(i.classList.contains("e-popup-alone")&&o&&!s)return"continue";var c=h.popupEleWidth(i);if(i===h.tbarEle[0]&&(c+=h.tbarEleMrgn),i.style.position="",!(c<e||s))return"break";var p={minWidth:i.style.minWidth,height:i.style.height,minHeight:i.style.minHeight};if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains("e-overflow-hide")||i.classList.remove(P),r=h.tbarEle.indexOf(i),h.tbarAlign){var u=h.items[parseInt(r.toString(),10)].align;r=h.tbarAlgEle[(u+"s").toLowerCase()].indexOf(i),a=h.tbarAlgEle[(u+"s").toLowerCase()],l=h.element.querySelector("."+A+" .e-toolbar-"+u.toLowerCase())}var f=0;"Extended"!==h.overflowMode&&a.slice(0,r).forEach(function(t){(t.classList.contains("e-overflow-show")||t.classList.contains("e-separator"))&&(t.classList.contains("e-separator")&&(t.style.display="",e-=t.offsetWidth),f++)}),d=h.ignoreEleFetch(r,l),i.classList.contains("e-overflow-show")?(h.tbarPriRef(l,r,f,i,s,c,e,d,p),e-=i.offsetWidth):0===r?(l.insertBefore(i,l.firstChild),e-=i.offsetWidth):(n=t.selectAll(".e-overflow-show",h.popObj.element).length,l.insertBefore(i,l.children[r+d-n]),e-=i.offsetWidth),i.style.height=""}(p[c]);c++);this.checkOverflow(this.element,this.element.getElementsByClassName(A)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+A);if(!t.isNullOrUndefined(e)&&e.classList.contains("e-tbar-pos")){this.remove(e,"e-tbar-pos");var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+A);this.add(e,"e-tbar-pos"),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+A);if(!t.isNullOrUndefined(i)&&i.classList.contains("e-tbar-pos")){var s,n=this.element.querySelector(".e-hor-nav");if(this.scrollModule){var r=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+r).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var o=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){o-=this.isVertical?n.offsetHeight:n.offsetWidth;var a=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=a:s[2].style.bottom=a:this.enableRtl?s[2].style.left=a:s[2].style.right=a}if(!(o<=e)){var l=(o-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+l+"px";this.isVertical?this.enableRtl?s[1].style.marginBottom=d:s[1].style.marginTop=d:this.enableRtl?s[1].style.marginRight=d:s[1].style.marginLeft=d}}},i.prototype.tbarItemAlign=function(e,t,i){var s=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var n=[];if(n.push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),n.push(this.createElement("div",{className:"e-toolbar-center",attrs:{role:"group"}})),n.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align)n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,"e-tbar-pos");else if("Left"!==e.align){var r=t.childNodes,o=n[0];[].slice.call(r).forEach(function(e){s.tbarAlgEle.lefts.push(e),o.appendChild(e)}),t.appendChild(o),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,"e-tbar-pos")}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,A),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(i){"DIV"===i.tagName&&(e.tbarEle.push(i),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","false"),e.add(i,T))})},i.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var i=void 0;e&&e.children.length>0&&(i=e.querySelector("."+A)),i||(i=this.createElement("div",{className:A})),this.itemsAlign(t,i),e.appendChild(i)}},i.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},i.prototype.enableItems=function(e,i){var s,n=e,r=n.length;t.isNullOrUndefined(i)&&(i=!0);var o=function(e,i){e?(i.classList.remove("e-overlay"),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","false")):(i.classList.add("e-overlay"),t.isNullOrUndefined(i.firstElementChild)||i.firstElementChild.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(r)&&r>=1){for(var a=0,l=[].slice.call(n);a<r;a++){var d=l[parseInt(a.toString(),10)];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[parseInt(a.toString(),10)]=s}else s=d;o(i,s)}i?t.removeClass(n,"e-overlay"):t.addClass(n,"e-overlay")}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;o(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},i.prototype.addItems=function(e,i){var s;this.extendedOpen();var n=this.element.querySelector("."+A);if(t.isNullOrUndefined(n))return void this.itemsRerender(e);var r,o="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==o||(o=e.align)});for(var a=0,l=e;a<l.length;a++){var d=l[a];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+T,this.element),d.align=o,r=this.renderSubComponent(d,i),this.tbarEle.length>=i&&s.length>=0){t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var h="L"===d.align[0]?0:"C"===d.align[0]?1:2,c=void 0;this.tbarAlign||"Left"===o?this.tbarAlign?((c=t.closest(s[0],"."+A).children[parseInt(h.toString(),10)]).insertBefore(r,c.children[parseInt(i.toString(),10)]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,r),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+A,this.element))[0].appendChild(r):s[0].parentNode.insertBefore(r,s[parseInt(i.toString(),10)]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+A).children[parseInt(h.toString(),10)]).appendChild(r),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(r),this.refreshPositioning()),this.items.splice(i,0,d),d.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(i,0,r),i++,this.offsetWid=n.offsetWidth}}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.removeItems=function(e){var i,s=e,n=[].slice.call(t.selectAll("."+T,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var r=0,o=[].slice.call(s);r<o.length;r++){a=o[r];i=this.tbarEle.indexOf(a),this.removeItemByIndex(i,n),n=t.selectAll("."+T,this.element)}else{var a=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(a),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[parseInt(e.toString(),10)]&&i[parseInt(e.toString(),10)]){var s=this.tbarEle.indexOf(i[parseInt(e.toString(),10)]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[parseInt(s.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(s.toString(),10)]);this.tbarAlgEle[(this.items[parseInt(s.toString(),10)].align+"s").toLowerCase()].splice(parseInt(n.toString(),10),1)}this.isReact&&this.clearToolbarTemplate(i[parseInt(e.toString(),10)]);var r=i[parseInt(e.toString(),10)].querySelector(".e-control.e-btn");t.isNullOrUndefined(r)||t.isNullOrUndefined(r.ej2_instances[0])||r.ej2_instances[0].isDestroyed||r.ej2_instances[0].destroy(),t.detach(i[parseInt(e.toString(),10)]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var r,o=s.type,a=e;if("object"==typeof e&&(r="function"==typeof a.appendTo),"string"!=typeof e&&r){if("Input"===o){var l=this.createElement("input");s.id?l.id=s.id:l.id=t.getUniqueID("tbr-ipt"),i.appendChild(l),a.appendTo(l)}}else{var d=void 0,h=e,c=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);h="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName))if("string"==typeof e&&c.test(h))i.innerHTML=h;else if(document.querySelectorAll(h).length){var p=(l=document.querySelector(h)).outerHTML.trim();i.appendChild(l),l.style.display="",t.isNullOrUndefined(p)||this.tempId.push(h)}else d=t.compile(h);else i.appendChild(e)}catch(e){d=t.compile(h)}var u=void 0;t.isNullOrUndefined(d)||(u=d({},this,"template",this.element.id+n+"_template",this.isStringTemplate,void 0,void 0,this.root)),!t.isNullOrUndefined(u)&&u.length>0&&[].slice.call(u).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template");var f=i.firstElementChild;t.isNullOrUndefined(f)||(f.setAttribute("tabindex",t.isNullOrUndefined(f.getAttribute("tabIndex"))?"-1":this.getDataTabindex(f)),f.setAttribute("data-tabindex",t.isNullOrUndefined(f.getAttribute("tabIndex"))?"-1":this.getDataTabindex(f))),this.tbarEle.push(i)},i.prototype.buttonRendering=function(e,i){var s=this.createElement("button",{className:"e-tbar-btn"});s.setAttribute("type","button");var r,o,a=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var l=this.createElement("span",{className:"e-tbar-btn-text"});a?(l.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(a):a,s.appendChild(l),s.classList.add("e-tbtn-txt")):this.add(i,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(r=e.prefixIcon+" e-icons",o="Left"):(r=e.suffixIcon+" e-icons",o="Right"));var d=new n.Button({iconCss:r,iconPosition:o});return d.createElement=this.createElement,d.appendTo(s),e.width&&t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),s},i.prototype.renderSubComponent=function(e,i){var s,n=this.createElement("div",{className:T}),r=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!t.isNullOrUndefined(e.tooltipText)?t.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",r.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,i);else switch(e.type){case"Button":(s=this.buttonRendering(e,n)).setAttribute("tabindex",t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),s.setAttribute("data-tabindex",t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),s.setAttribute("aria-label",e.text||e.tooltipText),s.setAttribute("aria-disabled","false"),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,"e-separator")}if(e.showTextOn){var o=e.showTextOn;"Toolbar"===o?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===o&&this.add(n,"e-popup-text")}if(e.overflow){var a=e.overflow;"Show"===a?this.add(n,"e-overflow-show"):"Hide"===a&&(n.classList.contains("e-separator")||this.add(n,"e-overflow-hide"))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains("e-separator")&&(this.add(n,"e-popup-alone"),this.popupPriCount++),e.disabled&&this.add(n,"e-overlay"),!1===e.visible&&this.add(n,"e-hidden"),n},i.prototype.getDataTabindex=function(e){return t.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},i.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){var i=this.element.querySelector("."+T+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )");if(t.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle))if(t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")){if(!t.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")){this.updateTabIndex("0");var s="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i);i.setAttribute("tabindex",s)}else this.updateTabIndex("-1");e.removeAttribute("tabindex")}else{var n=parseInt(this.getDataTabindex(this.activeEle),10)+1;this.activeEle.setAttribute("tabindex",n.toString())}},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"toolbar"},i.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var i=this.checkOverflow(e,e.getElementsByClassName(A)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+A);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,"e-tbar-pos"))}i&&this.scrollModule&&this.offsetWid===e.offsetWidth||((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()),this.element.querySelector(".e-hscroll-bar")&&(this.scrollStep=this.element.querySelector(".e-hscroll-bar").offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator())},i.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},i.prototype.extendedOpen=function(){var e=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var o=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===o?r.firstElementChild.setAttribute("tabindex","0"):o!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",o);break}r=n[++s]}},i.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var i=this.registeredTemplate,s=0;s<i.template.length;s++){var n=i.template[parseInt(s.toString(),10)].rootNodes[0],r=t.closest(n,"."+T);if(!t.isNullOrUndefined(r)&&r===e){this.clearTemplate(["template"],[i.template[parseInt(s.toString(),10)]]);break}}else if(this.portals&&this.portals.length>0)for(var o=this.portals,s=0;s<o.length;s++){var a=o[parseInt(s.toString(),10)],r=t.closest(a.containerInfo,"."+T);if(!t.isNullOrUndefined(r)&&r===e){this.clearTemplate(["template"],s);break}}},i.prototype.onPropertyChanged=function(e,i){var s=this.element;this.extendedOpen();for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&i.items instanceof Array)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var l=parseInt(Object.keys(e.items)[parseInt(a.toString(),10)],10),d=Object.keys(e.items[parseInt(l.toString(),10)])[0],h=Object(e.items[parseInt(l.toString(),10)])[""+d];if(this.tbarAlign||"align"===d){this.refresh(),this.trigger("created");break}var c="showAlwaysInPopup"===d&&!h,p="overflow"===d&&0!==this.popupPriCount;(c||this.items[parseInt(l.toString(),10)].showAlwaysInPopup&&p)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var u=[].slice.call(t.selectAll("."+A+" ."+T,s));this.isReact&&this.items[parseInt(l.toString(),10)].template&&this.clearToolbarTemplate(u[parseInt(l.toString(),10)]),t.detach(u[parseInt(l.toString(),10)]),this.tbarEle.splice(l,1),this.addItems([this.items[parseInt(l.toString(),10)]],l),this.items.splice(l,1),this.items[parseInt(l.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.refreshOverflow();break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(s,"e-rtl"),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl"),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,"e-rtl"):this.remove(this.scrollModule.element,"e-rtl")),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,"e-rtl"):this.remove(this.popObj.element,"e-rtl")),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},i.prototype.hideItem=function(e,i){var s,n="object"==typeof e,r=e;if(n||!t.isNullOrUndefined(r)){var o=[].slice.call(t.selectAll("."+T,this.element));n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(t.selectAll("."+T,this.element))[parseInt(r.toString(),10)]),s&&(i?(s.classList.add("e-hidden"),s.classList.contains("e-separator")||(t.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))||"-1"!==s.firstElementChild.getAttribute("tabindex"))&&this.updateHideEleTabIndex(s,i,n,r,o)):(s.classList.remove("e-hidden"),s.classList.contains("e-separator")||this.updateHideEleTabIndex(s,i,n,r,o)),this.refreshOverflow())}},k([t.Collection([],D)],i.prototype,"items",void 0),k([t.Property("auto")],i.prototype,"width",void 0),k([t.Property("auto")],i.prototype,"height",void 0),k([t.Property("")],i.prototype,"cssClass",void 0),k([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),k([t.Property()],i.prototype,"scrollStep",void 0),k([t.Property(!0)],i.prototype,"enableCollision",void 0),k([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),k([t.Property(!0)],i.prototype,"allowKeyboard",void 0),k([t.Event()],i.prototype,"clicked",void 0),k([t.Event()],i.prototype,"created",void 0),k([t.Event()],i.prototype,"destroyed",void 0),k([t.Event()],i.prototype,"beforeCreate",void 0),i=k([t.NotifyPropertyChanges],i)}(t.Component),H=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)}}(),U=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},R="e-acrdn-item",B="e-acrdn-header",j="e-acrdn-header-content",q="e-acrdn-panel",F="e-acrdn-content",W=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Property("SlideDown")],i.prototype,"effect",void 0),U([t.Property(400)],i.prototype,"duration",void 0),U([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},W)],i.prototype,"collapse",void 0),U([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},W)],i.prototype,"expand",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return H(i,e),U([t.Property(null)],i.prototype,"content",void 0),U([t.Property(null)],i.prototype,"header",void 0),U([t.Property(null)],i.prototype,"cssClass",void 0),U([t.Property(null)],i.prototype,"iconCss",void 0),U([t.Property(!1)],i.prototype,"expanded",void 0),U([t.Property(!0)],i.prototype,"visible",void 0),U([t.Property(!1)],i.prototype,"disabled",void 0),U([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),z=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},s}return H(i,e),i.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var i=this.element;if(e.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(i.children).forEach(function(e){i.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)i.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}i.classList.remove("e-acrdn-root"),i.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+q);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains("e-accordion")&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add("e-acrdn-root"),this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);t.setStyleAttribute(this.element,{width:e,height:i}),t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices)},i.prototype.renderControl=function(){this.trgtEle=this.element.children.length>0?t.select("div",this.element):null,this.renderItems(),this.initItemExpand()},i.prototype.wireFocusEvents=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+R));e<i.length;e++){var s=i[e],n=s.querySelector("."+B);s.childElementCount>0&&n&&(t.EventHandler.clearEvents(n),t.EventHandler.add(n,"focus",this.focusIn,this),t.EventHandler.add(n,"blur",this.focusOut,this))}},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+B})),this.isNested||(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},i.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},i.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},i.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},i.prototype.getItemTemplate=function(){return this.itemTemplateFn},i.prototype.focusIn=function(e){e.target.parentElement.classList.add("e-item-focus")},i.prototype.focusOut=function(e){e.target.parentElement.classList.remove("e-item-focus")},i.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e,i=t.select(".e-accordion-container",this.element);e=i?i.children:this.element.children;var s=[];[].slice.call(e).forEach(function(e){s.push({header:e.childElementCount>0&&e.children[0]?e.children[0]:"",content:e.childElementCount>1&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),i&&this.element.removeChild(i),this.setProperties({items:s},!0)},i.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:"e-toggle-icon"}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},i.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0)this.dataSource.forEach(function(e,r){i=s.renderInnerItem(e,r),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+B),"blur",s.focusOut,s))});else{var r=this.items;n&&r.length>0&&r.forEach(function(i,r){e=s.renderInnerItem(i,r),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+B),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=e.target,n=this.getItems(),r={};if(t.closest(s,".e-accordion")===this.element){s.classList.add("e-target");var o=t.closest(s,"."+R),a=t.closest(s,"."+B),l=t.closest(s,"."+q);o&&(t.isNullOrUndefined(a)||t.isNullOrUndefined(l))&&(a=o.children[0],l=o.children[1]),a&&(i=t.select(".e-toggle-icon",a));var d;a?d=t.closest(a,"."+R):l&&(d=t.closest(l,"."+R));var h=this.getIndexByItem(o);d&&(r.item=n[this.getIndexByItem(d)]),r.originalEvent=e,!(!t.isNullOrUndefined(i)&&o.childElementCount<=1)||!t.isNullOrUndefined(l)&&t.isNullOrUndefined(t.select(".e-acrdn-header .e-toggle-icon",d))?this.afterContentRender(s,r,o,a,l,d):(o.appendChild(this.contentRendering(h)),this.ariaAttrUpdate(o),this.afterContentRender(s,r,o,a,l,d)),this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,r,o){var a=this,l=[];this.trigger("clicked",i,function(i){if(!i.cancel){var d=r&&!t.isNullOrUndefined(t.select(".e-target",r)),h=r&&!t.isNullOrUndefined(t.select(".e-accordion",r))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=r&&t.isNullOrUndefined(t.select(".e-accordion",r))||!(t.closest(e,".e-accordion")===a.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(q)||e.classList.contains(F)||d)){var p=a.element.querySelector(".e-accordion-container"),u=p?p.children:a.element.children;[].slice.call(u).forEach(function(e){e.classList.contains("e-active")&&l.push(e)});var f=[].slice.call(a.element.querySelectorAll(".e-acrdn-item [e-animate]"));if(f.length>0)for(var m=0,g=f;m<g.length;m++){var v=g[m];l.push(v.parentElement)}var y=-1!==l.indexOf(o)&&"true"===r.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+q,s),S=t.closest(s,".e-acrdn-root").querySelector(".e-expand-state");if(t.isNullOrUndefined(C))return;b=S===s,!t.isVisible(C)||y&&!o.classList.contains("e-selected")?(l.length>0&&"Single"===a.expandMode&&!y&&l.forEach(function(e){a.collapse(t.select("."+q,e)),e.classList.remove("e-expand-state")}),a.expand(C)):a.collapse(C),t.isNullOrUndefined(S)||b||S.classList.remove("e-expand-state")}}}})},i.prototype.eleMoveFocus=function(e,i,s){var n,r=t.closest(s,"."+R);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+B):s.classList.contains(B)&&(r="moveUp"===e?r.previousElementSibling:r.nextElementSibling)&&(n=t.select("."+B,r)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,B);if(!t.isNullOrUndefined(s)||i.classList.contains("e-accordion")||i.classList.contains(B)){var n,r=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,r,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(q)?"true"!==n.getAttribute("e-animate")&&i.click():i.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?r.firstElementChild.children[0]:r.lastElementChild.children[0]).focus(),e.preventDefault()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:B,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:R,id:e.id||t.getUniqueID("acrdn_item")});if(this.headerTemplate){var n=this.headerEleGenerate(),r=this.createElement("div",{className:j});return n.appendChild(r),t.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),s.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(s,"e-select"),s}if(e.header&&this.angularnativeCondiCheck(e,"header")){var o=e.header;this.enableHtmlSanitizer&&"string"==typeof e.header&&(o=t.SanitizeHtmlHelper.sanitize(e.header));var n=this.headerEleGenerate(),r=this.createElement("div",{className:j});n.appendChild(r),n.appendChild(this.fetchElement(r,o,i)),s.appendChild(n)}var a=t.select("."+B,s);if(!e.expanded||t.isNullOrUndefined(i)||this.enablePersistence||-1===this.initExpand.indexOf(i)&&this.initExpand.push(i),e.cssClass&&t.addClass([s],e.cssClass.split(" ")),e.disabled&&t.addClass([s],"e-overlay"),!1===e.visible&&t.addClass([s],"e-hide"),e.iconCss){var l=this.createElement("div",{className:"e-acrdn-header-icon"}),d=this.createElement("span",{className:e.iconCss+" e-icons"});l.appendChild(d),t.isNullOrUndefined(a)?((a=this.headerEleGenerate()).appendChild(l),s.appendChild(a)):a.insertBefore(l,a.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var h=this.toggleIconGenerate();t.isNullOrUndefined(a)&&(a=this.headerEleGenerate(),s.appendChild(a)),a.appendChild(h),this.add(s,"e-select")}return s},i.prototype.angularnativeCondiCheck=function(e,i){var s="content"===i?e.content:e.header;if(this.isAngular&&!t.isNullOrUndefined(s.elementRef)){var n=s.elementRef.nativeElement.data;if(t.isNullOrUndefined(n)||""===n||-1===n.indexOf("bindings="))return!0;var r=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(r)&&"false"===r["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s){var n,r;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);r=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}else n=t.compile(i)}catch(s){"string"==typeof i?e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(e.appendChild(i),this.trgtEle&&(e.firstElementChild.style.display="")):n=t.compile(i)}var a;if(!t.isNullOrUndefined(n)){this.isReact&&this.renderReactTemplates();var l=void 0,d=void 0;e.classList.contains(j)?(l=this.element.id+s+"_header",d="header"):e.classList.contains(F)&&(l=this.element.id+s+"_content",d="content"),a=n({},this,d,l,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+B,e),s=t.select("."+q,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","region")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:q+" e-content-hide",id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:F});if(!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0)this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s);else{var n=this.items[parseInt(e.toString(),10)].content;this.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),i.appendChild(this.fetchElement(s,n,e))}return i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+R);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains("e-overlay"))){var r=t.closest(n,".e-acrdn-root").querySelector(".e-expand-state"),o={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},a=t.select(".e-toggle-icon",n).firstElementChild,l={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+q),isExpanded:!0};this.trigger("expanding",l,function(s){s.cancel||(a.classList.add("e-toggle-animation"),i.expandedItemsPush(n),t.isNullOrUndefined(r)||r.classList.remove("e-expand-state"),n.classList.add("e-expand-state"),"None"===o.name&&"Enable"!==t.animationMode||"Disable"===t.animationMode?(i.expandProgress("begin",a,e,n,s),i.expandProgress("end",a,e,n,s)):i.expandAnimation(o.name,a,e,n,o,s))})}},i.prototype.expandAnimation=function(e,i,s,n,r,o){var a=this;"None"===e&&"Enable"===t.animationMode&&(e="SlideDown",r.name="SlideDown");var l;this.lastActiveItemId=n.id,"SlideDown"===e?(r.begin=function(){a.expandProgress("begin",i,s,n,o),s.style.position="absolute",l=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},r.progress=function(){n.style.minHeight=l+s.offsetHeight+"px"},r.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,o)}):(r.begin=function(){a.expandProgress("begin",i,s,n,o)},r.end=function(){a.expandProgress("end",i,s,n,o)}),new t.Animation(r).animate(s)},i.prototype.expandProgress=function(e,i,s,n,r){this.remove(s,"e-content-hide"),this.add(n,"e-selected"),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,"e-active"),s.setAttribute("aria-hidden","false"),t.attributes(s.previousElementSibling,{"aria-expanded":"true"}),i.classList.remove("e-toggle-animation"),this.trigger("expanded",r))},i.prototype.expandedItemsPush=function(e){var t=this.getIndexByItem(e);if(-1===this.expandedIndices.indexOf(t)){var i=[].slice.call(this.expandedIndices);i.push(t),this.setProperties({expandedIndices:i},!0)}},i.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},i.prototype.getItemElements=function(){var e=[],t=this.element.children;return[].slice.call(t).forEach(function(t){t.classList.contains(R)&&e.push(t)}),e},i.prototype.expandedItemsPop=function(e){var t=this.getIndexByItem(e),i=[].slice.call(this.expandedIndices);i.splice(i.indexOf(t),1),this.setProperties({expandedIndices:i},!0)},i.prototype.collapse=function(e){var i=this;if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=t.closest(e,"."+R);if(t.isVisible(e)&&!n.classList.contains("e-overlay")){var r={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},o=t.select(".e-toggle-icon",n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+q),isExpanded:!1};this.trigger("expanding",a,function(s){s.cancel||(i.expandedItemsPop(n),n.classList.remove("e-expand-state"),o.classList.add("e-toggle-animation"),"None"===r.name&&"Enable"!==t.animationMode||"Disable"===t.animationMode?(i.collapseProgress("begin",o,e,n,s),i.collapseProgress("end",o,e,n,s)):i.collapseAnimation(r.name,e,n,o,r,s))})}}},i.prototype.collapseAnimation=function(e,i,s,n,r,o){var a=this;"None"===e&&"Enable"===t.animationMode&&(e="SlideUp",r.name="SlideUp");var l,d,h,c;this.lastActiveItemId=s.id,"SlideUp"===e?(r.begin=function(){h=s.offsetHeight,s.style.minHeight=h+"px",i.style.position="absolute",l=s.offsetHeight,d=i.offsetHeight,i.style.maxHeight=d+"px",a.collapseProgress("begin",n,i,s,o)},r.progress=function(){(c=l-(d-i.offsetHeight))<h&&(s.style.minHeight=c+"px")},r.end=function(){i.style.display="none",a.collapseProgress("end",n,i,s,o),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(r.begin=function(){a.collapseProgress("begin",n,i,s,o)},r.end=function(){a.collapseProgress("end",n,i,s,o)}),new t.Animation(r).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,r){this.remove(i,"e-expand-icon"),this.remove(n,"e-selected"),"end"===e&&(this.add(s,"e-content-hide"),i.classList.remove("e-toggle-animation"),this.remove(n,"e-active"),s.setAttribute("aria-hidden","true"),t.attributes(s.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",r))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.getItems=function(){return this.itemTemplate&&this.headerTemplate?this.dataSource:this.items},i.prototype.addItem=function(e,i){var s=this,n=this.element,r=this.getItemElements(),o=this.getItems();t.isNullOrUndefined(i)&&(i=o.length),n.childElementCount>=i&&(e instanceof Array?e:[e]).forEach(function(e,a){var l=i+a;o.splice(l,0,e);var d=s.renderInnerItem(e,l);n.childElementCount===l?n.appendChild(d):n.insertBefore(d,r[parseInt(l.toString(),10)]),t.EventHandler.add(d.querySelector("."+B),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+B),"blur",s.focusOut,s),s.expandedIndices=[],s.expandedItemRefresh(),e&&e.expanded&&s.expandItem(!0,l)}),this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(){var e=this,t=this.getItemElements();[].slice.call(t).forEach(function(t){t.classList.contains("e-selected")&&e.expandedItemsPush(t)})},i.prototype.removeItem=function(e){if(this.isReact||this.isAngular){var i=t.selectAll("."+R,this.element)[parseInt(e.toString(),10)],s=t.select("."+j,i),n=t.select("."+F,i);this.clearAccordionTemplate(s,this.dataSource.length>0?"headerTemplate":"header",j),this.clearAccordionTemplate(n,this.dataSource.length>0?"itemTemplate":"content",F)}var r=this.getItemElements()[parseInt(e.toString(),10)],o=this.getItems();t.isNullOrUndefined(r)||(this.restoreContent(e),t.detach(r),o.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},i.prototype.select=function(e){var i=this.getItemElements()[parseInt(e.toString(),10)];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+B,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[parseInt(e.toString(),10)];t.isNullOrUndefined(s)||(t.isNullOrUndefined(i)&&(i=!0),i?this.add(s,"e-hide"):this.remove(s,"e-hide"))},i.prototype.enableItem=function(e,i){var s=this.getItemElements()[parseInt(e.toString(),10)];if(!t.isNullOrUndefined(s)){var n=s.firstElementChild;i?(this.remove(s,"e-overlay"),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains("e-active")&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,"e-overlay"),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){a=n[n.length-1];this.itemExpand(e,a,this.getIndexByItem(a))}else{var r=t.select("#"+this.lastActiveItemId,this.element);[].slice.call(n).forEach(function(t){s.itemExpand(e,t,s.getIndexByItem(t)),t.classList.remove("e-expand-state")});var o=t.select(".e-expand-state",this.element);o&&o.classList.remove("e-expand-state"),r&&r.classList.add("e-expand-state")}else{var a=n[parseInt(i.toString(),10)];if(t.isNullOrUndefined(a)||!a.classList.contains("e-select")||a.classList.contains("e-active")&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,a,i)}},i.prototype.itemExpand=function(e,i,s){var n=i.children[1];i.classList.contains("e-overlay")||(t.isNullOrUndefined(n)&&e?(n=this.contentRendering(s),i.appendChild(n),this.ariaAttrUpdate(i),this.expand(n)):t.isNullOrUndefined(n)||(e?this.expand(n):this.collapse(n)),this.isReact&&this.renderReactTemplates())},i.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+R)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+R)[parseInt(e.toString(),10)],this.templateEle.forEach(function(e){t.isNullOrUndefined(i.querySelector(e))||(document.body.appendChild(i.querySelector(e)).style.display="none")})},i.prototype.updateItem=function(e,i){if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=s[parseInt(i.toString(),10)];s.splice(i,1),this.restoreContent(i);var r=t.select("."+j,e),o=t.select("."+F,e);(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(r,"header",j),this.clearAccordionTemplate(o,"content",F)),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.clearAccordionTemplate=function(e,i,s){if(this.registeredTemplate&&this.registeredTemplate[""+i])for(var n=this.registeredTemplate,r=0;r<n[""+i].length;r++){var o=n[""+i][parseInt(r.toString(),10)].rootNodes[0],a=t.closest(o,"."+s);if(!t.isNullOrUndefined(a)&&a===e||t.isNullOrUndefined(o.parentNode)){this.clearTemplate([i],[n[""+i][parseInt(r.toString(),10)]]);break}}else if(this.portals&&this.portals.length>0)for(var l=this.portals,r=0;r<l.length;r++){var d=l[parseInt(r.toString(),10)],a=t.closest(d.containerInfo,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],r);break}}},i.prototype.getPersistData=function(){var e=["expandedIndices"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"items":if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var a=Object.keys(e.items),l=0;l<a.length;l++)for(var d=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),h=Object.keys(e.items[parseInt(d.toString(),10)]),c=0;c<h.length;c++){var p=t.selectAll("."+R,this.element)[parseInt(d.toString(),10)],u=Object(i.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]],f=Object(e.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]],m=h[parseInt(c.toString(),10)],g=t.select("."+F,p);if(("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===u)&&this.updateItem(p,d),"cssClass"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||(u&&t.removeClass([p],u.split(" ")),f&&t.addClass([p],f.split(" "))),"visible"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||(!1===Object(e.items[parseInt(d.toString(),10)])[""+h[parseInt(c.toString(),10)]]?p.classList.add("e-hide"):p.classList.remove("e-hide")),"disabled"!==h[parseInt(c.toString(),10)]||t.isNullOrUndefined(p)||this.enableItem(d,!f),h.indexOf("header")<0&&"content"===h[parseInt(c.toString(),10)]&&!t.isNullOrUndefined(p)&&2===p.children.length)if("function"==typeof f){(this.isAngular||this.isReact)&&this.clearAccordionTemplate(g,h[parseInt(c.toString(),10)],F);var v=p.querySelector("."+F);v.innerHTML="",this.setTemplate(f,v,d)}else p.classList.contains("e-selected")&&this.expandItem(!1,d),t.detach(p.querySelector("."+q))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),n=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),n=!0;break;case"itemTemplate":this.initializeItemTemplate(),n=!0;break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl");break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>1&&this.expandItem(!1)}n&&(this.initExpand=[],!t.isNullOrUndefined(this.expandedIndices)&&this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},U([t.Collection([],_)],i.prototype,"items",void 0),U([t.Property([])],i.prototype,"dataSource",void 0),U([t.Property()],i.prototype,"itemTemplate",void 0),U([t.Property()],i.prototype,"headerTemplate",void 0),U([t.Property("100%")],i.prototype,"width",void 0),U([t.Property("auto")],i.prototype,"height",void 0),U([t.Property([])],i.prototype,"expandedIndices",void 0),U([t.Property("Multiple")],i.prototype,"expandMode",void 0),U([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),U([t.Complex({},V)],i.prototype,"animation",void 0),U([t.Event()],i.prototype,"clicked",void 0),U([t.Event()],i.prototype,"expanding",void 0),U([t.Event()],i.prototype,"expanded",void 0),U([t.Event()],i.prototype,"created",void 0),U([t.Event()],i.prototype,"destroyed",void 0),i=U([t.NotifyPropertyChanges],i)}(t.Component),K=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)}}(),X=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Y=function(e){function i(t,i){return e.call(this,t,i)||this}return K(i,e),i.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||t.getUniqueID("ej2-contextmenu"),e.prototype.preRender.call(this)},i.prototype.initialize=function(){this.template=this.itemTemplate?this.itemTemplate:null,e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=s.getZindexPartial(this.element).toString()},i.prototype.open=function(t,i,s){e.prototype.openMenu.call(this,null,null,t,i,null,s)},i.prototype.close=function(){e.prototype.closeMenu.call(this)},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"filter":this.close(),this.filter=t.filter;break;case"target":this.unWireEvents(i.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=t.itemTemplate,this.refresh()}},i.prototype.getModuleName=function(){return"contextmenu"},X([t.Property("")],i.prototype,"target",void 0),X([t.Property("")],i.prototype,"filter",void 0),X([t.Collection([],N)],i.prototype,"items",void 0),X([t.Property(null)],i.prototype,"itemTemplate",void 0),X([t.Property(!1)],i.prototype,"enableScrolling",void 0),i=X([t.NotifyPropertyChanges],i)}(w),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 n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},J="e-vertical",Z=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return G(i,e),i.prototype.getModuleName=function(){return"menu"},i.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||t.getUniqueID("ej2-menu"),this.template){try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items)}else this.updateMenuItems(this.items);e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(J),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(J),this.element.setAttribute("aria-orientation","vertical")):t.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add("e-hamburger"),"Horizontal"===this.orientation&&this.element.classList.add("e-hide-menu"))},i.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},i.prototype.onPropertyChanged=function(i,s){for(var n=this,r=0,o=Object.keys(i);r<o.length;r++)switch(o[r]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(J),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(J),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(J),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(J),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(s.items).length||this.updateMenuItems(i.items);break;case"hamburgerMode":this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),i.hamburgerMode?(this.element.parentElement.classList.add("e-hamburger"),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove("e-hamburger"),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(J),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(J):this.element.previousElementSibling.classList.remove(J),this.element.classList[i.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(i.title=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title):i.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=i.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(s.target),this.wireEvents(),"Horizontal"===this.orientation&&(i.target?this.element.previousElementSibling.classList.add(J):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(J)),this.element.classList.add("e-hide-menu")));break;case"template":this.template=i.template,this.refresh()}e.prototype.onPropertyChanged.call(this,i,s)},i.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[""+n]){for(t=this.getIndex(e[""+n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},i.prototype.open=function(){e.prototype.openHamburgerMenu.call(this)},i.prototype.close=function(){e.prototype.closeHamburgerMenu.call(this)},Q([t.Property("Horizontal")],i.prototype,"orientation",void 0),Q([t.Property("")],i.prototype,"target",void 0),Q([t.Property(null)],i.prototype,"template",void 0),Q([t.Property(!1)],i.prototype,"enableScrolling",void 0),Q([t.Property(!1)],i.prototype,"hamburgerMode",void 0),Q([t.Property("Menu")],i.prototype,"title",void 0),Q([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),Q([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},E)],i.prototype,"fields",void 0),i=Q([t.NotifyPropertyChanges],i)}(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)}}(),ee=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},te="e-tab-header",ie="e-tab-wrap",se="e-toolbar-items",ne="e-toolbar-item",re="e-toolbar-popup",oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),ee([t.Property(600)],i.prototype,"duration",void 0),ee([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},oe)],i.prototype,"previous",void 0),ee([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},oe)],i.prototype,"next",void 0),i}(t.ChildProperty),le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property("")],i.prototype,"text",void 0),ee([t.Property("")],i.prototype,"iconCss",void 0),ee([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Complex({},le)],i.prototype,"header",void 0),ee([t.Property(null)],i.prototype,"headerTemplate",void 0),ee([t.Property("")],i.prototype,"content",void 0),ee([t.Property("")],i.prototype,"cssClass",void 0),ee([t.Property(!1)],i.prototype,"disabled",void 0),ee([t.Property(!0)],i.prototype,"visible",void 0),ee([t.Property()],i.prototype,"id",void 0),ee([t.Property(-1)],i.prototype,"tabIndex",void 0),i}(t.ChildProperty),he=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.show={},s.hide={},s.maxHeight=0,s.title="Close",s.isInteracted=!1,s.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActiveTabBorder.bind(s),s.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},s}return $(i,e),i.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var i=t.select(".e-tab > .e-content",this.element);this.element.classList.remove("e-template"),t.isNullOrUndefined(i)||(i.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var s=0;s<this.draggableItems.length;s++)this.draggableItems[s].destroy(),this.draggableItems[s]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.refreshOverflow=function(){t.isNullOrUndefined(this.tbObj)||this.tbObj.refreshOverflow()},i.prototype.preRender=function(){var e=t.closest(this.element,".e-content");this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" .e-tab-header":this.dragArea),t.isNullOrUndefined(e)||(e.parentElement.classList.add("e-nested"),this.isNested=!0);var i=t.Browser.info.name,s="msie"===i?"e-ie":"edge"===i?"e-edge":"safari"===i?"e-safari":"";t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),t.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:"e-icons e-close-icon",attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:t.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){e.refreshOverflow(),e.refreshActiveBorder()})},i.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach(function(e,i){t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(e.setProperties)&&e.setProperties({id:"tabitem_"+i.toString()},!0)}),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:"e-content"})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:te})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add("e-template");var i=e.querySelector(".e-tab-header");i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select(".e-tab-header",this.element))&&!t.isNullOrUndefined(t.select(".e-content",this.element))){if(this.renderHeader(),this.tbItems=t.select(".e-tab-header ."+se,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+ne,this.element).length>0){this.tbItems=t.select(".e-tab-header ."+se,this.element),this.bdrLine=this.createElement("div",{className:"e-indicator e-hidden e-ignore"});var s=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(s)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):s.insertBefore(this.bdrLine,s.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}this.setRTL(this.enableRtl)}},i.prototype.renderHeader=function(){var e=this,i=this.headerPlacement,s=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(te)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,r=[],o=0;o<n;o++)r.push(this.hdrEle.children.item(o));if(n>0){var a=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(a),r.forEach(function(i,s){e.lastIndex=s;var n={className:"e-item",id:"e-item"+e.tabId+"_"+s},r=e.createElement("span",{className:"e-tab-text",attrs:{role:"presentation"}}).outerHTML,o=e.createElement("div",{className:"e-text-wrap",innerHTML:r+e.btnCls.outerHTML}).outerHTML,l=e.createElement("div",{className:ie,innerHTML:o,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":"e-content"+e.tabId+"_"+s,"aria-disabled":"false"}});l.querySelector(".e-tab-text").appendChild(i),a.appendChild(e.createElement("div",n)),t.selectAll(".e-item",a)[s].appendChild(l)})}}else s=this.parseObject(this.items,0);this.tbObj=new M({width:"Left"===i||"Right"===i?"auto":"100%",height:"Left"===i||"Right"===i?"100%":"auto",overflowMode:this.overflowMode,items:0!==s.length?s:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{role:"tablist"}),t.isNullOrUndefined(this.element.getAttribute("aria-label"))?t.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.setCloseButton(this.showCloseButton);var l=this.tbObj.element.querySelector("."+se);t.isNullOrUndefined(l)||(t.isNullOrUndefined(l.id)||""===l.id)&&(l.id=this.element.id+"_tab_header_items")},i.prototype.createContentElement=function(e){var i=this.createElement("div",{id:"e-content"+this.tabId+"_"+e,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===Number(this.extIndex(this.itemIndexArray[0])))&&t.addClass([i],"e-active"),i},i.prototype.renderContent=function(){this.cntEle=t.select(".e-content",this.element);var e=t.selectAll("."+ne,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var i=this.cntEle.children,s=0;s<e.length;s++)i.length-1>=s&&(t.addClass([i.item(s)],"e-item"),t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+s}),i.item(s).id="e-content"+this.tabId+"_"+s)}else if(t.selectAll("."+ne,this.element).length>0)if("Init"===this.loadOn)for(s=0;s<this.itemIndexArray.length;s++)this.itemIndexArray[s]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[s]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(this.selectedItem>0?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},i.prototype.parseObject=function(e,i){var s=this,n=Array.prototype.slice.call(t.selectAll(".e-tab-header ."+ne,this.element)),r=this.lastIndex;!this.isReplace&&n.length>0&&(r=this.getMaxIndicesFromItems(n));var o,a=[],l=[];return e.forEach(function(e,d){var h=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,c=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;if(t.isNullOrUndefined(e.headerTemplate)&&(t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===c))return void l.push(d);var p=e.headerTemplate||e.header.text;"string"==typeof p&&s.enableHtmlSanitizer&&(p=t.SanitizeHtmlHelper.sanitize(p));var u;s.isReplace&&!t.isNullOrUndefined(s.tbId)&&""!==s.tbId?(u=parseInt(s.tbId.substring(s.tbId.lastIndexOf("_")+1),10),s.tbId=""):u=i+d,s.lastIndex=0===n.length?d:s.isReplace?u:r+1+d;var f=e.disabled?" e-disable e-overlay":"",m=!1===e.visible?" e-hidden":"";o=s.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});var g=p instanceof Object?p.outerHTML:p,v=!t.isNullOrUndefined(g)&&""!==g;t.isNullOrUndefined(p.tagName)?s.headerTextCompile(o,p,d):o.appendChild(p);var y=s.createElement("span",{className:"e-icons e-tab-icon e-icon-"+h+" "+c}),b=s.createElement("div",{className:"e-text-wrap"});b.appendChild(o),""!==p&&void 0!==p&&""!==c?("left"===h||"top"===h?b.insertBefore(y,b.firstElementChild):b.appendChild(y),o,s.isIconAlone=!1):(""===c?o:y)===y&&(t.detach(o),b.appendChild(y),s.isIconAlone=!0);var C=t.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),S=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:C,"data-tabindex":C,role:"tab","aria-selected":"false","aria-disabled":"false"};b.appendChild(s.btnCls.cloneNode(!0));var I=s.createElement("div",{className:ie,attrs:S});I.appendChild(b),s.itemIndexArray instanceof Array&&s.itemIndexArray.splice(i+d,0,"e-item"+s.tabId+"_"+s.lastIndex);var x={htmlAttributes:{id:"e-item"+s.tabId+"_"+s.lastIndex,"data-id":e.id},template:I};x.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+f+" "+m+" "+(""!==c?"e-i"+h:"")+" "+(v?"":"e-icon"),"top"!==h&&"bottom"!==h||s.element.classList.add("e-vertical-icon"),a.push(x),d++}),this.isAdd||l.forEach(function(e){s.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),a},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll(".e-toolbar-item.e-active",e);[].slice.call(i).forEach(function(e){return e.classList.remove("e-active")}),[].slice.call(i).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")})}},i.prototype.checkPopupOverflow=function(e){this.tbPop=t.select(".e-toolbar-pop",this.element);var i=t.select(".e-hor-nav",this.element),s=t.select("."+se,this.element),n=s.lastChild,r=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?r=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(r=!0),r&&(e.classList.add(re),this.tbPop.insertBefore(e,t.selectAll("."+re,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+ie).classList.remove("e-ripple")),this.tbItem=t.selectAll(".e-toolbar-items ."+ne,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(re),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(s)){var n=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(n)}this.isPopup=!0}return t.selectAll("."+ne,this.tbItems).length-1},i.prototype.setCloseButton=function(e){var i=t.select(".e-tab-header",this.element);!0===e?i.classList.add("e-close-show"):i.classList.remove("e-close-show"),this.refreshOverflow(),this.refreshActiveTabBorder()},i.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains("e-rtl");return this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},i.prototype.triggerPrevAnimation=function(e,i){var s=this,n=this.prevCtnAnimation(i,this.selectedItem);t.isNullOrUndefined(n)?e.classList.remove("e-active"):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add("e-progress"),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove("e-active"),e.classList.remove("e-progress"),e.classList.remove("e-view"),t.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||s.isTemplate||t.detach(e)},new t.Animation(n).animate(e))},i.prototype.triggerAnimation=function(e,i){var s,n=this,r=this.prevIndex;[].slice.call(this.element.querySelector(".e-content").children).forEach(function(e){e.id===n.prevActiveEle&&(s=e)});var o=this.tbItem[r],a=this.getTrgContent(this.cntEle,this.extIndex(e));if(t.isNullOrUndefined(s)&&!t.isNullOrUndefined(o)){var l=this.extIndex(o.id);s=this.getTrgContent(this.cntEle,l)}t.isNullOrUndefined(a)||(this.prevActiveEle=a.id);var d=t.isNullOrUndefined(this.animation)||t.isNullOrUndefined(this.animation.next.effect)||t.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect;if(this.initRender||!1===i||d)return void(s&&s!==a&&s.classList.remove("e-active"));var h,c=t.select(".e-content",this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var p=this.animation.previous.effect;h={name:"None"===p?"":"SlideLeftIn"!==p?p:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===t.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var u=this.animation.next.effect;h={name:"None"===u?"":"SlideRightIn"!==u?u:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===t.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}}h.progress=function(){c.classList.add("e-progress"),n.setActiveBorder()},h.end=function(){c.classList.remove("e-progress"),a.classList.add("e-active")},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,r),this.isPopup=!1,""===h.name?a.classList.add("e-active"):new t.Animation(h).animate(a)},i.prototype.keyPressed=function(e){var i=t.closest(e,".e-tab-header ."+ne),s=this.getEleIndex(i);!t.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():t.isNullOrUndefined(i)||!1!==i.classList.contains("e-active")||(this.selectTab(s,null,!0),t.isNullOrUndefined(this.popEle)||this.popObj.hide(this.hide))},i.prototype.getTabHeader=function(){if(!t.isNullOrUndefined(this.element)){var e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(te)});if(e.length>0)return e[0];var i=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0];if(i)return[].slice.call(i.children).filter(function(e){return e.classList.contains(te)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+ne,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace("e-item"+this.tabId+"_","")},i.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},i.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach(function(i){t.isNullOrUndefined(e.element.querySelector(i))||(document.body.appendChild(e.element.querySelector(i)).style.display="none")})},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},i.prototype.compileElement=function(e,i,s,n){var r;"string"==typeof i?(i=i.trim(),this.isVue?r=t.compile(this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):e.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i):i):r=t.compile(i);var o;t.isNullOrUndefined(r)||(o=r({},this,s)),!t.isNullOrUndefined(r)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},i.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},i.prototype.getContent=function(e,i,s,n){var r;if("string"==typeof(i=t.isNullOrUndefined(i)?"":i)||t.isNullOrUndefined(i.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var o=document.querySelector(i);r=o.outerHTML.trim(),"clone"===s?e.appendChild(o.cloneNode(!0)):(e.appendChild(o),o.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains("e-nested")?t.select(".e-nested> .e-content > #e-content"+this.tabId+"_"+i,this.element):this.findEle(e.children,"e-content"+this.tabId+"_"+i)},i.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},i.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},i.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?"e-vertical-left":"e-vertical-right";t.addClass([this.hdrEle],["e-vertical",e]),this.element.classList.contains("e-nested")?t.addClass([this.hdrEle],["e-vertical-tab",e]):t.addClass([this.element],["e-vertical-tab",e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],["e-horizontal-bottom"])},i.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},i.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var i=this.hdrEle.querySelector(".e-active"),s=!!this.hdrEle.classList.contains("e-vertical");t.removeClass([this.element],["e-vertical-tab"]),t.removeClass([this.hdrEle],["e-vertical","e-vertical-left","e-vertical-right"]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(re)&&this.popupHandler(i)),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},i.prototype.focusItem=function(){var e=t.select(" #e-item"+this.tabId+"_"+this.selectedItem,this.hdrEle);t.isNullOrUndefined(e)||e.firstElementChild.focus()},i.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},i.prototype.setOrientation=function(e,i){var s=Array.prototype.indexOf.call(this.element.children,i),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector(".e-content"));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],["e-horizontal-bottom"]),this.element.insertBefore(i,t.select(".e-content",this.element)))},i.prototype.setCssClass=function(e,i,s){if(""!==i&&!t.isNullOrUndefined(i))for(var n=i.split(" "),r=0;r<n.length;r++)s?e.classList.add(n[r]):e.classList.remove(n[r])},i.prototype.loadContentInitMode=function(e){if(e){if("Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t);this.prevIndex!==this.selectedItem&&e.classList.remove("e-active")}},i.prototype.loadContentElement=function(){if(!this.isTemplate){var e=this.cntEle.children.item(0);this.loadContentInitMode(e)}},i.prototype.setContentHeight=function(e){if(this.element.classList.contains("e-fill-mode")&&t.removeClass([this.element],["e-fill-mode"]),!t.isNullOrUndefined(this.cntEle)){var i=this.getTabHeader();if("None"===this.heightAdjustMode){if(this.loadContentElement(),"auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],["e-fill-mode"]),t.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var s=t.selectAll(".e-content > .e-item",this.element),n=0;n<s.length;n++)s[n].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(s[n])),s[n].style.removeProperty("display"),s[n].style.removeProperty("visibility");else{this.cntEle=t.select(".e-content",this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var r=this.cntEle.children.item(0),n=0;n<this.items.length;n++)for(this.getContent(r,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(r));r.firstChild;)r.removeChild(r.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(r,this.items[0].content,"render",0),this.loadContentInitMode(r)}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),t.setStyleAttribute(this.cntEle,{height:"auto"})}},i.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},i.prototype.setActiveBorder=function(){var e=this.getTabHeader(),i=t.select(".e-toolbar-item.e-active",e);if(!t.isNullOrUndefined(i)){this.reorderActiveTab?e&&e.classList.remove("e-reorder-active-item"):(i.classList.contains(re)&&!this.bdrLine.classList.contains("e-hidden")&&this.bdrLine.classList.add("e-hidden"),e&&!e.classList.contains("e-reorder-active-item")&&e.classList.add("e-reorder-active-item"));var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+se,e);var n=t.select(".e-indicator",e),r=t.select(".e-toolbar-items ."+this.scrCntClass,e);if(this.isVertical())t.setStyleAttribute(n,{left:"",right:""}),0!==(t.isNullOrUndefined(r)?this.tbItems.offsetHeight:r.offsetHeight)?t.setStyleAttribute(n,{top:i.offsetTop+"px",height:i.offsetHeight+"px"}):t.setStyleAttribute(n,{top:0,height:0});else{if("MultiRow"===this.overflowMode){var o="Bottom"===this.headerPlacement?i.offsetTop:i.offsetHeight+i.offsetTop;t.setStyleAttribute(n,{top:o+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var a=t.isNullOrUndefined(r)?this.tbItems.offsetWidth:r.offsetWidth;0!==a?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:a-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||i.classList.contains(re)||this.bdrLine.classList.remove("e-hidden")}}},i.prototype.setActive=function(e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1),this.tbItem=t.selectAll("."+ne,this.getTabHeader());var n=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!t.isNullOrUndefined(n)&&n.classList.contains("e-disable"))){if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),n.classList.contains("e-active"))return void this.setActiveBorder();this.isTemplate||t.attributes(n.firstElementChild,{"aria-controls":"e-content"+this.tabId+"_"+this.extIndex(n.id)});var r=n.id;this.removeActiveClass(),n.classList.add("e-active"),n.firstElementChild.setAttribute("aria-selected","true");var o=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle="e-content"+this.tabId+"_"+o),this.isTemplate){if(t.select(".e-content",this.element).children.length>0){var a=this.findEle(t.select(".e-content",this.element).children,"e-content"+this.tabId+"_"+o);t.isNullOrUndefined(a)||a.classList.add("e-active"),this.triggerAnimation(r,this.enableAnimation)}}else{for(this.cntEle=t.select(".e-tab > .e-content",this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var l=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(l)){this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_"+this.extIndex(r),className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+this.extIndex(r)}}));var d=this.getTrgContent(this.cntEle,this.extIndex(r)),h=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(d,this.items[h].content,"render",h)}else l.classList.add("e-active");this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(n),!this.initRender&&!i){var c={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:n,selectedIndex:e,selectedContent:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:s,preventFocus:!1};this.trigger("selected",c,function(e){e.preventFocus||n.firstElementChild.focus()})}}},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+se,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},i.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,"e-rtl",e),this.refreshActiveBorder()},i.prototype.refreshActiveBorder=function(){t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.setActiveBorder()},i.prototype.showPopup=function(e){var i=t.select(".e-popup.e-toolbar-pop",this.hdrEle);if(i&&i.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement||this.element.classList.contains("e-rtl")?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector(".e-tab-header");t&&Array.prototype.slice.call(t.querySelectorAll("."+ne)).forEach(function(t){e.initializeDrag(t)})}},i.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),t.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},i.prototype.unWireEvents=function(){t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),t.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),t.isNullOrUndefined(this.cntEle)||t.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove("e-rtl"),this.element.classList.remove("e-focused")},i.prototype.clickHandler=function(e){this.element.classList.remove("e-focused");var i=e.originalEvent.target,s=t.closest(i,"."+ne),n=this.getEleIndex(s);i.classList.contains("e-close-icon")?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,t.isNullOrUndefined(s)||n===this.selectedItem||this.selectTab(n,e.originalEvent,!0))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var i=this.element.querySelector('[data-swipe="true"]');if(i)return void i.removeAttribute("data-swipe");if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var s=this.selectedItem-1;s>=0;s--)if(!this.tbItem[s].classList.contains("e-hidden")){this.selectTab(s,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+ne,this.element).length-1)for(var n=this.selectedItem+1;n<this.tbItem.length;n++)if(!this.tbItem[n].classList.contains("e-hidden")){this.selectTab(n,null,!0);break}this.isSwiped=!1}},i.prototype.spaceKeyDown=function(e){if(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which){var i=t.closest(e.target,".e-tab-header");t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains("e-disable")){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select(".e-active",s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var r=t.closest(document.activeElement,"."+ne),o=t.closest(i,"."+ne);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains("e-disable"))return;if("enter"===e.action&&i.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(i);break;case"tab":case"shiftTab":i.classList.contains(ie)&&!1===t.closest(i,"."+ne).classList.contains("e-active")&&i.setAttribute("tabindex",i.getAttribute("data-tabindex")),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),t.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":t.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!t.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!t.isNullOrUndefined(o)){var a=o.nextSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ne)&&a.firstElementChild.focus(),this.removeTab(this.getEleIndex(o))}this.setActiveBorder()}}},i.prototype.refreshItemVisibility=function(e){var i=t.select("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!t.isNullOrUndefined(i)){var s=t.select(".e-hscroll-bar",this.tbItems),n=s.scrollLeft,r=n+s.offsetWidth,o=e.offsetLeft,a=e.offsetWidth,l=e.offsetLeft+e.offsetWidth;if(n<o&&r<l){d=r-o;s.scrollLeft=n+(a-d)}else if(n>o&&r>l){var d=l-n;s.scrollLeft=n-(a-d)}}},i.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains("e-close-icon")&&i.setAttribute("title",new t.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},i.prototype.evalOnPropertyChangeItems=function(e,i){var s=this;if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var n=t.select(".e-tab > .e-content",this.element);n.firstElementChild;)t.detach(n.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var r=Object.keys(e.items),o=0;o<r.length;o++)for(var a=parseInt(Object.keys(e.items)[o],10),l=Object.keys(e.items[a]),d=0;d<l.length;d++){var h=Object(i.items[a])[l[d]],c=Object(e.items[a])[l[d]],p=this.element.querySelectorAll("."+ne)[a],u=void 0;u=p&&!t.isNullOrUndefined(p.id)&&""!==p.id?this.getIndexFromEle(p.id):a;var f=t.select(".e-toolbar-items #e-item"+this.tabId+"_"+u,this.element),m=t.select(".e-content #e-content"+this.tabId+"_"+u,this.element);if("header"===l[d]||"headerTemplate"===l[d]){var g=t.isNullOrUndefined(this.items[a].header)||t.isNullOrUndefined(this.items[a].header.iconCss)?"":this.items[a].header.iconCss,v=this.items[a].headerTemplate||this.items[a].header.text;if("headerTemplate"===l[d]&&this.clearTabTemplate(f,l[d],ne),""===v&&""===g)this.removeTab(a);else{this.tbId=p.id;var y=[];y.push(this.items[a]),this.items.splice(a,1),this.itemIndexArray.splice(a,1),this.tbObj.items.splice(a,1);var b=f.classList.contains("e-hidden");t.detach(f),this.isReplace=!0,this.addTab(y,a),b&&this.hideTab(a),this.isReplace=!1}}if("content"===l[d]&&!t.isNullOrUndefined(m))if(("string"==typeof c||t.isNullOrUndefined(c.innerHTML))&&("."===c[0]||"#"===c[0])&&c.length){var C=document.querySelector(c);m.appendChild(C),C.style.display=""}else""===c&&"#"===h[0]?(document.body.appendChild(this.element.querySelector(h)).style.display="none",m.innerHTML=c):this.isAngular||this.isReact?(this.clearTabTemplate(m,l[d],"e-item"),m.innerHTML="",this.templateCompile(m,c,a)):"function"!=typeof c&&(m.innerHTML=c);"cssClass"===l[d]&&(t.isNullOrUndefined(f)||(f.classList.remove(h),f.classList.add(c)),t.isNullOrUndefined(m)||(m.classList.remove(h),m.classList.add(c))),"disabled"===l[d]&&this.enableTab(a,!0!==c),"visible"===l[d]&&this.hideTab(a,!0!==c)}this.isReact&&this.portals&&this.portals.length>0&&this.renderReactTemplates(function(){s.refreshActiveTabBorder()})}},i.prototype.clearTabTemplate=function(e,i,s){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[i])for(var n=this.registeredTemplate,r=0;r<n[i].length;r++){var o=n[i][r].rootNodes[0],a=t.closest(o,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],[n[i][r]]);break}}else if(this.portals&&this.portals.length>0)for(var l=this.portals,r=0;r<l.length;r++){var d=l[r],a=t.closest(d.containerInfo,"."+s);if(!t.isNullOrUndefined(a)&&a===e){this.clearTemplate([i],r);break}}},i.prototype.initializeDrag=function(e){var i=this,s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+ne,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,r=i.getEleIndex(i.dragItem),o={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+ne),clonedElement:i.cloneElement,index:r};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||".e-tab-header"===i.dragArea){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+ie).style.visibility="hidden",i.cloneElement.classList.contains("e-hidden")&&t.removeClass([i.cloneElement],"e-hidden")):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],"e-hidden"),i.dragItem.classList.contains("e-hidden")&&t.removeClass([i.dragItem],"e-hidden"),i.dragItem.querySelector("."+ie).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var a=i.element.querySelector(".e-scroll-right-nav"),l=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(a)&&Math.abs(a.offsetWidth/2+a.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(l)&&Math.abs(l.offsetLeft+l.offsetWidth-i.cloneElement.offsetLeft)>l.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none",n=t.closest(e.target,".e-toolbar-item.e-draggable");var h=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(h=i.element.querySelector(".e-hscroll-content").offsetWidth),null!=n&&!n.isSameNode(i.dragItem)&&n.closest(".e-tab").isSameNode(i.dragItem.closest(".e-tab"))&&((s=i.getEleIndex(n))<r&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,r,s),s>r&&Math.abs(n.offsetWidth/2)+n.offsetLeft-h<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,r,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",o)}else i.trigger("dragging",o)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(s)},i.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),t.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector(".e-tab-header").classList.contains("e-close-show")&&t.addClass([this.cloneElement],"e-close-show"),t.removeClass([this.cloneElement.querySelector("."+ie)],"e-ripple"),t.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||t.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},i.prototype.itemDragStart=function(e){var i=this;this.draggingItems=this.items.map(function(e){return e}),this.dragItem=e.element;var s={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",s,function(s){if(s.cancel){var n=e.element.ej2_instances[0];t.isNullOrUndefined(n)||n.intDestroy(e.event),t.detach(i.cloneElement)}else i.removeActiveClass(),t.addClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.dragItem.querySelector("."+ie).style.visibility="hidden"})},i.prototype.dragAction=function(e,t,i){if(this.items.length>0){var s=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>i)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(e.parentElement.lastChild,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var n=e.parentElement.lastChild;if(e.isSameNode(n)){var r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(n,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},i.prototype.itemDragStop=function(e){var i=this;t.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+ie).style.visibility="visible",document.body.style.cursor="";var s={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",s,function(e){e.cancel?i.refresh():i.items.length>0&&i.draggingItems.length>0?(i.items=i.draggingItems,i.selectedItem=t.isNullOrUndefined(i.droppedIndex)?i.getEleIndex(i.dragItem):i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+ie).style.visibility="",t.removeClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.droppedIndex=t.isNullOrUndefined(i.droppedIndex)?i.getEleIndex(i.dragItem):i.droppedIndex,i.selectTab(i.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+ne,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove("e-disable","e-overlay"),s.firstElementChild.setAttribute("tabindex",s.firstElementChild.getAttribute("data-tabindex"))):(s.classList.add("e-disable","e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains("e-active")&&this.select(e+1)),t.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!i,this.dataBind()),s.firstElementChild.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};if(this.isReplace)this.addingTabContent(e,t);else{for(var n=0,r=e;n<r.length;n++){var o=r[n];o.disabled=o.disabled||!1,o.visible=o.visible||!0}this.trigger("adding",s,function(s){s.cancel||i.addingTabContent(e,t)})}this.isReact&&this.renderReactTemplates()},i.prototype.addingTabContent=function(e,i){var s=this,n=0;if(this.hdrEle=t.select(".e-tab-header",this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var r=Array.from(t.selectAll(".e-tab-header ."+ne,this.element)),o=r.length;if(0!==o&&(n=this.getMaxIndicesFromItems(r)+1),t.isNullOrUndefined(i)&&(i=o-1),o<i||i<0||isNaN(i))return;0!==o||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.tbItems=t.select("."+se,this.getTabHeader()),this.isAdd=!0;var a=this.parseObject(e,i);this.isAdd=!1;var l,d=0;e.forEach(function(e,r){if(l=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(l)||0===l.length&&!t.isNullOrUndefined(e.header)&&t.isNullOrUndefined(e.header.iconCss)||(a[r]&&(t.isNullOrUndefined(e.id)&&(e.id="e-item"+s.tabId+"_tabitem_"+(n+r).toString()),a[r].htmlAttributes["data-id"]=e.id),s.items.splice(i+d,0,e),d++),!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)&&(s.isTemplate||"Init"===s.loadOn)){var o=n+r,h=s.createElement("div",{id:"e-content"+s.tabId+"_"+o,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item_"+o}});s.cntEle.insertBefore(h,s.cntEle.children[i+r]);var c=s.getTrgContent(s.cntEle,o.toString());s.getContent(c,e.content,"render",i)}}),this.tbObj.addItems(a,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):(this.setActiveBorder(),this.tbItem=t.selectAll("."+ne,this.getTabHeader())),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+ne,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){var r=t.select("#e-item"+i.tabId+"_"+i.extIndex(s.id),t.select("."+se,i.element));t.isNullOrUndefined(r)||i.clearTabTemplate(r,"headerTemplate",ne),i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id));var o=i.itemIndexArray.indexOf(s.id);i.items.splice(o,1),i.itemIndexArray.splice(o,1),i.refreshActiveBorder();var a=t.select("#e-content"+i.tabId+"_"+i.extIndex(s.id),t.select(".e-content",i.element));t.isNullOrUndefined(a)||(i.clearTabTemplate(a,"content","e-item"),t.detach(a)),i.trigger("removed",n),i.draggableItems&&i.draggableItems.length>0&&(i.draggableItems[e].destroy(),i.draggableItems[e]=null,i.draggableItems.splice(e,1)),s.classList.contains("e-active")?(e=e>t.selectAll(".e-toolbar-item:not(.e-toolbar-popup)",i.element).length-1?e-1:e,i.enableAnimation=!1,i.tbItem=t.selectAll("."+ne,i.getTabHeader()),e=i.getSelectingTabIndex(e),e=!isNaN(e)&&e>=0&&i.tbItem.length>e?e:0,i.selectedItem=e,i.select(e)):e!==i.selectedItem&&(e<i.selectedItem&&(e=i.itemIndexArray.indexOf(i.tbItem[i.selectedItem].id),i.setProperties({selectedItem:e>-1?e:i.selectedItem},!0),i.prevIndex=i.selectedItem),i.tbItem=t.selectAll("."+ne,i.getTabHeader())),0===t.selectAll("."+ne,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+ne,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add("e-hidden"),!0===i)if(n.classList.add("e-hidden"),0!==(s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems)).length&&n.classList.contains("e-active")){if(0!==e)for(var r=e-1;r>=0;r--){if(!this.tbItem[r].classList.contains("e-hidden")){this.select(r);break}if(0===r)for(o=e+1;o<this.tbItem.length;o++)if(!this.tbItem[o].classList.contains("e-hidden")){this.select(o);break}}else for(var o=e+1;o<this.tbItem.length;o++)if(!this.tbItem[o].classList.contains("e-hidden")){this.select(o);break}}else 0===s.length&&this.element.classList.add("e-hidden");else this.element.classList.remove("e-hidden"),s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems),n.classList.remove("e-hidden"),0===s.length&&this.select(e);this.setActiveBorder(),t.isNullOrUndefined(this.items[e])||(this.items[e].visible=!i,this.dataBind()),t.isNullOrUndefined(n.firstElementChild)||n.firstElementChild.setAttribute("aria-hidden",""+i),"Popup"===this.overflowMode&&this.refreshOverflow()}},i.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1),this.isInteracted=i,this.select(e,t)},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+se,n),this.tbItem=t.selectAll("."+ne,n),this.content=t.select(".e-content",this.element),this.prevItem=this.tbItem[this.prevIndex],t.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var r=this.tbItem[e];t.isNullOrUndefined(r)?this.selectedID="0":this.selectingID=this.extIndex(r.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains("e-disable")||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex"));var o={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectedID,this.content),selectingItem:r,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",o,function(t){t.cancel||s.selectingContent(e,s.isInteracted)}),this.isInteracted=!1},i.prototype.getSelectingTabIndex=function(e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains("e-disable")||this.tbItem[e].classList.contains("e-hidden")))for(var i=e+1;i<this.items.length;i++){if(!1===this.items[i].disabled&&!0===this.items[i].visible){e=i;break}e=0}return e},i.prototype.selectingContent=function(e,i){if("number"==typeof e)if(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(re)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,i),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll(".e-toolbar-items ."+ne,this.hdrEle);var s=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,s);var n=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,n)}}else this.setActive(e,null,i);else this.setActive(0,null,i);else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,i)},i.prototype.getItemIndex=function(e){for(var t,i=0;i<this.tbItem.length;i++)if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}return t},i.prototype.disable=function(e){this.setCssClass(this.element,"e-disable",e),this.element.setAttribute("aria-disabled",""+e)},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},i.prototype.getModuleName=function(){return"tab"},i.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,r=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});n<r.length;n++)switch(r[n]){case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var o=this.element.querySelector(".e-tab-header");""===i.cssClass||t.isNullOrUndefined(i.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(o)||this.setCssClass(o,e.cssClass,!0)):(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(o)||(this.setCssClass(o,i.cssClass,!1),this.setCssClass(o,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=i.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+se),i=this.element.querySelector(".e-toolbar-item.e-active"),s=this.getIndexFromEle(i.id),n=i.innerText,r=this.element.querySelector(".e-content").querySelector(".e-active").children[0],o=r.innerHTML;t.detach(i),t.detach(r);var a={className:ne+" e-template e-active",id:"e-item"+this.tabId+"_"+s},l=this.createElement("span",{className:"e-tab-text",innerHTML:n,attrs:{role:"presentation"}}).outerHTML,d=this.createElement("div",{className:"e-text-wrap",innerHTML:l+this.btnCls.outerHTML}).outerHTML,h=i.firstElementChild.getAttribute("data-tabindex"),c=this.createElement("div",{className:ie,innerHTML:d,attrs:{tabIndex:h,"data-tabindex":h,role:"tab","aria-controls":"e-content"+this.tabId+"_"+s,"aria-selected":"true","aria-disabled":"false"}});e.insertBefore(this.createElement("div",a),e.children[s+1]),this.element.querySelector(".e-toolbar-item.e-active").appendChild(c);S=this.createElement("div",{innerHTML:o});this.element.querySelector(".e-content").querySelector(".e-active").appendChild(S)}else if(this.element.querySelector(".e-toolbar-item.e-active")){t.detach(this.element.querySelector(".e-toolbar-item.e-active").children[0]),t.detach(this.element.querySelector(".e-content").querySelector(".e-active").children[0]);var p=this.items[this.selectedItem],u=t.isNullOrUndefined(p.header)||t.isNullOrUndefined(p.header.iconPosition)?"":p.header.iconPosition,f=t.isNullOrUndefined(p.header)||t.isNullOrUndefined(p.header.iconCss)?"":p.header.iconCss,m=p.headerTemplate||p.header.text,g=this.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});t.isNullOrUndefined(m.tagName)?this.headerTextCompile(g,m,this.selectedItem):g.appendChild(m);var v=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+u+" "+f}),y=this.createElement("div",{className:"e-text-wrap"});y.appendChild(g),""!==m&&void 0!==m&&""!==f?("left"===u||"top"===u?y.insertBefore(v,y.firstElementChild):y.appendChild(v),g,this.isIconAlone=!1):(""===f?g:v)===v&&(t.detach(g),y.appendChild(v),this.isIconAlone=!0);var h=t.isNullOrUndefined(p.tabIndex)?"-1":p.tabIndex.toString(),b=p.disabled?{}:{tabIndex:h,"data-tabindex":h,role:"tab","aria-selected":"true","aria-disabled":"false"};y.appendChild(this.btnCls.cloneNode(!0));var C=this.createElement("div",{className:ie,attrs:b});C.appendChild(y),"top"!==u&&"bottom"!==u||this.element.classList.add("e-vertical-icon"),this.element.querySelector(".e-toolbar-item.e-active").appendChild(C);var S=this.createElement("div"),I=p.content,x=void 0;if("string"==typeof I||t.isNullOrUndefined(I.innerHTML))if("string"==typeof I&&this.enableHtmlSanitizer&&(I=t.SanitizeHtmlHelper.sanitize(I)),"."===I[0]||"#"===I[0])if(document.querySelectorAll(I).length){var E=document.querySelector(I);x=E.outerHTML.trim(),S.appendChild(E),E.style.display=""}else this.compileElement(S,I,"content",this.selectedItem);else this.compileElement(S,I,"content",this.selectedItem);else S.appendChild(I);t.isNullOrUndefined(x)||-1===this.templateEle.indexOf(I.toString())&&this.templateEle.push(I.toString()),this.element.querySelector(".e-item.e-active").appendChild(S)}this.isReact&&this.renderReactTemplates()},i.prototype.refreshActiveTabBorder=function(){var e=t.select(".e-toolbar-item.e-toolbar-popup.e-active",this.element);!t.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},ee([t.Collection([],de)],i.prototype,"items",void 0),ee([t.Property("100%")],i.prototype,"width",void 0),ee([t.Property("Both")],i.prototype,"swipeMode",void 0),ee([t.Property("auto")],i.prototype,"height",void 0),ee([t.Property("")],i.prototype,"cssClass",void 0),ee([t.Property(0)],i.prototype,"selectedItem",void 0),ee([t.Property("Top")],i.prototype,"headerPlacement",void 0),ee([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),ee([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),ee([t.Property("Demand")],i.prototype,"loadOn",void 0),ee([t.Property(!1)],i.prototype,"enablePersistence",void 0),ee([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),ee([t.Property(!1)],i.prototype,"showCloseButton",void 0),ee([t.Property(!0)],i.prototype,"reorderActiveTab",void 0),ee([t.Property()],i.prototype,"scrollStep",void 0),ee([t.Property()],i.prototype,"dragArea",void 0),ee([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),ee([t.Property(!0)],i.prototype,"clearTemplates",void 0),ee([t.Complex({},ae)],i.prototype,"animation",void 0),ee([t.Event()],i.prototype,"created",void 0),ee([t.Event()],i.prototype,"adding",void 0),ee([t.Event()],i.prototype,"added",void 0),ee([t.Event()],i.prototype,"selecting",void 0),ee([t.Event()],i.prototype,"selected",void 0),ee([t.Event()],i.prototype,"removing",void 0),ee([t.Event()],i.prototype,"removed",void 0),ee([t.Event()],i.prototype,"onDragStart",void 0),ee([t.Event()],i.prototype,"dragging",void 0),ee([t.Event()],i.prototype,"dragged",void 0),ee([t.Event()],i.prototype,"destroyed",void 0),i=ee([t.NotifyPropertyChanges],i)}(t.Component),ce=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)}}(),pe=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},ue="e-treeview",fe="e-icon-collapsible",me="e-icon-expandable",ge="e-list-item",ve="e-list-text",ye="e-list-parent",be="e-active",Ce="e-icons-spinner",Se="e-process",Ie="e-icons",xe="e-text-content",Ee="e-drop-in",Ne="e-drop-next",Oe="e-fullrow",we="e-disable",Le="e-check",ke="e-treeview-checkbox",Ae="e-node-focus",Te={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("child")],i.prototype,"child",void 0),pe([t.Property([])],i.prototype,"dataSource",void 0),pe([t.Property("expanded")],i.prototype,"expanded",void 0),pe([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),pe([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),pe([t.Property("iconCss")],i.prototype,"iconCss",void 0),pe([t.Property("id")],i.prototype,"id",void 0),pe([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),pe([t.Property("isChecked")],i.prototype,"isChecked",void 0),pe([t.Property("parentID")],i.prototype,"parentID",void 0),pe([t.Property(null)],i.prototype,"query",void 0),pe([t.Property("selectable")],i.prototype,"selectable",void 0),pe([t.Property("selected")],i.prototype,"selected",void 0),pe([t.Property(null)],i.prototype,"tableName",void 0),pe([t.Property("text")],i.prototype,"text",void 0),pe([t.Property("tooltip")],i.prototype,"tooltip",void 0),pe([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("SlideDown")],i.prototype,"effect",void 0),pe([t.Property(400)],i.prototype,"duration",void 0),pe([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},De)],i.prototype,"collapse",void 0),pe([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},De)],i.prototype,"expand",void 0),i}(t.ChildProperty),He=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.isRefreshed=!1,s.preventExpand=!1,s.checkedElement=[],s.disableNode=[],s.validArr=[],s.validNodes=[],s.expandChildren=[],s.isFieldChange=!1,s.changeDataSource=!1,s.hasTemplate=!1,s.isFirstRender=!1,s.isNodeDropped=!1,s.isInteracted=!1,s.isRightClick=!1,s.mouseDownStatus=!1,s.isDropIn=!1,s.OldCheckedData=[],s.isHiddenItem=!1,s}ce(a,e),l=a,a.prototype.getModuleName=function(){return"treeview"},a.prototype.preRender=function(){var e=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",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",ctrlA:"ctrl+A",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",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:me,ariaAttributes:Te,expandIconPosition:"Left",itemCreated:function(t){e.beforeNodeCreate(t)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new t.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),t.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),t.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),t.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},a.prototype.getPersistData=function(){var e=["selectedNodes","checkedNodes","expandedNodes"];return this.addOnPersist(e)},a.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},a.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},a.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add("e-disabled"),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove("e-disabled"),this.element.setAttribute("aria-disabled","false"))},a.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},a.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+xe+" > ."+Ie+",.e-input-group,.e-input, ."+ke};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+xe+" > ."+Ie,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},a.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},a.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},a.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},a.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof r.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(t){i.treeList.pop(),i.treeData=t.result,i.isNumberTypeId=i.getType(),i.setRootData(),e&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),t.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},a.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,o=[];if(e.query)n=e.query.clone();else{n=new r.Query;for(var a=this.getActualProperties(e),l=0,d=Object.keys(a);l<d.length;l++){var h=d[l];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[""+h]&&"url"!==h&&-1===o.indexOf(e[""+h])&&o.push(e[""+h])}n.select(o),Object.prototype.hasOwnProperty.call(a,"tableName")&&n.from(e.tableName)}return i.ListBase.addSorting(this.sortOrder,e.text,n),t.isNullOrUndefined(s)||t.isNullOrUndefined(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(s):s),n},a.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},a.prototype.setRootData=function(){if(this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType){this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID);var e=this.getChildNodes(this.treeData,void 0,!0);t.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e}else this.rootData=this.treeData},a.prototype.isChildObject=function(){return"object"==typeof this.fields.child},a.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var s=this.getSortedData(this.rootData);this.ulElement=i.ListBase.createList(this.createElement,e?this.rootData:s,this.listBaseOption),this.element.appendChild(this.ulElement);var n=this.ulElement.querySelectorAll(".e-list-item");if(!1===this.loadOnDemand)for(var r=0;r<n.length;)this.renderChildNodes(n[parseInt(r.toString(),10)],!0,null,!0),r++;(1===t.selectAll("."+ye,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},a.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,i=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.isChecked,"equal",!0,!1)),s=0;s<i.length;s++){var n=i[parseInt(s.toString(),10)][this.fields.id]?i[parseInt(s.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(n)||this.isLoaded||this.checkDisabledState(n,i[s]),i[parseInt(s.toString(),10)][this.fields.hasChildren])for(var o=i[parseInt(s.toString(),10)][this.fields.id],a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.parentID,"equal",o,!1)),l=0;l<a.length;l++){var d=a[parseInt(l.toString(),10)][this.fields.id]?a[parseInt(l.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(d)&&this.autoCheck&&this.checkDisabledState(d,a[l])}}for(s=0;s<this.checkedNodes.length;s++){var h=this.fields,c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(h.id,"equal",this.checkedNodes[parseInt(s.toString(),10)],!0));if(c[0]&&this.autoCheck&&(this.getCheckedNodeDetails(h,c),this.checkIndeterminateState(c[0])),c.length>0){f=c[0][this.fields.id]?c[0][this.fields.id].toString():null;this.checkedNodes.indexOf(f)>-1&&-1===this.validNodes.indexOf(f)&&this.validNodes.push(f)}for(var p=new r.DataManager(this.treeData).executeLocal((new r.Query).where(h.parentID,"equal",this.checkedNodes[parseInt(s.toString(),10)],!0)),u=0;u<p.length;u++){var f=p[parseInt(u.toString(),10)][this.fields.id]?p[parseInt(u.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(f)&&this.autoCheck&&this.checkDisabledState(f,p[u]),this.checkedNodes.indexOf(f)>-1&&-1===this.validNodes.indexOf(f)&&this.validNodes.push(f)}}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline){for(u=0;u<this.treeData.length;u++){var m=this.treeData[parseInt(u.toString(),10)][this.fields.id]?this.treeData[parseInt(u.toString(),10)][this.fields.id].toString():"";this.treeData[parseInt(u.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(m)&&this.checkDisabledState(m,this.treeData[u]),this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m);var g=t.getValue(this.fields.child.toString(),this.treeData[parseInt(u.toString(),10)]);g&&this.updateChildCheckState(g,this.treeData[parseInt(u.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},a.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,o=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),a=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(o||a)a&&(t.select("."+Le,a)||this.changeState(a,"indeterminate",null,!0,!0));else{-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var l=this.getChildNodes(this.treeData,s),d=0;d<l.length;d++){var h=l[parseInt(d.toString(),10)][this.fields.id]?l[parseInt(d.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===l.length&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s)}var c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},a.prototype.updateParentCheckState=function(){var e,i=t.selectAll(".e-stop",this.element),s=this.treeData;this.element.classList.contains("e-filtering")&&(s=this.DDTTreeData);for(var n=0;n<i.length;n++){var o=t.closest(i[parseInt(n.toString(),10)],"."+ge),a=o.getAttribute("data-uid").toString(),l=void 0;this.element.classList.contains("e-filtering")&&(l=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("parentID","equal",a,!0)));var d=0;if(e=1===this.dataType?new r.DataManager(s).executeLocal((new r.Query).where(this.fields.parentID,"equal",a,!0)):this.getChildNodes(s,a)){for(var h=this,c=0;c<e.length;c++)!function(t){var i=e[parseInt(t.toString(),10)][h.fields.id].toString();-1!==h.checkedNodes.indexOf(i)?d++:h.element.classList.contains("e-filtering")&&-1!==l.findIndex(function(e){return e.id===i})&&d++}(c);if(d===e.length){var p=o.getAttribute("data-uid");-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p),this.changeState(o,"check",null,!0,!0)}else 0===d&&0===this.checkedNodes.length&&this.changeState(o,"uncheck",null,!0,!0)}}},a.prototype.checkIndeterminateState=function(e){var t;(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]'))?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},a.prototype.updateChildCheckState=function(e,i){for(var s=0,n=i[this.fields.id]?i[this.fields.id].toString():"",r=0;r<e.length;r++){var o=e[parseInt(r.toString(),10)][this.fields.id]?e[parseInt(r.toString(),10)][this.fields.id].toString():"";e[parseInt(r.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(o)&&this.checkDisabledState(o,e[r]),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.autoCheck&&this.checkDisabledState(o,e[r]),-1!==this.checkedNodes.indexOf(o)&&this.autoCheck&&s++,this.checkedNodes.indexOf(o)>-1&&-1===this.validNodes.indexOf(o)&&this.validNodes.push(o);var a=t.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]);a&&a.length&&(-1===this.parentCheckData.indexOf(i)&&this.parentCheckData.push(i),this.updateChildCheckState(a,e[parseInt(r.toString(),10)])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkDisabledState(n,i)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var l=0;l<this.parentCheckData.length;l++)i!==this.parentCheckData[parseInt(l.toString(),10)]&&this.parentCheckData[parseInt(l.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(l.toString(),10)])}this.parentCheckData=[]},a.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.classList.add(ke);var s=t.select("div."+me+", div."+fe,e.item),r=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var o=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(r)>-1?(t.select(".e-frame",i).classList.add(Le),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(o)||"true"!==o.toString()?e.item.setAttribute("aria-checked","false"):(t.select(".e-frame",i).classList.add(Le),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item));var a=t.select(".e-frame",i);t.EventHandler.add(a,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(a,"mouseup",this.frameMouseHandler,this)}this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains("e-selected")&&e.item.setAttribute("aria-selected","false");var l=e.fields;if(this.addActionClass(e,l.selected,"e-selected"),this.addActionClass(e,l.expanded,"e-expanded"),e.item.setAttribute("tabindex","-1"),t.EventHandler.add(e.item,"focus",this.focusIn,this),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+ve),h=e.item.getAttribute("data-uid");d.innerHTML="",this.renderNodeTemplate(e.curData,d,h)}var c={node:e.item,nodeData:e.curData,text:e.text};this.isRefreshed||(this.trigger("drawNode",c),!1!==e.curData[this.fields.selectable]||this.showCheckBox||(e.item.classList.add("e-prevent"),e.item.firstElementChild.setAttribute("style","cursor: not-allowed")))},a.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},a.prototype.addActionClass=function(e,i,s){var n=e.curData,r=t.getValue(i,n);t.isNullOrUndefined(r)||"false"===r.toString()||e.item.classList.add(s)},a.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof r.DataManager){for(s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[parseInt(s.toString(),10)])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)])))return 1;return 2}for(var s=0,n=e.length;s<n;s++){if("string"==typeof i.child&&(!t.isNullOrUndefined(t.getValue(i.child,e[parseInt(s.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(s.toString(),10)],i.child)))return 2;if(this.isChildObject())return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[parseInt(s.toString(),10)]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[parseInt(s.toString(),10)])))return 1}return 1},a.prototype.getGroupedData=function(e,t){for(var s=(new r.Query).group(t),n=i.ListBase.getDataSource(e,s),o=[],a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].items;o.push(l)}return o},a.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},a.prototype.finalizeNode=function(e,i,s){var n=this;if(i||this.updateAttributes(e),!s){var o=t.selectAll(".e-expanded",e);if(!this.loadOnDemand&&this.fields.dataSource instanceof r.DataManager&&(this.isInitalExpand=this.treeData.filter(function(e){return!0===e[n.fields.expanded]}).length>0||this.isInitalExpand),!this.isInitalExpand)for(var a=0;a<o.length;a++)this.renderChildNodes(o[parseInt(a.toString(),10)]);t.removeClass(o,"e-expanded")}i||this.updateList(),this.isLoaded&&this.updateCheckedProp()},a.prototype.updateAttributes=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[parseInt(s.toString(),10)].setAttribute("alt","e-list-img");if(this.isLoaded){for(var n=t.selectAll(".e-selected",e),r=0;r<n.length;r++){this.selectNode(n[parseInt(r.toString(),10)],null);break}t.removeClass(n,"e-selected")}for(var o=t.selectAll(".e-list-item:not(.e-expanded)",e),a=0;a<o.length;a++){var l=t.select("div."+Ie,o[parseInt(a.toString(),10)]);l&&l.classList.contains(me)&&this.disableExpandAttr(o[parseInt(a.toString(),10)])}},a.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},a.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[parseInt(i.toString(),10)].classList.contains(ge)&&(t.select("."+ye,e[parseInt(i.toString(),10)])?this.ensureParentCheckState(e[parseInt(i.toString(),10)]):this.ensureChildCheckState(e[parseInt(i.toString(),10)]));else for(var s=t.selectAll(".e-stop",this.element),i=0;i<s.length;i++)s[parseInt(i.toString(),10)].classList.remove("e-stop")},a.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(ue))return;var i=e;e.classList.contains(ge)&&(i=t.select("."+ye,e));var s=t.selectAll("."+ke+" ."+Le,i),n=t.selectAll(".e-stop",i),o=t.selectAll(this.checkDisabledChildren?"."+ge:".e-list-item:not(.e-disable)",i),a=e.getElementsByClassName(ke)[0],l=o.length,d=s.length,h=[],c=[],p=e.getAttribute("data-uid"),u=!0,f=!1;o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?f=!0:u=!1)});var m=!1;if(this.element.classList.contains("e-filtering")){d=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("parentID","equal",p,!0)).length;var g=new r.DataManager(this.OldCheckedData).executeLocal((new r.Query).where("hasChildren","equal",!0,!0));g.length>0&&this.OldCheckedData.some(function(e){return e.id===p})&&f&&(d=g.length,m=!0);l=(1===this.dataType?new r.DataManager(this.DDTTreeData).executeLocal((new r.Query).where(this.fields.parentID,"equal",p,!0)):this.getChildNodes(this.DDTTreeData,p)).length}if(!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof r.DataManager||(h=this.getSelectedChildNodeDetails(p),c=new r.DataManager(this.checkActionNodes).executeLocal((new r.Query).where("parentID","equal",p,!0))),0===l&&0===d)return;l===d||m&&l>0&&c.length===h.length&&0!==c.length&&0!==h.length&&u&&this.autoCheck&&this.showCheckBox?this.changeState(a,"check",null,!0,!0):d>0&&!m&&this.autoCheck&&this.showCheckBox?this.changeState(a,"indeterminate",null,!0,!0):d>0||n.length>0?this.changeState(a,"indeterminate",null,!0,!0):0===d&&this.changeState(a,"uncheck",null,!0,!0);var v=t.closest(e,"."+ye);if(!t.isNullOrUndefined(v)){var y=t.closest(v,"."+ge);this.ensureParentCheckState(y)}}},a.prototype.getSelectedChildNodeDetails=function(e){var i=this;return this.checkedNodes.map(function(e){return new r.DataManager(i.DDTTreeData).executeLocal((new r.Query).where("id","equal",e,!0))[0]}).filter(function(i){if(i&&"object"==typeof i&&"pid"in i){var s=i.pid;if(!t.isNullOrUndefined(s))return s.toString()===e}return!1})},a.prototype.ensureChildCheckState=function(e,i,s){var n=this;if(!t.isNullOrUndefined(e)){var r=t.select("."+ye,e),o=void 0;if(!t.isNullOrUndefined(r)){var a=Array.from(r.querySelectorAll("li"));o=t.selectAll("."+ke,r),this.isFilter&&(o=Array.from(o).filter(function(e){var t=e.closest("li").getAttribute("data-uid");return null!==t&&-1!==n.checkedNodes.indexOf(t)}),a=Array.from(a).filter(function(e){var t=e.getAttribute("data-uid");return null!==t&&-1!==n.checkedNodes.indexOf(t)}),0===o.length&&(o=t.selectAll("."+ke,r),a=Array.from(r.querySelectorAll("li"))));for(var l=e.getElementsByClassName("e-frame")[0].classList.contains(Le),d=e.getElementsByClassName("e-frame")[0].classList.contains("e-stop"),h=void 0,c=0;c<o.length;c++){var p=a[parseInt(c.toString(),10)].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[parseInt(c.toString(),10)]))){var u=o[parseInt(c.toString(),10)].getElementsByClassName("e-frame")[0].classList.contains(Le);l?h="check":u&&!this.isLoaded?h="check":-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(d||l)?h="check":a[parseInt(c.toString(),10)].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||d)&&-1!==this.parentNodeCheck.indexOf(p)?(h="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||d)&&-1!==this.parentNodeCheck.indexOf(p)?(h="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):h="uncheck"}else h=t.getValue(this.fields.isChecked,this.currentLoadData[parseInt(c.toString(),10)])?"check":"uncheck",-1!==this.ele&&(h=l?"check":"uncheck"),"uncheck"===h&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),h="indeterminate");this.changeState(o[parseInt(c.toString(),10)],h,i,!0,!0)}}this.autoCheck&&this.isLoaded&&!s&&this.updateParentCheckState()}},a.prototype.doCheckBoxAction=function(e,i){if(t.isNullOrUndefined(e)){var s=t.selectAll("."+ke,this.element);if(this.loadOnDemand)for(n=0;n<s.length;n++)this.updateFieldChecked(s[parseInt(n.toString(),10)],i),this.changeState(s[parseInt(n.toString(),10)],i?"check":"uncheck",null,null,null,i);else for(var n=0;n<s.length;n++)this.updateFieldChecked(s[parseInt(n.toString(),10)],i),this.changeState(s[parseInt(n.toString(),10)],i?"check":"uncheck")}else{e.reverse();for(var r=e.length-1;r>=0;r--){var o=this.getElement(e[parseInt(r.toString(),10)]);if(t.isNullOrUndefined(o)){if(""!==(u=e[r-e.length]?e[r-e.length].toString():e[parseInt(r.toString(),10)]?e[parseInt(r.toString(),10)].toString():null)&&i&&u)this.setValidCheckedNode(u,e),this.dynamicCheckState(u,i);else if(-1!==this.checkedNodes.indexOf(u)&&""!==u&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(u),1);var a=this.getChildNodes(this.treeData,u);if(a){for(var l=0;l<a.length;l++){var d=a[parseInt(l.toString(),10)][this.fields.id]?a[parseInt(l.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(d)){this.checkedNodes.splice(this.checkedNodes.indexOf(d),1);var h=this.element.querySelector('[data-uid="'+d+'"]');h&&this.changeState(h,"uncheck",null)}}-1!==this.parentNodeCheck.indexOf(u)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(u),1)}u&&this.dynamicCheckState(u,i),this.updateField(this.treeData,this.fields,u,"isChecked",null)}}else{var c=t.select(".e-list-parent ."+ke,o);this.validateCheckNode(c,!i,o,null)}}}if(e)for(var p=0;p<e.length-1;p++){var u=e[parseInt(p.toString(),10)]?e[parseInt(p.toString(),10)].toString():"";i||this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},a.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+ge),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},a.prototype.dynamicCheckState=function(e,i){if(1===this.dataType){var s=0,n=new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var o=n[0][this.fields.id]?n[0][this.fields.id].toString():null,a=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,l=this.element.querySelector('[data-uid="'+a+'"]'),d=this.element.querySelector('[data-uid="'+o+'"]'),h=this.getChildNodes(this.treeData,a);if(h)for(u=0;u<h.length;u++){var c=h[parseInt(u.toString(),10)][this.fields.id]?h[parseInt(u.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(c)&&s++}-1!==this.checkedNodes.indexOf(e)&&l&&o===e&&this.autoCheck?this.changeState(l,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&o===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&o===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&l&&o===e&&this.autoCheck&&0!==s?this.changeState(l,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&l&&o===e&&this.autoCheck&&0===s?this.changeState(l,"uncheck",null):d||l||o!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(var o=void 0,l=void 0,p=void 0,u=0;u<this.treeData.length;u++){o=this.treeData[parseInt(u.toString(),10)][this.fields.id]?this.treeData[parseInt(u.toString(),10)][this.fields.id].toString():"",p=(l=this.element.querySelector('[data-uid="'+o+'"]'))?t.select("."+Le,l):null,-1===this.checkedNodes.indexOf(o)&&l&&p&&!i&&this.changeState(l,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[parseInt(u.toString(),10)]);f&&this.updateChildIndeterminate(f,o,e,i,o)}},a.prototype.updateIndeterminate=function(e,t){var i,s=this.getTreeData(e),n=0;1===this.dataType&&(i=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null);var r=this.getChildNodes(this.treeData,i);if(r)for(var o=0;o<r.length;o++){var a=r[parseInt(o.toString(),10)][this.fields.id]?r[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(a)&&n++}var l=this.element.querySelector('[data-uid="'+i+'"]');l&&t?this.changeState(l,"indeterminate",null):!t&&l&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(l,"indeterminate",null):!t&&l&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(l,"uncheck",null):l||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)?this.parentNodeCheck.push(i):t||-1===this.checkedNodes.indexOf(i)||-1!==this.parentNodeCheck.indexOf(i)||0===n||this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1))},a.prototype.updateChildIndeterminate=function(e,i,s,n,r){for(var o=0,a=0;a<e.length;a++){var l=e[parseInt(a.toString(),10)][this.fields.id]?e[parseInt(a.toString(),10)][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(l)&&o++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+Le,d):null,p=this.element.querySelector('[data-uid="'+l+'"]'),u=p?t.select("."+Le,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&l===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||l!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&l===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&l===s&&this.autoCheck&&0===o&&!n)h.classList.remove("e-stop");else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&l===s&&0===o)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(l)&&p&&u&&0===o)this.changeState(p,"uncheck",null);else if(!p&&!d&&l===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+r+'"]');n&&0!==o?this.changeState(f,"indeterminate",null):n&&o===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkDisabledState(i):n||0!==o||-1===this.parentNodeCheck.indexOf(i)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i)),-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i)}}else this.autoCheck?this.changeState(d,"uncheck",null):0!==o?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[parseInt(a.toString(),10)]);m&&this.updateChildIndeterminate(m,l,s,n,r)}},a.prototype.changeState=function(e,i,s,n,r,o){var a,l=this,d=t.closest(e,"."+ge);!this.checkDisabledChildren&&d&&(d.classList.contains(we)||this.disableNode&&-1!==this.disableNode.indexOf(d.getAttribute("data-uid")))||(e===d&&(e=t.select("."+ke,d)),n?this.nodeCheckAction(e,i,d,a,s,n,r,o):(this.checkActionNodes=[],a=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",a,function(t){t.cancel||l.nodeCheckAction(e,i,d,t,s,n,r,o)})))},a.prototype.nodeCheckAction=function(e,i,s,n,r,o,a,l){var d,h=e.getElementsByClassName("e-frame")[0];if("check"!==i||h.classList.contains(Le)?"uncheck"===i&&(h.classList.contains(Le)||h.classList.contains("e-stop"))?(t.removeClass([h],[Le,"e-stop"]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(Le),h.classList.add("e-stop"),this.removeCheck(s),d="mixed"):(h.classList.remove("e-stop"),h.classList.add(Le),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||s.setAttribute("aria-checked",d),a){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,r),t.isUndefined(o)&&(n.data=c)}void 0!==l&&this.ensureStateChange(s,l),o||t.isNullOrUndefined(d)||(s.setAttribute("aria-checked",d),n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},a.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkDisabledState(i)},a.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},a.prototype.getCheckEvent=function(e,i,s){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,data:n}},a.prototype.finalize=function(){var e=t.select("."+ye,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",Te.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+ge,this.element);i&&(i.setAttribute("tabindex","0"),this.updateIdAttr(null,i)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction()}},a.prototype.setTextWrap=function(){(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-text-wrap"),t.Browser.isIE&&(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-ie-wrap")},a.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var i=e?t.selectAll("."+ge,e):this.liList,s=i.length,n=0;n<s;n++)this.calculateWrap(i[parseInt(n.toString(),10)])},a.prototype.calculateWrap=function(e){var i=t.select("."+Oe,e);i&&i.nextElementSibling&&(i.style.height=this.allowTextWrap?i.nextElementSibling.offsetHeight+"px":"")},a.prototype.doExpandAction=function(){var e=this,i=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof r.DataManager&&(this.isInitalExpand=this.treeData.filter(function(t){return!0===t[e.fields.expanded]}).length>0||this.isInitalExpand),this.isInitalExpand&&i.length>0)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof r.DataManager)this.expandGivenNodes(i);else{for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[parseInt(s.toString(),10)]+'"]',this.element);if(t.isNullOrUndefined(n))i[parseInt(s.toString(),10)]&&-1===this.expandChildren.indexOf(i[parseInt(s.toString(),10)])&&this.expandChildren.push(i[parseInt(s.toString(),10)].toString());else{var o=t.select("."+me,t.select("."+xe,n));t.isNullOrUndefined(o)||this.expandAction(n,o,null)}}this.afterFinalized()}else this.afterFinalized()},a.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){++t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),this.index>0&&(this.index=0)},a.prototype.expandCallback=function(e,i){var s=t.select('[data-uid="'+e+'"]',this.element);if(t.isNullOrUndefined(s))i();else{var n=t.select("."+me,t.select("."+xe,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null,!1,i),i()}},a.prototype.afterFinalized=function(){if(this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,(!this.isLoaded||this.isFieldChange)&&!this.isNodeDropped){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0,this.isNodeDropped=!1},a.prototype.doSelectionAction=function(){var e=t.selectAll(".e-selected",this.element),i=this.selectedNodes;if(i.length>0){this.setProperties({selectedNodes:[]},!0);for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[parseInt(s.toString(),10)]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[parseInt(s.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,"e-selected")},a.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},a.prototype.clickHandler=function(e){var i=t.Browser.isDevice&&e.originalEvent.changedTouches&&!t.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+ge);if(n&&(!n.classList.contains("e-prevent")||s.contains(me)||s.contains(fe))){if(3!==e.originalEvent.which){var r=t.select(".e-ripple-element",n),o=t.select("."+Ie,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var a=t.closest(i,"."+ke);if(!t.isNullOrUndefined(a)){var l=t.select(".e-frame",a);return this.validateCheckNode(a,l.classList.contains(Le),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(me)?this.expandAction(n,i,e):s.contains(fe)?this.collapseNode(n,i,e):r&&o?o.classList.contains("e-ripple")&&o.classList.contains(me)?this.expandAction(n,o,e):o.classList.contains("e-ripple")&&o.classList.contains(fe)?this.collapseNode(n,o,e):s.contains(ye)||s.contains(ge)||this.toggleSelect(n,e.originalEvent,!1):s.contains(ye)||s.contains(ge)||this.toggleSelect(n,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,n)}}},a.prototype.nodeCheckedEvent=function(e,t,i){var s=this.getCheckEvent(e,t?"uncheck":"check",i);s.data=s.data.splice(0,s.data.length-1),this.trigger("nodeChecked",s)},a.prototype.updateOldCheckedData=function(e){var t=this,i=new r.DataManager(e),s=i.executeLocal((new r.Query).where("isChecked","equal","true",!0)),n=i.executeLocal((new r.Query).where("isChecked","equal","false",!0));if(n.length>0&&-1!==(a=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id}))){this.OldCheckedData.splice(a,1);var o=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id});return void(o.length>0&&o.forEach(function(e){var i=t.OldCheckedData.findIndex(function(t){return t.id===e.id});-1!==i&&t.OldCheckedData.splice(i,1)}))}if(s.length>0){var a=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id});if(-1===a)return void this.OldCheckedData.push(s[0])}},a.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},a.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Ce)&&this.hideSpinner(i),this.initialRender||i.classList.add("interaction"),!0!==s||!0===s&&e.classList.contains("e-expanded")){if(!0!==this.preventExpand){t.removeClass([i],me),t.addClass([i],fe);var o=0,a=0,l=t.select("."+ye,e),d=e;if(this.isAnimate&&!this.isRefreshed){this.setHeight(d,l);var h=t.select(".e-list-item."+be,e);this.aniObj.animate(l,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===t.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add("e-animation-active"),o=d.offsetHeight,a=t.select("."+xe,e).offsetHeight},progress:function(e){e.element.style.display="block",n.animateHeight(e,o,a)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove("e-animation-active"),n.expandedNode(d,l,i)}})}else this.expandedNode(d,l,i)}}else t.select("."+ye,e).style.display="none",this.fields.dataSource instanceof r.DataManager==!0&&(this.preventExpand=!1);this.initialRender&&i.classList.add("interaction")},a.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Se),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},a.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),t.removeClass([e],"e-node-collapsed");var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.expandedNodes.indexOf(i)||this.expandedNodes.push(i)},a.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Se)){t.addClass([i],Se);var r;this.isLoaded?(r=this.getExpandEvent(e,s),this.isInteracted=r.isInteracted,this.trigger("nodeCollapsing",r,function(s){s.cancel?t.removeClass([i],Se):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,r)}},a.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],fe),t.addClass([i],me);var r=0,o=0,a=t.select("."+ye,e),l=e,d=t.select(".e-list-item."+be,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===t.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){l.style.overflow="hidden",!t.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.add("e-animation-active"),r=t.select("."+xe,e).offsetHeight,o=l.offsetHeight},progress:function(e){n.animateHeight(e,r,o)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(d)&&d instanceof HTMLElement&&d.classList.remove("e-animation-active"),n.collapsedNode(l,a,i,s)}}):this.collapsedNode(l,a,i,s)},a.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Se),this.removeExpand(e),this.isLoaded&&((n=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",n))},a.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);var i=this.expandedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.expandedNodes.splice(i,1)},a.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],"e-node-collapsed")},a.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},a.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},a.prototype.renderChildNodes=function(e,s,n,o,a){var l=this,d=t.select("div."+Ie,e);if(!t.isNullOrUndefined(d)){this.showSpinner(d);var h;if(this.fields.dataSource instanceof r.DataManager){var c=this.parents(e,"."+ye).length,p=this.getChildFields(this.fields,c,1);if(t.isNullOrUndefined(p)||t.isNullOrUndefined(p.dataSource))return t.detach(d),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager&&this.isOffline?(this.treeList.pop(),h=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(h,p,d,e,s,n,o)):p.dataSource.executeQuery(this.getQuery(p,e.getAttribute("data-uid"))).then(function(t){l.treeList.pop(),h=t.result,1===l.dataType&&(l.dataType=2),l.loadChild(h,p,d,e,s,n,o)}).catch(function(e){l.trigger("actionFailure",{error:e})})}else{if(h=this.getChildNodes(this.treeData,e.getAttribute("data-uid"),!1,parseFloat(e.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(h),t.isNullOrUndefined(h)||0===h.length)return t.detach(d),d.classList.contains(Ce)&&this.hideSpinner(d),void this.removeExpand(e,!0);this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(e,d,o),this.setSelectionForChildNodes(h),this.ensureCheckNode(e,a),this.finalizeNode(e,a,s),this.disableTreeNodes(h),this.renderSubChild(e,s,o,a)}}},a.prototype.loadChild=function(e,s,n,o,a,l,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(o,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof r.DataManager&&!this.isOffline){var h=o.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(o.getAttribute("aria-level"))+1,o.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(o,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(o),this.finalizeNode(o),this.disableTreeNodes(e),this.renderSubChild(o,a,d)}l&&l(),a&&this.expandedNodes.push(o.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},a.prototype.disableTreeNodes=function(e){if(!t.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var i=0;i<e.length;){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(s)&&this.doDisableAction([s]),i++}},a.prototype.setSelectionForChildNodes=function(e){if(!t.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length){var i;for(i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(s)&&this.doSelectionAction()}}},a.prototype.ensureCheckNode=function(e,i){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e,null,i),(!i||(t.select("."+Le,this.element)||t.select(".e-stop",this.element)))&&this.ensureParentCheckState(e))),this.currentLoadData=null},a.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},a.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},a.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},a.prototype.getChildNodes=function(e,i,s,n){var r=this;void 0===s&&(s=!1);var o;if(t.isNullOrUndefined(e))return o;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,i)||this.findNestedChildNodes(e,i,n)||[];if(this.isChildObject()){for(var a=t.isNullOrUndefined(n)?this.fields.child:this.fields,l=1;l<n&&!t.isNullOrUndefined(a.child);)a=a.child,l++;this.updateListProp(a);var d=e.findIndex(function(e){return t.getValue(r.fields.id,e)&&t.getValue(r.fields.id,e).toString()===i});if(-1!==d)return t.getValue("child",e[parseInt(d.toString(),10)]);if(-1===d)for(var h=0,c=e.length;h<c;h++){var p=t.getValue("child",e[parseInt(h.toString(),10)]),u=t.isNullOrUndefined(p)?-1:p.findIndex(function(e){return t.getValue(r.fields.child.id,e)&&t.getValue(r.fields.child.id,e).toString()===i});if(-1!==u)return t.getValue("child",p[parseInt(u.toString(),10)]);if(!t.isNullOrUndefined(p)&&void 0!==(o=this.getChildNodes(p,i,!1,n)))break}}return o},a.prototype.findChildNodes=function(e,i,s){var n=e.findIndex(function(e){var n=t.getValue(i,e);return n&&n.toString()===s});return-1!==n?t.getValue(this.fields.child,e[n]):null},a.prototype.findNestedChildNodes=function(e,i,s){for(var n=0,r=e;n<r.length;n++){var o=r[n],a=t.getValue(this.fields.child,o);if(!t.isNullOrUndefined(a)){var l=this.findChildNodes(a,this.fields.id,i);if(l)return l;var d=this.getChildNodes(a,i,!1,s);if(d&&d.length>0)return d}}},a.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++){if(t.isNullOrUndefined(e[parseInt(n.toString(),10)][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0])))return s?e[parseInt(n.toString(),10)]:[];if(t.getValue(this.fields.parentID,e[parseInt(n.toString(),10)][0]).toString()===i)return e[parseInt(n.toString(),10)]}},a.prototype.renderSubChild=function(e,i,s,n){if(i)for(var r=t.selectAll("."+me,e),o=0,a=r.length;o<a;o++){var l=r[parseInt(o.toString(),10)];if(e.querySelector(".e-icons")!==r[parseInt(o.toString(),10)]){var d=t.closest(l,"."+ge);this.expandArgs=this.getExpandEvent(d,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(d,i,null,s,n)}}},a.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},a.prototype.isActive=function(e){return!!e.classList.contains(be)},a.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))return void this.setFocusElement(e);var r;this.isLoaded?(r=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",r,function(t){t.cancel||t.node.classList.contains("e-prevent")||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,r,s)},a.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey||i.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var r=this.liList.indexOf(this.startNode),o=this.liList.indexOf(e);if(r>o){var a=r;r=o,o=a}for(var l=r;l<=o;l++){var d=this.liList[parseInt(l.toString(),10)];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s),this.isRightClick=!1),this.isRightClick=!1},a.prototype.unselectNode=function(e,t){var i,s=this;this.isLoaded?(i=this.getSelectEvent(e,"un-select",t),this.trigger("nodeSelecting",i,function(t){t.cancel||s.nodeUnselectAction(e,t)})):this.nodeUnselectAction(e,i)},a.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},a.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&(t.removeClass([i],Ae),i.setAttribute("tabindex","-1")),t.addClass([e],Ae),e.setAttribute("tabindex","0"),t.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(i,e)}},a.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],be);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},a.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],be);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},a.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+be),i=0,s=e;i<s.length;i++){var n=s[i];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}t.removeClass(e,be),this.setProperties({selectedNodes:[]},!0)},a.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},a.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},a.prototype.expandHandler=function(e){var i=t.Browser.isDevice&&e.originalEvent.changedTouches&&!t.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ge)||i.classList.contains(Ie)||this.showCheckBox&&t.closest(i,"."+ke)||this.expandCollapseAction(t.closest(i,"."+ge),e)},a.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+Ie,e);if(s&&!s.classList.contains(Se)){var n=s.classList;n.contains(me)?this.expandAction(e,s,i):n.contains(fe)&&this.collapseNode(e,s,i)}},a.prototype.expandAction=function(e,i,s,n,r,o){var a=this;i.classList.contains(Se)||(t.addClass([i],Se),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Se):a.nodeExpandAction(e,i,n,r,o)})):this.nodeExpandAction(e,i,n,r,o))},a.prototype.nodeExpandAction=function(e,i,s,n,r){var o=t.select("."+ye,e);if(o&&"UL"===o.nodeName)this.expandNode(e,i);else{this.isFirstRender=!0,this.renderChildNodes(e,s,n,null,r);for(var a=t.selectAll("."+ge,e),l=0;l<a.length;l++){var d=this.getId(a[parseInt(l.toString(),10)]);if(-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren){var h=t.select("."+me,t.select("."+xe,a[parseInt(l.toString(),10)]));t.isNullOrUndefined(h)||this.expandAction(a[parseInt(l.toString(),10)],h,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1)}}}},a.prototype.keyActionHandler=function(e){var i=this,s=e.target,n=this.getFocusedNode();if(s&&s.classList.contains("e-input")){var r=s;return void("enter"===e.action?r.blur():"escape"===e.action&&(r.value=this.oldText,r.blur()))}e.preventDefault();var o={cancel:!1,event:e,node:n};this.trigger("keyPress",o,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox?i.checkNode(e):i.toggleSelect(n,e);break;case"moveRight":i.openNode(!i.enableRtl,e);break;case"moveLeft":i.openNode(!!i.enableRtl,e);break;case"shiftDown":i.shiftKeySelect(!0,e);break;case"moveDown":case"ctrlDown":case"csDown":i.navigateNode(!0);break;case"shiftUp":i.shiftKeySelect(!1,e);break;case"moveUp":case"ctrlUp":case"csUp":i.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":i.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":i.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n);break;case"ctrlA":if(i.allowMultiSelection){var r=t.selectAll(".e-list-item:not(.e-active)",i.element);i.selectGivenNodes(r)}}})},a.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+xe),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var r=n.getBoundingClientRect();s.bottom>r.bottom?n.scrollTop+=s.bottom-r.bottom:s.top<r.top&&(n.scrollTop-=r.top-s.top)}this.isVisibleInViewport(i)||i.scrollIntoView(e)},a.prototype.isVisibleInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},a.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},a.prototype.shiftKeySelect=function(e,t){if(this.allowMultiSelection){var i=this.getFocusedNode(),s=e?this.getNextNode(i):this.getPrevNode(i);this.removeHover(),this.setFocusElement(s),this.toggleSelect(s,t,!1),this.navigateToFocus(!e)}else this.navigateNode(e)},a.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+ke,i),n=t.select(" .e-frame",s).classList.contains(Le);i.classList.contains("e-disable")||0===i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},a.prototype.validateCheckNode=function(e,i,s,n){var r=this,o=t.closest(e,"."+ge);this.checkActionNodes=[];var a=i?"false":"true";t.isNullOrUndefined(a)||o.setAttribute("aria-checked",a);var l=this.getCheckEvent(o,i?"uncheck":"check",n);this.trigger("nodeChecking",l,function(t){t.cancel||r.nodeCheckingAction(e,i,s,t,n)})},a.prototype.nodeCheckingAction=function(e,i,s,n,r){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))&&(this.checkedElement.push(s.getAttribute("data-uid")),this.autoCheck)){var o=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==o?this.allCheckNode(o,this.checkedElement,null,null,!1):o=null}if(this.changeState(e,i?"uncheck":"check",r,!0),this.autoCheck){this.ensureChildCheckState(s),this.updateOldCheckedData([this.getNodeData(s)]),this.ensureParentCheckState(t.closest(t.closest(s,"."+ye),"."+ge));var a=void 0;"check"===n.action?a=!0:"uncheck"===n.action&&(a=!1),this.ensureStateChange(s,a)}this.nodeCheckedEvent(e,i,r)},a.prototype.ensureStateChange=function(e,i){var s=this,n=t.select("."+ye,e),o=e.getAttribute("data-uid"),a=this.fields;if(1===this.dataType&&this.autoCheck){var l=new r.DataManager(this.treeData).executeLocal((new r.Query).where(a.parentID,"equal",o,!0)),d=l.filter(function(e){return-1!==s.checkedNodes.indexOf(e[a.id].toString())},this);-1!==this.checkedNodes.indexOf(o)&&d.length!==l.length&&this.isFilter&&d.length>0&&(l=d);for(v=0;v<l.length;v++){var h=l[parseInt(v.toString(),10)][this.fields.id]?l[parseInt(v.toString(),10)][this.fields.id].toString():null,c=l[parseInt(v.toString(),10)][this.fields.isChecked]?l[parseInt(v.toString(),10)][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(o)&&-1===this.checkedNodes.indexOf(h)){this.checkDisabledState(h,l[v]);u=this.getChildNodes(this.treeData,h);this.getChildItems(u,i),-1!==this.parentNodeCheck.indexOf(h)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)}else if(-1===this.checkedNodes.indexOf(o)&&null===n&&-1!==this.checkedNodes.indexOf(h)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(h),1),"true"===c&&this.updateField(this.treeData,this.fields,h,"isChecked",null),-1===this.checkedNodes.indexOf(o)&&null===n||-1!==this.parentNodeCheck.indexOf(h)){var p=this.getChildNodes(this.treeData,h);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(h)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)}}else{var u=this.getChildNodes(this.treeData,h);this.getChildItems(u,i)}}}else if(1!==this.dataType||this.autoCheck){if(u=this.getChildNodes(this.treeData,o)){var f=u.filter(function(e){var t=String(e[Object.keys(e)[0]]);return-1!==s.checkedNodes.indexOf(t)});f.length>0&&u.length&&this.isFilter&&(u=f),this.childStateChange(u,o,n,i)}}else if(i)for(v=0;v<this.treeData.length;v++){var m=this.treeData[parseInt(v.toString(),10)][this.fields.id]?this.treeData[parseInt(v.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(m)&&this.checkDisabledState(m,this.treeData[v])}else{for(var g=new r.DataManager(this.treeData).executeLocal((new r.Query).where(a.isChecked,"equal",!0,!1)),v=0;v<g.length;v++){var y=g[parseInt(v.toString(),10)][this.fields.id]?g[parseInt(v.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(y)&&this.checkedNodes.splice(this.checkedNodes.indexOf(y),1),this.updateField(this.treeData,this.fields,y,"isChecked",null)}this.checkedNodes=[]}},a.prototype.checkDisabledState=function(e,i){var s=this.checkDisabledChildren;if(!s){var n=!0;if(this.loadOnDemand&&this.fields.htmlAttributes&&(i=t.isNullOrUndefined(i)?i:this.getNodeObject(e),!t.isNullOrUndefined(i))){var r=i[this.fields.htmlAttributes];r&&!t.isNullOrUndefined(r.class)&&-1!==r.class.indexOf(we)&&(n=!1)}var o=t.select('[data-uid="'+e+'"]',this.element);s=o?!o.classList.contains(we):-1===this.disableNode.indexOf(e)&&n}s&&this.checkedNodes.push(e)},a.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null;-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null);var r=this.getChildNodes(this.treeData,s);r.length>0&&this.getChildItems(r,t)}},a.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",o=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===o&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[]));var a=this.getChildNodes([e[parseInt(n.toString(),10)]],r);a&&this.childStateChange(a,t,i,s)}},a.prototype.allCheckNode=function(e,i,s,n,r){if(e)for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.id,e[parseInt(o.toString(),10)]),l=this.element.querySelector('[data-uid="'+a+'"]');!1!==r&&-1===this.checkedElement.indexOf(a.toString())&&(null===l&&!t.isNullOrUndefined(e[parseInt(o.toString(),10)][this.fields.isChecked])&&-1===i.indexOf(a.toString())||0===n||2===s)&&(!1!==e[parseInt(o.toString(),10)][this.fields.isChecked]||2===s?i.push(a.toString()):n=null,n=!1!==e[parseInt(o.toString(),10)][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(a.toString())&&t.isNullOrUndefined(s)&&i.push(a.toString());var d=t.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]);if(!0===t.getValue(this.fields.hasChildren,e[parseInt(o.toString(),10)])||d){var h=t.getValue(this.fields.id,e[parseInt(o.toString(),10)]),c=void 0;(c=1===this.dataType?this.getChildNodes(this.treeData,h.toString()):d)&&(t.isNullOrUndefined(r)?this.allCheckNode(c,i,s,n):this.allCheckNode(c,i,s,n,r),n=null)}n=null}},a.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+Ie,s);if(e){if(!n)return;n.classList.contains(me)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(fe))this.collapseNode(s,n,i);else{var r=t.closest(t.closest(s,"."+ye),"."+ge);if(!r)return;r.classList.contains("e-disable")||(this.setFocus(s,r),this.navigateToFocus(!0))}},a.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},a.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},a.prototype.getFocusedNode=function(){var e,i=t.select('.e-list-item[tabindex="0"]',this.element);if(!t.isNullOrUndefined(i)){var s=i.getAttribute("aria-checked");"mixed"!==s&&"false"!==s||(this.isFilter=!1)}return t.isNullOrUndefined(i)&&(e=t.select("."+ge,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},a.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);if(this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")){var s=i.lastChild;null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")?this.focusNextNode(i,!1):null==i.nextSibling&&s.classList.contains(xe)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},a.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[parseInt(s.toString(),10)],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},a.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[parseInt(s.toString(),10)],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},a.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[parseInt(i.toString(),10)],i++}while(!t.isVisible(e));return e},a.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[parseInt(i.toString(),10)],i--}while(!t.isVisible(e));return e},a.prototype.setFocus=function(e,i){t.removeClass([e],Ae),e.setAttribute("tabindex","-1"),i.classList.contains("e-disable")||(t.addClass([i],Ae),i.setAttribute("tabindex","0"),i.focus(),t.EventHandler.add(i,"blur",this.focusOut,this),this.updateIdAttr(e,i))},a.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},a.prototype.focusIn=function(){if(!this.mouseDownStatus){var e=this.getFocusedNode();e.classList.contains("e-disable")?(e.setAttribute("tabindex","-1"),this.navigateNode(!0)):(e.setAttribute("tabindex","0"),t.addClass([e],Ae),t.EventHandler.add(e,"blur",this.focusOut,this)),this.mouseDownStatus=!1}},a.prototype.focusOut=function(e){var i=this.getFocusedNode();e.target===i&&(t.removeClass([i],Ae),t.EventHandler.remove(i,"blur",this.focusOut))},a.prototype.onMouseOver=function(e){if(!t.Browser.isDevice){var i=e.target,s=i.classList,n=t.closest(i,"."+ge);if(!n||s.contains(ye)||s.contains(ge))return void this.removeHover();n&&!n.classList.contains("e-disable")&&this.setHover(n)}},a.prototype.setHover=function(e){e.classList.contains("e-hover")||e.classList.contains("e-prevent")||(this.removeHover(),t.addClass([e],"e-hover"))},a.prototype.onMouseLeave=function(){this.removeHover()},a.prototype.removeHover=function(){var e=t.selectAll(".e-hover",this.element);e&&e.length&&t.removeClass(e,"e-hover")},a.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(ge)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(ue)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),r=t.closest(e.parentNode,"."+ge),o=r?r.getAttribute("data-uid"):null,a=e.classList.contains(be),l=!e.classList.contains("e-prevent"),d="true"===e.getAttribute("aria-expanded"),h=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+me,e)||t.select("."+fe,e)),c=null,p=t.select("."+ke,e);return this.showCheckBox&&p&&(c=e.getAttribute("aria-checked")),{id:s,text:n,parentID:o,selected:a,selectable:l,expanded:d,isChecked:c,hasChildren:h}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},a.prototype.getText=function(e,i){if(i){var s=this.getNodeObject(e.getAttribute("data-uid")),n=parseFloat(e.getAttribute("aria-level")),r=this.getFields(this.fields,n,1);return t.getValue(r.text,s)}return t.select("."+ve,e).textContent},a.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},a.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i,this.root);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},a.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},a.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",t.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},a.prototype.setCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},a.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ge)||i.classList.contains(Ie)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+ge);this.createTextbox(s)}},a.prototype.createTextbox=function(e){var i=this,s=t.select(".e-tree-input",this.element);s&&s.blur();var n=t.select("."+ve,e);this.updateOldText(e);var r=this.createElement("input",{className:"e-tree-input",attrs:{value:this.oldText}}),o=this.getEditEvent(e,null,r.outerHTML);this.trigger("nodeEditing",o,function(s){if(!s.cancel){var r="width:"+(n.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(i.nodeTemplateFn)||i.destroyTemplate(e),i.isReact?setTimeout(function(){i.renderTextBox(o,n,r)},5):i.renderTextBox(o,n,r)}})},a.prototype.renderTextBox=function(e,i,s){i.innerHTML=e.innerHtml;var n=t.select(".e-tree-input",i);this.inputObj=o.Input.createInput({element:n,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.setAttribute("style",s),n.focus();var r=n;r.setSelectionRange(0,r.value.length),this.wireInputEvents(n)},a.prototype.updateOldText=function(e){var i=e.getAttribute("data-uid");this.editData=this.getNodeObject(i);var s=parseFloat(e.getAttribute("aria-level"));this.editFields=this.getFields(this.fields,s,1),this.oldText=t.getValue(this.editFields.text,this.editData)},a.prototype.inputFocusOut=function(e){if(t.select(".e-tree-input",this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+ve),a=t.closest(i,"."+ge);t.detach(this.inputObj.container),o.Input.destroy({element:i,properties:this.properties}),this.fields.dataSource instanceof r.DataManager&&!this.isOffline?this.crudOperation("update",null,a,s,null,null,!0):this.appendNewText(a,n,s,!0),t.EventHandler.remove(i,"blur",this.inputFocusOut),this.inputObj=null,t.detach(i),i=null}},a.prototype.appendNewText=function(e,t,i,s){var n=this,r=this.getEditEvent(e,i,null);this.trigger("nodeEdited",r,function(r){i=r.cancel?r.oldText:r.newText,n.updateText(e,t,i,s),r.oldText!==i&&n.triggerEvent("nodeEdited",[n.getNode(e)])})},a.prototype.updateText=function(e,i,s,n){var r=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))this.enableHtmlSanitizer?i.innerText=t.SanitizeHtmlHelper.sanitize(s):i.innerHTML=s;else{i.innerText="";var o=e.getAttribute("data-uid");this.renderNodeTemplate(r,i,o),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),e.focus(),t.EventHandler.add(e,"blur",this.focusOut,this),t.addClass([e],Ae)),this.allowTextWrap&&this.calculateWrap(e)},a.prototype.getElement=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?t.getElement(e):null},a.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},a.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},a.prototype.getNodeObject=function(e){if(!t.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var i=0,s=this.treeData.length;i<s;i++){var n=t.getValue(this.fields.id,this.treeData[parseInt(i.toString(),10)]);if(!t.isNullOrUndefined(this.treeData[parseInt(i.toString(),10)])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[parseInt(i.toString(),10)]}}},a.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var o=0,a=e.length;o<a;o++){var l=t.getValue(i.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&l&&l.toString()===s)return e[parseInt(o.toString(),10)];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(o.toString(),10)]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[parseInt(o.toString(),10)]),this.getChildMapper(i),s)))break}else if(this.isChildObject()){d=t.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[parseInt(o.toString(),10)]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},a.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},a.prototype.initializeDrag=function(){var e,i=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+xe,enableTapHold:!0,tapHoldThreshold:100,helper:function(s){i.dragTarget=s.sender.target;var n=t.closest(i.dragTarget,"."+ue),r=t.closest(i.dragTarget,"."+xe);if(i.dragLi=t.closest(i.dragTarget,"."+ge),i.fullRowSelect&&!r&&i.dragTarget.classList.contains(Oe)&&(r=i.dragTarget.nextElementSibling),!i.dragTarget||!s.element.isSameNode(n)||!r||i.dragTarget.classList.contains(ue)||i.dragTarget.classList.contains(ye)||i.dragTarget.classList.contains(ge)||i.dragLi.classList.contains("e-disable"))return!1;var o=r.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+Ie,o))){var a=i.createElement("div",{className:Ie+" "+me});o.insertBefore(a,o.children[0])}var l="e-drag-item "+ue+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=i.createElement("div",{className:l})).appendChild(o);var d=i.selectedNodes.length;if(d>1&&i.allowMultiSelection&&i.dragLi.classList.contains(be)){var h=i.createElement("span",{className:"e-drop-count",innerHTML:""+d});e.appendChild(h)}return document.body.appendChild(e),document.body.style.cursor="",i.dragData=i.getNodeData(i.dragLi),e},dragStart:function(s){t.addClass([i.element],"e-dragging");var n,r=t.closest(s.target,".e-list-item");r&&(n=parseInt(r.getAttribute("aria-level"),10));var o=i.getDragEvent(s.event,i,null,s.target,null,e,n);o.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",o,function(t){t.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0})},drag:function(s){i.dragObj.setProperties({cursorAt:{top:!t.isNullOrUndefined(s.event.targetTouches)||t.Browser.isDevice?60:-20}}),i.dragAction(s,e)},dragStop:function(e){t.removeClass([i.element],"e-dragging"),e.target.classList.contains("e-sibling")||i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable");s&&n||(t.detach(e.helper),document.body.style.cursor="");var r,o=t.closest(s,".e-list-item");o&&(r=parseInt(o.getAttribute("aria-level"),10));var a=i.getDragEvent(e.event,i,s,s,null,e.helper,r);a.preventTargetExpand=!1,i.trigger("nodeDragStop",a,function(n){i.dragParent=n.draggedParentNode,i.preventExpand=n.preventTargetExpand,n.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor="",s.classList.contains("e-sibling")&&i.removeVirtualEle()),i.dragStartAction=!1})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){!t.isNullOrUndefined(e)&&!e.target.classList.contains("e-sibling")&&i.dropObj.dragData.default&&i.dropObj.dragData.default.helper.classList.contains(ue)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){i.dropAction(e),i.removeVirtualEle()}})},a.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],"e-dragging"),this.dragStartAction=!1},a.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&i.length>0?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},a.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&i.length>0?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},a.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+xe),r=t.select("div."+Ie,i);t.removeClass([r],[Ee,Ne,"e-drop-out","e-no-drop"]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="";var o=e.target.classList,a=e.event,l=this.getOffsetY(a,e.target),d=this.getOffsetX(a,e.target);if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(o)&&o.contains(Oe)&&(n=e.target.nextElementSibling),s){var h=t.closest(e.target,"."+ge),c=t.closest(e.target,"."+ke),p=t.closest(e.target,"."+fe),u=t.closest(e.target,"."+me);if(!s.classList.contains(ue)||n&&!h.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,h))if(this.hasTemplate&&h){var f=t.select(this.fullRowSelect?"."+Oe:"."+xe,h);if(e&&!u&&!p&&l<7&&!c||u&&l<5||p&&d<3){m=this.fullRowSelect?1:0;this.appendIndicator(h,r,m)}else if(e&&!u&&!p&&!c&&f&&l>f.offsetHeight-10||u&&l>19||p&&d>19){m=this.fullRowSelect?2:1;this.appendIndicator(h,r,m)}else t.addClass([r],Ee),this.isDropIn=!0}else if(h&&e&&!u&&!p&&l<7&&!c||u&&l<5||p&&d<3){m=this.fullRowSelect?1:0;this.appendIndicator(h,r,m)}else if(h&&e&&!u&&!p&&e.target.offsetHeight>0&&l>e.target.offsetHeight-10&&!c||u&&l>19||p&&d>19){var m=this.fullRowSelect?2:1;this.appendIndicator(h,r,m)}else t.addClass([r],Ee),this.isDropIn=!0;else"LI"!==e.target.nodeName||h.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,h)?e.target.classList.contains("e-sibling")?t.addClass([r],Ne):t.addClass([r],"e-drop-out"):(t.addClass([r],Ne),this.renderVirtualEle(e))}else t.addClass([r],"e-no-drop"),document.body.style.cursor="not-allowed";var g,v=t.closest(e.target,".e-list-item");v&&(g=parseInt(v.getAttribute("aria-level"),10));var y=this.getDragEvent(e.event,this,e.target,e.target,null,i,g);y.dropIndicator&&t.removeClass([r],y.dropIndicator),this.trigger("nodeDragging",y),y.dropIndicator&&t.addClass([r],y.dropIndicator)},a.prototype.appendIndicator=function(e,i,s){t.addClass([i],Ne);var n=this.createElement("div",{className:"e-sibling"});e.insertBefore(n,e.children[parseInt(s.toString(),10)])},a.prototype.dropAction=function(e){for(var i,s,n=e.event,o=this.getOffsetY(n,e.target),a=e.target,d=!1,h=[],c=[],p=e.dragData.draggable,u=0;u<p.ej2_instances.length;u++)if(p.ej2_instances[parseInt(u.toString(),10)]instanceof l){i=p.ej2_instances[parseInt(u.toString(),10)];break}if(i&&i.dragTarget){var f=i.dragTarget,m=t.closest(f,"."+ge),g=t.closest(a,"."+ge);if(c.push(m),null==g&&a.classList.contains(ue)&&(g=a.firstElementChild),t.detach(e.droppedElement),document.body.style.cursor="",!g||g.isSameNode(m)||this.isDescendant(m,g))return void(this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1));if(i.allowMultiSelection&&m.classList.contains(be)){var v=t.selectAll("."+be,i.element);if(c=v,e.target.offsetHeight<=33&&o>e.target.offsetHeight-10&&o>6)for(u=v.length-1;u>=0;u--)g.isSameNode(v[parseInt(u.toString(),10)])||this.isDescendant(v[parseInt(u.toString(),10)],g)||this.appendNode(a,v[parseInt(u.toString(),10)],g,e,i,o);else for(u=0;u<v.length;u++)g.isSameNode(v[parseInt(u.toString(),10)])||this.isDescendant(v[parseInt(u.toString(),10)],g)||this.appendNode(a,v[parseInt(u.toString(),10)],g,e,i,o)}else this.appendNode(a,m,g,e,i,o);s=parseInt(m.getAttribute("aria-level"),10),d=!0}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1);for(u=0;u<c.length;u++)h.push(this.getNode(c[parseInt(u.toString(),10)]));this.trigger("nodeDropped",this.getDragEvent(e.event,i,a,e.target,e.dragData.draggedElement,null,s,d)),i.element.id!==this.element.id&&(i.triggerEvent("nodeDropped",h),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",h)},a.prototype.appendNode=function(e,i,s,n,r,o){var a=t.closest(e,"."+ke),l=t.closest(n.target,"."+fe),d=t.closest(n.target,"."+me);i.classList.contains("e-disable")||a||!(d&&n.event.offsetY<5||l&&n.event.offsetX<3||d&&n.event.offsetY>19||l&&n.event.offsetX>19||!d&&!l)?this.dropAsChildNode(i,s,r,null,n,o,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,r):e.firstElementChild&&e.classList.contains(ue)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,r):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,r):this.dropAsChildNode(i,s,r,null,n,o,null,e),this.showCheckBox&&this.ensureIndeterminate()},a.prototype.dropAsSiblingNode=function(e,i,s,n){var r,o=t.closest(i,"."+ye),a=t.closest(e,"."+ye),l=t.closest(a,"."+ge);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?r=!1:s.event.offsetY<2?r=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?r=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(r=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");o.insertBefore(e,r?d:d.nextElementSibling)}else o.insertBefore(e,r?s.target:s.target.nextElementSibling);this.moveData(e,i,o,r,n),this.updateElement(a,l),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},a.prototype.dropAsChildNode=function(e,i,s,n,r,o,a,l){var d,h=t.closest(e,"."+ye),c=t.closest(h,"."+ge),p=t.closest(i,"."+ye);if(r&&r.target&&(d=t.select(this.fullRowSelect?"."+Oe:"."+xe,i)),r&&(o<7&&!l.classList.contains("e-sibling")||l.classList.contains("e-sibling")&&!i.lastChild.classList.contains("e-sibling"))&&!a)p.insertBefore(e,i),this.moveData(e,i,p,!0,s);else if(r&&r.target.offsetHeight>0&&o>r.target.offsetHeight-10&&!a&&!this.hasTemplate)p.insertBefore(e,i.nextElementSibling),this.moveData(e,i,p,!1,s);else if(this.hasTemplate&&d&&o>d.offsetHeight-10&&!a)p.insertBefore(e,i.nextElementSibling),this.moveData(e,i,p,!1,s);else{var u=this.expandParent(i),f=t.isNullOrUndefined(n)?null:u.childNodes[parseInt(n.toString(),10)];u.insertBefore(e,f),this.moveData(e,f,u,!0,s)}this.updateElement(h,c),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},a.prototype.moveData=function(e,i,s,n,r){var o=t.closest(s,"."+ge),a=this.getId(e),l=r.updateChildField(r.treeData,r.fields,a,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(o);if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);var p=t.isNullOrUndefined(h)?this.treeData.length:n?h:h+1;if(t.isNullOrUndefined(c)&&!this.hasPid)delete l[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,l[0])}if(this.treeData.splice(p,0,l[0]),r.element.id!==this.element.id){var f=r.removeChildNodes(a);p++;for(var m=0,g=f.length;m<g;m++)this.treeData.splice(p,0,f[parseInt(m.toString(),10)]),p++;r.groupedData=r.getGroupedData(r.treeData,r.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,c,l,n?h:h+1)},a.prototype.expandParent=function(e){var s=t.select("div."+me+", div."+fe,e);s&&s.classList.contains(me)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+ye,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+ye,e),!t.isNullOrUndefined(n)&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(n.style.display="none"),t.isNullOrUndefined(n)||!1!==this.preventExpand||(n.style.display="block"),t.isNullOrUndefined(n)&&!0===this.preventExpand&&(t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),(o=t.select("div."+me+", div."+fe,e))&&o.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),o?t.removeClass([o],fe):i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),t.isNullOrUndefined(n)){var r=this.expandArgs;(t.isNullOrUndefined(r)||r&&"nodeExpanding"!==r.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption);var o=t.select("div."+me+", div."+fe,e);o?t.removeClass([o],me):(i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption),o=t.select("div."+Ie,e),t.removeClass([o],me)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}var a=t.select("div."+fe,e);return!t.isNullOrUndefined(n)&&a&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(t.removeClass([a],fe),e.setAttribute("aria-expanded","false"),t.addClass([a],me)),n},a.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+Ie,i);t.detach(e),t.detach(s);var n=this.getId(i);this.updateField(this.treeData,this.fields,n,"hasChildren",!1),this.removeExpand(i,!0)}},a.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+ye).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,e),i+1)},a.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)];o.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,o),i+1)}},a.prototype.renderVirtualEle=function(e){var t,i=e.event,s=this.getOffsetY(i,e.target);s>e.target.offsetHeight-2?t=!1:s<2&&(t=!0);var n=this.createElement("div",{className:"e-sibling"}),r=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(n,e.target.children[parseInt(r.toString(),10)])},a.prototype.removeVirtualEle=function(){var e=t.select(".e-sibling");e&&t.detach(e)},a.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},a.prototype.getDragEvent=function(e,i,s,n,o,a,l,d){var h=s?t.closest(s,"."+ge):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:o,u=i?i.dragData:null,f=s?this.parents(s,"."+ge):null,m=i.dragLi.parentElement,g=i.dragLi?t.closest(m,"."+ge):null,v=null,y=null,b=[Ne,Ee,"e-drop-out","e-no-drop"],C=null,S=!0===d?p:h,I=S?t.closest(S,".e-list-parent"):null,x=0,E=null;if(g=i.dragLi&&null===g?t.closest(m,"."+ue):g,g=!0===d?this.dragParent:g,a)for(;x<4;){if(t.select("."+Ie,a).classList.contains(b[parseInt(x.toString(),10)])){C=b[parseInt(x.toString(),10)];break}x++}if(I){var N=0;for(x=0;x<I.childElementCount;x++){if(N=!0!==d&&I.children[parseInt(x.toString(),10)]===p&&h!==p?++N:N,!0!==d&&I.children[parseInt(x.toString(),10)].classList.contains("e-hover")){y=e.offsetY>=23?x+1:x;break}if(I.children[parseInt(x.toString(),10)]===S){e.offsetY,y=x;break}}y=0!==N?--y:y,E=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}if(s&&(v=0===f.length?null:s.classList.contains(ge)?f[0]:f[1]),h===p&&(v=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(v=h,!0!==d)){l=++l;var O=v?t.select(".e-list-parent",v):null;if(y=O?O.children.length:0,!(this.fields.dataSource instanceof r.DataManager)&&null===O&&v){var w=v.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,v.getAttribute("data-uid").toString()):null;y=w?w.length:0}}return{cancel:!1,clonedNode:a,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:l,draggedParentNode:g,dropTarget:v,dropIndicator:C,target:n,position:E}},a.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(s=0;s<i;s++)this.createFullRow(this.liList[parseInt(s.toString(),10)]);else for(var s=0;s<i;s++){var n=t.select("."+Oe,this.liList[parseInt(s.toString(),10)]);t.detach(n)}},a.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Oe});e.insertBefore(t,e.childNodes[0])},a.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=n=t.selectAll('.e-list-item:not([aria-selected="true"])',this.element);i<s.length;i++)(a=s[i]).setAttribute("aria-selected","false");else for(var n=t.selectAll('.e-list-item[aria-selected="false"]',this.element),r=0,o=n;r<o.length;r++){var a=o[r];a.removeAttribute("aria-selected")}},a.prototype.collapseByLevel=function(e,i,s,n){if(n=t.isNullOrUndefined(n)?1:n,i>0&&!t.isNullOrUndefined(e))for(var r=this.getVisibleNodes(s,e.childNodes),o=0,a=r.length;o<a;o++){var l=r[parseInt(o.toString(),10)],d=t.select("."+fe,t.select("."+xe,l));n>=i&&!t.isNullOrUndefined(d)&&this.collapseNode(l,d,null),this.collapseByLevel(t.select("."+ye,l),i,s,n+1)}},a.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+fe,this.element)),s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)],o=t.closest(r,"."+ge);this.collapseNode(o,r,null)}},a.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,o=n.length;r<o;r++){var a=n[parseInt(r.toString(),10)],l=t.select("."+me,t.select("."+xe,a));t.isNullOrUndefined(l)||this.expandAction(a,l,null),this.expandByLevel(t.select("."+ye,a),i-1,s)}},a.prototype.expandAllNodes=function(e){for(var i=0,s=this.getVisibleNodes(e,t.selectAll("."+me,this.element));i<s.length;i++){var n=s[i],r=t.closest(n,"."+ge);this.expandAction(r,n,null,!0,null,!0)}},a.prototype.getVisibleNodes=function(e,i){var s=Array.prototype.slice.call(i);if(e)for(var n=0;n<s.length;n++)t.isVisible(s[parseInt(n.toString(),10)])||(s.splice(n,1),n--);return s},a.prototype.removeNode=function(e){var i=t.closest(e,"."+ye),s=t.closest(i,"."+ge);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.removeData(e)},a.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},a.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+ge,this.element))},a.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=t.selectAll("."+be,this.element);this.selectGivenNodes(e)},a.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=t.selectAll('[aria-expanded="true"]',this.element),i=0,s=e.length;i<s;i++)this.addExpand(e[parseInt(i.toString(),10)])},a.prototype.removeData=function(e){if(1===this.dataType){var t=new r.DataManager(this.treeData),i=this.getId(e),s={},n=this.isNumberTypeId?parseFloat(i):i;s[this.fields.id]=n,t.remove(this.fields.id,s),this.removeChildNodes(i)}else{i=this.getId(e);this.updateChildField(this.treeData,this.fields,i,null,null,!0)}},a.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,o=i.length;n<o;n++){var a=new r.DataManager(this.treeData),l=t.getValue(this.fields.id,i[parseInt(n.toString(),10)]).toString(),d={},h=this.isNumberTypeId?parseFloat(l):l;d[this.fields.id]=h;var c=a.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(l)}return s},a.prototype.doGivenAction=function(e,i,s){for(var n=0,r=e.length;n<r;n++){var o=this.getElement(e[parseInt(n.toString(),10)]);if(!t.isNullOrUndefined(o)){var a=t.select("."+i,t.select("."+xe,o));t.isNullOrUndefined(a)||(s?this.expandAction(o,a,null):this.collapseNode(o,a,null))}}},a.prototype.addGivenNodes=function(e,s,n,r,o){if(0!==e.length){var a=this.getSortedData(e),l=s?parseFloat(s.getAttribute("aria-level"))+1:1;r&&this.updateMapper(l);var d,h=i.ListBase.createListItemFromJson(this.createElement,a,this.listBaseOption,l),c=this.getId(s);t.isNullOrUndefined(s)||(d=t.select("div."+Ie,s)),1===this.dataType&&d&&d.classList.contains(me)&&this.preventExpand&&!t.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,c,e,n),this.isFirstRender=!1);var p;p=o||(s?this.expandParent(s):t.select("."+ye,this.element));var u=t.isNullOrUndefined(n)?null:p.childNodes[parseInt(n.toString(),10)];if(!this.isFirstRender||1===this.dataType){var f=this.expandArgs;if(u||"None"===this.sortOrder){for(v=0;v<h.length;v++)p.insertBefore(h[parseInt(v.toString(),10)],u);1!==this.dataType||t.isNullOrUndefined(s)||this.preventExpand||t.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(m=t.select("div."+Ie,s))&&m.classList.contains(me)&&(t.isNullOrUndefined(f)||"nodeExpanding"!==f.name)&&this.expandAction(s,m,null))}if(!u&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===p.childNodes.length){for(v=0;v<h.length;v++)p.insertBefore(h[parseInt(v.toString(),10)],u);if(!(1!==this.dataType||t.isNullOrUndefined(s)||this.preventExpand||t.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager"))){this.preventExpand=!1;var m=t.select("div."+Ie,s);m&&m.classList.contains(me)&&(t.isNullOrUndefined(f)||"nodeExpanding"!==f.name)&&this.expandAction(s,m,null)}}else for(var g=p.childNodes,v=0;v<h.length;v++)for(C=0;C<g.length;C++){if("Ascending"===this.sortOrder?g[parseInt(C.toString(),10)].textContent.toUpperCase()>h[parseInt(v.toString(),10)].innerText.toUpperCase():g[parseInt(C.toString(),10)].textContent.toUpperCase()<h[parseInt(v.toString(),10)].innerText.toUpperCase()){p.insertBefore(h[parseInt(v.toString(),10)],g[parseInt(C.toString(),10)]);break}p.insertBefore(h[parseInt(v.toString(),10)],g[g.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);for(var y=this.getId(u),b=t.isNullOrUndefined(y)?this.treeData.length:this.getDataPos(this.treeData,this.fields,y),C=0;C<e.length;C++){if(!t.isNullOrUndefined(c)){var S=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,S,e[parseInt(C.toString(),10)])}this.treeData.splice(b,0,e[parseInt(C.toString(),10)]),b++}}this.finalizeNode(p)}},a.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},a.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(t,"navigateUrl")?t.navigateUrl:"navigateUrl"},a.prototype.getDataPos=function(e,i,s){for(var n=null,o=0,a=e.length;o<a;o++){var l=t.getValue(i.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&l&&l.toString()===s)return o;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(o.toString(),10)]))){var d=t.getValue("child",e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},a.prototype.addChildData=function(e,i,s,n,o){var a;if(t.isNullOrUndefined(s)){o=t.isNullOrUndefined(o)?e.length:o;for(var l=0,d=n.length;l<d;l++)e.splice(o,0,n[parseInt(l.toString(),10)]),o++;return a}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[parseInt(h.toString(),10)]);if(e[parseInt(h.toString(),10)]&&p&&p.toString()===s){if("string"==typeof i.child&&Object.prototype.hasOwnProperty.call(e[parseInt(h.toString(),10)],i.child)&&null!==e[parseInt(h.toString(),10)][i.child]||this.fields.dataSource instanceof r.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(h.toString(),10)],"child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[parseInt(h.toString(),10)]);t.isNullOrUndefined(f)&&(f=[]),o=t.isNullOrUndefined(o)?f.length:o;for(var l=0,d=n.length;l<d;l++)f.splice(o,0,n[parseInt(l.toString(),10)]),o++}else{u="string"==typeof i.child?i.child:"child";e[parseInt(h.toString(),10)][""+u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(h.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(h.toString(),10)]))){f=t.getValue("child",e[parseInt(h.toString(),10)]);if(void 0!==(a=this.addChildData(f,this.getChildMapper(i),s,n,o)))break}}else{var m=t.getValue(i.child,e[parseInt(h.toString(),10)]);if(void 0!==(a=this.addChildData(m,this.getChildMapper(i),s,n,o)))break}}return a},a.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)][this.fields.id].toString();o&&-1===this.disableNode.indexOf(o)&&this.disableNode.push(o);var a=this.getElement(o);a&&(a.setAttribute("aria-disabled","true"),t.addClass([a],we))}},a.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var r=this.getElement(i[parseInt(s.toString(),10)]),o=i[parseInt(s.toString(),10)];o&&-1!==this.disableNode.indexOf(o)&&this.disableNode.splice(this.disableNode.indexOf(o),1),r&&(r.removeAttribute("aria-disabled"),t.removeClass([r],we))}},a.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},a.prototype.checkValidId=function(e){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(t){return-1!==e.indexOf(t[i.fields.id]?t[i.fields.id].toString():null)});else if(2===this.dataType)for(var s=0;s<this.treeData.length;s++){var n=this.treeData[parseInt(s.toString(),10)][this.fields.id]?this.treeData[parseInt(s.toString(),10)][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[parseInt(s.toString(),10)]);var r=t.getValue(this.fields.child.toString(),this.treeData[parseInt(s.toString(),10)]);r&&this.filterNestedChild(r,e)}return this.validArr},a.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[parseInt(s.toString(),10)][this.fields.id]?e[parseInt(s.toString(),10)][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[parseInt(s.toString(),10)]);var r=t.getValue(this.fields.child.toString(),e[parseInt(s.toString(),10)]);r&&this.filterNestedChild(r,i)}},a.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},a.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var o=this.checkedNodes,a=0,r=o.length;a<r;a++)this.updateField(this.treeData,this.fields,o[parseInt(a.toString(),10)],"isChecked",!0)}},a.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,o=e.length;n<o;n++){for(var a=0;a<s.length;a++){var l=this.getMapperProp(i,s[parseInt(a.toString(),10)]);t.isNullOrUndefined(e[parseInt(n.toString(),10)][""+l])||delete e[parseInt(n.toString(),10)][""+l]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(n.toString(),10)]))?this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(n.toString(),10)]))&&this.removeField(t.getValue("child",e[parseInt(n.toString(),10)]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[parseInt(n.toString(),10)]),this.getChildMapper(i),s)}},a.prototype.getMapperProp=function(e,i){switch(i){case"selected":return t.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return t.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return t.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return t.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return i}},a.prototype.updateField=function(e,i,s,n,o){if(!t.isNullOrUndefined(s))if(1===this.dataType){var a=this.isNumberTypeId?parseFloat(s):s,l=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",a,!1));t.setValue(this.getMapperProp(i,n),o,l[0])}else this.updateChildField(e,i,s,n,o)},a.prototype.updateChildField=function(e,i,s,n,o,a){var l;if(t.isNullOrUndefined(e))return l;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[parseInt(d.toString(),10)]);if(e[parseInt(d.toString(),10)]&&!t.isNullOrUndefined(c)&&c.toString()===s)return a?l=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),o,e[parseInt(d.toString(),10)]),l=[]),l;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(d.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(d.toString(),10)]))){var p=t.getValue("child",e[parseInt(d.toString(),10)]);if(void 0!==(l=this.updateChildField(p,this.getChildMapper(i),s,n,o,a)))break}}else{var u=t.getValue(i.child,e[parseInt(d.toString(),10)]);if(void 0!==(l=this.updateChildField(u,this.getChildMapper(i),s,n,o,a)))break}}return l},a.prototype.triggerEvent=function(e,i){if(this.renderReactTemplates(),"addNodes"===e){for(var s=[],n=0;n<i.length;n++)s.push(this.getNode(this.getElement(t.isNullOrUndefined(i[parseInt(n.toString(),10)][this.fields.id])?t.getValue(this.fields.id,i[parseInt(n.toString(),10)]).toString():null)));i=s}var r={data:this.treeData,action:e,nodeData:i};this.trigger("dataSourceChanged",r)},a.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},a.prototype.wireEditingEvents=function(e){var i=this;e&&!this.disabled?this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),i.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},a.prototype.wireClickEvent=function(e){var i=this;e?this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},a.prototype.wireExpandOnEvent=function(e){var i=this;e?this.touchExpandObj=new t.Touch(this.element,{tap:function(e){("Click"===i.expandOnType||"DblClick"===i.expandOnType&&i.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&i.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},a.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&t.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},a.prototype.preventContextMenu=function(e){e.preventDefault()},a.prototype.wireEvents=function(){t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},a.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},a.prototype.parents=function(e,i){for(var s=[],n=e.parentNode;!t.isNullOrUndefined(n);)t.matches(n,i)&&s.push(n),n=n.parentNode;return s},a.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+ge):2===e.tapCount&&(i=t.closest(s,"."+ge))),this.firstTap===i},a.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},a.prototype.showSpinner=function(e){t.addClass([e],Ce),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},a.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Ce)},a.prototype.setCheckedNodes=function(e){(e=JSON.parse(JSON.stringify(e))).length>1&&"function"==typeof this.nodeChecked&&this.nodeChecked.length>0&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},a.prototype.setValidCheckedNode=function(e,i){if(void 0===i&&(i=[]),1===this.dataType){var s=this.fields,n=new r.DataManager(this.treeData).executeLocal((new r.Query).where(s.id,"equal",e,!0));if(n[0]&&(this.setChildCheckState(n,e,n[0],i),this.autoCheck)){for(var o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=this.getChildNodes(this.treeData,o),l=0,d=0;d<a.length;d++){var h=a[parseInt(d.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(h)&&l++}l===a.length&&-1===this.checkedNodes.indexOf(o)&&o&&this.checkDisabledState(o)}}else if(2===this.dataType)for(var c=0;c<this.treeData.length;c++){if((this.treeData[parseInt(c.toString(),10)][this.fields.id]?this.treeData[parseInt(c.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var p=t.getValue(this.fields.child.toString(),this.treeData[parseInt(c.toString(),10)]);p&&this.setChildCheckState(p,e,this.treeData[parseInt(c.toString(),10)],i)}},a.prototype.setChildCheckState=function(e,i,s,n){void 0===n&&(n=[]);var r,o=0;if(1===this.dataType){s&&(r=s[this.fields.id]?s[this.fields.id].toString():null);for(h=0;h<e.length;h++){var a=e[parseInt(h.toString(),10)][this.fields.id]?e[parseInt(h.toString(),10)][this.fields.id].toString():null;s&&r&&this.autoCheck&&-1!==this.checkedNodes.indexOf(r)&&-1===this.checkedNodes.indexOf(a)&&this.checkDisabledState(a,e[h]),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i);var l=this.getChildNodes(this.treeData,a),d=1===n.length&&n[0]===a;(l.length===i.length||d)&&this.setChildCheckState(l,i,s)}}else{s&&(r=s[this.fields.id]?s[this.fields.id].toString():"");for(var h=0;h<e.length;h++){var c=e[parseInt(h.toString(),10)][this.fields.id]?e[parseInt(h.toString(),10)][this.fields.id].toString():"",d=1===[i].length&&0===n.length;s&&r&&this.autoCheck&&(-1===this.checkedNodes.indexOf(r)||-1!==this.checkedNodes.indexOf(c)||c!==i&&!d||this.checkDisabledState(c,e[h])),c===i&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i),(l=t.getValue(this.fields.child.toString(),e[parseInt(h.toString(),10)]))&&this.setChildCheckState(l,i,e[parseInt(h.toString(),10)]),-1!==this.checkedNodes.indexOf(c)&&this.autoCheck&&o++,o===e.length&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,s)}}},a.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},a.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var r=0;r<s.length;r++)this.treeData.splice(n,0,s[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},a.prototype.updateChildPosition=function(e,i,s,n,o){for(var a,l=0,d=e.length;l<d;l++){var h=t.getValue(i.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&h&&h.toString()===s)return e[parseInt(l.toString(),10)]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[parseInt(l.toString(),10)]))){var c=t.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(a=this.updateChildPosition(c,this.getChildMapper(i),s,n,o)))break}}else{var p=t.getValue(i.child,e[parseInt(l.toString(),10)]);if(void 0!==(a=this.updateChildPosition(p,this.getChildMapper(i),s,n,o)))break}}return a},a.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},a.prototype.crudOperation=function(e,i,s,n,r,o,a){var l,d=this,h=this.fields.dataSource,c=[],p=this.getQuery(this.fields),u=this.fields.id,f={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];i?m=this.nodeType(i):s&&("string"==typeof s?m[0]=s.toString():"object"==typeof s&&(m[0]=s.getAttribute("data-uid").toString()));for(var g=0,v=m.length;g<v;g++){var y=this.getElement(m[parseInt(g.toString(),10)]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[parseInt(g.toString(),10)]);c.push(b)}}switch(e){case"delete":1===i.length?l=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,l=h.saveChanges(f,u,p.fromTable,p)),l.then(function(){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(l=h.update(u,c[0],p.fromTable,p)).then(function(){return d.editSucess(s,n,a)}).catch(function(e){return d.dmFailure(e,s,a)});break;case"insert":if(1===r.length)l=h.insert(r[0],p.fromTable,p);else{for(var C=[],g=0,v=r.length;g<v;g++)C.push(r[parseInt(g.toString(),10)]);f.addedRecords=C,l=h.saveChanges(f,u,p.fromTable,p)}l.then(function(){var e=d.getElement(s);d.addSuccess(r,e,o),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},a.prototype.deleteSuccess=function(e){for(var i=[],s=0,n=e.length;s<n;s++){var r=this.getElement(e[parseInt(s.toString(),10)]);i.push(this.getNode(r)),t.isNullOrUndefined(r)||this.removeNode(r)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent("removeNode",i)},a.prototype.editSucess=function(e,i,s){var n=this.getElement(e),r=t.select("."+ve,n);this.appendNewText(n,r,i,s)},a.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+Ie):null;t&&r&&r.classList.contains(me)&&null===t.querySelector("."+ye)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+ye),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},a.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},a.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+ve,s);this.updateText(s,n,this.oldText,i)},a.prototype.getHierarchicalParentId=function(e,i,s){var n=this,r=i.findIndex(function(t){return t[n.fields.id]&&t[n.fields.id].toString()===e});if(-1===r)for(var o=0;o<i.length;o++){var a=t.getValue(this.fields.child.toString(),i[parseInt(o.toString(),10)]);if(!t.isNullOrUndefined(a)){if(-1!==(r=a.findIndex(function(t){return t[n.fields.id]&&t[n.fields.id].toString()===e}))){s.push(i[parseInt(o.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(i[parseInt(o.toString(),10)][this.fields.id].toString(),this.treeData,s);break}this.getHierarchicalParentId(e,a,s)}}return s},a.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":if(this.selectedNodes.length>1){var o=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(o,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=i.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(i.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:t.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.isReact&&(!this.isReact||this.fields.dataSource instanceof r.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var a=this.element.querySelectorAll("li"),l=0;l<a.length;)"true"!==a[parseInt(l.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(a[parseInt(l.toString(),10)],!0,null,!0),l++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},a.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,e.prototype.destroy.call(this)},a.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var o=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof r.DataManager)this.isOffline?this.addSuccess(e,o,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,o,s);else{if(o)this.addGivenNodes(e,o,s);else{e=this.getSortedData(e);for(var a=0;a<e.length;a++){var l=t.getValue(this.fields.parentID,e[parseInt(a.toString(),10)]);o=l?this.getElement(l.toString()):l,!t.isNullOrUndefined(l)&&t.isNullOrUndefined(o)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(l),this.preventExpand=n,this.isHiddenItem=!1,o=this.getElement(l.toString())),this.addGivenNodes([e[parseInt(a.toString(),10)]],o,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&o&&this.ensureParentCheckState(o),this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},a.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i)},a.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},a.prototype.collapseAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.collapseByLevel(t.select("."+ye,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,fe,!1)},a.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},a.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},a.prototype.ensureVisible=function(e){var i=[];if(1===this.dataType)for(var s=this.getTreeData(e);0!==s.length&&!t.isNullOrUndefined(s[0][this.fields.parentID]);)i.push(s[0][this.fields.parentID].toString()),s=this.getTreeData(s[0][this.fields.parentID].toString());else 2===this.dataType&&(i=this.getHierarchicalParentId(e,this.treeData,i));this.expandAll(i.reverse(),null,null,this.isHiddenItem);var n=this.getElement(e);if(!t.isNullOrUndefined(n)){if("object"==typeof e){var r=this.parents(n,"."+ge);this.expandAll(r)}setTimeout(function(){n.scrollIntoView({behavior:"smooth"})},450)}},a.prototype.expandAll=function(e,i,s,n){this.isAnimate=!n,t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+ye,this.element),i,s):(this.expandAllNodes(s),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,me,!0),this.isAnimate=!0},a.prototype.getAllCheckedNodes=function(){return this.checkedNodes},a.prototype.getDisabledNodes=function(){return this.disableNode},a.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},a.prototype.getTreeData=function(e){var i=this.getId(e);if(this.updatePersistProp(),t.isNullOrUndefined(i))return this.treeData;var s=this.getNodeObject(i);return t.isNullOrUndefined(s)?[]:[s]},a.prototype.moveNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)&&0!==e.length){var o=this.getElement(i),a=[];t.isNullOrUndefined(o)&&(this.isHiddenItem=!0,this.ensureVisible(i),this.isHiddenItem=!1,o=this.getElement(i));for(var l=0;l<e.length;l++){var d=this.getElement(e[parseInt(l.toString(),10)]);a.push(this.getNode(d)),t.isNullOrUndefined(d)||o.isSameNode(d)||this.isDescendant(d,o)||(this.preventExpand=n,this.dropAsChildNode(d,o,this,s,null,null,null,o))}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",a)}},a.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n=!1;if(1===this.dataType&&s.length>1)n=!0;else if(2===this.dataType&&1===s.length){var r=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(r)||(n=!0)}var o=this.getElement(e),a=o?o.getAttribute("data-uid"):e?e.toString():null;this.refreshData=this.getNodeObject(a),s=JSON.parse(JSON.stringify(s));var l,d;if(1===this.dataType&&n){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[parseInt(h.toString(),10)][this.fields.parentID])){d=s[parseInt(h.toString(),10)],s.splice(h,1);break}l=t.extend({},this.refreshData,d)}else l=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))return void this.updatePosition(a,l,n,s);this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[l],this.listBaseOption,c),u=t.select("."+ye,o),f=t.getValue(this.fields.child.toString(),l);if(n&&u||n&&!t.isNullOrUndefined(f)){var m=o.parentElement,g=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[parseInt(g.toString(),10)]),this.updatePosition(a,l,n,s),n&&u&&this.expandAll([a])}else{var v=t.select("."+xe,o),y=t.select("."+xe,p[0]),b=t.select("div."+Ie,v),C=t.select("div."+Ie,y);b&&C&&(C.classList.contains(me)&&b.classList.contains(fe)?(t.removeClass([C],me),t.addClass([C],fe)):C.classList.contains(fe)&&b.classList.contains(me)?(t.removeClass([C],fe),t.addClass([C],me)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(v);var S=t.select("."+Oe,o);S.parentNode.insertBefore(y,S.nextSibling),this.updatePosition(a,l,n,s)}if(o=this.getElement(e),l[this.fields.tooltip]&&o.setAttribute("title",l[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(l,this.fields.htmlAttributes)&&l[this.fields.htmlAttributes]){var I={};t.merge(I,l[this.fields.htmlAttributes]),I.class?(t.addClass([o],I.class.split(" ")),delete I.class):t.attributes(o,I)}-1!==this.selectedNodes.indexOf(a)&&(o.setAttribute("aria-selected","true"),t.addClass([o],be)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(o)])}},a.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof r.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},a.prototype.updateNode=function(e,i){var s=this;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&this.allowEditing){var n=this.getElement(e);if(!t.isNullOrUndefined(n)){var o=t.select("."+ve,n);this.updateOldText(n);var a=this.getEditEvent(n,null,null);this.trigger("nodeEditing",a,function(t){t.cancel||(s.fields.dataSource instanceof r.DataManager&&!s.isOffline?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,o,i,!1))})}}},a.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var l;return pe([t.Property(!1)],a.prototype,"allowDragAndDrop",void 0),pe([t.Property(!1)],a.prototype,"allowEditing",void 0),pe([t.Property(!1)],a.prototype,"allowMultiSelection",void 0),pe([t.Property(!1)],a.prototype,"allowTextWrap",void 0),pe([t.Complex({},Me)],a.prototype,"animation",void 0),pe([t.Property()],a.prototype,"checkedNodes",void 0),pe([t.Property(!0)],a.prototype,"checkDisabledChildren",void 0),pe([t.Property("")],a.prototype,"cssClass",void 0),pe([t.Property(!1)],a.prototype,"disabled",void 0),pe([t.Property(null)],a.prototype,"dragArea",void 0),pe([t.Property(!0)],a.prototype,"enableHtmlSanitizer",void 0),pe([t.Property(!1)],a.prototype,"enablePersistence",void 0),pe([t.Property()],a.prototype,"expandedNodes",void 0),pe([t.Property("Auto")],a.prototype,"expandOn",void 0),pe([t.Complex({},Pe)],a.prototype,"fields",void 0),pe([t.Property(!0)],a.prototype,"fullRowSelect",void 0),pe([t.Property(!0)],a.prototype,"loadOnDemand",void 0),pe([t.Property()],a.prototype,"locale",void 0),pe([t.Property()],a.prototype,"nodeTemplate",void 0),pe([t.Property()],a.prototype,"selectedNodes",void 0),pe([t.Property("None")],a.prototype,"sortOrder",void 0),pe([t.Property(!1)],a.prototype,"showCheckBox",void 0),pe([t.Property(!0)],a.prototype,"autoCheck",void 0),pe([t.Property(!1)],a.prototype,"fullRowNavigable",void 0),pe([t.Event()],a.prototype,"actionFailure",void 0),pe([t.Event()],a.prototype,"created",void 0),pe([t.Event()],a.prototype,"dataBound",void 0),pe([t.Event()],a.prototype,"dataSourceChanged",void 0),pe([t.Event()],a.prototype,"drawNode",void 0),pe([t.Event()],a.prototype,"destroyed",void 0),pe([t.Event()],a.prototype,"keyPress",void 0),pe([t.Event()],a.prototype,"nodeChecked",void 0),pe([t.Event()],a.prototype,"nodeChecking",void 0),pe([t.Event()],a.prototype,"nodeClicked",void 0),pe([t.Event()],a.prototype,"nodeCollapsed",void 0),pe([t.Event()],a.prototype,"nodeCollapsing",void 0),pe([t.Event()],a.prototype,"nodeDragging",void 0),pe([t.Event()],a.prototype,"nodeDragStart",void 0),pe([t.Event()],a.prototype,"nodeDragStop",void 0),pe([t.Event()],a.prototype,"nodeDropped",void 0),pe([t.Event()],a.prototype,"nodeEdited",void 0),pe([t.Event()],a.prototype,"nodeEditing",void 0),pe([t.Event()],a.prototype,"nodeExpanded",void 0),pe([t.Event()],a.prototype,"nodeExpanding",void 0),pe([t.Event()],a.prototype,"nodeSelected",void 0),pe([t.Event()],a.prototype,"nodeSelecting",void 0),a=l=pe([t.NotifyPropertyChanges],a)}(t.Component),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)}}(),Re=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Be="e-close",je="e-open",qe="e-right",Fe="e-left",We="e-over",Ve="e-push",_e="e-sidebar-context",ze=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.documentClickContext=s.documentclickHandler.bind(s),s}return Ue(i,e),i.prototype.preRender=function(){this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.setEnableRTL=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},i.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),t.addClass([this.element],"e-sidebar-absolute"),t.addClass([this.target],_e),this.targetEle=this.getTargetElement())},i.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!t.isNullOrUndefined(e)&&e.classList.contains("e-sidebar");)e=e.nextElementSibling;return e},i.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},i.prototype.setWidth=function(){this.enableDock&&"Left"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock&&"Right"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||t.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},i.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},i.prototype.setZindex=function(){t.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},i.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&t.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");t.isNullOrUndefined(e||this.targetEle)||t.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||t.addClass([this.element],["e-visibility"]),t.removeClass([this.element],[je,Be,qe,Fe,"e-slide",Ve,We]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?qe:Fe),this.enableDock&&t.addClass([this.element],"e-dock"),t.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],[Be,"e-disable-animation"]):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Be)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,t.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},i.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!t.isNullOrUndefined(this.defaultBackdropDiv)?t.removeClass([this.defaultBackdropDiv],"e-sidebar-overlay"):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},i.prototype.hide=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Be))return;i.element.classList.contains(je)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Be),t.removeClass([i.element],je),t.setStyleAttribute(i.element,{width:t.formatUnit(i.enableDock?i.dockSize:i.width)}),i.setType(i.type);var s=document.querySelector(".e-main-content")||i.targetEle;!i.enableDock&&s&&(s.style.transform="translateX(0px)",s.style["Left"===i.position?"marginLeft":"marginRight"]="0px"),i.destroyBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.remove("e-sidebar-overflow"),i.setProperties({isOpen:!1},!0),i.enableDock&&setTimeout(function(){return i.setTimeOut()},50),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(je)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(Be)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],["e-visibility","e-disable-animation"]),i.element.classList.contains(je))return;i.element.classList.contains(Be)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[je,"e-transition"]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Be),t.setStyleAttribute(i.element,{width:t.formatUnit(i.width)}),i.setType(i.type),i.createBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.add("e-sidebar-overflow"),i.setProperties({isOpen:!0},!0),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setAnimation=function(){this.animate?t.removeClass([this.element],"e-disable-animation"):t.addClass([this.element],"e-disable-animation")},i.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},i.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?t.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&t.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(Be)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=this.target,i=document.querySelector(".e-main-content")||this.targetEle;this.defaultBackdropDiv=this.createElement("div"),t.addClass([this.defaultBackdropDiv],"e-sidebar-overlay"),t.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),i.appendChild(this.defaultBackdropDiv)}else this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className="e-sidebar-overlay",this.modal.style.display="block",document.body.appendChild(this.modal))},i.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},i.prototype.getModuleName=function(){return"sidebar"},i.prototype.toggle=function(){this.element.classList.contains(je)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(je)},i.prototype.setMediaQuery=function(){if(this.mediaQuery){("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery).matches:this.mediaQuery.matches)&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide()}},i.prototype.resize=function(){t.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],We):t.addClass([this.element],Ve)),this.setMediaQuery(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.documentclickHandler=function(e){t.closest(e.target,".e-control.e-sidebar")||this.hide(e)},i.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&e.distanceX>=50&&e.velocity>=.5?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection?this.hide(e.originalEvent):this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&e.distanceX>=50&&e.velocity>=.5&&this.show()},i.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new t.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new t.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},i.prototype.wireEvents=function(){this.setEnableGestures(),t.EventHandler.add(window,"resize",this.resize,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.resize),t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},i.prototype.onPropertyChanged=function(i,s){for(var n=document.querySelector(".e-main-content")||this.targetEle,r=this.isServerRendered,o=0,a=Object.keys(i);o<a.length;o++)switch(a[o]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),t.removeClass([this.element],["e-visibility"]),this.addClass(),t.addClass([this.element],"Auto"===this.type?t.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),n&&(n.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(t.removeClass([this.element],Fe),t.addClass([this.element],qe)):(t.removeClass([this.element],qe),t.addClass([this.element],Fe)),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),t.isNullOrUndefined(this.target)&&(t.removeClass([this.element],"e-sidebar-absolute"),t.removeClass([s.target],_e),t.setStyleAttribute(n,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,e.prototype.refresh.call(this),this.isServerRendered=r;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock();break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}},i.prototype.setType=function(e){var i=this.element.getBoundingClientRect().width;this.setZindex();var s=document.querySelector(".e-main-content")||this.targetEle;s&&(s.style.transform="translateX(0px)",t.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),r="Left"===this.position?i:-i;switch(t.removeClass([this.element],[Ve,We,"e-slide"]),e){case"Push":t.addClass([this.element],[Ve]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style.transform="translateX("+r+"px)");break;case"Over":t.addClass([this.element],[We]),this.enableDock&&(this.element.classList.contains(Be)||this.isOpen)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":t.addClass([this.element],["e-transition"]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],Ve)):t.addClass([this.element],We):(t.addClass([this.element],Ve),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.target&&t.removeClass([this.target],_e),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[je,Be,Ve,"e-slide",We,Fe,qe,"e-transition","e-disable-animation"]),t.removeClass([this.element],"e-sidebar-absolute"),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",t.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var i=document.querySelector(".e-main-content")||this.targetEle;t.isNullOrUndefined(i)||(i.style.margin="",i.style.transform=""),this.unWireEvents()},Re([t.Property("auto")],i.prototype,"dockSize",void 0),Re([t.Property(null)],i.prototype,"mediaQuery",void 0),Re([t.Property(!1)],i.prototype,"enableDock",void 0),Re([t.Property("en-US")],i.prototype,"locale",void 0),Re([t.Property(!1)],i.prototype,"enablePersistence",void 0),Re([t.Property(!0)],i.prototype,"enableGestures",void 0),Re([t.Property(!1)],i.prototype,"isOpen",void 0),Re([t.Property(!1)],i.prototype,"enableRtl",void 0),Re([t.Property(!0)],i.prototype,"animate",void 0),Re([t.Property("auto")],i.prototype,"height",void 0),Re([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),Re([t.Property("Left")],i.prototype,"position",void 0),Re([t.Property(null)],i.prototype,"target",void 0),Re([t.Property(!1)],i.prototype,"showBackdrop",void 0),Re([t.Property("Auto")],i.prototype,"type",void 0),Re([t.Property("auto")],i.prototype,"width",void 0),Re([t.Property(1e3)],i.prototype,"zIndex",void 0),Re([t.Event()],i.prototype,"created",void 0),Re([t.Event()],i.prototype,"close",void 0),Re([t.Event()],i.prototype,"open",void 0),Re([t.Event()],i.prototype,"change",void 0),Re([t.Event()],i.prototype,"destroyed",void 0),i=Re([t.NotifyPropertyChanges],i)}(t.Component),Ke=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)}}(),Xe=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Ye="e-icon-right",Ge="e-breadcrumb-menu",Qe="e-breadcrumb-wrap-mode",Je="e-breadcrumb-scroll-mode";!function(e){e.Hidden="Hidden",e.Collapsed="Collapsed",e.Menu="Menu",e.Wrap="Wrap",e.Scroll="Scroll",e.None="None"}(e.BreadcrumbOverflowMode||(e.BreadcrumbOverflowMode={}));var Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ke(i,e),Xe([t.Property("")],i.prototype,"text",void 0),Xe([t.Property("")],i.prototype,"id",void 0),Xe([t.Property("")],i.prototype,"url",void 0),Xe([t.Property(null)],i.prototype,"iconCss",void 0),Xe([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),$e=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.isPopupCreated=!1,s}return Ke(n,e),n.prototype.preRender=function(){},n.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},n.prototype.initialize=function(){this._maxItems=this.maxItems,t.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&t.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add("e-disabled"),this.element.setAttribute("aria-disabled","true")),"Wrap"===this.overflowMode?this.element.classList.add(Qe):"Scroll"===this.overflowMode&&this.element.classList.add(Je),this.initItems(),this.initPvtProps()},n.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&this._maxItems>0&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(this._maxItems>=0?(this.startIndex=this._maxItems>1?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},n.prototype.getEndIndex=function(){var e,t=this;return this.activeItem?this.items.forEach(function(i,s){i.url!==t.activeItem&&i.text!==t.activeItem||(e=s)}):e=this.items.length-1,e},n.prototype.initItems=function(){if(!this.items.length){var e=void 0,t=void 0,i=[];if(this.url){var s=new URL(this.url,window.location.origin);e=s.origin+"/",t=s.href.split(e)[1].split("/")}else e=window.location.origin+"/",t=window.location.href.split(e)[1].split("/");i.push({iconCss:"e-icons e-home",url:e});for(var n=0;n<t.length;n++)t[n]&&(i.push({text:t[n],url:e+t[n]}),e+=t[n]+"/");this.setProperties({items:i},!0)}},n.prototype.renderItems=function(e){var s,n,r=this,o=this.element.classList.contains(Ye),a=e.length;if(a){var l,d=void 0,h=void 0,c=0,p=void 0,u=2*a-1,f=!1,m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),g=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),v=this.hasField(e,"iconCss"),y="Collapsed"===this.overflowMode&&this._maxItems>0&&a>this._maxItems&&!this.isExpanded,b="Hidden"===this.overflowMode&&this._maxItems>0;"Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML="");for(var C={moduleName:this.getModuleName(),showIcon:v,itemNavigable:!0,itemCreated:function(e){var i=e.curData.isLastItem;i&&e.item.children.length&&!r.itemTemplate&&(delete e.curData.isLastItem,l||r.enableActiveItemNavigation||(e.item.innerHTML=r.createElement("span",{className:"e-breadcrumb-text",innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||r.itemTemplate||e.item.classList.add("e-icon-item"),b&&e.item.setAttribute("item-index",c.toString());var s={item:t.extend({},e.curData.properties?e.curData.properties:e.curData),element:e.item,cancel:!1};r.trigger("beforeItemRender",s),f=s.cancel;var n=o||s.element.classList.contains(Ye);n&&e.curData.iconCss&&!r.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(".e-breadcrumb-icon")),s.item.disabled&&(e.item.setAttribute("aria-disabled","true"),e.item.classList.add("e-disabled")),s.item.id&&e.item.setAttribute("id",s.item.id),(s.item.disabled||r.disabled)&&e.item.children.length&&!r.itemTemplate&&e.item.children[0].setAttribute("tabindex","-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),!(!i||i&&r.enableActiveItemNavigation)||s.item.disabled||r.disabled||(e.item.children[0].setAttribute("tabindex","0"),t.EventHandler.add(e.item.children[0],"keydown",r.keyDownHandler,r))),e.item.removeAttribute("role"),i&&e.item.setAttribute("data-active-item",""),r.itemTemplate||r.beforeItemRenderChanges(e.curData,s.item,e.item,n)}},S=0;S<u;S%2&&c++,S++)if(d=this.activeItem&&(this.activeItem===e[c].url||this.activeItem===e[c].text),!(y&&S>1&&S<u-2)&&(!b||!(c<this.startIndex||c>this.endIndex)||S%2&&c===this.startIndex-1||0===c)){S%2?(p=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||t.isNullOrUndefined(this.separatorTemplate)?C.template=t.initializeCSPTemplate(function(){return"/"}):C.template=this.separatorTemplate,C.itemClass="e-breadcrumb-separator",n=!1,s=[{previousItem:e[c],nextItem:e[c+1]}]):(C.itemClass="",this.itemTemplate?(C.template=this.itemTemplate,n=!1):n=!0,(s=[t.extend({},e[c].properties?e[c].properties:e[c])])[0].url||this.itemTemplate||(s=[t.extend({},s[0],{isEmptyUrl:!0,url:"#"})]),h=(b||"Menu"===this.overflowMode)&&c===this.endIndex,((S===u-1||h)&&!this.itemTemplate||d)&&(s[0].isLastItem=!0));var I=m,x=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(c>=this.startIndex&&c<=x&&(!(S%2)||!(c===x))&&this.endIndex>=this._maxItems&&this._maxItems>0||0===this._maxItems)){if(S%2)continue;I=this.popupUl,h&&(l=!0)}else"Wrap"===this.overflowMode&&(I=0===S?g:p);var E=i.ListBase.createList(this.createElement,s,C,n,this).childNodes;if(f){if(b||y||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(c,1),this.initPvtProps(),this.reRenderItems();(S===u-1||h)&&t.remove(I.lastElementChild)}else t.append(E,I);if("Wrap"===this.overflowMode&&0!==S&&S%2==0&&m.appendChild(p),y&&1===S){var N=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}});t.EventHandler.add(N,"keyup",this.expandHandler,this),m.appendChild(N)}if("Menu"===this.overflowMode&&this.startIndex===S&&this.endIndex>=this._maxItems&&this._maxItems>=0){var O=this.getMenuElement();t.EventHandler.add(O,"keyup",this.keyDownHandler,this),m.appendChild(O)}if(d||h)break;f&&S++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){r.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(g),this.element.appendChild(m),this.isReact||this.calculateMaxItems()}},n.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e=void 0,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);if("Menu"===this.overflowMode){var r=this.getMenuElement();this.element.appendChild(r),n+=r.offsetWidth,t.remove(r)}for(o=0;o<s.length-2;o++){if(n>i){if(e=Math.ceil((o-1)/2)+("Menu"===this.overflowMode&&o<=2?0:1),(this.maxItems>e&&!(this.maxItems>-1&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===o&&(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth)>i)return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[o].classList.contains(Ge)||(n+=s[o].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&this._maxItems>0){i=0;if((s=this.element.querySelectorAll(".e-breadcrumb-item")).length>this._maxItems+this._maxItems-1){for(var o="Wrap"===this.overflowMode?1:0;o<this._maxItems+this._maxItems-1;o++)i+=s[o].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},n.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},n.prototype.beforeItemRenderChanges=function(e,i,s,n){var r=s.querySelector(".e-anchor-wrap");if(r&&r.parentElement.setAttribute("aria-label","home"),i.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=i.text)}),i.iconCss!==e.iconCss&&r){var o=s.querySelector(".e-breadcrumb-icon");if(o)i.iconCss?(t.removeClass([o],e.iconCss.split(" ")),t.addClass([o],i.iconCss.split(" "))):t.remove(o);else if(i.iconCss){var a=this.createElement("span",{className:"e-breadcrumb-icon "+i.iconCss});n?t.append([a],r):r.insertBefore(a,r.childNodes[0])}}if(i.url!==e.url&&this.enableNavigation){var l=s.querySelector("a.e-breadcrumb-text");l&&(i.url?l.setAttribute("href",i.url):l.removeAttribute("href"))}},n.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},n.prototype.clickHandler=function(e){var i=t.closest(e.target,".e-breadcrumb-item:not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),i&&(t.closest(e.target,".e-breadcrumb-text")||this.itemTemplate)){var s=void 0;s="Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(".e-breadcrumb-item")).indexOf(i):[].slice.call(i.parentElement.children).indexOf(i),"Menu"===this.overflowMode?t.closest(e.target,".e-breadcrumb-popup")?(s+=this.startIndex,this.endIndex=s,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector("."+Ge)?s>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector("."+Ge))?(s+=2*this.popupUl.childElementCount-2,s=Math.floor(s/2),this.endIndex=s):this.startIndex=this.endIndex=s:(s=Math.floor(s/2),this.startIndex=this.endIndex=s):s=Math.floor(s/2),"Hidden"===this.overflowMode&&this._maxItems>0&&0!==this.endIndex&&(s=parseInt(i.getAttribute("item-index"),10),this.startIndex>1&&(this.startIndex-=this.endIndex-s),this.endIndex=s);var n={element:i,item:this.items[s],event:e,cancel:!1};if(this.trigger("itemClick",n),n.cancel)return;this.items[s]&&(this.activeItem=this.items[s].url||this.items[s].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Ge)&&!this.isPopupCreated&&this.renderPopup()},n.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:"e-breadcrumb-popup "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new s.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector("."+Ge),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},n.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!t.closest(e.target,"."+Ge)&&!t.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element))},n.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},n.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},n.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},n.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},n.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===i.overflowMode?this.element.classList.remove(Qe):"Wrap"===e.overflowMode&&this.element.classList.add(Qe),"Scroll"===i.overflowMode?this.element.classList.remove(Je):"Scroll"===e.overflowMode&&this.element.classList.add(Je);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(i.cssClass&&i.cssClass.indexOf(Ye)>-1&&!(e.cssClass&&e.cssClass.indexOf(Ye)>-1)||!(i.cssClass&&i.cssClass.indexOf(Ye)>-1)&&e.cssClass&&e.cssClass.indexOf(Ye)>-1)&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle("e-disabled"),this.element.setAttribute("aria-disabled",e.disabled+"")}},n.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHanlder,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},n.prototype.popupWireEvents=function(){t.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),t.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(document,"click",this.delegateClickHanlder),t.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(t.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),t.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},n.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},n.prototype.getModuleName=function(){return"breadcrumb"},n.prototype.destroy=function(){var i=this;this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,t.detach(this.popupObj.element));var s=[],n=["aria-label"];this.cssClass&&s.concat(this.cssClass.split(" ")),this.enableRtl&&s.push("e-rtl"),this.disabled&&(s.push("e-disabled"),n.push("aria-disabled")),"Wrap"===this.overflowMode?s.push(Qe):"Scroll"===this.overflowMode&&s.push(Je),this.unWireEvents(),this.element.innerHTML="",t.removeClass([this.element],s),n.forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Xe([t.Property("")],n.prototype,"url",void 0),Xe([t.Collection([],Ze)],n.prototype,"items",void 0),Xe([t.Property("")],n.prototype,"activeItem",void 0),Xe([t.Property(-1)],n.prototype,"maxItems",void 0),Xe([t.Property("Menu")],n.prototype,"overflowMode",void 0),Xe([t.Property("")],n.prototype,"cssClass",void 0),Xe([t.Property(null)],n.prototype,"itemTemplate",void 0),Xe([t.Property("/")],n.prototype,"separatorTemplate",void 0),Xe([t.Property(!0)],n.prototype,"enableNavigation",void 0),Xe([t.Property(!1)],n.prototype,"enableActiveItemNavigation",void 0),Xe([t.Property(!1)],n.prototype,"disabled",void 0),Xe([t.Property("")],n.prototype,"locale",void 0),Xe([t.Event()],n.prototype,"beforeItemRender",void 0),Xe([t.Event()],n.prototype,"itemClick",void 0),Xe([t.Event()],n.prototype,"created",void 0),n=Xe([t.NotifyPropertyChanges],n)}(t.Component),et=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)}}(),tt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},it="e-carousel-item",st="e-carousel-navigators",nt="e-carousel-hover";!function(e){e[e.Touch=1]="Touch",e[e.Mouse=2]="Mouse"}(e.CarouselSwipeMode||(e.CarouselSwipeMode={}));var rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return et(i,e),tt([t.Property()],i.prototype,"cssClass",void 0),tt([t.Property()],i.prototype,"interval",void 0),tt([t.Property()],i.prototype,"template",void 0),tt([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),ot=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isSwipe=!1,s}return et(s,i),s.prototype.getModuleName=function(){return"e-carousel".replace("e-","")},s.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},s.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};var e={nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"};this.localeObj=new t.L10n(this.getModuleName(),e,this.locale)},s.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},s.prototype.onPropertyChanged=function(i,s){for(var n,r,o=0,a=Object.keys(i);o<a.length;o++){var l=a[o];switch(l){case"animationEffect":this.applyAnimation();break;case"cssClass":t.classList(this.element,[i.cssClass],[s.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,s.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector(".e-carousel-items")&&this.renderTouchActions();break;case"loop":this.loop&&t.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),(this.partialVisible||this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse))&&this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),i.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":if((r=[].slice.call(this.element.querySelectorAll(".e-previous-button,\n .e-next-button, .e-play-button"))).push(this.element),this.enableRtl?t.addClass(r,"e-rtl"):t.removeClass(r,"e-rtl"),this.partialVisible||this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse)){var d=this.loop?this.getNumOfItems():0,h=this.itemsContainer.firstElementChild.clientWidth;this.itemsContainer.style.transform=this.getTranslateX(h,this.selectedIndex+d)}break;case"buttonsVisibility":if(n=this.element.querySelector("."+st))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),t.remove(n);break;case"VisibleOnHover":t.addClass([].slice.call(n.childNodes),"e-hover-arrows");break;case"Visible":t.removeClass([].slice.call(n.childNodes),"e-hover-arrows")}else this.renderNavigators(),this.renderPlayButton();break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(this.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&t.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(n=this.element.querySelector(".e-carousel-indicators"))&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(n)),this.renderIndicators();break;case"showPlayButton":n=this.element.querySelector(".e-play-pause"),!this.showPlayButton&&n&&(t.remove(n),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var c="dataSource"===l?this.dataSource:this.items;!t.isNullOrUndefined(c)&&c.length>0&&this.selectedIndex>=c.length&&(this.setActiveSlide(c.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?t.addClass([this.element],"e-partial"):t.removeClass([this.element],"e-partial"),this.reRenderSlides();break;case"swipeMode":t.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),t.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),t.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},s.prototype.reRenderSlides=function(){var e=this.element.querySelector(".e-carousel-items");e&&(this.resetTemplates(["itemTemplate"]),t.remove(e)),this.renderSlides()},s.prototype.reRenderIndicators=function(){var e=this.element.querySelector(".e-carousel-indicators");e&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(e)),this.renderIndicators()},s.prototype.initialize=function(){var i=[];i.push("e-carousel"),this.cssClass&&i.push(this.cssClass),this.enableRtl&&i.push("e-rtl"),this.partialVisible&&i.push("e-partial"),this.swipeMode!==(~e.CarouselSwipeMode.Touch&~e.CarouselSwipeMode.Mouse)&&i.push("e-swipe"),t.addClass([this.element],i),t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),t.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},s.prototype.renderSlides=function(){var e=this,i=this.element.querySelector(".e-carousel-slide-container");i||(i=this.createElement("div",{className:"e-carousel-slide-container",attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(i)),this.itemsContainer=this.createElement("div",{className:"e-carousel-items",attrs:{"aria-live":this.autoPlay?"off":"polite"}}),i.appendChild(this.itemsContainer);var s=this.getNumOfItems();s>0&&this.loop&&(this.items.length>0?this.items.slice(-s).forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer,!0)}):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.dataSource.slice(-s).forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer,!0)})),this.items.length>0?(this.slideItems=this.items,this.items.forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer)})):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer)})),s>0&&this.loop&&(this.items.length>0?this.items.slice(0,s).forEach(function(t,i){e.renderSlide(t,t.template,i,e.itemsContainer,!0)}):!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.dataSource.slice(0,s).forEach(function(t,i){e.renderSlide(t,e.itemTemplate,i,e.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length);var n=t.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth;this.itemsContainer.style.transitionProperty="none";var r=this.loop?s:0;this.itemsContainer.style.transform=this.getTranslateX(n,this.selectedIndex+r),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},s.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},s.prototype.renderSlide=function(e,i,s,n,r){void 0===r&&(r=!1);var o=this.createElement("div",{id:t.getUniqueID("carousel_item"),className:it+" "+(e.cssClass?e.cssClass:"")+" "+(this.selectedIndex!==s||r?"":"e-active"),attrs:{"aria-hidden":this.selectedIndex!==s||r?"true":"false","data-index":s.toString(),role:"group","aria-roledescription":"slide"}});r&&o.classList.add("e-cloned"),t.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,o);var a=this.element.id+"_template",l=this.templateParser(i)(e,this,"itemTemplate",a,!1);t.append(l,o),n.appendChild(o)},s.prototype.renderNavigators=function(){if("Hidden"!==this.buttonsVisibility){var e=this.createElement("div",{className:st});this.element.querySelector(".e-carousel-slide-container").insertAdjacentElement("afterend",e),!t.isNullOrUndefined(this.slideItems)&&this.slideItems.length>1&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates()}},s.prototype.renderNavigatorButton=function(e){var i=this.createElement("div",{className:("Previous"===e?"e-previous":"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?"e-hover-arrows":"")});if("Previous"===e&&this.previousButtonTemplate){t.addClass([i],"e-template");var s=this.element.id+"_previousButtonTemplate",r=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",s,!1);t.append(r,i)}else if("Next"===e&&this.nextButtonTemplate){t.addClass([i],"e-template");var s=this.element.id+"_nextButtonTemplate",r=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",s,!1);t.append(r,i)}else{var o=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}});new n.Button({cssClass:"e-flat e-round "+("Previous"===e?"e-previous-button":"e-next-button"),iconCss:"e-icons "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(o),i.appendChild(o)}this.element.querySelector("."+st).appendChild(i),t.EventHandler.add(i,"click",this.navigatorClickHandler,this)},s.prototype.renderPlayButton=function(){if(!(t.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1)){var e=this.createElement("div",{className:"e-play-pause "+("VisibleOnHover"===this.buttonsVisibility?"e-hover-arrows":"")});if(this.playButtonTemplate){t.addClass([e],"e-template");var i=this.element.id+"_playButtonTemplate",s=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",i,!1);t.append(s,e)}else{var r=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),o=this.selectedIndex===this.slideItems.length-1&&!this.loop,a=new n.Button({cssClass:"e-flat e-round e-play-button",iconCss:"e-icons "+(this.autoPlay&&!o?"e-pause-icon":"e-play-icon"),isToggle:!0,enableRtl:this.enableRtl});o&&(this.setProperties({autoPlay:!1},!0),r.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),a.appendTo(r),e.appendChild(r)}var l=this.element.querySelector("."+st);l.insertBefore(e,l.lastElementChild),this.renderTemplates(),t.EventHandler.add(e,"click",this.playButtonClickHandler,this)}},s.prototype.renderIndicators=function(){var e=this;if(this.showIndicators&&!t.isNullOrUndefined(this.indicatorsType)){var i="e-default";this.indicatorsTemplate||(i="e-"+this.indicatorsType.toLowerCase());var s=this.createElement("div",{className:"e-carousel-indicators "+i}),r=this.createElement("div",{className:"e-indicator-bars"});s.appendChild(r);var o;if(this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(r,this.selectedIndex+1):r.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(r,this.selectedIndex+1):((o=this.createElement("div",{className:"e-indicator-bar"})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),o.style.setProperty("--carousel-items-count",""+this.slideItems.length),r.appendChild(o));break;case"Default":case"Dynamic":this.slideItems.forEach(function(i,s){var o=e.createElement("div",{className:"e-indicator-bar "+(e.selectedIndex===s?"e-active":e.selectedIndex-1===s?"e-prev":e.selectedIndex+1===s?"e-next":""),attrs:{"data-index":s.toString(),"aria-current":e.selectedIndex===s?"true":"false"}});if(o.style.setProperty("--carousel-items-current",""+e.selectedIndex),e.indicatorsTemplate)e.renderIndicatorTemplate(o,s);else if("Default"===e.indicatorsType){var a=e.createElement("button",{className:"e-indicator",attrs:{type:"button","aria-label":e.localeObj.getConstant("slide")+" "+(s+1)+" "+e.localeObj.getConstant("of")+" "+e.slideItems.length}});o.appendChild(a),a.appendChild(e.createElement("div",{})),new n.Button({cssClass:"e-flat e-small"}).appendTo(a)}r.appendChild(o),"Default"===e.indicatorsType&&t.EventHandler.add(o,"click",e.indicatorClickHandler,e)})}this.element.appendChild(s)}},s.prototype.renderIndicatorTemplate=function(e,i){void 0===i&&(i=0),t.addClass([e],"e-template");var s=this.element.id+"_indicatorsTemplate",n=this.templateParser(this.indicatorsTemplate)({index:i,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",s,!1);t.append(n,e)},s.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},s.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new t.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},s.prototype.applyAnimation=function(){switch(t.removeClass([this.element],["e-carousel-custom-animation","e-carousel-fade-animation","e-carousel-slide-animation","e-carousel-animation-none"]),this.animationEffect){case"Slide":t.addClass([this.element],"e-carousel-slide-animation");break;case"Fade":t.addClass([this.element],"e-carousel-fade-animation");break;case"None":t.addClass([this.element],"e-carousel-animation-none");break;case"Custom":t.addClass([this.element],"e-carousel-custom-animation")}},s.prototype.autoSlide=function(){t.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},s.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+it+".e-active")||this.element.querySelector(".e-carousel-indicators .e-active");if(!t.isNullOrUndefined(e)){var i=parseInt(e.dataset.index,10);if(this.loop||i!==this.slideItems.length-1){var s=(i+1)%this.slideItems.length;this.element.classList.contains(nt)||this.setActiveSlide(s,"Next"),this.autoSlide()}else this.resetSlideInterval()}},s.prototype.applySlideInterval=function(){var e=this;if(this.autoPlay&&!this.element.classList.contains(nt)){var i=this.interval;this.items.length>0&&!t.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(i=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return e.autoSlideChange()},i)}},s.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},s.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},s.prototype.setActiveSlide=function(e,i,s){var n=this;if(void 0===s&&(s=!1),!(this.element.querySelectorAll("."+it+".e-prev,."+it+".e-next").length>0)){e=t.isNullOrUndefined(e)?0:e;var r=[].slice.call(this.element.querySelectorAll("."+it+":not(.e-cloned)")),o=this.element.querySelector("."+it+".e-active");if(t.isNullOrUndefined(o)&&this.showIndicators){var a=this.element.querySelector(".e-indicator-bar.e-active"),l=parseInt(a.dataset.index,10);return void t.addClass([r[parseInt(l.toString(),10)]],"e-active")}if(t.isNullOrUndefined(o))return void t.addClass([r[parseInt(e.toString(),10)]],"e-active");var d=parseInt(o.dataset.index,10),h=r[parseInt(e.toString(),10)],c={currentIndex:d,nextIndex:e,currentSlide:o,nextSlide:h,slideDirection:i,isSwiped:s,cancel:!1};this.trigger("slideChanging",c,function(o){if(!o.cancel){n.setProperties({selectedIndex:e},!0),t.attributes(o.currentSlide,{"aria-hidden":"true"}),t.attributes(o.nextSlide,{"aria-hidden":"false"}),n.refreshIndicators(d,e),n.slideChangedEventArgs={currentIndex:o.nextIndex,previousIndex:o.currentIndex,currentSlide:o.nextSlide,previousSlide:o.currentSlide,slideDirection:i,isSwiped:s};var a=r[parseInt(e.toString(),10)].clientWidth,l=n.getNumOfItems();n.isSwipe||(n.itemsContainer.style.transitionDuration="0.6s"),n.isSwipe=!1,"Fade"===n.animationEffect?n.itemsContainer.classList.add("e-fade-in-out"):n.itemsContainer.style.transitionProperty="transform",n.loop?0===n.slideChangedEventArgs.currentIndex&&"Next"===n.slideChangedEventArgs.slideDirection?n.itemsContainer.style.transform=n.getTranslateX(a,r.length+l):n.slideChangedEventArgs.currentIndex===n.slideItems.length-1&&"Previous"===n.slideChangedEventArgs.slideDirection?n.itemsContainer.style.transform=n.partialVisible?n.getTranslateX(a):"translateX(0px)":n.itemsContainer.style.transform=n.getTranslateX(a,e+l):n.itemsContainer.style.transform=n.getTranslateX(a,e),"Slide"===n.animationEffect?"Previous"===i?(t.addClass([o.nextSlide],"e-prev"),o.nextSlide.setAttribute("data-slide-height",o.nextSlide.offsetHeight.toString()),t.addClass([o.currentSlide,o.nextSlide],"e-transition-end")):(t.addClass([o.nextSlide],"e-next"),o.nextSlide.setAttribute("data-slide-height",o.nextSlide.offsetHeight.toString()),t.addClass([o.currentSlide,o.nextSlide],"e-transition-start")):"Fade"===n.animationEffect?(t.removeClass([o.currentSlide],"e-active"),t.addClass([o.nextSlide],"e-active")):"Custom"===n.animationEffect?"Previous"===i?(t.addClass([o.nextSlide],"e-next"),t.addClass([o.currentSlide],"e-prev")):(t.addClass([o.currentSlide],"e-prev"),t.addClass([o.nextSlide],"e-next")):n.onTransitionEnd(),n.handleNavigatorsActions(e)}})}},s.prototype.onTransitionEnd=function(){var e=this;t.removeClass(this.element.querySelectorAll(".e-carousel-items"),"e-fade-in-out");var i=this.getNumOfItems();if(this.slideChangedEventArgs){if(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)){var s=this.slideChangedEventArgs.currentSlide.clientWidth;this.itemsContainer.style.transform=this.getTranslateX(s,this.slideChangedEventArgs.currentIndex+i)}t.addClass([this.slideChangedEventArgs.currentSlide],"e-active"),t.removeClass([this.slideChangedEventArgs.previousSlide],"e-active"),this.trigger("slideChanged",this.slideChangedEventArgs,function(){t.removeClass(e.element.querySelectorAll("."+it),["e-prev","e-next","e-transition-start","e-transition-end"]),e.slideChangedEventArgs=null})}},s.prototype.refreshIndicators=function(e,i){var s=this,n=this.element.querySelector(".e-indicator-bars");if(!t.isNullOrUndefined(n)){var r=[].slice.call(n.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":t.attributes(r[parseInt(e.toString(),10)],{"aria-current":"false"}),t.attributes(r[parseInt(i.toString(),10)],{"aria-current":"true"}),t.removeClass(r,["e-active","e-prev","e-next"]),t.addClass([r[parseInt(i.toString(),10)]],"e-active"),r[i-1]&&t.addClass([r[i-1]],"e-prev"),r[i+1]&&t.addClass([r[i+1]],"e-next"),r.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+s.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(n.children.length>0&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,i+1)):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(n.children.length>0&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,i+1)):n.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},s.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var r=n[s];"class"===r?t.addClass([i],e[""+r]):i.setAttribute(r,e[""+r])}},s.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},s.prototype.getNavigatorState=function(e,i){var s=e.querySelector("."+(i?"e-previous-button":"e-next-button"));return!!s&&t.getInstance(s,n.Button).disabled},s.prototype.navigatorClickHandler=function(e){var t=e.currentTarget;if(!this.getNavigatorState(t,t.classList.contains("e-previous"))){var i=t.classList.contains("e-previous")?"Previous":"Next";this.setActiveSlide(this.getSlideIndex(i),i),this.autoSlide()}},s.prototype.indicatorClickHandler=function(e){var i=t.closest(e.target,".e-indicator-bar"),s=parseInt(i.dataset.index,10);this.selectedIndex!==s&&(this.setActiveSlide(s,this.selectedIndex>s?"Previous":"Next"),this.autoSlide())},s.prototype.playButtonClickHandler=function(e,i){void 0===i&&(i=!1);var s=this.element.querySelector(".e-play-button");if(s){var r=t.getInstance(s,n.Button);i||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),r.iconCss="e-icons "+(this.autoPlay?"e-pause-icon":"e-play-icon"),r.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide()}},s.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var i,s,n=!1,r=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&r.classList.contains("e-indicator")?r.click():r.classList.contains("e-carousel")||r.classList.contains("e-play-button")?this.playButtonClickHandler(e):r.classList.contains("e-next-button")?this.next():r.classList.contains("e-previous-button")&&this.prev();break;case"end":s=this.slideItems.length-1,i="Next",n=!0;break;case"home":s=0,i="Previous",n=!0;break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&t.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),i="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",s=this.getSlideIndex(i),n=!this.isSuspendSlideTransition(s,i)}n&&(this.setActiveSlide(s,i),this.autoSlide(),n=!1)}},s.prototype.swipeHandler=function(e){if(!(this.element.classList.contains(nt)||t.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1)){var i="Right"===e.swipeDirection?"Previous":"Next",s=this.getSlideIndex(i);this.isSuspendSlideTransition(s,i)||(this.setActiveSlide(s,i,!0),this.autoSlide())}},s.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},s.prototype.handleNavigatorsActions=function(e){if("Hidden"!==this.buttonsVisibility){if(this.showPlayButton){var i=this.element.querySelector(".e-play-button"),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,r=t.isNullOrUndefined(this.playButtonTemplate)&&i&&s;t.isNullOrUndefined(this.playButtonTemplate)&&i&&!s&&(r=!i.classList.contains("e-active")),r&&(this.setProperties({autoPlay:!s},!0),i.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(l=t.getInstance(i,n.Button)).iconCss="e-icons "+(this.autoPlay?"e-pause-icon":"e-play-icon"),l.dataBind())}var o=this.element.querySelector(".e-previous-button");o&&t.isNullOrUndefined(this.previousButtonTemplate)&&((l=t.getInstance(o,n.Button)).disabled=!this.loop&&0===e,l.dataBind());var a=this.element.querySelector(".e-next-button");if(a&&t.isNullOrUndefined(this.nextButtonTemplate)){var l=t.getInstance(a,n.Button);l.disabled=!this.loop&&e===this.slideItems.length-1,l.dataBind()}}},s.prototype.onHoverActions=function(e){var i=this.element.querySelector("."+st);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&i&&t.removeClass([].slice.call(i.childNodes),"e-hover-arrows"),this.pauseOnHover&&t.addClass([this.element],nt);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&i&&t.addClass([].slice.call(i.childNodes),"e-hover-arrows"),t.removeClass([this.element],nt),this.isSwipe&&this.swipStop()}this.autoSlide()},s.prototype.onFocusActions=function(e){switch(e.type){case"focusin":t.addClass([this.element],nt);break;case"focusout":t.removeClass([this.element],nt)}this.autoSlide()},s.prototype.destroyButtons=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<i.length;e++){var s=i[e],r=t.getInstance(s,n.Button);r&&r.destroy()}},s.prototype.getNumOfItems=function(){return this.partialVisible?2:1},s.prototype.getTranslateValue=function(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0},s.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=e.touches?e.touches[0].pageX:e.pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},s.prototype.swiping=function(e){if(this.itemsContainer.classList.contains("e-swipe-start")){this.isSwipe=!0,e.preventDefault();var t=e.touches?e.touches[0].pageX:e.pageX,i=this.prevPageX-t;!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&i>0||this.selectedIndex===this.itemsContainer.childElementCount-1&&i<0)||!this.enableRtl&&(0===this.selectedIndex&&i<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&i>0))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?i:-i))+"px)")}},s.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,i=this.getTranslateValue(this.itemsContainer)-this.initialTranslate;if(i=i<0?-1*i:i,this.isSwipe){var s=i*(t.Browser.isDevice?6:1.66);this.itemsContainer.style.transitionDuration=(t.Browser.isDevice?i:s)/e/10+"s"}var n=this.itemsContainer.firstElementChild.clientWidth/2;this.itemsContainer.classList.remove("e-swipe-start");var r=this.getTranslateValue(this.itemsContainer);r-this.initialTranslate<-n?this.swipeNavigation(!this.enableRtl):r-this.initialTranslate>n?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},s.prototype.swipeNavigation=function(e){e?this.next():this.prev()},s.prototype.swipeModehandlers=function(){(this.swipeMode&e.CarouselSwipeMode.Touch)===e.CarouselSwipeMode.Touch&&(t.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&e.CarouselSwipeMode.Mouse)===e.CarouselSwipeMode.Mouse&&(t.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&e.CarouselSwipeMode.Mouse&e.CarouselSwipeMode.Touch)==(e.CarouselSwipeMode.Mouse&e.CarouselSwipeMode.Touch)&&(t.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),t.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),t.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},s.prototype.resizeHandler=function(){if(this.itemsContainer&&this.itemsContainer.firstElementChild){var e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth;this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex)}},s.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.enableTouchSwipe&&this.swipeModehandlers(),t.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),t.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),t.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),t.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),t.EventHandler.add(window,"resize",this.resizeHandler,this)},s.prototype.unWireEvents=function(){var e=this;[].slice.call(this.element.querySelectorAll(".e-indicator-bar")).forEach(function(i){t.EventHandler.remove(i,"click",e.indicatorClickHandler)}),[].slice.call(this.element.querySelectorAll(".e-previous,.e-next")).forEach(function(i){t.EventHandler.remove(i,"click",e.navigatorClickHandler)});var i=this.element.querySelector(".e-play-pause");i&&t.EventHandler.remove(i,"click",this.playButtonClickHandler),t.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),t.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),t.EventHandler.clearEvents(this.element),t.EventHandler.clearEvents(this.itemsContainer),t.EventHandler.remove(window,"resize",this.resizeHandler)},s.prototype.prev=function(){if(this.loop||0!==this.selectedIndex){var e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1;this.setActiveSlide(e,"Previous"),this.autoSlide()}},s.prototype.next=function(){if(this.loop||this.selectedIndex!==this.slideItems.length-1){var e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1;this.setActiveSlide(e,"Next"),this.autoSlide()}},s.prototype.play=function(){var e=this.element.querySelector(".e-play-icon");this.showPlayButton&&e&&(t.classList(e,["e-pause-icon"],["e-play-icon"]),this.element.querySelector(".e-play-button").setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},s.prototype.pause=function(){var e=this.element.querySelector(".e-pause-icon");this.showPlayButton&&e&&(this.element.querySelector(".e-play-button").setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),t.classList(e,["e-play-icon"],["e-pause-icon"])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},s.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},s.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},s.prototype.destroy=function(){var e=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(t){e.element.removeChild(t)}),t.removeClass([this.element],["e-carousel",this.cssClass,"e-rtl","e-swipe"]),["role","style"].forEach(function(t){e.element.removeAttribute(t)}),this.itemsContainer=null,i.prototype.destroy.call(this)},tt([t.Collection([],rt)],s.prototype,"items",void 0),tt([t.Property("Slide")],s.prototype,"animationEffect",void 0),tt([t.Property()],s.prototype,"previousButtonTemplate",void 0),tt([t.Property()],s.prototype,"nextButtonTemplate",void 0),tt([t.Property()],s.prototype,"indicatorsTemplate",void 0),tt([t.Property()],s.prototype,"playButtonTemplate",void 0),tt([t.Property()],s.prototype,"cssClass",void 0),tt([t.Property([])],s.prototype,"dataSource",void 0),tt([t.Property()],s.prototype,"itemTemplate",void 0),tt([t.Property(0)],s.prototype,"selectedIndex",void 0),tt([t.Property("100%")],s.prototype,"width",void 0),tt([t.Property("100%")],s.prototype,"height",void 0),tt([t.Property(5e3)],s.prototype,"interval",void 0),tt([t.Property(!0)],s.prototype,"autoPlay",void 0),tt([t.Property(!0)],s.prototype,"pauseOnHover",void 0),tt([t.Property(!0)],s.prototype,"loop",void 0),tt([t.Property(!1)],s.prototype,"showPlayButton",void 0),tt([t.Property(!0)],s.prototype,"enableTouchSwipe",void 0),tt([t.Property(!0)],s.prototype,"allowKeyboardInteraction",void 0),tt([t.Property(!0)],s.prototype,"showIndicators",void 0),tt([t.Property("Default")],s.prototype,"indicatorsType",void 0),tt([t.Property("Visible")],s.prototype,"buttonsVisibility",void 0),tt([t.Property(!1)],s.prototype,"partialVisible",void 0),tt([t.Property(e.CarouselSwipeMode.Touch)],s.prototype,"swipeMode",void 0),tt([t.Property()],s.prototype,"htmlAttributes",void 0),tt([t.Event()],s.prototype,"slideChanging",void 0),tt([t.Event()],s.prototype,"slideChanged",void 0),s=tt([t.NotifyPropertyChanges],s)}(t.Component),at=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)}}(),lt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},dt=function(e){function i(t,i){return e.call(this,t,i)||this}return at(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.element.classList.remove("e-appbar"),this.element.removeAttribute("style"),this.element.removeAttribute("role")},i.prototype.getModuleName=function(){return"appbar"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.preRender=function(){},i.prototype.render=function(){this.element.classList.add("e-appbar"),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add("e-horizontal-bottom"),this.isSticky&&this.element.classList.add("e-sticky"),this.enableRtl&&this.element.classList.add("e-rtl"),this.setHeightMode(),this.setColorMode(),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"mode":t.removeClass([this.element],["e-dense","e-prominent"]),this.setHeightMode();break;case"position":"Bottom"===this.position?t.addClass([this.element],"e-horizontal-bottom"):t.removeClass([this.element],"e-horizontal-bottom");break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?t.addClass([this.element],"e-sticky"):t.removeClass([this.element],"e-sticky");break;case"htmlAttributes":if(!t.isNullOrUndefined(this.htmlAttributes)){if(!t.isNullOrUndefined(i.htmlAttributes))for(var r=0,o=Object.keys(i.htmlAttributes);r<o.length;r++){var a=o[r];"class"===a?t.removeClass([this.element],i.htmlAttributes[""+a]):this.element.removeAttribute(a)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":t.removeClass([this.element],["e-dark","e-primary","e-inherit","e-light"]),this.setColorMode();break;case"enableRtl":this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")}},i.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var r=n[s];"class"===r?t.addClass([i],e[""+r]):i.setAttribute(r,e[""+r])}},i.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add("e-prominent"):"Dense"===this.mode&&this.element.classList.add("e-dense")},i.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add("e-light");break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add("e-primary");break;case"Inherit":this.element.classList.add("e-inherit")}},lt([t.Property("Regular")],i.prototype,"mode",void 0),lt([t.Property("Top")],i.prototype,"position",void 0),lt([t.Property()],i.prototype,"cssClass",void 0),lt([t.Property(!1)],i.prototype,"isSticky",void 0),lt([t.Property()],i.prototype,"htmlAttributes",void 0),lt([t.Property("Light")],i.prototype,"colorMode",void 0),lt([t.Event()],i.prototype,"created",void 0),lt([t.Event()],i.prototype,"destroyed",void 0),i=lt([t.NotifyPropertyChanges],i)}(t.Component),ht=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)}}(),ct=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};!function(e){e.NotStarted="NotStarted",e.InProgress="InProgress",e.Completed="Completed"}(e.StepStatus||(e.StepStatus={}));var pt=function(i){function s(){return null!==i&&i.apply(this,arguments)||this}return ht(s,i),ct([t.Property("")],s.prototype,"cssClass",void 0),ct([t.Property(!1)],s.prototype,"disabled",void 0),ct([t.Property("")],s.prototype,"iconCss",void 0),ct([t.Property(null)],s.prototype,"isValid",void 0),ct([t.Property("")],s.prototype,"label",void 0),ct([t.Property(!1)],s.prototype,"optional",void 0),ct([t.Property(e.StepStatus.NotStarted)],s.prototype,"status",void 0),ct([t.Property("")],s.prototype,"text",void 0),s}(t.ChildProperty);!function(e){e.Horizontal="Horizontal",e.Vertical="Vertical"}(e.StepperOrientation||(e.StepperOrientation={}));var ut=function(i){function s(e,t){return i.call(this,e,t)||this}return ht(s,i),s.prototype.preRender=function(){},s.prototype.getModuleName=function(){return"stepperBase"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.render=function(){},s.prototype.updateOrientaion=function(e){(e.classList.contains("e-horizontal")||e.classList.contains("e-vertical"))&&e.classList.remove("e-horizontal","e-vertical"),t.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},s.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t=e.querySelector("li").querySelector(".e-step-label-container");if(this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains("e-vertical"))if(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")){var i=e.querySelector(".e-stepper-steps");this.progressStep.style.setProperty("--progress-position",i.offsetWidth/2+"px")}else this.progressStep.style.setProperty("--progress-position",this.progressBarPosition/2-1+"px");t&&t.classList.contains("e-label-before")&&this.progressStep.style.setProperty("--progress-position",this.progressBarPosition-1+5+"px"),e.classList.contains("e-horizontal")&&this.setProgressPosition(e)},s.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild;if(!0!==t){var n=0;n=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",n+"px")}var r=e.querySelector(".e-stepper-steps").lastChild.firstChild;if(e.classList.contains("e-rtl")){var o=s.offsetLeft+s.offsetWidth-e.querySelector(".e-stepper-steps").offsetWidth;this.progressStep.style.setProperty("--progress-left-position",Math.abs(o)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(r.offsetLeft-s.offsetLeft)+"px")}else this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",r.offsetWidth+r.offsetLeft-2-(s.offsetLeft+2)+"px")},s.prototype.onPropertyChanged=function(e,t){},ct([t.Collection([],pt)],s.prototype,"steps",void 0),ct([t.Property("")],s.prototype,"cssClass",void 0),ct([t.Property(!1)],s.prototype,"readOnly",void 0),ct([t.Property(e.StepperOrientation.Horizontal)],s.prototype,"orientation",void 0),ct([t.Event()],s.prototype,"created",void 0),s=ct([t.NotifyPropertyChanges],s)}(t.Component),ft=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)}}(),mt=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},gt="e-indicator",vt="e-step-text-container",yt="e-step-selected",bt="e-step-inprogress",Ct="e-step-notstarted",St="e-step-focus",It="e-step-completed",xt="e-step-disabled",Et="e-stepper-readonly",Nt="e-label-before",Ot="e-step-item",wt="e-step-type-indicator",Lt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ft(i,e),mt([t.Property(!0)],i.prototype,"enable",void 0),mt([t.Property(2e3)],i.prototype,"duration",void 0),mt([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty);!function(e){e.Top="Top",e.Bottom="Bottom",e.Start="Start",e.End="End"}(e.StepLabelPosition||(e.StepLabelPosition={})),function(e){e.Default="Default",e.Label="Label",e.Indicator="Indicator"}(e.StepType||(e.StepType={}));var kt=function(i){function n(e,t){var s=i.call(this,e,t)||this;return s.stepperItemElements=[],s}return ft(n,i),n.prototype.preRender=function(){this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()));var e={optional:"Optional"};this.l10n=new t.L10n("stepper",e,this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},n.prototype.getModuleName=function(){return"stepper"},n.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},n.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&t.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add(Et),this.enableRtl&&this.element.classList.add("e-rtl"),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),this.steps.length>0&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},n.prototype.initiateProgressBar=function(){var e=this;this.steps.length>1&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},n.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},n.prototype.renderDefault=function(e){var t=this.steps[parseInt(e.toString(),10)];return!t.iconCss&&!t.text&&!t.label},n.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?(this.animation.duration>=0&&e&&e.style.setProperty("--duration",this.animation.duration+"ms"),this.animation.delay>=0&&e&&e.style.setProperty("--delay",this.animation.delay+"ms")):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},n.prototype.updateStepType=function(){if(!t.isNullOrUndefined(this.stepType)){var e=this.stepType.toLowerCase();-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition())}},n.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.updateResize,this),t.EventHandler.add(window,"click",this.updateStepFocus,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.updateResize),t.EventHandler.remove(window,"click",this.updateStepFocus)},n.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains("e-horizontal")&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},n.prototype.updateStepFocus=function(){if(this.isKeyNavFocus){this.isKeyNavFocus=!1;var e=this.element.querySelector("."+St);e&&(e.classList.remove(St),this.element.classList.remove("e-steps-focus"))}},n.prototype.updateStepperStatus=function(t){for(var i=0;i<this.steps.length;i++){var s=this.steps[parseInt(i.toString(),10)],n=s.status.toLowerCase();if(t&&0===this.activeStep&&0===i){a=this.isProtectedOnChange;this.isProtectedOnChange=!0,s.status=e.StepStatus.InProgress,this.isProtectedOnChange=a}if(s&&"notstarted"!==n&&i===this.activeStep)for(var r=0;r<this.steps.length;r++){var o=this.stepperItemElements[parseInt(r.toString(),10)];o.classList.remove(yt,bt,It,Ct);var a=this.isProtectedOnChange;this.isProtectedOnChange=!0,"completed"===n?this.updateStatusClass(r,i,o):this.updateStatusClass(r,i,o,!0),this.isProtectedOnChange=a}else s&&"notstarted"!==n&&i!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},n.prototype.updateStatusClass=function(t,i,s,n){var r=this.steps[parseInt(t.toString(),10)];t<i?(s.classList.add(It),r.status=e.StepStatus.Completed):t===i?s.classList.add(n?bt:It,yt):s.classList.add(Ct)},n.prototype.renderItems=function(){for(var e,i=this,s=this.element.classList.contains("e-horizontal"),n=this.element.classList.contains("e-vertical"),r=t.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),o=0;o<this.steps.length;o++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var a=this.createElement("span",{className:"e-step"}),l=this.steps[parseInt(o.toString(),10)],d=!!l.label,h=!!l.text,c=this.element.classList.contains(wt);if(this.stepperItemContainer.classList[0===o?"add":"remove"](yt,bt),this.stepperItemContainer.classList[0!==o?"add":"remove"](Ct),s&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(o)&&(t.isNullOrUndefined(this.template)||""===this.template)){var p=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase();p&&a.classList.add("e-icons","e-step-indicator"),p||null!=l.isValid||(a.classList.add("e-step-content"),a.innerHTML=(o+1).toString()),this.stepperItemContainer.appendChild(a)}else if(t.isNullOrUndefined(this.template)||""===this.template){var u=!0;if((l.iconCss||!l.iconCss&&h&&d)&&(!h&&!d||!this.element.classList.contains("e-step-type-label"))){if(l.iconCss){var f=l.iconCss.trim().split(" ");(e=a.classList).add.apply(e,[gt].concat(f)),this.stepperItemContainer.classList.add(Ot)}else!l.iconCss&&h&&d&&(a.classList.add(gt),a.innerHTML=l.text,this.stepperItemContainer.classList.add(Ot));this.stepperItemContainer.appendChild(a),(s&&("start"===r||"end"===r)&&d||n&&("top"===r||"bottom"===r)&&d)&&!c&&(this.element.classList.add("e-label-"+r),this.createTextLabelElement(l.label),u=!1)}if(!h||l.iconCss&&c||!u||l.iconCss&&d||(!l.iconCss&&c||(!l.iconCss||this.element.classList.contains("e-step-type-label"))&&!d?(l.iconCss||d||this.element.classList.add("e-step-type-indicator"),this.checkValidState(l,a),d=!1):(d||this.createTextLabelElement(l.text),d&&this.element.classList.contains("e-step-type-label")&&(this.createElement("span",{className:"e-text"}).innerText=l.label),h=!d)),d&&d&&(!l.iconCss||!c)&&u)if(l.iconCss||h||!c){if((!this.element.classList.contains("e-step-type-label")||!h||this.element.classList.contains("e-step-type-label")&&d)&&(this.createTextLabelElement(l.label,!0),this.updateLabelPosition(),(!l.iconCss&&!h&&!this.stepperItemContainer.classList.contains(Ot)||this.element.classList.contains("e-step-type-label"))&&(this.stepperItemContainer.classList.add("e-step-label-only"),null!==l.isValid))){var m=this.createElement("span",{className:"e-step-validation-icon e-icons"});this.labelContainer.appendChild(m)}}else this.checkValidState(l,a,!0)}if(l.optional){var g=this.createElement("span",{className:"e-step-label-optional"});this.l10n.setLocale(this.locale);var v=this.l10n.getConstant("optional");g.innerText=v,d&&this.labelContainer&&(this.element.classList.contains("e-label-after")&&!this.stepperItemContainer.classList.contains("e-step-label-only")||s&&this.element.classList.contains(Nt)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||n&&this.element.classList.contains(Nt)?this.labelContainer.appendChild(g):this.stepperItemContainer.appendChild(g),null!==l.isValid&&this.stepperItemContainer.classList.add(l.isValid?"e-step-valid":"e-step-error")}l.cssClass&&t.addClass([this.stepperItemContainer],l.cssClass.trim().split(" ")),l.disabled&&(this.stepperItemContainer.classList[l.disabled?"add":"remove"](xt),t.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==l.isValid&&(l.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(o,!1),this.stepperItemContainer.classList.contains(bt)?t.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):t.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,o),this.stepperItemElements.push(this.stepperItemContainer);var y={element:this.stepperItemContainer,index:o};this.trigger("beforeStepRender",y,function(e){i.stepperItemList.appendChild(e.element)}),n&&(this.isAngular&&this.template?setTimeout(function(){i.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(n&&this.element.classList.contains(Nt))for(var b=this.stepperItemList.querySelectorAll(".e-label"),C=0;C<b.length;C++)b[parseInt(C.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},n.prototype.createTextLabelElement=function(e,t){void 0===t&&(t=!1);var i=this.createElement("span",{className:t?"e-label":vt+" e-text"});i.innerText=e,t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer.appendChild(i)):this.stepperItemContainer.appendChild(i),this.stepperItemContainer.classList.add(t?"e-step-label":"e-step-text")},n.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(Nt),t=this.stepperItemContainer.classList.contains(Ot)&&!this.stepperItemContainer.classList.contains("e-step-text")&&!this.stepperItemContainer.classList.contains("e-step-label"),i=this.stepperItemContainer.querySelector("."+vt);if(i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e){var s=this.stepperItemContainer.querySelector(".e-label").offsetWidth+15;this.beforeLabelWidth=Math.max(this.beforeLabelWidth,s);var n=this.element.querySelector("ol").lastChild.querySelector("."+gt),r=this.stepperItemContainer.querySelector("."+vt);if(n||r){var o=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+gt)||r).offsetWidth/2;this.progressBarPosition=Math.max(this.progressBarPosition,o)}else this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)}else{var a=this.element.querySelector("ol").lastChild,l=t?this.stepperItemContainer.offsetWidth:a.firstChild.offsetWidth;this.progressBarPosition=Math.max(this.progressBarPosition,l)}},n.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label?e.label:e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(gt),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(Ot))},n.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains("e-horizontal")?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},n.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},n.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(t.removeClass([this.labelContainer],e),t.removeClass([this.element],e))},n.prototype.checkValidStep=function(){for(var e=this.element.classList.contains(wt),t=this,i=0;i<this.steps.length;i++)!function(i){var s=t.steps[parseInt(i.toString(),10)],n=t.stepperItemElements[parseInt(i.toString(),10)];if(null!==s.isValid){var r,o=void 0;e&&!s.iconCss?o=n.querySelector("."+gt):r=n.querySelector("."+gt),!o&&e&&t.renderDefault(i)&&(o=n.querySelector(".e-step-indicator"));var a=n.querySelector(".e-step-validation-icon"),l=s.iconCss.trim().split(" "),d=n.classList.contains("e-step-valid"),h=d?"e-check":"e-circle-info";if(o&&(o.classList.remove("e-step-indicator"),""!==o.innerHTML&&(o.innerHTML=""),o.classList.add("e-icons",h,gt)),t.renderDefault(i)&&!e&&n.querySelector(".e-step").classList.add("e-icons",h,gt),r&&(""!==r.innerHTML?r.innerHTML="":l.length>0&&l.forEach(function(e){r.classList.remove(e)}),r.classList.add("e-icons",h)),a&&(a.classList.add(d?"e-circle-check":"e-circle-info"),t.element.classList.contains("e-vertical"))){var c=n.querySelector(".e-label"),p=n.querySelector(".e-text"),u=p?p.offsetWidth+p.getBoundingClientRect().left:c.offsetWidth+c.getBoundingClientRect().left;n.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",u+20+"px")}}}(i)},n.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new s.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-stepper-tooltip "+this.cssClass:"e-stepper-tooltip",position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):t.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},n.prototype.wireItemsEvents=function(e,i){t.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,i),this),t.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,i),this),t.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},n.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var i=this.stepperItemElements[parseInt(e.toString(),10)];t.EventHandler.remove(i,"click",this.linearModeHandler.bind(this,i,e)),t.EventHandler.remove(i,"mouseover",this.openStepperTooltip.bind(this,e)),t.EventHandler.remove(i,"mouseleave",this.closeStepperTooltip)}},n.prototype.linearModeHandler=function(e,t,i){if(this.linear){var s=t-this.activeStep;1===Math.abs(s)&&this.stepClickHandler(t,i,e)}else this.stepClickHandler(t,i,e)},n.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];if(this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen){if(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)){var i="inprogress"===t.status.toLowerCase()?"e-stepper-tooltip e-step-inprogress-tip "+(this.cssClass?this.cssClass:""):"e-stepper-tooltip "+(this.cssClass?this.cssClass:"");this.tooltipObj.setProperties({cssClass:i.trim()})}this.tooltipOpen=!0}},n.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},n.prototype.updateTooltipContent=function(e){if(this.showTooltip){this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]);var i=void 0,s=this.steps[parseInt(e.toString(),10)];if(this.tooltipTemplate){i=this.createElement("span",{className:"e-stepper-tooltip-content"});var n=this.getTemplateFunction(this.tooltipTemplate);t.append(n({value:s},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),i),this.tooltipObj.setProperties({content:i},!0)}else{var r=s.label?s.label:s.text;this.tooltipObj.setProperties({content:t.initializeCSPTemplate(function(){return r})},!0)}this.renderReactTemplates()}},n.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},n.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},n.prototype.renderItemContent=function(e,i){var s=this.stepperItemList.querySelectorAll("li");if(i&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template){i?s[parseInt(e.toString(),10)].classList.add("e-step-template"):this.stepperItemContainer.classList.add("e-step-template");var n=this.steps[parseInt(e.toString(),10)];t.append(this.templateFunction({step:n,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),i?s[parseInt(e.toString(),10)]:this.stepperItemContainer)}this.renderReactTemplates()},n.prototype.removeItemContent=function(e){e.classList.remove("e-step-template");for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},n.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},n.prototype.getTemplateFunction=function(e){if("string"==typeof e){var i="";try{var s=t.select(e);i=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:e}catch(t){i=e}return t.compile(i)}return t.compile(e)},n.prototype.navigateToStep=function(e,t,i,s,n){var r=this,o={element:i,event:t,isInteracted:s,previousStep:this.activeStep,activeStep:e,cancel:!1};if(!1!==n){var a=this.activeStep;this.trigger("stepChanging",o,function(n){if(!n.cancel){r.navigationHandler(e);var o={element:i,event:t,isInteracted:s,previousStep:a,activeStep:r.activeStep};r.trigger("stepChanged",o)}})}else this.navigationHandler(e)},n.prototype.navigationHandler=function(i,s,n){i=Math.min(i,this.steps.length-1);var r=this.stepperItemElements.length;i>=0&&i<r-1&&(i=this.stepperItemElements[parseInt(i.toString(),10)].classList.contains(xt)?this.activeStep:i);var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.activeStep=parseInt(i.toString(),10),this.isProtectedOnChange=o;for(var a=0;a<this.steps.length;a++){var l=this.stepperItemElements[parseInt(a.toString(),10)],d=this.steps[parseInt(a.toString(),10)];l.classList.remove(yt,bt,It,Ct),a===this.activeStep&&l.classList.add(yt),this.activeStep>=0&&this.progressbar?this.element.classList.contains("e-horizontal")?this.calculateProgressbarPos():this.progressbar.style.setProperty("--progress-value",100/(this.steps.length-1)*i+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty("--progress-value","0%"),a===this.activeStep?l.classList.add(bt):this.activeStep>0&&a<this.activeStep?l.classList.add(It):l.classList.add(Ct),l.classList.contains(bt)?t.attributes(l,{tabindex:"0","aria-current":"true"}):t.attributes(l,{tabindex:"-1","aria-current":"false"});var h=this.isProtectedOnChange;this.isProtectedOnChange=!0,!1!==n&&(a<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===d.status.toLowerCase()?d.status=e.StepStatus.Completed:a===this.activeStep?d.status=e.StepStatus.InProgress:a>this.activeStep&&(d.status=e.StepStatus.NotStarted),s&&this.activeStep===a&&(d.status=s),"completed"===d.status.toLowerCase()&&(l.classList.remove(yt,bt,Ct),l.classList.add(It)),"notstarted"===d.status.toLowerCase()&&(l.classList.remove(yt,bt,It),l.classList.add(Ct))),this.isProtectedOnChange=h,this.updateIndicatorStatus(a,l)}this.updateStepInteractions()},n.prototype.calculateProgressbarPos=function(){var e=this;if((this.element.classList.contains(Nt)||this.element.classList.contains("e-label-after"))&&!this.element.classList.contains(wt)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(Ot)){var t=this.element.querySelector(".e-stepper-progressbar"),i=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,s=0===this.activeStep?0:(i.offsetLeft-t.offsetLeft+i.offsetWidth/2)/t.offsetWidth*100;this.element.classList.contains("e-rtl")?(s=(t.getBoundingClientRect().right-i.getBoundingClientRect().right+i.offsetWidth/2)/t.offsetWidth*100,this.progressbar.style.setProperty("--progress-value",s+"%")):this.progressbar.style.setProperty("--progress-value",s+"%")}else{var n=0,r=0;this.stepperItemElements.forEach(function(t,i){var s=t.offsetWidth;n+=s,i<=e.activeStep&&(r+=i===e.activeStep&&0!==i?s/2:s)});var o=(this.stepperItemList.offsetWidth-n)/(this.stepperItemElements.length-1),a=(r+o*this.activeStep)/this.stepperItemList.offsetWidth*100;this.progressbar.style.setProperty("--progress-value",a+"%")}},n.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(wt)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(It)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(gt,"e-icons","e-check")):(t.classList.contains(bt)||t.classList.contains(Ct))&&(t.firstChild.classList.remove(gt,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},n.prototype.updateStepInteractions=function(){var e=this;this.element.classList.toggle("e-linear",this.linear),this.stepperItemElements.forEach(function(t,i){t.classList.toggle("e-previous",i===e.activeStep-1),t.classList.toggle("e-next",i===e.activeStep+1)})},n.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)t.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},n.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},n.prototype.previousStep=function(){this.activeStep>0&&this.navigateToStep(this.activeStep-1,null,null,!1)},n.prototype.reset=function(){if(0===this.activeStep)this.updateStepInteractions();else{var e=!!this.stepperItemElements[0].classList.contains(xt);this.navigateToStep(e?-1:0,null,null,!1)}},n.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},n.prototype.updateElementClassArray=function(){var e=["e-rtl",Et,"e-steps-focus","e-label-after",Nt,"e-label-top","e-label-bottom","e-label-start","e-label-end",wt,"e-step-type-label","e-vertical","e-horizontal","e-linear"];t.removeClass([this.element],e)},n.prototype.destroy=function(){i.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&t.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&t.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},n.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},n.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains("e-horizontal")?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},n.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=this.element.querySelector("."+St);s||(s=this.element.querySelector("."+yt));var n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(St))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(St),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){var o=r;for(r=e?r+1:r-1;r>=0&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(xt);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(o.toString(),10)].classList.contains(St)&&n[parseInt(o.toString(),10)].classList.remove(St),"home"!==t.action&&"end"!==t.action||(r="home"===t.action?i?n.length-1:0:i?0:n.length-1),r>=0&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(St)}else if("space"===t.action||"enter"===t.action){var a=!1;if(this.linear){var l=this.activeStep-r;1===Math.abs(l)&&(this.navigateToStep(r,null,null,!0),a=!0)}else this.navigateToStep(r,null,null,!0),a=!0;a&&(this.updateStepFocus(),this.stepperItemElements[r].focus())}},n.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains(Et)&&this.element.classList.add(Et),this.enableRtl&&!this.element.classList.contains("e-rtl")&&this.element.classList.add("e-rtl"),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},n.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,o=0;o<r;o++){var a=Object.keys(e[n])[o];"status"===a?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===a&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},n.prototype.updateDynamicActiveStep=function(e,t){if(this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,this.activeStep>=0&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(xt)&&(this.activeStep=t),this.linear){var i=t-this.activeStep;1===Math.abs(i)&&this.navigateToStep(this.activeStep,null,null,!0)}else this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},n.prototype.updateDynamicCssClass=function(e,i){i&&t.removeClass([this.element],i.trim().split(" ")),e&&t.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-stepper-tooltip "+this.cssClass:"e-stepper-tooltip"})},n.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"](Et);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},mt([t.Property(0)],n.prototype,"activeStep",void 0),mt([t.Complex({},Lt)],n.prototype,"animation",void 0),mt([t.Property(!1)],n.prototype,"linear",void 0),mt([t.Property(!1)],n.prototype,"showTooltip",void 0),mt([t.Property("")],n.prototype,"template",void 0),mt([t.Property("")],n.prototype,"tooltipTemplate",void 0),mt([t.Property(e.StepLabelPosition.Bottom)],n.prototype,"labelPosition",void 0),mt([t.Property(e.StepType.Default)],n.prototype,"stepType",void 0),mt([t.Event()],n.prototype,"stepChanged",void 0),mt([t.Event()],n.prototype,"stepChanging",void 0),mt([t.Event()],n.prototype,"stepClick",void 0),mt([t.Event()],n.prototype,"beforeStepRender",void 0),n=mt([t.NotifyPropertyChanges],n)}(ut);return e.Accordion=z,e.AccordionActionSettings=W,e.AccordionAnimationSettings=V,e.AccordionItem=_,e.ActionSettings=De,e.AppBar=dt,e.Breadcrumb=$e,e.BreadcrumbItem=Ze,e.Carousel=ot,e.CarouselItem=rt,e.ContextMenu=Y,e.FieldSettings=E,e.FieldsSettings=Pe,e.HScroll=p,e.Header=le,e.Item=D,e.Menu=Z,e.MenuAnimationSettings=O,e.MenuItem=N,e.NodeAnimationSettings=Me,e.Sidebar=ze,e.Step=pt,e.Stepper=kt,e.StepperAnimationSettings=Lt,e.StepperBase=ut,e.Tab=he,e.TabActionSettings=oe,e.TabAnimationSettings=ae,e.TabItem=de,e.Toolbar=M,e.TreeView=He,e.VScroll=m,e.addScrolling=a,e.destroyScroll=d,e}({},ej.base,ej.lists,ej.popups,ej.buttons,ej.data,ej.inputs),this.ejs=ej;
|
|
11
2
|
//# sourceMappingURL=ej2-navigations.min.js.map
|