123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- /*!
- * filename: ej2-base.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.base=function(e){"use strict";function t(){tt=!1}function r(e,t){var r=t;return r.unshift(void 0),new(Function.prototype.bind.apply(e,r))}function n(e){var t,r=new Uint16Array(5);(window.msCrypto||window.crypto).getRandomValues(r);var n="ej2"+C(r),i=function(r){r.source===window&&"string"==typeof r.data&&r.data.length<=32&&r.data===n&&(e(),t())};return window.addEventListener("message",i,!1),window.postMessage(n,"*"),t=function(){window.removeEventListener("message",i),e=i=n=void 0}}function i(e,t){for(var r=t,n=e.replace(/\[/g,".").replace(/\]/g,"").split("."),i=0;i<n.length&&!h(r);i++)r=r[n[i]];return r}function o(e,t,r){var n,i,o=e.replace(/\[/g,".").replace(/\]/g,"").split("."),a=r||{},s=a,l=o.length;for(n=0;n<l;n++)i=o[n],n+1===l?s[i]=void 0===t?{}:t:p(s[i])&&(s[i]={}),s=s[i];return a}function a(e,t){delete e[t]}function s(e){var t={};return!p(e)&&e.constructor===t.constructor}function l(e,t){return e[t]}function c(e,t){if(!p(t))for(var r=e,n=t,i=0,o=Object.keys(t);i<o.length;i++){var a=o[i];p(r.deepMerge)||-1===r.deepMerge.indexOf(a)||!s(n[a])&&!Array.isArray(n[a])?r[a]=n[a]:u(r[a],r[a],n[a],!0)}}function u(e,t,r,n){var i=e&&"object"==typeof e?e:{},o=arguments.length;n&&(o-=1);for(var a=arguments,l=1;l<o;l++)!function(e){if(!a[e])return"continue";var t=a[e];Object.keys(t).forEach(function(e){var r,o=i[e],a=t[e],l=Array.isArray(a)&&Array.isArray(o)&&a.length!==o.length,c=!w()||!(o instanceof Event||l);n&&c&&(s(a)||Array.isArray(a))?s(a)?(r=o||{},Array.isArray(r)&&r.hasOwnProperty("isComplexArray")?u(r,{},a,n):i[e]=u(r,{},a,n)):(r=w()?o&&Object.keys(a).length:o||[],i[e]=u([],r,a,n)):i[e]=a})}(l);return i}function p(e){return void 0===e||null===e}function h(e){return void 0===e}function d(e){return e+"_"+et++}function m(e,t){var r;return function(){var n=this,i=arguments,o=function(){return r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function f(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push(encodeURIComponent(i)+"="+encodeURIComponent(""+e[i]))}return t.join("&")}function g(e){var t=Object.prototype.toString;return"[object Array]"===t.call(e)&&"[object Object]"===t.call(e[0])}function v(e,t){var r=e;return r===t||!(r===document||!r)&&v(r.parentNode,t)}function y(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}}function b(e,t){var r=document.createElement("div"),n=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("base, link, style")),i=[].slice.call(document.getElementsByTagName("body")[0].querySelectorAll("link, style"));if(i.length)for(var o=0,a=i.length;o<a;o++)n.push(i[o]);var s="";p(t)&&(t=window.open("","print","height=452,width=1024,tabbar=no")),r.appendChild(e.cloneNode(!0));for(var l=0,a=n.length;l<a;l++)s+=n[l].outerHTML;t.document.write("<!DOCTYPE html> <html><head>"+s+"</head><body>"+r.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),t.document.close(),t.focus();var c=setInterval(function(){t.ready&&(t.print(),t.close(),clearInterval(c))},500);return t}function M(e){var t=e+"";return t.match(/auto|%|px|vh|vm|vmax|vmin|em/)?t:t+"px"}function D(){tt=!0}function w(){return tt}function E(e){return e instanceof Node||!w()||p(e.xPath)?e:document.evaluate(e.xPath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function P(e,t){var r="string"==typeof e?document.querySelector(e):e;if(r[Qe])for(var n=0,i=r[Qe];n<i.length;n++){var o=i[n];if(o instanceof t)return o}return null}function S(e,t){var r="string"==typeof e?document.querySelector(e):e;r[Qe]?r[Qe].push(t):r[Qe]=[t]}function O(){if("undefined"!=typeof window){var e=new Uint16Array(5);return(window.msCrypto||window.crypto).getRandomValues(e)}}function C(e){for(var t="",r=0;r<5;r++)t+=(r?",":"")+e[r];return t}function T(e){return i(e||"",at)}function j(t){e.defaultCulture=t,Mt.notify("notifyExternalChange",{locale:e.defaultCulture})}function x(t){e.defaultCurrencyCode=t,Mt.notify("notifyExternalChange",{currencyCode:e.defaultCurrencyCode})}function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var i=n[r];u(Dt,i,{},!0)}}function F(t){void 0===t&&(t=!0),e.rightToLeft=t,Mt.notify("notifyExternalChange",{enableRtl:e.rightToLeft})}function A(t,r){var n=e.IntlBase.getDependables(Dt,t,"",!0)[wt[0]],o=e.IntlBase.getDependables(Dt,t,"")[wt[1]],a=i("defaultNumberingSystem",n),s=w()?i("numberSymbols",n):i("symbols-numberSystem-"+a,n),l=e.IntlBase.getSymbolPattern(r||"decimal",a,n,!1);return u(s,e.IntlBase.getFormatData(l,!0,"",!0),{dateSeparator:e.IntlBase.getDateSeparator(o)})}function R(t,r){var n=e.IntlBase.getDependables(Dt,t,"",!0);return e.IntlBase.getCurrencySymbol(n.numericObject,r)}function I(t){return e.IntlBase.getDependables(Dt,"",t,!1)[wt[1]]}function H(e,t,r){var n='var str="'+L(e,"data",t,r)+'"; return str;';return new Function("data",n).bind(t)}function L(e,t,r,n){var i=0,o=[],a=e.match(/class="([^\"]+|)\s{2}/g),s="";return a&&a.forEach(function(t){s=t.replace(/\s\s+/g," "),e=e.replace(t,s)}),e.replace(Ft,"").replace(Yt,"'$1'").replace(Xt,function(e,a,s,l){var c=/\@|\#|\$/gm,u=a.match(Bt);if(u){var p=u[1];if(It.test(a))a='";} '+a.replace(u[1],p.replace(zt,function(e){return e=e.trim(),k(e,!At.test(e)&&-1===o.indexOf(e),t,o,n)}))+'{ \n str = str + "';else if(Rt.test(a))a='"; '+a.replace(u[1],p.replace(_t,function(e){return Y(e,t,o,n)}))+'{ \n str = str + "';else if(Lt.test(a)){var h=u[1].split(" of ");a='"; '+a.replace(u[1],function(e){return o.push(h[0]),o.push(h[0]+"Index"),"var i"+(i+=1)+"=0; i"+i+" < "+k(h[1],!0,t,o,n)+".length; i"+i+"++"})+"{ \n "+h[0]+"= "+k(h[1],!0,t,o,n)+"[i"+i+"]; \n var "+h[0]+"Index=i"+i+'; \n str = str + "'}else{var d=a.split("("),m=r&&r.hasOwnProperty(d[0])?"this.":"global";m=/\./.test(d[0])?"":m;var f=u[1].split(",");0===u[1].length||/data/.test(f[0])||/window./.test(f[0])||(u[1]="global"===m?t+"."+u[1]:u[1]);var g=/\@|\$|\#/gm,v=/\]\./gm;Kt.test(a)&&v.test(a)||g.test(a)?/\@|\$|\#|\]\./gm.test(a)&&(a='"+ '+("global"===m?"":m)+a.replace(u[1],p.replace(Ut,function(e){return Y(e,t,o,n)}))+'+ "'):a='" + '+("global"===m?"":m)+a.replace(p,k(u[1].replace(/,( |)data.|,/gi,","+t+".").replace(/,( |)data.window/gi,",window"),"global"!==m,t,o,n))+'+"'}}else Ht.test(a)?a='"; '+a.replace(Ht,'} else { \n str = str + "'):a.match(kt)?a=a.replace(kt,'"; \n } \n str = str + "'):c.test(a)?(a.match($t)&&(a=z(a)),a='"+'+G(a,-1===o.indexOf(a),t,o)+'"]+"'):a=a.match($t)?'"+'+G(a=z(a),-1===o.indexOf(a),t,o)+'"]+"':'"+'+k(a.replace(/\,/gi,"+"+t+"."),-1===o.indexOf(a),t,o,n)+'+"';return a})}function k(e,t,r,n,i){return!t||Gt.test(e)||-1!==n.indexOf(e.split(".")[0])||i?e:r+"."+e}function B(e,t,r,n){var i=/^\..*/gm;return!t||Gt.test(e)||-1!==n.indexOf(e.split(".")[0])||i.test(e)?e:r+"."+e}function G(e,t,r,n){return t&&!Gt.test(e)&&-1===n.indexOf(e.split(".")[0])?r+'["'+e:e}function z(e){return e=e.match(Vt)?e:e.replace($t,"\\\\")}function Y(e,t,r,n){if(e=e.trim(),/\window\./gm.test(e))return e;var i=/'|"/gm;return/\@|\$|\#/gm.test(e)&&(e=G(e,-1===r.indexOf(e),t,r)+'"]'),Wt.test(e)?B(e,!i.test(e)&&-1===r.indexOf(e),t,r):k(e,!i.test(e)&&-1===r.indexOf(e),t,r,n)}function _(){return"-"+Math.random().toString(36).substr(2,5)}function X(e,t,r){var n=Qt.compile(e,t,r);return function(e,t,r,i,o,a,s){var l=n(e,t,r,s);if(w()&&!o){var c=i+_();if(Jt[i]||(Jt[i]=[]),p(a))e.BlazorTemplateId=c,Jt[i].push(e);else for(var u=0,h=Object.keys(Jt[i][a]);u<h.length;u++){var d=h[u];"BlazorTemplateId"!==d&&e[d]&&(Jt[i][a][d]=e[d]),"BlazorTemplateId"===d&&(c=Jt[i][a][d])}return"rowTemplate"===r?[K("tr",{id:c,className:"e-blazor-template"})]:[K("div",{id:c,className:"e-blazor-template"})]}if("string"==typeof l){if(Zt.test(l))return(m=K("svg",{innerHTML:l})).childNodes;var m=K(qt.test(l)?"table":"div",{innerHTML:l});return m.childNodes}return l}}function W(e,t,r,n,i){if(w()){window.sfBlazor.updateTemplate(t,Jt[e],e,r,i),!1!==n&&(Jt[e]=[])}}function $(e,t,r){var n=document.getElementById(e);if(n)for(var i=n.getElementsByClassName("blazor-inner-template"),o=0;o<i.length;o++){var a=" ";a=p(r)?i[o].getAttribute("data-templateId"):i[r].getAttribute("data-templateId");var s=document.getElementById(a);if(s)for(var l=s.childNodes.length,c=0;c<l;c++)p(r)?i[o].appendChild(s.childNodes[0]):(i[r].appendChild(s.childNodes[0]),o=i.length)}}function V(e){Qt.compile=e.compile}function U(){return Qt.compile}function K(e,t){var r=gr.test(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return void 0===t?r:(r.innerHTML=t.innerHTML?t.innerHTML:"",void 0!==t.className&&(r.className=t.className),void 0!==t.id&&(r.id=t.id),void 0!==t.styles&&r.setAttribute("style",t.styles),void 0!==t.attrs&&oe(r,t.attrs),r)}function q(e,t){for(var r=J(t),n=0,a=e;n<a.length;n++)for(var l=a[n],c=0,u=r;c<u.length;c++){var h=u[c];if(s(l)){var d=i("attributes.className",l);p(d)?o("attributes.className",h,l):new RegExp("\\b"+h+"\\b","i").test(d)||o("attributes.className",d+" "+h,l)}else l.classList.contains(h)||l.classList.add(h)}return e}function Z(e,t){for(var r=J(t),n=0,a=e;n<a.length;n++){var l=a[n],c=s(l);if(c?i("attributes.className",l):""!==l.className)for(var u=0,p=r;u<p.length;u++){var h=p[u];if(c){var d=i("attributes.className",l).split(" "),m=d.indexOf(h);-1!==m&&d.splice(m,1),o("attributes.className",d.join(" "),l)}else l.classList.remove(h)}}return e}function J(e){var t=[];return"string"==typeof e?t.push(e):t=e,t}function Q(e){var t=e;return""===t.style.visibility&&t.offsetWidth>0}function ee(e,t,r){if(s(t))jt.prepend(e,t);else{for(var n=document.createDocumentFragment(),i=0,o=e;i<o.length;i++){var a=o[i];n.appendChild(a)}t.insertBefore(n,t.firstElementChild),r&&re(t)}return e}function te(e,t,r){if(s(t))jt.append(e,t);else{for(var n=document.createDocumentFragment(),i=0,o=e;i<o.length;i++){var a=o[i];n.appendChild(a)}t.appendChild(n),r&&re(t)}return e}function re(e){e.querySelectorAll("script").forEach(function(e){var t=document.createElement("script");t.text=e.innerHTML,document.head.appendChild(t),ne(t)})}function ne(e){if(s(e))return jt.detach(e);var t=e.parentNode;return t?t.removeChild(e):void 0}function ie(e){if(s(e))jt.detach(e);else{var t=e.parentNode;Nt.clearEvents(e),t.removeChild(e)}}function oe(e,t){for(var r=e,n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];if(s(r)){var a=o;"tabindex"===o&&(a="tabIndex"),r.attributes[a]=t[o]}else r.setAttribute(o,t[o])}return r}function ae(e,t,r){return void 0===t&&(t=document),s(t)&&r?jt.vDomSelector({ele:t,selector:e,selectAll:!1}):(e=le(e),t.querySelector(e))}function se(e,t,r){return void 0===t&&(t=document),s(t)&&!r?jt.vDomSelector({ele:t,selector:e,selectAll:!0}):(e=le(e),t.querySelectorAll(e))}function le(e){var t=/(!|"|\$|%|&|'|\(|\)|\*|\/|:|;|<|=|\?|@|\]|\^|`|{|}|\||\+|~)/g;if(e.match(/#[0-9]/g)||e.match(t)){for(var r=e.split(","),n=0;n<r.length;n++){for(var i=r[n].split(" "),o=0;o<i.length;o++)if(i[o].indexOf("#")>-1&&!i[o].match(/\[.*\]/)){var a=i[o].split("#");if(a[1].match(/^\d/)||a[1].match(t)){var s=i[o].split(".");s[0]=s[0].replace(/#/,"[id='")+"']",i[o]=s.join(".")}}r[n]=i.join(" ")}return r.join(",")}return e}function ce(e,t){var r=e;if("function"==typeof r.closest)return r.closest(t);for(;r&&1===r.nodeType;){if(me(r,t))return r;r=r.parentNode}return null}function ue(e){for(var t=[],r=0,n=Array.prototype.slice.call(e.parentNode.childNodes);r<n.length;r++){var i=n[r];i.nodeType===Node.ELEMENT_NODE&&e!==i&&t.push(i)}return t}function pe(e,t,r){var n,o=s(e);return n=o?i("attributes."+t,e):e.getAttribute(t),p(n)&&r&&(o?e.attributes[t]=r:e.setAttribute(t,r.toString()),n=r),n}function he(e,t){void 0!==t&&(s(e)?jt.setStyleAttribute(e,t):Object.keys(t).forEach(function(r){e.style[r]=t[r]}))}function de(e,t,r){q([e],t),Z([e],r)}function me(e,t){var r=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return r?r.call(e,t):-1!==[].indexOf.call(document.querySelectorAll(t),e)}function fe(e,t){if(s(e))if(""===t)e.children=[];else{var r=jt.ConvertHTMLToJSon(t);r.length&&(jt.assignParent(r,e),e.children=r)}else e.innerHTML=t}function ge(e,t){return s(e)?new RegExp("\\b"+t+"\\b","i").test(e.attributes.className):e.classList.contains(t)}function ve(e,t){return s(e)?t?u({},{},e,!0):{tagName:e.tagName,attributes:e.attributes}:e.cloneNode(t)}function ye(e,t){var r,n,i="string"==typeof e?document.getElementById(e):e;for(n=0;n<i.ej2_instances.length;n++)if(r=i.ej2_instances[n],"string"==typeof t){if(t===r.getModuleName())return r}else if(r instanceof t)return r}function be(e){for(var t=[].slice.call(e.getElementsByClassName("e-control")),r=0;r<t.length;r++){var n=t[r].classList[1].split("e-")[1],i=ye(t[r],n);h(i)||i.destroy()}}function Me(e,t,n,i){return e.properties.hasOwnProperty(t)&&e.properties[t]instanceof i||(e.properties[t]=r(i,[e,t,n])),e.properties[t]}function De(e,t,n,i,o,a){for(var s=[],l=n?n.length:0,c=0;c<l;c++){var u=i;if(a&&(u=i(n[c],e)),o){var p=r(u,[e,t,{},!0]);p.setProperties(n[c],!0),s.push(p)}else s.push(r(u,[e,t,n[c],!1]))}return s}function we(e,t){return function(){return this.properties.hasOwnProperty(t)||(this.properties[t]=e),this.properties[t]}}function Ee(e,t){return function(r){if(this.properties[t]!==r){var n=this.properties.hasOwnProperty(t)?this.properties[t]:e;this.saveChanges(t,r,n),this.properties[t]=r}}}function Pe(e,t,r){return function(){return Me(this,t,e,r)}}function Se(e,t,r){return function(n){Me(this,t,e,r).setProperties(n)}}function Oe(e,t,r){return function(){var n=r({});return this.properties.hasOwnProperty(t)?this.properties[t]:Me(this,t,e,n)}}function Ce(e,t,r){return function(n){var i=r(n,this);Me(this,t,e,i).setProperties(n)}}function Te(e,t,r){return function(){var n=this;if(!this.properties.hasOwnProperty(t)){var i=De(this,t,e,r,!1);this.properties[t]=i}var o=void 0!==this.controlParent&&this.controlParent.ignoreCollectionWatch||this.ignoreCollectionWatch;return this.properties[t].hasOwnProperty("push")||o||["push","pop"].forEach(function(e){var i={value:Fe(e,t,r,n.properties[t]).bind(n),configurable:!0};Object.defineProperty(n.properties[t],e,i)}),this.properties[t].hasOwnProperty("isComplexArray")||Object.defineProperty(this.properties[t],"isComplexArray",{value:!0}),this.properties[t]}}function je(e,t,r){return function(n){this.isComplexArraySetter=!0;var i=De(this,t,e,r,!1),o=De(this,t,n,r,!0);this.isComplexArraySetter=!1,this.saveChanges(t,o,i),this.properties[t]=o}}function xe(e,t,r){return function(n){var i=this.properties.hasOwnProperty(t)?this.properties[t]:e,o=De(this,t,n,r,!0,!0);this.saveChanges(t,o,i),this.properties[t]=o}}function Ne(e,t,r){return function(){var n=r({});if(!this.properties.hasOwnProperty(t)){var i=De(this,t,e,n,!1);this.properties[t]=i}return this.properties[t]}}function Fe(e,t,r,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=this.propName?this.getParentKey()+"."+t+"-":t+"-";switch(e){case"push":for(var a=0;a<r.length;a++){Array.prototype[e].apply(n,[r[a]]);var s=Ae(o+(n.length-1),r[a],!this.controlParent,e);this.serverDataBind(s,r[a],!1,e)}break;case"pop":Array.prototype[e].apply(n);var l=Ae(o+n.length,null,!this.controlParent,e);this.serverDataBind(l,{ejsAction:"pop"},!1,e)}return n}}function Ae(e,t,r,n){var i=e;if(r&&(i={},i[e]=t,t&&"object"==typeof t)){i[e].ejsAction=n}return i}function Re(e){return function(t,r){var n={set:Ee(e,r),get:we(e,r),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"prop",e)}}function Ie(e,t){return function(r,n){var i={set:Se(e,n,t),get:Pe(e,n,t),enumerable:!0,configurable:!0};Object.defineProperty(r,n,i),ze(r,n,"complexProp",e,t)}}function He(e){return function(t,r){var n={set:Ce({},r,e),get:Oe({},r,e),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"complexProp",{},e)}}function Le(e,t){return function(r,n){var i={set:je(e,n,t),get:Te(e,n,t),enumerable:!0,configurable:!0};Object.defineProperty(r,n,i),ze(r,n,"colProp",e,t)}}function ke(e){return function(t,r){var n={set:xe([],r,e),get:Ne([],r,e),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"colProp",{},e)}}function Be(){return function(e,t){var r={set:function(e){var r=this.properties[t];if(r!==e){var n=Xe(this,t);!1===h(r)&&n.context.removeEventListener(n.prefix,r),n.context.addEventListener(n.prefix,e),this.properties[t]=e}},get:we(void 0,t),enumerable:!0,configurable:!0};Object.defineProperty(e,t,r),ze(e,t,"event")}}function Ge(e){}function ze(e,t,r,n,i){h(e.propList)&&(e.propList={props:[],complexProps:[],colProps:[],events:[],propNames:[],complexPropNames:[],colPropNames:[],eventNames:[]}),e.propList[r+"s"].push({propertyName:t,defaultValue:n,type:i}),e.propList[r+"Names"].push(t)}function Ye(e){if(h(e.prototype.builderObject)){e.prototype.builderObject={properties:{},propCollections:[],add:function(){this.isPropertyArray=!0,this.propCollections.push(u({},this.properties,{}))}};for(var t=/complex/,r=0,n=Object.keys(e.prototype.propList);r<n.length;r++)for(var i=n[r],o=0,a=e.prototype.propList[i];o<a.length;o++)!function(r){t.test(i)?e.prototype.builderObject[r.propertyName]=function(e){var t={};c(t,Ye(r.type)),e(t);var n;return n=t.isPropertyArray?t.propCollections:u({},t.properties,{}),this.properties[r.propertyName]=n,t.properties={},t.propCollections=[],t.isPropertyArray=!1,this}:e.prototype.builderObject[r.propertyName]=function(e){return this.properties[r.propertyName]=e,this}}(a[o])}return e.prototype.builderObject}function _e(e){var t=function(e){return this.element=e,this};return function(r){return t.prototype.hasOwnProperty("create")||((t.prototype=Ye(e)).create=function(){var t=u({},{},this.properties);return this.properties={},new e(t,this.element)}),new t(r)}}function Xe(e,t){if(!1===e.hasOwnProperty("parentObj"))return{context:e,prefix:t};var r=i("propName",e);return r&&(t=r+"-"+t),Xe(i("parentObj",e),t)}function We(t,r,n){var i=$e(r);return!1===i.rippleFlag||void 0===i.rippleFlag&&!e.isRippleEnabled?Function:(t.setAttribute("data-ripple","true"),Nt.add(t,"mousedown",Ve,{parent:t,rippleOptions:i}),Nt.add(t,"mouseup",Ue,{parent:t,rippleOptions:i,done:n}),Nt.add(t,"mouseleave",Ke,{parent:t,rippleOptions:i}),xt.isPointer&&Nt.add(t,"transitionend",Ke,{parent:t,rippleOptions:i}),function(){t.removeAttribute("data-ripple"),Nt.remove(t,"mousedown",Ve),Nt.remove(t,"mouseup",Ue),Nt.remove(t,"mouseleave",Ke),Nt.remove(t,"transitionend",Ke)})}function $e(e){return{selector:e&&e.selector?e.selector:null,ignore:e&&e.ignore?e.ignore:null,rippleFlag:e&&e.rippleFlag,isCenterRipple:e&&e.isCenterRipple,duration:e&&e.duration?e.duration:350}}function Ve(e){var t=e.target,r=this.rippleOptions.selector,n=r?ce(t,r):t;if(!(!n||this.rippleOptions&&ce(t,this.rippleOptions.ignore))){var i=n.getBoundingClientRect(),o=e.pageX-document.body.scrollLeft,a=e.pageY-(!document.body.scrollTop&&document.documentElement?document.documentElement.scrollTop:document.body.scrollTop),s=Math.max(Math.abs(o-i.left),Math.abs(o-i.right)),l=Math.max(Math.abs(a-i.top),Math.abs(a-i.bottom)),c=Math.sqrt(s*s+l*l),u=2*c+"px",p=o-i.left-c,h=a-i.top-c;this.rippleOptions&&this.rippleOptions.isCenterRipple&&(p=0,h=0,u="100%"),n.classList.add("e-ripple");var d=K("div",{className:"e-ripple-element",styles:"width: "+u+";height: "+u+";left: "+p+"px;top: "+h+"px;transition-duration: "+this.rippleOptions.duration.toString()+"ms;"});n.appendChild(d),window.getComputedStyle(d).getPropertyValue("opacity"),d.style.transform="scale(1)",n!==this.parent&&Nt.add(n,"mouseleave",Ke,{parent:this.parent,rippleOptions:this.rippleOptions})}}function Ue(e){qe(e,this)}function Ke(e){qe(e,this)}function qe(e,t){var r=t.rippleOptions.duration,n=e.target,i=t.rippleOptions.selector,o=i?ce(n,i):n;if(o&&(!o||-1!==o.className.indexOf("e-ripple"))){var a=se(".e-ripple-element",o),s=a[a.length-1];s&&(s.style.opacity="0.5"),t.parent!==o&&Nt.remove(o,"mouseleave",Ke),setTimeout(function(){s&&s.parentNode&&s.parentNode.removeChild(s),o.getElementsByClassName("e-ripple-element").length||o.classList.remove("e-ripple"),t.done&&t.done(e)},r)}}function Ze(t){return e.isRippleEnabled=t,e.isRippleEnabled}function Je(t){e.versionBasedStatePersistence=t}var Qe="ej2_instances",et=0,tt=!1,rt={latn:{_digits:"0123456789",_type:"numeric"}},nt={decimal:".",group:",",percentSign:"%",plusSign:"+",minusSign:"-",infinity:"∞",nan:"NaN",exponential:"E"},it=[0,1,2,3,4,5,6,7,8,9],ot=function(){function e(){}return e.getMainObject=function(e,t){return i(w()?t:"main."+t,e)},e.getNumberingSystem=function(e){return i("supplemental.numberingSystems",e)||this.numberingSystems},e.reverseObject=function(e,t){for(var r={},n=0,i=t||Object.keys(e);n<i.length;n++){var o=i[n];r.hasOwnProperty(e[o])||(r[e[o]]=o)}return r},e.getSymbolRegex=function(e){var t=e.map(function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}).join("|");return new RegExp(t,"g")},e.getSymbolMatch=function(e){for(var t={},r=0,n=Object.keys(nt);r<n.length;r++){var i=n[r];t[e[i]]=nt[i]}return t},e.constructRegex=function(e){for(var t=e.length,r="",n=0;n<t;n++)r+=n!==t-1?e[n]+"|":e[n];return r},e.convertValueParts=function(e,t,r){return e.replace(t,function(e){return r[e]})},e.getDefaultNumberingSystem=function(e){var t={};return t.obj=i("numbers",e),t.nSystem=i("defaultNumberingSystem",t.obj),t},e.getCurrentNumericOptions=function(e,t,r,n){var o={},a=this.getDefaultNumberingSystem(e);if(!h(a.nSystem)||n){var s=n?i("obj.mapperDigits",a):i(a.nSystem+"._digits",t);h(s)||(o.numericPair=this.reverseObject(s,it),o.numberParseRegex=new RegExp(this.constructRegex(s),"g"),o.numericRegex="["+s[0]+"-"+s[9]+"]",r&&(o.numericRegex=s[0]+"-"+s[9],o.symbolNumberSystem=i(n?"numberSymbols":"symbols-numberSystem-"+a.nSystem,a.obj),o.symbolMatch=this.getSymbolMatch(o.symbolNumberSystem),o.numberSystem=a.nSystem))}return o},e.getNumberMapper=function(e,t,r){var n={mapper:{}},o=this.getDefaultNumberingSystem(e);if(!h(o.nSystem)){n.numberSystem=o.nSystem,n.numberSymbols=i("symbols-numberSystem-"+o.nSystem,o.obj),n.timeSeparator=i("timeSeparator",n.numberSymbols);var a=i(o.nSystem+"._digits",t);if(!h(a))for(var s=0,l=it;s<l.length;s++){var c=l[s];n.mapper[c]=a[c]}}return n},e.nPair="numericPair",e.nRegex="numericRegex",e.numberingSystems=rt,e}(),at={DJF:"Fdj",ERN:"Nfk",ETB:"Br",NAD:"$",ZAR:"R",XAF:"FCFA",GHS:"GH₵",XDR:"XDR",AED:"د.إ.",BHD:"د.ب.",DZD:"د.ج.",EGP:"ج.م.",ILS:"₪",IQD:"د.ع.",JOD:"د.ا.",KMF:"CF",KWD:"د.ك.",LBP:"ل.ل.",LYD:"د.ل.",MAD:"د.م.",MRU:"أ.م.",OMR:"ر.ع.",QAR:"ر.ق.",SAR:"ر.س.",SDG:"ج.س.",SOS:"S",SSP:"£",SYP:"ل.س.",TND:"د.ت.",YER:"ر.ي.",CLP:"$",INR:"₹",TZS:"TSh",EUR:"€",AZN:"₼",RUB:"₽",BYN:"Br",ZMW:"K",BGN:"лв.",NGN:"₦",XOF:"CFA",BDT:"৳",CNY:"¥",BAM:"КМ",UGX:"USh",USD:"$",CZK:"Kč",GBP:"£",DKK:"kr.",KES:"Ksh",CHF:"CHF",MVR:"ރ.",BTN:"Nu.",XCD:"EC$",AUD:"$",BBD:"$",BIF:"FBu",BMD:"$",BSD:"$",BWP:"P",BZD:"$",CAD:"$",NZD:"$",FJD:"$",FKP:"£",GIP:"£",GMD:"D",GYD:"$",HKD:"$",IDR:"Rp",JMD:"$",KYD:"$",LRD:"$",MGA:"Ar",MOP:"MOP$",MUR:"Rs",MWK:"MK",MYR:"RM",PGK:"K",PHP:"₱",PKR:"Rs",RWF:"RF",SBD:"$",SCR:"SR",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",ANG:"NAf.",SZL:"E",TOP:"T$",TTD:"$",VUV:"VT",WST:"WS$",ARS:"$",BOB:"Bs",BRL:"R$",COP:"$",CRC:"₡",CUP:"$",DOP:"$",GTQ:"Q",HNL:"L",MXN:"$",NIO:"C$",PAB:"B/.",PEN:"S/",PYG:"₲",UYU:"$",VES:"Bs.S",IRR:"ريال",GNF:"FG",CDF:"FC",HTG:"G",XPF:"FCFP",HRK:"kn",HUF:"Ft",AMD:"֏",ISK:"kr",JPY:"¥",GEL:"₾",CVE:"",KZT:"₸",KHR:"៛",KPW:"₩",KRW:"₩",KGS:"сом",AOA:"Kz",LAK:"₭",MZN:"MTn",MKD:"ден",MNT:"₮",BND:"$",MMK:"K",NOK:"kr",NPR:"रु",AWG:"Afl.",SRD:"$",PLN:"zł",AFN:"؋",STN:"Db",MDL:"L",RON:"lei",UAH:"₴",LKR:"රු.",ALL:"Lekë",RSD:"дин.",TJS:"смн",THB:"฿",TMT:"m.",TRY:"₺",UZS:"сўм",VND:"₫",TWD:"NT$"};!function(e){function t(e){var t=e.getDate(),r=e.getMonth(),i=e.getFullYear(),o=r+1,a=i;o<3&&(a-=1,o+=12);var s=Math.floor(a/100),l=s-Math.floor(s/4)-2,c=Math.floor(365.25*(a+4716))+Math.floor(30.6001*(o+1))+t-l-1524,u=c+(l=(s=Math.floor((c-1867216.25)/36524.25))-Math.floor(s/4)+1)+1524,p=Math.floor((u-122.1)/365.25),h=Math.floor(365.25*p),d=Math.floor((u-h)/30.6001);t=u-h-Math.floor(30.6001*d),(r=Math.floor((u-h)/20.6001))>13&&(p+=1,r-=12),r-=1,i=p-4716;var m=c-24e5,f=c-1948084,g=Math.floor(f/10631);f-=10631*g;var v=Math.floor((f-.1335)/(10631/30)),y=30*g+v;f-=Math.floor(v*(10631/30)+.1335);var b=Math.floor((f+28.5001)/29.5);13===b&&(b=12);for(var M=f-Math.floor(29.5001*b-29),D=0;D<n.length&&!(n[D]>m);D++);var w=D+16260,E=Math.floor((w-1)/12),P=E+1,S=w-12*E,O=m-n[D-1]+1;return(O+"").length>2&&(O=M,S=b,P=y),{year:P,month:S,date:O}}function r(e,t,r){var i=r+n[12*(e-1)+1+(t-1)-16260-1]-1+24e5,o=Math.floor(i+.5),a=Math.floor((o-1867216.25)/36524.25),s=(a=o+1+a-Math.floor(a/4))+1524,l=Math.floor((s-122.1)/365.25),c=Math.floor(365.25*l),u=Math.floor((s-c)/30.6001),p=s-c-Math.floor(30.6001*u),h=u-(u>13.5?13:1),d=l-(h>2.5?4716:4715);return d<=0&&h--,new Date(d+"/"+h+"/"+p)}var n=[28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990];e.getHijriDate=t,e.toGregorian=r}(e.HijriParser||(e.HijriParser={}));var st=["sun","mon","tue","wed","thu","fri","sat"],lt={m:"getMinutes",h:"getHours",H:"getHours",s:"getSeconds",d:"getDate",f:"getMilliseconds"},ct={M:"month",d:"day",E:"weekday",c:"weekday",y:"year",m:"minute",h:"hour",H:"hour",s:"second",L:"month",a:"designator",z:"timeZone",Z:"timeZone",G:"era",f:"milliseconds"},ut=function(){function t(){}return t.dateFormat=function(t,r,n){var o=this,a=e.IntlBase.getDependables(n,t,r.calendar),s=i("parserObject.numbers",a),l=a.dateObject,c={isIslamic:e.IntlBase.islamicRegex.test(r.calendar)};w()&&r.isServerRendered&&(r=e.IntlBase.compareBlazorDateFormats(r,t));var p=r.format||e.IntlBase.getResultantPattern(r.skeleton,a.dateObject,r.type,!1,w()?t:"");if(c.dateSeperator=w()?i("dateSeperator",l):e.IntlBase.getDateSeparator(a.dateObject),h(p))y("Format options or type given must be invalid");else{p=e.IntlBase.ConvertDateToWeekFormat(p),w()&&(p=p.replace(/tt/,"a")),c.pattern=p,c.numMapper=w()?u({},s):ot.getNumberMapper(a.parserObject,ot.getNumberingSystem(n));for(var d=0,m=p.match(/\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi)||[];d<m.length;d++){var f=m[d],g=f.length,v=f[0];switch("K"===v&&(v="h"),v){case"E":case"c":w()?c.weekday=i("days."+e.IntlBase.monthIndex[g],l):c.weekday=a.dateObject[e.IntlBase.days]["stand-alone"][e.IntlBase.monthIndex[g]];break;case"M":case"L":w()?c.month=i("months."+e.IntlBase.monthIndex[g],l):c.month=a.dateObject[e.IntlBase.month]["stand-alone"][e.IntlBase.monthIndex[g]];break;case"a":c.designator=w()?i("dayPeriods",l):i("dayPeriods.format.wide",l);break;case"G":var b=g<=3?"eraAbbr":4===g?"eraNames":"eraNarrow";c.era=w()?i("eras",l):i("eras."+b,a.dateObject);break;case"z":c.timeZone=i("dates.timeZoneNames",a.parserObject)}}}return function(e){return isNaN(e.getDate())?null:o.intDateFormatter(e,c)}},t.intDateFormatter=function(t,r){for(var n="",i=r.pattern.match(e.IntlBase.dateParseRegex),o=this.getCurrentDateValue(t,r.isIslamic),a=0,s=i;a<s.length;a++){var l=s[a],c=l.length,u=l[0];"K"===u&&(u="h");var h=void 0,d="",m=void 0,f=void 0,g="";switch(u){case"M":case"L":h=o.month,c>2?n+=r.month[h]:m=!0;break;case"E":case"c":n+=r.weekday[st[t.getDay()]];break;case"H":case"h":case"m":case"s":case"d":case"f":if(m=!0,"d"===u)h=o.date;else if("f"===u){m=!1,f=!0;var v=(d=(d=t[lt[u]]().toString()).substring(0,c)).length;if(c!==v){if(c>3)continue;for(var y=0;y<c-v;y++)d="0"+d.toString()}g+=d}else h=t[lt[u]]();"h"===u&&(h=h%12||12);break;case"y":f=!0,g+=o.year,2===c&&(g=g.substr(g.length-2));break;case"a":var b=t.getHours()<12?"am":"pm";n+=r.designator[b];break;case"G":var M=t.getFullYear()<0?0:1,D=r.era[M];p(D)&&(D=r.era[M?0:1]),n+=D||"";break;case"'":n+="''"===l?"'":l.replace(/\'/g,"");break;case"z":var w=t.getTimezoneOffset(),E=c<4?"+H;-H":r.timeZone.hourFormat;E=E.replace(/:/g,r.numMapper.timeSeparator),0===w?n+=r.timeZone.gmtZeroFormat:(f=!0,g=this.getTimeZoneValue(w,E)),g=r.timeZone.gmtFormat.replace(/\{0\}/,g);break;case":":n+=r.numMapper.numberSymbols.timeSeparator;break;case"/":n+=r.dateSeperator;break;case"W":m=!0,h=e.IntlBase.getWeekOfYear(t);break;default:n+=l}m&&(f=!0,g=this.checkTwodigitNumber(h,c)),f&&(n+=ot.convertValueParts(g,e.IntlBase.latnParseRegex,r.numMapper.mapper))}return n},t.getCurrentDateValue=function(t,r){return r?e.HijriParser.getHijriDate(t):{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate()}},t.checkTwodigitNumber=function(e,t){var r=e+"";return 2===t&&2!==r.length?"0"+r:r},t.getTimeZoneValue=function(e,t){var r=this,n=t.split(";")[e>0?1:0],i=Math.abs(e);return n=n.replace(/HH?|mm/g,function(e){var t=e.length,n=-1!==e.indexOf("H");return r.checkTwodigitNumber(Math.floor(n?i/60:i%60),t)})},t}(),pt={ms:"minimumSignificantDigits",ls:"maximumSignificantDigits",mf:"minimumFractionDigits",lf:"maximumFractionDigits"},ht=["infinity","nan","group","decimal","exponential"],dt=function(){function t(){}return t.numberFormatter=function(t,r,n){var o,a=this,s=u({},r),l={},c={},p=e.IntlBase.getDependables(n,t,"",!0),d=p.numericObject;c.numberMapper=w()?u({},d):ot.getNumberMapper(p.parserObject,ot.getNumberingSystem(n),!0),c.currencySymbol=w()?i("currencySymbol",d):e.IntlBase.getCurrencySymbol(p.numericObject,s.currency||e.defaultCurrencyCode,r.altSymbol),c.percentSymbol=w()?i("numberSymbols.percentSign",d):c.numberMapper.numberSymbols.percentSign,c.minusSymbol=w()?i("numberSymbols.minusSign",d):c.numberMapper.numberSymbols.minusSign;var m=c.numberMapper.numberSymbols;if(r.format&&!e.IntlBase.formatRegex.test(r.format))l=e.IntlBase.customFormat(r.format,c,p.numericObject);else{if(u(s,e.IntlBase.getProperNumericSkeleton(r.format||"N")),s.isCurrency="currency"===s.type,s.isPercent="percent"===s.type,w()||(o=e.IntlBase.getSymbolPattern(s.type,c.numberMapper.numberSystem,p.numericObject,s.isAccount)),s.groupOne=this.checkValueRange(s.maximumSignificantDigits,s.minimumSignificantDigits,!0),this.checkValueRange(s.maximumFractionDigits,s.minimumFractionDigits,!1,!0),h(s.fractionDigits)||(s.minimumFractionDigits=s.maximumFractionDigits=s.fractionDigits),h(s.useGrouping)&&(s.useGrouping=!0),s.isCurrency&&!w()&&(o=o.replace(/\u00A4/g,e.IntlBase.defaultCurrency)),w())l.nData=u({},{},i(s.type+"nData",d)),l.pData=u({},{},i(s.type+"pData",d)),"currency"===s.type&&r.currency&&e.IntlBase.replaceBlazorCurrency([l.pData,l.nData],c.currencySymbol,r.currency);else{var f=o.split(";");l.nData=e.IntlBase.getFormatData(f[1]||"-"+f[0],!0,c.currencySymbol),l.pData=e.IntlBase.getFormatData(f[0],!1,c.currencySymbol),s.useGrouping&&(s.groupSeparator=m[ht[2]],s.groupData=this.getGroupingDetails(f[0]))}if(h(s.minimumFractionDigits)&&(s.minimumFractionDigits=l.nData.minimumFraction),h(s.maximumFractionDigits)){var g=l.nData.maximumFraction;s.maximumFractionDigits=h(g)&&s.isPercent?0:g}var v=s.minimumFractionDigits,y=s.maximumFractionDigits;h(v)||h(y)||v>y&&(s.maximumFractionDigits=v)}return u(l.nData,s),u(l.pData,s),function(e){return isNaN(e)?m[ht[1]]:isFinite(e)?a.intNumberFormatter(e,l,c):m[ht[0]]}},t.getGroupingDetails=function(t){var r={},n=t.match(e.IntlBase.negativeDataRegex);if(n&&n[4]){var i=n[4],o=i.lastIndexOf(",");if(-1!==o){var a=i.split(".")[0];r.primary=a.length-o-1;var s=i.lastIndexOf(",",o-1);-1!==s&&(r.secondary=o-1-s)}}return r},t.checkValueRange=function(e,t,r,n){var i=n?"f":"s",o=0,a=pt["l"+i],s=pt["m"+i];if(h(e)||(this.checkRange(e,a,n),o++),h(t)||(this.checkRange(t,s,n),o++),2===o){if(!(e<t))return!0;y(s+"specified must be less than the"+a)}else r&&1===o&&y("Both"+s+"and"+s+"must be present");return!1},t.checkRange=function(e,t,r){var n=r?[0,20]:[1,21];(e<n[0]||e>n[1])&&y(t+"value must be within the range"+n[0]+"to"+n[1])},t.intNumberFormatter=function(t,r,n){var i;if(!h(r.nData.type)){t<0?(t*=-1,i=r.nData):i=0===t?r.zeroData||r.pData:r.pData;var o="";return i.isPercent&&(t*=100),i.groupOne?o=this.processSignificantDigits(t,i.minimumSignificantDigits,i.maximumSignificantDigits):(o=this.processFraction(t,i.minimumFractionDigits,i.maximumFractionDigits),i.minimumIntegerDigits&&(o=this.processMinimumIntegers(o,i.minimumIntegerDigits))),"scientific"===i.type&&(o=(o=t.toExponential(i.maximumFractionDigits)).replace("e",n.numberMapper.numberSymbols[ht[4]])),o=o.replace(".",n.numberMapper.numberSymbols[ht[3]]),i.useGrouping&&(o=this.groupNumbers(o,i.groupData.primary,i.groupSeparator||",",n.numberMapper.numberSymbols[ht[3]]||".",i.groupData.secondary)),o=ot.convertValueParts(o,e.IntlBase.latnParseRegex,n.numberMapper.mapper),"N/A"===i.nlead?i.nlead:i.nlead+o+i.nend}},t.processSignificantDigits=function(e,t,r){var n=e+"";return n.length<t?e.toPrecision(t):(n=e.toPrecision(r),+n+"")},t.groupNumbers=function(e,t,r,n,i){for(var o=!p(i)&&0!==i,a=e.split(n),s=a[0],l=s.length,c="";l>t;)c=s.slice(l-t,l)+(c.length?r+c:""),l-=t,o&&(t=i,o=!1);return a[0]=s.slice(0,l)+(c.length?r:"")+c,a.join(n)},t.processFraction=function(e,t,r){var n=(e+"").split(".")[1],i=n?n.length:0;if(t&&i<t){var o="";if(0!==i){o+=e;for(var a=0;a<t-i;a++)o+="0";return o}return o=e.toFixed(t),e.toFixed(t)}return!p(r)&&(i>r||0===r)?e.toFixed(r):e+""},t.processMinimumIntegers=function(e,t){var r=e.split("."),n=r[0],i=n.length;if(i<t){for(var o=0;o<t-i;o++)n="0"+n;r[0]=n}return r.join(".")},t}(),mt=/^[0-9]*$/,ft={minute:"setMinutes",hour:"setHours",second:"setSeconds",day:"setDate",month:"setMonth",milliseconds:"setMilliseconds"},gt=function(){function t(){}return t.dateParser=function(t,r,n){var o=this,a=e.IntlBase.getDependables(n,t,r.calendar),s=ot.getCurrentNumericOptions(a.parserObject,ot.getNumberingSystem(n),!1,w()),l={};w()&&r.isServerRendered&&(r=e.IntlBase.compareBlazorDateFormats(r,t));var c,u=r.format||e.IntlBase.getResultantPattern(r.skeleton,a.dateObject,r.type,!1,w()?t:""),d="";if(h(u))y("Format options or type given must be invalid");else{u=e.IntlBase.ConvertDateToWeekFormat(u),l={isIslamic:e.IntlBase.islamicRegex.test(r.calendar),pattern:u,evalposition:{},culture:t};for(var m=u.match(e.IntlBase.dateParseRegex)||[],f=m.length,g=0,v=0,b=!1,M=s.numericRegex,D=w()?a.parserObject.numbers:ot.getNumberMapper(a.parserObject,ot.getNumberingSystem(n)),E=0;E<f;E++){var P=m[E],S=P.length,O="K"===P[0]?"h":P[0],C=void 0,T=void 0,j=ct[O],x=2===S?"":"?";switch(b&&(g=v,b=!1),O){case"E":case"c":var N=void 0;N=w()?i("days."+e.IntlBase.monthIndex[S],a.dateObject):a.dateObject[e.IntlBase.days]["stand-alone"][e.IntlBase.monthIndex[S]];var F=ot.reverseObject(N);d+="("+Object.keys(F).join("|")+")";break;case"M":case"L":case"d":case"m":case"s":case"h":case"H":case"f":if(T=!0,("M"===O||"L"===O)&&S>2){var A=void 0;A=w()?i("months."+e.IntlBase.monthIndex[S],a.dateObject):a.dateObject.months["stand-alone"][e.IntlBase.monthIndex[S]],l[j]=ot.reverseObject(A),d+="("+Object.keys(l[j]).join("|")+")"}else if("f"===O){if(S>3)continue;C=!0,d+="("+M+M+"?"+M+"?)"}else C=!0,d+="("+M+M+x+")";"h"===O&&(l.hour12=!0);break;case"W":d+="("+M+(1===S?"?":"")+M+")";break;case"y":T=C=!0,d+=2===S?"("+M+M+")":"("+M+"{"+S+",})";break;case"a":T=!0;var R=w()?i("dayPeriods",a.dateObject):i("dayPeriods.format.wide",a.dateObject);l[j]=ot.reverseObject(R),d+="("+Object.keys(l[j]).join("|")+")";break;case"G":T=!0;var I=S<=3?"eraAbbr":4===S?"eraNames":"eraNarrow";l[j]=ot.reverseObject(w()?i("eras",a.dateObject):i("eras."+I,a.dateObject)),d+="("+Object.keys(l[j]).join("|")+"?)";break;case"z":T=0!==(new Date).getTimezoneOffset(),l[j]=i("dates.timeZoneNames",a.parserObject);var H=l[j],L=(c=S<4)?"+H;-H":H.hourFormat;L=L.replace(/:/g,D.timeSeparator),d+="("+this.parseTimeZoneRegx(L,H,M)+")?",b=!0,v=c?6:12;break;case"'":d+="("+P.replace(/\'/g,"")+")?";break;default:d+="([\\D])"}T&&(l.evalposition[j]={isNumber:C,pos:E+1+g,hourOnly:c}),E!==f-1||p(d)||(l.parserRegex=new RegExp("^"+d+"$","i"))}}return function(t){var r=o.internalDateParse(t,l,s);if(p(r)||!Object.keys(r).length)return null;if(l.isIslamic){var n={},i=r.year,a=r.day,c=r.month,u=i?i+"":"",h=2===u.length;i&&c&&a&&!h||(n=e.HijriParser.getHijriDate(new Date)),h&&(i=parseInt((n.year+"").slice(0,2)+u,10));var d=e.HijriParser.toGregorian(i||n.year,c||n.month,a||n.date);r.year=d.getFullYear(),r.month=d.getMonth()+1,r.day=d.getDate()}return o.getDateObject(r)}},t.getDateObject=function(e,t){var r=t||new Date;r.setMilliseconds(0);var n=["hour","minute","second","milliseconds","month","day"],i=e.year,o=e.designator,a=e.timeZone;h(i)||((i+"").length<=2&&(i+=100*Math.floor(r.getFullYear()/100)),r.setFullYear(i));for(var s=0,l=n;s<l.length;s++){var c=l[s],u=e[c];if(h(u)&&"day"===c&&r.setDate(1),!h(u))if("month"===c){if((u-=1)<0||u>11)return new Date("invalid");var p=r.getDate();r.setDate(1),r[ft[c]](u);var d=new Date(r.getFullYear(),u+1,0).getDate();r.setDate(p<d?p:d)}else{if("day"===c){var m=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();if(u<1||u>m)return null}r[ft[c]](u)}}if(!h(o)){var f=r.getHours();"pm"===o?r.setHours(f+(12===f?0:12)):12===f&&r.setHours(0)}if(!h(a)){var g=a-r.getTimezoneOffset();0!==g&&r.setMinutes(r.getMinutes()+g)}return r},t.internalDateParse=function(e,t,r){var n=e.match(t.parserRegex),i={hour:0,minute:0,second:0};r.numericRegex;if(p(n))return null;for(var o=0,a=Object.keys(t.evalposition);o<a.length;o++){var s=a[o],l=t.evalposition[s],c=n[l.pos];if(l.isNumber)i[s]=this.internalNumberParser(c,r);else if("timeZone"!==s||h(c))c="month"!==s||t.isIslamic||"en"!==t.culture&&"en-GB"!==t.culture&&"en-US"!==t.culture?c:c[0].toUpperCase()+c.substring(1).toLowerCase(),i[s]=t[s][c];else{var u=l.pos,d=void 0,m=n[u+1],f=!h(m);l.hourOnly?d=60*this.getZoneValue(f,m,n[u+4],r):(d=60*this.getZoneValue(f,m,n[u+7],r),d+=this.getZoneValue(f,n[u+4],n[u+10],r)),p(d)||(i[s]=d)}}return t.hour12&&(i.hour12=!0),i},t.internalNumberParser=function(e,t){return e=ot.convertValueParts(e,t.numberParseRegex,t.numericPair),mt.test(e)?+e:null},t.parseTimeZoneRegx=function(e,t,r){var n,i,o=t.gmtFormat,a="("+r+")("+r+")";return n=e.replace("+","\\+"),n=-1!==e.indexOf("HH")?n.replace(/HH|mm/g,"("+a+")"):n.replace(/H|m/g,"("+a+"?)"),i=n.split(";").map(function(e){return o.replace("{0}",e)}),n=i.join("|")+"|"+t.gmtZeroFormat},t.getZoneValue=function(e,t,r,n){var i=e?t:r;if(!i)return 0;var o=this.internalNumberParser(i,n);return e?-o:o},t}(),vt=["minusSign","infinity"],yt=function(){function t(){}return t.numberParser=function(t,r,n){var o,a=this,s=e.IntlBase.getDependables(n,t,"",!0),l={custom:!0};e.IntlBase.formatRegex.test(r.format)||!r.format?(u(l,e.IntlBase.getProperNumericSkeleton(r.format||"N")),l.custom=!1,l.fractionDigits||r.maximumFractionDigits&&(l.maximumFractionDigits=r.maximumFractionDigits)):u(l,e.IntlBase.customFormat(r.format,null,null));var c=i("numbers",s.parserObject);o=ot.getCurrentNumericOptions(s.parserObject,ot.getNumberingSystem(n),!0,w()),l.symbolRegex=ot.getSymbolRegex(Object.keys(o.symbolMatch)),l.infinity=o.symbolNumberSystem[vt[1]];var p;if(w())l.nData=u({},{},i(l.type+"nData",c)),l.pData=u({},{},i(l.type+"pData",c)),"currency"===l.type&&r.currency&&e.IntlBase.replaceBlazorCurrency([l.pData,l.nData],i("currencySymbol",c),r.currency);else if(p=e.IntlBase.getSymbolPattern(l.type,o.numberSystem,s.numericObject,l.isAccount)){var h=(p=p.replace(/\u00A4/g,e.IntlBase.defaultCurrency)).split(";");l.nData=e.IntlBase.getFormatData(h[1]||"-"+h[0],!0,""),l.pData=e.IntlBase.getFormatData(h[0],!0,"")}return function(e){return a.getParsedNumber(e,l,o)}},t.getParsedNumber=function(e,t,r){var n,i,o,a,s,l;if(-1!==e.indexOf(t.infinity))return 1/0;e=ot.convertValueParts(e,t.symbolRegex,r.symbolMatch),0===(e=ot.convertValueParts(e,r.numberParseRegex,r.numericPair)).indexOf(".")&&(e="0"+e);var c=e.match(/^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)([Ee][+-]?[0-9]+)?([^0-9]*)$/);if(p(c))return NaN;a=c[1],o=c[2];var u=c[5];return s=c[6],n=t.custom?a===t.nData.nlead&&s===t.nData.nend:-1!==a.indexOf(t.nData.nlead)&&-1!==s.indexOf(t.nData.nend),i=n?t.nData.isPercent:t.pData.isPercent,o=o.replace(/,/g,""),u&&(o+=u),l=+o,("percent"===t.type||i)&&(l/=100),(t.custom||t.fractionDigits)&&(l=parseFloat(l.toFixed(t.custom?n?t.nData.maximumFractionDigits:t.pData.maximumFractionDigits:t.fractionDigits))),t.maximumFractionDigits&&(l=this.convertMaxFracDigits(o,t,l,n)),n&&(l*=-1),l},t.convertMaxFracDigits=function(e,t,r,n){var i=e.split(".");return i[1]&&i[1].length>t.maximumFractionDigits&&(r=+r.toFixed(t.custom?n?t.nData.maximumFractionDigits:t.pData.maximumFractionDigits:t.maximumFractionDigits)),r},t}(),bt=function(){function e(e){this.ranArray=[],this.boundedEvents={},p(e)||(this.context=e)}return e.prototype.on=function(e,t,r,n){if(!p(t)){var i=r||this.context;if(this.notExist(e))return void(this.boundedEvents[e]=[{handler:t,context:i}]);p(n)?this.isHandlerPresent(this.boundedEvents[e],t)||this.boundedEvents[e].push({handler:t,context:i}):-1===this.ranArray.indexOf(n)&&(this.ranArray.push(n),this.boundedEvents[e].push({handler:t,context:i,id:n}))}},e.prototype.off=function(e,t,r){if(!this.notExist(e)){var n=i(e,this.boundedEvents);if(t){for(var o=0;o<n.length;o++)if(r){if(n[o].id===r){n.splice(o,1);var a=this.ranArray.indexOf(r);-1!==a&&this.ranArray.splice(a,1);break}}else if(t===n[o].handler){n.splice(o,1);break}}else delete this.boundedEvents[e]}},e.prototype.notify=function(e,t,r,n){if(this.notExist(e))return void(r&&r.call(this,t));t&&(t.name=e);var o=i(e,this.boundedEvents).slice(0);if(window.Blazor)return this.blazorCallback(o,t,r,n,0);for(var a=0,s=o;a<s.length;a++){var l=s[a];l.handler.call(l.context,t)}r&&r.call(this,t)},e.prototype.blazorCallback=function(e,t,r,n,i){var o=this,a=i===e.length-1;if(i<e.length){var s=e[i],l=s.handler.call(s.context,t);if(l&&"function"==typeof l.then){if(!r)return l;l.then(function(l){if(l="string"==typeof l&&o.isJson(l)?JSON.parse(l,o.dateReviver):l,u(t,t,l,!0),!r||!a)return o.blazorCallback(e,t,r,n,i+1);r.call(s.context,t)}).catch(function(e){n&&n.call(s.context,"string"==typeof e&&o.isJson(e)?JSON.parse(e,o.dateReviver):e)})}else{if(!r||!a)return this.blazorCallback(e,t,r,n,i+1);r.call(s.context,t)}}},e.prototype.dateReviver=function(e,t){return w&&"string"==typeof t&&null!==t.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/)?new Date(t):t},e.prototype.isJson=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},e.prototype.destroy=function(){this.boundedEvents=this.context=void 0},e.prototype.notExist=function(e){return!1===this.boundedEvents.hasOwnProperty(e)||this.boundedEvents[e].length<=0},e.prototype.isHandlerPresent=function(e,t){for(var r=0,n=e;r<n.length;r++)if(n[r].handler===t)return!0;return!1},e}(),Mt=new bt;e.rightToLeft=!1;var Dt={};e.defaultCulture="en-US",e.defaultCurrencyCode="USD";var wt=["numericObject","dateObject"],Et=function(){function t(e){e&&(this.culture=e)}return t.prototype.getDateFormat=function(e){return ut.dateFormat(this.getCulture(),e||{type:"date",skeleton:"short"},Dt)},t.prototype.getNumberFormat=function(t){return t&&!t.currency&&(t.currency=e.defaultCurrencyCode),w()&&t&&!t.format&&(t.minimumFractionDigits=0),dt.numberFormatter(this.getCulture(),t||{},Dt)},t.prototype.getDateParser=function(e){return gt.dateParser(this.getCulture(),e||{skeleton:"short",type:"date"},Dt)},t.prototype.getNumberParser=function(e){return w()&&e&&!e.format&&(e.minimumFractionDigits=0),yt.numberParser(this.getCulture(),e||{format:"N"},Dt)},t.prototype.formatNumber=function(e,t){return this.getNumberFormat(t)(e)},t.prototype.formatDate=function(e,t){return this.getDateFormat(t)(e)},t.prototype.parseDate=function(e,t){return this.getDateParser(t)(e)},t.prototype.parseNumber=function(e,t){return this.getNumberParser(t)(e)},t.prototype.getDatePattern=function(t,r){return e.IntlBase.getActualDateTimeFormat(this.getCulture(),t,Dt,r)},t.prototype.getNumberPattern=function(t,r){return e.IntlBase.getActualNumberFormat(this.getCulture(),t,Dt,r)},t.prototype.getFirstDayOfWeek=function(){return e.IntlBase.getWeekData(this.getCulture(),Dt)},t.prototype.getCulture=function(){return this.culture||e.defaultCulture},t}(),Pt={"en-US":{d:"M/d/y",D:"EEEE, MMMM d, y",f:"EEEE, MMMM d, y h:mm a",F:"EEEE, MMMM d, y h:mm:s a",g:"M/d/y h:mm a",G:"M/d/yyyy h:mm:ss tt",m:"MMMM d",M:"MMMM d",r:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",R:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"h:mm tt",T:"h:m:s tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",U:"dddd, MMMM d, yyyy h:mm:ss tt",y:"MMMM yyyy",Y:"MMMM yyyy"}};!function(t){function r(e,r,n,o,a){var l,c=n||"date";if(a)l=s({skeleton:e},a).format||s({skeleton:"d"},"en-US").format;else{if(-1!==t.basicPatterns.indexOf(e)){if(l=i(c+"Formats."+e,r),"dateTime"===c){var u=i("dateFormats."+e,r),p=i("timeFormats."+e,r);l=l.replace("{1}",u).replace("{0}",p)}}else l=i("dateTimeFormats.availableFormats."+e,r);h(l)&&"yMd"===e&&(l="M/d/y")}return l}function n(e,r,n,o){var a={},s=n||"gregorian";if(a.parserObject=ot.getMainObject(e,r)||(w()?t.blazorDefaultObject:t.defaultObject),o)a.numericObject=i("numbers",a.parserObject);else{var l=w()?"dates":"dates.calendars."+s;a.dateObject=i(l,a.parserObject)}return a}function o(e,t,r,n){return i(e+"Formats-numberSystem-"+t+(n?".accounting":".standard"),r)||(n?i(e+"Formats-numberSystem-"+t+".standard",r):"")}function a(e){var r=e.match(t.dateConverterMapper);if(r&&w()){var n=3===r[0].length?"EEE":"EEEE";return e.replace(t.dateConverterMapper,n)}return e}function s(e,t){var r=e.format||e.skeleton,n=i((t||"en-US")+"."+r,Pt);return n||(n=i("en-US."+r,Pt)),n&&(n=a(n),e.format=n.replace(/tt/,"a")),e}function l(e){var r=e.match(t.formatRegex),n={},i=r[1].toUpperCase();return n.isAccount="A"===i,n.type=t.patternMatcher[i],e.length>1&&(n.fractionDigits=parseInt(r[2],10)),n}function c(e,r,n,i){var o=i?{}:{nlead:"",nend:""},a=e.match(t.customRegex);if(a){i||(o.nlead=d(a[1],n),o.nend=d(a[10],n),o.groupPattern=a[4]);var s=a[7];if(s&&r){var l=s.match(x);p(l)?o.minimumFraction=0:o.minimumFraction=l.length,o.maximumFraction=s.length-1}}return o}function d(e,r){return e?e.replace(t.defaultCurrency,r):""}function m(e,t,r){return i("currencies."+t+(r?"."+r:".symbol"),e)||i("currencies."+t+".symbol-alt-narrow",e)||"$"}function f(e,t,r){for(var n={},i=e.split(";"),o=["pData","nData","zeroData"],a=0;a<i.length;a++)n[o[a]]=g(i[a],t,r);return p(n.nData)&&(n.nData=u({},n.pData),n.nData.nlead=p(t)?"-"+n.nData.nlead:t.minusSymbol+n.nData.nlead),n}function g(e,r,n){var i={type:"decimal",minimumFractionDigits:0,maximumFractionDigits:0},a=e.match(t.customRegex);if(p(a)||""===a[5]&&"N/A"!==e)return i.type=void 0,i;i.nlead=a[1],i.nend=a[10];var s=a[6];i.useGrouping=-1!==s.indexOf(","),s=s.replace(/,/g,"");var l=a[7];if(-1!==s.indexOf("0")&&(i.minimumIntegerDigits=s.length-s.indexOf("0")),p(l)||(i.minimumFractionDigits=l.lastIndexOf("0"),i.maximumFractionDigits=l.lastIndexOf("#"),-1===i.minimumFractionDigits&&(i.minimumFractionDigits=0),(-1===i.maximumFractionDigits||i.maximumFractionDigits<i.minimumFractionDigits)&&(i.maximumFractionDigits=i.minimumFractionDigits)),p(r)?u(i,v([i.nlead,i.nend],"%","%")):(u(i,v([i.nlead,i.nend],"$",r.currencySymbol)),i.isCurrency||u(i,v([i.nlead,i.nend],"%",r.percentSymbol))),!p(n)){var c=o(i.type,r.numberMapper.numberSystem,n,!1);i.useGrouping&&(i.groupSeparator=r.numberMapper.numberSymbols[N[2]],i.groupData=dt.getGroupingDetails(c.split(";")[0])),i.nlead=i.nlead.replace(/\'/g,""),i.nend=i.nend.replace(/\'/g,"")}return i}function v(e,t,r){for(var n={nlead:e[0],nend:e[1]},i=0;i<2;i++){var o=e[i],a=o.indexOf(t);if(-1!==a&&(a<o.indexOf("'")||a>o.lastIndexOf("'"))){n[H[i]]=o.substr(0,a)+r+o.substr(a+1),n[H[t]]=!0,n.type=n.isCurrency?"currency":"percent";break}}return n}function y(e){var t=(i("dateFormats.short",e)||"").match(/[dM]([^dM])[dM]/i);return t?t[1]:"/"}function b(e,t,o,a){var l=n(o,e,t.calendar);w()&&(t=s(t,e));var c=t.format||r(t.skeleton,l.dateObject,t.type);if(a){if(-1!==(c=c.replace(F,function(e){return A[e]})).indexOf("z")){var u=c.match(/z/g).length,p=void 0,h={timeZone:{}};h.numMapper=ot.getNumberMapper(l.parserObject,ot.getNumberingSystem(o)),h.timeZone=i("dates.timeZoneNames",l.parserObject);var d=(new Date).getTimezoneOffset(),m=u<4?"+H;-H":h.timeZone.hourFormat;m=m.replace(/:/g,h.numMapper.timeSeparator),0===d?p=h.timeZone.gmtZeroFormat:(p=ut.getTimeZoneValue(d,m),p=h.timeZone.gmtFormat.replace(/\{0\}/,p)),c=c.replace(/[z]+/,'"'+p+'"')}c=c.replace(/ $/,"")}return c}function M(e,t){if(-1!==e.indexOf(",")){var r=e.split(",");e=r[0]+i("numberMapper.numberSymbols.group",t)+r[1].replace(".",i("numberMapper.numberSymbols.decimal",t))}else e=e.replace(".",i("numberMapper.numberSymbols.decimal",t));return e}function D(r,a,s,p){var h,d=n(s,r,"",!0),f={custom:!0},g=d.numericObject,v={},y=(a.format||"").match(t.currencyFormatRegex),b=t.formatRegex.test(a.format)?l(a.format||"N"):{},D={};if(y){D.numberMapper=w()?u({},d.numericObject):ot.getNumberMapper(d.parserObject,ot.getNumberingSystem(s),!0);var O=w()?i("currencySymbol",d.numericObject):m(d.numericObject,a.currency||e.defaultCurrencyCode,a.altSymbol),C=o("currency",D.numberMapper.numberSystem,d.numericObject,/a/i.test(a.format)),T=(C=C.replace(/\u00A4/g,O)).split(";");v.hasNegativePattern=!!w()||T.length>1,v.nData=w()?i(b.type+"nData",g):c(T[1]||"-"+T[0],!0,O),v.pData=w()?i(b.type+"pData",g):c(T[0],!1,O),y[2]||a.minimumFractionDigits||a.maximumFractionDigits||(h=c(C.split(";")[0],!0,"",!0).minimumFraction)}var j;if(t.formatRegex.test(a.format)||!a.format){if(u(f,l(a.format||"N")),f.custom=!1,j="###0",f.fractionDigits||a.minimumFractionDigits||a.maximumFractionDigits||h){f.fractionDigits&&(a.minimumFractionDigits=a.maximumFractionDigits=f.fractionDigits),j=E(j,h||f.fractionDigits||a.minimumFractionDigits||0,a.maximumFractionDigits||0)}if(a.minimumIntegerDigits&&(j=P(j,a.minimumIntegerDigits)),a.useGrouping&&(j=S(j)),"currency"===f.type||f.type&&w()){w()&&"currency"!==f.type&&(v.pData=i(f.type+"pData",g),v.nData=i(f.type+"nData",g));var x=j;j=v.pData.nlead+x+v.pData.nend,(v.hasNegativePattern||w())&&(j+=";"+v.nData.nlead+x+v.nData.nend)}"percent"!==f.type||w()||(j+=" %")}else j=a.format.replace(/\'/g,'"');return Object.keys(D).length>0&&(j=p?j:M(j,D)),j}function E(e,t,r){e+=".";for(var n=0;n<t;n++)e+="0";if(t<r)for(var i=r-t,o=0;o<i;o++)e+="#";return e}function P(e,t){for(var r=e.split("."),n="",i=0;i<t;i++)n+="0";return r[1]?n+"."+r[1]:n}function S(e){var t=e.split("."),r=t[0],n=3-r.length%3;e="";for(var i=(r=(n&&1===n?"#":2===n?"##":"")+r).length-1;i>0;i-=3)e=","+r[i-2]+r[i-1]+r[i]+e;return e=e.slice(1),t[1]?e+"."+t[1]:e}function O(e,t){var r=R,n=i("supplemental.weekData.firstDay",t),o=e;return/en-/.test(o)&&(o=o.slice(3)),o=o.slice(0,2).toUpperCase()+o.substr(2),n&&(r=n[o]||R),I[r]}function C(e,t,r){var n=T(r);if(t!==n)for(var i=0,o=e;i<o.length;i++){var a=o[i];a.nend=a.nend.replace(t,n),a.nlead=a.nlead.replace(t,n)}}function j(e){var t,r=new Date(e.getFullYear(),0,1),n=r.getDay();n=n>=0?n:n+7;var i=Math.floor((e.getTime()-r.getTime()-6e4*(e.getTimezoneOffset()-r.getTimezoneOffset()))/864e5)+1;if(n<4){if((t=Math.floor((i+n-1)/7)+1)>52){var o=new Date(e.getFullYear()+1,0,1).getDay();t=(o=o>=0?o:o+7)<4?1:53}}else t=Math.floor((i+n-1)/7);return t}t.negativeDataRegex=/^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,t.customRegex=/^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,t.latnParseRegex=/0|1|2|3|4|5|6|7|8|9/g;var x=/[0-9]/g;t.defaultCurrency="$";var N=["infinity","nan","group","decimal"],F=/G|M|L|H|c|'| a|yy|y|EEEE|E/g,A={G:"",M:"m",L:"m",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};t.dateConverterMapper=/dddd|ddd/gi;var R="sun";t.islamicRegex=/^islamic/;var I={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};t.formatRegex=/(^[ncpae]{1})([0-1]?[0-9]|20)?$/i,t.currencyFormatRegex=/(^[ca]{1})([0-1]?[0-9]|20)?$/i,t.curWithoutNumberRegex=/(c|a)$/gi;var H={$:"isCurrency","%":"isPercent","-":"isNegative",0:"nlead",1:"nend"};t.dateParseRegex=/([a-z])\1*|'([^']|'')+'|''|./gi,t.basicPatterns=["short","medium","long","full"],t.defaultObject={dates:{calendars:{gregorian:{months:{"stand-alone":{abbreviated:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},narrow:{1:"J",2:"F",3:"M",4:"A",5:"M",6:"J",7:"J",8:"A",9:"S",10:"O",11:"N",12:"D"},wide:{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}}},days:{"stand-alone":{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},narrow:{sun:"S",mon:"M",tue:"T",wed:"W",thu:"T",fri:"F",sat:"S"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}}},dayPeriods:{format:{wide:{am:"AM",pm:"PM"}}},eras:{eraNames:{0:"Before Christ","0-alt-variant":"Before Common Era",1:"Anno Domini","1-alt-variant":"Common Era"},eraAbbr:{0:"BC","0-alt-variant":"BCE",1:"AD","1-alt-variant":"CE"},eraNarrow:{0:"B","0-alt-variant":"BCE",1:"A","1-alt-variant":"CE"}},dateFormats:{full:"EEEE, MMMM d, y",long:"MMMM d, y",medium:"MMM d, y",short:"M/d/yy"},timeFormats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats:{full:"{1} 'at' {0}",long:"{1} 'at' {0}",medium:"{1}, {0}",short:"{1}, {0}",availableFormats:{d:"d",E:"ccc",Ed:"d E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"y G",GyMMM:"MMM y G",GyMMMd:"MMM d, y G",GyMMMEd:"E, MMM d, y G",h:"h a",H:"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss a v",Hmsv:"HH:mm:ss v",hmv:"h:mm a v",Hmv:"HH:mm v",M:"L",Md:"M/d",MEd:"E, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"E, MMM d",MMMMd:"MMMM d",ms:"mm:ss",y:"y",yM:"M/y",yMd:"M/d/y",yMEd:"E, M/d/y",yMMM:"MMM y",yMMMd:"MMM d, y",yMMMEd:"E, MMM d, y",yMMMM:"MMMM y"}}},islamic:{months:{"stand-alone":{abbreviated:{1:"Muh.",2:"Saf.",3:"Rab. I",4:"Rab. II",5:"Jum. I",6:"Jum. II",7:"Raj.",8:"Sha.",9:"Ram.",10:"Shaw.",11:"Dhuʻl-Q.",12:"Dhuʻl-H."},narrow:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},wide:{1:"Muharram",2:"Safar",3:"Rabiʻ I",4:"Rabiʻ II",5:"Jumada I",6:"Jumada II",7:"Rajab",8:"Shaʻban",9:"Ramadan",10:"Shawwal",11:"Dhuʻl-Qiʻdah",12:"Dhuʻl-Hijjah"}}},days:{"stand-alone":{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},narrow:{sun:"S",mon:"M",tue:"T",wed:"W",thu:"T",fri:"F",sat:"S"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}}},dayPeriods:{format:{wide:{am:"AM",pm:"PM"}}},eras:{eraNames:{0:"AH"},eraAbbr:{0:"AH"},eraNarrow:{0:"AH"}},dateFormats:{full:"EEEE, MMMM d, y G",long:"MMMM d, y G",medium:"MMM d, y G",short:"M/d/y GGGGG"},timeFormats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats:{full:"{1} 'at' {0}",long:"{1} 'at' {0}",medium:"{1}, {0}",short:"{1}, {0}",availableFormats:{d:"d",E:"ccc",Ed:"d E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"y G",GyMMM:"MMM y G",GyMMMd:"MMM d, y G",GyMMMEd:"E, MMM d, y G",h:"h a",H:"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",M:"L",Md:"M/d",MEd:"E, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"E, MMM d",MMMMd:"MMMM d",ms:"mm:ss",y:"y G",yyyy:"y G",yyyyM:"M/y GGGGG",yyyyMd:"M/d/y GGGGG",yyyyMEd:"E, M/d/y GGGGG",yyyyMMM:"MMM y G",yyyyMMMd:"MMM d, y G",yyyyMMMEd:"E, MMM d, y G",yyyyMMMM:"MMMM y G",yyyyQQQ:"QQQ y G",yyyyQQQQ:"QQQQ y G"}}}},timeZoneNames:{hourFormat:"+HH:mm;-HH:mm",gmtFormat:"GMT{0}",gmtZeroFormat:"GMT"}},numbers:{currencies:{USD:{displayName:"US Dollar",symbol:"$","symbol-alt-narrow":"$"},EUR:{displayName:"Euro",symbol:"€","symbol-alt-narrow":"€"},GBP:{displayName:"British Pound","symbol-alt-narrow":"£"}},defaultNumberingSystem:"latn",minimumGroupingDigits:"1","symbols-numberSystem-latn":{decimal:".",group:",",list:";",percentSign:"%",plusSign:"+",minusSign:"-",exponential:"E",superscriptingExponent:"×",perMille:"‰",infinity:"∞",nan:"NaN",timeSeparator:":"},"decimalFormats-numberSystem-latn":{standard:"#,##0.###"},"percentFormats-numberSystem-latn":{standard:"#,##0%"},"currencyFormats-numberSystem-latn":{standard:"¤#,##0.00",accounting:"¤#,##0.00;(¤#,##0.00)"},"scientificFormats-numberSystem-latn":{standard:"#E0"}}},t.blazorDefaultObject={numbers:{mapper:{0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},mapperDigits:"0123456789",numberSymbols:{decimal:".",group:",",plusSign:"+",minusSign:"-",percentSign:"%",nan:"NaN",timeSeparator:":",infinity:"∞"},timeSeparator:":",currencySymbol:"$",currencypData:{nlead:"$",nend:"",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},percentpData:{nlead:"",nend:"%",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},percentnData:{nlead:"-",nend:"%",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},currencynData:{nlead:"($",nend:")",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},decimalnData:{nlead:"-",nend:"",groupData:{primary:3},maximumFraction:2,minimumFraction:2},decimalpData:{nlead:"",nend:"",groupData:{primary:3},maximumFraction:2,minimumFraction:2}},dates:{dayPeriods:{am:"AM",pm:"PM"},dateSeperator:"/",days:{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}},months:{abbreviated:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},wide:{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}},eras:{1:"AD"}}},t.monthIndex={3:"abbreviated",4:"wide",5:"narrow",1:"abbreviated"},t.month="months",t.days="days",t.patternMatcher={C:"currency",P:"percent",N:"decimal",A:"currency",E:"scientific"},t.getResultantPattern=r,t.getDependables=n,t.getSymbolPattern=o,t.ConvertDateToWeekFormat=a,t.compareBlazorDateFormats=s,t.getProperNumericSkeleton=l,t.getFormatData=c,t.getCurrencySymbol=m,t.customFormat=f,t.isCurrencyPercent=v,t.getDateSeparator=y,t.getActualDateTimeFormat=b,t.getActualNumberFormat=D,t.getWeekData=O,t.replaceBlazorCurrency=C,t.getWeekOfYear=j}(e.IntlBase||(e.IntlBase={}));var St=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot="GET",Ct=function(){function e(e,t,r,n){this.mode=!0,this.emitError=!0,this.options={},"string"==typeof e?(this.url=e,this.type=t?t.toUpperCase():Ot,this.mode=!!p(r)||r):"object"==typeof e&&(this.options=e,c(this,this.options)),this.type=this.type?this.type.toUpperCase():Ot,this.contentType=void 0!==this.contentType?this.contentType:n}return e.prototype.send=function(e){var t=this;this.data=p(e)?this.data:e;var r={cancel:!1,httpRequest:null};return new Promise(function(e,n){t.httpRequest=new XMLHttpRequest,t.httpRequest.onreadystatechange=function(){t.stateChange(e,n)},p(t.onLoad)||(t.httpRequest.onload=t.onLoad),p(t.onProgress)||(t.httpRequest.onprogress=t.onProgress),p(t.onAbort)||(t.httpRequest.onabort=t.onAbort),p(t.onError)||(t.httpRequest.onerror=t.onError),p(t.onUploadProgress)||(t.httpRequest.upload.onprogress=t.onUploadProgress),t.httpRequest.open(t.type,t.url,t.mode),p(t.data)||null===t.contentType||t.httpRequest.setRequestHeader("Content-Type",t.contentType||"application/json; charset=utf-8"),t.beforeSend&&(r.httpRequest=t.httpRequest,t.beforeSend(r)),r.cancel||t.httpRequest.send(p(t.data)?null:t.data)})},e.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e,this),e},e.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(this.httpRequest),e},e.prototype.stateChange=function(e,t){var r=this.httpRequest.responseText;if(this.dataType&&"json"===this.dataType.toLowerCase())if(""===r)r=void 0;else try{r=JSON.parse(r)}catch(e){}4===this.httpRequest.readyState&&(this.httpRequest.status>=200&&this.httpRequest.status<=299||304===this.httpRequest.status?e(this.successHandler(r)):this.emitError?t(new Error(this.failureHandler(this.httpRequest.statusText))):e())},e.prototype.getResponseHeader=function(e){var t,r;t={};for(var n=St.exec(this.httpRequest.getAllResponseHeaders());n;)t[n[1].toLowerCase()]=n[2],n=St.exec(this.httpRequest.getAllResponseHeaders());return r=t[e.toLowerCase()],p(r)?null:r},e}(),Tt={OPERA:/(opera|opr)(?:.*version|)[ \/]([\w.]+)/i,EDGE:/(edge)(?:.*version|)[ \/]([\w.]+)/i,CHROME:/(chrome|crios)[ \/]([\w.]+)/i,PANTHOMEJS:/(phantomjs)[ \/]([\w.]+)/i,SAFARI:/(safari)[ \/]([\w.]+)/i,WEBKIT:/(webkit)[ \/]([\w.]+)/i,MSIE:/(msie|trident) ([\w.]+)/i,MOZILLA:/(mozilla)(?:.*? rv:([\w.]+)|)/i};"undefined"!=typeof window&&(window.browserDetails=window.browserDetails||{});var jt,xt=function(){function e(){}return e.extractBrowserDetail=function(){for(var t={culture:{}},r=[],n=0,i=Object.keys(Tt);n<i.length;n++){var o=i[n];if(r=e.userAgent.match(Tt[o])){if(t.name="opr"===r[1].toLowerCase()?"opera":r[1].toLowerCase(),t.name="crios"===r[1].toLowerCase()?"chrome":t.name,t.version=r[2],t.culture.name=t.culture.language=navigator.language,e.userAgent.match(/Trident\/7\./)){t.name="msie";break}var a=e.userAgent.match(/(version)[ \/]([\w.]+)/i);"safari"===t.name&&a&&(t.version=a[2]);break}}return t},e.getEvent=function(t){var r={start:{isPointer:"pointerdown",isTouch:"touchstart",isDevice:"mousedown"},move:{isPointer:"pointermove",isTouch:"touchmove",isDevice:"mousemove"},end:{isPointer:"pointerup",isTouch:"touchend",isDevice:"mouseup"},cancel:{isPointer:"pointercancel",isTouch:"touchcancel",isDevice:"mouseleave"}};return e.isPointer&&!e.isWindows?r[t].isPointer:e.isTouch?r[t].isTouch+(e.isDevice?"":" "+r[t].isDevice):r[t].isDevice},e.getTouchStartEvent=function(){return e.getEvent("start")},e.getTouchEndEvent=function(){return e.getEvent("end")},e.getTouchMoveEvent=function(){return e.getEvent("move")},e.getTouchCancelEvent=function(){return e.getEvent("cancel")},e.getValue=function(t,r){var n=window.browserDetails;return void 0===n[t]?n[t]=r.test(e.userAgent):n[t]},Object.defineProperty(e,"userAgent",{get:function(){return e.uA},set:function(t){e.uA=t,window.browserDetails={}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"info",{get:function(){return h(window.browserDetails.info)?window.browserDetails.info=e.extractBrowserDetail():window.browserDetails.info},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIE",{get:function(){return e.getValue("isIE",/msie|trident/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isTouch",{get:function(){return h(window.browserDetails.isTouch)?window.browserDetails.isTouch="ontouchstart"in window.navigator||window&&window.navigator&&window.navigator.maxTouchPoints>0||"ontouchstart"in window:window.browserDetails.isTouch},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isPointer",{get:function(){return h(window.browserDetails.isPointer)?window.browserDetails.isPointer="pointerEnabled"in window.navigator:window.browserDetails.isPointer},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isMSPointer",{get:function(){return h(window.browserDetails.isMSPointer)?window.browserDetails.isMSPointer="msPointerEnabled"in window.navigator:window.browserDetails.isMSPointer},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isDevice",{get:function(){return e.getValue("isDevice",/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIos",{get:function(){return e.getValue("isIos",/(ipad|iphone|ipod touch)/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIos7",{get:function(){return e.getValue("isIos7",/(ipad|iphone|ipod touch);.*os 7_\d|(ipad|iphone|ipod touch);.*os 8_\d/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isAndroid",{get:function(){return e.getValue("isAndroid",/android/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWebView",{get:function(){return h(window.browserDetails.isWebView)?(window.browserDetails.isWebView=!(h(window.cordova)&&h(window.PhoneGap)&&h(window.phonegap)&&"object"!==window.forge),window.browserDetails.isWebView):window.browserDetails.isWebView},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWindows",{get:function(){return e.getValue("isWindows",/trident|windows phone|edge/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchStartEvent",{get:function(){return h(window.browserDetails.touchStartEvent)?window.browserDetails.touchStartEvent=e.getTouchStartEvent():window.browserDetails.touchStartEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchMoveEvent",{get:function(){return h(window.browserDetails.touchMoveEvent)?window.browserDetails.touchMoveEvent=e.getTouchMoveEvent():window.browserDetails.touchMoveEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchEndEvent",{get:function(){return h(window.browserDetails.touchEndEvent)?window.browserDetails.touchEndEvent=e.getTouchEndEvent():window.browserDetails.touchEndEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchCancelEvent",{get:function(){return h(window.browserDetails.touchCancelEvent)?window.browserDetails.touchCancelEvent=e.getTouchCancelEvent():window.browserDetails.touchCancelEvent},enumerable:!0,configurable:!0}),e.uA="undefined"!=typeof navigator?navigator.userAgent:"",e}(),Nt=function(){function e(){}return e.addOrGetEventData=function(e){return"__eventList"in e?e.__eventList.events:(e.__eventList={},e.__eventList.events=[])},e.add=function(t,r,n,i,o){var a,s=e.addOrGetEventData(t);a=o?m(n,o):n,i&&(a=a.bind(i));for(var l=r.split(" "),c=0;c<l.length;c++)s.push({name:l[c],listener:n,debounce:a}),xt.isIE?t.addEventListener(l[c],a):t.addEventListener(l[c],a,{passive:!1});return a},e.remove=function(t,r,n){for(var i=e.addOrGetEventData(t),o=r.split(" "),a=0;a<o.length;a++)!function(e){var r,a=-1;i&&0!==i.length&&i.some(function(t,i){return t.name===o[e]&&t.listener===n&&(a=i,r=t.debounce,!0)}),-1!==a&&i.splice(a,1),r&&t.removeEventListener(o[e],r)}(a)},e.clearEvents=function(t){var r,n;n=u([],n,r=e.addOrGetEventData(t));for(var i=0;i<n.length;i++)t.removeEventListener(n[i].name,n[i].debounce),r.shift()},e.trigger=function(t,r,n){for(var i=0,o=e.addOrGetEventData(t);i<o.length;i++){var a=o[i];a.name===r&&a.debounce.call(this,n)}},e}(),Ft=new RegExp("\\n|\\r|\\s\\s+","g"),At=new RegExp(/'|"/g),Rt=new RegExp("if ?\\("),It=new RegExp("else if ?\\("),Ht=new RegExp("else"),Lt=new RegExp("for ?\\("),kt=new RegExp("(/if|/for)"),Bt=new RegExp("\\((.*)\\)",""),Gt=new RegExp("^[0-9]+$","g"),zt=new RegExp("[\\w\"'.\\s+]+","g"),Yt=new RegExp('"(.*?)"',"g"),_t=new RegExp("[\\w\"'@#$.\\s+]+","g"),Xt=new RegExp("\\${([^}]*)}","g"),Wt=/^\..*/gm,$t=/\\/gi,Vt=/\\\\/gi,Ut=new RegExp("[\\w\"'@#$.\\s+]+","g"),Kt=/\window\./gm,qt=/^[\n\r.]+\<tr|^\<tr/,Zt=/^[\n\r.]+\<svg|^\<path|^\<g/,Jt={},Qt={compile:(new(function(){function e(){}return e.prototype.compile=function(e,t,r){return void 0===t&&(t={}),H(e,t)},e}())).compile},er=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tr=/(?:#([\w-]+)|(\w+)|\.([\w-]+))/g,rr=/^(\.|#)/,nr={".":"className","#":"id"},ir="(?=.*?\\b{value}\\b)",or={className:"attributes.className",id:"attributes.id",tagName:"tagName"},ar=["area","base","basefont","br","col","frame","hr","img","input","link","meta","param","embed","command","keygen","source","track","wbr"],sr=["a","address","article","applet","aside","audio","blockquote","button","canvas","center","dd","del","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","ins","isindex","li","map","menu","noframes","noscript","object","ol","output","p","pre","section","script","table","tbody","td","tfoot","th","thead","tr","ul","video"],lr=["abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","script","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"],cr=["colgroup","dd","dt","li","options","p","td","tfoot","th","thead","tr"],ur=["checked","compact","declare","defer","disabled","ismap","multiple","nohref","noresize","noshade","nowrap","readonly","selected"],pr=["Script","style"],hr={tabindex:"tabIndex"},dr=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,mr=/^<\/([-A-Za-z0-9_]+)[^>]*>/,fr=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;!function(e){function t(e,t){var r=[],n=u({},{},t,!0);if(!p(t)&&Object.keys(t).length&&(n.innerHTML&&(r=d(n.innerHTML),delete n.innerHTML),n.attrs&&(u(n,n.attrs),delete n.attrs),n.styles)){for(var i=n.styles.split(";"),o={},a=0,s=i.length;a<s;a++){var l=i[a].split(":");o[l[0]]=l[1]}delete n.styles,n.style=o}return{tagName:e,attributes:n||{},children:r}}function r(e,t){t&&e&&e.forEach(function(e){return s(e)&&(e.parent&&a(e),e.parent=t),e})}function n(e,t){r(e,t),t.children?t.children=t.children.concat(e):t.children=[].concat(e)}function o(e,t){if(r(e,t),t.children&&t.children.length)for(var n=e.length-1;n>=0;n--)t.children.unshift(e[n]);else t.children=[],t.children.concat(e)}function a(e){var t=e.parent;if(t){var r=t.children.indexOf(e);-1!==r&&t.children.splice(r)}return t}function l(e){for(var t=e.ele,r=e.selector,n=e.selectAll,i=e.immediateParent,o=r.split(" "),a=t,s=0,u=o.length;s<u;s++){var p=!1,d=a,m=o[s],f=[];if(er.test(m))c(m,f);else if(-1===m.indexOf(">"))for(var g=0,v=m.match(tr);g<v.length;g++)c(v[g],f);else if(-1!==m.indexOf(">")){p=!0;for(var y=t,b=void 0,M=0,D=0,w=m.split(">");D<w.length;D++){var E=w[D];if(!y)break;if(y.length){for(var P=[],S=0,O=y;S<O.length;S++){var C=O[S];P=P.concat(l({ele:C,selector:E,selectAll:n,immediateParent:!!M}))}b=P}else b=l({ele:y,selector:E,selectAll:n,immediateParent:!!M});M++,y=b}b&&(a=b)}if(!p)if(d.length){for(var T=[],j=0,x=d;j<x.length;j++){var N=x[j];T=T.concat(h(N,f,n,i))}a=T}else a=h(d,f,n,i)}return n?a:a[0]||null}function c(e,t){var r=e.match(rr),n={};if(r){var i=nr[r[0]];if("className"===i){var o=t.filter(function(e){return e.hasOwnProperty("className")})[0],a=!1;o||(a=!0,o={});var s=o[i]||"";o[i]=s+ir.replace("{value}",e.replace(".","")),a&&t.push(o)}else n[i]=e.replace(r[0],""),t.push(n)}else t.push({tagName:e})}function h(e,t,r,n){if(e.children){var o=e.children.filter(function(e){if("string"!=typeof e){for(var r=!0,n=0,o=t;n<o.length;n++){var a=o[n],s=Object.keys(a)[0],l=a[s],c=i(or[s],e);if("className"===s){if(!new RegExp("^"+l+".*$").test(c)){r=!1;break}}else if(c!==l){r=!1;break}}return r}return!1});return n||o.length&&!r||e.children.forEach(function(e){s(e)&&(o=o.concat(h(e,t,r)))}),o}return[]}function d(e){function t(e,t,n){if(t=t.toLowerCase(),f(sr,t))for(;m(a)&&f(lr,m(a));)r("",m(a));f(cr,t)&&m(a)&&r("",t);var i=f(ar,t);i||a.push(t);var l={};n.replace(fr,function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[2]?r[2]:r[3]?r[3]:r[4]?r[4]:f(ur,t)?t:"";if("style"===t){for(var o=i.split(";"),a={},s=0,c=o.length;s<c;s++){var u=o[s].split(":");a[u[0]]=u[1]}i=a}t=hr[t]||t,l[t]=i}),l["data-id"]=_();var c={tagName:t,attributes:l};if(i){var u=s[0]||o;void 0===u.children&&(u.children=[]),c.parent=u,u.children.push(c)}else s.unshift(c)}function r(e,t){var r;if(t)for(r=a.length-1;r>=0&&a[r]!==t;r--);else r=0;if(r>=0){for(var n=s.length-1;n>=r;n--){var i=s.shift();if(0===s.length)o.push(i);else{var l=s[0];void 0===l.children&&(l.children=[]),i.parent=l,l.children.push(i)}}a.length=r}}function n(e){if(0===s.length)o.push(e);else{var t=s[0];void 0===t.children&&(t.children=[]),t.children.push(e)}}for(var i,o=[],a=[],s=[];e;){i=!0;var l=m(a);if(l&&f(pr,l))e=e.replace(new RegExp("([\\s\\S]*?)</"+m(s)+"[^>]*>"),function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),n(t),""}),r("",m(a));else{if(0===e.indexOf("</"))(c=e.match(mr))&&(e=e.substring(c[0].length),c[0].replace(mr,r)),i=!1;else if(0===e.indexOf("<")){var c=e.match(dr);c&&(e=e.substring(c[0].length),c[0].replace(dr,t)),i=!1}if(i){var u=e.indexOf("<"),p=u<0?e:e.substring(0,u);e=u<0?"":e.substring(u),n(p)}}}return o}function m(e){return e[e.length-1]}function f(e,t){return-1!==e.indexOf(t)}function g(e,t){return s(e)?t?u({},{},e,!0):{tagName:e.tagName,attributes:e.attributes}:e.cloneNode(t)}function v(e,t){e.attributes.style?e.attributes.style=u({},t):e.attributes.style=u(e.attributes.style,t)}e.createElement=t,e.assignParent=r,e.append=n,e.prepend=o,e.detach=a,e.vDomSelector=l,e.accessElement=h,e.ConvertHTMLToJSon=d,e.cloneNode=g,e.setStyleAttribute=v}(jt||(jt={}));var gr=/^svg|^path|^g/,vr=new RegExp("]"),yr=function(){function e(e,t){this.isRendered=!1,this.isComplexArraySetter=!1,this.isServerRendered=!1,this.allowServerDataBinding=!0,this.isProtectedOnChange=!0,this.properties={},this.changedProperties={},this.oldProperties={},this.bulkChanges={},this.refreshing=!1,this.ignoreCollectionWatch=!1,this.finalUpdate=function(){},this.childChangedProperties={},this.modelObserver=new bt(this),h(t)||(this.element="string"==typeof t?document.querySelector(t):t,p(this.element)||(this.isProtectedOnChange=!1,this.addInstance())),h(e)||this.setProperties(e,!0),this.isDestroyed=!1}return e.prototype.setProperties=function(e,t){var r=this.isProtectedOnChange;this.isProtectedOnChange=!!t,c(this,e),!0!==t?(c(this.changedProperties,e),this.dataBind()):w()&&this.isRendered&&this.serverDataBind(e),this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.isProtectedOnChange=r},e.callChildDataBind=function(e,t){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t[i]instanceof Array)for(var o=0,a=t[i];o<a.length;o++){var s=a[o];void 0!==s.dataBind&&s.dataBind()}else t[i].dataBind()}},e.prototype.clearChanges=function(){this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.childChangedProperties={}},e.prototype.dataBind=function(){if(e.callChildDataBind(this.childChangedProperties,this),Object.getOwnPropertyNames(this.changedProperties).length){var t=this.isProtectedOnChange,r=this.changedProperties,n=this.oldProperties;this.clearChanges(),this.isProtectedOnChange=!0,this.onPropertyChanged(r,n),this.isProtectedOnChange=t}},e.prototype.serverDataBind=function(e){if(w()){e=e||{},u(this.bulkChanges,{},e,!0);this.allowServerDataBinding&&window.sfBlazor.updateModel&&(window.sfBlazor.updateModel(this),this.bulkChanges={})}},e.prototype.saveChanges=function(e,t,r){if(w()){var i={};i[e]=t,this.serverDataBind(i)}this.isProtectedOnChange||(this.oldProperties[e]=r,this.changedProperties[e]=t,this.finalUpdate(),this.finalUpdate=n(this.dataBind.bind(this)))},e.prototype.addEventListener=function(e,t){this.modelObserver.on(e,t)},e.prototype.removeEventListener=function(e,t){this.modelObserver.off(e,t)},e.prototype.trigger=function(e,t,r,n){var o=this;if(!0!==this.isDestroyed){var a=this.isProtectedOnChange;this.isProtectedOnChange=!1;var s=this.modelObserver.notify(e,t,r,n);if(vr.test(e)){var l=i(e,this);if(l){if(window.Blazor){var c=l.call(this,t);c&&"function"==typeof c.then?r?c.then(function(e){r&&(e="string"==typeof e&&o.modelObserver.isJson(e)?JSON.parse(e):e,r.call(o,e))}).catch(function(e){n&&(e="string"==typeof e&&o.modelObserver.isJson(e)?JSON.parse(e):e,n.call(o,e))}):s=c:r&&r.call(this,t)}else l.call(this,t),r&&r.call(this,t)}else r&&r.call(this,t)}return this.isProtectedOnChange=a,s}},e.prototype.addInstance=function(){var e="e-"+this.getModuleName().toLowerCase();q([this.element],["e-lib",e]),p(this.element.ej2_instances)?o("ej2_instances",[this],this.element):this.element.ej2_instances.push(this)},e.prototype.destroy=function(){var e=this;this.element.ej2_instances=this.element.ej2_instances.filter(function(t){return t!==e}),Z([this.element],["e-"+this.getModuleName()]),0===this.element.ej2_instances.length&&Z([this.element],["e-lib"]),this.clearChanges(),this.modelObserver.destroy(),this.isDestroyed=!0},e}(),br=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Dr=function(e){function t(t){var r=e.call(this,t,void 0)||this;return r.easing={ease:"cubic-bezier(0.250, 0.100, 0.250, 1.000)",linear:"cubic-bezier(0.250, 0.250, 0.750, 0.750)",easeIn:"cubic-bezier(0.420, 0.000, 1.000, 1.000)",easeOut:"cubic-bezier(0.000, 0.000, 0.580, 1.000)",easeInOut:"cubic-bezier(0.420, 0.000, 0.580, 1.000)",elasticInOut:"cubic-bezier(0.5,-0.58,0.38,1.81)",elasticIn:"cubic-bezier(0.17,0.67,0.59,1.81)",elasticOut:"cubic-bezier(0.7,-0.75,0.99,1.01)"},r}br(t,e),r=t,t.prototype.animate=function(e,t){t=t||{};var n=this.getModel(t);if("string"==typeof e)for(var i=0,o=Array.prototype.slice.call(se(e,document));i<o.length;i++){var a=o[i];n.element=a,r.delayAnimation(n)}else n.element=e,r.delayAnimation(n)},t.stop=function(e,t){e.style.animation="",e.removeAttribute("e-animate");var r=e.getAttribute("e-animation-id");if(r){var n=parseInt(r,10);cancelAnimationFrame(n),e.removeAttribute("e-animation-id")}t&&t.end&&t.end.call(this,t)},t.delayAnimation=function(e){e.delay?setTimeout(function(){r.applyAnimation(e)},e.delay):r.applyAnimation(e)},t.applyAnimation=function(e){var t=this;e.timeStamp=0;var r=0,n=0,i=0,o=0,a=e.duration;e.element.setAttribute("e-animate","true");var s=function(l){try{if(l){o=0===o?l:o,e.timeStamp=l+e.timeStamp-o,o=l,!r&&e.begin&&e.begin.call(t,e),r+=1;var c=e.timeStamp/r;e.timeStamp<a&&e.timeStamp+c<a&&e.element.getAttribute("e-animate")?(e.element.style.animation=e.name+" "+e.duration+"ms "+e.timingFunction,e.progress&&e.progress.call(t,e),requestAnimationFrame(s)):(cancelAnimationFrame(n),e.element.removeAttribute("e-animation-id"),e.element.removeAttribute("e-animate"),e.element.style.animation="",e.end&&e.end.call(t,e))}else i=performance.now(),n=requestAnimationFrame(s),e.element.setAttribute("e-animation-id",n.toString())}catch(r){cancelAnimationFrame(n),e.element.removeAttribute("e-animation-id"),e.fail&&e.fail.call(t,r)}};s()},t.prototype.getModel=function(e){return{name:e.name||this.name,delay:e.delay||this.delay,duration:void 0!==e.duration?e.duration:this.duration,begin:e.begin||this.begin,end:e.end||this.end,fail:e.fail||this.fail,progress:e.progress||this.progress,timingFunction:this.easing[e.timingFunction]?this.easing[e.timingFunction]:e.timingFunction||this.easing[this.timingFunction]}},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"animation"},t.prototype.destroy=function(){};var r;return Mr([Re("FadeIn")],t.prototype,"name",void 0),Mr([Re(400)],t.prototype,"duration",void 0),Mr([Re("ease")],t.prototype,"timingFunction",void 0),Mr([Re(0)],t.prototype,"delay",void 0),Mr([Be()],t.prototype,"progress",void 0),Mr([Be()],t.prototype,"begin",void 0),Mr([Be()],t.prototype,"end",void 0),Mr([Be()],t.prototype,"fail",void 0),t=r=Mr([Ge],t)}(yr);e.isRippleEnabled=!1;var wr,Er=function(){function e(e){this.loadedModules=[],this.parent=e}return e.prototype.inject=function(e,t){var n=e.length;if(0===n)return void this.clean();this.loadedModules.length&&this.clearUnusedModule(e);for(var i=0;i<n;i++)for(var a=e[i],s=0,l=t;s<l.length;s++){var c=l[s],u=a.member;if(c.prototype.getModuleName()===a.member&&!this.isModuleLoaded(u)){var p=r(c,a.args),h=this.getMemberName(u);a.isProperty?o(h,c,this.parent):o(h,p,this.parent);var d=a;d.member=h,this.loadedModules.push(d)}}},e.prototype.clean=function(){for(var e=0,t=this.loadedModules;e<t.length;e++){var r=t[e];r.isProperty||i(r.member,this.parent).destroy()}this.loadedModules=[]},e.prototype.clearUnusedModule=function(e){for(var t=this,r=e.map(function(e){return t.getMemberName(e.member)}),n=0,o=this.loadedModules.filter(function(e){return-1===r.indexOf(e.member)});n<o.length;n++){var s=o[n];s.isProperty||i(s.member,this.parent).destroy(),this.loadedModules.splice(this.loadedModules.indexOf(s),1),a(this.parent,s.member)}},e.prototype.getMemberName=function(e){return e[0].toLowerCase()+e.substring(1)+"Module"},e.prototype.isModuleLoaded=function(e){for(var t=0,r=this.loadedModules;t<r.length;t++)if(r[t].member===this.getMemberName(e))return!0;return!1},e}(),Pr=function(){function e(e,t,r,n){this.isComplexArraySetter=!1,this.properties={},this.changedProperties={},this.childChangedProperties={},this.oldProperties={},this.finalUpdate=function(){},this.callChildDataBind=i("callChildDataBind",yr),this.parentObj=e,this.controlParent=this.parentObj.controlParent||this.parentObj,this.propName=t,this.isParentArray=n,this.setProperties(r,!0)}return e.prototype.updateChange=function(e,t){!0===e?this.parentObj.childChangedProperties[t]=e:delete this.parentObj.childChangedProperties[t],this.parentObj.updateChange&&this.parentObj.updateChange(e,this.parentObj.propName)},e.prototype.updateTimeOut=function(){if(this.parentObj.updateTimeOut)this.parentObj.finalUpdate(),this.parentObj.updateTimeOut();else{var e=setTimeout(this.parentObj.dataBind.bind(this.parentObj)),t=function(){clearTimeout(e)};this.finalUpdate=t}},e.prototype.clearChanges=function(){this.finalUpdate(),this.updateChange(!1,this.propName),this.oldProperties={},this.changedProperties={}},e.prototype.setProperties=function(e,t){!0===t?(c(this,e),this.updateChange(!1,this.propName),this.clearChanges()):c(this,e)},e.prototype.dataBind=function(){if(this.callChildDataBind(this.childChangedProperties,this),this.isParentArray){var e=this.parentObj[this.propName].indexOf(this);Object.keys(this.changedProperties).length&&(o(this.propName+"."+e,this.changedProperties,this.parentObj.changedProperties),o(this.propName+"."+e,this.oldProperties,this.parentObj.oldProperties))}else this.parentObj.changedProperties[this.propName]=this.changedProperties,this.parentObj.oldProperties[this.propName]=this.oldProperties;this.clearChanges()},e.prototype.saveChanges=function(e,t,r,n){this.controlParent.isProtectedOnChange||(n||this.serverDataBind(e,t,!0),this.oldProperties[e]=r,this.changedProperties[e]=t,this.updateChange(!0,this.propName),this.finalUpdate(),this.updateTimeOut())},e.prototype.serverDataBind=function(e,t,r,n){if(w()&&!this.parentObj.isComplexArraySetter){var i,o={},a=r?this.getParentKey(!0)+"."+e:e;if(-1!==a.indexOf(".")){var s=a.split(".");i=o;for(var l=0;l<s.length;l++){var c=l===s.length-1;i[s[l]]=c?t:{},i=c?i:i[s[l]]}}else o[a]={},i=o[a],o[a][e]=t;if(this.isParentArray){i.ejsAction=n||"none"}this.controlParent.serverDataBind(o)}},e.prototype.getParentKey=function(e){var t="",r=this.propName;if(this.isParentArray){t=this.parentObj[this.propName].indexOf(this);var n=this.parentObj[this.propName].length;n=e?n:n>0?n-1:0,r+=t=-1!==t?"-"+t:"-"+n}return this.controlParent!==this.parentObj&&(r=this.parentObj.getParentKey()+"."+this.propName+t),r},e}(),Sr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Or=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Cr=0,Tr=0;e.versionBasedStatePersistence=!1;var jr=function(t){function r(r,n){var i=t.call(this,r,n)||this;return i.randomId=O(),i.isStringTemplate=!1,i.needsID=!1,i.isReactHybrid=!1,p(i.enableRtl)&&i.setProperties({enableRtl:e.rightToLeft},!0),p(i.locale)&&i.setProperties({locale:e.defaultCulture},!0),i.moduleLoader=new Er(i),i.localObserver=new bt(i),Mt.on("notifyExternalChange",i.detectFunction,i,i.randomId),h(n)||i.appendTo(),i}return Sr(r,t),r.prototype.requiredModules=function(){return[]},r.prototype.destroy=function(){this.isDestroyed||(this.enablePersistence&&this.setPersistData(),this.localObserver.destroy(),this.refreshing||(Z([this.element],["e-control"]),this.trigger("destroyed",{cancel:!1}),t.prototype.destroy.call(this),this.moduleLoader.clean(),Mt.off("notifyExternalChange",this.detectFunction,this.randomId)))},r.prototype.refresh=function(){this.refreshing=!0,this.moduleLoader.clean(),this.destroy(),this.clearChanges(),this.localObserver=new bt(this),this.preRender(),this.injectModules(),this.render(),this.refreshing=!1},r.prototype.accessMount=function(){this.mount&&!this.isReactHybrid&&this.mount()},r.prototype.getRootElement=function(){return this.isReactHybrid?this.actualElement:this.element},r.prototype.getLocalData=function(){var t=this.getModuleName()+this.element.id;return e.versionBasedStatePersistence?window.localStorage.getItem(t+this.ej2StatePersistenceVersion):window.localStorage.getItem(t)},r.prototype.appendTo=function(e){if(p(e)||"string"!=typeof e?p(e)||(this.element=e):this.element=ae(e,document),!p(this.element)){var r="e-"+this.getModuleName().toLowerCase();q([this.element],["e-control",r]),this.isProtectedOnChange=!1,this.needsID&&!this.element.id&&(this.element.id=this.getUniqueID(this.getModuleName())),this.enablePersistence&&(this.mergePersistData(),window.addEventListener("unload",this.setPersistData.bind(this)));var n=i("ej2_instances",this.element);n&&-1!==n.indexOf(this)||t.prototype.addInstance.call(this),this.preRender(),this.injectModules(),this.render(),this.mount?this.accessMount():this.trigger("created")}},r.prototype.renderComplete=function(e){if(w()){window.sfBlazor.renderComplete(this.element,e)}this.isRendered=!0},r.prototype.dataBind=function(){this.injectModules(),t.prototype.dataBind.call(this)},r.prototype.on=function(e,t,r){if("string"==typeof e)this.localObserver.on(e,t,r);else for(var n=0,i=e;n<i.length;n++){var o=i[n];this.localObserver.on(o.event,o.handler,o.context)}},r.prototype.off=function(e,t){if("string"==typeof e)this.localObserver.off(e,t);else for(var r=0,n=e;r<n.length;r++){var i=n[r];this.localObserver.off(i.event,i.handler)}},r.prototype.notify=function(e,t){!0!==this.isDestroyed&&this.localObserver.notify(e,t)},r.prototype.getInjectedModules=function(){return this.injectedModules},r.Inject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.prototype.injectedModules||(this.prototype.injectedModules=[]);for(var r=0;r<e.length;r++)-1===this.prototype.injectedModules.indexOf(e[r])&&this.prototype.injectedModules.push(e[r])},r.prototype.createElement=function(e,t,r){return r&&this.isReactHybrid?(t&&(t={}),t["data-id"]=_(),jt.createElement(e,t)):K(e,t)},r.prototype.triggerStateChange=function(e,t){this.isReactHybrid&&(this.setState(),this.currentContext={calls:e,args:t})},r.prototype.injectModules=function(){this.injectedModules&&this.injectedModules.length&&this.moduleLoader.inject(this.requiredModules(),this.injectedModules)},r.prototype.detectFunction=function(e){var t=Object.keys(e);t.length&&(this[t[0]]=e[t[0]])},r.prototype.mergePersistData=function(){var t;p(t=e.versionBasedStatePersistence?window.localStorage.getItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion):window.localStorage.getItem(this.getModuleName()+this.element.id))||""===t||this.setProperties(JSON.parse(t),!0)},r.prototype.setPersistData=function(){this.isDestroyed||(e.versionBasedStatePersistence?window.localStorage.setItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion,this.getPersistData()):window.localStorage.setItem(this.getModuleName()+this.element.id,this.getPersistData()))},r.prototype.renderReactTemplates=function(){},r.prototype.clearTemplate=function(e,t){},r.prototype.getUniqueID=function(e){return this.isHistoryChanged()&&(Cr=0),wr=this.pageID(location.href),Tr=history.length,e+"_"+wr+"_"+Cr++},r.prototype.pageID=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return Math.abs(t)},r.prototype.isHistoryChanged=function(){return wr!==this.pageID(location.href)||Tr!==history.length},r.prototype.addOnPersist=function(e){for(var t=this,r={},n=0,a=e;n<a.length;n++){var s=a[n],l=void 0;h(l=i(s,this))||o(s,this.getActualProperties(l),r)}return JSON.stringify(r,function(e,r){return t.getActualProperties(r)})},r.prototype.getActualProperties=function(e){return e instanceof Pr?i("properties",e):e},r.prototype.ignoreOnPersist=function(e){return JSON.stringify(this.iterateJsonProperties(this.properties,e))},r.prototype.iterateJsonProperties=function(e,t){for(var r={},n=this,i=0,o=Object.keys(e);i<o.length;i++)!function(i){if(-1===t.indexOf(i)){var o=e[i];if("object"!=typeof o||o instanceof Array)r[i]=o;else{var a=t.filter(function(e){return new RegExp(i+".").test(e)}).map(function(e){return e.replace(i+".","")});r[i]=n.iterateJsonProperties(n.getActualProperties(o),a)}}}(o[i]);return r},Or([Re(!1)],r.prototype,"enablePersistence",void 0),Or([Re()],r.prototype,"enableRtl",void 0),Or([Re()],r.prototype,"locale",void 0),r=Or([Ge],r)}(yr);!function(){"undefined"!=typeof window&&window.addEventListener("popstate",function(){Cr=0})}();var xr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Fr={left:0,top:0,bottom:0,right:0},Ar={isDragged:!1},Rr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xr(t,e),Nr([Re(0)],t.prototype,"left",void 0),Nr([Re(0)],t.prototype,"top",void 0),t}(Pr),Ir=function(e){function t(t,n){var i=e.call(this,n,t)||this;return i.dragLimit=r.getDefaultPosition(),i.borderWidth=r.getDefaultPosition(),i.padding=r.getDefaultPosition(),i.diffX=0,i.prevLeft=0,i.prevTop=0,i.dragProcessStarted=!1,i.tapHoldTimer=0,i.externalInitialize=!1,i.diffY=0,i.parentScrollX=0,i.parentScrollY=0,i.droppables={},i.bind(),i}xr(t,e),r=t,t.prototype.bind=function(){this.toggleEvents(),xt.isIE&&q([this.element],"e-block-touch"),this.droppables[this.scope]={}},t.getDefaultPosition=function(){return u({},Fr)},t.prototype.toggleEvents=function(e){var t;h(this.handle)||(t=ae(this.handle,this.element));var r=this.enableTapHold&&xt.isDevice&&xt.isTouch?this.mobileInitialize:this.initialize;e?Nt.remove(t||this.element,xt.touchStartEvent,r):Nt.add(t||this.element,xt.touchStartEvent,r,this)},t.prototype.mobileInitialize=function(e){var t=this,r=e.currentTarget;this.tapHoldTimer=setTimeout(function(){t.externalInitialize=!0,t.removeTapholdTimer(),t.initialize(e,r)},this.tapHoldThreshold),Nt.add(document,xt.touchMoveEvent,this.removeTapholdTimer,this),Nt.add(document,xt.touchEndEvent,this.removeTapholdTimer,this)},t.prototype.removeTapholdTimer=function(){clearTimeout(this.tapHoldTimer),Nt.remove(document,xt.touchMoveEvent,this.removeTapholdTimer),Nt.remove(document,xt.touchEndEvent,this.removeTapholdTimer)},t.prototype.getScrollableParent=function(e,t){var r={vertical:"scrollHeight",horizontal:"scrollWidth"},n={vertical:"clientHeight",horizontal:"clientWidth"};return p(e)?null:e[r[t]]>e[n[t]]&&("vertical"===t?e.scrollTop>0:e.scrollLeft>0)?("vertical"===t?(this.parentScrollY=this.parentScrollY+(0===this.parentScrollY?e.scrollTop:e.scrollTop-this.parentScrollY),this.tempScrollHeight=e.scrollHeight):(this.parentScrollX=this.parentScrollX+(0===this.parentScrollX?e.scrollLeft:e.scrollLeft-this.parentScrollX),this.tempScrollWidth=e.scrollWidth),p(e)?e:this.getScrollableParent(e.parentNode,t)):this.getScrollableParent(e.parentNode,t)},t.prototype.getScrollableValues=function(){this.parentScrollX=0,this.parentScrollY=0;this.element.classList.contains("e-dialog")&&this.element.classList.contains("e-dlg-modal"),this.getScrollableParent(this.element.parentNode,"vertical"),this.getScrollableParent(this.element.parentNode,"horizontal")},t.prototype.initialize=function(e,t){if(this.currentStateTarget=e.target,!this.isDragStarted()){if(this.isDragStarted(!0),this.externalInitialize=!1,this.target=e.currentTarget||t,this.dragProcessStarted=!1,this.abort){var r=this.abort;"string"==typeof r&&(r=[r]);for(var n=0;n<r.length;n++)if(!p(ce(e.target,r[n])))return void(this.isDragStarted()&&this.isDragStarted(!0))}this.preventDefault&&!h(e.changedTouches)&&"touchstart"!==e.type&&e.preventDefault(),this.element.setAttribute("aria-grabbed","true");var i=this.getCoordinates(e);if(this.initialPosition={x:i.pageX,y:i.pageY},!this.clone){var o=this.element.getBoundingClientRect();this.getScrollableValues(),e.clientX===e.pageX&&(this.parentScrollX=0),e.clientY===e.pageY&&(this.parentScrollY=0),this.relativeXPosition=i.pageX-(o.left+this.parentScrollX),this.relativeYPosition=i.pageY-(o.top+this.parentScrollY)}this.externalInitialize?this.intDragStart(e):(Nt.add(document,xt.touchMoveEvent,this.intDragStart,this),Nt.add(document,xt.touchEndEvent,this.intDestroy,this)),this.toggleEvents(!0),"touchstart"!==e.type&&this.isPreventSelect&&document.body.classList.add("e-prevent-select"),this.externalInitialize=!1,Nt.trigger(document.documentElement,xt.touchStartEvent,e)}},t.prototype.intDragStart=function(e){this.removeTapholdTimer();var t=!h(e.changedTouches);if(!t||1===e.changedTouches.length){t&&e.preventDefault();var r,n=this.getCoordinates(e),i=getComputedStyle(this.element);this.margin={left:parseInt(i.marginLeft,10),top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10)};var o=this.element;if(this.clone&&this.dragTarget){var a=ce(e.target,this.dragTarget);p(a)||(o=a)}this.isReplaceDragEle&&(o=this.currentStateCheck(e.target,o)),this.offset=this.calculateParentPosition(o),this.position=this.getMousePosition(e,this.isDragScroll);var s=this.initialPosition.x-n.pageX,l=this.initialPosition.y-n.pageY;if(Math.sqrt(s*s+l*l)>=this.distance||this.externalInitialize){var c=this.getHelperElement(e);if(!c||p(c))return;var u=this.helperElement=c;if(this.parentClientRect=this.calculateParentPosition(u.offsetParent),this.dragStart){var d={event:e,element:o,target:this.getProperTargetElement(e),bindEvents:w()?this.bindDragEvents.bind(this):null,dragElement:u};this.trigger("dragStart",d)}this.dragArea?this.setDragArea():(this.dragLimit={left:0,right:0,bottom:0,top:0},this.borderWidth={top:0,left:0}),r={left:this.position.left-this.parentClientRect.left,top:this.position.top-this.parentClientRect.top},this.clone&&!this.enableTailMode&&(this.diffX=this.position.left-this.offset.left,this.diffY=this.position.top-this.offset.top),this.getScrollableValues();var m=getComputedStyle(o),f=parseFloat(m.marginTop);this.clone&&0!==f&&(r.top+=f);var g=this.getProcessedPositionValue({top:r.top-this.diffY+"px",left:r.left-this.diffX+"px"});this.dragElePosition={top:r.top,left:r.left},he(u,this.getDragPosition({position:"absolute",left:g.left,top:g.top})),Nt.remove(document,xt.touchMoveEvent,this.intDragStart),Nt.remove(document,xt.touchEndEvent,this.intDestroy),w()||this.bindDragEvents(u)}}},t.prototype.bindDragEvents=function(e){Q(e)?(Nt.add(document,xt.touchMoveEvent,this.intDrag,this),Nt.add(document,xt.touchEndEvent,this.intDragStop,this),this.setGlobalDroppables(!1,this.element,e)):(this.toggleEvents(),document.body.classList.remove("e-prevent-select"))},t.prototype.elementInViewport=function(e){for(this.top=e.offsetTop,this.left=e.offsetLeft,this.width=e.offsetWidth,this.height=e.offsetHeight;e.offsetParent;)e=e.offsetParent,this.top+=e.offsetTop,this.left+=e.offsetLeft;return this.top>=window.pageYOffset&&this.left>=window.pageXOffset&&this.top+this.height<=window.pageYOffset+window.innerHeight&&this.left+this.width<=window.pageXOffset+window.innerWidth},t.prototype.getProcessedPositionValue=function(e){return this.queryPositionInfo?this.queryPositionInfo(e):e},t.prototype.calculateParentPosition=function(e){if(p(e))return{left:0,top:0};var t=e.getBoundingClientRect(),r=getComputedStyle(e);return{left:t.left+window.pageXOffset-parseInt(r.marginLeft,10),top:t.top+window.pageYOffset-parseInt(r.marginTop,10)}},t.prototype.intDrag=function(e){if(h(e.changedTouches)||1===e.changedTouches.length){var t,r;this.position=this.getMousePosition(e,this.isDragScroll);var n=this.getDocumentWidthHeight("Height");n<this.position.top&&(this.position.top=n);var i=this.getDocumentWidthHeight("Width");if(i<this.position.left&&(this.position.left=i),this.drag){var o=this.getProperTargetElement(e);this.trigger("drag",{event:e,element:this.element,target:o})}var a=this.checkTargetElement(e);if(a.target&&a.instance){var s=!0;this.hoverObject&&(this.hoverObject.instance!==a.instance?this.triggerOutFunction(e,a):s=!1),s&&(a.instance.dragData[this.scope]=this.droppables[this.scope],a.instance.intOver(e,a.target),this.hoverObject=a)}else this.hoverObject&&this.triggerOutFunction(e,a);var l=this.droppables[this.scope].helper;this.parentClientRect=this.calculateParentPosition(this.helperElement.offsetParent);var c=this.parentClientRect.left,u=this.parentClientRect.top,d=this.getCoordinates(e),m=d.pageX,f=d.pageY,g=this.position.left-this.diffX,v=this.position.top-this.diffY,y=getComputedStyle(l),b=parseFloat(y.marginTop);if(this.dragArea){if(this.pageX!==m||this.skipDistanceCheck){var M=l.offsetWidth+(parseFloat(y.marginLeft)+parseFloat(y.marginRight));t=this.dragLimit.left>g&&g>0?this.dragLimit.left:this.dragLimit.right+window.pageXOffset<g+M&&g>0?g-(g-this.dragLimit.right)+window.pageXOffset-M:g<0?this.dragLimit.left:g}if(this.pageY!==f||this.skipDistanceCheck){var D=l.offsetHeight+(parseFloat(y.marginTop)+parseFloat(y.marginBottom));r=this.dragLimit.top>v&&v>0?this.dragLimit.top:this.dragLimit.bottom+window.pageYOffset<v+D&&v>0?v-(v-this.dragLimit.bottom)+window.pageYOffset-D:v<0?this.dragLimit.top:v}}else t=g,r=v;var w=u+this.borderWidth.top,E=c+this.borderWidth.left;this.dragProcessStarted&&(p(r)&&(r=this.prevTop),p(t)&&(t=this.prevLeft));var P,S;if(this.dragArea){if(this.dragLimit.top=this.clone?this.dragLimit.top:0,P=r-w<0?this.dragLimit.top:r-w,S=t-E<0?this.dragElePosition.left:t-E,b>0&&(this.clone&&(P+=this.element.offsetTop,v<0&&(this.element.offsetTop+v>=0?P=this.element.offsetTop+v:P-=this.element.offsetTop),P=this.dragLimit.bottom<P?this.dragLimit.bottom:P),r-w<0))if(v+b+(l.offsetHeight-w)>=0){var O=this.dragLimit.top+v-w;O+b+w<0?P-=b+w:P=O}else P-=b+w}else P=r-w,S=t-E;var C=this.getProcessedPositionValue({top:P+"px",left:S+"px"});he(l,this.getDragPosition(C)),!this.elementInViewport(l)&&this.enableAutoScroll&&this.helperElement.scrollIntoView(),this.dragProcessStarted=!0,this.prevLeft=t,this.prevTop=r,this.position.left=t,this.position.top=r,this.pageX=m,this.pageY=f}},t.prototype.triggerOutFunction=function(e,t){this.hoverObject.instance.intOut(e,t.target),this.hoverObject.instance.dragData[this.scope]=null,this.hoverObject=null},t.prototype.getDragPosition=function(e){var t=u({},e);return this.axis&&("x"===this.axis?delete t.top:"y"===this.axis&&delete t.left),t},t.prototype.getDocumentWidthHeight=function(e){var t=document.body,r=document.documentElement;return Math.max(t["scroll"+e],r["scroll"+e],t["offset"+e],r["offset"+e],r["client"+e])},t.prototype.intDragStop=function(e){if(this.dragProcessStarted=!1,h(e.changedTouches)||1===e.changedTouches.length){if(-1!==["touchend","pointerup","mouseup"].indexOf(e.type)){if(this.dragStop){var t=this.getProperTargetElement(e);this.trigger("dragStop",{event:e,element:this.element,target:t,helper:this.helperElement})}this.intDestroy(e)}else this.element.setAttribute("aria-grabbed","false");var r=this.checkTargetElement(e);r.target&&r.instance&&(r.instance.dragStopCalled=!0,r.instance.dragData[this.scope]=this.droppables[this.scope],r.instance.intDrop(e,r.target)),this.setGlobalDroppables(!0),document.body.classList.remove("e-prevent-select")}},t.prototype.intDestroy=function(e){this.dragProcessStarted=!1,this.toggleEvents(),document.body.classList.remove("e-prevent-select"),this.element.setAttribute("aria-grabbed","false"),Nt.remove(document,xt.touchMoveEvent,this.intDragStart),Nt.remove(document,xt.touchEndEvent,this.intDragStop),Nt.remove(document,xt.touchEndEvent,this.intDestroy),Nt.remove(document,xt.touchMoveEvent,this.intDrag),this.isDragStarted()&&this.isDragStarted(!0)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"draggable"},t.prototype.isDragStarted=function(e){return e&&(Ar.isDragged=!Ar.isDragged),Ar.isDragged},t.prototype.setDragArea=function(){var e,t,r,n=0,i=0;if(r="string"===typeof this.dragArea?ae(this.dragArea):this.dragArea){var o=r.getBoundingClientRect();e=r.scrollWidth?r.scrollWidth:o.right-o.left,t=r.scrollHeight?r.scrollHeight:o.bottom-o.top;for(var a=["Top","Left","Bottom","Right"],s=getComputedStyle(r),l=0;l<a.length;l++){var c=a[l],u=s["border"+c+"Width"],p=s["padding"+c],h=c.toLowerCase();this.borderWidth[h]=isNaN(parseFloat(u))?0:parseFloat(u),this.padding[h]=isNaN(parseFloat(p))?0:parseFloat(p)}n=o.top,i=o.left,this.dragLimit.left=i+this.borderWidth.left+this.padding.left,this.dragLimit.top=r.offsetTop+this.borderWidth.top+this.padding.top,this.dragLimit.right=i+e-(this.borderWidth.right+this.padding.right),this.dragLimit.bottom=n+t-(this.borderWidth.bottom+this.padding.bottom)}},t.prototype.getProperTargetElement=function(e){var t,r=this.getCoordinates(e),n=this.helperElement.style.pointerEvents||"";return v(e.target,this.helperElement)||-1!==e.type.indexOf("touch")?(this.helperElement.style.pointerEvents="none",t=document.elementFromPoint(r.clientX,r.clientY),this.helperElement.style.pointerEvents=n):t=e.target,t},t.prototype.currentStateCheck=function(e,t){return p(this.currentStateTarget)||this.currentStateTarget===e?p(t)?e:t:this.currentStateTarget},t.prototype.getMousePosition=function(e,t){var r,n,i=void 0!==e.srcElement?e.srcElement:e.target,o=this.getCoordinates(e),a=p(i.offsetParent);return t?(r=this.clone?o.pageX:o.pageX+(a?0:i.offsetParent.scrollLeft)-this.relativeXPosition,n=this.clone?o.pageY:o.pageY+(a?0:i.offsetParent.scrollTop)-this.relativeYPosition):(r=this.clone?o.pageX:o.pageX+window.pageXOffset-this.relativeXPosition,n=this.clone?o.pageY:o.pageY+window.pageYOffset-this.relativeYPosition),!this.clone&&this.dragArea&&(this.getScrollableValues(),n-=this.tempScrollHeight?this.parentScrollY:0,r-=this.tempScrollWidth?this.parentScrollX:0),{left:r-(this.margin.left+this.cursorAt.left),top:n-(this.margin.top+this.cursorAt.top)}},t.prototype.getCoordinates=function(e){return e.type.indexOf("touch")>-1?e.changedTouches[0]:e},t.prototype.getHelperElement=function(e){var t;return this.clone?this.helper?t=this.helper({sender:e,element:this.target}):(t=K("div",{className:"e-drag-helper e-block-touch",innerHTML:"Draggable"}),document.body.appendChild(t)):t=this.element,t},t.prototype.setGlobalDroppables=function(e,t,r){this.droppables[this.scope]=e?null:{draggable:t,helper:r,draggedElement:this.element}},t.prototype.checkTargetElement=function(e){var t=this.getProperTargetElement(e),r=this.getDropInstance(t);if(!r&&t&&!p(t.parentNode)){var n=ce(t.parentNode,".e-droppable")||t.parentElement;n&&(r=this.getDropInstance(n))}return{target:t,instance:r}},t.prototype.getDropInstance=function(e){var t,r=e&&e.ej2_instances;if(r)for(var n=0,i=r;n<i.length;n++){var o=i[n];if("droppable"===o.getModuleName()){t=o;break}}return t},t.prototype.destroy=function(){this.toggleEvents(!0),e.prototype.destroy.call(this)};var r;return Nr([Ie({},Rr)],t.prototype,"cursorAt",void 0),Nr([Re(!0)],t.prototype,"clone",void 0),Nr([Re()],t.prototype,"dragArea",void 0),Nr([Re()],t.prototype,"isDragScroll",void 0),Nr([Re()],t.prototype,"isReplaceDragEle",void 0),Nr([Re(!0)],t.prototype,"isPreventSelect",void 0),Nr([Be()],t.prototype,"drag",void 0),Nr([Be()],t.prototype,"dragStart",void 0),Nr([Be()],t.prototype,"dragStop",void 0),Nr([Re(1)],t.prototype,"distance",void 0),Nr([Re()],t.prototype,"handle",void 0),Nr([Re()],t.prototype,"abort",void 0),Nr([Re()],t.prototype,"helper",void 0),Nr([Re("default")],t.prototype,"scope",void 0),Nr([Re("")],t.prototype,"dragTarget",void 0),Nr([Re()],t.prototype,"axis",void 0),Nr([Re()],t.prototype,"queryPositionInfo",void 0),Nr([Re(!1)],t.prototype,"enableTailMode",void 0),Nr([Re(!1)],t.prototype,"skipDistanceCheck",void 0),Nr([Re(!0)],t.prototype,"preventDefault",void 0),Nr([Re(!1)],t.prototype,"enableAutoScroll",void 0),Nr([Re(!1)],t.prototype,"enableTapHold",void 0),Nr([Re(750)],t.prototype,"tapHoldThreshold",void 0),t=r=Nr([Ge],t)}(yr),Hr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},kr=function(e){function t(t,r){var n=e.call(this,r,t)||this;return n.mouseOver=!1,n.dragData={},n.dragStopCalled=!1,n.bind(),n}return Hr(t,e),t.prototype.bind=function(){this.wireEvents()},t.prototype.wireEvents=function(){Nt.add(this.element,xt.touchEndEvent,this.intDrop,this)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"droppable"},t.prototype.intOver=function(e,t){if(!this.mouseOver){var r=this.dragData[this.scope];this.trigger("over",{event:e,target:t,dragData:r}),this.mouseOver=!0}},t.prototype.intOut=function(e,t){this.mouseOver&&(this.trigger("out",{evt:e,target:t}),this.mouseOver=!1)},t.prototype.intDrop=function(e,t){if(this.dragStopCalled){this.dragStopCalled=!1;var r,n=!0,i=this.dragData[this.scope],o=!!i&&(i.helper&&Q(i.helper));o&&(r=this.isDropArea(e,i.helper,t),this.accept&&(n=me(i.helper,this.accept))),o&&this.drop&&r.canDrop&&n&&this.trigger("drop",{event:e,target:r.target,droppedElement:i.helper,dragData:i}),this.mouseOver=!1}},t.prototype.isDropArea=function(e,t,r){var n={canDrop:!0,target:r||e.target},i="touchend"===e.type;if(i||n.target===t){t.style.display="none";var o=i?e.changedTouches[0]:e,a=document.elementFromPoint(o.clientX,o.clientY);n.canDrop=!1,n.canDrop=v(a,this.element),n.canDrop&&(n.target=a),t.style.display=""}return n},t.prototype.destroy=function(){Nt.remove(this.element,xt.touchEndEvent,this.intDrop),e.prototype.destroy.call(this)},Lr([Re()],t.prototype,"accept",void 0),Lr([Re("default")],t.prototype,"scope",void 0),Lr([Be()],t.prototype,"drop",void 0),Lr([Be()],t.prototype,"over",void 0),Lr([Be()],t.prototype,"out",void 0),t=Lr([Ge],t)}(yr),Br=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},zr={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,space:32,escape:27,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,semicolon:186,plus:187,comma:188,minus:189,dot:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},Yr=function(e){function t(t,n){var i=e.call(this,n,t)||this;return i.keyPressHandler=function(e){for(var t=e.altKey,n=e.ctrlKey,o=e.shiftKey,a=e.which,s=0,l=Object.keys(i.keyConfigs);s<l.length;s++)for(var c=l[s],u=0,p=i.keyConfigs[c].split(",");u<p.length;u++){var h=p[u],d=r.getKeyConfigData(h.trim());t===d.altKey&&n===d.ctrlKey&&o===d.shiftKey&&a===d.keyCode&&(e.action=c,i.keyAction&&i.keyAction(e))}},i.bind(),i}Br(t,e),r=t,t.prototype.destroy=function(){this.unwireEvents(),e.prototype.destroy.call(this)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.bind=function(){this.wireEvents()},t.prototype.getModuleName=function(){return"keyboard"},t.prototype.wireEvents=function(){this.element.addEventListener(this.eventName,this.keyPressHandler)},t.prototype.unwireEvents=function(){this.element.removeEventListener(this.eventName,this.keyPressHandler)},t.getKeyConfigData=function(e){if(e in this.configCache)return this.configCache[e];var t=e.toLowerCase().split("+"),n={altKey:-1!==t.indexOf("alt"),ctrlKey:-1!==t.indexOf("ctrl"),shiftKey:-1!==t.indexOf("shift"),keyCode:null};return t[t.length-1].length>1&&Number(t[t.length-1])?n.keyCode=Number(t[t.length-1]):n.keyCode=r.getKeyCode(t[t.length-1]),r.configCache[e]=n,n},t.getKeyCode=function(e){return zr[e]||e.toUpperCase().charCodeAt(0)};var r;return t.configCache={},Gr([Re({})],t.prototype,"keyConfigs",void 0),Gr([Re("keyup")],t.prototype,"eventName",void 0),Gr([Be()],t.prototype,"keyAction",void 0),t=r=Gr([Ge],t)}(yr),_r=function(){function t(t,r,n){this.controlName=t,this.localeStrings=r,this.setLocale(n||e.defaultCulture)}return t.prototype.setLocale=function(e){var r=this.intGetControlConstant(t.locale,e);this.currentLocale=r||this.localeStrings},t.load=function(e){this.locale=u(this.locale,e,{},!0)},t.prototype.getConstant=function(e){return p(this.currentLocale[e])?this.localeStrings[e]||"":this.currentLocale[e]},t.prototype.intGetControlConstant=function(e,t){return e[t]?e[t][this.controlName]:null},t.locale={},t}(),Xr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},$r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xr(t,e),Wr([Re(50)],t.prototype,"swipeThresholdDistance",void 0),t}(Pr),Vr=/(Up|Down)/,Ur=function(e){function t(t,r){var n=e.call(this,r,t)||this;return n.touchAction=!0,n.tapCount=0,n.startEvent=function(e){if(!0===n.touchAction){var t=n.updateChangeTouches(e);void 0!==e.changedTouches&&(n.touchAction=!1),n.isTouchMoved=!1,n.movedDirection="",n.startPoint=n.lastMovedPoint={clientX:t.clientX,clientY:t.clientY},n.startEventData=t,n.hScrollLocked=n.vScrollLocked=!1,n.tStampStart=Date.now(),n.timeOutTapHold=setTimeout(function(){n.tapHoldEvent(e)},n.tapHoldThreshold),Nt.add(n.element,xt.touchMoveEvent,n.moveEvent,n),Nt.add(n.element,xt.touchEndEvent,n.endEvent,n),Nt.add(n.element,xt.touchCancelEvent,n.cancelEvent,n)}},n.moveEvent=function(e){var t=n.updateChangeTouches(e);n.movedPoint=t,n.isTouchMoved=!(t.clientX===n.startPoint.clientX&&t.clientY===n.startPoint.clientY);var r={};n.isTouchMoved&&(clearTimeout(n.timeOutTapHold),n.calcScrollPoints(e),r=u(r,{},{startEvents:n.startEventData,originalEvent:e,startX:n.startPoint.clientX,startY:n.startPoint.clientY,distanceX:n.distanceX,distanceY:n.distanceY,scrollDirection:n.scrollDirection,velocity:n.getVelocity(t)}),n.trigger("scroll",r),n.lastMovedPoint={clientX:t.clientX,clientY:t.clientY})},n.cancelEvent=function(e){clearTimeout(n.timeOutTapHold),clearTimeout(n.timeOutTap),n.tapCount=0,n.swipeFn(e),Nt.remove(n.element,xt.touchCancelEvent,n.cancelEvent)},n.endEvent=function(e){n.swipeFn(e),n.isTouchMoved||"function"==typeof n.tap&&(n.trigger("tap",{originalEvent:e,tapCount:++n.tapCount}),n.timeOutTap=setTimeout(function(){n.tapCount=0},n.tapThreshold)),n.modeclear()},n.swipeFn=function(e){clearTimeout(n.timeOutTapHold),clearTimeout(n.timeOutTap);var t=n.updateChangeTouches(e),r=t.clientX-n.startPoint.clientX,i=t.clientY-n.startPoint.clientY;r=Math.floor(r<0?-1*r:r),i=Math.floor(i<0?-1*i:r),n.isTouchMoved=r>1||i>1,/Mozilla|Firefox/.test(xt.userAgent)&&0===t.clientX&&0===t.clientY&&"mouseup"===e.type&&(n.isTouchMoved=!1),n.endPoint=t,n.calcPoints(e);var o={originalEvent:e,startEvents:n.startEventData,startX:n.startPoint.clientX,startY:n.startPoint.clientY,distanceX:n.distanceX,distanceY:n.distanceY,swipeDirection:n.movedDirection,velocity:n.getVelocity(t)};if(n.isTouchMoved){var a=void 0,s=n.swipeSettings.swipeThresholdDistance;a=u(a,n.defaultArgs,o);var l=!1,c=n.element,p=n.isScrollable(c),h=Vr.test(n.movedDirection);(s<n.distanceX&&!h||s<n.distanceY&&h)&&(l=!p||n.checkSwipe(c,h)),l&&n.trigger("swipe",a)}n.modeclear()},n.modeclear=function(){n.modeClear=setTimeout(function(){n.touchAction=!0},"function"!=typeof n.tap?0:20),n.lastTapTime=(new Date).getTime(),Nt.remove(n.element,xt.touchMoveEvent,n.moveEvent),Nt.remove(n.element,xt.touchEndEvent,n.endEvent),Nt.remove(n.element,xt.touchCancelEvent,n.cancelEvent)},n.bind(),n}return Xr(t,e),t.prototype.onPropertyChanged=function(e,t){},t.prototype.bind=function(){this.wireEvents(),xt.isIE&&this.element.classList.add("e-block-touch")},t.prototype.destroy=function(){this.unwireEvents(),e.prototype.destroy.call(this)},t.prototype.wireEvents=function(){Nt.add(this.element,xt.touchStartEvent,this.startEvent,this)},t.prototype.unwireEvents=function(){Nt.remove(this.element,xt.touchStartEvent,this.startEvent)},t.prototype.getModuleName=function(){return"touch"},t.prototype.isScrollable=function(e){var t=getComputedStyle(e),r=t.overflow+t.overflowX+t.overflowY;return!!/(auto|scroll)/.test(r)},t.prototype.tapHoldEvent=function(e){this.tapCount=0,this.touchAction=!0;var t;Nt.remove(this.element,xt.touchMoveEvent,this.moveEvent),Nt.remove(this.element,xt.touchEndEvent,this.endEvent),t={originalEvent:e},this.trigger("tapHold",t),Nt.remove(this.element,xt.touchCancelEvent,this.cancelEvent)},t.prototype.calcPoints=function(e){var t=this.updateChangeTouches(e);this.defaultArgs={originalEvent:e},this.distanceX=Math.abs(Math.abs(t.clientX)-Math.abs(this.startPoint.clientX)),this.distanceY=Math.abs(Math.abs(t.clientY)-Math.abs(this.startPoint.clientY)),this.distanceX>this.distanceY?this.movedDirection=t.clientX>this.startPoint.clientX?"Right":"Left":this.movedDirection=t.clientY<this.startPoint.clientY?"Up":"Down"},t.prototype.calcScrollPoints=function(e){var t=this.updateChangeTouches(e);this.defaultArgs={originalEvent:e},this.distanceX=Math.abs(Math.abs(t.clientX)-Math.abs(this.lastMovedPoint.clientX)),this.distanceY=Math.abs(Math.abs(t.clientY)-Math.abs(this.lastMovedPoint.clientY)),(this.distanceX>this.distanceY||!0===this.hScrollLocked)&&!1===this.vScrollLocked?(this.scrollDirection=t.clientX>this.lastMovedPoint.clientX?"Right":"Left",this.hScrollLocked=!0):(this.scrollDirection=t.clientY<this.lastMovedPoint.clientY?"Up":"Down",this.vScrollLocked=!0)},t.prototype.getVelocity=function(e){var t=e.clientX,r=e.clientY,n=Date.now(),i=t-this.startPoint.clientX,o=r-this.startPoint.clientX,a=n-this.tStampStart;return Math.sqrt(i*i+o*o)/a},t.prototype.checkSwipe=function(e,t){var r=["scroll","offset"],n=t?["Height","Top"]:["Width","Left"];return e[r[0]+n[0]]<=e[r[1]+n[0]]||(0===e[r[0]+n[1]]||e[r[1]+n[0]]+e[r[0]+n[1]]>=e[r[0]+n[0]])},t.prototype.updateChangeTouches=function(e){return e.changedTouches&&0!==e.changedTouches.length?e.changedTouches[0]:e},Wr([Be()],t.prototype,"tap",void 0),Wr([Be()],t.prototype,"tapHold",void 0),Wr([Be()],t.prototype,"swipe",void 0),Wr([Be()],t.prototype,"scroll",void 0),Wr([Re(350)],t.prototype,"tapThreshold",void 0),Wr([Re(750)],t.prototype,"tapHoldThreshold",void 0),Wr([Ie({},$r)],t.prototype,"swipeSettings",void 0),t=Wr([Ge],t)}(yr),Kr=["script","style","iframe[src]",'link[href*="javascript:"]','object[type="text/x-scriptlet"]','object[data^="data:text/html;base64"]','img[src^="data:text/html;base64"]','[src^="javascript:"]','[dynsrc^="javascript:"]','[lowsrc^="javascript:"]','[type^="application/x-shockwave-flash"]'],qr=[{attribute:"href",selector:'[href*="javascript:"]'},{attribute:"background",selector:'[background^="javascript:"]'},{attribute:"style",selector:'[style*="javascript:"]'},{attribute:"style",selector:'[style*="expression("]'},{attribute:"href",selector:'a[href^="data:text/html;base64"]'}],Zr=["onchange","onclick","onmouseover","onmouseout","onkeydown","onload","onerror","onblur","onfocus","onbeforeload","onbeforeunload","onkeyup","onsubmit","onafterprint","onbeforeonload","onbeforeprint","onblur","oncanplay","oncanplaythrough","onchange","onclick","oncontextmenu","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onerror","onfocus","onformchange","onforminput","onhaschange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onoffline","onoine","ononline","onpagehide","onpageshow","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreadystatechange","onredo","onresize","onscroll","onseeked","onseeking","onselect","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","onundo","onunload","onvolumechange","onwaiting","onmouseenter","onmouseleave","onmousewheel","onstart","onpropertychange"],Jr=function(){function e(){}return e.beforeSanitize=function(){return{selectors:{tags:Kr,attributes:qr}}},e.sanitize=function(e){var t=this.beforeSanitize();return this.serializeValue(t,e)},e.serializeValue=function(e,t){this.removeAttrs=e.selectors.attributes,this.removeTags=e.selectors.tags,this.wrapElement=document.createElement("div"),this.wrapElement.innerHTML=t,this.removeXssTags(),this.removeJsEvents(),this.removeXssAttrs();var r=this.wrapElement.innerHTML;return this.removeElement(),r},e.removeElement=function(){for(var e=this.wrapElement.children,t=0;t<e.length;t++)for(var r=e[t].attributes,n=0;n<r.length;n++)this.wrapElement.children[t].removeAttribute(r[n].localName)},e.removeXssTags=function(){var e=this.wrapElement.querySelectorAll(this.removeTags.join(","));e.length>0&&e.forEach(function(e){ne(e)})},e.removeJsEvents=function(){var e=this.wrapElement.querySelectorAll("["+Zr.join("],[")+"]");e.length>0&&e.forEach(function(e){Zr.forEach(function(t){e.hasAttribute(t)&&e.removeAttribute(t)})})},e.removeXssAttrs=function(){var e=this;this.removeAttrs.forEach(function(t,r){var n=e.wrapElement.querySelectorAll(t.selector);n.length>0&&n.forEach(function(e){e.removeAttribute(t.attribute)})})},e}();return e.blazorCultureFormats=Pt,e.Ajax=Ct,e.Animation=Dr,e.rippleEffect=We,e.enableRipple=Ze,e.Base=yr,e.getComponent=ye,e.removeChildInstance=be,e.Browser=xt,e.enableVersionBasedPersistence=Je,e.Component=jr,e.ChildProperty=Pr,e.Position=Rr,e.Draggable=Ir,e.Droppable=kr,e.EventHandler=Nt,e.onIntlChange=Mt,e.cldrData=Dt,e.Internationalization=Et,e.setCulture=j,e.setCurrencyCode=x,e.loadCldr=N,e.enableRtl=F,e.getNumericObject=A,e.getNumberDependable=R,e.getDefaultDateObject=I,e.KeyboardEvents=Yr,e.L10n=_r,e.ModuleLoader=Er,e.Property=Re,e.Complex=Ie,e.ComplexFactory=He,e.Collection=Le,e.CollectionFactory=ke,e.Event=Be,e.NotifyPropertyChanges=Ge,e.CreateBuilder=_e,e.SwipeSettings=$r,e.Touch=Ur,e.blazorTemplates=Jt,e.getRandomId=_,e.compile=X,e.updateBlazorTemplate=W,e.resetBlazorTemplate=$,e.setTemplateEngine=V,e.getTemplateEngine=U,e.disableBlazorMode=t,e.createInstance=r,e.setImmediate=n,e.getValue=i,e.setValue=o,e.deleteObject=a,e.isObject=s,e.getEnumValue=l,e.merge=c,e.extend=u,e.isNullOrUndefined=p,e.isUndefined=h,e.getUniqueID=d,e.debounce=m,e.queryParams=f,e.isObjectArray=g,e.compareElementParent=v,e.throwError=y,e.print=b,e.formatUnit=M,e.enableBlazorMode=D,e.isBlazor=w,e.getElement=E,e.getInstance=P,e.addInstance=S,e.uniqueID=O,e.createElement=K,e.addClass=q,e.removeClass=Z,e.isVisible=Q,e.prepend=ee,e.append=te,e.detach=ne,e.remove=ie,e.attributes=oe,e.select=ae,e.selectAll=se,e.closest=ce,e.siblings=ue,e.getAttributeOrDefault=pe,e.setStyleAttribute=he,e.classList=de,e.matches=me,e.includeInnerHTML=fe,e.containsClass=ge,e.cloneNode=ve,e.Observer=bt,e.SanitizeHtmlHelper=Jr,e}({}),this.ejs=ej;
- /*!
- * filename: ej2-data.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.data=function(e,t){"use strict";var r=function(){function e(e){return this.subQuery=null,this.isChild=!1,this.distincts=[],this.queries=[],this.key="",this.fKey="","string"==typeof e?this.fromTable=e:e&&e instanceof Array&&(this.lookups=e),this.expands=[],this.sortedColumns=[],this.groupedColumns=[],this.subQuery=null,this.isChild=!1,this.params=[],this.lazyLoad=[],this}return e.prototype.setKey=function(e){return this.key=e,this},e.prototype.using=function(e){return this.dataManager=e,this},e.prototype.execute=function(e,t,r,n){return e=e||this.dataManager,e?e.executeQuery(this,t,r,n):a.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.executeLocal=function(e){return e=e||this.dataManager,e?e.executeLocal(this):a.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.clone=function(){var t=new e;return t.queries=this.queries.slice(0),t.key=this.key,t.isChild=this.isChild,t.dataManager=this.dataManager,t.fromTable=this.fromTable,t.params=this.params.slice(0),t.expands=this.expands.slice(0),t.sortedColumns=this.sortedColumns.slice(0),t.groupedColumns=this.groupedColumns.slice(0),t.subQuerySelector=this.subQuerySelector,t.subQuery=this.subQuery,t.fKey=this.fKey,t.isCountRequired=this.isCountRequired,t.distincts=this.distincts.slice(0),t.lazyLoad=this.lazyLoad.slice(0),t},e.prototype.from=function(e){return this.fromTable=e,this},e.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},e.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.where=function(e,t,r,o,a){t=t?t.toLowerCase():null;var s=null;return"string"==typeof e?s=new n(e,t,r,o,a):e instanceof n&&(s=e),this.queries.push({fn:"onWhere",e:s}),this},e.prototype.search=function(e,t,r,n,o){"string"==typeof t&&(t=[t]),r&&"none"!==r||(r="contains");var s=a.fnOperators[r];return this.queries.push({fn:"onSearch",e:{fieldNames:t,operator:r,searchKey:e,ignoreCase:n,ignoreAccent:o,comparer:s}}),this},e.prototype.sortBy=function(e,t,r){return this.sortByForeignKey(e,t,r)},e.prototype.sortByForeignKey=function(r,n,o,s){var i,u,c=t.isNullOrUndefined(s)?"ascending":s;if("string"==typeof r&&a.endsWith(r.toLowerCase()," desc")&&(r=r.replace(/ desc$/i,""),n="descending"),n&&"string"!=typeof n||(c=n?n.toLowerCase():"ascending",n=a.fnSort(n)),o){i=e.filterQueries(this.queries,"onSortBy");for(var l=0;l<i.length;l++)if("string"==typeof(u=i[l].e.fieldName)){if(u===r)return this}else if(u instanceof Array)for(var p=0;p<u.length;p++)if(u[p]===r||r.toLowerCase()===u[p]+" desc")return this}return this.queries.push({fn:"onSortBy",e:{fieldName:r,comparer:n,direction:c}}),this},e.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},e.prototype.group=function(e,t,r){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:r||null}}),this},e.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},e.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},e.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},e.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},e.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},e.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},e.prototype.foreignKey=function(e){return this.fKey=e,this},e.prototype.requiresCount=function(){return this.isCountRequired=!0,this},e.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},e.filterQueries=function(e,t){return e.filter(function(e){return e.fn===t})},e.filterQueryLists=function(e,t){for(var r=e.filter(function(e){return-1!==t.indexOf(e.fn)}),n={},o=0;o<r.length;o++)n[r[o].fn]||(n[r[o].fn]=r[o].e);return n},e}(),n=function(){function e(t,r,n,o,s){return void 0===o&&(o=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof t?(this.field=t,this.operator=r.toLowerCase(),this.value=n,this.ignoreCase=o,this.ignoreAccent=s,this.isComplex=!1,this.comparer=a.fnOperators.processOperator(this.operator)):(t instanceof e&&n instanceof e||n instanceof Array)&&(this.isComplex=!0,this.condition=r.toLowerCase(),this.predicates=[t],n instanceof Array?[].push.apply(this.predicates,n):this.predicates.push(n)),this}return e.and=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"and")},e.prototype.and=function(t,r,n,o,a){return e.combine(this,t,r,n,"and",o,a)},e.or=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"or")},e.prototype.or=function(t,r,n,o,a){return e.combine(this,t,r,n,"or",o,a)},e.fromJson=function(e){if(e instanceof Array){for(var t=[],r=0,n=e.length;r<n;r++)t.push(this.fromJSONData(e[r]));return t}var o=e;return this.fromJSONData(o)},e.prototype.validate=function(e){var t,r,n=this.predicates?this.predicates:[];if(!this.isComplex&&this.comparer)return this.comparer.call(this,a.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);t="and"===this.condition;for(var o=0;o<n.length;o++)if(r=n[o].validate(e),t){if(!r)return!1}else if(r)return!0;return t},e.prototype.toJson=function(){var e,t;if(this.isComplex){e=[],t=this.predicates;for(var r=0;r<t.length;r++)e.push(t[r].toJson())}return{isComplex:this.isComplex,field:this.field,operator:this.operator,value:this.value,ignoreCase:this.ignoreCase,ignoreAccent:this.ignoreAccent,condition:this.condition,predicates:e}},e.combinePredicates=function(t,r){if(1===t.length){if(!(t[0]instanceof Array))return t[0];t=t[0]}return new e(t[0],r,t.slice(1))},e.combine=function(t,r,n,o,s,i,u){return r instanceof e?e[s](t,r):"string"==typeof r?e[s](t,new e(r,n,o,i,u)):a.throwError("Predicate - "+s+" : invalid arguments")},e.fromJSONData=function(t){for(var r=t.predicates||[],n=r.length,o=[],a=0;a<n;a++)o.push(this.fromJSONData(r[a]));return t.isComplex?new e(o[0],t.condition,o.slice(1)):new e(t.field,t.operator,t.value,t.ignoreCase,t.ignoreAccent)},e}(),o={GroupGuid:"{271bbba0-1ee7}"},a=function(){function e(){}return e.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},e.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},e.startsWith=function(e,t){return e.slice(0,t.length)===t},e.fnSort=function(t){return t=t?e.toLowerCase(t):"ascending","ascending"===t?this.fnAscending:this.fnDescending},e.fnAscending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?-1:"string"==typeof e?e.localeCompare(r):null===e||void 0===e?1:e-r},e.fnDescending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?1:"string"==typeof e?-1*e.localeCompare(r):null===e||void 0===e?-1:r-e},e.extractFields=function(e,t){for(var r={},n=0;n<t.length;n++)r=this.setValue(t[n],this.getObject(t[n],e),r);return r},e.select=function(e,t){for(var r=[],n=0;n<e.length;n++)r.push(this.extractFields(e[n],t));return r},e.group=function(r,n,a,s,i,u,c){s=s||1;var l=r;if(l.GroupGuid===o.GroupGuid){for(var p=this,d=0;d<l.length;d++)!function(e){if(t.isNullOrUndefined(i))l[e].items=p.group(l[e].items,n,a,l.level+1,null,u,c),l[e].count=l[e].items.length;else{var r=-1,o=i.filter(function(t){return t.key===l[e].key});r=i.indexOf(o[0]),l[e].items=p.group(l[e].items,n,a,l.level+1,i[r].items,u,c),l[e].count=i[r].count}}(d);return l.childLevels+=1,l}var h={},f=[];f.GroupGuid=o.GroupGuid,f.level=s,f.childLevels=0,f.records=l;for(var g=this,y=0;y<l.length;y++)!function(e){var r=g.getVal(l,e,n);if(t.isNullOrUndefined(u)||(r=u(r,n)),!h[r]&&(h[r]={key:r,count:0,items:[],aggregates:{},field:n},f.push(h[r]),!t.isNullOrUndefined(i))){var o=i.filter(function(e){return e.key===h[r].key});h[r].count=o[0].count}h[r].count=t.isNullOrUndefined(i)?h[r].count+=1:h[r].count,(!c||c&&a.length)&&h[r].items.push(l[e])}(y);if(a&&a.length)for(y=0;y<f.length;y++)!function(r){for(var n={},o=void 0,s=a,u=0;u<a.length;u++)if(o=e.aggregates[a[u].type],t.isNullOrUndefined(i))o&&(n[s[u].field+" - "+s[u].type]=o(f[r].items,s[u].field));else{var c=i.filter(function(e){return e.key===f[r].key});o&&(n[s[u].field+" - "+s[u].type]=o(c[0].items,s[u].field))}f[r].aggregates=n}(y);if(c&&f.length&&a.length)for(y=0;y<f.length;y++)f[y].items=[];return l.length&&f||l},e.buildHierarchy=function(e,t,r,n,o){var a,s={};for(n.result&&(n=n.result),n.GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),a=0;a<n.length;a++)(s[i=this.getObject(e,n[a])]||(s[i]=[])).push(n[a]);for(a=0;a<r.length;a++){var i=this.getObject(o||e,r[a]);r[a][t]=s[i]}},e.getFieldList=function(e,t,r){if(void 0===r&&(r=""),void 0===t||null===t)return this.getFieldList(e,[],r);for(var n=e,o=0,a=Object.keys(e);o<a.length;o++){var s=a[o];"object"!=typeof n[s]||n[s]instanceof Array?t.push(r+s):this.getFieldList(n[s],t,r+s+".")}return t},e.getObject=function(e,t){if(!e)return t;if(t){if(-1===e.indexOf("."))return t[e];for(var r=t,n=e.split("."),o=0;o<n.length&&null!=r;o++)r=r[n[o]];return r}},e.setValue=function(e,r,n){var o,a,s=e.toString().split("."),i=n||{},u=i,c=s.length;for(o=0;o<c;o++)a=s[o],o+1===c?u[a]=void 0===r?void 0:r:t.isNullOrUndefined(u[a])&&(u[a]={}),u=u[a];return i},e.sort=function(e,t,r){if(e.length<=1)return e;var n=parseInt((e.length/2).toString(),10),o=e.slice(0,n),a=e.slice(n);return o=this.sort(o,t,r),a=this.sort(a,t,r),this.merge(o,a,t,r)},e.ignoreDiacritics=function(t){return"string"!=typeof t?t:t.split("").map(function(t){return t in e.diacritics?e.diacritics[t]:t}).join("")},e.merge=function(e,t,r,n){for(var o,a=[];e.length>0||t.length>0;)o=e.length>0&&t.length>0?n?n(this.getVal(e,0,r),this.getVal(t,0,r),e[0],t[0])<=0?e:t:e[0][r]<e[0][r]?e:t:e.length>0?e:t,a.push(o.shift());return a},e.getVal=function(e,t,r){return r?this.getObject(r,e[t]):e[t]},e.toLowerCase=function(e){return e?"string"==typeof e?e.toLowerCase():e.toString():0===e||!1===e?e.toString():""},e.callAdaptorFunction=function(e,r,n,o){if(r in e){var a=e[r](n,o);t.isNullOrUndefined(a)||(n=a)}return n},e.getAddParams=function(t,r,n){var o={};return e.callAdaptorFunction(t,"addParams",{dm:r,query:n,params:n.params,reqParams:o}),o},e.isPlainObject=function(e){return!!e&&e.constructor===Object},e.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},e.getGuid=function(e){var t;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,function(e,r){if("crypto"in window&&"getRandomValues"in crypto){var n=new Uint8Array(1);window.crypto.getRandomValues(n),t=n[0]%16|0}else t=16*Math.random()|0;return"0123456789abcdef"[19===r?3&t|8:t]})},e.isNull=function(e){return void 0===e||null===e},e.getItemFromComparer=function(r,n,o){var a,s,i,u=0,c="string"==typeof e.getVal(r,0,n);if(r.length)for(;t.isNullOrUndefined(a)&&u<r.length;)a=e.getVal(r,u,n),i=r[u++];for(;u<r.length;u++)s=e.getVal(r,u,n),t.isNullOrUndefined(s)||(c&&(a=+a,s=+s),o(a,s)>0&&(a=s,i=r[u]));return i},e.distinct=function(r,n,o){o=!t.isNullOrUndefined(o)&&o;var a,s=[],i={};return r.forEach(function(t,u){(a="object"==typeof r[u]?e.getVal(r,u,n):r[u])in i||(s.push(o?r[u]:a),i[a]=1)}),s},e.serverTimezoneOffset=null,e.timeZoneHandling=!0,e.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},e.aggregates={sum:function(t,r){for(var n,o=0,a="number"!=typeof e.getVal(t,0,r),s=0;s<t.length;s++)n=e.getVal(t,s,r),isNaN(n)||null===n||(a&&(n=+n),o+=n);return o},average:function(t,r){return e.aggregates.sum(t,r)/t.length},min:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnAscending))},max:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnDescending))},truecount:function(e,t){return new m(e).executeLocal((new r).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new m(e).executeLocal((new r).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},e.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},e.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},e.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof"},e.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains"},e.diacritics={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e.fnOperators={equal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?e.toLowerCase(t)===e.toLowerCase(r):t===r},notequal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),!e.fnOperators.equal(t,r,n)},lessthan:function(t,r,n){return n?e.toLowerCase(t)<e.toLowerCase(r):t<r},greaterthan:function(t,r,n){return n?e.toLowerCase(t)>e.toLowerCase(r):t>r},lessthanorequal:function(t,r,n){return n?e.toLowerCase(t)<=e.toLowerCase(r):t<=r},greaterthanorequal:function(t,r,n){return n?e.toLowerCase(t)>=e.toLowerCase(r):t>=r},contains:function(r,n,o,a){return a&&(r=e.ignoreDiacritics(r),n=e.ignoreDiacritics(n)),o?!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==e.toLowerCase(r).indexOf(e.toLowerCase(n)):!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==r.toString().indexOf(n)},notnull:function(e){return null!==e},isnull:function(e){return null===e},startswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.startsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.startsWith(t,r)},endswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.endsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.endsWith(t,r)},processSymbols:function(t){var r=e.operatorSymbols[t];return r?e.fnOperators[r]:e.throwError("Query - Process Operator : Invalid operator")},processOperator:function(t){var r=e.fnOperators[t];return r||e.fnOperators.processSymbols(t)}},e.parse={parseJson:function(t){return"string"==typeof t?t=JSON.parse(t,e.parse.jsonReviver):t instanceof Array?e.parse.iterateAndReviveArray(t):"object"==typeof t&&null!==t&&e.parse.iterateAndReviveJson(t),t},iterateAndReviveArray:function(t){for(var r=0;r<t.length;r++)"object"==typeof t[r]&&null!==t[r]?e.parse.iterateAndReviveJson(t[r]):"string"!=typeof t[r]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(t[r])?t[r]=e.parse.parseJson(t[r]):t[r]=e.parse.jsonReviver("",t[r])},iterateAndReviveJson:function(t){for(var r,n=0,o=Object.keys(t);n<o.length;n++){var a=o[n];e.startsWith(a,"__")||("object"==typeof(r=t[a])?r instanceof Array?e.parse.iterateAndReviveArray(r):r&&e.parse.iterateAndReviveJson(r):t[a]=e.parse.jsonReviver(t[a],r))}},jsonReviver:function(t,r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r),o=e.timeZoneHandling?e.serverTimezoneOffset:null;if(n)return e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),o,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var a=r.indexOf("Z")>-1||r.indexOf("z")>-1,s=r.split(/[^0-9.]/);if(a)r=e.dateParse.toTimeZone(new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),e.serverTimezoneOffset,!1);else{var i=new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),u=parseInt(s[6],10),c=parseInt(s[7],10);if(isNaN(u)&&isNaN(c))return i;r.indexOf("+")>-1?i.setHours(i.getHours()-u,i.getMinutes()-c):i.setHours(i.getHours()+u,i.getMinutes()+c),r=e.dateParse.toTimeZone(i,e.serverTimezoneOffset,!1)}null==e.serverTimezoneOffset&&(r=e.dateParse.addSelfOffset(r))}}return r},isJson:function(t){return"string"==typeof t[0]?t:e.parse.parseJson(t)},isGuid:function(e){return null!=/[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i.exec(e)},replacer:function(t,r){return e.isPlainObject(t)?e.parse.jsonReplacer(t,r):t instanceof Array?e.parse.arrayReplacer(t):t instanceof Date?e.parse.jsonReplacer({val:t},r).val:t},jsonReplacer:function(t,r){for(var n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o];if((n=t[s])instanceof Date){var i=n;null==e.serverTimezoneOffset?t[s]=e.dateParse.toTimeZone(i,null).toJSON():(i=new Date(+i+36e5*e.serverTimezoneOffset),t[s]=e.dateParse.toTimeZone(e.dateParse.addSelfOffset(i),null).toJSON())}}return t},arrayReplacer:function(t){for(var r=0;r<t.length;r++)e.isPlainObject(t[r])?t[r]=e.parse.jsonReplacer(t[r]):t[r]instanceof Date&&(t[r]=e.parse.jsonReplacer({date:t[r]}).date);return t},jsonDateReplacer:function(t,r){if("value"===t&&r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r);if(n)r=e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),null,!0);else if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var o=r.split(/[^0-9]/);r=e.dateParse.toTimeZone(new Date(parseInt(o[0],10),parseInt(o[1],10)-1,parseInt(o[2],10),parseInt(o[3],10),parseInt(o[4],10),parseInt(o[5],10)),null,!0)}}if(r instanceof Date)return r=e.dateParse.addSelfOffset(r),null===e.serverTimezoneOffset?e.dateParse.toTimeZone(e.dateParse.addSelfOffset(r),null).toJSON():(r=e.dateParse.toTimeZone(r,r.getTimezoneOffset()/60*2-e.serverTimezoneOffset,!1)).toJSON()}return r}},e.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(t,r,n){if(null===r)return t;var o=n?e.dateParse.toUTC(t):t;return new Date(+o-36e5*r)},toLocalTime:function(e){var t=e,r=-t.getTimezoneOffset(),n=r>=0?"+":"-",o=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return t.getFullYear()+"-"+o(t.getMonth()+1)+"-"+o(t.getDate())+"T"+o(t.getHours())+":"+o(t.getMinutes())+":"+o(t.getSeconds())+n+o(r/60)+":"+o(r%60)}},e}(),s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i={GroupGuid:"{271bbba0-1ee7}"},u=function(){function e(t){this.options={from:"table",requestType:"json",sortBy:"sorted",select:"select",skip:"skip",group:"group",take:"take",search:"search",count:"requiresCounts",where:"where",aggregates:"aggregates",expand:"expand"},this.type=e,this.dataSource=t,this.pvt={}}return e.prototype.processResponse=function(e,t,r,n){return e},e}(),c=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.processQuery=function(e,t){for(var r,n,o,a=e.dataSource.json.slice(0),s=a.length,i=!0,u={},c=0,l=[],p=0;p<t.lazyLoad.length;p++)c++,u[t.lazyLoad[p].key]=t.lazyLoad[p].value;for(var d={},p=0;p<t.queries.length;p++)"onPage"!==(n=t.queries[p]).fn&&"onGroup"!==n.fn||!t.lazyLoad.length?(r=this[n.fn].call(this,a,n.e,t),"onAggregates"===n.fn?d[n.e.field+" - "+n.e.type]=r:a=void 0!==r?r:a,"onPage"!==n.fn&&"onSkip"!==n.fn&&"onTake"!==n.fn&&"onRange"!==n.fn||(i=!1),i&&(s=a.length)):("onGroup"===n.fn&&l.push(n.e),"onPage"===n.fn&&(o=n.e));if(c){var h={query:t,lazyLoad:u,result:a,group:l,page:o},f=this.lazyLoadGroup(h);a=f.result,s=f.count}return t.isCountRequired&&(a={result:a,count:s,aggregates:d}),a},n.prototype.lazyLoadGroup=function(e){var r=0,n=this.getAggregate(e.query),o=e.result;if(t.isNullOrUndefined(e.lazyLoad.onDemandGroupInfo)){u=e.group[0].fieldName;r=(o=a.group(o,u,n,null,null,e.group[0].comparer,!0)).length;c=o;e.page&&(o=this.onPage(o,e.page,e.query)),this.formGroupResult(o,c)}else{for(var s=e.lazyLoad.onDemandGroupInfo,i=s.where.length-1;i>=0;i--)o=this.onWhere(o,s.where[i]);if(e.group.length!==s.level){var u=e.group[s.level].fieldName;o=a.group(o,u,n,null,null,e.group[0].comparer,!0)}r=o.length;var c=o;o=(o=o.slice(s.skip)).slice(0,s.take),e.group.length!==s.level&&this.formGroupResult(o,c)}return{result:o,count:r}},n.prototype.formGroupResult=function(e,t){if(e.length&&t.length){e.GroupGuid=t.GroupGuid,e.childLevels=t.childLevels,e.level=t.level,e.records=t.records}return e},n.prototype.getAggregate=function(e){var t=r.filterQueries(e.queries,"onAggregates"),n=[];if(t.length)for(var o=void 0,s=0;s<t.length;s++)o=t[s].e,n.push({type:o.type,field:a.getValue(o.field,e)});return n},n.prototype.batchRequest=function(e,t,r){var n,o=t.deletedRecords.length;for(n=0;n<t.addedRecords.length;n++)this.insert(e,t.addedRecords[n]);for(n=0;n<t.changedRecords.length;n++)this.update(e,r.key,t.changedRecords[n]);for(n=0;n<o;n++)this.remove(e,r.key,t.deletedRecords[n]);return t},n.prototype.onWhere=function(e,t){return e&&e.length?e.filter(function(e){if(t)return t.validate(e)}):e},n.prototype.onAggregates=function(e,t){var r=a.aggregates[t.type];return e&&r&&0!==e.length?r(e,t.field):null},n.prototype.onSearch=function(e,t){return e&&e.length?(0===t.fieldNames.length&&a.getFieldList(e[0],t.fieldNames),e.filter(function(e){for(var r=0;r<t.fieldNames.length;r++)if(t.comparer.call(e,a.getObject(t.fieldNames[r],e),t.searchKey,t.ignoreCase,t.ignoreAccent))return!0;return!1})):e},n.prototype.onSortBy=function(e,t,r){if(!e||!e.length)return e;var n,o=a.getValue(t.fieldName,r);if(!o)return e.sort(t.comparer);if(o instanceof Array){for(var s=(o=o.slice(0)).length-1;s>=0;s--)o[s]&&(n=t.comparer,a.endsWith(o[s]," desc")&&(n=a.fnSort("descending"),o[s]=o[s].replace(" desc","")),e=a.sort(e,o[s],n));return e}return a.sort(e,o,t.comparer)},n.prototype.onGroup=function(e,t,r){if(!e||!e.length)return e;var n=this.getAggregate(r);return a.group(e,a.getValue(t.fieldName,r),n,null,null,t.comparer)},n.prototype.onPage=function(e,t,r){var n=a.getValue(t.pageSize,r),o=(a.getValue(t.pageIndex,r)-1)*n,s=o+n;return e&&e.length?e.slice(o,s):e},n.prototype.onRange=function(e,t){return e&&e.length?e.slice(a.getValue(t.start),a.getValue(t.end)):e},n.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,a.getValue(t.nos)):e},n.prototype.onSkip=function(e,t){return e&&e.length?e.slice(a.getValue(t.nos)):e},n.prototype.onSelect=function(e,t){return e&&e.length?a.select(e,a.getValue(t.fieldNames)):e},n.prototype.insert=function(e,r,n,o,a){return t.isNullOrUndefined(a)?e.dataSource.json.push(r):e.dataSource.json.splice(a,0,r)},n.prototype.remove=function(e,t,r,n){var o,s=e.dataSource.json;for("object"!=typeof r||r instanceof Date||(r=a.getObject(t,r)),o=0;o<s.length&&a.getObject(t,s[o])!==r;o++);return o!==s.length?s.splice(o,1):null},n.prototype.update=function(e,r,n,o){var a,s,i=e.dataSource.json;for(t.isNullOrUndefined(r)||(s=t.getValue(r,n)),a=0;a<i.length&&(t.isNullOrUndefined(r)||t.getValue(r,i[a])!==s);a++);return a<i.length?t.merge(i[a],n):null},n}(u),l=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return s(o,e),o.prototype.processQuery=function(e,t,n){var o,s,i=this.getQueryRequest(t),u=r.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),c=t.params,l=e.dataSource.url,p=null,d=this.options,h={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in u?(o=u.onPage,s=((s=a.getValue(o.pageIndex,t))-1)*(p=a.getValue(o.pageSize,t))):"onRange"in u&&(s=(o=u.onRange).start,p=o.end-o.start);for(v=0;v<i.sorts.length;v++)o=a.getValue(i.sorts[v].e.fieldName,t),h.sorts.push(a.callAdaptorFunction(this,"onEachSort",{name:o,direction:i.sorts[v].e.direction},t));n&&(o=this.getFiltersFrom(n,t))&&h.filters.push(a.callAdaptorFunction(this,"onEachWhere",o.toJson(),t));for(v=0;v<i.filters.length;v++){h.filters.push(a.callAdaptorFunction(this,"onEachWhere",i.filters[v].e.toJson(),t));for(var f=0,g="object"==typeof h.filters[v]?Object.keys(h.filters[v]):[];f<g.length;f++){O=g[f];a.isNull(h[O])&&delete h[O]}}for(v=0;v<i.searches.length;v++)o=i.searches[v].e,h.searches.push(a.callAdaptorFunction(this,"onEachSearch",{fields:o.fieldNames,operator:o.operator,key:o.searchKey,ignoreCase:o.ignoreCase},t));for(v=0;v<i.groups.length;v++)h.groups.push(a.getValue(i.groups[v].e.fieldName,t));for(v=0;v<i.aggregates.length;v++)o=i.aggregates[v].e,h.aggregates.push({type:o.type,field:a.getValue(o.field,t)});var y={};if(this.getRequestQuery(d,t,u,h,y),a.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:c,reqParams:y}),t.lazyLoad.length)for(var v=0;v<t.lazyLoad.length;v++)y[t.lazyLoad[v].key]=t.lazyLoad[v].value;for(var m=0,S=Object.keys(y);m<S.length;m++){var O=S[m];(a.isNull(y[O])||""===y[O]||0===y[O].length)&&delete y[O]}d.skip in y&&d.take in y||null===p||(y[d.skip]=a.callAdaptorFunction(this,"onSkip",s,t),y[d.take]=a.callAdaptorFunction(this,"onTake",p,t));var b=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(y,a.parse.jsonDateReplacer),url:l,pvtData:b,type:"POST",contentType:"application/json; charset=utf-8"}:(o=this.convertToQueryString(y,t,e),o=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+o,{type:"GET",url:o.length?l.replace(/\/*$/,o):l,pvtData:b})},o.prototype.getRequestQuery=function(e,t,r,n,o){var s=o;s[e.from]=t.fromTable,e.apply&&t.distincts.length&&(s[e.apply]="onDistinct"in this?a.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(s[e.expand]="onExpand"in this&&"onSelect"in r?a.callAdaptorFunction(this,"onExpand",{selects:a.getValue(r.onSelect.fieldNames,t),expands:t.expands},t):t.expands),s[e.select]="onSelect"in r&&!t.distincts.length?a.callAdaptorFunction(this,"onSelect",a.getValue(r.onSelect.fieldNames,t),t):"",s[e.count]=t.isCountRequired?a.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",s[e.search]=n.searches.length?a.callAdaptorFunction(this,"onSearch",n.searches,t):"",s[e.skip]="onSkip"in r?a.callAdaptorFunction(this,"onSkip",a.getValue(r.onSkip.nos,t),t):"",s[e.take]="onTake"in r?a.callAdaptorFunction(this,"onTake",a.getValue(r.onTake.nos,t),t):"",s[e.where]=n.filters.length||n.searches.length?a.callAdaptorFunction(this,"onWhere",n.filters,t):"",s[e.sortBy]=n.sorts.length?a.callAdaptorFunction(this,"onSortBy",n.sorts,t):"",s[e.group]=n.groups.length?a.callAdaptorFunction(this,"onGroup",n.groups,t):"",s[e.aggregates]=n.aggregates.length?a.callAdaptorFunction(this,"onAggregates",n.aggregates,t):"",s.param=[]},o.prototype.convertToQueryString=function(e,t,r){return""},o.prototype.processResponse=function(e,r,n,o,s,i){if(o&&o.getResponseHeader("Content-Type")&&-1!==o.getResponseHeader("Content-Type").indexOf("application/json")){var u=a.timeZoneHandling;r&&!r.timeZoneHandling&&(a.timeZoneHandling=!1),e=a.parse.parseJson(e),a.timeZoneHandling=u}var c=s,l=c.pvtData||{},p=e?e.groupDs:[];if(o&&o.getResponseHeader("Content-Type")&&-1!==o.getResponseHeader("Content-Type").indexOf("xml"))return n.isCountRequired?{result:[],count:0}:[];var d=JSON.parse(c.data);if(d&&"batch"===d.action&&e&&e.addedRecords)return i.addedRecords=e.addedRecords,i;e&&e.d&&(e=e.d);var h={};e&&"count"in e&&(h.count=e.count),h.result=e&&e.result?e.result:e;var f=!1;if(Array.isArray(e.result)&&e.result.length){if(t.isNullOrUndefined(e.result[0].key)||(h.result=this.formRemoteGroupedData(h.result,1,l.groups.length-1)),n&&n.lazyLoad.length&&l.groups.length)for(var g=0;g<n.lazyLoad.length;g++)if("onDemandGroupInfo"===n.lazyLoad[g].key){var y=n.lazyLoad[g].value.level;l.groups.length===y&&(f=!0)}}return f||this.getAggregateResult(l,e,h,p,n),a.isNull(h.count)?h.result:{result:h.result,count:h.count,aggregates:h.aggregates}},o.prototype.formRemoteGroupedData=function(e,r,n){for(var o=0;o<e.length;o++)e[o].items.length&&Object.keys(e[o].items[0]).indexOf("key")>-1&&this.formRemoteGroupedData(e[o].items,r+1,n-1);return e.GroupGuid=i.GroupGuid,e.level=r,e.childLevels=n,e.records=e[0].items.length?this.getGroupedRecords(e,!t.isNullOrUndefined(e[0].items.records)):[],e},o.prototype.getGroupedRecords=function(e,t){for(var r=[],n=0;n<e.length;n++)if(t)r=r.concat(e[n].items.records);else for(var o=0;o<e[n].items.length;o++)r.push(e[n].items[o]);return r},o.prototype.onGroup=function(e){return this.pvt.groups=e,e},o.prototype.onAggregates=function(e){this.pvt.aggregates=e},o.prototype.batchRequest=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.removeUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(t.extend({},{changed:r.changedRecords,added:r.addedRecords,deleted:r.deletedRecords,action:"batch",table:n[void 0],key:n[void 0]},a.getAddParams(this,e,o)))}},o.prototype.beforeSend=function(e,t){},o.prototype.insert=function(e,r,n,o){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:r,table:n,action:"insert"},a.getAddParams(this,e,o)))}},o.prototype.remove=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{key:n,keyColumn:r,table:o,action:"remove"},a.getAddParams(this,e,s)))}},o.prototype.update=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:n,action:"update",keyColumn:r,key:a.getObject(r,n),table:o},a.getAddParams(this,e,s)))}},o.prototype.getFiltersFrom=function(e,t){var r,o=t.fKey,s=o,i=t.key,u=[];"object"!=typeof e[0]&&(s=null);for(var c=0;c<e.length;c++)r="object"==typeof e[0]?a.getObject(i||s,e[c]):e[c],u.push(new n(o,"equal",r));return n.or(u)},o.prototype.getAggregateResult=function(e,n,o,s,i){var u=n;if(n&&n.result&&(u=n.result),e&&e.aggregates&&e.aggregates.length){var c=e.aggregates,l=void 0,p=u,d={};n.aggregate&&(p=n.aggregate);for(g=0;g<c.length;g++)(l=a.aggregates[c[g].type])&&(d[c[g].field+" - "+c[g].type]=l(p,c[g].field));o.aggregates=d}var h=Array.isArray(n.result)&&n.result.length&&!t.isNullOrUndefined(n.result[0].key);if(e&&e.groups&&e.groups.length&&!h){for(var f=e.groups,g=0;g<f.length;g++){t.isNullOrUndefined(s)||(s=a.group(s,f[g]));var y=r.filterQueries(i.queries,"onGroup")[g].e;u=a.group(u,f[g],e.aggregates,null,s,y.comparer)}o.result=u}return o},o.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=r.filterQueries(e.queries,"onSortBy"),t.groups=r.filterQueries(e.queries,"onGroup"),t.filters=r.filterQueries(e.queries,"onWhere"),t.searches=r.filterQueries(e.queries,"onSearch"),t.aggregates=r.filterQueries(e.queries,"onAggregates"),t},o.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var r=0,n=e.params;r<n.length;r++){var o=n[r];if(t[o.key])throw new Error("Query() - addParams: Custom Param is conflicting other request arguments");t[o.key]=o.value,o.fn&&(t[o.key]=o.fn.call(e.query,o.key,e.query,e.dm)),t.params[o.key]=t[o.key]}},o}(u),p=function(e){function r(r){var n=e.call(this)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json;odata=light;q=1,application/json;odata=verbose;q=0.5",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$inlinecount",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PUT"}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"ODataAdaptor"},r.prototype.onPredicate=function(e,n,o){var s,i,u="",c=e.value,l=typeof c,p=e.field?r.getField(e.field):null;if(c instanceof Date&&(c="datetime'"+a.parse.replacer(c)+"'"),"string"===l&&(c="'"+(c=encodeURIComponent(c))+"'",o&&(p="cast("+p+", 'Edm.String')"),a.parse.isGuid(c)&&(i="guid"),e.ignoreCase&&(i||(p="tolower("+p+")"),c=c.toLowerCase())),s=a.odBiOperator[e.operator])return u+=p,u+=s,i&&(u+=i),u+c;if("substringof"===(s=t.isNullOrUndefined(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?a.odUniOperator[e.operator]:a.odv4UniOperator[e.operator])){var d=c;c=p,p=d}return u+=s+"(",u+=p+",",i&&(u+=i),u+=c+")"},r.prototype.addParams=function(t){e.prototype.addParams.call(this,t),delete t.reqParams.params},r.prototype.onComplexPredicate=function(e,t,r){for(var n=[],o=0;o<e.predicates.length;o++)n.push("("+this.onEachWhere(e.predicates[o],t,r)+")");return n.join(" "+e.condition+" ")},r.prototype.onEachWhere=function(e,t,r){return e.isComplex?this.onComplexPredicate(e,t,r):this.onPredicate(e,t,r)},r.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},r.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&a.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],r=0;r<e.fields.length;r++)t.push(new n(e.fields[r],e.operator,e.key,e.ignoreCase));this.pvt.search=t},r.prototype.onSearch=function(e){return this.pvt.search=n.or(this.pvt.search),""},r.prototype.onEachSort=function(e){var t=[];if(e.name instanceof Array)for(var n=0;n<e.name.length;n++)t.push(r.getField(e.name[n])+("descending"===e.direction?" desc":""));else t.push(r.getField(e.name)+("descending"===e.direction?" desc":""));return t.join(",")},r.prototype.onSortBy=function(e){return e.reverse().join(",")},r.prototype.onGroup=function(e){return this.pvt.groups=e,[]},r.prototype.onSelect=function(e){for(var t=0;t<e.length;t++)e[t]=r.getField(e[t]);return e.join(",")},r.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},r.prototype.onCount=function(e){return!0===e?"allpages":""},r.prototype.beforeSend=function(e,t,r){a.endsWith(r.url,this.options.batch)&&"post"===r.type.toLowerCase()?(t.setRequestHeader("Accept",this.options.multipartAccept),t.setRequestHeader("DataServiceVersion","2.0"),t.overrideMimeType("text/plain; charset=x-user-defined")):t.setRequestHeader("Accept",this.options.accept),t.setRequestHeader("DataServiceVersion","2.0"),t.setRequestHeader("MaxDataServiceVersion","2.0")},r.prototype.processResponse=function(e,r,n,o,s,i){if(s&&"GET"===s.type&&!this.rootUrl&&e["odata.metadata"]){var u=e["odata.metadata"].split("/$metadata#");this.rootUrl=u[0],this.resourceTableName=u[1]}if(!t.isNullOrUndefined(e.d)){var c=n&&n.isCountRequired?e.d.results:e.d;if(!t.isNullOrUndefined(c))for(var l=0;l<c.length;l++)t.isNullOrUndefined(c[l].__metadata)||delete c[l].__metadata}var p=s&&s.pvtData,d=this.processBatchResponse(e,n,o,s,i);if(d)return d;var h=o&&s.getResponseHeader("DataServiceVersion"),f=null,g=h&&parseInt(h,10)||2;if(n&&n.isCountRequired){(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"]),e.d&&(e=e.d),(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"])}3===g&&e.value&&(e=e.value),e.d&&(e=e.d),g<3&&e.results&&(e=e.results);var y={};return y.count=f,y.result=e,this.getAggregateResult(p,e,y,null,n),a.isNull(f)?y.result:{result:y.result,count:y.count,aggregates:y.aggregates}},r.prototype.convertToQueryString=function(e,t,r){var n=[],o=e.table||"";delete e.table,r.dataSource.requiresFormat&&(e.$format="json");for(var a=0,s=Object.keys(e);a<s.length;a++){var i=s[a];n.push(i+"="+e[i])}return n=n.join("&"),r.dataSource.url&&-1!==r.dataSource.url.indexOf("?")&&!o?n:n.length?o+"?"+n:o||""},r.prototype.localTimeReplacer=function(e,r){for(var n=0,o=t.isNullOrUndefined(r)?[]:Object.keys(r);n<o.length;n++){var s=o[n];r[s]instanceof Date&&(r[s]=a.dateParse.toLocalTime(r[s]))}return r},r.prototype.insert=function(e,t,r){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},r.prototype.remove=function(e,t,r,n){var o;return o="string"!=typeof r||a.parse.isGuid(r)?"("+r+")":"('"+r+"')",{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:"")+o}},r.prototype.update=function(e,r,n,o,s,i){"PATCH"!==this.options.updateType||t.isNullOrUndefined(i)||(n=this.compareAndRemove(n,i,r));var u;return u="string"!=typeof n[r]||a.parse.isGuid(n[r])?"("+n[r]+")":"('"+n[r]+"')",{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,o?"/"+o:"")+u,data:JSON.stringify(n,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},r.prototype.batchRequest=function(e,t,r,n,o){var s=r.guid=a.getGuid(this.options.batchPre),i=this.rootUrl?this.rootUrl+"/"+this.options.batch:e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;var u={url:r.url,key:r.key,cid:1,cSet:a.getGuid(this.options.changeSet)},c="--"+s+"\n";return c+="Content-Type: multipart/mixed; boundary="+u.cSet.replace("--","")+"\n",this.pvt.changeSet=0,c+=this.generateInsertRequest(t.addedRecords,u,e),c+=this.generateUpdateRequest(t.changedRecords,u,e,o?o.changedRecords:[]),c+=this.generateDeleteRequest(t.deletedRecords,u,e),c+=u.cSet+"--\n",c+="--"+s+"--",{type:"POST",url:i,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+s,data:c}},r.prototype.generateDeleteRequest=function(e,t,r){if(!e)return"";var n={method:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid(n)?"("+n+")":n instanceof Date?"("+e[t][r].toJSON()+")":"('"+n+"')"},data:function(e,t){return""}};return this.generateBodyContent(e,t,n,r)+"\n"},r.prototype.generateInsertRequest=function(e,t,r){if(!e)return"";var n={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,n,r)},r.prototype.generateUpdateRequest=function(e,t,r,n){var o=this;if(!e)return"";e.forEach(function(e){return e=o.compareAndRemove(e,n.filter(function(r){return a.getObject(t.key,r)===a.getObject(t.key,e)})[0],t.key)});var s={method:this.options.updateType+" ",url:function(e,t,r){return"number"==typeof e[t][r]||a.parse.isGuid(e[t][r])?"("+e[t][r]+")":e[t][r]instanceof Date?"("+e[t][r].toJSON()+")":"('"+e[t][r]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,s,r)},r.getField=function(e){return e.replace(/\./g,"/")},r.prototype.generateBodyContent=function(e,r,n,o){for(var a="",s=0;s<e.length;s++)a+="\n"+r.cSet+"\n",a+=this.options.changeSetContent+"\n\n",a+=n.method,"POST "===n.method?a+=(o.dataSource.insertUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"PUT "===n.method||"PATCH "===n.method?a+=(o.dataSource.updateUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"DELETE "===n.method&&(a+=(o.dataSource.removeUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n"),a+="Accept: "+this.options.accept+"\n",a+="Content-Id: "+this.pvt.changeSet+++"\n",a+=this.options.batchChangeSetContentType+"\n",t.isNullOrUndefined(e[s]["@odata.etag"])?a+="\n":(a+="If-Match: "+e[s]["@odata.etag"]+"\n\n",delete e[s]["@odata.etag"]),a+=n.data(e,s);return a},r.prototype.processBatchResponse=function(e,r,n,o,s){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return r.isCountRequired?{result:[],count:0}:[];if(o&&this.options.batch&&a.endsWith(o.url,this.options.batch)&&"post"===o.type.toLowerCase()){var i=n.getResponseHeader("Content-Type"),u=void 0,c=void 0,l=e+"";if(i=i.substring(i.indexOf("=batchresponse")+1),(l=l.split(i)).length<2)return{};l=l[1];var p=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(l);p&&l.replace(p[0],"");for(var d=p?p[1]:"",h=(l=l.split(d)).length;h>-1;h--)/\bContent-ID:/i.test(l[h])&&/\bHTTP.+201/.test(l[h])&&(u=parseInt(/\bContent-ID: (\d+)/i.exec(l[h])[1],10),s.addedRecords[u]&&(c=a.parse.parseJson(/^\{.+\}/m.exec(l[h])[0]),t.extend({},s.addedRecords[u],this.processResponse(c))));return s}return null},r.prototype.compareAndRemove=function(e,r,n){var o=this;return t.isNullOrUndefined(r)?e:(Object.keys(e).forEach(function(t){t!==n&&"@odata.etag"!==t&&(a.isPlainObject(e[t])?(o.compareAndRemove(e[t],r[t]),0===Object.keys(e[t]).filter(function(e){return"@odata.etag"!==e}).length&&delete e[t]):e[t]===r[t]?delete e[t]:e[t]&&r[t]&&e[t].valueOf()===r[t].valueOf()&&delete e[t])}),e)},r}(l),d=function(e){function n(r){var n=e.call(this,r)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json, text/javascript, */*; q=0.01",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$count",search:"$search",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PATCH",localTime:!1,apply:"$apply"}),t.extend(n.options,r||{}),n}return s(n,e),n.prototype.getModuleName=function(){return"ODataV4Adaptor"},n.prototype.onCount=function(e){return!0===e?"true":""},n.prototype.onPredicate=function(t,n,o){var s="",i=t.value,u=i instanceof Date;if(n instanceof r)for(var c=this.getQueryRequest(n),l=0;l<c.filters.length;l++)c.filters[l].e.key===t.value&&(o=!0);return s=e.prototype.onPredicate.call(this,t,n,o),u&&(s=s.replace(/datetime'(.*)'$/,"$1")),a.parse.isGuid(i)&&(s=s.replace("guid","").replace(/'/g,"")),s},n.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},n.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},n.prototype.onExpand=function(e){var t=this,r={},n={},o=e.expands.slice(),a=[];return e.selects.filter(function(e){return e.indexOf(".")>-1}).forEach(function(e){var t=e.split(".");t[0]in r||(r[t[0]]=[]),r[t[0]].push(t[1])}),Object.keys(r).forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),o.forEach(function(e){n[e]=e in r?e+"("+t.options.select+"="+r[e].join(",")+")":e}),Object.keys(n).forEach(function(e){return a.push(n[e])}),a.join(",")},n.prototype.onDistinct=function(e){return"groupby(("+e.map(function(e){return p.getField(e)}).join(",")+"))"},n.prototype.onSelect=function(t){return e.prototype.onSelect.call(this,t.filter(function(e){return-1===e.indexOf(".")}))},n.prototype.beforeSend=function(e,t,r){"POST"!==r.type&&"PUT"!==r.type&&"PATCH"!==r.type||t.setRequestHeader("Prefer","return=representation"),t.setRequestHeader("Accept",this.options.accept)},n.prototype.processResponse=function(r,n,o,s,i,u){if(i&&"GET"===i.type&&!this.rootUrl&&r["@odata.context"]){var c=r["@odata.context"].split("/$metadata#");this.rootUrl=c[0],this.resourceTableName=c[1]}var l=i&&i.pvtData,p=e.prototype.processBatchResponse.call(this,r,o,s,i,u);if(p)return p;var d=null;o&&o.isCountRequired&&"@odata.count"in r&&(d=r["@odata.count"]),r=t.isNullOrUndefined(r.value)?r:r.value;var h={};return h.count=d,h.result=r,this.getAggregateResult(l,r,h,null,o),a.isNull(d)?h.result:{result:h.result,count:d,aggregates:h.aggregates}},n}(p),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.getModuleName=function(){return"WebApiAdaptor"},t.prototype.insert=function(e,t,r){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},t.prototype.remove=function(e,t,r,n){return{type:"DELETE",url:e.dataSource.url+"/"+r,data:JSON.stringify(r)}},t.prototype.update=function(e,t,r,n){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(r)}},t.prototype.batchRequest=function(e,t,r){var n=this,o=r.guid=a.getGuid(this.options.batchPre),s=e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;for(var i=[],u=0,c=t.addedRecords.length;u<c;u++)!function(n,a){t.addedRecords.forEach(function(a,s){var u={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("POST /api/"+(e.dataSource.insertUrl||e.dataSource.crudUrl||r.url)+u.url(t.addedRecords,n,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")})}(u);for(var u=0,c=t.changedRecords.length;u<c;u++)!function(a,s){t.changedRecords.forEach(function(s,u){var c={method:n.options.updateType+" ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("PUT /api/"+(e.dataSource.updateUrl||e.dataSource.crudUrl||r.url)+c.url(t.changedRecords,a,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",s?JSON.stringify(s):"")})}(u);for(var u=0,c=t.deletedRecords.length;u<c;u++)!function(n,s){t.deletedRecords.forEach(function(s,u){var c={mtd:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid(n)?"/"+n:n instanceof Date?"/"+e[t][r].toJSON():"/'"+n+"'"},data:function(e,t){return""}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("DELETE /api/"+(e.dataSource.removeUrl||e.dataSource.crudUrl||r.url)+c.url(t.deletedRecords,n,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",s?JSON.stringify(s):"")})}(u);return i.push("--"+o+"--",""),{type:"POST",url:s,contentType:"multipart/mixed; boundary="+o,data:i.join("\r\n")}},t.prototype.beforeSend=function(e,t,r){t.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01")},t.prototype.processResponse=function(e,t,r,n,o,s){var i=o&&o.pvtData,u=null,c={};if(o&&"post"!==o.type.toLowerCase()){var l=n&&o.getResponseHeader("DataServiceVersion"),p=l&&parseInt(l,10)||2;r&&r.isCountRequired&&(a.isNull(e.Count)||(u=e.Count)),p<3&&e.Items&&(e=e.Items),c.count=u,c.result=e,this.getAggregateResult(i,e,c,null,r)}return c.result=c.result||e,a.isNull(u)?c.result:{result:c.result,count:c.count,aggregates:c.aggregates}},t}(p),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.processQuery=function(e,t,r){var n=(new l).processQuery(e,t,r),o=a.parse.parseJson(n.data),s={};if(o.param)for(var i=0;i<o.param.length;i++){var u=o.param[i],c=Object.keys(u)[0];s[c]=u[c]}s.value=o;return{data:JSON.stringify(s),url:n.url,pvtData:n.pvtData,type:"POST",contentType:"application/json; charset=utf-8"}},t}(l),g=function(e){function r(){var r=e.call(this)||this;return t.setValue("beforeSend",l.prototype.beforeSend,r),r}return s(r,e),r.prototype.insert=function(e,r,n,o,s){return this.pvt.position=s,this.updateType="add",{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:r,table:n,action:"insert"},a.getAddParams(this,e,o)))}},r.prototype.remove=function(r,n,o,s,i){return e.prototype.remove.call(this,r,n,o),{type:"POST",url:r.dataSource.removeUrl||r.dataSource.crudUrl||r.dataSource.url,data:JSON.stringify(t.extend({},{key:o,keyColumn:n,table:s,action:"remove"},a.getAddParams(this,r,i)))}},r.prototype.update=function(e,r,n,o,s){return this.updateType="update",this.updateKey=r,{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:n,action:"update",keyColumn:r,key:n[r],table:o},a.getAddParams(this,e,s)))}},r.prototype.processResponse=function(t,r,n,o,a,s,i){var u;if(t=a?JSON.parse(a.data):t,"add"===this.updateType&&e.prototype.insert.call(this,r,t,null,null,this.pvt.position),"update"===this.updateType&&e.prototype.update.call(this,r,this.updateKey,t),this.updateType=void 0,t.added)for(u=0;u<t.added.length;u++)e.prototype.insert.call(this,r,t.added[u]);if(t.changed)for(u=0;u<t.changed.length;u++)e.prototype.update.call(this,r,i.key,t.changed[u]);if(t.deleted)for(u=0;u<t.deleted.length;u++)e.prototype.remove.call(this,r,i.key,t.deleted[u]);return t},r.prototype.batchRequest=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(t.extend({},{changed:r.changedRecords,added:r.addedRecords,deleted:r.deletedRecords,action:"batch",table:n.url,key:n.key},a.getAddParams(this,e,o)))}},r.prototype.addParams=function(e){(new l).addParams(e)},r}(c),y=function(e){function r(r){var n=e.call(this)||this;return n.options=t.extend({},n.options,{getData:new Function,addRecord:new Function,updateRecord:new Function,deleteRecord:new Function,batchUpdate:new Function}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"CustomDataAdaptor"},r}(l),v=function(e){function n(r,n,o){var s=e.call(this)||this;s.isCrudAction=!1,s.isInsertAction=!1,t.isNullOrUndefined(r)||(s.cacheAdaptor=r),s.pageSize=o,s.guidId=a.getGuid("cacheAdaptor");var i={keys:[],results:[]};window.localStorage.setItem(s.guidId,JSON.stringify(i));var u=s.guidId;return t.isNullOrUndefined(n)||setInterval(function(){var e;e=a.parse.parseJson(window.localStorage.getItem(u));for(var t=[],r=0;r<e.results.length;r++){var o=+new Date,s=+new Date(e.results[r].timeStamp);e.results[r].timeStamp=o-s,o-s>n&&t.push(r)}for(r=0;r<t.length;r++)e.results.splice(t[r],1),e.keys.splice(t[r],1);window.localStorage.removeItem(u),window.localStorage.setItem(u,JSON.stringify(e))},n),s}return s(n,e),n.prototype.generateKey=function(e,t){var n=this.getQueryRequest(t),o=r.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),a=e;"onPage"in o&&(a+=o.onPage.pageIndex),n.sorts.forEach(function(e){a+=e.e.direction+e.e.fieldName}),n.groups.forEach(function(e){a+=e.e.fieldName}),n.searches.forEach(function(e){a+=e.e.searchKey});for(var s=0;s<n.filters.length;s++){var i=n.filters[s];if(i.e.isComplex){var u=t.clone();u.queries=[];for(var c=0;c<i.e.predicates.length;c++)u.queries.push({fn:"onWhere",e:i.e.predicates[c],filter:t.queries.filter});a+=i.e.condition+this.generateKey(e,u)}else a+=i.e.field+i.e.operator+i.e.value}return a},n.prototype.processQuery=function(e,t,r){var n,o=this.generateKey(e.dataSource.url,t),s=(n=a.parse.parseJson(window.localStorage.getItem(this.guidId)))?n.results[n.keys.indexOf(o)]:null;return null==s||this.isCrudAction||this.isInsertAction?(this.isCrudAction=null,this.isInsertAction=null,this.cacheAdaptor.processQuery.apply(this.cacheAdaptor,[].slice.call(arguments,0))):s},n.prototype.processResponse=function(e,t,r,n,o,s){if(this.isInsertAction||o&&this.cacheAdaptor.options.batch&&a.endsWith(o.url,this.cacheAdaptor.options.batch)&&"post"===o.type.toLowerCase())return this.cacheAdaptor.processResponse(e,t,r,n,o,s);e=this.cacheAdaptor.processResponse.apply(this.cacheAdaptor,[].slice.call(arguments,0));var i=r?this.generateKey(t.dataSource.url,r):t.dataSource.url,u={},c=(u=a.parse.parseJson(window.localStorage.getItem(this.guidId))).keys.indexOf(i);for(-1!==c&&(u.results.splice(c,1),u.keys.splice(c,1)),u.results[u.keys.push(i)-1]={keys:i,result:e.result,timeStamp:new Date,count:e.count};u.results.length>this.pageSize;)u.results.splice(0,1),u.keys.splice(0,1);return window.localStorage.setItem(this.guidId,JSON.stringify(u)),e},n.prototype.beforeSend=function(e,r,n){!t.isNullOrUndefined(this.cacheAdaptor.options.batch)&&a.endsWith(n.url,this.cacheAdaptor.options.batch)&&"post"===n.type.toLowerCase()&&r.setRequestHeader("Accept",this.cacheAdaptor.options.multipartAccept),e.dataSource.crossDomain||r.setRequestHeader("Accept",this.cacheAdaptor.options.accept)},n.prototype.update=function(e,t,r,n){return this.isCrudAction=!0,this.cacheAdaptor.update(e,t,r,n)},n.prototype.insert=function(e,t,r){return this.isInsertAction=!0,this.cacheAdaptor.insert(e,t,r)},n.prototype.remove=function(e,t,r,n){return this.isCrudAction=!0,this.cacheAdaptor.remove(e,t,r,n)},n.prototype.batchRequest=function(e,t,r){return this.cacheAdaptor.batchRequest(e,t,r)},n}(l),m=function(){function e(e,n,o){var s=this;this.dateParse=!0,this.timeZoneHandling=!0,this.requests=[],e||this.dataSource||(e=[]),o=o||e.adaptor,e&&!1===e.timeZoneHandling&&(this.timeZoneHandling=e.timeZoneHandling);var i;return e instanceof Array?i={json:e,offline:!0}:"object"==typeof e?(e.json||(e.json=[]),i={url:e.url,insertUrl:e.insertUrl,removeUrl:e.removeUrl,updateUrl:e.updateUrl,crudUrl:e.crudUrl,batchUrl:e.batchUrl,json:e.json,headers:e.headers,accept:e.accept,data:e.data,timeTillExpiration:e.timeTillExpiration,cachingPageSize:e.cachingPageSize,enableCaching:e.enableCaching,requestType:e.requestType,key:e.key,crossDomain:e.crossDomain,jsonp:e.jsonp,dataType:e.dataType,offline:void 0!==e.offline?e.offline:!(e.adaptor instanceof g||e.adaptor instanceof y)&&!e.url,requiresFormat:e.requiresFormat}):a.throwError("DataManager: Invalid arguments"),void 0!==i.requiresFormat||a.isCors()||(i.requiresFormat=!!t.isNullOrUndefined(i.crossDomain)||i.crossDomain),void 0===i.dataType&&(i.dataType="json"),this.dataSource=i,this.defaultQuery=n,i.url&&i.offline&&!i.json.length?(this.isDataAvailable=!1,this.adaptor=o||new p,this.dataSource.offline=!1,this.ready=this.executeQuery(n||new r),this.ready.then(function(e){s.dataSource.offline=!0,s.isDataAvailable=!0,i.json=e.result,s.adaptor=new c})):this.adaptor=i.offline?new c:new p,!i.jsonp&&this.adaptor instanceof p&&(i.jsonp="callback"),this.adaptor=o||this.adaptor,i.enableCaching&&(this.adaptor=new v(this.adaptor,i.timeTillExpiration,i.cachingPageSize)),this}return e.prototype.setDefaultQuery=function(e){return this.defaultQuery=e,this},e.prototype.executeLocal=function(n){this.defaultQuery||n instanceof r||a.throwError("DataManager - executeLocal() : A query is required to execute"),this.dataSource.json||a.throwError("DataManager - executeLocal() : Json data is required to execute"),n=n||this.defaultQuery;var o=this.adaptor.processQuery(this,n);if(n.subQuery){var s=n.subQuery.fromTable,i=n.subQuery.lookups,u=n.isCountRequired?o.result:o;i&&i instanceof Array&&a.buildHierarchy(n.subQuery.fKey,s,u,i,n.subQuery.key);for(var c=0;c<u.length;c++)u[c][s]instanceof Array&&(u[c]=t.extend({},{},u[c]),u[c][s]=this.adaptor.processResponse(n.subQuery.using(new e(u[c][s].slice(0))).executeLocal(),this,n))}return this.adaptor.processResponse(o,this,n)},e.prototype.executeQuery=function(n,o,s,i){var u=this;"function"==typeof n&&(i=s,s=o,o=n,n=null),n||(n=this.defaultQuery),n instanceof r||a.throwError("DataManager - executeQuery() : A query is required to execute");var c=new S,l={query:n};if(!this.dataSource.offline&&void 0!==this.dataSource.url&&""!==this.dataSource.url||!t.isNullOrUndefined(this.adaptor.makeRequest)||this.isCustomDataAdaptor(this.adaptor)){var p=this.adaptor.processQuery(this,n);t.isNullOrUndefined(this.adaptor.makeRequest)?!t.isNullOrUndefined(p.url)||this.isCustomDataAdaptor(this.adaptor)?this.makeRequest(p,c,l,n):(l=e.getDeferedArgs(n,p,l),c.resolve(l)):this.adaptor.makeRequest(p,c,l,n)}else e.nextTick(function(){var t=u.executeLocal(n);l=e.getDeferedArgs(n,t,l),c.resolve(l)});return(o||s)&&c.promise.then(o,s),i&&c.promise.then(i,i),c.promise},e.getDeferedArgs=function(e,t,r){return e.isCountRequired?(r.result=t.result,r.count=t.count,r.aggregates=t.aggregates):r.result=t,r},e.nextTick=function(e){(window.setImmediate||window.setTimeout)(e,0)},e.prototype.extendRequest=function(e,r,n){return t.extend({},{type:"GET",dataType:this.dataSource.dataType,crossDomain:this.dataSource.crossDomain,jsonp:this.dataSource.jsonp,cache:!0,processData:!1,onSuccess:r,onFailure:n},e)},e.prototype.makeRequest=function(e,r,n,o){var s=this,i=!!o.subQuerySelector,u=function(e){n.error=e,r.reject(n)},c=function(e,t,o,a,s,i,u){n.xhr=o,n.count=t?parseInt(t.toString(),10):0,n.result=e,n.request=a,n.aggregates=i,n.actual=s,n.virtualSelectRecords=u,r.resolve(n)},l=function(e,t){var r=new S,l={parent:n};o.subQuery.isChild=!0;var p=s.adaptor.processQuery(s,o.subQuery,e?s.adaptor.processResponse(e):t),d=s.makeRequest(p,r,l,o.subQuery);return i||r.then(function(t){e&&(a.buildHierarchy(o.subQuery.fKey,o.subQuery.fromTable,e,t,o.subQuery.key),c(e,t.count,t.xhr))},u),d},p=function(e,r){s.isCustomDataAdaptor(s.adaptor)&&(r=t.extend({},s.ajaxReqOption,r)),-1===r.httpRequest.getResponseHeader("Content-Type").indexOf("xml")&&s.dateParse&&(e=a.parse.parseJson(e));var n=s.adaptor.processResponse(e,s,o,r.httpRequest,r),u=0,p=null,d=e.virtualSelectRecords;if(o.isCountRequired&&(u=n.count,p=n.aggregates,n=n.result),!o.subQuery)return void c(n,u,r.httpRequest,r.type,e,p,d);i||l(n,r)},d=this.extendRequest(e,p,u);if(this.isCustomDataAdaptor(this.adaptor)){this.ajaxReqOption=d;var h=d;this.adaptor.options.getData({data:h.data,onSuccess:h.onSuccess,onFailure:h.onFailure})}else{var f=new t.Ajax(d);f.beforeSend=function(){s.beforeSend(f.httpRequest,f)},(d=f.send()).catch(function(e){return!0}),this.requests.push(f)}if(i){var g=o.subQuerySelector.call(this,{query:o.subQuery,parent:o});g&&g.length?Promise.all([d,l(null,g)]).then(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=s.adaptor.processResponse(r[0],s,o,s.requests[0].httpRequest,s.requests[0]),u=0;o.isCountRequired&&(u=n.count,n=n.result);var l=s.adaptor.processResponse(r[1],s,o.subQuery,s.requests[1].httpRequest,s.requests[1]);u=0,o.subQuery.isCountRequired&&(u=l.count,l=l.result),a.buildHierarchy(o.subQuery.fKey,o.subQuery.fromTable,n,l,o.subQuery.key),i=!1,c(n,u,s.requests[0].httpRequest)}):i=!1}return d},e.prototype.beforeSend=function(e,t){this.adaptor.beforeSend(this,e,t);for(var r,n=this.dataSource.headers,o=0;n&&o<n.length;o++){r=[];for(var a=0,s=Object.keys(n[o]);a<s.length;a++){var i=s[a];r.push(i),e.setRequestHeader(i,n[o][i])}}},e.prototype.saveChanges=function(e,n,o,a,s){var i=this;o instanceof r&&(a=o,o=null);var u={url:o,key:n||this.dataSource.key},c=this.adaptor.batchRequest(this,e,u,a||new r,s);if(this.dataSource.offline)return c;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){if(this.isCustomDataAdaptor(this.adaptor))return this.doAjaxRequest(c,this.adaptor.options.batchUpdate);var l=new S,p=new t.Ajax(c);return p.beforeSend=function(){i.beforeSend(p.httpRequest,p)},p.onSuccess=function(t,r){l.resolve(i.adaptor.processResponse(t,i,null,r.httpRequest,r,e,u))},p.onFailure=function(e){l.reject([{error:e}])},p.send().catch(function(e){return!0}),l.promise}return this.adaptor.doAjaxRequest(c)},e.prototype.insert=function(e,n,o,a){n instanceof r&&(o=n,n=null);var s=this.adaptor.insert(this,e,n,o,a);return this.dataSource.offline?s:t.isNullOrUndefined(this.adaptor.doAjaxRequest)?this.doAjaxRequest(s,this.adaptor.options.addRecord):this.adaptor.doAjaxRequest(s)},e.prototype.remove=function(e,n,o,s){"object"==typeof n&&(n=a.getObject(e,n)),o instanceof r&&(s=o,o=null);var i=this.adaptor.remove(this,e,n,o,s);if(this.dataSource.offline)return i;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){var u=this.adaptor.options.deleteRecord;return this.doAjaxRequest(i,u)}return this.adaptor.doAjaxRequest(i)},e.prototype.update=function(e,n,o,a,s){o instanceof r&&(a=o,o=null);var i=this.adaptor.update(this,e,n,o,a,s);if(this.dataSource.offline)return i;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){var u=this.adaptor.options.updateRecord;return this.doAjaxRequest(i,u)}return this.adaptor.doAjaxRequest(i)},e.prototype.isCustomDataAdaptor=function(e){return this.adaptor.getModuleName&&"CustomDataAdaptor"===this.adaptor.getModuleName()},e.prototype.successFunc=function(e,r){this.isCustomDataAdaptor(this.adaptor)&&(r=t.extend({},this.ajaxReqOption,r));try{a.parse.parseJson(e)}catch(t){e=[]}e=this.adaptor.processResponse(a.parse.parseJson(e),this,null,r.httpRequest,r),this.ajaxDeffered.resolve(e)},e.prototype.failureFunc=function(e){this.ajaxDeffered.reject([{error:e}])},e.prototype.doAjaxRequest=function(e,r){var n=this;if(e=t.extend({},{type:"POST",contentType:"application/json; charset=utf-8",processData:!1},e),this.ajaxDeffered=new S,this.isCustomDataAdaptor(this.adaptor))this.ajaxReqOption=e,r.call(this,{data:e.data,onSuccess:this.successFunc.bind(this),onFailure:this.failureFunc.bind(this)});else{var o=new t.Ajax(e);o.beforeSend=function(){n.beforeSend(o.httpRequest,o)},o.onSuccess=this.successFunc.bind(this),o.onFailure=this.failureFunc.bind(this),o.send().catch(function(e){return!0})}return this.ajaxDeffered.promise},e}(),S=function(){function e(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)}return e}();return e.DataManager=m,e.Deferred=S,e.Query=r,e.Predicate=n,e.Adaptor=u,e.JsonAdaptor=c,e.UrlAdaptor=l,e.ODataAdaptor=p,e.ODataV4Adaptor=d,e.WebApiAdaptor=h,e.WebMethodAdaptor=f,e.RemoteSaveAdaptor=g,e.CustomDataAdaptor=y,e.CacheAdaptor=v,e.DataUtil=a,e}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-buttons.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.buttons=function(e,t){"use strict";function i(e,i,s,n,r,a){var l=n;if(n.tagName===i){var o=t.getValue("ej2_instances",n);l=e("input",{attrs:{type:s}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&l.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(l),t.setValue("ej2_instances",o,l),t.deleteObject(n,"ej2_instances")}return l}function s(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function n(e,i,s){"INPUT"===s?(i.parentNode.insertBefore(e.element,i),t.detach(i),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")}function r(e,s,n,r,a){r=i(e.createElement,s,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&t.addClass([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(s.checked&&a.classList.add("e-check"),n.appendChild(a),s.label){var l=e("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function l(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function o(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c=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)}}(),h=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},p=new t.Observer,d={RTL:"e-rtl",BUTTON:"e-btn",PRIMARY:"e-primary",ICONBTN:"e-icon-btn"},u=function(e){function i(t,i){return e.call(this,t,i)||this}return c(i,e),i.prototype.preRender=function(){},i.prototype.render=function(){this.initialize(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+d.BUTTON}),this.renderComplete()},i.prototype.initialize=function(){if(this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(d.PRIMARY),!t.isBlazor()||t.isBlazor()&&"progress-btn"!==this.getModuleName()){if(this.content){var e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=e}this.setIconCss()}this.enableRtl&&this.element.classList.add(d.RTL),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},i.prototype.controlStatus=function(e){this.element.disabled=e},i.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(d.ICONBTN);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},i.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},i.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},i.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},i.prototype.destroy=function(){var i=[d.PRIMARY,d.RTL,d.ICONBTN,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,""));var s=this.element.querySelector("span.e-btn-icon");s&&t.detach(s),this.unWireEvents(),t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.getModuleName=function(){return"btn"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.Inject=function(){},i.prototype.onPropertyChanged=function(e,i){for(var n=this.element.querySelector("span.e-btn-icon"),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"isPrimary":e.isPrimary?this.element.classList.add(d.PRIMARY):this.element.classList.remove(d.PRIMARY);break;case"disabled":this.controlStatus(e.disabled);break;case"iconCss":n?e.iconCss?(n.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):t.detach(n):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&t.detach(n),this.setIconCss();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(d.RTL):this.element.classList.remove(d.RTL);break;case"content":s(this.element)||this.element.classList.remove(d.ICONBTN),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(e.content=t.SanitizeHtmlHelper.sanitize(e.content)),this.element.innerHTML=e.content,this.setIconCss());break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},h([t.Property("Left")],i.prototype,"iconPosition",void 0),h([t.Property("")],i.prototype,"iconCss",void 0),h([t.Property(!1)],i.prototype,"disabled",void 0),h([t.Property(!1)],i.prototype,"isPrimary",void 0),h([t.Property("")],i.prototype,"cssClass",void 0),h([t.Property("")],i.prototype,"content",void 0),h([t.Property(!1)],i.prototype,"isToggle",void 0),h([t.Property()],i.prototype,"locale",void 0),h([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),h([t.Event()],i.prototype,"created",void 0),i=h([t.NotifyPropertyChanges],i)}(t.Component),m=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,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},v="e-frame",y="e-ripple-container",b="e-checkbox-wrapper",g=["title","class","style","disabled","readonly","name","value"],C=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isMouseClick=!1,s}return m(s,e),s.prototype.changeState=function(e){var i,s,n=this.getWrapper().getElementsByClassName(v)[0];t.isRippleEnabled&&(s=this.getWrapper().getElementsByClassName(y)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),s&&(s.classList.remove("e-ripple-stop"),s.classList.add("e-ripple-check")),i="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),s&&t.removeClass([s],["e-ripple-check","e-ripple-stop"]),i="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),s&&(s.classList.remove("e-ripple-check"),s.classList.add("e-ripple-stop")),i="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",i)},s.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.updateVueArrayModel(!1),event:e};this.trigger("change",t),e.stopPropagation()},s.prototype.destroy=function(){var i=this,s=this.getWrapper();e.prototype.destroy.call(this),this.wrapper&&(s=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&s.parentNode&&s.parentNode.insertBefore(this.element,s),t.detach(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){i.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML=""))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},s.prototype.getModuleName=function(){return"checkbox"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},s.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&(this.element.setAttribute("value",this.value),this.isVue&&"boolean"==typeof this.value&&!0===this.value&&this.setProperties({checked:!0},!0)),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(b)||(e=this.createElement("div",{className:b,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}}),s=this.createElement("span",{className:"e-icons "+v});if(e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(i),i.appendChild(this.element),o(this,i),i.appendChild(s),t.isRippleEnabled){var n=this.createElement("span",{className:y});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,l(e,this.getWrapper().getElementsByClassName(y)[0])},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(y)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);l(e,t)}},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove("e-checkbox-disabled"),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=s.getElementsByClassName("e-label")[0],l=s.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?l.appendChild(a):l.insertBefore(a,s.getElementsByClassName(v)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":if(this.isVue&&"object"==typeof e.value)break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=i(this.createElement,"EJS-CHECKBOX","checkbox",e,b,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-checkbox-disabled"),e.setAttribute("aria-disabled","true")},s.prototype.setText=function(e){var i=this.getWrapper();if(i){var s=i.getElementsByClassName("e-label")[0];if(s)s.textContent=e;else{e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(v)[0]):n.appendChild(s)}}},s.prototype.changeHandler=function(e){e.stopPropagation()},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},s.prototype.unWireEvents=function(){var e=this.wrapper;t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var i=e.getElementsByTagName("label")[0];t.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),t.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByTagName("label")[0];t.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),t.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},s.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e){var i=this.value.indexOf(t);return this.checked?i<0&&this.value.push(t):i>-1&&this.value.splice(i,1),this.value}for(var s=0;s<this.value.length;s++)t===this.value[s]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.element.checked},s.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(g.indexOf(s)>-1){var n=this.getWrapper();"class"===s?t.addClass([n],this.htmlAttributes[s].split(" ")):"title"===s?n.setAttribute(s,this.htmlAttributes[s]):"style"===s?this.getWrapper().getElementsByClassName(v)[0].setAttribute(s,this.htmlAttributes[s]):this.element.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},f([t.Event()],s.prototype,"change",void 0),f([t.Event()],s.prototype,"created",void 0),f([t.Property(!1)],s.prototype,"checked",void 0),f([t.Property("")],s.prototype,"cssClass",void 0),f([t.Property(!1)],s.prototype,"disabled",void 0),f([t.Property(!1)],s.prototype,"indeterminate",void 0),f([t.Property("")],s.prototype,"label",void 0),f([t.Property("After")],s.prototype,"labelPosition",void 0),f([t.Property("")],s.prototype,"name",void 0),f([t.Property("")],s.prototype,"value",void 0),f([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),f([t.Property({})],s.prototype,"htmlAttributes",void 0),s=f([t.NotifyPropertyChanges],s)}(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)}}(),E=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},H=["title","class","style","disabled","readonly","name","value"],S=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s}k(s,e),n=s,s.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value");t=this.isVue&&t?this.element.value:this.value,this.trigger("change",{value:t,event:e}),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},s.prototype.updateChange=function(){for(var e,i,s=this.getRadioGroup(),r=0;r<s.length;r++)(e=s[r])!==this.element&&((i=t.getInstance(e,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var i=this,s=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),t.detach(s),this.element.checked=!1,["name","value","disabled"].forEach(function(e){i.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},s.prototype.getModuleName=function(){return"radio"},s.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,s=t.length;i<s;i++)if((e=t[i]).checked)return e.value;return""},s.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element?this.element.parentElement:null},s.prototype.getLabel=function(){return this.element?this.element.nextElementSibling:null},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var e=this.element.getAttribute("value");this.isVue&&e&&e===this.value&&(this.checked=!0),(this.isVue?this.value&&!e:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var e,i=this.element.parentElement;i.classList.contains("e-radio-wrapper")||(i=this.createElement("div",{className:"e-radio-wrapper"}),this.element.parentNode.insertBefore(i,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}});i.appendChild(this.element),i.appendChild(s),t.isRippleEnabled&&(e=this.createElement("span",{className:"e-ripple-container"}),s.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},s.prototype.labelRippleHandler=function(e){l(e,this.getLabel().getElementsByClassName("e-ripple-container")[0])},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=this.getLabel(),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"checked":e.checked&&this.updateChange(),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?n.classList.add("e-rtl"):n.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":if(!t.isNullOrUndefined(this.htmlAttributes)&&this.htmlAttributes.value)break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttribute()}},s.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=i(this.createElement,"EJS-RADIOBUTTON","radio",e,"e-radio-wrapper","radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var s=this.element.getAttribute("formcontrolname");s&&(this.setProperties({name:s},!0),this.element.setAttribute("name",s))}},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},s.prototype.setDisabled=function(){this.element.disabled=!0},s.prototype.setText=function(e){var i=this.getLabel(),s=i.getElementsByClassName("e-label")[0];s?s.textContent=e:(e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(H.indexOf(s)>-1){var n=this.element.parentElement;"class"===s?t.addClass([n],this.htmlAttributes[s].split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[s]):this.element.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler);var i=e.getElementsByClassName("e-label")[0];i&&(t.EventHandler.remove(i,"mousedown",this.labelRippleHandler),t.EventHandler.remove(i,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByClassName("e-label")[0];i&&(t.EventHandler.add(i,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(i,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()};var n;return E([t.Event()],s.prototype,"change",void 0),E([t.Event()],s.prototype,"created",void 0),E([t.Property(!1)],s.prototype,"checked",void 0),E([t.Property("")],s.prototype,"cssClass",void 0),E([t.Property(!1)],s.prototype,"disabled",void 0),E([t.Property("")],s.prototype,"label",void 0),E([t.Property("After")],s.prototype,"labelPosition",void 0),E([t.Property("")],s.prototype,"name",void 0),E([t.Property("")],s.prototype,"value",void 0),E([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),E([t.Property({})],s.prototype,"htmlAttributes",void 0),s=n=E([t.NotifyPropertyChanges],s)}(t.Component),A=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)}}(),P=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},L="e-ripple-container",N=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isDrag=!1,s}return A(i,e),i.prototype.changeState=function(e){var i,s,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(s=n.getElementsByClassName(L)[0]),e?(t.addClass([r,a],"e-switch-active"),i="true",this.element.checked=!0,this.checked=!0,s&&t.addClass([s],["e-ripple-check"])):(t.removeClass([r,a],"e-switch-active"),i="false",this.element.checked=!1,this.checked=!1,s&&t.removeClass([s],["e-ripple-check"])),n.setAttribute("aria-checked",i)},i.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"switch"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getWrapper=function(){return this.element.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains("e-switch-wrapper")||(e=this.createElement("div",{className:"e-switch-wrapper",attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var i=this.createElement("span",{className:"e-switch-inner"}),s=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),o(this,e),i.appendChild(s),i.appendChild(n),e.appendChild(i),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:L});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},i.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove("e-switch-disabled"),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "))}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH","e-switch-wrapper",e,this.getModuleName())},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},i.prototype.rippleHandler=function(e){l(e,this.getWrapper().getElementsByClassName(L)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isFocused=!1)},i.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(L)[0];if(t){var i=document.createEvent("MouseEvents");i.initEvent(e,!1,!0),t.dispatchEvent(i)}},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-switch-disabled"),e.setAttribute("aria-disabled","true")},i.prototype.setLabel=function(e,t){var i=this.getWrapper();e&&(i.querySelector(".e-switch-on").textContent=e),t&&(i.querySelector(".e-switch-off").textContent=t)},i.prototype.switchFocusHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.switchMouseUp=function(e){var t=e.target;"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},i.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},i.prototype.toggle=function(){this.clickHandler()},i.prototype.wireEvents=function(){var e=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},P([t.Event()],i.prototype,"change",void 0),P([t.Event()],i.prototype,"created",void 0),P([t.Property(!1)],i.prototype,"checked",void 0),P([t.Property("")],i.prototype,"cssClass",void 0),P([t.Property(!1)],i.prototype,"disabled",void 0),P([t.Property("")],i.prototype,"name",void 0),P([t.Property("")],i.prototype,"onLabel",void 0),P([t.Property("")],i.prototype,"offLabel",void 0),P([t.Property("")],i.prototype,"value",void 0),i=P([t.NotifyPropertyChanges],i)}(t.Component),x=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),T=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},w={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},O=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.multiSelectedChip=[],s}return x(i,e),i.prototype.preRender=function(){},i.prototype.chipType=function(){return this.chips&&this.chips.length&&this.chips.length>0},i.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",t.isBlazor()&&this.isServerRendered||(this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips,void 0)),this.wireEvent(!1),this.rippleFunction=t.rippleEffect(this.element,{selector:".e-chip"}),this.renderComplete()},i.prototype.createChip=function(){if(this.innerText=this.element.innerText.trim(),t.isBlazor())for(var e=this.element.querySelectorAll(".e-chip"),i=0;i<e.length;i++)null!=e[i]&&t.detach(e[i]);else this.element.innerHTML="";this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},i.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(w.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(w.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(w.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},i.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](w.rtl)},i.prototype.chipCreation=function(e){for(var i=[],s=0;s<e.length;s++){var n=this.getFieldValues(e[s]),r=this.elementCreation(n),a=(w.chip+" "+(n.enabled?" ":w.disabled)+" "+(n.avatarIconCss||n.avatarText?w.chipWrapper:n.leadingIconCss?w.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if(this.chipType()){var l=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});n.value&&l.setAttribute("data-value",n.value.toString()),t.append(r,l),i.push(l)}else i=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text),n.value&&this.element.setAttribute("data-value",n.value.toString())}t.append(i,this.element)},i.prototype.getFieldValues=function(e){var i=!("false"===this.enabled.toString());return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():this.chipType()?e.toString():this.innerText?this.innerText:this.text.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?i:"false"!==e.enabled.toString():i,value:"object"==typeof e&&e.value?e.value.toString():null,leadingIconUrl:"object"==typeof e&&e.leadingIconUrl?e.leadingIconUrl.toString():this.leadingIconUrl,trailingIconUrl:"object"==typeof e&&e.trailingIconUrl?e.trailingIconUrl.toString():this.trailingIconUrl}},i.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var i=(w.avatar+" "+e.avatarIconCss).trim(),s=this.createElement("span",{className:i});s.innerText=e.avatarText,t.push(s)}else if(e.leadingIconCss){var i=(w.icon+" "+e.leadingIconCss).trim(),n=this.createElement("span",{className:i});t.push(n)}else if(e.leadingIconUrl){i=(w.avatar+" image-url").trim();(n=this.createElement("span",{className:i})).style.backgroundImage="url("+e.leadingIconUrl+")",t.push(n)}var r=this.createElement("span",{className:w.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||this.chipType()&&this.enableDelete){var i=(w.delete+" "+(e.trailingIconCss?e.trailingIconCss:w.deleteIcon)).trim(),a=this.createElement("span",{className:i});t.push(a)}else if(e.trailingIconUrl){var i="trailing-icon-url".trim(),l=this.createElement("span",{className:i});l.style.backgroundImage="url("+e.trailingIconUrl+")",t.push(l)}return t},i.prototype.find=function(e){var t,i=e instanceof HTMLElement?e:this.element.querySelectorAll("."+w.chip)[e];return i&&this.chipType()&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(i),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=i),t},i.prototype.add=function(e){var t;if("chip"!==this.type){var i=e instanceof Array?e:[e];(t=this.chips).push.apply(t,i),this.chipCreation(i)}},i.prototype.select=function(e,t){this.onSelect(e,!1,t)},i.prototype.multiSelection=function(e){for(var t=this.element.querySelectorAll(".e-chip"),i=0;i<e.length;i++)if("string"==typeof e[i]){for(var s=0;s<t.length;s++)if(e[i]!==s&&e[i]===t[s].attributes[5].value){this.multiSelectedChip.push(s);break}}else this.multiSelectedChip.push(e[i])},i.prototype.onSelect=function(e,t,i){var s,n,r;if(this.chipType()&&"None"!==this.selection){if(t)for(var a=this.element.querySelectorAll("."+w.chip),l=0;l<a.length;l++)a[l].setAttribute("aria-selected","false"),a[l].classList.remove(w.active);for(var o=e instanceof Array?e:[e],l=0;l<o.length;l++){var c=o[l]instanceof HTMLElement?o[l]:this.element.querySelectorAll("."+w.chip)[o[l]];if("index"!==i)for(var h=0;h<this.chips.length;h++){n=this.element.querySelectorAll("."+w.chip)[h];var p=this.getFieldValues(this.chips[h]);"value"===i?null!==p.value&&(r=n.dataset.value):"text"===i&&(r=n.innerText),r===o[l].toString()&&(s=h,c=this.element.querySelectorAll("."+w.chip)[s])}c instanceof HTMLElement&&this.selectionHandler(c)}}},i.prototype.remove=function(e){var t=this;if(this.chipType()){var i=e instanceof Array?e:[e],s=[],n=this.element.querySelectorAll("."+w.chip);i.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&s.push(t)}),s.forEach(function(e){var i=t.element.querySelectorAll("."+w.chip),s=Array.prototype.slice.call(i).indexOf(e);t.deleteHandler(e,s)})}},i.prototype.getSelectedChips=function(){var e;if(this.chipType()&&"None"!==this.selection){for(var i={texts:[],Indexes:[],data:[],elements:[]},s=this.element.querySelectorAll("."+w.active),n=0;n<s.length;n++){var r=s[n];i.elements.push(r);var a=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(r);i.Indexes.push(a),i.data.push(this.chips[a]);var l="object"==typeof this.chips[a]?this.chips[a].text?this.chips[a].text.toString():null:this.chips[a].toString();i.texts.push(l)}var o={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(o.index)?void 0:"Multiple"===this.selection?i:o}return e},i.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},i.prototype.keyHandler=function(e){e.target.classList.contains(w.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},i.prototype.focusInHandler=function(e){e.classList.contains(w.focused)||e.classList.add(w.focused)},i.prototype.focusOutHandler=function(e){var i=t.closest(e.target,"."+w.chip),s=this.chipType()?this.element.querySelector("."+w.focused):this.element.classList.contains(w.focused)?this.element:null;i&&s&&s.classList.remove(w.focused)},i.prototype.clickHandler=function(e,i){var s=this;void 0===i&&(i=!1);var n=t.closest(e.target,"."+w.chip);if(n){var r=void 0;if(this.chipType())r=this.find(n);else{var a=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(n);r={text:this.innerText?this.innerText:this.text,element:n,data:this.text,index:a}}r.event=e,r.cancel=!1,this.trigger("beforeClick",r,function(n){n.cancel||(n.element=t.isBlazor()?t.getElement(n.element):n.element,s.clickEventHandler(n.element,e,i))})}},i.prototype.clickEventHandler=function(e,i,s){var n=this;if(this.chipType()){var r=this.find(e);if(r.event=i,(i.target.classList.contains(w.deleteIcon)?i.target:s?e.querySelector("."+w.deleteIcon):void 0)&&this.enableDelete){r.cancel=!1;var a=r;this.trigger("delete",a,function(i){if(!i.cancel){i.element=t.isBlazor()?t.getElement(i.element):i.element,n.deleteHandler(i.element,i.index),n.selectionHandler(e),r.selected=i.element.classList.contains(w.active);var s=r;n.trigger("click",s)}})}else if("None"!==this.selection){this.selectionHandler(e),r.selected=e.classList.contains(w.active);var l=r;this.trigger("click",l)}else{this.focusInHandler(e);o=r;this.trigger("click",o)}}else{this.focusInHandler(e);var o={text:this.innerText?this.innerText:this.text,element:e,data:this.text,event:i};this.trigger("click",o)}},i.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+w.active);t&&t!==e&&(t.classList.remove(w.active),t.setAttribute("aria-selected","false")),this.setProperties({selectedChips:null},!0)}else this.setProperties({selectedChips:[]},!0);e.classList.contains(w.active)?(e.classList.remove(w.active),e.setAttribute("aria-selected","false")):(e.classList.add(w.active),e.setAttribute("aria-selected","true")),this.updateSelectedChips()},i.prototype.updateSelectedChips=function(){for(var e,t=this.element.querySelectorAll(".e-chip"),i=[],s=[],n=null,r=0;r<t.length;r++){var a=this.element.querySelectorAll(".e-chip")[r];if("true"===a.getAttribute("aria-selected")){if(e=a.getAttribute("data-value"),"Single"===this.selection&&a.classList.contains("e-active")){n=e||r;break}n=e?s.push(e):i.push(r)}}this.setProperties({selectedChips:"Single"===this.selection?n:e?s:i},!0)},i.prototype.deleteHandler=function(e,i){this.allowServerDataBinding=!0,this.chips.splice(i,1),this.setProperties({chips:this.chips},!0),this.serverDataBind(),this.allowServerDataBinding=!1,t.isBlazor()&&this.isServerRendered||t.detach(e)},i.prototype.destroy=function(){if(t.removeClass([this.element],[w.chipSet,w.chip,w.rtl,w.multiSelection,w.singleSelection,w.disabled,w.chipWrapper,w.iconWrapper,w.active,w.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunction(),t.isBlazor())for(var i=this.chipType()?this.element.querySelectorAll(".e-chip"):this.element.querySelectorAll(".e-chip-text"),s=0;s<i.length;s++)null!=i[s]&&t.detach(i[s]);else e.prototype.destroy.call(this),this.element.innerHTML="",this.element.innerText=this.innerText},i.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"chip-list"},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":t.isBlazor()&&this.isServerRendered||(this.isServerRendered=!1,this.refresh(),this.isServerRendered=!0);break;case"cssClass":t.isBlazor()&&this.isServerRendered||(this.chipType()?(this.isServerRendered=!1,this.refresh(),this.isServerRendered=!0):(t.removeClass([this.element],i.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))));break;case"selectedChips":t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"),"Multiple"===this.selection?(this.multiSelectedChip=[],this.multiSelection(e.selectedChips),this.onSelect(this.multiSelectedChip,!0,void 0),this.updateSelectedChips()):this.onSelect(e.selectedChips,!0,void 0);break;case"enableRtl":this.setRtl()}},T([t.Property([])],i.prototype,"chips",void 0),T([t.Property("")],i.prototype,"text",void 0),T([t.Property("")],i.prototype,"avatarText",void 0),T([t.Property("")],i.prototype,"avatarIconCss",void 0),T([t.Property("")],i.prototype,"leadingIconCss",void 0),T([t.Property("")],i.prototype,"trailingIconCss",void 0),T([t.Property("")],i.prototype,"leadingIconUrl",void 0),T([t.Property("")],i.prototype,"trailingIconUrl",void 0),T([t.Property("")],i.prototype,"cssClass",void 0),T([t.Property(!0)],i.prototype,"enabled",void 0),T([t.Property([])],i.prototype,"selectedChips",void 0),T([t.Property("None")],i.prototype,"selection",void 0),T([t.Property(!1)],i.prototype,"enableDelete",void 0),T([t.Event()],i.prototype,"created",void 0),T([t.Event()],i.prototype,"click",void 0),T([t.Event()],i.prototype,"beforeClick",void 0),T([t.Event()],i.prototype,"delete",void 0),i=T([t.NotifyPropertyChanges],i)}(t.Component),R=function(){function e(){}return e}();return e.wrapperInitialize=i,e.getTextNode=s,e.destroy=n,e.preRender=r,e.createCheckBox=a,e.rippleMouseHandler=l,e.setHiddenInput=o,e.buttonObserver=p,e.Button=u,e.CheckBox=C,e.RadioButton=S,e.Switch=N,e.classNames=w,e.ChipList=O,e.Chip=R,e}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-popups.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.popups=function(t,e,i){"use strict";function o(t,i){var o=!1,n={left:0,top:0},s=t;if(!t||!i)return n;for(e.isNullOrUndefined(i.offsetParent)&&"fixed"===i.style.position&&(o=!0);(i.offsetParent||o)&&t&&i.offsetParent!==t;)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;for(t=s;(i.offsetParent||o)&&t&&i.offsetParent!==t;)n.left-=t.scrollLeft,n.top-=t.scrollTop,t=t.parentElement;return n}function n(t,e,i,o,n){if(Zt=void 0,Zt=n,ae=!!o,!t)return{left:0,top:0};e||(e="left"),i||(i="top"),Kt=t.ownerDocument,Gt=t;var s={left:0,top:0};return l(e.toLowerCase(),i.toLowerCase(),s)}function s(t,e){e.left=t}function r(t,e){e.top=t}function l(t,e,i){switch(Wt=Gt.getBoundingClientRect(),e+t){case"topcenter":s(m(),i),r(c(),i);break;case"topright":s(f(),i),r(c(),i);break;case"centercenter":s(m(),i),r(p(),i);break;case"centerright":s(f(),i),r(p(),i);break;case"centerleft":s(u(),i),r(p(),i);break;case"bottomcenter":s(m(),i),r(d(),i);break;case"bottomright":s(f(),i),r(d(),i);break;case"bottomleft":s(u(),i),r(d(),i);break;default:case"topleft":s(u(),i),r(c(),i)}return i}function a(){return Kt.documentElement.scrollTop||Kt.body.scrollTop}function h(){return Kt.documentElement.scrollLeft||Kt.body.scrollLeft}function d(){return ae?Wt.bottom:Wt.bottom+a()}function p(){return c()+Wt.height/2}function c(){return ae?Wt.top:Wt.top+a()}function u(){return Wt.left+h()}function f(){var t=Gt&&Gt.classList.contains("e-date-range-wrapper")?Zt?Zt.width:0:Zt&&Wt.width>=Zt.width?Zt.width:0;return Wt.right+h()-t}function m(){return u()+Wt.width/2}function g(t,e,i,o){if(void 0===e&&(e=null),void 0===i&&(i={X:!1,Y:!1}),!i.Y&&!i.X)return{left:0,top:0};var s=t.getBoundingClientRect();if(Qt=e,Jt=t.ownerDocument,o||(o=n(t,"left","top")),i.X){var r=Qt?T():A(),l=B(),a=R(),h=l-o.left,d=o.left+s.width-a;s.width>r?o.left=h>0&&d<=0?a-s.width:d>0&&h<=0?l:h>d?a-s.width:l:h>0?o.left+=h:d>0&&(o.left-=d)}if(i.Y){var p=Qt?P():L(),c=U(),u=k(),f=c-o.top,m=o.top+s.height-u;s.height>p?o.top=f>0&&m<=0?u-s.height:m>0&&f<=0?c:f>m?u-s.height:c:f>0?o.top+=f:m>0&&(o.top-=m)}return o}function v(t,e,i,o){void 0===e&&(e=null);var s=n(t,"left","top");i&&(s.left=i),o&&(s.top=o);var r=[];Qt=e,Jt=t.ownerDocument;var l=t.getBoundingClientRect(),a=s.top,h=s.left,d=s.left+l.width,p=N(a,s.top+l.height),c=C(h,d);return p.topSide&&r.push("top"),c.rightSide&&r.push("right"),c.leftSide&&r.push("left"),p.bottomSide&&r.push("bottom"),r}function y(t,e,i,o,n,s,r,l,a){if(void 0===r&&(r=null),void 0===l&&(l={X:!0,Y:!0}),e&&t&&n&&s&&(l.X||l.Y)){var h,d={TL:null,TR:null,BL:null,BR:null},p={TL:null,TR:null,BL:null,BR:null};if("none"===window.getComputedStyle(t).display){var c=t.style.visibility;t.style.visibility="hidden",t.style.display="block",h=t.getBoundingClientRect(),t.style.removeProperty("display"),t.style.visibility=c}else h=t.getBoundingClientRect();var u={posX:n,posY:s,offsetX:i,offsetY:o,position:{left:0,top:0}};Qt=r,Jt=e.ownerDocument,E(e,d,u,a,h),O(p,u,h),l.X&&w(e,p,d,u,h,!0),l.Y&&d.TL.top>-1&&S(e,p,d,u,h,!0),b(t,u,h)}}function b(t,e,i){var o=0,s=0;if(null!=t.offsetParent&&("absolute"===getComputedStyle(t.offsetParent).position||"relative"===getComputedStyle(t.offsetParent).position)){var r=n(t.offsetParent,"left","top",!1,i);o=r.left,s=r.top}t.style.top=e.position.top+e.offsetY-s+"px",t.style.left=e.position.left+e.offsetX-o+"px"}function E(t,e,i,o,s){i.position=n(t,i.posX,i.posY,o,s),e.TL=n(t,"left","top",o,s),e.TR=n(t,"right","top",o,s),e.BR=n(t,"left","bottom",o,s),e.BL=n(t,"right","bottom",o,s)}function O(t,e,i){t.TL={top:e.position.top+e.offsetY,left:e.position.left+e.offsetX},t.TR={top:t.TL.top,left:t.TL.left+i.width},t.BL={top:t.TL.top+i.height,left:t.TL.left},t.BR={top:t.TL.top+i.height,left:t.TL.left+i.width}}function C(t,e){var i=!1,o=!1;return t-M()<B()&&(i=!0),e>R()&&(o=!0),{leftSide:i,rightSide:o}}function w(t,e,i,o,s,r){var l=C(e.TL.left,e.TR.left);i.TL.left-M()<=B()&&(l.leftSide=!1),i.TR.left>R()&&(l.rightSide=!1),(l.leftSide&&!l.rightSide||!l.leftSide&&l.rightSide)&&("right"===o.posX?o.posX="left":o.posX="right",o.offsetX=o.offsetX+s.width,o.offsetX=-1*o.offsetX,o.position=n(t,o.posX,o.posY,!1),O(e,o,s),r&&w(t,e,i,o,s,!1))}function S(t,e,i,o,s,r){var l=N(e.TL.top,e.BL.top);i.TL.top-z()<=U()&&(l.topSide=!1),i.BL.top>=k()&&t.getBoundingClientRect().bottom<window.innerHeight&&(l.bottomSide=!1),(l.topSide&&!l.bottomSide||!l.topSide&&l.bottomSide)&&("top"===o.posY?o.posY="bottom":o.posY="top",o.offsetY=o.offsetY+s.height,o.offsetY=-1*o.offsetY,o.position=n(t,o.posX,o.posY,!1,s),O(e,o,s),r&&S(t,e,i,o,s,!1))}function N(t,e){var i=!1,o=!1;return t-z()<U()&&(i=!0),e>k()&&(o=!0),{topSide:i,bottomSide:o}}function T(){return Qt.getBoundingClientRect().width}function P(){return Qt.getBoundingClientRect().height}function x(){return Qt.getBoundingClientRect().left}function H(){return Qt.getBoundingClientRect().top}function U(){return Qt?H():0}function B(){return Qt?x():0}function R(){return Qt?M()+x()+T():M()+A()}function k(){return Qt?z()+H()+P():z()+L()}function z(){return Jt.documentElement.scrollTop||Jt.body.scrollTop}function M(){return Jt.documentElement.scrollLeft||Jt.body.scrollLeft}function L(){return window.innerHeight}function A(){var t=window.innerWidth,i=document.documentElement.getBoundingClientRect();return t-(t-(e.isNullOrUndefined(document.documentElement)?0:i.width))}function I(t,e){for(var i=getComputedStyle(t),o=[],n=/(auto|scroll)/,s=t.parentElement;s&&"HTML"!==s.tagName;){var r=getComputedStyle(s);"absolute"===i.position&&"static"===r.position||!n.test(r.overflow+r.overflowY+r.overflowX)||o.push(s),s=s.parentElement}return e||o.push(document),o}function Y(t){for(var i=t.parentElement,o=[];i&&"BODY"!==i.tagName;){var n=document.defaultView.getComputedStyle(i,null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(i,null).getPropertyValue("position");"auto"!==n&&"static"!==s&&o.push(n),i=i.parentElement}for(var r=[],l=0;l<document.body.children.length;l++)if(!t.isEqualNode(document.body.children[l])){var n=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("position");"auto"!==n&&"static"!==s&&r.push(n)}r.push("999");var a=[];if(!e.isNullOrUndefined(t.parentElement)&&"BODY"!==t.parentElement.tagName)for(var h=[].slice.call(t.parentElement.children),l=0;l<h.length;l++)if(!t.isEqualNode(h[l])){var n=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("position");"auto"!==n&&"static"!==s&&a.push(n)}var d=o.concat(r,a),p=Math.max.apply(Math,d)+1;return p>2147483647?2147483647:p}function X(t){void 0===t&&(t=["*"]);for(var e=[],i=0;i<t.length;i++)for(var o=document.getElementsByTagName(t[i]),n=0;n<o.length;n++){var s=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("z-index"),r=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("position");"auto"!==s&&"static"!==r&&e.push(s)}var l=Math.max.apply(Math,e)+1;return l>2147483647?2147483647:l}function D(t){Te=t.resizeBegin,Pe=t.resizing,xe=t.resizeComplete,$t=q(t.element),se=q(t.boundary);for(var i=t.direction.split(" "),o=0;o<i.length;o++)if(be.indexOf(i[o])>=0&&i[o])j(i[o]);else if(""!==i[o].trim()){var n=e.createElement("div",{className:"e-icons "+me+" e-"+i[o]});$t.appendChild(n)}ee=t.minHeight,oe=t.minWidth,ne=t.maxWidth,ie=t.maxHeight,t.proxy&&t.proxy.element&&t.proxy.element.classList.contains("e-dialog")?F(t.proxy):F()}function j(t){Z();var i=e.createElement("span",{attrs:{unselectable:"on",contenteditable:"false"}});i.setAttribute("class","e-dialog-border-resize e-"+t),"south"===t&&(i.style.height="2px",i.style.width="100%",i.style.bottom="0px",i.style.left="0px"),"north"===t&&(i.style.height="2px",i.style.width="100%",i.style.top="0px",i.style.left="0px"),"east"===t&&(i.style.height="100%",i.style.width="2px",i.style.right="0px",i.style.top="0px"),"west"===t&&(i.style.height="100%",i.style.width="2px",i.style.left="0px",i.style.top="0px"),$t.appendChild(i)}function q(t){var i;return e.isNullOrUndefined(t)||(i="string"==typeof t?document.querySelector(t):t),i}function F(t){e.isNullOrUndefined(t)&&(t=this);for(var i=$t.querySelectorAll("."+me),o=0;o<i.length;o++){te=i[o],e.EventHandler.add(te,"mousedown",V,t);s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.add(te,s,G,t)}var n=$t.querySelectorAll(".e-dialog-border-resize");if(!e.isNullOrUndefined(n))for(o=0;o<n.length;o++){te=n[o],e.EventHandler.add(te,"mousedown",V,t);var s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.add(te,s,G,t)}}function _(t){return t.indexOf("mouse")>-1?"mouse":"touch"}function V(t){if(t.preventDefault(),$t=t.target.parentElement,Z(),Se=t.pageX,Ne=t.pageY,t.target.classList.add(ge),e.isNullOrUndefined(Te)||(le=this,!0!==Te(t,le))){var i=e.isNullOrUndefined(se)?document:se;e.EventHandler.add(i,"mousemove",K,this),e.EventHandler.add(document,"mouseup",W,this);for(var o=0;o<ve.length;o++)He=!$t.classList.contains(ve[o])}}function W(t){var i="msie"===e.Browser.info.name?"pointermove":"touchmove",o="msie"===e.Browser.info.name?"pointerup":"touchend",n=e.isNullOrUndefined(se)?document:se,s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.remove(n,"mousemove",K),e.EventHandler.remove(n,i,K),e.EventHandler.remove(n,s,K),e.isNullOrUndefined(document.body.querySelector("."+ge))||document.body.querySelector("."+ge).classList.remove(ge),e.isNullOrUndefined(xe)||xe(t,le=this),e.EventHandler.remove(document,"mouseup",W),e.EventHandler.remove(document,o,W)}function Z(){Ee=parseFloat(getComputedStyle($t,null).getPropertyValue("width").replace("px","")),Oe=parseFloat(getComputedStyle($t,null).getPropertyValue("height").replace("px","")),Ce=$t.getBoundingClientRect().left,we=$t.getBoundingClientRect().top}function G(t){$t=t.target.parentElement,Z();var i=t.touches?t.changedTouches[0]:t;if(Se=i.pageX,Ne=i.pageY,e.isNullOrUndefined(Te)||(le=this,!0!==Te(t,le))){var o="msie"===e.Browser.info.name?"pointermove":"touchmove",n="msie"===e.Browser.info.name?"pointerup":"touchend",s=e.isNullOrUndefined(se)?document:se;e.EventHandler.add(s,o,K,this),e.EventHandler.add(document,n,W)}}function K(t){if(t.target.classList.contains(me)&&t.target.classList.contains(ge)?te=t.target:e.isNullOrUndefined(document.body.querySelector("."+ge))||(te=document.body.querySelector("."+ge)),!e.isNullOrUndefined(te)){for(var i="",o=0;o<fe.length;o++)te.classList.contains("e-"+fe[o])&&(i=fe[o]);switch(e.isNullOrUndefined(Pe)||Pe(t,le=this),i){case"south":Q(t);break;case"north":$(t);break;case"west":tt(t);break;case"east":et(t);break;case"south-east":Q(t),et(t);break;case"south-west":Q(t),tt(t);break;case"north-east":$(t),et(t);break;case"north-west":$(t),tt(t)}}}function J(t){return t.getBoundingClientRect()}function Q(t){var i,o=document.documentElement.clientHeight,n=!1,s=(t.touches?t.changedTouches[0]:t).pageY,r=J($t);e.isNullOrUndefined(se)||(i=J(se)),e.isNullOrUndefined(se)?e.isNullOrUndefined(se)&&(o-s>=0||r.top<0)&&(n=!0):n=!0;var l=Oe+(s-Ne);l=l>ee?l:ee;var a=0;e.isNullOrUndefined(se)||(a=i.top);var h=e.isNullOrUndefined(se)?0:se.offsetHeight-se.clientHeight,d=r.top-a-h/2;if(d=d<0?0:d,r.top>0&&d+l>ie){if(n=!1,$t.classList.contains(ye))return;return void($t.style.height=ie-parseInt(d.toString(),10)+"px")}var p=0;if(n){r.top<0&&o+(r.height+r.top)>0&&l+(p=r.top)<=30&&(l=r.height-(r.height+r.top)+30),l+r.top>=ie&&($t.style.height=r.height+(o-(r.height+r.top))+"px");var c=e.isNullOrUndefined(se)?p:d;l>=ee&&l+c<=ie&&($t.style.height=l+"px")}}function $(t){var i,o=!1,n="mouse"===_(t.type)?t.pageY:t.touches[0].pageY,s=J($t);e.isNullOrUndefined(se)||(i=J(se)),!e.isNullOrUndefined(se)&&s.top-i.top>0?o=!0:e.isNullOrUndefined(se)&&n>0&&(o=!0);var r=Oe-(n-Ne);if(o&&r>=ee&&r<=ie){var l=0;e.isNullOrUndefined(se)||(l=i.top);var a=we-l+(n-Ne);a=a>0?a:1,$t.style.height=r+"px",$t.style.top=a+"px"}}function tt(t){var i,o=document.documentElement.clientWidth,n=!1;e.isNullOrUndefined(se)||(i=J(se));var s="mouse"===_(t.type)?t.pageX:t.touches[0].pageX,r=J($t),l=e.isNullOrUndefined(se)?0:se.offsetWidth-se.clientWidth,a=e.isNullOrUndefined(se)?0:i.left,h=e.isNullOrUndefined(se)?0:i.width;e.isNullOrUndefined(re)&&(e.isNullOrUndefined(se)?re=o:(re=r.left-a-l/2+r.width,re+=h-l-re)),!e.isNullOrUndefined(se)&&Math.floor(r.left-i.left+r.width+(i.right-r.right))-l<=ne?n=!0:e.isNullOrUndefined(se)&&s>=0&&(n=!0);var d=Ee-(s-Se);if(He&&(d=d>re?re:d),n&&d>=oe&&d<=ne){var p=0;e.isNullOrUndefined(se)||(p=i.left);var c=Ce-p+(s-Se);c=c>0?c:1,d!==Ue&&Be&&($t.style.width=d+"px"),He&&($t.style.left=c+"px",Be=1!==c)}Ue=d}function et(t){var i,o=document.documentElement.clientWidth,n=!1;e.isNullOrUndefined(se)||(i=J(se));var s=(t.touches?t.changedTouches[0]:t).pageX,r=J($t);!e.isNullOrUndefined(se)&&(r.left-i.left+r.width<=ne||r.right-i.left>=r.width)?n=!0:e.isNullOrUndefined(se)&&o-s>0&&(n=!0);var l=Ee+(s-Se),a=0;if(e.isNullOrUndefined(se)||(a=i.left),r.left-a+l>ne){if(n=!1,$t.classList.contains(ye))return;$t.style.width=ne-(r.left-a)+"px"}n&&l>=oe&&l<=ne&&($t.style.width=l+"px")}function it(t){ee=t}function ot(t){ne=t}function nt(t){ie=t}function st(){for(var t=$t.querySelectorAll("."+me),i=0;i<t.length;i++)e.detach(t[i]);var o=$t.querySelectorAll(".e-dialog-border-resize");if(!e.isNullOrUndefined(o))for(i=0;i<o.length;i++)e.detach(o[i])}function rt(t,e,i,o){switch(t){case"Create":lt({type:o,target:document.querySelector(e.target),cssClass:e.cssClass,label:e.label,width:e.width});break;case"Show":Dt(document.querySelector(i));break;case"Hide":qt(document.querySelector(i));break;case"Set":Ft({cssClass:e.cssClass,type:o})}}function lt(t,i){if(t.target){var o,n=e.isNullOrUndefined(i)?e.createElement:i,s=xt(t.target,n);if(e.isNullOrUndefined(t.cssClass)||s.wrap.classList.add(t.cssClass),e.isNullOrUndefined(t.template)&&e.isNullOrUndefined(mi)){var r=e.isNullOrUndefined(t.type)?mt(s.wrap):t.type;o=wt(e.isNullOrUndefined(t.width)?void 0:t.width,r),gt(r,s.wrap,o,n),e.isNullOrUndefined(t.label)||at(s.inner_wrap,t.label,n)}else{var l=e.isNullOrUndefined(t.template)?mi:t.template;s.wrap.classList.add(fi),Ct(s.wrap,l,gi)}s.wrap.classList.add(ii),s=null}}function at(t,e,i){var o=i("div",{});return o.classList.add(ui),o.innerHTML=e,t.appendChild(o),o}function ht(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Material",radius:e},Pt(t,o,i,oi),Bt(e,t,"Material",oi)}function dt(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Bootstrap4",radius:e},Pt(t,o,i,li),Bt(e,t,"Bootstrap4",li)}function pt(t,e,i){var o={};Ke[e].timeOut=0,o[e]=St(e,i,0,0),Ht({uniqueID:e,container:t,globalInfo:o,timeOutVar:0})}function ct(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Fabric",radius:e},Tt(t,o,ni,i),At(e,t,ni)}function ut(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Tailwind",radius:e},Tt(t,o,si,i),At(e,t,si)}function ft(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"HighContrast",radius:e},Tt(t,o,ai,i),At(e,t,ai)}function mt(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")}function gt(t,i,o,n){var s=i.querySelector("."+di),r=s.querySelector("svg");switch(e.isNullOrUndefined(r)||s.removeChild(r),t){case"Material":ht(s,o,n);break;case"Fabric":ct(s,o,n);break;case"Bootstrap":vt(s,o,n);break;case"HighContrast":ft(s,o,n);break;case"Bootstrap4":dt(s,o,n);break;case"Tailwind":case"Tailwind-dark":ut(s,o,n)}}function vt(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Bootstrap",radius:e},yt(t,o,i),bt(t,e)}function yt(t,e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("id",e),o.setAttribute("class",ri),o.setAttribute("viewBox","0 0 64 64"),t.insertBefore(o,t.firstChild);for(var n=0;n<=7;n++){var s=document.createElementNS("http://www.w3.org/2000/svg","circle");s.setAttribute("class",pi+"_"+n),s.setAttribute("r","2"),s.setAttribute("transform","translate(32,32)"),o.appendChild(s)}}function bt(t,e){var i=t.querySelector("svg.e-spin-bootstrap");i.style.width=i.style.height=e+"px";for(var o=90,n=0;n<=7;n++){var s=It(0,0,24,o),r=i.querySelector("."+pi+"_"+n);r.setAttribute("cx",s.x+""),r.setAttribute("cy",s.y+""),o=o>=360?0:o,o+=45}}function Et(t,e){function i(t){o.push(t),t===s&&1!==l||(t<=n&&t>1&&!r?t=parseFloat((t-.2).toFixed(2)):1===t?(t=7,t=parseFloat((t+.2).toFixed(2)),r=!0):t<8&&r?8===(t=parseFloat((t+.2).toFixed(2)))&&(r=!1):t<=8&&!r&&(t=parseFloat((t-.2).toFixed(2))),++l,i(t))}var o=[],n=t,s=e,r=!1,l=1;return i(n),o}function Ot(t){for(var e=t.querySelector("svg.e-spin-bootstrap").getAttribute("id"),i=1;i<=8;i++)!function(t,e,i,o,n){function s(e){Ke[n].isAnimate&&(++r,t.setAttribute("r",e+""),r>=o.length&&(r=0),Ke[n].timeOut=setTimeout(s.bind(null,o[r]),18))}var r=0;s(e)}(t.getElementsByClassName("e-path-circle_"+(8===i?0:i))[0],i,0,Et(i,i),e)}function Ct(t,i,o){e.isNullOrUndefined(o)||t.classList.add(o),t.querySelector(".e-spinner-inner").innerHTML=i}function wt(t,e){var i;switch(e){case"Material":i=Je;break;case"Fabric":i=Qe;break;case"Tailwind":case"Tailwind-dark":i=Qe;break;case"Bootstrap4":i=ti;break;default:i=$e}return t=t?parseFloat(t+""):i,"Bootstrap"===e?t:t/2}function St(t,e,i,o){return{radius:e,count:i,previousId:o}}function Nt(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function Tt(t,e,i,o){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("id",e),n.setAttribute("class",i);var s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("class",pi);var r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("class",ci),t.insertBefore(n,t.firstChild),n.appendChild(s),n.appendChild(r)}function Pt(t,e,i,o){var n=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("class",o),n.setAttribute("id",e),s.setAttribute("class",pi),t.insertBefore(n,t.firstChild),n.appendChild(s)}function xt(t,e){var i=e("div",{}),o=e("div",{});return i.classList.add(hi),o.classList.add(di),t.appendChild(i),i.appendChild(o),{wrap:i,inner_wrap:o}}function Ht(t){Ut(1,149,Lt,1333,t.globalInfo[t.uniqueID].count,75,t),t.globalInfo[t.uniqueID].count=++t.globalInfo[t.uniqueID].count%4}function Ut(t,i,o,n,s,r,l){function a(e){var i=Math.max(0,Math.min((new Date).getTime()-p,n));h(o(i,t,c,n),e.container),d===e.globalInfo[e.uniqueID].previousId&&i<n?Ke[e.uniqueID].timeOut=setTimeout(a.bind(null,e),1):Ht(e)}function h(t,i){if(!e.isNullOrUndefined(i.querySelector("svg.e-spin-material"))&&!e.isNullOrUndefined(i.querySelector("svg.e-spin-material").querySelector("path.e-path-circle"))){var o=i.querySelector("svg.e-spin-material").querySelector("path.e-path-circle");o.setAttribute("stroke-dashoffset",Mt(u,f,t,r)+""),o.setAttribute("transform","rotate("+m+" "+u/2+" "+u/2+")")}}var d=++l.globalInfo[l.uniqueID].previousId,p=(new Date).getTime(),c=i-t,u=Rt(2*l.globalInfo[l.uniqueID].radius+""),f=zt(u),m=-90*(l.globalInfo[l.uniqueID].count||0);a(l)}function Bt(t,e,i,o){var n=2*t,s=e.querySelector("svg."+o),r=s.querySelector("path.e-path-circle"),l=zt(n),a=n/2+"px";s.setAttribute("viewBox","0 0 "+n+" "+n),s.style.width=s.style.height=n+"px",s.style.transformOrigin=a+" "+a+" "+a,r.setAttribute("d",kt(n,l)),"Material"===i&&(r.setAttribute("stroke-width",l+""),r.setAttribute("stroke-dasharray",(n-l)*Math.PI*.75+""),r.setAttribute("stroke-dashoffset",Mt(n,l,1,75)+""))}function Rt(t){return parseFloat(t)}function kt(t,e){var i=t/2,o=e/2;return"M"+i+","+o+"A"+(i-o)+","+(i-o)+" 0 1 1 "+o+","+i}function zt(t){return.1*t}function Mt(t,e,i,o){return(t-e)*Math.PI*(3*o/100-i/100)}function Lt(t,e,i,o){var n=(t/=o)*t,s=n*t;return e+i*(6*s*n+-15*n*n+10*s)}function At(t,e,i){var o=t,n=t,s=2*t,r=e.querySelector("."+i),l=r.querySelector(".e-path-circle"),a=r.querySelector(".e-path-arc"),h=s/2+"px";l.setAttribute("d",Xt(o,n,t)),a.setAttribute("d",Yt(o,n,t,315,45)),r.setAttribute("viewBox","0 0 "+s+" "+s),r.style.transformOrigin=h+" "+h+" "+h,r.style.width=r.style.height=s+"px"}function It(t,e,i,o){var n=(o-90)*Math.PI/180;return{x:t+i*Math.cos(n),y:e+i*Math.sin(n)}}function Yt(t,e,i,o,n){var s=It(t,e,i,n),r=It(t,e,i,o);return["M",s.x,s.y,"A",i,i,0,0,0,r.x,r.y].join(" ")}function Xt(t,e,i){return["M",t,e,"m",-i,0,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0].join(" ")}function Dt(t){jt(t,!1),t=null}function jt(t,i){var o;if(t&&(o=t.classList.contains(hi)?t:t.querySelector("."+hi)),t&&o){var n=o.querySelector("."+di);if(i?!o.classList.contains(fi)&&!o.classList.contains(ii):!o.classList.contains(fi)&&!o.classList.contains(ei)){var s=o.querySelector("svg");if(e.isNullOrUndefined(s))return;var r=s.getAttribute("id");switch(Ke[r].isAnimate=!i,Ke[r].type){case"Material":i?clearTimeout(Ke[r].timeOut):pt(n,r,Ke[r].radius);break;case"Bootstrap":i?clearTimeout(Ke[r].timeOut):Ot(n)}}i?e.classList(o,[ii],[ei]):e.classList(o,[ei],[ii]),t=null}}function qt(t){jt(t,!0),t=null}function Ft(t,i){var o=e.isNullOrUndefined(i)?e.createElement:i;void 0!==t.template&&(mi=t.template,void 0!==t.template&&(gi=t.cssClass));for(var n=document.querySelectorAll("."+hi),s=0;s<n.length;s++)_t(t.template,n[s],t.type,t.cssClass,o)}function _t(t,i,o,n,s){e.isNullOrUndefined(t)&&!i.classList.contains(fi)?(Vt(i,o,n,s),i.classList.contains(ei)?(i.classList.remove(ei),Dt(i)):(i.classList.remove(ii),qt(i))):(mi=t,e.isNullOrUndefined(n)||(gi=n))}function Vt(t,i,o,n){e.isNullOrUndefined(o)||t.classList.add(o);var s=t.querySelector("svg"),r="Bootstrap"===i?parseFloat(s.style.height):parseFloat(s.style.height)/2;if(s.getAttribute("class").split(/\s/).indexOf("e-spin-material")>=0){var l=s.getAttribute("id");clearTimeout(Ke[l].timeOut)}gt(i,t,r,n)}var Wt,Zt,Gt,Kt,Jt,Qt,$t,te,ee,ie,oe,ne,se,re,le,ae=!1,he=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),de=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},pe=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return he(i,t),de([e.Property("left")],i.prototype,"X",void 0),de([e.Property("top")],i.prototype,"Y",void 0),i}(e.ChildProperty),ce={ROOT:"e-popup",RTL:"e-rtl",OPEN:"e-popup-open",CLOSE:"e-popup-close"},ue=function(t){function i(e,i){return t.call(this,i,e)||this}return he(i,t),i.prototype.onPropertyChanged=function(t,i){for(var o=0,n=Object.keys(t);o<n.length;o++)switch(n[o]){case"width":e.setStyleAttribute(this.element,{width:e.formatUnit(t.width)});break;case"height":e.setStyleAttribute(this.element,{height:e.formatUnit(t.height)});break;case"zIndex":e.setStyleAttribute(this.element,{zIndex:t.zIndex});break;case"enableRtl":this.setEnableRtl();break;case"position":case"relateTo":this.refreshPosition();break;case"offsetX":var s=t.offsetX-i.offsetX;this.element.style.left=(parseInt(this.element.style.left,10)+s).toString()+"px";break;case"offsetY":var r=t.offsetY-i.offsetY;this.element.style.top=(parseInt(this.element.style.top,10)+r).toString()+"px";break;case"content":this.setContent();break;case"actionOnScroll":"none"!==t.actionOnScroll?this.wireScrollEvents():this.unwireScrollEvents()}},i.prototype.getModuleName=function(){return"popup"},i.prototype.resolveCollision=function(){this.checkCollision()},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.destroy=function(){this.element.classList.remove(ce.ROOT,ce.RTL,ce.OPEN,ce.CLOSE),this.unwireEvents(),t.prototype.destroy.call(this)},i.prototype.render=function(){this.element.classList.add(ce.ROOT);var t={};1e3!==this.zIndex&&(t.zIndex=this.zIndex),"auto"!==this.width&&(t.width=e.formatUnit(this.width)),"auto"!==this.height&&(t.height=e.formatUnit(this.height)),e.setStyleAttribute(this.element,t),this.fixedParent=!1,this.setEnableRtl(),this.setContent()},i.prototype.wireEvents=function(){e.Browser.isDevice&&e.EventHandler.add(window,"orientationchange",this.orientationOnChange,this),"none"!==this.actionOnScroll&&this.wireScrollEvents()},i.prototype.wireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,i=this.getScrollableParent(this.getRelateToElement());t<i.length;t++){var o=i[t];e.EventHandler.add(o,"scroll",this.scrollRefresh,this)}},i.prototype.unwireEvents=function(){e.Browser.isDevice&&e.EventHandler.remove(window,"orientationchange",this.orientationOnChange),"none"!==this.actionOnScroll&&this.unwireScrollEvents()},i.prototype.unwireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,i=this.getScrollableParent(this.getRelateToElement());t<i.length;t++){var o=i[t];e.EventHandler.remove(o,"scroll",this.scrollRefresh)}},i.prototype.getRelateToElement=function(){var t=""===this.relateTo||e.isNullOrUndefined(this.relateTo)?document.body:this.relateTo;return this.setProperties({relateTo:t},!0),"string"==typeof this.relateTo?document.querySelector(this.relateTo):this.relateTo},i.prototype.scrollRefresh=function(t){if("reposition"===this.actionOnScroll?e.isNullOrUndefined(this.element)||this.element.offsetParent===t.target||this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&null==t.target.parentElement||this.refreshPosition():"hide"===this.actionOnScroll&&this.hide(),"none"!==this.actionOnScroll&&this.getRelateToElement()){var i=this.isElementOnViewport(this.getRelateToElement(),t.target);i||this.targetInvisibleStatus?i&&(this.targetInvisibleStatus=!1):(this.trigger("targetExitViewport"),this.targetInvisibleStatus=!0)}},i.prototype.isElementOnViewport=function(t,e){for(var i=this.getScrollableParent(t),o=0;o<i.length;o++)if(!this.isElementVisible(t,i[o]))return!1;return!0},i.prototype.isElementVisible=function(t,i){var o=this.checkGetBoundingClientRect(t);if(!o.height||!o.width)return!1;if(e.isNullOrUndefined(this.checkGetBoundingClientRect(i))){var s=window,r={top:s.scrollY,left:s.scrollX,right:s.scrollX+s.outerWidth,bottom:s.scrollY+s.outerHeight},l=n(t),a={top:l.top,left:l.left,right:l.left+o.width,bottom:l.top+o.height},h={top:r.bottom-a.top,left:r.right-a.left,bottom:a.bottom-r.top,right:a.right-r.left};return h.top>0&&h.left>0&&h.right>0&&h.bottom>0}var d=i.getBoundingClientRect();return!(o.bottom<d.top||o.bottom>d.bottom||o.right>d.right||o.left<d.left)},i.prototype.preRender=function(){},i.prototype.setEnableRtl=function(){this.reposition(),this.enableRtl?this.element.classList.add(ce.RTL):this.element.classList.remove(ce.RTL)},i.prototype.setContent=function(){e.isNullOrUndefined(this.content)||(this.element.innerHTML="","string"==typeof this.content?this.element.textContent=this.content:this.element.appendChild(this.content))},i.prototype.orientationOnChange=function(){var t=this;setTimeout(function(){t.refreshPosition()},200)},i.prototype.refreshPosition=function(t,i){e.isNullOrUndefined(t)||this.checkFixedParent(t),this.reposition(),i||this.checkCollision()},i.prototype.reposition=function(){var t,i,o=this.getRelateToElement();if("number"==typeof this.position.X&&"number"==typeof this.position.Y)t={left:this.position.X,top:this.position.Y};else if("string"==typeof this.position.X&&"number"==typeof this.position.Y||"number"==typeof this.position.X&&"string"==typeof this.position.Y){var n=void 0,s=this.element.style.display;this.element.style.display="block",this.element.classList.contains("e-dlg-modal")&&(n=this.element.parentElement.style.display,this.element.parentElement.style.display="block"),i=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY),t="string"==typeof this.position.X?{left:i.left,top:this.position.Y}:{left:this.position.X,top:i.top},this.element.style.display=s,this.element.classList.contains("e-dlg-modal")&&(this.element.parentElement.style.display=n)}else if(o){s=this.element.style.display;this.element.style.display="block",t=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY),this.element.style.display=s}else t={left:0,top:0};e.isNullOrUndefined(t)||(this.element.style.left=t.left+"px",this.element.style.top=t.top+"px")},i.prototype.checkGetBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return null}},i.prototype.getAnchorPosition=function(t,i,s,r,l){var a=this.checkGetBoundingClientRect(i),h=this.checkGetBoundingClientRect(t);if(e.isNullOrUndefined(a)||e.isNullOrUndefined(h))return null;var d=t,p={left:0,top:0};switch(i.offsetParent&&"BODY"===i.offsetParent.tagName&&"BODY"===t.tagName?p=n(t):(i.classList.contains("e-dlg-modal")&&"BODY"!==d.tagName&&(i=i.parentElement),p=o(d,i)),s.X){default:case"left":break;case"center":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.left+=window.innerWidth/2-a.width/2:"container"===this.targetType?p.left+=h.width/2-a.width/2:p.left+=h.width/2;break;case"right":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.left+=window.innerWidth-a.width:"container"===this.targetType?p.left+=h.width-a.width:p.left+=h.width}switch(s.Y){default:case"top":break;case"center":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.top+=window.innerHeight/2-a.height/2:"container"===this.targetType?p.top+=h.height/2-a.height/2:p.top+=h.height/2;break;case"bottom":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.top+=window.innerHeight-a.height:"container"===this.targetType?p.top+=h.height-a.height:p.top+=h.height}return p.left+=r,p.top+=l,p},i.prototype.callFlip=function(t){var e=this.getRelateToElement();y(this.element,e,this.offsetX,this.offsetY,this.position.X,this.position.Y,this.viewPortElement,t,this.fixedParent)},i.prototype.callFit=function(t){if(0!==v(this.element,this.viewPortElement).length)if(e.isNullOrUndefined(this.viewPortElement)){var i=g(this.element,this.viewPortElement,t);t.X&&(this.element.style.left=i.left+"px"),t.Y&&(this.element.style.top=i.top+"px")}else{var o=this.checkGetBoundingClientRect(this.element),n=this.checkGetBoundingClientRect(this.viewPortElement);if(e.isNullOrUndefined(o)||e.isNullOrUndefined(n))return null;t&&!0===t.Y&&(n.top>o.top?this.element.style.top="0px":n.bottom<o.bottom&&(this.element.style.top=parseInt(this.element.style.top,10)-(o.bottom-n.bottom)+"px")),t&&!0===t.X&&(n.right<o.right?this.element.style.left=parseInt(this.element.style.left,10)-(o.right-n.right)+"px":n.left>o.left&&(this.element.style.left=parseInt(this.element.style.left,10)+(n.left-o.left)+"px"))}},i.prototype.checkCollision=function(){var t=this.collision.X,e=this.collision.Y;"none"===t&&"none"===e||("flip"===t&&"flip"===e?this.callFlip({X:!0,Y:!0}):"fit"===t&&"fit"===e?this.callFit({X:!0,Y:!0}):("flip"===t?this.callFlip({X:!0,Y:!1}):"flip"===e&&this.callFlip({Y:!0,X:!1}),"fit"===t?this.callFit({X:!0,Y:!1}):"fit"===e&&this.callFit({X:!1,Y:!0})))},i.prototype.show=function(t,i){var o=this;if(this.wireEvents(),1e3===this.zIndex||!e.isNullOrUndefined(i)){var n=e.isNullOrUndefined(i)?this.element:i;this.zIndex=Y(n),e.setStyleAttribute(this.element,{zIndex:this.zIndex})}t=e.isNullOrUndefined(t)||"object"!=typeof t?this.showAnimation:t,"none"===this.collision.X&&"none"===this.collision.Y||(e.removeClass([this.element],ce.CLOSE),e.addClass([this.element],ce.OPEN),this.checkCollision(),e.removeClass([this.element],ce.OPEN),e.addClass([this.element],ce.CLOSE)),e.isNullOrUndefined(t)?(e.removeClass([this.element],ce.CLOSE),e.addClass([this.element],ce.OPEN),this.trigger("open")):(t.begin=function(){o.isDestroyed||(e.removeClass([o.element],ce.CLOSE),e.addClass([o.element],ce.OPEN))},t.end=function(){o.isDestroyed||o.trigger("open")},new e.Animation(t).animate(this.element))},i.prototype.hide=function(t){var i=this;t=e.isNullOrUndefined(t)||"object"!=typeof t?this.hideAnimation:t,e.isNullOrUndefined(t)?(e.removeClass([this.element],ce.OPEN),e.addClass([this.element],ce.CLOSE),this.trigger("close")):(t.end=function(){i.isDestroyed||(e.removeClass([i.element],ce.OPEN),e.addClass([i.element],ce.CLOSE),i.trigger("close"))},new e.Animation(t).animate(this.element)),this.unwireEvents()},i.prototype.getScrollableParent=function(t){return this.checkFixedParent(t),I(t,this.fixedParent)},i.prototype.checkFixedParent=function(t){for(var i=t.parentElement;i&&"HTML"!==i.tagName;){var o=getComputedStyle(i);"fixed"===o.position&&!e.isNullOrUndefined(this.element)&&this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&(this.element.style.top=window.scrollY>parseInt(this.element.style.top)?e.formatUnit(window.scrollY-parseInt(this.element.style.top)):e.formatUnit(parseInt(this.element.style.top)-window.scrollY),this.element.style.position="fixed",this.fixedParent=!0),i=i.parentElement,!e.isNullOrUndefined(this.element)&&e.isNullOrUndefined(this.element.offsetParent)&&"fixed"===o.position&&"fixed"===this.element.style.position&&(this.fixedParent=!0)}},de([e.Property("auto")],i.prototype,"height",void 0),de([e.Property("auto")],i.prototype,"width",void 0),de([e.Property(null)],i.prototype,"content",void 0),de([e.Property("container")],i.prototype,"targetType",void 0),de([e.Property(null)],i.prototype,"viewPortElement",void 0),de([e.Property({X:"none",Y:"none"})],i.prototype,"collision",void 0),de([e.Property("")],i.prototype,"relateTo",void 0),de([e.Complex({},pe)],i.prototype,"position",void 0),de([e.Property(0)],i.prototype,"offsetX",void 0),de([e.Property(0)],i.prototype,"offsetY",void 0),de([e.Property(1e3)],i.prototype,"zIndex",void 0),de([e.Property(!1)],i.prototype,"enableRtl",void 0),de([e.Property("reposition")],i.prototype,"actionOnScroll",void 0),de([e.Property(null)],i.prototype,"showAnimation",void 0),de([e.Property(null)],i.prototype,"hideAnimation",void 0),de([e.Event()],i.prototype,"open",void 0),de([e.Event()],i.prototype,"close",void 0),de([e.Event()],i.prototype,"targetExitViewport",void 0),i=de([e.NotifyPropertyChanges],i)}(e.Component),fe=["north-west","north","north-east","west","east","south-west","south","south-east"],me="e-resize-handle",ge="e-focused-handle",ve=["e-restrict-left"],ye="e-resize-viewport",be=["north","west","east","south"],Ee=0,Oe=0,Ce=0,we=0,Se=0,Ne=0,Te=null,Pe=null,xe=null,He=!0,Ue=0,Be=!0,Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ke=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Re(i,t),ke([e.Property(!0)],i.prototype,"isFlat",void 0),ke([e.Property()],i.prototype,"buttonModel",void 0),ke([e.Property("Button")],i.prototype,"type",void 0),ke([e.Event()],i.prototype,"click",void 0),i}(e.ChildProperty),Me=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Re(i,t),ke([e.Property("Fade")],i.prototype,"effect",void 0),ke([e.Property(400)],i.prototype,"duration",void 0),ke([e.Property(0)],i.prototype,"delay",void 0),i}(e.ChildProperty),Le="e-dialog",Ae="e-dlg-target",Ie="e-scroll-disabled",Ye="e-dlg-fullscreen",Xe="Information",De="e-scroll-disabled",je="e-alert-dialog",qe="e-confirm-dialog",Fe="user action",_e=function(t){function o(e,i){var o=t.call(this,e,i)||this;return o.dlgClosedBy=Fe,o}return Re(o,t),o.prototype.render=function(){this.initialize(),this.initRender(),this.wireEvents(),"100%"===this.width&&(this.element.style.width=""),""!==this.minHeight&&(this.element.style.minHeight=e.formatUnit(this.minHeight)),this.enableResize&&(this.setResize(),"None"===this.animationSettings.effect&&this.getMinHeight()),this.renderComplete()},o.prototype.preRender=function(){var t=this;this.headerContent=null,this.allowMaxHeight=!0,this.preventVisibility=!0,this.clonedEle=this.element.cloneNode(!0),this.closeIconClickEventHandler=function(e){t.dlgClosedBy="close icon",t.hide(e)},this.dlgOverlayClickEventHandler=function(e){t.dlgClosedBy="overlayClick",e.preventFocus=!1,t.trigger("overlayClick",e,function(e){e.preventFocus||t.focusContent(),t.dlgClosedBy=Fe})};var i={close:"Close"};if(this.l10n=new e.L10n("dialog",i,this.locale),this.checkPositionData(),e.isNullOrUndefined(this.target)){var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.target=document.body,this.isProtectedOnChange=o}},o.prototype.isNumberValue=function(t){return/^[-+]?\d*\.?\d+$/.test(t)},o.prototype.checkPositionData=function(){if(!e.isNullOrUndefined(this.position)){if(!e.isNullOrUndefined(this.position.X)&&"number"!=typeof this.position.X&&(t=this.isNumberValue(this.position.X))){i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.X=parseFloat(this.position.X),this.isProtectedOnChange=i}if(!e.isNullOrUndefined(this.position.Y)&&"number"!=typeof this.position.Y){var t=this.isNumberValue(this.position.Y);if(t){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.Y=parseFloat(this.position.Y),this.isProtectedOnChange=i}}}},o.prototype.getEle=function(t,e){for(var i=void 0,o=0;o<t.length;o++)if(t[o].classList.contains(e)){i=t[o];break}return i},o.prototype.getMinHeight=function(){var t="0px",i="0px";e.isNullOrUndefined(this.element.querySelector(".e-dlg-header-content"))||(t=getComputedStyle(this.headerContent).height);var o=this.getEle(this.element.children,"e-footer-content");e.isNullOrUndefined(o)||(i=getComputedStyle(o).height);var n=parseInt(t.slice(0,t.indexOf("p")),10),s=parseInt(i.slice(0,i.indexOf("p")),10);return it(n+30+(isNaN(s)?0:s)),n+30+s},o.prototype.onResizeStart=function(t,e){return e.trigger("resizeStart",t),t.cancel},o.prototype.onResizing=function(t,e){e.trigger("resizing",t)},o.prototype.onResizeComplete=function(t,e){e.trigger("resizeStop",t)},o.prototype.setResize=function(){if(this.enableResize){if(this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-icons.e-resize-handle")))return;this.element.classList.add("e-dlg-resizable");for(var t=getComputedStyle(this.element).minHeight,i=getComputedStyle(this.element).minWidth,o="",n=0;n<this.resizeHandles.length;n++){if("All"===this.resizeHandles[n]){o="south north east west north-east north-west south-east south-west";break}var s="";switch(this.resizeHandles[n].toString()){case"SouthEast":s="south-east";break;case"SouthWest":s="south-west";break;case"NorthEast":s="north-east";break;case"NorthWest":s="north-west";break;default:s=this.resizeHandles[n].toString()}o+=s.toLocaleLowerCase()+" "}this.enableRtl&&"south-east"===o.trim()?o="south-west":this.enableRtl&&"south-west"===o.trim()&&(o="south-east"),this.isModal&&this.enableRtl?this.element.classList.add("e-restrict-left"):this.isModal&&this.target===document.body&&this.element.classList.add("e-resize-viewport"),D({element:this.element,direction:o,minHeight:parseInt(t.slice(0,i.indexOf("p")),10),maxHeight:this.targetEle.clientHeight,minWidth:parseInt(i.slice(0,i.indexOf("p")),10),maxWidth:this.targetEle.clientWidth,boundary:this.target===document.body?null:this.targetEle,resizeBegin:this.onResizeStart.bind(this),resizeComplete:this.onResizeComplete.bind(this),resizing:this.onResizing.bind(this),proxy:this}),this.wireWindowResizeEvent()}else st(),this.unWireWindowResizeEvent(),this.isModal?this.element.classList.remove("e-restrict-left"):this.element.classList.remove("e-resize-viewport"),this.element.classList.remove("e-dlg-resizable")},o.prototype.getFocusElement=function(t){var e=t.querySelectorAll('input,select,textarea,button:enabled,a,[contenteditable="true"],[tabindex]');return{element:e[e.length-1]}},o.prototype.keyDown=function(t){var i=this;if(9===t.keyCode&&this.isModal){var o=void 0;e.isNullOrUndefined(this.btnObj)||(o=this.btnObj[this.btnObj.length-1]),e.isNullOrUndefined(this.btnObj)&&!e.isNullOrUndefined(this.ftrTemplateContent)&&(o=this.getFocusElement(this.ftrTemplateContent)),e.isNullOrUndefined(this.btnObj)&&e.isNullOrUndefined(this.ftrTemplateContent)&&!e.isNullOrUndefined(this.contentEle)&&(o=this.getFocusElement(this.contentEle)),e.isNullOrUndefined(o)||document.activeElement!==o.element||t.shiftKey||(t.preventDefault(),this.focusableElements(this.element).focus()),document.activeElement===this.focusableElements(this.element)&&t.shiftKey&&(t.preventDefault(),e.isNullOrUndefined(o)||o.element.focus())}var n=document.activeElement,s=["input","textarea"].indexOf(n.tagName.toLowerCase())>-1,r=!1;if(s||(r=n.hasAttribute("contenteditable")&&"true"===n.getAttribute("contenteditable")),27===t.keyCode&&this.closeOnEscape&&(this.dlgClosedBy="escape",this.hide(t)),13===t.keyCode&&!t.ctrlKey&&"textarea"!==n.tagName.toLowerCase()&&s&&!e.isNullOrUndefined(this.primaryButtonEle)||13===t.keyCode&&t.ctrlKey&&("textarea"===n.tagName.toLowerCase()||r)&&!e.isNullOrUndefined(this.primaryButtonEle)){var l;this.buttons.some(function(t,i){l=i;var o=t.buttonModel;return!e.isNullOrUndefined(o)&&!0===o.isPrimary})&&"function"==typeof this.buttons[l].click&&setTimeout(function(){i.buttons[l].click.call(i,t)})}},o.prototype.initialize=function(){e.isNullOrUndefined(this.target)||(this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target),this.isBlazorServerRender()||e.addClass([this.element],Le),e.Browser.isDevice&&e.addClass([this.element],"e-device"),this.isBlazorServerRender()||this.setCSSClass(),this.setMaxHeight()},o.prototype.initRender=function(){var t=this;if(this.initialRender=!0,this.isBlazorServerRender()||e.attributes(this.element,{role:"dialog"}),1e3===this.zIndex?(this.setzIndex(this.element,!1),this.calculatezIndex=!0):this.calculatezIndex=!1,this.isBlazorServerRender()&&e.isNullOrUndefined(this.headerContent)&&(this.headerContent=this.element.getElementsByClassName("e-dlg-header-content")[0]),this.isBlazorServerRender()&&e.isNullOrUndefined(this.contentEle)&&(this.contentEle=this.element.querySelector("#"+this.element.id+"_dialog-content")),this.isBlazorServerRender()||(this.setTargetContent(),""===this.header||e.isNullOrUndefined(this.header)||this.setHeader(),this.showCloseIcon&&this.renderCloseIcon(),this.setContent(),""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)?e.isNullOrUndefined(this.buttons[0].buttonModel)||this.setButton():this.setFooterTemplate()),this.isBlazorServerRender()&&(e.isNullOrUndefined(this.buttons[0].buttonModel)||""!==this.footerTemplate||this.setButton()),this.allowDragging&&!e.isNullOrUndefined(this.headerContent)&&this.setAllowDragging(),this.isBlazorServerRender()||(e.attributes(this.element,{"aria-modal":this.isModal?"true":"false"}),this.isModal&&this.setIsModal()),this.isBlazorServerRender()&&e.isNullOrUndefined(this.dlgContainer)){this.dlgContainer=this.element.parentElement;for(var i=0,o=this.dlgContainer.children;i<o.length;i++)o[i].classList.contains("e-dlg-overlay")&&(this.dlgOverlay=o[i])}if(!0!==this.element.classList.contains(je)&&!0!==this.element.classList.contains(qe)&&!e.isNullOrUndefined(this.element.parentElement)){var n=this.isModal?this.dlgContainer.parentElement:this.element.parentElement;this.refElement=this.createElement("div",{className:"e-dlg-ref-element"}),n.insertBefore(this.refElement,this.isModal?this.dlgContainer:this.element)}e.isNullOrUndefined(this.targetEle)||(this.isModal?this.targetEle.appendChild(this.dlgContainer):this.targetEle.appendChild(this.element)),this.popupObj=new ue(this.element,{height:this.height,width:this.width,zIndex:this.zIndex,relateTo:this.target,actionOnScroll:"none",enableRtl:this.enableRtl,open:function(e){var i={container:t.isModal?t.dlgContainer:t.element,element:t.element,target:t.target,preventFocus:!1};t.enableResize&&t.resetResizeIcon(),t.trigger("open",i,function(e){e.preventFocus||t.focusContent()})},close:function(i){t.isModal&&e.addClass([t.dlgOverlay],"e-fade"),t.unBindEvent(t.element),t.isModal&&(t.dlgContainer.style.display="none"),t.trigger("close",t.closeArgs);var o=document.activeElement;e.isNullOrUndefined(o)||e.isNullOrUndefined(o.blur)||o.blur(),e.isNullOrUndefined(t.storeActiveElement)||e.isNullOrUndefined(t.storeActiveElement.focus)||t.storeActiveElement.focus()}}),this.positionChange(),this.setEnableRTL(),this.isBlazorServerRender()||(e.addClass([this.element],"e-popup-close"),this.isModal&&this.setOverlayZindex()),this.visible?this.show():this.isModal&&(this.dlgOverlay.style.display="none"),this.initialRender=!1},o.prototype.resetResizeIcon=function(){var t=this.getMinHeight();if(this.targetEle.offsetHeight<t){var i=this.enableRtl?"e-south-west":"e-south-east",o=this.element.querySelector("."+i);e.isNullOrUndefined(o)||(o.style.bottom="-"+t.toString()+"px")}},o.prototype.setOverlayZindex=function(t){var i;i=e.isNullOrUndefined(t)?parseInt(this.element.style.zIndex,10)?parseInt(this.element.style.zIndex,10):this.zIndex:t,this.dlgOverlay.style.zIndex=(i-1).toString(),this.dlgContainer.style.zIndex=i.toString()},o.prototype.positionChange=function(){this.isModal&&(isNaN(parseFloat(this.position.X))||isNaN(parseFloat(this.position.Y)))?!isNaN(parseFloat(this.position.X))&&isNaN(parseFloat(this.position.Y))||isNaN(parseFloat(this.position.X))&&!isNaN(parseFloat(this.position.Y))?this.setPopupPosition():(this.element.style.top="0px",this.element.style.left="0px",this.dlgContainer.classList.add("e-dlg-"+this.position.X+"-"+this.position.Y)):this.setPopupPosition()},o.prototype.setPopupPosition=function(){this.popupObj.setProperties({position:{X:this.position.X,Y:this.position.Y}})},o.prototype.setAllowDragging=function(){var t=this;this.dragObj=new e.Draggable(this.element,{clone:!1,isDragScroll:!0,abort:".e-dlg-closeicon-btn",handle:".e-dlg-header-content",dragStart:function(i){t.trigger("dragStart",i,function(t){e.isBlazor()&&t.bindEvents(i.dragElement)})},dragStop:function(i){t.isModal&&(e.isNullOrUndefined(t.position)||t.dlgContainer.classList.remove("e-dlg-"+t.position.X+"-"+t.position.Y),t.element.style.position="relative"),t.trigger("dragStop",i),t.element.classList.remove("e-restrict-left")},drag:function(e){t.trigger("drag",e)}}),e.isNullOrUndefined(this.targetEle)||(this.dragObj.dragArea=this.targetEle)},o.prototype.setButton=function(){if(!this.isBlazorServerRender()){this.buttonContent=[],this.btnObj=[];for(s=0;s<this.buttons.length;s++){var t=e.isNullOrUndefined(this.buttons[s].type)?"button":this.buttons[s].type.toLowerCase(),o=this.createElement("button",{attrs:{type:t}});this.buttonContent.push(o.outerHTML)}this.setFooterTemplate()}for(var n,s=0,r=this.element.children;s<r.length;s++)r[s].classList.contains("e-footer-content")&&(n=r[s].querySelectorAll("button"));for(s=0;s<this.buttons.length;s++)this.isBlazorServerRender()||(this.btnObj[s]=new i.Button(this.buttons[s].buttonModel)),this.isBlazorServerRender()&&(this.ftrTemplateContent=this.element.querySelector(".e-footer-content")),!e.isNullOrUndefined(this.ftrTemplateContent)&&n.length>0&&("function"==typeof this.buttons[s].click&&e.EventHandler.add(n[s],"click",this.buttons[s].click,this),"object"==typeof this.buttons[s].click&&e.EventHandler.add(n[s],"click",this.buttonClickHandler.bind(this,s),this)),this.isBlazorServerRender()||e.isNullOrUndefined(this.ftrTemplateContent)||(this.btnObj[s].appendTo(this.ftrTemplateContent.children[s]),this.buttons[s].isFlat&&this.btnObj[s].element.classList.add("e-flat"),this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0])},o.prototype.buttonClickHandler=function(t){this.trigger("buttons["+t+"].click",{})},o.prototype.setContent=function(){e.attributes(this.element,{"aria-describedby":this.element.id+"_dialog-content"}),this.contentEle=this.createElement("div",{className:"e-dlg-content",id:this.element.id+"_dialog-content"}),this.innerContentElement?this.contentEle.appendChild(this.innerContentElement):(e.isNullOrUndefined(this.content)||""===this.content)&&this.initialRender||("string"!=typeof this.content||e.isBlazor()?this.content instanceof HTMLElement?this.contentEle.appendChild(this.content):this.setTemplate(this.content,this.contentEle,"content"):this.contentEle.innerHTML=this.sanitizeHelper(this.content)),e.isNullOrUndefined(this.headerContent)?this.element.insertBefore(this.contentEle,this.element.children[0]):this.element.insertBefore(this.contentEle,this.element.children[1]),"auto"===this.height&&(this.isBlazorServerRender()||!e.Browser.isIE||""!==this.element.style.width||e.isNullOrUndefined(this.width)||(this.element.style.width=e.formatUnit(this.width)),this.setMaxHeight())},o.prototype.setTemplate=function(t,i,o){var n,s;s=i.classList.contains("e-dlg-header")?this.element.id+"header":i.classList.contains("e-footer-content")?this.element.id+"footerTemplate":this.element.id+"content";var r;e.isNullOrUndefined(t.outerHTML)?"string"!=typeof t||e.isBlazor()&&!this.isStringTemplate?(n=e.compile(t),r=t):i.innerHTML=this.sanitizeHelper(t):i.appendChild(t);var l=[];if(!e.isNullOrUndefined(n)){for(var a=0,h=n({},this,o,s,!(e.isBlazor()&&!this.isStringTemplate&&0===r.indexOf("<div>Blazor"))||this.isStringTemplate);a<h.length;a++){var d=h[a];l.push(d)}e.append([].slice.call(l),i)}},o.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize(),o={cancel:!1,helper:null};e.extend(i,i,o),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},o.prototype.setMaxHeight=function(){if(this.allowMaxHeight){var t=this.element.style.display;this.element.style.display="none",this.element.style.maxHeight=!e.isNullOrUndefined(this.target)&&this.targetEle.offsetHeight<window.innerHeight?this.targetEle.offsetHeight-20+"px":window.innerHeight-20+"px",this.element.style.display=t,e.Browser.isIE&&"auto"===this.height&&!e.isNullOrUndefined(this.contentEle)&&this.element.offsetHeight<this.contentEle.offsetHeight&&(this.element.style.height="inherit")}},o.prototype.setEnableRTL=function(){this.isBlazorServerRender()||(this.enableRtl?e.addClass([this.element],"e-rtl"):e.removeClass([this.element],"e-rtl")),e.isNullOrUndefined(this.element.querySelector(".e-resize-handle"))||(st(),this.setResize())},o.prototype.setTargetContent=function(){var t=this;if(e.isNullOrUndefined(this.content)||""===this.content){var i=""!==this.element.innerHTML.replace(/\s|<(\/?|\/?)(!--!--)>/g,"");(this.element.children.length>0||i)&&(this.innerContentElement=document.createDocumentFragment(),[].slice.call(this.element.childNodes).forEach(function(e){8!==e.nodeType&&t.innerContentElement.appendChild(e)}))}},o.prototype.setHeader=function(){this.headerEle?this.headerEle.innerHTML="":this.headerEle=this.createElement("div",{id:this.element.id+"_title",className:"e-dlg-header"}),this.createHeaderContent(),this.headerContent.appendChild(this.headerEle),this.setTemplate(this.header,this.headerEle,"header"),e.attributes(this.element,{"aria-labelledby":this.element.id+"_title"}),this.element.insertBefore(this.headerContent,this.element.children[0])},o.prototype.setFooterTemplate=function(){this.ftrTemplateContent?this.ftrTemplateContent.innerHTML="":this.ftrTemplateContent=this.createElement("div",{className:"e-footer-content"}),""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)?this.ftrTemplateContent.innerHTML=this.buttonContent.join(""):this.setTemplate(this.footerTemplate,this.ftrTemplateContent,"footerTemplate"),this.element.appendChild(this.ftrTemplateContent)},o.prototype.createHeaderContent=function(){e.isNullOrUndefined(this.headerContent)&&(this.headerContent=this.createElement("div",{id:this.element.id+"_dialog-header",className:"e-dlg-header-content"}))},o.prototype.renderCloseIcon=function(){this.closeIcon=this.createElement("button",{className:"e-dlg-closeicon-btn",attrs:{type:"button"}}),this.closeIconBtnObj=new i.Button({cssClass:"e-flat",iconCss:"e-icon-dlg-close e-icons"}),this.closeIconTitle(),e.isNullOrUndefined(this.headerContent)?(this.createHeaderContent(),e.prepend([this.closeIcon],this.headerContent),this.element.insertBefore(this.headerContent,this.element.children[0])):e.prepend([this.closeIcon],this.headerContent),this.closeIconBtnObj.appendTo(this.closeIcon)},o.prototype.closeIconTitle=function(){this.l10n.setLocale(this.locale);var t=this.l10n.getConstant("close");this.closeIcon.setAttribute("title",t),this.closeIcon.setAttribute("aria-label",t)},o.prototype.setCSSClass=function(t){this.cssClass&&e.addClass([this.element],this.cssClass.split(" ")),t&&e.removeClass([this.element],t.split(" "))},o.prototype.setIsModal=function(){this.dlgContainer=this.createElement("div",{className:"e-dlg-container"}),this.element.classList.remove("e-popup-open"),this.element.parentNode.insertBefore(this.dlgContainer,this.element),this.dlgContainer.appendChild(this.element),e.addClass([this.element],"e-dlg-modal"),this.dlgOverlay=this.createElement("div",{className:"e-dlg-overlay"}),this.dlgOverlay.style.zIndex=(this.zIndex-1).toString(),this.dlgContainer.appendChild(this.dlgOverlay)},o.prototype.getValidFocusNode=function(t){for(var e,i=0;i<t.length;i++){if(((e=t[i]).clientHeight>0||"a"===e.tagName.toLowerCase()&&e.hasAttribute("href"))&&e.tabIndex>-1&&!e.disabled&&!this.disableElement(e,'[disabled],[aria-disabled="true"],[type="hidden"]'))return e;e=null}return e},o.prototype.focusableElements=function(t){if(!e.isNullOrUndefined(t)){var i=t.querySelectorAll('input,select,textarea,button,a,[contenteditable="true"],[tabindex]');return this.getValidFocusNode(i)}return null},o.prototype.getAutoFocusNode=function(t){var i=t.querySelector(".e-dlg-closeicon-btn"),o=t.querySelectorAll("[autofocus]"),n=this.getValidFocusNode(o);if(e.isBlazor()&&(this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0]),e.isNullOrUndefined(n)){if(n=this.focusableElements(this.contentEle),!e.isNullOrUndefined(n))return i=n;if(!e.isNullOrUndefined(this.primaryButtonEle))return this.element.querySelector(".e-primary")}else i=n;return i},o.prototype.disableElement=function(t,e){var i=t?t.matches||t.webkitMatchesSelector||t.msGetRegionContent:null;if(i)for(;t;t=t.parentNode)if(t instanceof Element&&i.call(t,e))return t;return null},o.prototype.focusContent=function(){var t=this.getAutoFocusNode(this.element),i=e.isNullOrUndefined(t)?this.element:t,o=e.Browser.userAgent;(o.indexOf("MSIE ")>0||o.indexOf("Trident/")>0)&&this.element.focus(),i.focus(),this.bindEvent(this.element)},o.prototype.bindEvent=function(t){e.EventHandler.add(t,"keydown",this.keyDown,this)},o.prototype.unBindEvent=function(t){e.EventHandler.remove(t,"keydown",this.keyDown)},o.prototype.updateSanitizeContent=function(){this.isBlazorServerRender()||(this.contentEle.innerHTML=this.sanitizeHelper(this.content))},o.prototype.isBlazorServerRender=function(){return e.isBlazor()&&this.isServerRendered},o.prototype.getModuleName=function(){return"dialog"},o.prototype.onPropertyChanged=function(t,i){if(this.element.classList.contains(Le))for(var o=0,n=Object.keys(t);o<n.length;o++)switch(n[o]){case"content":e.isNullOrUndefined(this.content)||""===this.content?e.isNullOrUndefined(this.contentEle)||(e.detach(this.contentEle),this.contentEle=null):(this.isBlazorServerRender()&&(this.contentEle=this.element.querySelector(".e-dlg-content")),e.isNullOrUndefined(this.contentEle)||"dialog"===this.contentEle.getAttribute("role")?this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-dlg-content"))||this.setContent():(this.isBlazorServerRender()||(this.contentEle.innerHTML=""),"function"==typeof this.content?(this.clearTemplate(["content"]),e.detach(this.contentEle),this.contentEle=null,this.setContent()):"string"==typeof this.content?this.isBlazorServerRender()&&""===this.contentEle.innerText?this.contentEle.insertAdjacentHTML("beforeend",this.sanitizeHelper(this.content)):this.updateSanitizeContent():this.contentEle.appendChild(this.content),this.setMaxHeight()));break;case"header":""===this.header||e.isNullOrUndefined(this.header)?this.headerEle&&(e.detach(this.headerEle),this.headerEle=null):this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-dlg-header-content"))||this.setHeader();break;case"footerTemplate":if(""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)){if(!this.ftrTemplateContent)return;e.detach(this.ftrTemplateContent),this.ftrTemplateContent=null,this.buttons=[{}]}else this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-footer-content"))||this.setFooterTemplate(),this.buttons=[{}];break;case"showCloseIcon":this.element.getElementsByClassName("e-icon-dlg-close").length>0?this.showCloseIcon||""!==this.header&&!e.isNullOrUndefined(this.header)?this.showCloseIcon?this.isBlazorServerRender()&&this.wireEvents():e.detach(this.closeIcon):(e.detach(this.headerContent),this.headerContent=null):(this.isBlazorServerRender()||this.renderCloseIcon(),this.wireEvents());break;case"locale":this.showCloseIcon&&this.closeIconTitle();break;case"visible":this.visible?this.show():this.hide();break;case"isModal":this.updateIsModal();break;case"height":e.setStyleAttribute(this.element,{height:e.formatUnit(t.height)});break;case"width":e.setStyleAttribute(this.element,{width:e.formatUnit(t.width)});break;case"zIndex":this.popupObj.zIndex=this.zIndex,this.isModal&&this.setOverlayZindex(this.zIndex),this.element.style.zIndex!==this.zIndex.toString()&&(this.calculatezIndex=!1);break;case"cssClass":this.setCSSClass(i.cssClass);break;case"buttons":var s=this.buttons.length;e.isNullOrUndefined(this.ftrTemplateContent)||this.isBlazorServerRender()||(e.detach(this.ftrTemplateContent),this.ftrTemplateContent=null);for(var r=0;r<s;r++)e.isNullOrUndefined(this.buttons[r].buttonModel)||(this.footerTemplate="",this.setButton());break;case"allowDragging":this.allowDragging&&!e.isNullOrUndefined(this.headerContent)?this.setAllowDragging():this.dragObj.destroy();break;case"target":this.setTarget(t.target);break;case"position":if(this.checkPositionData(),this.isModal){var l=e.isNullOrUndefined(i.position.X)?this.position.X:i.position.X,a=e.isNullOrUndefined(i.position.Y)?this.position.Y:i.position.Y;this.dlgContainer.classList.contains("e-dlg-"+l+"-"+a)&&this.dlgContainer.classList.remove("e-dlg-"+l+"-"+a)}this.positionChange();break;case"enableRtl":this.setEnableRTL();break;case"enableResize":this.setResize()}},o.prototype.setTarget=function(t){this.popupObj.relateTo=t,this.target=t,this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target,this.dragObj&&(this.dragObj.dragArea=this.targetEle),this.setMaxHeight(),this.isModal&&this.updateIsModal(),this.enableResize&&this.setResize()},o.prototype.updateIsModal=function(){if(this.element.setAttribute("aria-modal",this.isModal?"true":"false"),this.isModal)this.setIsModal(),this.element.style.top="0px",this.element.style.left="0px",e.isNullOrUndefined(this.targetEle)||this.targetEle.appendChild(this.dlgContainer);else{for(e.removeClass([this.element],"e-dlg-modal"),e.removeClass([document.body],[Ae,Ie]),e.detach(this.dlgOverlay);this.dlgContainer.firstChild;)this.dlgContainer.parentElement.insertBefore(this.dlgContainer.firstChild,this.dlgContainer);this.dlgContainer.parentElement.removeChild(this.dlgContainer)}this.visible&&this.show(),this.positionChange(),this.isModal&&this.dlgOverlay&&e.EventHandler.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},o.prototype.setzIndex=function(t,e){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.zIndex=Y(t),this.isProtectedOnChange=i,e&&(this.popupObj.zIndex=this.zIndex)},o.prototype.windowResizeHandler=function(){ot(this.targetEle.clientWidth),nt(this.targetEle.clientHeight),this.setMaxHeight()},o.prototype.getPersistData=function(){return this.addOnPersist([])},o.prototype.destroy=function(){if(!this.isDestroyed){var i=["e-rtl","e-dlg-modal","e-dlg-resizable","e-restrict-left",Ye,"e-device"],o=["role","aria-modal","aria-labelledby","aria-describedby","aria-grabbed","tabindex","style"];if(e.removeClass([this.targetEle],[Ae,Ie]),!e.isNullOrUndefined(this.element)&&this.element.classList.contains(Ye)&&e.removeClass([document.body],[Ae,Ie]),this.isModal&&e.removeClass([e.isNullOrUndefined(this.targetEle)?document.body:this.targetEle],Ie),this.unWireEvents(),!e.isNullOrUndefined(this.btnObj))for(n=0;n<this.btnObj.length;n++)this.btnObj[n].destroy();if(e.isNullOrUndefined(this.dragObj)||this.dragObj.destroy(),!e.isNullOrUndefined(this.popupObj.element)&&this.popupObj.element.classList.contains("e-popup")&&this.popupObj.destroy(),e.removeClass([this.element],i),e.isNullOrUndefined(this.cssClass)||""===this.cssClass||e.removeClass([this.element],this.cssClass.split(" ")),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.isModal?this.dlgContainer:this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isModal&&!this.isBlazorServerRender()&&(e.detach(this.dlgOverlay),this.dlgContainer.parentNode.insertBefore(this.element,this.dlgContainer),e.detach(this.dlgContainer)),this.isBlazorServerRender()||(this.element.innerHTML=this.clonedEle.innerHTML),this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.children))for(n=0;n<=this.element.children.length;n++)n-=n,e.detach(this.element.children[n]);for(var n=0;n<o.length;n++)this.element.removeAttribute(o[n]);this.isBlazorServerRender()?this.isDestroyed=!0:t.prototype.destroy.call(this),this.isReact&&this.clearTemplate()}},o.prototype.wireWindowResizeEvent=function(){window.addEventListener("resize",this.windowResizeHandler.bind(this))},o.prototype.unWireWindowResizeEvent=function(){window.removeEventListener("resize",this.windowResizeHandler.bind(this))},o.prototype.wireEvents=function(){this.isBlazorServerRender()&&this.showCloseIcon&&(this.closeIcon=this.element.getElementsByClassName("e-dlg-closeicon-btn")[0]),this.showCloseIcon&&e.EventHandler.add(this.closeIcon,"click",this.closeIconClickEventHandler,this),this.isModal&&this.dlgOverlay&&e.EventHandler.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},o.prototype.unWireEvents=function(){if(this.showCloseIcon&&e.EventHandler.remove(this.closeIcon,"click",this.closeIconClickEventHandler),this.isModal&&e.EventHandler.remove(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler),this.buttons.length>0&&!e.isNullOrUndefined(this.buttons[0].buttonModel)&&""===this.footerTemplate)for(var t=0;t<this.buttons.length;t++)"function"==typeof this.buttons[t].click&&e.EventHandler.remove(this.ftrTemplateContent.children[t],"click",this.buttons[t].click)},o.prototype.refreshPosition=function(){this.popupObj.refreshPosition()},o.prototype.show=function(t){var i=this;if(this.element.classList.contains(Le)){if(!this.element.classList.contains("e-popup-open")||!e.isNullOrUndefined(t)){e.isNullOrUndefined(t)||this.fullScreen(t);var o=e.isBlazor()?{cancel:!1,element:this.element,container:this.isModal?this.dlgContainer:this.element,maxHeight:this.element.style.maxHeight}:{cancel:!1,element:this.element,container:this.isModal?this.dlgContainer:this.element,target:this.target,maxHeight:this.element.style.maxHeight};this.trigger("beforeOpen",o,function(t){if(!t.cancel){i.element.style.maxHeight!==o.maxHeight&&(i.allowMaxHeight=!1,i.element.style.maxHeight=o.maxHeight),i.storeActiveElement=document.activeElement,i.element.tabIndex=-1,i.isModal&&!e.isNullOrUndefined(i.dlgOverlay)&&(i.dlgOverlay.style.display="block",i.dlgContainer.style.display="flex",e.removeClass([i.dlgOverlay],"e-fade"),e.isNullOrUndefined(i.targetEle)?e.addClass([document.body],[Ae,Ie]):(i.targetEle===document.body?i.dlgContainer.style.position="fixed":i.dlgContainer.style.position="absolute",i.dlgOverlay.style.position="absolute",i.element.style.position="relative",e.addClass([i.targetEle],[Ae,Ie])));var n={name:i.animationSettings.effect+"In",duration:i.animationSettings.duration,delay:i.animationSettings.delay},s=i.isModal?i.element.parentElement:i.element;i.calculatezIndex&&(i.setzIndex(s,!0),e.setStyleAttribute(i.element,{zIndex:i.zIndex}),i.isModal&&i.setOverlayZindex(i.zIndex)),"None"===i.animationSettings.effect?i.popupObj.show():i.popupObj.show(n),i.dialogOpen=!0;var r=i.isProtectedOnChange;i.isProtectedOnChange=!0,i.visible=!0,i.preventVisibility=!0,i.isProtectedOnChange=r}})}this.isReact&&this.renderReactTemplates()}},o.prototype.hide=function(t){var i=this;if(this.element.classList.contains(Le)&&this.preventVisibility){var o=e.isBlazor()?{cancel:!1,isInteracted:!!t,element:this.element,container:this.isModal?this.dlgContainer:this.element,event:t}:{cancel:!1,isInteracted:!!t,element:this.element,target:this.target,container:this.isModal?this.dlgContainer:this.element,event:t,closedBy:this.dlgClosedBy};this.closeArgs=o,this.trigger("beforeClose",o,function(t){if(!t.cancel){i.isModal&&(e.isNullOrUndefined(i.targetEle)?e.removeClass([document.body],[Ae,Ie]):e.removeClass([i.targetEle],[Ae,Ie]));var o={name:i.animationSettings.effect+"Out",duration:i.animationSettings.duration,delay:i.animationSettings.delay};"None"===i.animationSettings.effect?i.popupObj.hide():i.popupObj.hide(o),i.dialogOpen=!1;var n=i.isProtectedOnChange;i.isProtectedOnChange=!0,i.visible=!1,i.preventVisibility=!1,i.isProtectedOnChange=n}i.dlgClosedBy=Fe})}},o.prototype.fullScreen=function(t){this.element.offsetTop,this.element.offsetLeft;if(t){e.addClass([this.element],Ye);var i=this.element.style.display;this.element.style.display="none",this.element.style.maxHeight=e.isNullOrUndefined(this.target)?window.innerHeight+"px":this.targetEle.offsetHeight+"px",this.element.style.display=i,e.addClass([document.body],[Ae,Ie]),this.allowDragging&&!e.isNullOrUndefined(this.dragObj)&&this.dragObj.destroy()}else e.removeClass([this.element],Ye),e.removeClass([document.body],[Ae,Ie]),this.allowDragging&&!e.isNullOrUndefined(this.headerContent)&&this.setAllowDragging();return t},o.prototype.getButtons=function(t){return e.isNullOrUndefined(t)?this.btnObj:this.btnObj[t]},ke([e.Property("")],o.prototype,"content",void 0),ke([e.Property(!0)],o.prototype,"enableHtmlSanitizer",void 0),ke([e.Property(!1)],o.prototype,"showCloseIcon",void 0),ke([e.Property(!1)],o.prototype,"isModal",void 0),ke([e.Property("")],o.prototype,"header",void 0),ke([e.Property(!0)],o.prototype,"visible",void 0),ke([e.Property(!1)],o.prototype,"enableResize",void 0),ke([e.Property(["South-East"])],o.prototype,"resizeHandles",void 0),ke([e.Property("auto")],o.prototype,"height",void 0),ke([e.Property("")],o.prototype,"minHeight",void 0),ke([e.Property("100%")],o.prototype,"width",void 0),ke([e.Property("")],o.prototype,"cssClass",void 0),ke([e.Property(1e3)],o.prototype,"zIndex",void 0),ke([e.Property(null)],o.prototype,"target",void 0),ke([e.Property("")],o.prototype,"footerTemplate",void 0),ke([e.Property(!1)],o.prototype,"allowDragging",void 0),ke([e.Collection([{}],ze)],o.prototype,"buttons",void 0),ke([e.Property(!0)],o.prototype,"closeOnEscape",void 0),ke([e.Complex({},Me)],o.prototype,"animationSettings",void 0),ke([e.Complex({X:"center",Y:"center"},pe)],o.prototype,"position",void 0),ke([e.Event()],o.prototype,"created",void 0),ke([e.Event()],o.prototype,"open",void 0),ke([e.Event()],o.prototype,"beforeSanitizeHtml",void 0),ke([e.Event()],o.prototype,"beforeOpen",void 0),ke([e.Event()],o.prototype,"close",void 0),ke([e.Event()],o.prototype,"beforeClose",void 0),ke([e.Event()],o.prototype,"dragStart",void 0),ke([e.Event()],o.prototype,"dragStop",void 0),ke([e.Event()],o.prototype,"drag",void 0),ke([e.Event()],o.prototype,"overlayClick",void 0),ke([e.Event()],o.prototype,"resizeStart",void 0),ke([e.Event()],o.prototype,"resizing",void 0),ke([e.Event()],o.prototype,"resizeStop",void 0),ke([e.Event()],o.prototype,"destroyed",void 0),o=ke([e.NotifyPropertyChanges],o)}(e.Component);!function(t){function i(t){var i=e.createElement("div",{className:je});document.body.appendChild(i);var o,r=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}];return o="string"==typeof t?n({content:t,position:{X:"center",Y:"top"},isModal:!0,header:Xe,buttons:r},i):n(s(t),i),o.close=function(){t&&t.close&&t.close.apply(o),o.destroy(),o.element.classList.contains("e-dlg-modal")?(o.element.parentElement.remove(),o.target.classList.remove(De)):o.element.remove()},o}function o(t){var i=e.createElement("div",{className:qe});document.body.appendChild(i);var o,s=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},{buttonModel:{content:"Cancel"},click:function(){this.hide()}}];return o="string"==typeof t?n({position:{X:"center",Y:"top"},content:t,isModal:!0,header:Xe,buttons:s},i):n(r(t),i),o.close=function(){t&&t.close&&t.close.apply(o),o.destroy(),o.element.classList.contains("e-dlg-modal")?(o.element.parentElement.remove(),o.target.classList.remove(De)):o.element.remove()},o}function n(t,e){var i=new _e(t);return i.appendTo(e),i}function s(t){var e={};return e.buttons=[],e=l(e,t),e=a(e,t)}function r(t){var e={};return e.buttons=[],e=l(e,t),e=h(e,t)}function l(t,i){return t.header=e.isNullOrUndefined(i.title)?Xe:i.title,t.content=e.isNullOrUndefined(i.content)?"":i.content,t.isModal=!!e.isNullOrUndefined(i.isModal)||i.isModal,t.showCloseIcon=!e.isNullOrUndefined(i.showCloseIcon)&&i.showCloseIcon,t.allowDragging=!e.isNullOrUndefined(i.isDraggable)&&i.isDraggable,t.closeOnEscape=!e.isNullOrUndefined(i.closeOnEscape)&&i.closeOnEscape,t.position=e.isNullOrUndefined(i.position)?{X:"center",Y:"top"}:i.position,t.animationSettings=e.isNullOrUndefined(i.animationSettings)?{effect:"Fade",duration:400,delay:0}:i.animationSettings,t.cssClass=e.isNullOrUndefined(i.cssClass)?"":i.cssClass,t.zIndex=e.isNullOrUndefined(i.zIndex)?1e3:i.zIndex,t.open=e.isNullOrUndefined(i.open)?null:i.open,t}function a(t,i){var o=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}];return e.isNullOrUndefined(i.okButton)?t.buttons=o:t.buttons[0]=d(t.buttons[0],i.okButton,o[0]),t}function h(t,i){var o={buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},n={buttonModel:{content:"Cancel"},click:function(){this.hide()}};return e.isNullOrUndefined(i.okButton)?t.buttons[0]=o:t.buttons[0]=d(t.buttons[0],i.okButton,o),e.isNullOrUndefined(i.cancelButton)?t.buttons[1]=n:t.buttons[1]=d(t.buttons[1],i.cancelButton,n),t}function d(t,i,o){var n=o;return e.isNullOrUndefined(i.text)||(n.buttonModel.content=i.text),e.isNullOrUndefined(i.icon)||(n.buttonModel.iconCss=i.icon),e.isNullOrUndefined(i.cssClass)||(n.buttonModel.cssClass=i.cssClass),e.isNullOrUndefined(i.click)||(n.click=i.click),n}t.alert=i,t.confirm=o}(t.DialogUtility||(t.DialogUtility={}));var Ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),We=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},Ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ve(i,t),We([e.Property({effect:"FadeIn",duration:150,delay:0})],i.prototype,"open",void 0),We([e.Property({effect:"FadeOut",duration:150,delay:0})],i.prototype,"close",void 0),i}(e.ChildProperty),Ge=function(t){function i(e,i){var o=t.call(this,e,i)||this;return o.isBlazorTooltip=!1,o.contentTargetValue=null,o.contentEvent=null,o.contentAnimation=null,o.mouseMoveEvent=null,o.mouseMoveTarget=null,o}return Ve(i,t),i.prototype.initialize=function(){this.formatPosition(),this.isServerRender()||e.addClass([this.element],"e-tooltip")},i.prototype.isServerRender=function(){return e.isBlazor()&&this.isServerRendered},i.prototype.formatPosition=function(){var t,e;0===this.position.indexOf("Top")||0===this.position.indexOf("Bottom")?(t=this.position.split(/(?=[A-Z])/),this.tooltipPositionY=t[0],this.tooltipPositionX=t[1]):(e=this.position.split(/(?=[A-Z])/),this.tooltipPositionX=e[0],this.tooltipPositionY=e[1])},i.prototype.renderArrow=function(){if(this.setTipClass(this.position),this.isServerRender()){var t=this.tooltipEle.querySelector(".e-arrow-tip");e.addClass([t.querySelector(".e-arrow-tip-outer")],this.tipClass),e.addClass([t.querySelector(".e-arrow-tip-inner")],this.tipClass),this.tooltipEle.appendChild(t)}else(t=this.createElement("div",{className:"e-arrow-tip "+this.tipClass})).appendChild(this.createElement("div",{className:"e-arrow-tip-outer "+this.tipClass})),t.appendChild(this.createElement("div",{className:"e-arrow-tip-inner "+this.tipClass})),this.tooltipEle.appendChild(t)},i.prototype.setTipClass=function(t){0===t.indexOf("Right")?this.tipClass="e-tip-left":0===t.indexOf("Bottom")?this.tipClass="e-tip-top":0===t.indexOf("Left")?this.tipClass="e-tip-right":this.tipClass="e-tip-bottom"},i.prototype.renderPopup=function(t){var e=this.mouseTrail?{top:0,left:0}:this.getTooltipPosition(t);this.tooltipEle.classList.remove("e-lib"),this.popupObj=new ue(this.tooltipEle,{height:this.height,width:this.width,position:{X:e.left,Y:e.top},enableRtl:this.enableRtl,open:this.openPopupHandler.bind(this),close:this.closePopupHandler.bind(this)})},i.prototype.getTooltipPosition=function(t){this.tooltipEle.style.display="block";var e=n(t,this.tooltipPositionX,this.tooltipPositionY),i=this.calculateTooltipOffset(this.position),o=this.collisionFlipFit(t,e.left+i.left,e.top+i.top);return this.tooltipEle.style.display="",o},i.prototype.reposition=function(t){var e=this.getTooltipPosition(t);this.popupObj.position={X:e.left,Y:e.top},this.popupObj.dataBind()},i.prototype.openPopupHandler=function(){!this.mouseTrail&&this.needTemplateReposition()&&this.reposition(this.findTarget()),this.trigger("afterOpen",this.tooltipEventArgs)},i.prototype.closePopupHandler=function(){e.resetBlazorTemplate(this.element.id+"content","Content"),this.clearTemplate(["content"]),this.clear(),this.trigger("afterClose",this.tooltipEventArgs)},i.prototype.calculateTooltipOffset=function(t){var e={top:0,left:0},i=this.tooltipEle.offsetWidth,o=this.tooltipEle.offsetHeight,n=this.tooltipEle.querySelector(".e-arrow-tip"),s=n?n.offsetWidth:0,r=n?n.offsetHeight:0,l=this.showTipPointer?0:8,a=r/2+2+(this.tooltipEle.offsetHeight-this.tooltipEle.clientHeight),h=s/2+2+(this.tooltipEle.offsetWidth-this.tooltipEle.clientWidth);switch(this.mouseTrail&&(l+=2),t){case"RightTop":e.left+=s+l,e.top-=o-a;break;case"RightCenter":e.left+=s+l,e.top-=o/2;break;case"RightBottom":e.left+=s+l,e.top-=a;break;case"BottomRight":e.top+=r+l,e.left-=h;break;case"BottomCenter":e.top+=r+l,e.left-=i/2;break;case"BottomLeft":e.top+=r+l,e.left-=i-h;break;case"LeftBottom":e.left-=s+i+l,e.top-=a;break;case"LeftCenter":e.left-=s+i+l,e.top-=o/2;break;case"LeftTop":e.left-=s+i+l,e.top-=o-a;break;case"TopLeft":e.top-=o+r+l,e.left-=i-h;break;case"TopRight":e.top-=o+r+l,e.left-=h;break;default:e.top-=o+r+l,e.left-=i/2}return e.left+=this.offsetX,e.top+=this.offsetY,e},i.prototype.updateTipPosition=function(t){var i=this.tooltipEle.querySelectorAll(".e-arrow-tip,.e-arrow-tip-outer,.e-arrow-tip-inner"),o=["e-tip-bottom","e-tip-top","e-tip-left","e-tip-right"];e.removeClass(i,o),this.setTipClass(t),e.addClass(i,this.tipClass)},i.prototype.adjustArrow=function(t,e,i,o){if(!1!==this.showTipPointer){this.updateTipPosition(e);var n,s;this.tooltipEle.style.display="block";var r=this.tooltipEle.clientWidth,l=this.tooltipEle.clientHeight,a=this.tooltipEle.querySelector(".e-arrow-tip"),h=this.tooltipEle.querySelector(".e-arrow-tip-inner"),d=a.offsetWidth,p=a.offsetHeight;if(this.tooltipEle.style.display="","e-tip-bottom"===this.tipClass||"e-tip-top"===this.tipClass)"e-tip-bottom"===this.tipClass?(s="99.9%",h.style.top="-"+(p-2)+"px"):(s=-(p-1)+"px",h.style.top="-"+(p-6)+"px"),t&&(n=(c="Center"!==i||r>t.offsetWidth||this.mouseTrail)&&"Left"===i||!c&&"End"===this.tipPointerPosition?r-d-2+"px":c&&"Right"===i||!c&&"Start"===this.tipPointerPosition?"2px":r/2-d/2+"px");else{"e-tip-right"===this.tipClass?(n="99.9%",h.style.left="-"+(d-2)+"px"):(n=-(d-1)+"px",h.style.left=d-2-d+"px");var c="Center"!==o||l>t.offsetHeight||this.mouseTrail;s=c&&"Top"===o||!c&&"End"===this.tipPointerPosition?l-p-2+"px":c&&"Bottom"===o||!c&&"Start"===this.tipPointerPosition?"2px":l/2-p/2+"px"}a.style.top=s,a.style.left=n}},i.prototype.renderContent=function(t){var i=this.tooltipEle.querySelector(".e-tip-content");if(this.cssClass&&e.addClass([this.tooltipEle],this.cssClass.split(" ")),t&&!e.isNullOrUndefined(t.getAttribute("title"))&&(t.setAttribute("data-content",t.getAttribute("title")),t.removeAttribute("title")),e.isNullOrUndefined(this.content))t&&!e.isNullOrUndefined(t.getAttribute("data-content"))&&(i.innerHTML=t.getAttribute("data-content"));else if(this.isBlazorTooltip||!this.isServerRender())if(i.innerHTML="",this.content instanceof HTMLElement)i.appendChild(this.content);else if("string"==typeof this.content&&this.content.indexOf("<div>Blazor")<0)this.enableHtmlSanitizer&&this.setProperties({content:e.SanitizeHtmlHelper.sanitize(this.content)},!0),i[this.enableHtmlParse?"innerHTML":"textContent"]=this.content;else{var o=e.compile(this.content)({},this,"content",this.element.id+"content",void 0,void 0,i);o&&e.append(o,i),this.renderReactTemplates(),"string"==typeof this.content&&this.content.indexOf("<div>Blazor")>=0&&(this.isBlazorTemplate=!0,e.updateBlazorTemplate(this.element.id+"content","Content",this))}},i.prototype.renderCloseIcon=function(){if(this.isSticky){var t=this.createElement("div",{className:"e-icons e-tooltip-close"});this.tooltipEle.appendChild(t),e.EventHandler.add(t,e.Browser.touchStartEvent,this.onStickyClose,this)}},i.prototype.addDescribedBy=function(t,i){var o=(t.getAttribute("aria-describedby")||"").split(/\s+/);o.indexOf(i)<0&&o.push(i),e.attributes(t,{"aria-describedby":o.join(" ").trim(),"data-tooltip-id":i})},i.prototype.removeDescribedBy=function(t){var e=t.getAttribute("data-tooltip-id"),i=(t.getAttribute("aria-describedby")||"").split(/\s+/),o=i.indexOf(e);-1!==o&&i.splice(o,1),t.removeAttribute("data-tooltip-id");var n=i.join(" ").trim();n?t.setAttribute("aria-describedby",n):t.removeAttribute("aria-describedby")},i.prototype.tapHoldHandler=function(t){clearTimeout(this.autoCloseTimer),this.targetHover(t.originalEvent)},i.prototype.touchEndHandler=function(t){var e=this;if(!this.isSticky){var i=function(){e.close()};this.autoCloseTimer=setTimeout(i,1500)}},i.prototype.targetClick=function(t){var i;i=this.target?e.closest(t.target,this.target):this.element,e.isNullOrUndefined(i)||(null===i.getAttribute("data-tooltip-id")?this.targetHover(t):this.isSticky||this.hideTooltip(this.animation.close,t,i))},i.prototype.targetHover=function(t){var i;if(i=this.target?e.closest(t.target,this.target):this.element,!(e.isNullOrUndefined(i)||null!==i.getAttribute("data-tooltip-id")&&0===this.closeDelay)){for(var o=0,n=[].slice.call(document.querySelectorAll("[data-tooltip-id= "+this.ctrlId+"_content]"));o<n.length;o++){var s=n[o];this.restoreElement(s)}this.showTooltip(i,this.animation.open,t)}},i.prototype.mouseMoveBeforeOpen=function(t){this.mouseMoveEvent=t},i.prototype.mouseMoveBeforeRemove=function(){this.mouseMoveTarget&&e.EventHandler.remove(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen)},i.prototype.showTooltip=function(t,i,o){var n=this;clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.openDelay&&this.mouseTrail&&(this.mouseMoveBeforeRemove(),this.mouseMoveTarget=t,e.EventHandler.add(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen,this)),this.tooltipEventArgs={type:o?o.type:null,cancel:!1,target:t,event:o||null,element:this.tooltipEle,isInteracted:!e.isNullOrUndefined(o)};var s=function(e){n.beforeRenderCallback(e,t,o,i)};this.trigger("beforeRender",this.tooltipEventArgs,s.bind(this))},i.prototype.beforeRenderCallback=function(t,i,o,n){var s=!1;if(t.cancel)this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove();else if(this.isHidden=!1,e.isNullOrUndefined(this.tooltipEle)){if(this.isServerRender()){this.contentTargetValue=i,this.contentEvent=o,this.contentAnimation=n;var r={enableTooltip:"true"};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",r),s=!0}else this.ctrlId=this.element.getAttribute("id")?e.getUniqueID(this.element.getAttribute("id")):e.getUniqueID("tooltip"),this.tooltipEle=this.createElement("div",{className:"e-tooltip-wrap e-popup e-lib",attrs:{role:"tooltip","aria-hidden":"false",id:this.ctrlId+"_content"},styles:"width:"+e.formatUnit(this.width)+";height:"+e.formatUnit(this.height)+";position:absolute;"}),this.beforeRenderBlazor(i,this);s||this.afterRenderBlazor(i,o,n,this)}else this.isServerRender()&&(e.addClass([this.tooltipEle],"e-popup-open"),document.body.appendChild(this.tooltipEle),this.renderCloseIcon(),this.renderPopup(i)),i&&(this.adjustArrow(i,this.position,this.tooltipPositionX,this.tooltipPositionY),this.addDescribedBy(i,this.ctrlId+"_content"),this.renderContent(i),e.Animation.stop(this.tooltipEle),this.reposition(i),this.afterRenderBlazor(i,o,n,this))},i.prototype.contentUpdated=function(t){e.isNullOrUndefined(this.tooltipEle)&&this.isServerRender()&&(this.ctrlId=this.element.id,this.tooltipEle=document.querySelector("#"+this.ctrlId+"_content"),this.tooltipEle&&(this.tooltipEle.setAttribute("style","width:"+e.formatUnit(this.width)+";height:"+e.formatUnit(this.height)+";position:absolute;"),this.beforeRenderBlazor(this.contentTargetValue,this),this.afterRenderBlazor(this.contentTargetValue,this.contentEvent,this.contentAnimation,this),this.contentTargetValue=this.contentEvent=this.contentAnimation=null))},i.prototype.beforeRenderBlazor=function(t,i){t&&(e.Browser.isDevice&&e.addClass([i.tooltipEle],"e-bigger"),"auto"!==i.width&&(i.tooltipEle.style.maxWidth=e.formatUnit(i.width)),this.isServerRender()||i.tooltipEle.appendChild(i.createElement("div",{className:"e-tip-content"})),document.body.appendChild(i.tooltipEle),e.removeClass([i.tooltipEle],"e-hidden"),i.addDescribedBy(t,i.ctrlId+"_content"),i.renderContent(t),e.addClass([i.tooltipEle],"e-popup-open"),i.showTipPointer&&i.renderArrow(),i.renderCloseIcon(),i.renderPopup(t),i.adjustArrow(t,i.position,i.tooltipPositionX,i.tooltipPositionY),e.Animation.stop(i.tooltipEle),i.reposition(t))},i.prototype.afterRenderBlazor=function(t,i,o,n){if(t){e.removeClass([n.tooltipEle],"e-popup-open"),e.addClass([n.tooltipEle],"e-popup-close"),n.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:t,event:i||null,element:n.tooltipEle,isInteracted:!e.isNullOrUndefined(i)},n.needTemplateReposition()&&!n.mouseTrail&&(n.tooltipEle.style.display="none");var s=function(e){n.beforeOpenCallback(e,t,o,i)};n.trigger("beforeOpen",n.tooltipEventArgs,s.bind(n))}},i.prototype.beforeOpenCallback=function(t,i,o,n){var s=this;if(t.cancel)this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove(),this.restoreElement(i);else{var r={name:o.effect,duration:o.duration,delay:o.delay,timingFunction:"easeOut"};if("None"===o.effect&&(r=void 0),this.openDelay>0){var l=function(){s.mouseTrail&&e.EventHandler.add(i,"mousemove touchstart mouseenter",s.onMouseMove,s),s.popupObj&&(s.popupObj.show(r,i),s.mouseMoveEvent&&s.mouseTrail&&s.onMouseMove(s.mouseMoveEvent))};this.showTimer=setTimeout(l,this.openDelay)}else this.popupObj&&this.popupObj.show(r,i)}n&&this.wireMouseEvents(n,i)},i.prototype.needTemplateReposition=function(){var t=this;return!e.isNullOrUndefined(t.viewContainerRef)&&"string"!=typeof t.viewContainerRef||this.isServerRender()&&this.isBlazorTemplate},i.prototype.checkCollision=function(t,e,i){var o={left:e,top:i,position:this.position,horizontal:this.tooltipPositionX,vertical:this.tooltipPositionY},n=v(this.tooltipEle,this.checkCollideTarget(),e,i);return n.length>0&&(o.horizontal=n.indexOf("left")>=0?"Right":n.indexOf("right")>=0?"Left":this.tooltipPositionX,o.vertical=n.indexOf("top")>=0?"Bottom":n.indexOf("bottom")>=0?"Top":this.tooltipPositionY),o},i.prototype.collisionFlipFit=function(t,e,i){var o=this.checkCollision(t,e,i),s=o.position;if(this.tooltipPositionY!==o.vertical&&(s=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?o.vertical+this.tooltipPositionX:this.tooltipPositionX+o.vertical),this.tooltipPositionX!==o.horizontal&&(0===s.indexOf("Left")&&(o.vertical="LeftTop"===s||"LeftCenter"===s?"Top":"Bottom",s=o.vertical+"Left"),0===s.indexOf("Right")&&(o.vertical="RightTop"===s||"RightCenter"===s?"Top":"Bottom",s=o.vertical+"Right"),o.horizontal=this.tooltipPositionX),this.tooltipEventArgs={type:null,cancel:!1,target:t,event:null,element:this.tooltipEle,collidedPosition:s},this.trigger("beforeCollision",this.tooltipEventArgs),o.position!==s){var r=n(t,o.horizontal,o.vertical);this.adjustArrow(t,s,o.horizontal,o.vertical);var l=this.calculateTooltipOffset(s);l.top-=-1!=="TopBottom".indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!=="TopBottom".indexOf(s.split(/(?=[A-Z])/)[0])?2*this.offsetY:0,l.left-=-1!=="RightLeft".indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!=="RightLeft".indexOf(s.split(/(?=[A-Z])/)[0])?2*this.offsetX:0,o.position=s,o.left=r.left+l.left,o.top=r.top+l.top}else this.adjustArrow(t,s,o.horizontal,o.vertical);var a={left:o.left,top:o.top},h=g(this.tooltipEle,this.checkCollideTarget(),{X:!0,Y:!1},a).left;if(this.tooltipEle.style.display="block",this.showTipPointer&&(0===s.indexOf("Bottom")||0===s.indexOf("Top"))){var d=this.tooltipEle.querySelector(".e-arrow-tip"),p=parseInt(d.style.left,10)-(h-o.left);p<0?p=0:p+d.offsetWidth>this.tooltipEle.clientWidth&&(p=this.tooltipEle.clientWidth-d.offsetWidth),d.style.left=p.toString()+"px"}return this.tooltipEle.style.display="",a.left=h,a},i.prototype.checkCollideTarget=function(){return!this.windowCollision&&this.target?this.element:null},i.prototype.hideTooltip=function(t,e,i){var o=this;if(this.closeDelay>0){clearTimeout(this.hideTimer),clearTimeout(this.showTimer);var n=function(){o.closeDelay&&o.tooltipEle&&o.isTooltipOpen||o.tooltipHide(t,e,i)};this.hideTimer=setTimeout(n,this.closeDelay)}else this.tooltipHide(t,e,i)},i.prototype.tooltipHide=function(t,i,o){var n,s=this;n=i?this.target?o||i.target:this.element:document.querySelector("[data-tooltip-id= "+this.ctrlId+"_content]"),this.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:n,event:i||null,element:this.tooltipEle,isInteracted:!e.isNullOrUndefined(i)},this.trigger("beforeClose",this.tooltipEventArgs,function(e){e.cancel?s.isHidden=!1:s.isServerRender()?s.blazorHide(t,n):(s.mouseMoveBeforeRemove(),s.popupHide(t,n))})},i.prototype.blazorHide=function(t,e){var i=this,o=function(){i.popupHide(t,e)};this.popupObj?this.popupHide(t,e):setTimeout(o,200)},i.prototype.popupHide=function(t,e){e&&this.restoreElement(e),this.isHidden=!0;var i={name:t.effect,duration:t.duration,delay:t.delay,timingFunction:"easeIn"};"None"===t.effect&&(i=void 0),this.popupObj&&this.popupObj.hide(i)},i.prototype.restoreElement=function(t){this.unwireMouseEvents(t),e.isNullOrUndefined(t.getAttribute("data-content"))||(t.setAttribute("title",t.getAttribute("data-content")),t.removeAttribute("data-content")),this.removeDescribedBy(t)},i.prototype.clear=function(){if(this.tooltipEle&&(e.removeClass([this.tooltipEle],"e-popup-close"),e.addClass([this.tooltipEle],"e-popup-open")),this.isHidden){if(this.popupObj&&this.popupObj.destroy(),this.isServerRender()&&this.tooltipEle){this.tooltipEle.style.display="none";var t={enableTooltip:"false"};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",t),e.remove(this.tooltipEle)}else this.tooltipEle&&e.remove(this.tooltipEle);this.tooltipEle=null,this.popupObj=null}},i.prototype.tooltipHover=function(t){this.tooltipEle&&(this.isTooltipOpen=!0)},i.prototype.tooltipMouseOut=function(t){this.isTooltipOpen=!1,this.hideTooltip(this.animation.close,t,this.findTarget())},i.prototype.onMouseOut=function(t){var i=t.relatedTarget;if(i&&!this.mouseTrail){var o=e.closest(i,".e-tooltip-wrap.e-lib.e-popup");o?e.EventHandler.add(o,"mouseleave",this.tooltipElementMouseOut,this):(this.hideTooltip(this.animation.close,t,this.findTarget()),0===this.closeDelay&&this.clear())}else this.hideTooltip(this.animation.close,t,this.findTarget()),this.clear()},i.prototype.tooltipElementMouseOut=function(t){this.hideTooltip(this.animation.close,t,this.findTarget()),e.EventHandler.remove(this.element,"mouseleave",this.tooltipElementMouseOut),this.clear()},i.prototype.onStickyClose=function(t){this.close()},i.prototype.onMouseMove=function(t){var i=0,o=0;t.type.indexOf("touch")>-1?(t.preventDefault(),i=t.touches[0].pageX,o=t.touches[0].pageY):(i=t.pageX,o=t.pageY),e.Animation.stop(this.tooltipEle),e.removeClass([this.tooltipEle],"e-popup-close"),e.addClass([this.tooltipEle],"e-popup-open"),this.adjustArrow(t.target,this.position,this.tooltipPositionX,this.tooltipPositionY);var n=this.calculateTooltipOffset(this.position),s=i+n.left+this.offsetX,r=o+n.top+this.offsetY,l=this.checkCollision(t.target,s,r);if(this.tooltipPositionX!==l.horizontal||this.tooltipPositionY!==l.vertical){var a=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?l.vertical+l.horizontal:l.horizontal+l.vertical;l.position=a,this.adjustArrow(t.target,l.position,l.horizontal,l.vertical);var h=this.calculateTooltipOffset(l.position);l.left=i+h.left-this.offsetX,l.top=o+h.top-this.offsetY}this.tooltipEle.style.left=l.left+"px",this.tooltipEle.style.top=l.top+"px"},i.prototype.keyDown=function(t){this.tooltipEle&&27===t.keyCode&&this.close()},i.prototype.touchEnd=function(t){this.tooltipEle&&null===e.closest(t.target,".e-tooltip")&&!this.isSticky&&this.close()},i.prototype.scrollHandler=function(t){this.tooltipEle&&(e.closest(t.target,".e-tooltip-wrap.e-lib.e-popup")||this.close())},i.prototype.render=function(){this.initialize(),this.wireEvents(this.opensOn),this.renderComplete()},i.prototype.preRender=function(){this.tipClass="e-tip-bottom",this.tooltipPositionX="Center",this.tooltipPositionY="Top",this.isHidden=!0},i.prototype.wireEvents=function(t){for(var i=0,o=this.getTriggerList(t);i<o.length;i++){var n=o[i];if("Custom"===n)return;"Focus"===n&&this.wireFocusEvents(),"Click"===n&&e.EventHandler.add(this.element,e.Browser.touchStartEvent,this.targetClick,this),"Hover"===n&&(e.Browser.isDevice?(this.touchModule=new e.Touch(this.element,{tapHoldThreshold:500,tapHold:this.tapHoldHandler.bind(this)}),e.EventHandler.add(this.element,e.Browser.touchEndEvent,this.touchEndHandler,this)):(e.EventHandler.add(this.element,"mouseover",this.targetHover,this),this.isServerRender()&&!this.isSticky&&e.EventHandler.add(this.element,"mouseleave",this.onMouseOut,this)))}e.EventHandler.add(document,"touchend",this.touchEnd,this),e.EventHandler.add(document,"scroll wheel",this.scrollHandler,this),e.EventHandler.add(document,"keydown",this.keyDown,this)},i.prototype.getTriggerList=function(t){return"Auto"===t&&(t=e.Browser.isDevice?"Hover":"Hover Focus"),t.split(" ")},i.prototype.wireFocusEvents=function(){if(e.isNullOrUndefined(this.target))e.EventHandler.add(this.element,"focus",this.targetHover,this);else for(var t=0,i=[].slice.call(this.element.querySelectorAll(this.target));t<i.length;t++){var o=i[t];e.EventHandler.add(o,"focus",this.targetHover,this)}},i.prototype.wireMouseEvents=function(t,i){this.tooltipEle&&(this.isSticky||("focus"===t.type&&e.EventHandler.add(i,"blur",this.onMouseOut,this),"mouseover"===t.type&&(this.isServerRender()||e.EventHandler.add(i,"mouseleave",this.onMouseOut,this)),this.closeDelay&&(e.EventHandler.add(this.tooltipEle,"mouseenter",this.tooltipHover,this),e.EventHandler.add(this.tooltipEle,"mouseleave",this.tooltipMouseOut,this))),this.mouseTrail&&0===this.openDelay&&e.EventHandler.add(i,"mousemove touchstart mouseenter",this.onMouseMove,this))},i.prototype.unwireEvents=function(t){for(var i=0,o=this.getTriggerList(t);i<o.length;i++){var n=o[i];if("Custom"===n)return;"Focus"===n&&this.unwireFocusEvents(),"Click"===n&&e.EventHandler.remove(this.element,e.Browser.touchStartEvent,this.targetClick),"Hover"===n&&(e.Browser.isDevice?(this.touchModule&&this.touchModule.destroy(),e.EventHandler.remove(this.element,e.Browser.touchEndEvent,this.touchEndHandler)):(e.EventHandler.remove(this.element,"mouseover",this.targetHover),this.isServerRender()&&!this.isSticky&&e.EventHandler.remove(this.element,"mouseleave",this.onMouseOut)))}e.EventHandler.remove(document,"touchend",this.touchEnd),e.EventHandler.remove(document,"scroll wheel",this.scrollHandler),e.EventHandler.remove(document,"keydown",this.keyDown)},i.prototype.unwireFocusEvents=function(){if(e.isNullOrUndefined(this.target))e.EventHandler.remove(this.element,"focus",this.targetHover);else for(var t=0,i=[].slice.call(this.element.querySelectorAll(this.target));t<i.length;t++){var o=i[t];e.EventHandler.remove(o,"focus",this.targetHover)}},i.prototype.unwireMouseEvents=function(t){if(!this.isSticky){for(var i=0,o=this.getTriggerList(this.opensOn);i<o.length;i++){var n=o[i];"Focus"===n&&e.EventHandler.remove(t,"blur",this.onMouseOut),"Hover"!==n||e.Browser.isDevice||this.isServerRender()||e.EventHandler.remove(t,"mouseleave",this.onMouseOut)}this.closeDelay&&(e.EventHandler.remove(t,"mouseenter",this.tooltipHover),e.EventHandler.remove(t,"mouseleave",this.tooltipMouseOut))}this.mouseTrail&&e.EventHandler.remove(t,"mousemove touchstart mouseenter",this.onMouseMove)},i.prototype.findTarget=function(){return document.querySelector("[data-tooltip-id= "+this.ctrlId+"_content]")},i.prototype.getModuleName=function(){return"tooltip"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.onPropertyChanged=function(t,i){for(var o=this.findTarget(),n=0,s=Object.keys(t);n<s.length;n++)switch(s[n]){case"width":this.tooltipEle&&o&&(this.tooltipEle.style.width=this.tooltipEle.style.maxWidth=e.formatUnit(t.width),this.reposition(o));break;case"height":this.tooltipEle&&o&&(this.tooltipEle.style.height=e.formatUnit(t.height),this.reposition(o));break;case"content":if(this.tooltipEle)this.isServerRender()&&(this.isBlazorTooltip=!0),this.renderContent();else if(this.isServerRender()){var r={content:t.content};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",r)}break;case"opensOn":this.unwireEvents(i.opensOn),this.wireEvents(t.opensOn);break;case"position":if(this.formatPosition(),this.tooltipEle&&o){var l=this.tooltipEle.querySelector(".e-arrow-tip-inner");l.style.top=l.style.left=null,this.reposition(o)}break;case"tipPointerPosition":this.tooltipEle&&o&&this.reposition(o);break;case"offsetX":if(this.tooltipEle){var a=t.offsetX-i.offsetX;this.tooltipEle.style.left=(parseInt(this.tooltipEle.style.left,10)+a).toString()+"px"}break;case"offsetY":if(this.tooltipEle){var h=t.offsetY-i.offsetY;this.tooltipEle.style.top=(parseInt(this.tooltipEle.style.top,10)+h).toString()+"px"}break;case"cssClass":this.tooltipEle&&(i.cssClass&&e.removeClass([this.tooltipEle],i.cssClass.split(" ")),t.cssClass&&e.addClass([this.tooltipEle],t.cssClass.split(" ")));break;case"enableRtl":this.tooltipEle&&(this.enableRtl?e.addClass([this.tooltipEle],"e-rtl"):e.removeClass([this.tooltipEle],"e-rtl"))}},i.prototype.open=function(t,i){e.isNullOrUndefined(i)&&(i=this.animation.open),e.isNullOrUndefined(t)&&(t=this.element),"none"!==t.style.display&&this.showTooltip(t,i)},i.prototype.close=function(t){t||(t=this.animation.close),this.hideTooltip(t)},i.prototype.refresh=function(t){this.tooltipEle&&this.renderContent(t),this.popupObj&&t&&this.reposition(t)},i.prototype.destroy=function(){if(this.isServerRender()||(t.prototype.destroy.call(this),this.tooltipEle&&e.remove(this.tooltipEle)),this.isServerRender()&&this.tooltipEle){var i=document.querySelector("#"+this.ctrlId+"_content_placeholder");i&&i.appendChild(this.tooltipEle)}this.popupObj&&this.popupObj.destroy(),e.removeClass([this.element],"e-tooltip"),this.unwireEvents(this.opensOn),this.unwireMouseEvents(this.element),this.tooltipEle=null,this.popupObj=null},We([e.Property("auto")],i.prototype,"width",void 0),We([e.Property("auto")],i.prototype,"height",void 0),We([e.Property()],i.prototype,"content",void 0),We([e.Property()],i.prototype,"target",void 0),We([e.Property("TopCenter")],i.prototype,"position",void 0),We([e.Property(0)],i.prototype,"offsetX",void 0),We([e.Property(0)],i.prototype,"offsetY",void 0),We([e.Property(!0)],i.prototype,"showTipPointer",void 0),We([e.Property(!0)],i.prototype,"enableHtmlParse",void 0),We([e.Property(!1)],i.prototype,"windowCollision",void 0),We([e.Property("Auto")],i.prototype,"tipPointerPosition",void 0),We([e.Property("Auto")],i.prototype,"opensOn",void 0),We([e.Property(!1)],i.prototype,"mouseTrail",void 0),We([e.Property(!1)],i.prototype,"isSticky",void 0),We([e.Complex({},Ze)],i.prototype,"animation",void 0),We([e.Property(0)],i.prototype,"openDelay",void 0),We([e.Property(0)],i.prototype,"closeDelay",void 0),We([e.Property()],i.prototype,"cssClass",void 0),We([e.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),We([e.Event()],i.prototype,"beforeRender",void 0),We([e.Event()],i.prototype,"beforeOpen",void 0),We([e.Event()],i.prototype,"afterOpen",void 0),We([e.Event()],i.prototype,"beforeClose",void 0),We([e.Event()],i.prototype,"afterClose",void 0),We([e.Event()],i.prototype,"beforeCollision",void 0),We([e.Event()],i.prototype,"created",void 0),We([e.Event()],i.prototype,"destroyed",void 0),i=We([e.NotifyPropertyChanges],i)}(e.Component),Ke={},Je=30,Qe=30,$e=30,ti=36,ei="e-spin-show",ii="e-spin-hide",oi="e-spin-material",ni="e-spin-fabric",si="e-spin-tailwind",ri="e-spin-bootstrap",li="e-spin-bootstrap4",ai="e-spin-high-contrast",hi="e-spinner-pane",di="e-spinner-inner",pi="e-path-circle",ci="e-path-arc",ui="e-spin-label",fi="e-spin-template",mi=null,gi=null;return t.PositionData=pe,t.Popup=ue,t.getScrollableParent=I,t.getZindexPartial=Y,t.getMaxZindex=X,t.calculateRelativeBasedPosition=o,t.calculatePosition=n,t.fit=g,t.isCollide=v,t.flip=y,t.ButtonProps=ze,t.AnimationSettings=Me,t.Dialog=_e,t.Animation=Ze,t.Tooltip=Ge,t.Spinner=rt,t.createSpinner=lt,t.showSpinner=Dt,t.hideSpinner=qt,t.setSpinner=Ft,t}({},ej.base,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-splitbuttons.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.splitbuttons=function(e,t,i,s){"use strict";function n(e,i){for(var s=t.extend({},e),n=0,o=Object.keys(s);n<o.length;n++){var r=o[n];i.indexOf(r)<0&&t.deleteObject(s,r)}return s}function o(e,i){var s=40===i?0:e.childElementCount-1,n=s,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var a=0,p=e.children.length;a<p;a++)e.children[a].classList.contains("e-focused")&&(n=a,e.children[a].classList.remove("e-focused"),40===i?n++:n--,n===(40===i?e.childElementCount:-1)&&(n=s));-1!==(n=r(e,e.children[n],n,i))&&(t.addClass([e.children[n]],"e-focused"),e.children[n].focus())}function r(e,t,i,s,n){if(void 0===n&&(n=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(i===(40===s?e.childElementCount-1:0)?i=40===s?0:e.childElementCount-1:40===s?i++:i--),(t=e.children[i]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++n===e.childElementCount)return i=-1;i=r(e,t,i,s,n)}return i}function a(e){var t=[].slice.call(e.getElementsByClassName("e-blank-icon"));if(t.length){var i=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)");i.classList.contains("e-url")&&(i=i.querySelector(".e-menu-url"));var s,n=i.querySelector(".e-menu-icon"),o=e.classList.contains("e-rtl");s=o?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var r=parseInt(getComputedStyle(n).fontSize,10)+parseInt(getComputedStyle(n)[s.margin],10)+parseInt(getComputedStyle(i).paddingLeft,10)+"px";t.forEach(function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[s.padding]=r:e.style[s.padding]=r})}}function p(e,s,n){void 0===s&&(s={});var o,r,a,p;t.isNullOrUndefined(n)&&(n=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;s.buttons=s.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=s.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=n("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),s.cssClass&&p&&!p.cssClass&&(p.cssClass=s.cssClass),new i.Button(p||{},r));return l}var 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)}}(),c=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},h=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return l(i,e),c([t.Property("")],i.prototype,"iconCss",void 0),c([t.Property("")],i.prototype,"id",void 0),c([t.Property(!1)],i.prototype,"separator",void 0),c([t.Property("")],i.prototype,"text",void 0),c([t.Property("")],i.prototype,"url",void 0),c([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),u=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},m={DISABLED:"e-disabled",FOCUS:"e-focused",ICON:"e-menu-icon",ITEM:"e-item",POPUP:"e-dropdown-popup",RTL:"e-rtl",SEPARATOR:"e-separator",VERTICAL:"e-vertical"},y=function(e){function r(t,i){var s=e.call(this,t,i)||this;return s.isPopupCreated=!0,s}return d(r,e),r.prototype.preRender=function(){},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},r.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},r.prototype.addItems=function(e,t){for(var i,s=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){s=n;break}for(var r=e.length-1;r>=0;r--)i=new h(this,"items",e[r],!0),this.items.splice(s,0,i);this.canOpen()||this.createItems()},r.prototype.removeItems=function(e,t){for(var i=!1,s=0,n=e.length;s<n;s++)for(var o=0,r=this.items.length;o<r;o++)if(e[s]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),i=!0;break}i&&this.getULElement()&&this.createItems()},r.prototype.createPopup=function(){var e,i=this.createElement("div",{className:m.POPUP,id:this.element.id+"-popup"});document.body.appendChild(i),this.dropDown=new s.Popup(i,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.isPopupCreated=!0},r.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},r.prototype.createItems=function(e){var i,s,n,o,r=this.items,p=this.hasIcon(this.items,"iconCss"),l=this.getULElement();l?l.innerHTML="":l=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var c=0;c<r.length;c++){s=r[c];var h=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(s.text):s.text;n=this.createElement("li",{innerHTML:s.url?"":h,className:s.separator?m.ITEM+" "+m.SEPARATOR:m.ITEM,attrs:{role:"menuItem",tabindex:"-1"},id:s.id?s.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),s.url&&(n.appendChild(this.createAnchor(s)),n.classList.add("e-url")),s.iconCss?(i=this.createElement("span",{className:m.ICON+" "+s.iconCss}),s.url?n.childNodes[0].appendChild(i):n.insertBefore(i,n.childNodes[0])):p&&!s.separator&&n.classList.add("e-blank-icon"),s.disabled&&n.classList.add("e-disabled"),o={item:s,element:n},this.trigger("beforeItemRender",o),l.appendChild(n)}e&&this.getPopUpElement().appendChild(l),p&&a(this.getPopUpElement())},r.prototype.hasIcon=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},r.prototype.createAnchor=function(e){var i=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:i,attrs:{href:e.url}})},r.prototype.initialize=function(){this.button=new i.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.target||!this.createPopupOnClick?this.createPopup():this.isPopupCreated=!1},r.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(m.VERTICAL)>-1?"bottom":"right")+" e-caret"}))},r.prototype.setActiveElem=function(e){this.activeElem=e},r.prototype.getModuleName=function(){return"dropdown-btn"},r.prototype.canOpen=function(){var e=!1;return this.isPopupCreated&&(e=this.getPopUpElement().classList.contains("e-popup-close")),e},r.prototype.destroy=function(){var i=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var s;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(s=this.cssClass.split(" ")),this.button.destroy(),s&&t.removeClass([this.element],s),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){i.element.removeAttribute(e)}),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents()}},r.prototype.destroyPopup=function(){if(this.isPopupCreated){if(this.dropDown.destroy(),this.getPopUpElement()){var e=document.getElementById(this.getPopUpElement().id);e&&(t.removeClass([e],["e-popup-open","e-popup-close"]),t.detach(e))}t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated&&(this.dropDown=void 0)}this.isPopupCreated=!1},r.prototype.getPopUpElement=function(){var e=null;return this.dropDown&&(e=this.dropDown.element),e},r.prototype.getULElement=function(){var e=null;return this.getPopUpElement()&&(e=this.getPopUpElement().children[0]),e},r.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this)},r.prototype.popupWireEvents=function(){var e=this.getPopUpElement();t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+m.ITEM})},r.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},r.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),o(this.getULElement(),e.keyCode))},r.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},r.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},r.prototype.mousedownHandler=function(e){var i=e.target;!this.dropDown||this.canOpen()||t.closest(i,'[id="'+this.getPopUpElement().id+'"]')||t.closest(i,'[id="'+this.element.id+'"]')||this.closePopup(e)},r.prototype.clickHandler=function(e){var i=e.target;if(t.closest(i,'[id="'+this.element.id+'"]'))!this.createPopupOnClick||this.target?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e));else if(t.closest(i,'[id="'+this.getPopUpElement().id+'"]')){var s=void 0,n=void 0,o=void 0,r=this.getLI(i);r&&(n=Array.prototype.indexOf.call(this.getULElement().children,r),(o=this.items[n])&&(s={element:r,item:o},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},r.prototype.openPopUp=function(e){var i=this;void 0===e&&(e=null),this.target||this.createItems(!0);var s=this.getULElement();this.popupWireEvents();var n={element:s,items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",n,function(e){if(!e.cancel){var s=i.getULElement();i.dropDown.show(null,i.element),t.addClass([i.element],"e-active"),i.element.setAttribute("aria-expanded","true"),s.focus();var n={element:s,items:i.items};i.trigger("open",n)}})},r.prototype.closePopup=function(e,i){var s=this;void 0===e&&(e=null);var n={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",n,function(e){if(!e.cancel){var n=s.getULElement(),o=n.querySelector(".e-selected");o&&o.classList.remove("e-selected"),s.dropDown.hide(),t.removeClass(s.activeElem,"e-active"),s.element.setAttribute("aria-expanded","false"),i&&i.focus();var r={element:n,items:s.items};s.trigger("close",r),!s.target&&n&&t.detach(n),s.target||s.createPopupOnClick&&s.destroyPopup(),s.target&&(s.isPopupCreated=!s.createPopupOnClick)}})},r.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler))},r.prototype.onPropertyChanged=function(e,i){var s=["content","cssClass","iconCss","iconPosition","disabled","enableRtl"];this.button.setProperties(n(e,s));var o;this.isPopupCreated&&(o=this.getPopUpElement(),this.dropDown.setProperties(n(e,["enableRtl"])));for(var r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(m.VERTICAL)>-1){var p=this.element.querySelector("span.e-caret");t.classList(p,["e-icon-bottom"],["e-icon-right"])}this.isPopupCreated&&(i.cssClass&&t.removeClass([o],i.cssClass.split(" ")),e.cssClass&&t.addClass([o],e.cssClass.split(" ")));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}},r.prototype.focusIn=function(){this.element.focus()},u([t.Property("")],r.prototype,"content",void 0),u([t.Property("")],r.prototype,"cssClass",void 0),u([t.Property(!1)],r.prototype,"disabled",void 0),u([t.Property("")],r.prototype,"iconCss",void 0),u([t.Property("Left")],r.prototype,"iconPosition",void 0),u([t.Property(!1)],r.prototype,"enableHtmlSanitizer",void 0),u([t.Collection([],h)],r.prototype,"items",void 0),u([t.Property(!1)],r.prototype,"createPopupOnClick",void 0),u([t.Property("")],r.prototype,"target",void 0),u([t.Event()],r.prototype,"beforeItemRender",void 0),u([t.Event()],r.prototype,"beforeOpen",void 0),u([t.Event()],r.prototype,"beforeClose",void 0),u([t.Event()],r.prototype,"close",void 0),u([t.Event()],r.prototype,"open",void 0),u([t.Event()],r.prototype,"select",void 0),u([t.Event()],r.prototype,"created",void 0),r=u([t.NotifyPropertyChanges],r)}(t.Component),f=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(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,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},g="e-rtl",b="EJS-SPLITBUTTON",C=function(e){function s(t,i){return e.call(this,t,i)||this}return f(s,e),s.prototype.preRender=function(){var e=this.element;if(e.tagName===b){for(var i=t.getValue("ej2_instances",e),s=this.createElement("button",{attrs:{type:"button"}}),n=this.createElement(b,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)s.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(n,e),t.detach(e),e=s,n.appendChild(e),t.setValue("ej2_instances",i,e),this.wrapper=n,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},s.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(t,i){e.prototype.addItems.call(this,t,i),this.secondaryBtnObj.items=this.items},s.prototype.removeItems=function(t,i){e.prototype.removeItems.call(this,t,i),this.secondaryBtnObj.items=this.items},s.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add(g),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},s.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new i.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},s.prototype.createSecondaryButton=function(){var e=this,t=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"});this.wrapper.appendChild(t);var i={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick};i.beforeItemRender=function(t){e.createPopupOnClick&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown),e.trigger("beforeItemRender",t)},i.open=function(t){e.trigger("open",t)},i.close=function(t){e.trigger("close",t)},i.select=function(t){e.trigger("select",t)},i.beforeOpen=function(t){var i=new P;return e.trigger("beforeOpen",t,function(e){i.resolve(e)}),i},i.beforeClose=function(t){var i=new P;return e.trigger("beforeClose",t,function(e){i.resolve(e)}),i},this.secondaryBtnObj=new y(i),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(t),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},s.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},s.prototype.getModuleName=function(){return"split-btn"},s.prototype.toggle=function(){this.secondaryBtnObj.toggle()},s.prototype.destroy=function(){var i=this,s=[g];if(this.cssClass&&(s=s.concat(this.cssClass.split(" "))),this.element){var n=document.getElementById(this.element.id);n&&n.parentElement===this.wrapper&&(this.wrapper.tagName===b?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],s),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){i.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents())}this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},s.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},s.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},s.prototype.onPropertyChanged=function(e,i){var s=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(n(e,s)),s=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(n(e,s));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"cssClass":i.cssClass&&t.removeClass([this.wrapper],i.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],g):t.removeClass([this.wrapper],g)}},s.prototype.focusIn=function(){this.element.focus()},v([t.Property("")],s.prototype,"content",void 0),v([t.Property("")],s.prototype,"cssClass",void 0),v([t.Property(!1)],s.prototype,"disabled",void 0),v([t.Property("")],s.prototype,"iconCss",void 0),v([t.Property("Left")],s.prototype,"iconPosition",void 0),v([t.Property(!1)],s.prototype,"createPopupOnClick",void 0),v([t.Collection([],h)],s.prototype,"items",void 0),v([t.Property("")],s.prototype,"target",void 0),v([t.Event()],s.prototype,"beforeItemRender",void 0),v([t.Event()],s.prototype,"beforeOpen",void 0),v([t.Event()],s.prototype,"beforeClose",void 0),v([t.Event()],s.prototype,"click",void 0),v([t.Event()],s.prototype,"close",void 0),v([t.Event()],s.prototype,"open",void 0),v([t.Event()],s.prototype,"select",void 0),v([t.Event()],s.prototype,"created",void 0),s=v([t.NotifyPropertyChanges],s)}(y),P=function(){function e(){var e=this;this.promise=new Promise(function(t,i){e.resolve=t,e.reject=i}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}return e}(),E=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)}}(),w=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},O="e-btn-content",k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),w([t.Property(null)],i.prototype,"template",void 0),w([t.Property(16)],i.prototype,"width",void 0),w([t.Property("Left")],i.prototype,"position",void 0),i}(t.ChildProperty),S=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),w([t.Property(400)],i.prototype,"duration",void 0),w([t.Property("None")],i.prototype,"effect",void 0),w([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),L=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.step=1,s}return E(i,e),i.prototype.preRender=function(){e.prototype.preRender.call(this)},i.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},i.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},i.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},i.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},i.prototype.getModuleName=function(){return"progress-btn"},i.prototype.destroy=function(){var i=this,s=["e-hide-spinner","e-progress-active","e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(s=s.concat(this.cssClass.split(" "))),t.removeClass([this.element],s),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){i.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},i.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},i.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),s.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},i.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},i.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},i.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(O)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},i.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},i.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:O,innerHTML:e})))},i.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:O,innerHTML:e});if(this.iconCss){var i=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(i.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add("e-icon-btn");var s=t.childNodes[0];!s||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(i):t.insertBefore(i,s)}this.element.appendChild(t)},i.prototype.clickHandler=function(){this.element.classList.contains("e-progress-active")||this.startProgress()},i.prototype.startProgress=function(e,t){var i=this.element.classList,n=i.contains("e-vertical");i.add("e-progress-active"),i.contains("e-hide-spinner")||s.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,n),this.startContAnimate()},i.prototype.startAnimate=function(e,t,i,s,n,o,r,a){var p=this;try{var l=e-i,c=this.duration*o/100,h=l?l<c?l-c:l%c:0;this.progressTime=t=t+l-h,i=e-h,s+=(l-h)/this.duration*100;var d={percent:n=(t-r)%c==0||100===s?s:n,currentDuration:t,step:o};this.eIsVertical=a,0===s?this.trigger("begin",d,function(e){p.successCallback(e,s,n,t,r,h,i)}):100===s||t===this.duration?this.trigger("end",d,function(e){p.successCallback(e,s,n,t,r,h,i)}):this.trigger("progress",d,function(e){p.successCallback(e,s,n,t,r,h,i)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},i.prototype.successCallback=function(e,t,i,s,n,o,r){var a=this,p=t,l=i,c=o,h=s,d=n,u=r,m=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[m?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,u,p,l,e.step,d,m)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},i.prototype.startContAnimate=function(){var e=this,i=this.element.getElementsByClassName(O)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(i,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){i.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},i.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add("e-progress-active");for(var i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();var s={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",s),this.progressTime=this.percent=0},i.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(O)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},i.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(O)[0];if(this.element.classList.contains("e-hide-spinner")||s.hideSpinner(this.element),this.element.classList.remove("e-progress-active"),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},i.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(O)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},i.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},i.prototype.onPropertyChanged=function(i,n){var o=this.element,r=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(r=!0),e.prototype.onPropertyChanged.call(this,i,n);for(var a=0,p=Object.keys(i);a<p.length;a++)switch(p[a]){case"content":if(t.isBlazor()){var l=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?l.childNodes[1].textContent=this.content:l.childNodes[0].textContent=this.content:l.textContent=this.content}else this.setContent(),this.createSpinner(),r&&(s.showSpinner(this.element),r=!1),this.enableProgress&&this.createProgress();o.setAttribute("aria-label",o.textContent+" progress");break;case"iconCss":n.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":i.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":i.spinSettings.position&&(o.classList.remove("e-spin-"+n.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(i.spinSettings.template||i.spinSettings.width)&&(o.removeChild(this.getSpinner()),this.createSpinner())}},i.prototype.focusIn=function(){this.element.focus()},w([t.Property(!1)],i.prototype,"enableProgress",void 0),w([t.Property(2e3)],i.prototype,"duration",void 0),w([t.Property("Left")],i.prototype,"iconPosition",void 0),w([t.Property("")],i.prototype,"iconCss",void 0),w([t.Property(!1)],i.prototype,"disabled",void 0),w([t.Property(!1)],i.prototype,"isPrimary",void 0),w([t.Property("")],i.prototype,"cssClass",void 0),w([t.Property("")],i.prototype,"content",void 0),w([t.Property(!1)],i.prototype,"isToggle",void 0),w([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),w([t.Complex({},k)],i.prototype,"spinSettings",void 0),w([t.Complex({},S)],i.prototype,"animationSettings",void 0),w([t.Event()],i.prototype,"created",void 0),w([t.Event()],i.prototype,"begin",void 0),w([t.Event()],i.prototype,"progress",void 0),w([t.Event()],i.prototype,"end",void 0),w([t.Event()],i.prototype,"fail",void 0),i=w([t.NotifyPropertyChanges],i)}(i.Button);return e.getModel=n,e.upDownKeyHandler=o,e.setBlankIconStyle=a,e.Item=h,e.DropDownButton=y,e.SplitButton=C,e.Deferred=P,e.createButtonGroup=p,e.SpinSettings=k,e.AnimationSettings=S,e.ProgressButton=L,e}({},ej.base,ej.buttons,ej.popups),this.ejs=ej;
- /*!
- * filename: ej2-inputs.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.inputs=function(e,t,i,s){"use strict";function n(){if(t.attributes(this.element,{role:"textbox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive","aria-valuenow":""}),this.mask){for(var e=this.mask.split("]"),i=0;i<e.length;i++)if("\\"===e[i][e[i].length-1]){e[i]=e[i]+"]";for(var s=e[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),m.call(this,s[n])}else if((s=e[i].split("[")).length>1)for(var a=!1,n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):m.call(this,s[n]);else m.call(this,s[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!t.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)t.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=r=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");t.attributes(this.element,{"aria-invalid":"false"})}}function a(){I.call(this,this.promptMask),D.call(this,this.value)}function r(){t.EventHandler.add(this.element,"keydown",k,this),t.EventHandler.add(this.element,"keypress",L,this),t.EventHandler.add(this.element,"keyup",A,this),t.EventHandler.add(this.element,"input",T,this),t.EventHandler.add(this.element,"focus",g,this),t.EventHandler.add(this.element,"blur",b,this),t.EventHandler.add(this.element,"paste",E,this),t.EventHandler.add(this.element,"cut",C,this),t.EventHandler.add(this.element,"drop",S,this),t.EventHandler.add(this.element,"mousedown",v,this),t.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&t.EventHandler.add(this.formElement,"reset",u,this))}function l(){t.EventHandler.remove(this.element,"keydown",k),t.EventHandler.remove(this.element,"keypress",L),t.EventHandler.remove(this.element,"keyup",A),t.EventHandler.remove(this.element,"input",T),t.EventHandler.remove(this.element,"focus",g),t.EventHandler.remove(this.element,"blur",b),t.EventHandler.remove(this.element,"paste",E),t.EventHandler.remove(this.element,"cut",C),t.EventHandler.remove(this.element,"mousedown",v),t.EventHandler.remove(this.element,"mouseup",f),this.formElement&&t.EventHandler.remove(this.formElement,"reset",u)}function o(){this.showClearButton&&t.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")||(d.call(this,e),this.value="")}function d(e){var t=this.element.value;I.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),B.call(this,e,t),this.element.setSelectionRange(0,0)}function u(){"EJS-MASKEDTEXTBOX"===this.element.tagName?I.call(this,this.promptMask):this.value=this.initInputValue}function c(e){return e.value}function p(e,i){var s="",n=0,a=!1,r=t.isNullOrUndefined(i)?t.isNullOrUndefined(e)||t.isNullOrUndefined(this)?i:e.value:i;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!t.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!t.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!t.isNullOrUndefined(this.customCharacters)&&!t.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function m(e){for(var t=0;t<e.length;t++)this.hiddenMask+=e[t],"\\"!==e[t]&&this.customRegExpCollec.push(e[t])}function v(){this.isClicked=!0}function f(){this.isClicked=!1}function g(e){var i=this,s=this.element,n=0,a=p.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||y.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)r=!0;else for(var e=s.selectionStart;e<i.promptMask.length;e++){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),setTimeout(function(){var e=s.selectionStart-1;if(e===i.promptMask.length-1||s.value[e]===i.promptChar)l=!0;else for(var t=e;t>=0;t--){if(s.value[t]===i.promptChar){l=!0;break}if(s.value[t]!==i.promptMask[t]){l=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:e,value:i.value,maskedValue:s.value,container:i.inputObj.container,selectionEnd:s.selectionEnd},y.call(i,o,s)});break}t.isNullOrUndefined(s.value.match(this.promptChar))&&(o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd},y.call(this,o,s)),this.isClicked=!1}}function y(e,t){this.trigger("focus",e,function(e){t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd})}function b(e){if(this.blurEventArgs={event:e,value:this.value,maskedValue:this.element.value,container:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){I.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!t.isNullOrUndefined(i)&&i.classList.contains(ne)&&t.removeClass([i],ne)}}function E(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;I.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=t.element.value.replace(/ /g,"");t.redoCollec.length>0&&t.redoCollec[0].value===t.element.value&&(a=p.call(t,t.element)),I.call(t,n),t.element.selectionStart=i,t.element.selectionEnd=s;var r=0;t.maskKeyPress=!0;do{w.call(t,a[r],!1,null),++r}while(r<a.length);if(t.maskKeyPress=!1,t._callPasteHandler=!1,t.element.value===n){var l=0;t.maskKeyPress=!0;do{w.call(t,a[l],!1,null),++l}while(l<a.length);t.maskKeyPress=!1}else B.call(t,e,n)},1)}}function C(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){I.call(t,a),t.element.selectionStart=t.element.selectionEnd=s,t.element.value!==i&&B.call(t,e,null)},0)}}function S(e){e.preventDefault()}function T(e){if(!0!==t.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var i={ctrlKey:!1,keyCode:229};if(t.extend(e,i),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||P.call(this,e),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{w.call(this,a[r],e.ctrlKey,e),++r}while(r<a.length);this.element.value!==this.preEleVal&&B.call(this,e,null)}var l=p.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(I.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function k(e){if(this.mask&&!this.readonly){229!==e.keyCode&&(!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||e.preventDefault(),P.call(this,e));var t=this.element.value;if(e.ctrlKey&&(89===e.keyCode||90===e.keyCode)){var i=void 0;90===e.keyCode&&this.undoCollec.length>0&&t!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===e.keyCode&&this.redoCollec.length>0&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function x(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(e=this.redoCollec[0],I.call(this,e.value),e.startIndex-t==1?(this.element.selectionStart=e.startIndex,this.element.selectionEnd=e.endIndex):(this.element.selectionStart=t+1,this.element.selectionEnd=i+1)):(I.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function O(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,I.call(this,this.promptMask),D.call(this,t)),e}function P(e){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=O.call(this,s,i,e),x.call(this)),this.element.value.length>=this.promptMask.length&&"input"===e.type&&(s=O.call(this,s,i,e));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[l-1],u=this.element.selectionEnd;if(s||8===e.keyCode||46===e.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(l>0||(8===e.keyCode||46===e.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===e.keyCode&&(c=!0)):46===e.keyCode?++m:--m;for(var v=l;8===e.keyCode||s||c?v>m:v<m;8===e.keyCode||s||c?v--:v++)for(var f=l;8===e.keyCode||s||c?f>0:f<this.element.value.length;8===e.keyCode||s||c?f--:f++){var g=void 0;(8===e.keyCode||c)&&(a!==r&&a!==l||a===r)||s?(d=h[f-1],g=l-1):(d=h[f],g=l,++l);var y=this.element.value[g];if(t.isNullOrUndefined(this.regExpCollec[d])&&!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,e.preventDefault(),46!==e.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,E=this.promptChar,C=b.substring(0,g)+E+b.substring(l,b.length);I.call(this,C),e.preventDefault(),46!==e.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===e.keyCode||c||!n&&46!==e.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!t.isNullOrUndefined(this.customCharacters))break}}46===e.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(I.call(this,this.promptMask),e.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==p&&B.call(this,e,i)}}function L(e){if(this.mask&&!this.readonly){var t=this.element.value;if(!e.ctrlKey||e.ctrlKey&&"KeyA"!==e.code&&"KeyY"!==e.code&&"KeyZ"!==e.code&&"KeyX"!==e.code&&"KeyC"!==e.code&&"KeyV"!==e.code){this.maskKeyPress=!0;var i=e.key;"Spacebar"===i&&(i=String.fromCharCode(e.keyCode)),i?i&&1===i.length&&(w.call(this,i,e.ctrlKey,e),e.preventDefault()):(this.isIosInvalid=!0,w.call(this,String.fromCharCode(e.keyCode),e.ctrlKey,e),e.preventDefault(),this.isIosInvalid=!1),32===e.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==t&&B.call(this,e,t)}}function B(e,i){var s=this.isProtectedOnChange;if(!t.isNullOrUndefined(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=p.call(this,this.element)),t.isNullOrUndefined(e)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=e),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,t.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=p.call(this,this.element),t.attributes(this.element,{"aria-valuenow":this.element.value})}function A(e){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==e.keyCode)V.call(this);else{var s=void 0;if(1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,r=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var l=this.element.selectionStart;s=i.value;var o=i.value.substring(l-a,l);i=this.redoCollec[0],r=r.trim();var h=t.Browser.isAndroid&&""===r;h||o===r||i.value.substring(l-a,l)===r?h&&R.call(this,e,l-1,this.element.selectionEnd-1,r,e.ctrlKey,!1):w.call(this,r,e.ctrlKey,e)}else s=this.promptMask,w.call(this,r,e.ctrlKey,e);this.maskKeyPress=!1,B.call(this,e,s)}}var d=p.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else B.call(this,e);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function H(e){if(e.length>1&&this.promptMask.length+e.length<this.element.value.length){var t=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+e+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);I.call(this,t),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+e.length}this.element.selectionStart=this.element.selectionStart-e.length,this.element.selectionEnd=this.element.selectionEnd-e.length}function N(e){this.maskKeyPress||H.call(this,e)}function w(e,i,s){if(N.call(this,e),!t.isNullOrUndefined(this)&&!t.isNullOrUndefined(e))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<e.length;c++){var p=e[c];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=c),!this.maskKeyPress||r<this.promptMask.length){for(v=r;v<this.promptMask.length;v++)n=this.escapeMaskValue[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===e&&(u=!0),(t.isNullOrUndefined(this.regExpCollec[n])&&(t.isNullOrUndefined(this.customCharacters)||!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r]);if(t.isNullOrUndefined(this.customCharacters)||t.isNullOrUndefined(this.customCharacters[n]))!t.isNullOrUndefined(this.regExpCollec[n])&&p.match(new RegExp(this.regExpCollec[n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&p.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var m=this.customCharacters[n].split(","),v=0;v<m.length;v++)if(p.match(new RegExp("["+m[v]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var f=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,I.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,I.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}r=this.element.selectionStart,U.call(this,s,r,p,a,u),d=!0,c===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,R.call(this,s,r,l,e,i,d);c!==e.length-1||o||(!t.Browser.isAndroid||t.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==e.length||i||t.isNullOrUndefined(s)||F.call(this)}}function U(e,t,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=M.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,t)+i+a.substring(t+1,a.length);I.call(this,r),this.element.selectionStart=this.element.selectionEnd=t+1}}function R(e,i,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;i>=this.promptMask.length?I.call(this,l.substring(0,i)):(s===i?I.call(this,l.substring(0,i)+l.substring(i+1,l.length)):this.promptMask.length===this.element.value.length?I.call(this,l.substring(0,i)+l.substring(i,l.length)):I.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?i:s),F.call(this)}1!==n.length||a||t.isNullOrUndefined(e)||F.call(this)}function F(){var e=this,i=this.element.parentNode,s=200;i.classList.contains(te)||i.classList.contains(ie)?t.addClass([i],ee):t.addClass([this.element],ee),!0===this.isIosInvalid&&(s=400),t.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||V.call(e)},s)}function V(){var e=this.element.parentNode;t.isNullOrUndefined(e)||t.removeClass([e],ee),t.removeClass([this.element],ee),t.attributes(this.element,{"aria-invalid":"false"})}function M(e,t){var i,s,n=t,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;s>=0&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){e=e.toUpperCase();break}if("<"===i[s]){e=e.toLowerCase();break}if("|"===i[s])break}--s}return e}function D(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,I.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var i=0;i<e.length;i++)w.call(this,e[i],!1,null);var s=p.call(this,this.element);this.prevValue=s,this.value=s,B.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!t.isNullOrUndefined(n)&&n.classList.contains(ne)&&!this.isFocus&&(t.removeClass([n],ne),t.addClass([n],ae),I.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value)}function I(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&t.isNullOrUndefined(this.value)&&(i="");var n=p.call(this,s||this.element,i);null===n||""===n?(e.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):e.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function z(e){var t=q(e);a.call(t);var i=p.call(this,this.element);this.prevValue=i,this.value=i,e.mask&&(l.call(t),r.call(t))}function q(e){t.addClass([e.element],se);var i={element:e.element,mask:e.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:e.promptChar?e.promptChar.length>1?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value?e.value:null,regExpCollec:re,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function W(e){return p.call(_(e),e.element)}function j(e){return c.call(_(e),e.element)}function _(e){var i;return!t.isNullOrUndefined(e)&&e.element.classList.contains(se)&&(i=q(e)),i}var X={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function i(e,i){var n=t.isNullOrUndefined(i)?t.createElement:i,a={container:null,buttons:[],clearButton:null};if(q=e.floatLabelType,W=e.bindClearAction,t.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(a.container=y(e,X.INPUTGROUP,X.INPUTCUSTOMTAG,"span",n),e.element.parentNode.insertBefore(a.container,e.element),t.addClass([e.element],X.INPUT),a.container.appendChild(e.element)):h(e,a,n),s(e),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(P(e.properties.showClearButton,e.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(X.FLOATINPUT)&&t.addClass([a.container],X.INPUTGROUP)),!t.isNullOrUndefined(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var r=0;r<e.buttons.length;r++)a.buttons.push(I(e.buttons[r],a.container,n));return t.isNullOrUndefined(e.element)||"TEXTAREA"!==e.element.tagName||t.addClass([a.container],X.TEXTAREA),z(a.container,e.element),a=u(e,a)}function s(e){n(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var e=m(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=m(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")}),e.element.addEventListener("input",function(){n(q,e.element)})}function n(e,i){var s=i.value;""!==s&&!t.isNullOrUndefined(s)&&i.parentElement?i.parentElement.classList.add("e-valid-input"):"Always"!==e&&i.parentElement&&i.parentElement.classList.remove("e-valid-input")}function a(){var e=m(this).getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(e)||(t.addClass([e],X.LABELTOP),e.classList.contains(X.LABELBOTTOM)&&t.removeClass([e],X.LABELBOTTOM))}function r(){var e=m(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var i=e.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(i)||(i.classList.contains(X.LABELTOP)&&t.removeClass([i],X.LABELTOP),t.addClass([i],X.LABELBOTTOM))}}function l(e){e.addEventListener("focus",a),e.addEventListener("blur",r)}function o(e){e.removeEventListener("focus",a),e.removeEventListener("blur",r)}function h(e,i,s){var n=t.isNullOrUndefined(s)?t.createElement:s;"Auto"===e.floatLabelType&&l(e.element),t.isNullOrUndefined(i.container)?(i.container=y(e,X.FLOATINPUT,X.FLOATCUSTOMTAG,"div",n),e.element.parentNode.insertBefore(i.container,e.element)):(t.isNullOrUndefined(e.customTag)||i.container.classList.add(X.FLOATCUSTOMTAG),i.container.classList.add(X.FLOATINPUT));var a=n("span",{className:X.FLOATLINE}),r=n("label",{className:X.FLOATTEXT});if(t.isNullOrUndefined(e.element.id)||""===e.element.id||(r.id="label_"+e.element.id.replace(/ /g,"_"),t.attributes(e.element,{"aria-labelledby":r.id})),t.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(r.innerText=b(e.element.placeholder),e.element.removeAttribute("placeholder")),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(r.innerText=b(e.properties.placeholder)),r.innerText||i.container.classList.add(X.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var o=i.container.querySelector(".e-input-in-wrap");o.appendChild(e.element),o.appendChild(a),o.appendChild(r)}else i.container.appendChild(e.element),i.container.appendChild(a),i.container.appendChild(r);p(e.element.value,r),"Always"===e.floatLabelType&&(r.classList.contains(X.LABELBOTTOM)&&t.removeClass([r],X.LABELBOTTOM),t.addClass([r],X.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){p(e.element.value,r)}),e.element.addEventListener("blur",function(t){p(e.element.value,r)})),t.isNullOrUndefined(e.element.getAttribute("id"))||r.setAttribute("for",e.element.getAttribute("id"))}function d(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function u(e,i){if(!t.isNullOrUndefined(e.properties))for(var s=0,n=Object.keys(e.properties);s<n.length;s++)switch(n[s]){case"cssClass":C(e.properties.cssClass,[i.container]),d(e.floatLabelType,i.container);break;case"enabled":O(e.properties.enabled,e.element,e.floatLabelType,i.container);break;case"enableRtl":x(e.properties.enableRtl,[i.container]);break;case"placeholder":T(e.properties.placeholder,e.element);break;case"readonly":k(e.properties.readonly,e.element)}return i}function c(e,i){e?t.removeClass([i],X.CLEARICONHIDE):t.addClass([i],X.CLEARICONHIDE)}function p(e,i){e?(t.addClass([i],X.LABELTOP),i.classList.contains(X.LABELBOTTOM)&&t.removeClass([i],X.LABELBOTTOM)):(i.classList.contains(X.LABELTOP)&&t.removeClass([i],X.LABELTOP),t.addClass([i],X.LABELBOTTOM))}function m(e){var i=t.isNullOrUndefined(e.parentNode)?e:e.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function v(e,i,s,n){var a=(t.isNullOrUndefined(n)?t.createElement:n)("span",{className:X.CLEARICON}),r=i.container;return t.isNullOrUndefined(s)?(i.container.classList.contains(X.FLOATINPUT)?i.container.querySelector("."+X.FLOATTEXT):e).insertAdjacentElement("afterend",a):r.appendChild(a),!t.isNullOrUndefined(r)&&r.classList.contains(X.FLOATINPUT)&&t.addClass([r],X.INPUTGROUP),t.addClass([a],X.CLEARICONHIDE),f(e,a,r),a.setAttribute("aria-label","close"),a}function f(e,i,s){(void 0==W||W)&&i.addEventListener("click",function(s){e.classList.contains(X.DISABLE)||e.readOnly||(s.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",t.addClass([i],X.CLEARICONHIDE))}),e.addEventListener("input",function(t){c(e.value,i)}),e.addEventListener("focus",function(t){c(e.value,i)}),e.addEventListener("blur",function(e){setTimeout(function(){t.addClass([i],X.CLEARICONHIDE)},200)})}function g(e,t){if(m(e).classList.contains(X.FLOATINPUT)&&"Auto"===t){var i=m(e).getElementsByClassName("e-float-text")[0];p(e.value,i)}}function y(e,i,s,n,a){var r,l=t.isNullOrUndefined(a)?t.createElement:a;return t.isNullOrUndefined(e.customTag)?r=l(n,{className:i}):(r=l(e.customTag,{className:i})).classList.add(s),r.classList.add("e-control-wrapper"),r}function b(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>',i=s.children[0].placeholder}return i}function E(e,i,s,a){if(i.value=e,t.isNullOrUndefined(s)||"Auto"!==s||g(i,s),!t.isNullOrUndefined(a)&&a){var r=m(i);if(!t.isNullOrUndefined(r)){var l=r.getElementsByClassName(X.CLEARICON)[0];t.isNullOrUndefined(l)||(i.value&&r.classList.contains("e-input-focus")?t.removeClass([l],X.CLEARICONHIDE):t.addClass([l],X.CLEARICONHIDE))}}n(s,i)}function C(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))}function S(e,i){"number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e))}function T(e,i){e=b(e);var s=m(i);s.classList.contains(X.FLOATINPUT)?t.isNullOrUndefined(e)||""===e?(s.classList.add(X.NOFLOATLABEL),s.getElementsByClassName(X.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(X.FLOATTEXT)[0].textContent=e,s.classList.remove(X.NOFLOATLABEL),i.removeAttribute("placeholder")):t.isNullOrUndefined(e)||""===e?(i.removeAttribute("placeholder"),i.removeAttribute("aria-placeholder")):t.attributes(i,{placeholder:e,"aria-placeholder":e})}function k(e,i,s){e?t.attributes(i,{readonly:""}):i.removeAttribute("readonly"),t.isNullOrUndefined(s)||g(i,s)}function x(e,i){e?t.addClass(i,X.RTL):t.removeClass(i,X.RTL)}function O(e,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},r=!t.isNullOrUndefined(n);e?(i.classList.remove(X.DISABLE),L(a,i),r&&t.removeClass([n],X.DISABLE)):(i.classList.add(X.DISABLE),B(a,i),r&&t.addClass([n],X.DISABLE)),t.isNullOrUndefined(s)||g(i,s)}function P(e,i,s,n,a){var r=t.isNullOrUndefined(a)?t.createElement:a;e?s.clearButton=v(i,s,n,r):(t.remove(s.clearButton),s.clearButton=null)}function L(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=m(t);"disabled"===n&&t.classList.remove(X.DISABLE),"disabled"===n&&a.classList.contains(X.INPUTGROUP)&&a.classList.remove(X.DISABLE),"placeholder"===n&&a.classList.contains(X.FLOATINPUT)?a.getElementsByClassName(X.FLOATTEXT)[0].textContent="":t.removeAttribute(n)}}function B(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=m(t);"disabled"===n&&t.classList.add(X.DISABLE),"disabled"===n&&a.classList.contains(X.INPUTGROUP)&&a.classList.add(X.DISABLE),"placeholder"===n&&a.classList.contains(X.FLOATINPUT)?a.getElementsByClassName(X.FLOATTEXT)[0].textContent=e[n]:t.setAttribute(n,e[n])}}function A(e){var i=e.container;if(!t.isNullOrUndefined(i)&&i.classList.contains(X.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),n=i.querySelector("."+X.FLOATTEXT).textContent,a=null!==i.querySelector(".e-clear-icon");t.detach(i.querySelector("."+X.FLOATLINE)),t.detach(i.querySelector("."+X.FLOATTEXT)),t.classList(i,[X.INPUTGROUP],[X.FLOATINPUT]),o(s),t.attributes(s,{placeholder:n}),s.classList.add(X.INPUT),a||"INPUT"!==s.tagName||s.removeAttribute("required")}}function H(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,r=t.closest(e,"."+X.INPUTGROUP);if(q=i,"Never"!==i){var l=r.tagName,o={element:e,floatLabelType:i,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:s}},u=r.querySelector(".e-clear-icon"),c={container:r};e.classList.remove(X.INPUT),h(o,c,a);var p=r.classList.contains("e-float-icon-left");if(t.isNullOrUndefined(u)&&(u=p?r.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):r.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u))p&&(u=r.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u)&&r.classList.remove(X.INPUTGROUP);else{var m=r.querySelector("."+X.FLOATLINE),v=r.querySelector("."+X.FLOATTEXT),f=p?r.querySelector(".e-input-in-wrap"):r;f.insertBefore(e,u),f.insertBefore(m,u),f.insertBefore(v,u)}}d(i,e.parentElement)}function N(e,t){for(var i=0;i<t.length;i++)w(e,t[i].container)}function w(e,i,s){var n=[];n.push(s);var a=t.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(e&&a.length>0)for(r=0;r<a.length;r++)a[r].addEventListener("mousedown",R,!1),a[r].addEventListener("mouseup",F,!1);else if(a.length>0)for(var r=0;r<a.length;r++)a[r].removeEventListener("mousedown",R,this),a[r].removeEventListener("mouseup",F,this)}function U(e,t){e.classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}function R(){for(var e=this,t=this.parentElement;!t.classList.contains("e-input-group");)t=t.parentElement;U(t,e)}function F(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}function V(e,t){var i=t("span",{className:e});return i.classList.add("e-input-group-icon"),i}function M(e,t,i,s,n){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var r=0,l=a;r<l.length;r++)I(d=l[r],i,n);else for(var o=0,h=a;o<h.length;o++){var d=h[o];D(d,i,s,n)}}function D(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,r=V(e,a);i.classList.add("e-float-icon-left");var l=i.querySelector(".e-input-in-wrap");if(t.isNullOrUndefined(l)){l=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(l,s);var o=i.querySelectorAll(s.tagName+" ~ *");l.appendChild(s);for(var h=0;h<o.length;h++)l.appendChild(o[h])}return l.parentNode.insertBefore(r,l),i.classList.contains(X.INPUTGROUP)||i.classList.add(X.INPUTGROUP),w(!0,i,r),r}function I(e,i,s){var n=V(e,t.isNullOrUndefined(s)?t.createElement:s);return i.classList.contains(X.INPUTGROUP)||i.classList.add(X.INPUTGROUP),(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),w(!0,i,n),n}function z(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}var q,W=!0;e.createInput=i,e.bindInitialEvent=s,e.wireFloatingEvents=l,e.wireClearBtnEvents=f,e.setValue=E,e.setCssClass=C,e.setWidth=S,e.setPlaceholder=T,e.setReadonly=k,e.setEnableRtl=x,e.setEnabled=O,e.setClearButton=P,e.removeAttributes=L,e.addAttributes=B,e.removeFloating=A,e.addFloating=H,e.setRipple=N,e.addIcon=M,e.prependSpan=D,e.appendSpan=I,e.validateInputType=z}(e.Input||(e.Input={}));var 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)}}(),Z=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Y="e-input-group-icon",G="e-spin-up",$=new RegExp("^(-)?(\\d*)$"),J=["title","style","class"],Q=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return K(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=t.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s<this.element.attributes.length;s++)"id"!==this.element.attributes[s].nodeName&&(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML);this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}if(!t.isBlazor()||!this.isServerRendered){t.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var n={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new t.L10n("numerictextbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,t.isBlazor()&&this.isServerRendered||(this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value)),this.validateMinMax(),this.validateStep(),null!==this.placeholder||t.isBlazor()&&this.isServerRendered||this.updatePlaceholder()},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(t.isBlazor()&&this.isServerRendered?(this.container=this.element.parentElement,this.inputWrapper={container:this.container},this.hiddenInput=this.container.querySelector('input[type="hidden"]'),this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),this.showSpinButton&&(this.spinDown=this.container.querySelector(".e-spin-down"),this.spinUp=this.container.querySelector("."+G),this.wireSpinBtnEvents()),e.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value)),this.wireEvents(),t.isBlazor()&&this.isServerRendered||(null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value))),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete())},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||e){var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(t.setValue(n,l,{}),!e)}break;case"min":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||e){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(t.setValue(n,o,{}),!e)}break;case"max":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||e){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(t.setValue(n,h,{}),!e)}break;case"step":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||e){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===d||isNaN(d)||this.setProperties(t.setValue(n,d,{}),!e)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==u&&!isNaN(u)||"value"===n)&&this.setProperties(t.setValue(n,u,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==t.getValue("currency",this)&&(t.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:i,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement);this.inputWrapper=s,this.container=s.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&t.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),t.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&t.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,t[a])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];J.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(J.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.spinBtnCreation=function(){this.spinDown=e.Input.appendSpan(Y+" e-spin-down",this.container,this.createElement),t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=e.Input.appendSpan(Y+" "+G,this.container,this.createElement),t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.prototype.validateMinMax=function(){("number"!=typeof this.min||isNaN(this.min))&&this.setProperties({min:-Number.MAX_VALUE},!0),("number"!=typeof this.max||isNaN(this.max))&&this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0)),this.setProperties({min:this.min>this.max?this.max:this.min},!0),t.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(e,t){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,e)),this.raiseChangeEvent(t)},s.prototype.checkErrorClass=function(){this.isValidState?t.removeClass([this.container],"e-error"):t.addClass([this.container],"e-error"),t.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},s.prototype.clear=function(e){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},s.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},s.prototype.setSpinButton=function(){t.isNullOrUndefined(this.spinDown)||t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),t.isNullOrUndefined(this.spinUp)||t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"blur",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"input",this.inputHandler,this),t.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&t.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){t.EventHandler.add(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"blur",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"input",this.inputHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keypress",this.keyPressHandler),t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&t.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){t.EventHandler.remove(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(e){e.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},s.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:e},e&&(this.changeEventArgs.event=e),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),t.merge(i,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",i)}},s.prototype.pasteHandler=function(){var e=this;if(this.enabled&&!this.readonly){var t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)})}},s.prototype.preventHandler=function(){var e=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(e.element.selectionStart>0){var s=e.element.selectionStart,n=e.element.selectionStart-1,a=e.element.value.split(""),r=t.getNumericObject(e.locale),l=t.getValue("decimal",r).charCodeAt(0);" "===e.element.value[n]&&e.element.selectionStart>0&&!i?(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value.trim():0!==n?e.element.value=e.prevVal:0===n&&(e.element.value=e.element.value.trim()),e.element.setSelectionRange(n,n)):isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&45!==e.element.value[e.element.selectionStart-1].charCodeAt(0)?(a.indexOf(e.element.value[e.element.selectionStart-1])!==a.lastIndexOf(e.element.value[e.element.selectionStart-1])&&e.element.value[e.element.selectionStart-1].charCodeAt(0)===l||e.element.value[e.element.selectionStart-1].charCodeAt(0)!==l)&&(e.element.value=e.element.value.substring(0,n)+e.element.value.substring(s,e.element.value.length),e.element.setSelectionRange(n,n),isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&e.element.selectionStart>0&&e.element.value.length&&e.preventHandler()):isNaN(parseFloat(e.element.value[e.element.selectionStart-2]))&&e.element.selectionStart>1&&45!==e.element.value[e.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(e.element.value[e.element.selectionStart-2])!==a.lastIndexOf(e.element.value[e.element.selectionStart-2])&&e.element.value[e.element.selectionStart-2].charCodeAt(0)===l||e.element.value[e.element.selectionStart-2].charCodeAt(0)!==l)&&(e.element.setSelectionRange(n,n),e.nextEle=e.element.value[e.element.selectionStart],e.cursorPosChanged=!0,e.preventHandler()),!0===e.cursorPosChanged&&e.element.value[e.element.selectionStart]===e.nextEle&&isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&(e.element.setSelectionRange(e.element.selectionStart+1,e.element.selectionStart+1),e.cursorPosChanged=!1,e.nextEle=null),""===e.element.value.trim()&&e.element.setSelectionRange(0,0),e.element.selectionStart>0&&45===e.element.value[e.element.selectionStart-1].charCodeAt(0)&&e.element.selectionStart>1&&(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value:e.element.value=e.prevVal,e.element.setSelectionRange(e.element.selectionStart,e.element.selectionStart)),e.prevVal=e.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&t.Browser.isDevice&&this.preventHandler();var e=this.instance.getNumberParser({format:"n"})(this.element.value);if(e=null===e||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null,t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}}},s.prototype.inputHandler=function(e){var i=this;if(this.enabled&&!this.readonly){var s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||s)&&t.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==t.getValue("decimal",t.getNumericObject(this.locale))&&this.element.value!==t.getValue("minusSign",t.getNumericObject(this.locale))){var n=this.instance.getNumberParser({format:"n"})(this.element.value);n=isNaN(n)?null:n,i.localChange({value:n}),this.preventChange=!0}if(this.isVue){var a=this.instance.getNumberParser({format:"n"})(this.element.value),r=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),l={event:e,value:null===a||isNaN(a)?null:a,previousValue:null===r||isNaN(r)?null:r};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action("increment",e);break;case 40:e.preventDefault(),this.action("decrement",e)}},s.prototype.performAction=function(e,t,i){(null===e||isNaN(e))&&(e=0);var s="increment"===i?e+t:e-t;return s=this.correctRounding(e,t,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(e,t,i){var s=new RegExp("[,.](.*)"),n=s.test(e.toString()),a=s.test(t.toString());if(n||a){var r=n?s.exec(e.toString())[0].length:0,l=a?s.exec(t.toString())[0].length:0,o=Math.max(r,l);return e=this.roundValue(i,o)}return i},s.prototype.roundValue=function(e,t){t=t||0;var i=Math.pow(10,t);return e*=i,e=Math.round(e)/i},s.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},s.prototype.updateCurrency=function(e,i){t.setValue(e,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(e){if(e||0===e){var t=this.getNumberOfDecimals(e);this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber(),i=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),t.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},s.prototype.setElementValue=function(t,i){e.Input.setValue(t,i||this.element,this.floatLabelType,this.showClearButton)},s.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},s.prototype.getNumberOfDecimals=function(e){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=e.toString();if(s.test(n)){var a=s.exec(n);t.isNullOrUndefined(a)||(n=e.toFixed(Math.min(parseInt(a[1],10),20)))}var r=n.split(".")[1];return i=r&&r.length?r.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var e=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},s.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},s.prototype.roundNumber=function(e,t){var i=e,s=t||0,n=i.toString().split("e"),a=(i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)))).toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},s.prototype.cancelEvent=function(e){return e.preventDefault(),!1},s.prototype.keyPressHandler=function(e){if(!this.enabled||this.readonly)return!0;if(!t.Browser.isDevice&&"11.0"===t.Browser.info.version&&13===e.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,e),!0}if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var s=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+s+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},s.prototype.numericRegex=function(){var e=t.getNumericObject(this.locale),i=t.getValue("decimal",e),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?$:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(e){e.preventDefault();var t,i=e;i.wheelDelta?t=i.wheelDelta/120:i.detail&&(t=-i.detail/3),t>0?this.action("increment",e):t<0&&this.action("decrement",e),this.cancelEvent(e)},s.prototype.focusHandler=function(e){var i=this;if(this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,t.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(t.Browser.isDevice||"11.0"!==t.Browser.info.version){var n=t.Browser.isDevice&&t.Browser.isIos?600:0;setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}t.Browser.isDevice||t.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(e){var i=this;if(this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(e.preventDefault(),t.Browser.isDevice){var s=this.element.value;this.element.focus(),this.isPrevFocused=!1;var n=this.element;setTimeout(function(){i.setElementValue(s,n)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var a=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(a),t.Browser.isDevice||t.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(t.closest(this.element,"form")){var r=this.element.nextElementSibling,l=document.createEvent("FocusEvent");l.initEvent("focusout",!1,!0),r.dispatchEvent(l)}}},s.prototype.mouseDownOnSpinner=function(e){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){this.getElementData(e);var s=e.currentTarget,n=s.classList.contains(G)?"increment":"decrement";t.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,e)},150),t.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(e){var t;if("touchmove"===e.type){var i=e.touches;t=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else t=document.elementFromPoint(e.clientX,e.clientY);t.classList.contains(Y)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(e){if(this.isPrevFocused&&(this.element.focus(),t.Browser.isDevice||(this.isPrevFocused=!1)),t.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var i=e.currentTarget,s=i.classList.contains(G)?"increment":"decrement";if(t.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,e),this.isCalled=!1,t.EventHandler.remove(document,"mouseup",this.mouseUpClick),t.closest(this.element,"form")){var n=this.element.nextElementSibling,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){e.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},s.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,t.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),t.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"increment")),this.raiseChangeEvent()},s.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"decrement")),this.raiseChangeEvent()},s.prototype.destroy=function(){if(this.unwireEvents(),!t.isBlazor()||!this.isServerRendered){t.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),t.detach(this.spinUp),t.detach(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),t.detach(this.container),i.prototype.destroy.call(this)}},s.prototype.getText=function(){return this.element.value},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.container],["e-input-focus"]))},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var r=a[n];switch(r){case"width":this.setElementWidth(i.width);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":e.Input.setEnabled(i.enabled,this.element);break;case"enableRtl":e.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":e.Input.setReadonly(i.readonly,this.element),this.readonly?t.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),e.Input.validateInputType(this.container,this.element);break;case"placeholder":e.Input.setPlaceholder(i.placeholder,this.element);break;case"step":this.step=i.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(i);break;case"showClearButton":this.updateClearButton(i);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(i.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":t.setValue(r,t.getValue(r,i),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=i.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),e.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var l=t.getValue(r,i);this.setProperties({currencyCode:l},!0),this.updateCurrency(r,l);break;case"currencyCode":var o=t.getValue(r,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":t.setValue(r,t.getValue(r,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(i){t.isBlazor()?this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)):(e.Input.setClearButton(i.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent())},s.prototype.updateSpinButton=function(e){t.isBlazor()?this.showSpinButton&&(this.spinDown=this.container.querySelector(".e-spin-down"),this.spinUp=this.container.querySelector("."+G),this.wireSpinBtnEvents()):e.showSpinButton?this.spinBtnCreation():(t.detach(this.spinUp),t.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},Z([t.Property("")],s.prototype,"cssClass",void 0),Z([t.Property(null)],s.prototype,"value",void 0),Z([t.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),Z([t.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),Z([t.Property(1)],s.prototype,"step",void 0),Z([t.Property(null)],s.prototype,"width",void 0),Z([t.Property(null)],s.prototype,"placeholder",void 0),Z([t.Property({})],s.prototype,"htmlAttributes",void 0),Z([t.Property(!0)],s.prototype,"showSpinButton",void 0),Z([t.Property(!1)],s.prototype,"readonly",void 0),Z([t.Property(!0)],s.prototype,"enabled",void 0),Z([t.Property(!1)],s.prototype,"showClearButton",void 0),Z([t.Property(!1)],s.prototype,"enablePersistence",void 0),Z([t.Property("n2")],s.prototype,"format",void 0),Z([t.Property(null)],s.prototype,"decimals",void 0),Z([t.Property(null)],s.prototype,"currency",void 0),Z([t.Property(null)],s.prototype,"currencyCode",void 0),Z([t.Property(!0)],s.prototype,"strictMode",void 0),Z([t.Property(!1)],s.prototype,"validateDecimalOnType",void 0),Z([t.Property("Never")],s.prototype,"floatLabelType",void 0),Z([t.Event()],s.prototype,"created",void 0),Z([t.Event()],s.prototype,"destroyed",void 0),Z([t.Event()],s.prototype,"change",void 0),Z([t.Event()],s.prototype,"focus",void 0),Z([t.Event()],s.prototype,"blur",void 0),s=Z([t.NotifyPropertyChanges],s)}(t.Component),ee="e-error",te="e-input-group",ie="e-float-input",se="e-utility-mask",ne="e-label-top",ae="e-label-bottom",re={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"},le=function(){function e(){}return e}(),oe=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)}}(),he=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},de=["title","style","class"],ue=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return oe(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=re,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=t.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.render=function(){var e=this;if("input"===this.element.tagName.toLowerCase()){var i=t.isBlazor()&&this.isServerRendered;"Never"===this.floatLabelType&&t.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,i&&!0===t.Browser.isIE?setTimeout(function(){e.resetMaskedTextBox()}):this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,t.Browser.isDevice||"11.0"!==t.Browser.info.version&&"edge"!==t.Browser.info.name||this.element.blur(),t.Browser.isDevice&&t.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),this.renderComplete()}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];de.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(de.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.inputObj.container.setAttribute(s,a)}else this.inputObj.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),n.call(this),a.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value);var e=p.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||l.call(this),r.call(this)},s.prototype.setMaskPlaceholder=function(t,i){(i||this.placeholder)&&(e.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&I.call(this,""))},s.prototype.setWidth=function(e){if(!t.isNullOrUndefined(e))if("number"==typeof e)this.inputObj.container.style.width=t.formatUnit(e),this.element.style.width=t.formatUnit(e);else if("string"==typeof e){var i=e.match(/px|%|em/)?e:t.formatUnit(e);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"disabled":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"value":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"readonly":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:i,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"value":D.call(this,this.value),this.placeholder&&this.setMaskPlaceholder(!1,!1);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width);break;case"cssClass":this.updateCssClass(t.cssClass,i.cssClass);break;case"enabled":e.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":e.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":e.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":e.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),o.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,e.Input.removeFloating(this.inputObj),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var a=this.value;this.mask=t.mask,this.updateValue(a);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var r=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(r=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],I.call(this,r)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(e){this.resetMaskedTextBox(),D.call(this,e)},s.prototype.getMaskedValue=function(){return c.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.inputObj.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.inputObj.container],["e-input-focus"]))},s.prototype.destroy=function(){l.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.inputObj.container.insertAdjacentElement("afterend",this.element),t.detach(this.inputObj.container),i.prototype.destroy.call(this)},he([t.Property(null)],s.prototype,"cssClass",void 0),he([t.Property(null)],s.prototype,"width",void 0),he([t.Property(null)],s.prototype,"placeholder",void 0),he([t.Property("Never")],s.prototype,"floatLabelType",void 0),he([t.Property({})],s.prototype,"htmlAttributes",void 0),he([t.Property(!0)],s.prototype,"enabled",void 0),he([t.Property(!1)],s.prototype,"readonly",void 0),he([t.Property(!1)],s.prototype,"showClearButton",void 0),he([t.Property(!1)],s.prototype,"enablePersistence",void 0),he([t.Property(null)],s.prototype,"mask",void 0),he([t.Property("_")],s.prototype,"promptChar",void 0),he([t.Property(null)],s.prototype,"value",void 0),he([t.Property(null)],s.prototype,"customCharacters",void 0),he([t.Event()],s.prototype,"created",void 0),he([t.Event()],s.prototype,"destroyed",void 0),he([t.Event()],s.prototype,"change",void 0),he([t.Event()],s.prototype,"focus",void 0),he([t.Event()],s.prototype,"blur",void 0),s=he([t.NotifyPropertyChanges],s)}(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,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("None")],i.prototype,"placement",void 0),pe([t.Property(10)],i.prototype,"largeStep",void 0),pe([t.Property(1)],i.prototype,"smallStep",void 0),pe([t.Property(!1)],i.prototype,"showSmallTicks",void 0),pe([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property(null)],i.prototype,"color",void 0),pe([t.Property(null)],i.prototype,"start",void 0),pe([t.Property(null)],i.prototype,"end",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property(!1)],i.prototype,"enabled",void 0),pe([t.Property(null)],i.prototype,"minStart",void 0),pe([t.Property(null)],i.prototype,"minEnd",void 0),pe([t.Property(null)],i.prototype,"maxStart",void 0),pe([t.Property(null)],i.prototype,"maxEnd",void 0),pe([t.Property(!1)],i.prototype,"startHandleFixed",void 0),pe([t.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("")],i.prototype,"cssClass",void 0),pe([t.Property("Before")],i.prototype,"placement",void 0),pe([t.Property("Focus")],i.prototype,"showOn",void 0),pe([t.Property(!1)],i.prototype,"isVisible",void 0),pe([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ye={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},be=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.horDir="left",s.verDir="bottom",s.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},s.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return ce(s,e),s.prototype.preRender=function(){var e={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new t.L10n("slider",e,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var e=t.closest(this.element,"form");e?(this.isForm=!0,t.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!t.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?t.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(t.formatUnit(this.min))):this.formResetValue=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))],this.formElement=e):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=t.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=t.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(e,t){var i=null,s=null;if(e||0===e){i=this.formatNumber(e);var n=this.numberOfDecimals(e);s=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.numberOfDecimals=function(e){var t=e.toString().split(".")[1];return t&&t.length?t.length:0},s.prototype.makeRoundNumber=function(e,t){var i=t||0;return Number(e.toFixed(i))},s.prototype.fractionalToInteger=function(e){e=0===this.numberOfDecimals(e)?Number(e).toFixed(this.noOfDecimals):e;for(var t=1,i=0;i<this.noOfDecimals;i++)t*=10;return e=Number((e*t).toFixed(0))},s.prototype.render=function(){t.isBlazor()&&this.isServerRendered||this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete()},s.prototype.initialize=function(){t.addClass([this.element],ye.root),this.setCSSClass()},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.sliderContainer.style.width=t.formatUnit(e):"string"==typeof e&&(this.sliderContainer.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setCSSClass=function(e){e&&t.removeClass([this.element],e.split(" ")),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(t.removeClass([this.sliderContainer],[ye.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(ye.sliderDisabled),this.wireEvents()):(t.addClass([this.sliderContainer],[ye.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(ye.sliderDisabled),this.unwireEvents())},s.prototype.getTheme=function(e){return window.getComputedStyle(e,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){t.isBlazor()&&this.isServerRendered?(this.sliderContainer=this.element.parentElement,this.sliderTrack=this.element.querySelector(".e-slider-track"),this.hiddenInput=this.element.parentElement.querySelector(".e-slider-input")):(this.sliderContainer=this.createElement("div",{className:ye.sliderContainer+" "+ye.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:ye.sliderTrack}),this.element.appendChild(this.sliderTrack)),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),t.isBlazor()&&this.isServerRendered||(this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:t.isNullOrUndefined(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:ye.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput)),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=t.isNullOrUndefined(this.value)?parseFloat(t.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(t.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(t.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(t.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,t.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),t.isBlazor()&&this.isServerRendered||(this.enabled?t.removeClass([this.sliderContainer],[ye.sliderDisabled]):t.addClass([this.sliderContainer],[ye.sliderDisabled]),this.readonly?t.addClass([this.sliderContainer],[ye.readonly]):t.removeClass([this.sliderContainer],[ye.readonly]))},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=this.isMaterial&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:ye.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(ye.dragHorizontal):this.rangeBar.classList.add(ye.dragVertical)))},s.prototype.createLimitBar=function(){if(t.isBlazor()&&this.isServerRendered)this.limitBarFirst=this.element.querySelectorAll(".e-limits")[0],"Range"===this.type&&(this.limitBarSecond=this.element.querySelectorAll(".e-limit-second")[0]);else{var e="Range"!==this.type?ye.limitBarDefault:ye.limitBarFirst;e+=" "+ye.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:e}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:ye.limitBarSecond+" "+ye.limits}}),this.element.appendChild(this.limitBarSecond))}},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(ye.verticalSlider),this.sliderContainer.classList.add(ye.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(ye.horizontalSlider),this.sliderContainer.classList.add(ye.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(e){var i=this,s=this.min,n=this.max;!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?t.attributes(e,{"aria-valuemin":s.toString(),"aria-valuemax":n.toString()}):(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[s.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[s.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,s){var n=0===s?i.firstHandle:i.secondHandle;n&&t.attributes(n,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})},s.prototype.createSecondHandle=function(){t.isBlazor()&&this.isServerRendered?this.secondHandle=this.element.querySelector(".e-handle-second"):(this.secondHandle=this.createElement("div",{attrs:{class:ye.sliderHandle,role:"slider",tabIndex:"0"}}),this.secondHandle.classList.add(ye.sliderSecondHandle),this.element.appendChild(this.secondHandle))},s.prototype.createFirstHandle=function(){t.isBlazor()&&this.isServerRendered?this.firstHandle=this.element.querySelector(".e-handle-first"):(this.firstHandle=this.createElement("div",{attrs:{class:ye.sliderHandle,role:"slider",tabIndex:"0"}}),this.firstHandle.classList.add(ye.sliderFirstHandle),this.element.appendChild(this.firstHandle)),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:ye.sliderHandle+" "+ye.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(e){e?(t.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(e){e?(t.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](ye.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](ye.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](ye.sliderTooltipStart)))},s.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),this.getHandle().style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),this.isMaterial&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},s.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(ye.sliderHandleFocused)&&this.firstHandle.classList.remove(ye.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(ye.sliderHandleFocused)&&this.secondHandle.classList.remove(ye.sliderHandleFocused)},s.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),e.currentTarget===this.firstHandle?this.firstHandle.classList.add(ye.sliderHandleFocused):this.secondHandle.classList.add(ye.sliderHandleFocused),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(ye.sliderHandleFocused)||e.currentTarget.classList.contains(ye.sliderTabHandle)||this.closeTooltip()},s.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){if(!t.isBlazor()||!this.isServerRendered){this.enableRtl&&"Vertical"!==this.orientation?t.addClass([this.sliderContainer],ye.rtl):t.removeClass([this.sliderContainer],ye.rtl);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(t.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&t.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}))}this.setBarColor()},s.prototype.tooltipValue=function(){var e,i=this,s={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,t.isBlazor()&&this.isServerRendered?s.text=this.formatContent(this.tooltipFormatInfo,!1):(this.setTooltipContent(),s.text=e=this.tooltipObj.content),this.trigger("tooltipChange",s,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.tooltipObj.content=t.text,i.setAriaAttrValue(i.firstHandle),"Range"===i.type&&i.setAriaAttrValue(i.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var e;e=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=e},s.prototype.formatContent=function(e,i){var s="",n=this.handleVal1,a=this.handleVal2;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(n=this.customValues[this.handleVal1],a=this.customValues[this.handleVal2]),i?("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,e).elementVal+" - "+this.formatString(n,e).elementVal:t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,e).elementVal+" - "+this.formatString(a,e).elementVal:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(e.format)?a.toString()+" - "+n.toString():this.formatString(a,e).formatString+" - "+this.formatString(n,e).formatString:t.isNullOrUndefined(e.format)?n.toString()+" - "+a.toString():this.formatString(n,e).formatString+" - "+this.formatString(a,e).formatString:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(e.format)?n.toString():this.formatString(n,e).formatString),s)},s.prototype.addTooltipClass=function(e){if(this.isMaterialTooltip){var t=e.toString().length;if(this.tooltipElement){i=t>4?{oldCss:ye.sliderMaterialDefault,newCss:ye.sliderMaterialRange}:{oldCss:ye.sliderMaterialRange,newCss:ye.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=t>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=t>4?ye.sliderMaterialRange:ye.sliderMaterialDefault;this.tooltipObj.cssClass=ye.sliderTooltip+" "+i}}},s.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},s.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&t.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(ye.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!this.isMaterialTooltip){var t=this.isBootstrap4?3:6;switch(e){case"TopCenter":this.tooltipObj.setProperties({offsetY:-t},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:t},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-t},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:t},!1)}}},s.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?t.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):t.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=ye.horizontalTooltipBefore;break;case"BottomCenter":t=ye.horizontalTooltipAfter;break;case"LeftCenter":t=ye.verticalTooltipBefore;break;case"RightCenter":t=ye.verticalTooltipAfter}return t},s.prototype.getTooltipTransformProperties=function(e){var t;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;t="Horizontal"===this.orientation?e===ye.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:e===ye.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return t},s.prototype.openMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var t=this.tooltipElement.firstElementChild;t.classList.remove(ye.materialTooltipHide),t.classList.add(ye.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(ye.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",t.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement.style.transition=e.transition.handle},2500):setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.closeMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){var t=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(ye.materialTooltipShow),t.classList.add(ye.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(ye.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.checkTooltipPosition=function(e){var t=this.tooltipPositionCalculation(e.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===e.collidedPosition&&e.element.classList.contains(t)||(this.isMaterialTooltip&&(void 0!==t&&(e.element.classList.remove(this.previousTooltipClass),e.element.classList.add(t),this.previousTooltipClass=t),e.element.style.transform&&e.element.classList.contains(ye.materialTooltipOpen)&&e.element.firstElementChild.innerText.length<=4&&(e.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=e.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)"},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4||this.isTailwind,cssClass:ye.sliderTooltip,height:this.isMaterial?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},s.prototype.initializeTooltipProps=function(){var e=this.isMaterialTooltip?"Always":"Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:e}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(e){t.isNullOrUndefined(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(ye.materialSlider),t.isBlazor()||this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},s.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},s.prototype.setButtons=function(){t.isBlazor()&&this.isServerRendered?(this.firstBtn=this.element.parentElement.querySelector(".e-slider-button.e-first-button"),this.secondBtn=this.element.parentElement.querySelector(".e-slider-button.e-second-button")):(this.firstBtn=this.createElement("div",{className:ye.sliderButton+" "+ye.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:ye.sliderButtonIcon})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:ye.sliderButton+" "+ye.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:ye.sliderButtonIcon})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(ye.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle())},s.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(ye.firstButton)||e.target.classList.contains(ye.firstButton)?t=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(ye.secondButton)||e.target.classList.contains(ye.secondButton))&&(t=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),t>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(e){var i=4;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(e>4&&(i=3),e>7&&(i=2),e>14&&(i=1),e>28&&(i=0)),i},s.prototype.renderScale=function(){var e=0,i="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),t.isBlazor()&&this.isServerRendered?this.ul=this.element.querySelector("ul"):this.ul=this.createElement("ul",{className:ye.scale+" e-"+i+"-scale "+ye.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",t.Browser.isAndroid&&"h"===i&&this.ul.classList.add(ye.sliderTickPosition);var s=this.ticks.smallStep;this.ticks.showSmallTicks?s<=0&&(s=parseFloat(t.formatUnit(this.step))):s=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));var n=this.fractionalToInteger(this.min),a=this.fractionalToInteger(this.max),r=this.fractionalToInteger(s),l=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,o=this.customTickCounter(l),h=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?l*o+l:Math.abs((a-n)/r);t.isBlazor()&&this.isServerRendered||this.element.appendChild(this.ul);var d,u=parseFloat(this.min.toString());"v"===i&&(u=parseFloat(this.max.toString()));var c,p=0,m=100/h;m===1/0&&(m=5);for(var v=0,f=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,g=0;v<=h;v++){if(d=this.createElement("li",{attrs:{class:ye.tick,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(c=v%(o+1)==0)&&("h"===i?(u=this.customValues[g],g++):(u=this.customValues[f],f--),d.setAttribute("title",u.toString()));else if(d.setAttribute("title",u.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))c="h"===i?(u-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(u-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var y=this.fractionalToInteger(this.ticks.largeStep),b=this.fractionalToInteger(u);c="h"===i?(b-n)%y==0:Math.abs(b-parseFloat(a.toString()))%y==0}c&&d.classList.add(ye.large),"h"===i?d.style.width=m+"%":d.style.height=m+"%";var E=c?"Both"===this.ticks.placement?2:1:0;if(c){for(var C=0;C<E;C++)this.createTick(d,u,m);t.isBlazor()&&this.isServerRendered&&t.isNullOrUndefined(this.customValues)&&(this.updateTicksValues(u,this.ul.children[e]),e++)}else t.isNullOrUndefined(this.customValues)&&(this.formatTicksValue(d,u),t.isBlazor()&&this.isServerRendered&&t.isNullOrUndefined(this.customValues)&&(this.updateTicksValues(u,this.ul.children[e]),e++));t.isBlazor()&&this.isServerRendered||this.ul.appendChild(d),this.tickElementCollection.push(d);var S=void 0;t.isNullOrUndefined(this.customValues)&&(S=this.numberOfDecimals(s)>this.numberOfDecimals(u)?this.numberOfDecimals(s):this.numberOfDecimals(u),u="h"===i?this.makeRoundNumber(u+s,S):this.makeRoundNumber(u-s,S),p=this.makeRoundNumber(p+s,S))}this.ticksAlignment(i,m)},s.prototype.updateTicksValues=function(e,t){if(t.childElementCount>0)for(var i=0;i<t.childElementCount;i++)this.blazortTicksValue(t,e,t.children[i]);else this.blazortTicksValue(t,e,null)},s.prototype.blazortTicksValue=function(e,i,s){var n=this,a=this.formatNumber(i),r={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?a:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",r,function(i){e.setAttribute("title",i.text.toString()),s&&(n.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.ticksAlignment=function(e,t,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(ye.sliderFirstTick),this.lastChild.classList.add(ye.sliderLastTick),this.sliderContainer.classList.add(ye.scale+"-"+this.ticks.placement.toLowerCase()),"h"===e?(this.firstChild.style.width=t/2+"%",this.lastChild.style.width=t/2+"%"):(this.firstChild.style.height=t/2+"%",this.lastChild.style.height=t/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(e,i,s){var n=this.createElement("span",{className:ye.tickValue+" "+ye.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});e.appendChild(n),t.isNullOrUndefined(this.customValues)?this.formatTicksValue(e,i,n,s):this.enableHtmlSanitizer?n.innerHTML=t.SanitizeHtmlHelper.sanitize(i.toString()):n.innerHTML=i.toString()},s.prototype.formatTicksValue=function(e,i,s,n){var a=this,r=this.formatNumber(i),l={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?r:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",l,function(i){if(e.setAttribute("title",i.text.toString()),s&&(a.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString()),!t.isNullOrUndefined(a.renderingTicks)&&t.isBlazor()){var r="Horizontal"===a.orientation?"h":"v";a.ticksAlignment(r,n,!1)}})},s.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(ye.sliderSmallSize):this.sliderContainer.classList.remove(ye.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(ye.sliderSmallSize):this.sliderContainer.classList.remove(ye.sliderSmallSize)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var e,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(e=this.firstChild.children[0].getBoundingClientRect());var r,l=[this.sliderContainer.querySelectorAll("."+ye.tick+"."+ye.large+" ."+ye.tickValue)];r="Both"===this.ticks.placement?[].slice.call(l[0],2):[].slice.call(l[0],1);for(var o="Vertical"===this.orientation?2*s.height:2*s.width,h=0;h<this.firstChild.children.length;h++)"Vertical"===this.orientation?t.isBlazor()&&this.isServerRendered||(this.firstChild.children[h].style.top=-e.height/2+"px"):this.enableRtl?this.firstChild.children[h].style.left=(o-this.firstChild.children[h].getBoundingClientRect().width)/2+"px":this.firstChild.children[h].style.left=-e.width/2+"px";for(h=0;h<r.length;h++)i=r[h].getBoundingClientRect(),"Vertical"===this.orientation?t.isBlazor()&&this.isServerRendered||t.setStyleAttribute(r[h],{top:(o-i.height)/2+"px"}):t.setStyleAttribute(r[h],{left:(o-i.width)/2+"px"});if(this.enableRtl&&this.lastChild.children.length&&0!==a&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement&&(t.isBlazor()||(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"))),0===a&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(ye.sliderLastTick),this.firstChild.style.right=this.firstHandle.style.right,t.isBlazor()||(this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px"))):(this.firstChild.classList.remove(ye.sliderLastTick),t.isBlazor()||(this.firstChild.style.left=this.firstHandle.style.left))),t.isBlazor()&&this.isServerRendered||"Vertical"===this.orientation&&this.firstChild.classList.remove(ye.sliderLastTick)),t.isBlazor()&&this.isServerRendered){var d=void 0;null!=this.firstChild&&(d="Horizontal"===this.orientation?{firstTickPostion:this.firstChild.children[0].style.left}:{firstTickPostion:-e.height/2+"px"}),null!=r[0]&&(d="Horizontal"===this.orientation?{otherTicksPosition:r[0].style.left}:{otherTicksPosition:(o-i.height)/2+"px"}),null!=this.firstChild&&null!=r[0]&&(d="Horizontal"===this.orientation?{firstTickPostion:this.firstChild.children[0].style.left,otherTicksPosition:r[0].style.left}:{firstTickPostion:-e.height/2+"px",otherTicksPosition:(o-i.height)/2+"px"}),this.interopAdaptor.invokeMethodAsync("SliderTicksData",d)}},s.prototype.setAriaAttrValue=function(e){var i,s=!t.isNullOrUndefined(this.ticks)&&!t.isNullOrUndefined(this.ticks.format),n=s?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),a=s?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);i=2===(n=this.customAriaText?this.customAriaText:n).split(" - ").length?n.split(" - "):[n,n],this.setAriaAttributes(e),"Range"!==this.type?t.attributes(e,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]})},s.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},s.prototype.getLimitCorrectedValues=function(e){return e="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(e,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(e){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===e.keyCode||37===e.keyCode||e.currentTarget.classList.contains(ye.firstButton)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===e.keyCode||39===e.keyCode||e.currentTarget.classList.contains(ye.secondButton)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===e.keyCode||e.currentTarget.classList.contains(ye.firstButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===e.keyCode||e.currentTarget.classList.contains(ye.secondButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===e.keyCode?i=parseFloat(this.min.toString()):35===e.keyCode&&(i=parseFloat(this.max.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),e.currentTarget.classList.contains(ye.firstButton)&&t.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),e.currentTarget.classList.contains(ye.secondButton)&&t.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(e){this.isMaterialTooltip?this.tooltipElement.classList.contains(ye.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(e):this.openTooltip(e)},s.prototype.buttonUp=function(e){e.currentTarget.classList.contains(ye.firstButton)&&t.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),e.currentTarget.classList.contains(ye.secondButton)&&t.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(e){return e=this.checkHandleValue(e),e=this.checkHandlePosition(e)},s.prototype.setLimitBarPositions=function(e,t,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.left=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.bottom=e+"px",this.limitBarFirst.style.height=t-e+"px"),"Range"===this.type&&("Horizontal"===this.orientation?this.enableRtl?(this.limitBarSecond.style.right=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=i+"px",this.limitBarSecond.style.height=s-i+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e);var t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t),this.setLimitBarPositions(e,t)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},s.prototype.getLimitValueAndPosition=function(e,i,s,n){return t.isNullOrUndefined(i)&&(i=this.min,t.isNullOrUndefined(e)&&n&&(e=i)),t.isNullOrUndefined(s)&&(s=this.max,t.isNullOrUndefined(e)&&n&&(e=s)),e<i&&(e=i),e>s&&(e=s),[e,this.checkHandlePosition(e)]},s.prototype.setValue=function(){if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=t.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,t.isNullOrUndefined(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1}this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},s.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"===this.type?1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+"")},s.prototype.setHandlePosition=function(e){var i,s=this,n=1===this.activeHandle?this.handlePos1:this.handlePos2;i=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),i.forEach(function(e){"Horizontal"===s.orientation?s.enableRtl?e.style.right=n+"px":e.style.left=n+"px":e.style.bottom=n+"px",t.isBlazor()&&s.isServerRendered&&e.style.removeProperty("visibility")}),this.changeEvent("change",e)},s.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},s.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},s.prototype.changeEvent=function(e,t){var i="change"===e?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.firstHandle);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[1])&&(this.initialTooltip=!1,this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(e,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(t.isBlazor()&&this.isServerRendered||this.tooltipValue(),s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:this.tooltipObj.content,isInteracted:!t.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:t.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!t.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},s.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[e[1],e[0]]:this.value=[e[0],e[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;var t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(e){var i;return e=100*(e-parseFloat(t.formatUnit(this.min)))/(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),parseFloat(t.formatUnit(this.max))===parseFloat(t.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(e){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(t.formatUnit(this.max));var i=this.tempStartEnd();return e<i.start?e=i.start:e>i.end&&(e=i.end),e},s.prototype.reposition=function(){var e=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(t.isBlazor()||(this.removeElement(this.ul),this.ul=void 0),this.renderScale(),t.isBlazor()&&this.tickValuePosition()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){e.firstHandle.style.transition=e.scaleTransform,"Range"===e.type&&(e.secondHandle.style.transition=e.scaleTransform)}),t.isBlazor()&&this.isServerRendered||this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(e){var t=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(e),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(t=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(e),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&this.handlePos2<this.handlePos1&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(t=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==t&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},s.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},s.prototype.xyToPosition=function(e){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=t/i}else{var s=e.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},s.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var i=parseFloat(t.formatUnit(this.step))/((parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/100),s=e%Math.abs(i);return 0!==s&&(i/2>s?e-=s:e+=Math.abs(i)-s),e},s.prototype.add=function(e,t,i){var s=Math.pow(10,3);return i?(Math.round(e*s)+Math.round(t*s))/s:(Math.round(e*s)-Math.round(t*s))/s},s.prototype.positionToValue=function(e){var i,s=parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));return i="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*s:e/this.element.getBoundingClientRect().height*s,this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(e){e.preventDefault();var t;"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?t={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var i=this.xyToPosition(t),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-i<i-this.handlePos1)this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(ye.sliderActiveHandle),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle.focus();else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(ye.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(ye.materialTooltipActive);var a=this.element.querySelector("."+ye.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(ye.sliderTabHandle);var r=1===this.activeHandle?this.firstHandle:this.secondHandle;if(e.target===r)return!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.sliderBarUp(e),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var l=this.isMaterial&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=l.handle,"Default"!==this.type&&(this.rangeBar.style.transition=l.rangeBar),this.setHandlePosition(e),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",e),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(e,t,i){1===i?(this.handleVal1=t,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=t,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(e){var t,i;"touchmove"!==e.type&&e.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===e.type?(n=(t=[e.clientX,e.clientY])[0],a=t[1]):(n=(i=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+this.secondPartRemain},this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1),s=this.enableRtl?{x:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-this.firstPartRemain},this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2),this.limits.enabled){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2)}this.handleVal2===this.max&&this.handleValueAdjust(this.handleVal2,this.max,2),this.handleVal1===this.min&&this.handleValueAdjust(this.handleVal1,this.min,1)}this.activeHandle=1,this.setHandlePosition(e),this.activeHandle=2,this.setHandlePosition(e),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(e){this.changeEvent("changed",e),this.handleFocusOut(),this.firstHandle.classList.remove(ye.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(ye.sliderActiveHandle)),this.closeTooltip(),this.isMaterial&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(ye.materialTooltipActive)),t.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),t.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(e){"touchmove"!==e.type&&e.preventDefault();var t;t="mousemove"===e.type?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};var i=this.xyToPosition(t),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(ye.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle)this.firstHandle.classList.add(ye.sliderActiveHandle),this.limits.enabled&&this.limits.startHandleFixed||(i>this.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i!==this.preHandlePos1&&(this.limits.enabled&&(s=(a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=a[1]),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1));else if(2===this.activeHandle&&(this.secondHandle.classList.add(ye.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||(i<this.handlePos1&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(e),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(e){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(e)),this.changeEvent("changed",e),this.closeTooltip(),t.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),t.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(e){if("Range"===this.type){if(e===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(e===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),e&&(this.tooltipObj.refresh(e),this.tooltipTarget=e))},s.prototype.openTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(e),this.tooltipTarget=e)},s.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},s.prototype.keyDown=function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:e.preventDefault(),this.buttonClick(e)}},s.prototype.wireButtonEvt=function(e){e?(t.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(t.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(e){var i,s;if(e.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&e.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===e.type?(n=(i=[e.clientX,e.clientY])[0],a=i[1]):"touchstart"===e.type&&(n=(s=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=s[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var r=this.element.querySelector("."+ye.sliderTabHandle);r&&r.classList.remove(ye.sliderTabHandle),t.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(e){if(this.isDragComplete)return void(this.isDragComplete=!1);e.preventDefault(),this.focusSliderElement(),this.sliderBarClick(e)},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(t.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&t.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),t.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),t.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),t.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&t.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),t.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),t.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),t.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),t.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(e){if(9===e.keyCode&&e.target.classList.contains(ye.sliderHandle)&&(this.focusSliderElement(),!e.target.classList.contains(ye.sliderTabHandle))){this.element.querySelector("."+ye.sliderTabHandle)&&this.element.querySelector("."+ye.sliderTabHandle).classList.remove(ye.sliderTabHandle),e.target.classList.add(ye.sliderTabHandle);var t=e.target.parentElement;t===this.element&&(t.querySelector("."+ye.sliderTrack).classList.add(ye.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||t.querySelector("."+ye.rangeBar).classList.add(ye.sliderTabRange)),"Range"===this.type&&(e.target.previousSibling.classList.contains(ye.sliderHandle)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",e)},s.prototype.hover=function(e){t.isNullOrUndefined(e)||("mouseover"===e.type||"touchmove"===e.type||"mousemove"===e.type||"pointermove"===e.type||"touchstart"===e.type?this.sliderContainer.classList.add(ye.sliderHover):this.sliderContainer.classList.remove(ye.sliderHover))},s.prototype.sliderFocusOut=function(e){e.relatedTarget!==this.secondHandle&&e.relatedTarget!==this.firstHandle&&e.relatedTarget!==this.element&&e.relatedTarget!==this.firstBtn&&e.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.element.querySelector("."+ye.sliderTabHandle)&&this.element.querySelector("."+ye.sliderTabHandle).classList.remove(ye.sliderTabHandle),this.element.querySelector("."+ye.sliderTabTrack)&&(this.element.querySelector("."+ye.sliderTabTrack).classList.remove(ye.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+ye.sliderTabRange)||this.element.querySelector("."+ye.sliderTabRange).classList.remove(ye.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(e){e.parentNode&&e.parentNode.removeChild(e)},s.prototype.changeSliderType=function(e,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(ye.materialSlider),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==e&&("Range"===e&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!t.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===e||"Default"===e?t.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):t.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),(t.isBlazor()||this.isServerRendered)&&"tooltip"===i||this.updateConfig()},s.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var e=this.enableRtl&&"Vertical"!==this.orientation;t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},s.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},s.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&(t.isBlazor()||this.refreshTooltip(this.tooltipTarget)),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},s.prototype.limitsPropertyChange=function(){this.limits.enabled?(t.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),t.isNullOrUndefined(this.limitBarFirst)&&t.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(t.isNullOrUndefined(this.limitBarFirst)||t.detach(this.limitBarFirst),t.isNullOrUndefined(this.limitBarSecond)||t.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),t.removeClass([this.sliderContainer],[ye.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),t.isBlazor()||this.isServerRendered||(this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),t.detach(this.sliderContainer)),this.tooltip.isVisible&&this.tooltipObj.destroy(),t.isBlazor()&&this.isMaterialTooltip&&!t.isNullOrUndefined(this.materialHandle)&&this.materialHandle.remove(),t.isBlazor()||this.isServerRendered||(this.element.innerHTML="")},s.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,a=Object.keys(e);n<a.length;n++){var r=a[n];switch(r){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(e&&i){var l=t.isNullOrUndefined(e.value)?"Range"===this.type?[this.min,this.max]:this.min:e.value;this.setProperties({value:l},!0),t.isNullOrUndefined(i.value)||i.value.toString()===l.toString()||(this.setValue(),t.isBlazor()&&this.isServerRendered||this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(t.isNullOrUndefined(e.value)||i.value[1]===l[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.setMinMaxValue(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"tooltip":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),t.isNullOrUndefined(e.tooltip)||t.isNullOrUndefined(i.tooltip)||this.setTooltip(r),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"type":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),t.isNullOrUndefined(i)||!Object.keys(i).length||t.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,r),this.setZindex()),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"enableRtl":t.isBlazor()&&this.isServerRendered&&(this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider),this.isServerRendered=!1),i.enableRtl!==e.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl()),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"limits":this.limitsPropertyChange();break;case"orientation":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.changeOrientation(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"ticks":t.isNullOrUndefined(this.sliderContainer.querySelector("."+ye.scale))||(t.isBlazor()&&this.isServerRendered||t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&s.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":e.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):t.isBlazor()&&this.isServerRendered||this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(ye.sliderButtonClass),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition()),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"enabled":this.setEnabled(),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"readonly":this.setReadOnly(),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"customValues":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.setValue(),this.reposition(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"colorRange":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.reposition(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"width":this.setElementWidth(e.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(ye.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(ye.readonly))},s.prototype.setMinMaxValue=function(){var e=this;this.setValue(),t.isBlazor()||this.refreshTooltip(this.tooltipTarget),t.isNullOrUndefined(this.sliderContainer.querySelector("."+ye.scale))||this.ul&&(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,t.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||t.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(e){this.changeSliderType(this.type,e)},s.prototype.setBarColor=function(){for(var e,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!t.isNullOrUndefined(this.colorRange[n].start)&&!t.isNullOrUndefined(this.colorRange[n].end)&&this.colorRange[n].end>this.colorRange[n].start){this.colorRange[n].start<this.min&&(this.colorRange[n].start=this.min),this.colorRange[n].end>this.max&&(this.colorRange[n].end=this.max);var a=this.checkHandlePosition(this.colorRange[n].start),r=this.checkHandlePosition(this.colorRange[n].end),l=this.createElement("div");l.style.backgroundColor=this.colorRange[n].color,l.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=ye.sliderHorizantalColor,e=this.enableRtl?t.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[n].end):this.checkHandlePosition(this.customValues.length-this.colorRange[n].end-1):this.checkHandlePosition(this.colorRange[n].start),l.style.width=r-a+"px",l.style.left=e+"px"):(i=ye.sliderVerticalColor,e=this.checkHandlePosition(this.colorRange[n].start),l.style.height=r-a+"px",l.style.bottom=e+"px"),l.classList.add(i),this.sliderTrack.appendChild(l)}},s.prototype.getModuleName=function(){return"slider"},pe([t.Property(null)],s.prototype,"value",void 0),pe([t.Property(null)],s.prototype,"customValues",void 0),pe([t.Property(1)],s.prototype,"step",void 0),pe([t.Property(null)],s.prototype,"width",void 0),pe([t.Property(0)],s.prototype,"min",void 0),pe([t.Property(100)],s.prototype,"max",void 0),pe([t.Property(!1)],s.prototype,"readonly",void 0),pe([t.Property("Default")],s.prototype,"type",void 0),pe([t.Collection([{}],ve)],s.prototype,"colorRange",void 0),pe([t.Complex({},me)],s.prototype,"ticks",void 0),pe([t.Complex({},fe)],s.prototype,"limits",void 0),pe([t.Property(!0)],s.prototype,"enabled",void 0),pe([t.Complex({},ge)],s.prototype,"tooltip",void 0),pe([t.Property(!1)],s.prototype,"showButtons",void 0),pe([t.Property(!0)],s.prototype,"enableAnimation",void 0),pe([t.Property("Horizontal")],s.prototype,"orientation",void 0),pe([t.Property("")],s.prototype,"cssClass",void 0),pe([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),pe([t.Event()],s.prototype,"created",void 0),pe([t.Event()],s.prototype,"change",void 0),pe([t.Event()],s.prototype,"changed",void 0),pe([t.Event()],s.prototype,"renderingTicks",void 0),pe([t.Event()],s.prototype,"renderedTicks",void 0),pe([t.Event()],s.prototype,"tooltipChange",void 0),s=pe([t.NotifyPropertyChanges],s)}(t.Component),Ee=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ce=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Se={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:\/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")};!function(e){e[e.Message=0]="Message",e[e.Label=1]="Label"}(e.ErrorOption||(e.ErrorOption={}));var Te=function(i){function s(e,s){var n=i.call(this,s,e)||this;if(n.validated=[],n.errorRules=[],n.allowSubmit=!1,n.required="required",n.infoElement=null,n.inputElement=null,n.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",n.localyMessage={},n.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===n.rules&&(n.rules={}),n.l10n=new t.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),t.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),e="string"==typeof e?t.select(e,document):e,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=t.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}Ee(s,i),n=s,s.prototype.addRules=function(e,i){e&&(this.rules.hasOwnProperty(e)?t.extend(this.rules[e],i,{}):this.rules[e]=i)},s.prototype.removeRules=function(e,i){if(e||i)if(this.rules[e]&&!i)delete this.rules[e];else{if(t.isNullOrUndefined(this.rules[e]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[e][i[s]]}else this.rules={}},s.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},s.prototype.reset=function(){this.element.reset(),this.clearForm()},s.prototype.getInputElement=function(e){return this.inputElement=t.select('[name="'+e+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=0,s=t.selectAll("."+this.errorClass+", ."+this.validClass,this.element);e<s.length;e++){var n=s[e];t.detach(n)}i.prototype.destroy.call(this),t.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"locale":this.localeFunc()}},s.prototype.localeFunc=function(){for(var e=0,t=Object.keys(this.defaultMessages);e<t.length;e++){var i=t[e];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[i]=s}},s.prototype.getModuleName=function(){return"formValidator"},s.prototype.afterLocalization=function(e){this.locale=e.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=t.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var e=0,i=t.selectAll(this.selectQuery,this.element);e<i.length;e++){var s=i[e];s.removeAttribute("aria-invalid"),s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var e=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],t=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},r=0,l=e;r<l.length;r++){var o=l[r];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==t.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},s.prototype.annotationRule=function(e,t,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],l=n[n.length-2];if(-1!==a.indexOf(r))switch(r){case"required":this.defRule(e,t,"required",s);break;case"creditcard":this.defRule(e,t,"creditcard",s);break;case"phone":this.defRule(e,t,"tel",s)}else if(-1!==a.indexOf(l))switch(l){case"maxlength":this.defRule(e,t,"maxLength",s);break;case"minlength":this.defRule(e,t,"minLength",s);break;case"range":var o=e.getAttribute("data-val-range-min"),h=e.getAttribute("data-val-range-max");this.defRule(e,t,"range",[o,h]);break;case"equalto":var d=e.getAttribute(i).split(".");this.defRule(e,t,"equalTo",d[d.length-1]);break;case"regex":this.defRule(e,t,"regex",s)}},s.prototype.defRule=function(e,t,i,s){var n,a=e.getAttribute("data-"+i+"-message"),r=e.getAttribute("data-val-"+i);this.rules[e.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(e.name),n=this.getErrorMessage(this.rules[e.name][i],i)),a?s=[s,a]:r?s=[s,r]:n&&(s=[s,n]),t[i]=s},s.prototype.wireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];n.isCheckable(s)?t.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?t.EventHandler.add(s,"change",this.changeHandler,this):(t.EventHandler.add(s,"focusout",this.focusOutHandler,this),t.EventHandler.add(s,"keyup",this.keyUpHandler,this))}t.EventHandler.add(this.element,"submit",this.submitHandler,this),t.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];t.EventHandler.clearEvents(s)}t.EventHandler.remove(this.element,"submit",this.submitHandler),t.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(e){this.trigger("focusout",e);var t=e.target;this.rules[t.name]&&(this.rules[t.name][this.required]||t.value.length>0?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},s.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(9!==e.which||this.rules[t.name]&&(!this.rules[t.name]||this.rules[t.name][this.required]))&&-1!==this.validated.indexOf(t.name)&&this.rules[t.name]&&-1===i.indexOf(e.which)&&this.validate(t.name)},s.prototype.clickHandler=function(e){this.trigger("click",e);var t=e.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(e){this.trigger("change",e);var t=e.target;this.validate(t.name)},s.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(e){if(this.rules[e]){var t=Object.keys(this.rules[e]),i=!1,s=!1,n=t.indexOf("validateHidden"),a=t.indexOf("hidden");if(this.getInputElement(e),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&t.splice(n,1),-1!==a&&t.splice(a-1,1),this.getErrorElement(e);for(var r=0,l=t;r<l.length;r++){var o=l[r],h=this.getErrorMessage(this.rules[e][o],o),d={name:e,message:h},u={inputName:e,element:this.inputElement,message:h};if(!this.isValid(e,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(e),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(e,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(e,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(e),u.status="success",this.trigger("validationComplete",u)}}}},s.prototype.optionalValidationStatus=function(e,i){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(e))},s.prototype.isValid=function(e,i){var s=this.rules[e][i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[e][i],l={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};return this.trigger("validationBegin",l),!l.param&&"required"===i||(r&&"function"==typeof r[0]?r[0].call(this,{element:this.inputElement,value:this.inputElement.value}):n.isCheckable(this.inputElement)?"required"!==i||t.selectAll('input[name="'+e+'"]:checked',this.element).length>0:n.checkValidator[i](l))},s.prototype.getErrorMessage=function(e,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[i]:this.defaultMessages[i],n=s.match(/{(\d)}/g);if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var r=e instanceof Array?e[a]:e;s=s.replace(n[a],r)}return s},s.prototype.createErrorElement=function(i,s,n){var a=t.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===e.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=t.createElement(this.errorContainer,{className:this.errorClass,innerHTML:a.outerHTML})),a.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+n.id+'"]'))this.element.querySelector('[data-valmsg-for="'+n.id+'"]').appendChild(a);else if(!0===n.hasAttribute("data-msg-containerid")){var r=n.getAttribute("data-msg-containerid");t.select("#"+r,this.element).appendChild(a)}else null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,a):this.inputElement.parentNode.insertBefore(a,this.inputElement.nextSibling);a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(e){return this.infoElement=t.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=t.select(this.errorElement+"."+this.errorClass+'[for="'+e+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(e){for(var t=0;t<this.errorRules.length;t++)this.errorRules[t].name===e&&this.errorRules.splice(t,1)},s.prototype.showMessage=function(e){this.infoElement.style.display="block",this.infoElement.innerHTML=e.message,this.checkRequired(e.name)},s.prototype.hideMessage=function(e){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(e),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},s.prototype.checkRequired=function(e){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(e))},s.isCheckable=function(e){var t=e.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)};var n;return s.checkValidator={required:function(e){return isNaN(Date.parse(e.value))?e.value.toString().length>0:!isNaN(new Date(e.value).getTime())},email:function(e){return Se.EMAIL.test(e.value)},url:function(e){return Se.URL.test(e.value)},dateIso:function(e){return Se.DATE_ISO.test(e.value)},tel:function(e){return Se.PHONE.test(e.value)},creditcard:function(e){return Se.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===e.value.indexOf(" ")},digits:function(e){return Se.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=e.param},minLength:function(e){return e.value.length>=e.param},rangeLength:function(e){var t=e.param;return e.value.length>=t[0]&&e.value.length<=t[1]},range:function(e){var t=e.param;return!isNaN(Number(e.value))&&Number(e.value)>=t[0]&&Number(e.value)<=t[1]},date:function(e){return!isNaN(new Date(e.value).getTime())},max:function(e){return isNaN(Number(e.value))?new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=e.param},min:function(e){if(isNaN(Number(e.value))){if(-1!==e.value.indexOf(",")){var t=e.value.replace(/,/g,"");return parseFloat(t)>=e.param}return new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime()}return+e.value>=e.param},regex:function(e){return new RegExp(e.param).test(e.value)},equalTo:function(e){var t=e.formElement.querySelector("#"+e.param);return e.param=t.value,e.param===e.value}},Ce([t.Property("")],s.prototype,"locale",void 0),Ce([t.Property("e-hidden")],s.prototype,"ignore",void 0),Ce([t.Property()],s.prototype,"rules",void 0),Ce([t.Property("e-error")],s.prototype,"errorClass",void 0),Ce([t.Property("e-valid")],s.prototype,"validClass",void 0),Ce([t.Property("label")],s.prototype,"errorElement",void 0),Ce([t.Property("div")],s.prototype,"errorContainer",void 0),Ce([t.Property(e.ErrorOption.Label)],s.prototype,"errorOption",void 0),Ce([t.Event()],s.prototype,"focusout",void 0),Ce([t.Event()],s.prototype,"keyup",void 0),Ce([t.Event()],s.prototype,"click",void 0),Ce([t.Event()],s.prototype,"change",void 0),Ce([t.Event()],s.prototype,"submit",void 0),Ce([t.Event()],s.prototype,"validationBegin",void 0),Ce([t.Event()],s.prototype,"validationComplete",void 0),Ce([t.Event()],s.prototype,"customPlacement",void 0),s=n=Ce([t.NotifyPropertyChanges],s)}(t.Base),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,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Oe="e-upload-file-list",Pe="e-file-status",Le="e-file-remove-btn",Be="e-file-delete-btn",Ae="e-file-abort-btn",He="e-file-reload-btn",Ne="e-upload-progress-wrap",we="e-upload-progress-bar",Ue="e-upload-success",Re="e-upload-fails",Fe="e-file-pause-btn",Ve=["title","style","class"],Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("")],i.prototype,"name",void 0),xe([t.Property(null)],i.prototype,"size",void 0),xe([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("Browse...")],i.prototype,"browse",void 0),xe([t.Property("Upload")],i.prototype,"upload",void 0),xe([t.Property("Clear")],i.prototype,"clear",void 0),i}(t.ChildProperty),Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("")],i.prototype,"saveUrl",void 0),xe([t.Property("")],i.prototype,"removeUrl",void 0),xe([t.Property(0)],i.prototype,"chunkSize",void 0),xe([t.Property(3)],i.prototype,"retryCount",void 0),xe([t.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(t.ChildProperty),ze=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.fileList=[],s.filesData=[],s.uploaderOptions=t,s}return ke(s,e),s.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=t.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=t.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=t.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isServerBlazor||this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=t.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}},s.prototype.setLocalizedTexts=function(){t.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(e){for(var t,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[n]===e&&(t=n)}return t},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)this.fileList[e].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(Ue)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},s.prototype.reRenderFileList=function(){this.listParent&&(t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){if(this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new t.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=t.getValue("currentLocale",this.l10n),this.isServerBlazor=!(!t.isBlazor()||!this.isServerRendered),this.isBlazorTemplate=!(!this.isServerBlazor||""===this.template||t.isNullOrUndefined(this.template)),this.isBlazorSaveUrl=!(!this.isServerRendered||""!==this.asyncSettings.saveUrl&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)),this.isBlazorSaveUrl&&this.sequentialUpload&&(this.sequentialUpload=!1),this.isBlazorSaveUrl||this.formRendered(),!this.isServerBlazor){this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var e=t.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var i=this.createElement("input",{attrs:{type:"file"}}),s=0;for(s;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}e[0].isPureReactComponent&&(t.isNullOrUndefined(e[0].props.name)?!t.isNullOrUndefined(e[0].props.id)&&t.isNullOrUndefined(e[0].props.name)?this.element.setAttribute("name",e[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",e[0].props.name)),t.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes()}this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=t.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var e=t.closest(this.element,"form");if(!t.isNullOrUndefined(e))for(;e&&e!==document.documentElement;e=e.parentElement)"FORM"===e.tagName&&(this.isForm=!0,this.formElement=e,e.setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"))},s.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},s.prototype.getModuleName=function(){return"uploader"},s.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},s.prototype.render=function(){this.isServerBlazor?(this.dropAreaWrapper=t.closest(this.element,".e-file-select-wrap"),this.uploadWrapper=t.closest(this.element,".e-upload.e-control-wrapper"),this.browseButton=this.dropAreaWrapper.querySelector("button.e-upload-browse-btn"),this.setDropArea(),this.renderPreLoadFiles(),this.wireEvents()):(this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()),this.isServerBlazor&&this.renderComplete()},s.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},s.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.uploadButton.focus(),this.wireActionButtonEvents())},s.prototype.serverActionButtonsEventBind=function(e){e&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=e,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},s.prototype.serverUlElement=function(e){e&&(this.isBlazorSaveUrl||this.isBlazorTemplate)&&(this.listParent=e,this.fileList=[].slice.call(this.listParent.querySelectorAll("li")),this.serverRemoveIconBindEvent(),this.isForm||this.checkAutoUpload(this.filesData))},s.prototype.wireActionButtonEvents=function(){t.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),t.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){t.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),t.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),this.isBlazorSaveUrl||this.isBlazorTemplate||t.detach(this.actionButtons),this.actionButtons=null)},s.prototype.renderButtonTemplates=function(){if("string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton){var e=t.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=e,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))}if(this.clearButton){var i=t.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=i,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear))}},s.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var e=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(e,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),e.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(e),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},s.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.createFileList(this.filesData);if(t.isNullOrUndefined(this.files[0].size))return;var e=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),e=[e[0]]);for(var s=0,n=e;s<n.length;s++){var a=n[s],r={name:a.name+"."+a.type.split(".")[a.type.split(".").length-1],rawFile:"",size:a.size,status:this.localizedTexts("uploadSuccessMessage"),type:a.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};i.push(r),this.filesData.push(r)}this.createFileList(i),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1)}},s.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var e=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Ue).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;e>0&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:t.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,e?this.isServerBlazor||(e.innerHTML=this.localizedTexts("dropFilesHint")):this.createDropTextHint());!s&&e&&t.remove(e)}else t.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},s.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var e=this.dropAreaWrapper.querySelector(".e-file-drop");e&&t.remove(e)}},s.prototype.createDropTextHint=function(){if(!this.isServerBlazor){var e=this.createElement("span",{className:"e-file-drop"});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Ve.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Ve.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.uploadWrapper.setAttribute(s,a)}else this.uploadWrapper.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var e=document.createAttribute("multiple");e.value="multiple",this.element.setAttributeNode(e)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(e){if(this.filesData.length-e.length==0||"1"!==this.filesData[this.filesData.length-e.length-1].statusCode){++this.count;var t=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],t),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(e)):--this.count}},s.prototype.setCSSClass=function(e){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(this.cssClass)||""===i||t.addClass([this.uploadWrapper],i.split(i.indexOf(",")>-1?",":" "));var s=e;t.isNullOrUndefined(e)||(s=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||""===s||t.removeClass([this.uploadWrapper],s.split(" "))},s.prototype.wireEvents=function(){t.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),t.EventHandler.add(this.element,"change",this.onSelectFiles,this),t.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new t.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),t.EventHandler.remove(this.element,"change",this.onSelectFiles),t.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(e){var i=e.target;switch(e.action){case"enter":if(e.target===this.clearButton)this.clearButtonClick();else if(e.target===this.uploadButton)this.uploadButtonClick();else if(e.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(Fe))(s=this.getCurrentMetaData(null,e)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1);else if(i.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,e),e);else if(i.classList.contains(He)){var s=this.getCurrentMetaData(null,e);if(t.isNullOrUndefined(s)){var n=e.target.parentElement,a=this.filesData[this.fileList.indexOf(n)];this.retry(a)}else s.file.statusCode="1",s.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(s.file)}else this.removeFiles(e),i.classList.contains(Ae)||this.browseButton.focus();e.preventDefault(),e.stopPropagation()}},s.prototype.getCurrentMetaData=function(e,i){var s,n;if(t.isNullOrUndefined(e)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=e;for(var r=0;r<this.uploadMetaData.length;r++)this.uploadMetaData[r].file.name===s.name&&(n=this.uploadMetaData[r]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},s.prototype.browseButtonClick=function(){this.element.click()},s.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},s.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},s.prototype.bindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),t.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),t.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),t.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),t.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),t.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),t.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),t.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(e){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,e.preventDefault(),e.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},s.prototype.dragHover=function(e){this.enabled&&("Default"!==this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),e.preventDefault(),e.stopPropagation())},s.prototype.dropElement=function(e){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(e),e.preventDefault(),e.stopPropagation()},s.prototype.onPasteFile=function(e){var t=e.clipboardData.items;if(1===t.length){var i=[].slice.call(t)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(e,[i.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(e){for(var t=[],i=this.fileList[e],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,r=0;r<e;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)t.push(s[l]);return t},s.prototype.removeFiles=function(e){if(this.enabled){var s=e.target.parentElement;this.isBlazorSaveUrl&&(this.fileList=[].slice.call(this.uploadWrapper.querySelectorAll("li")));var n=this.fileList.indexOf(s),a=this.fileList[n],r=this.isFormUpload(),l=r?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!t.isNullOrUndefined(l)){if(e.target.classList.contains(Ae)&&!r){if(l[0].statusCode="5",!t.isNullOrUndefined(a)){var o=a.querySelector("."+Ae);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else t.closest(e.target,".e-spinner-pane")||this.remove(l,!1,!1,!0,e);this.element.value="",this.checkActionButtonStatus()}}},s.prototype.removeFilesData=function(e,i){var s;if(i)return void(this.showFileList||(s=this.filesData.indexOf(e),this.filesData.splice(s,1)));var n=this.getLiElement(e);t.isNullOrUndefined(n)||(this.isBlazorSaveUrl||t.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),this.isBlazorSaveUrl?this.interopAdaptor.invokeMethodAsync("removeFileData",s):(0!==this.fileList.length||t.isNullOrUndefined(this.listParent)||(t.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count))},s.prototype.removeUploadedFile=function(e,i,s,n){var a=this,r=e,l=new t.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;if(l.beforeSend=function(n){i.currentRequest=l.httpRequest,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(l.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(o,a.customFormDatas)),s?a.removingEventCallback(i,o,r,e):a.trigger("removing",i,function(t){t.cancel?n.cancel=!0:a.removingEventCallback(t,o,r,e)})},this.isServerBlazor){var h=this.element.getAttribute("name");t.isNullOrUndefined(r.rawFile)||""===r.rawFile?o.append(h,r.name):o.append(h,r.rawFile,r.name)}l.onLoad=function(e){return a.removeCompleted(e,r,n),{}},l.onError=function(e){return a.removeFailed(e,r,n),{}},l.send(o)},s.prototype.removingEventCallback=function(e,s,n,a){var r=this.element.getAttribute("name"),l=this.getLiElement(a);if(!(t.isNullOrUndefined(l)||t.isNullOrUndefined(l.querySelector("."+Be))&&t.isNullOrUndefined(l.querySelector("."+Le)))){var o=l.querySelector("."+Be)?l.querySelector("."+Be):l.querySelector("."+Le);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.isServerBlazor||(e.postRawFile&&!t.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(r,n.rawFile,n.name):s.append(r,n.name),this.updateFormData(s,e.customFormData))},s.prototype.updateFormData=function(e,t){if(t.length>0&&t[0])for(var i=0;i<t.length;i++)!function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.append(Object.keys(s)[0],n)}(i)},s.prototype.updateCustomheader=function(e,t){if(t.length>0&&t[0])for(var i=0;i<t.length;i++)!function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.setRequestHeader(Object.keys(s)[0],n)}(i)},s.prototype.removeCompleted=function(e,t,i){var s=e&&e.currentTarget?this.getResponse(e):null,n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:e,response:s,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(t,i);var r=this.uploadedFilesData.indexOf(t);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(e,t,i)},s.prototype.removeFailed=function(e,s,n){var a={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var r=this.filesData.indexOf(s),l=this.fileList[r];if(l){l.classList.remove(Ue),l.classList.add(Re);var o=l.querySelector("."+Pe);o&&(o.classList.remove(Ue),o.classList.add(Re))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(h.querySelector("."+Be))){var d=h.querySelector("."+Be);i.hideSpinner(d),t.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var t=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(t))for(var i=this,s=0;s<t.length;s++)!function(s){var n=t[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(e){var t=n.fullPath;a.push({path:t,file:e})}),i.renderSelectedFiles(e,a,!0)}else n.isDirectory&&i.traverseFileTree(n,e)}(s)},s.prototype.checkDirectoryUpload=function(e){for(var t=0;e&&t<e.length;t++)if(e[t].webkitGetAsEntry().isDirectory)return!0;return!1},s.prototype.traverseFileTree=function(e,t){if(e.isFile)this.filesEntries.push(e);else if(e.isDirectory){var i=e.createReader();this.readFileFromDirectory(i,t)}},s.prototype.readFileFromDirectory=function(e,t){var i=this;e.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],t);i.pushFilesEntries(t),s.length&&i.readFileFromDirectory(e)})},s.prototype.pushFilesEntries=function(e){for(var t=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(t.filesEntries.length){var a=t.filesEntries[n].fullPath;i.push({path:a,file:s}),n===t.filesEntries.length-1&&(t.filesEntries=[],t.renderSelectedFiles(e,i,!0))}})}(n)},s.prototype.onSelectFiles=function(e){if(this.enabled){var t;if("drop"===e.type)if(this.directoryUpload)this.getFilesFromFolder(e);else{var i=this.sortFilesList=e.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))}else t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)}},s.prototype.getBase64=function(e){return new Promise(function(t,i){var s=new FileReader;s.readAsDataURL(e),s.onload=function(){return t(s.result)},s.onerror=function(e){return i(e)}})},s.prototype.renderSelectedFiles=function(e,t,i,s){var n=this;this.base64String=[];var a={event:e,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)return a.isCanceled=!0,void this.trigger("selected",a);this.flag=!0;var r=[];this.multiple||(this.clearData(!0),t=[t[0]]);for(var l=0;l<t.length;l++){var o=i?t[l].file:t[l];this.updateInitialFileDetails(e,t,o,l,r,i,s)}a.filesData=r,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(e){n._internalRenderSelect(e,r)})},s.prototype.updateInitialFileDetails=function(e,i,s,n,a,r,l){var o={name:r?i[n].path.substring(1,i[n].path.length):l?t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name):this.directoryUpload?i[n].webkitRelativePath:s.name,rawFile:s,size:s.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(s.name),validationMessages:this.validatedFileSize(s.size),statusCode:"1",id:t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};l&&(o.fileSource="paste"),o.status=""!==o.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==o.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):o.status,""===o.validationMessages.minSize&&""===o.validationMessages.maxSize||(o.statusCode="0"),a.push(o)},s.prototype._internalRenderSelect=function(e,i){if(!e.cancel){if(t.isBlazor()&&(this.currentRequestHeader=e.currentRequest,this.customFormDatas=e.customFormData),this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&e.modifiedFilesData.length>0){for(var s=0;s<e.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)e.modifiedFilesData[s].id===i[n].id&&(e.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?e.modifiedFilesData:this.checkExtension(e.modifiedFilesData);this.updateSortedFileList(a),this.filesData=a,this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else this.createFileList(i,!0),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.filesData=this.filesData.concat(i)),this.isForm&&!this.allowUpload()||this.isBlazorSaveUrl||this.isBlazorTemplate||this.checkAutoUpload(i);t.isNullOrUndefined(e.progressInterval)||""===e.progressInterval||(this.progressInterval=e.progressInterval)}else this.filesData=this.filesData.concat(i),this.isBlazorSaveUrl&&this.interopAdaptor.invokeMethodAsync("updateServerFileData",this.filesData,this.isForm),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},s.prototype.allowUpload=function(){var e=!1;return this.isForm&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(e=!0),e},s.prototype.isFormUpload=function(){var e=!1;return!this.isForm||!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!t.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(e=!0),e},s.prototype.clearData=function(e){t.isNullOrUndefined(this.listParent)||this.isBlazorSaveUrl||this.isBlazorTemplate||(t.detach(this.listParent),this.listParent=null),"msie"===this.browserName||e||(this.element.value=""),this.fileList=[],this.filesData=[],this.isBlazorSaveUrl||this.isBlazorTemplate?this.interopAdaptor.invokeMethodAsync("clearAll"):this.removeActionButtons()},s.prototype.updateSortedFileList=function(e){var i,s=this.createElement("div",{id:"clonewrapper"}),n=-1;if(this.listParent){for(var a=0;a<this.listParent.querySelectorAll("li").length;a++){var r=this.listParent.querySelectorAll("li")[a];s.appendChild(r.cloneNode(!0))}for(var l=0,o=i=this.listParent.querySelectorAll("li");l<o.length;l++){var h=o[l];t.detach(h)}this.removeActionButtons();var d=[].slice.call(s.childNodes);t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createParentUL();for(var u=0;u<e.length;u++){for(var c=0;c<this.filesData.length;c++)this.filesData[c].name===e[u].name&&(this.listParent.appendChild(d[c]),t.EventHandler.add(d[c].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(d[c]),n=u);n!==u&&this.createFileList([e[u]])}}else this.createFileList(e)},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.checkExtension=function(e){var t=e;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var r=0;r<e.length;r++)-1===i.indexOf(("."+e[r].type).toLocaleLowerCase())&&(e[r].status=this.localizedTexts("invalidFileType"),e[r].statusCode="0")}return t},s.prototype.validatedFileSize=function(e){var t="",i="";return e<this.minFileSize?t=this.localizedTexts("invalidMinFileSize"):e>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(t="",i=""),{minSize:t,maxSize:i}},s.prototype.isPreLoadFile=function(e){for(var t=!1,i=0;i<this.files.length;i++)this.files[i].name===e.name.slice(0,e.name.lastIndexOf("."))&&this.files[i].type===e.type&&(t=!0);return t},s.prototype.createCustomfileList=function(e){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");for(var i=0,s=e;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Oe,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(r){var l=[].slice.call(r);t.append(l,a)}var o=e.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},d={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",d),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createParentUL=function(){t.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(e,i){var s=this.createElement("li",{className:Oe});s.setAttribute("data-files-count",e.length+"");for(var n,a=this.createElement("span",{className:"e-file-container"}),r=0,l=e;r<l.length;r++){var o=l[r],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(o.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),a.appendChild(c)}else a.appendChild(h),a.appendChild(d);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(e,s);var p=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains("e-file-invalid")?(m.classList.add(Pe),m.classList.add("e-file-invalid"),m.innerText=e.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(e.length>1?"e-file-information":"e-file-size"),m.innerText=e.length>1?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),a.appendChild(m),t.isNullOrUndefined(s.querySelector(".e-icons"))){var v=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(v),t.EventHandler.add(v,"click",this.removeFiles,this),v.classList.add(Le)}var f={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))},g={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))};this.trigger("rendering",f),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(e,t){var i=e.status,s=this.validatedFileSize(e.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(t),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(e))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},s.prototype.addInvalidClass=function(e){e.classList.add("e-file-invalid")},s.prototype.createFormInput=function(e){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,s=e;i<s.length;i++)s[i].input=t;t.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(t),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")},s.prototype.getFileSize=function(e){for(var t=0,i=0,s=e;i<s.length;i++)t+=s[i].size;return t},s.prototype.mergeFileInfo=function(e,t){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:t},s=[],n="",a=0,r=e;a<r.length;a++){var l=r[a];s.push(l.name),n=l.type}return i.name=s.join(", "),i.size=this.getFileSize(e),i.type=n,i.status=this.statusForFormUpload(e,t),i},s.prototype.statusForFormUpload=function(e,t){for(var i,s=!0,n=0,a=e;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):(t.classList.add("e-file-invalid"),i=e.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(e,i){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");var s=this.createElement("li",{className:Oe});s.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,s);var n=this.mergeFileInfo(e,s);s.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template);var a=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,s);if(a){var r=[].slice.call(a);t.append(r,s)}var l=this.listParent.querySelectorAll("li").length;s.classList.contains("e-file-invalid")||this.createFormInput(e);var o={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",o),this.trigger("fileListRendering",h),this.listParent.appendChild(s),this.fileList.push(s),this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createFileList=function(e,i){if(this.isBlazorSaveUrl||this.isBlazorTemplate){var s=i?this.filesData=this.filesData.concat(e):e;this.interopAdaptor.invokeMethodAsync("createFileList",s,this.isForm)}else if(this.createParentUL(),""===this.template||t.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(e,this.element.files);else for(var n=0,a=e;n<a.length;n++){var r=a[n],l=this.createElement("li",{className:Oe,attrs:{"data-file-name":r.name,"data-files-count":"1"}}),o=this.createElement("span",{className:"e-file-container"}),h=this.createElement("span",{className:"e-file-name",attrs:{title:r.name}});h.innerHTML=this.getFileNameOnly(r.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(r.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),o.appendChild(c)}else o.appendChild(h),o.appendChild(d);var p=this.createElement("span",{className:"e-file-size"});p.innerHTML=this.bytesToSize(r.size),o.appendChild(p);var m=this.createElement("span",{className:Pe});o.appendChild(m),m.innerHTML=r.status,l.appendChild(o);var v=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),l.appendChild(v),t.EventHandler.add(v,"click",this.removeFiles,this),"2"===r.statusCode?(m.classList.add(Ue),v.classList.add(Be),v.setAttribute("title",this.localizedTexts("delete"))):"1"!==r.statusCode&&(m.classList.remove(Ue),m.classList.add("e-validation-fails")),this.autoUpload&&"1"===r.statusCode&&""!==this.asyncSettings.saveUrl&&(m.innerHTML=""),v.classList.contains(Be)||v.classList.add(Le);var f=e.indexOf(r),g={element:l,fileInfo:r,index:f,isPreload:this.isPreLoadFile(r)},y={element:l,fileInfo:r,index:f,isPreload:this.isPreLoadFile(r)};this.trigger("rendering",g),this.trigger("fileListRendering",y),this.listParent.appendChild(l),this.fileList.push(l),this.truncateName(h);var b=this.flag;this.isPreLoadFile(r)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=b)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(e,this.element.files)):this.createCustomfileList(e)},s.prototype.getSlicedName=function(e){var t=e.textContent;e.dataset.tail=t.slice(t.length-10)},s.prototype.setListToFileInfo=function(e,t){for(var i=0,s=e;i<s.length;i++)s[i].list=t},s.prototype.truncateName=function(e){var t=e;"edge"!==this.browserName&&t.offsetWidth<t.scrollWidth?this.getSlicedName(t):t.offsetWidth+1<t.scrollWidth&&this.getSlicedName(t)},s.prototype.getFileType=function(e){var t,i=e.lastIndexOf(".");return i>=0&&(t=e.substring(i+1)),t||""},s.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return t=e.split("."+t)[0]},s.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var e=document.createAttribute("multiple");this.element.setAttributeNode(e)}},s.prototype.filterfileList=function(e){for(var t=[],i=0;i<e.length;i++)this.getLiElement(e[i]).classList.contains(Ue)||t.push(e[i]);return t},s.prototype.updateStatus=function(e,i,s,n){if(void 0===n&&(n=!0),""!==i&&!t.isNullOrUndefined(i)&&""!==s&&!t.isNullOrUndefined(s))if(this.isBlazorSaveUrl)for(var a=0;a<this.filesData.length;a++)this.filesData[a].name===e.name&&(this.filesData[a].status=i,this.filesData[a].statusCode=s);else e.status=i,e.statusCode=s;if(n){var r=this.getLiElement(e);t.isNullOrUndefined(r)||t.isNullOrUndefined(r.querySelector("."+Pe))||""===i||t.isNullOrUndefined(i)||(r.querySelector("."+Pe).textContent=i)}return e},s.prototype.getLiElement=function(e){for(var i,s=0;s<this.filesData.length;s++)(t.isNullOrUndefined(this.filesData[s].id)||t.isNullOrUndefined(e.id)?this.filesData[s].name===e.name:this.filesData[s].name===e.name&&this.filesData[s].id===e.id)&&(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(e){var t=this.createElement("span",{className:Ne}),i=this.createElement("progressbar",{className:we,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),t.appendChild(s),t.appendChild(n),e.querySelector(".e-file-container").appendChild(t)},s.prototype.updateProgressbar=function(e,i){if(!isNaN(Math.round(e.loaded/e.total*100))&&!t.isNullOrUndefined(i.querySelector("."+we)))if(t.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%");else{var s=Math.round(e.loaded/e.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(e,t){e.querySelector("."+we).setAttribute("style","width:"+t),e.querySelector(".e-progress-bar-text").textContent=t},s.prototype.uploadInProgress=function(e,i,s,n){var a=this.getLiElement(i);if(!t.isNullOrUndefined(a)||s){if(t.isNullOrUndefined(a))this.cancelUploadingFile(i,e,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,e,n,a),a.querySelectorAll("."+Ne).length>0||!a.querySelector("."+Pe)||(a.querySelector("."+Pe).classList.add("e-upload-progress"),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"),a.querySelector("."+Pe).classList.remove(Re)),this.updateProgressbar(e,a);var r=a.querySelector("."+Le);t.isNullOrUndefined(r)||(r.classList.add(Ae,"e-upload-progress"),r.setAttribute("title",this.localizedTexts("abort")),r.classList.remove(Le))}var l={e:e,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",l)}},s.prototype.cancelUploadingFile=function(e,s,n,a){var r=this;if("5"===e.statusCode){var l={event:s,fileData:e,cancel:!1,customFormData:[]};this.trigger("canceling",l,function(s){if(s.cancel){if(e.statusCode="3",!t.isNullOrUndefined(a)){var l=a.querySelector("."+Ae);t.isNullOrUndefined(l)||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===e.statusCode){var h=r.element.getAttribute("name");o.append(h,e.name),o.append("cancel-uploading",e.name),r.updateFormData(o,s.customFormData);var d=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);d.emitError=!1,d.onLoad=function(t){return r.removecanceledFile(t,e),{}},d.send(o)}}})}},s.prototype.removecanceledFile=function(e,s){var n=this.getLiElement(s);if(!n.querySelector("."+He)&&!t.isNullOrUndefined(n.querySelector("."+Ae))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,s,n);var a=n.querySelector("."+Le);t.isNullOrUndefined(n)||(i.hideSpinner(a),t.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||t.detach(n.querySelector(".e-spinner-pane")));var r={event:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"cancel",file:s};this.trigger("success",r)}},s.prototype.renderFailureState=function(e,i,s){var n=this;this.updateProgressBarClasses(s,Re),this.removeProgressbar(s,"failure"),t.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Re);var a=s.querySelector("."+Ae);t.isNullOrUndefined(a)||(a.classList.remove(Ae,"e-upload-progress"),a.classList.add(Le),a.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),a.parentElement.insertBefore(this.pauseButton,a),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),s.querySelector("."+He).addEventListener("click",function(e){n.reloadcanceledFile(e,i,s,!1)},!1))},s.prototype.reloadcanceledFile=function(e,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(t.isNullOrUndefined(s.querySelector("."+Pe))||s.querySelector("."+Pe).classList.remove(Re),t.isNullOrUndefined(s.querySelector("."+He))||t.detach(s.querySelector("."+He)),this.pauseButton=null),s.classList.add("e-restrict-retry"),this.upload([i])},s.prototype.uploadComplete=function(e,i,s){var n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(t.isNullOrUndefined(a)&&(!s||t.isNullOrUndefined(s)))return;if(!t.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Ue),this.removeProgressbar(a,"success");var r=a.querySelector("."+Ae);t.isNullOrUndefined(r)||(r.classList.add(Be),r.setAttribute("title",this.localizedTexts("delete")),r.classList.remove(Ae),r.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(e,i)}else this.uploadFailed(e,i)},s.prototype.getResponse=function(e){var t=e.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},s.prototype.serverRemoveIconBindEvent=function(){if(this.uploadWrapper&&this.isBlazorSaveUrl)for(var e=[].slice.call(this.uploadWrapper.querySelectorAll("ul li")),i=0;i<e.length;i++){var s=e[i]?e[i].querySelector(".e-icons"):null;s&&(t.EventHandler.remove(s,"click",this.removeFiles),t.EventHandler.add(s,"click",this.removeFiles,this))}},s.prototype.raiseSuccessEvent=function(e,s){var n=this,a=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadSuccessMessage"),l={e:e,response:a,operation:"upload",file:this.updateStatus(s,r,"2",!1),statusText:r};if(!this.isBlazorSaveUrl){var o=this.getLiElement(s);if(!t.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");t.isNullOrUndefined(h)||(i.hideSpinner(o),t.detach(h))}}this.trigger("success",l,function(e){n.updateStatus(s,e.statusText,"2"),n.uploadedFilesData.push(s),n.isBlazorSaveUrl||n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0&&(n.getLiElement(s).classList.contains("e-restrict-retry")?n.getLiElement(s).classList.remove("e-restrict-retry"):(n.uploadSequential(),n.checkActionComplete(!0)))})},s.prototype.uploadFailed=function(e,i){var s=this,n=this.getLiElement(i),a=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadFailedMessage"),l={e:e,response:a,operation:"upload",file:this.updateStatus(i,r,"0",!1),statusText:r};t.isNullOrUndefined(n)||this.renderFailureState(e,i,n),this.trigger("failure",l,function(e){s.updateStatus(i,e.statusText,"0"),s.checkActionButtonStatus(),s.uploadSequential(),s.checkActionComplete(!0)})},s.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},s.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var e={fileData:[]};e.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e)}},s.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,s=0;s<e.length;s++)for(var n=e[s],a=0;a<this.filesData.length;a++)this.filesData[a].name===n.name&&(t[i]=this.filesData[a],++i);return t},s.prototype.updateProgressBarClasses=function(e,i){var s=e.querySelector("."+we);t.isNullOrUndefined(s)||s.classList.add(i)},s.prototype.removeProgressbar=function(e,i){var s=this;t.isNullOrUndefined(e.querySelector("."+Ne))||(this.progressAnimation=new t.Animation({duration:1250}),this.progressAnimation.animate(e.querySelector("."+Ne),{name:"FadeOut"}),this.progressAnimation.animate(e.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(e,i)},750))},s.prototype.animateProgressBar=function(e,i){"success"===i?(e.classList.add(Ue),t.isNullOrUndefined(e.querySelector("."+Pe))||(e.querySelector("."+Pe).classList.remove("e-upload-progress"),this.progressAnimation.animate(e.querySelector("."+Pe),{name:"FadeIn"}),e.querySelector("."+Pe).classList.add(Ue))):t.isNullOrUndefined(e.querySelector("."+Pe))||(e.querySelector("."+Pe).classList.remove("e-upload-progress"),this.progressAnimation.animate(e.querySelector("."+Pe),{name:"FadeIn"}),e.querySelector("."+Pe).classList.add(Re)),e.querySelector("."+Ne)&&t.detach(e.querySelector("."+Ne))},s.prototype.setExtensions=function(e){""===e||t.isNullOrUndefined(e)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",e)},s.prototype.templateComplier=function(e){if(e)try{if(t.selectAll(e,document).length)return t.compile(t.select(e,document).innerHTML.trim())}catch(i){return t.compile(e)}},s.prototype.setRTL=function(){this.enableRtl?t.addClass([this.uploadWrapper],"e-rtl"):t.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(e){return this.l10n.setLocale(this.locale),this.l10n.getConstant(e)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!t.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!t.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!t.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||e)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!e),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||e){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!e),this.initialAttr.multiple=!0}break;case"disabled":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||e){var r="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:r},!e),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(e,t,i){var s=Math.min(this.asyncSettings.chunkSize,e.size),n={chunkIndex:0,blob:e.rawFile.slice(0,s),file:e,start:0,end:s,retryCount:0,request:null};this.sendRequest(e,n,t,i)},s.prototype.sendRequest=function(e,i,s,n){var a=this,r=new FormData,l=e.rawFile.slice(i.start,i.end);r.append("chunkFile",l,e.name),r.append(this.uploaderName,l,e.name),r.append("chunk-index",i.chunkIndex.toString()),r.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(e.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new t.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(e){return a.chunkUploadComplete(e,i,s),{}},h.onUploadProgress=function(e){return a.chunkUploadInProgress(e,i,s),{}};var d={fileData:e,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(s){d.currentRequest=h.httpRequest,d.currentChunkIndex=i.chunkIndex,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(h.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(r,a.customFormDatas)),0===d.currentChunkIndex?a.trigger("uploading",d,function(t){a.uploadingEventCallback(r,t,s,e)}):a.trigger("chunkUploading",d,function(t){a.uploadingEventCallback(r,t,s,e)})},h.onError=function(e){return a.chunkUploadFailed(e,i,s),{}},h.send(r),i.request=h},s.prototype.uploadingEventCallback=function(e,t,i,s){t.cancel?this.eventCancelByArgs(i,t,s):this.updateFormData(e,t.customFormData)},s.prototype.eventCancelByArgs=function(e,i,s){var n=this;if(e.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){t.isNullOrUndefined(a.querySelector("."+Pe))||(a.querySelector("."+Pe).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+Pe).classList.add(Re)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var r=a.querySelector("."+Le);r&&r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(e){n.reloadcanceledFile(e,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||t.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(e,s,n){var a,r=this,l=e.target;if(4===l.readyState&&l.status>=200&&l.status<300){var o=e&&e.currentTarget?this.getResponse(e):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),d={event:e,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",d),!t.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode){var u={event:e,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",u,function(e){if(e.cancel){s.file.statusCode="3";var o=a.querySelector("."+Ae);t.isNullOrUndefined(a)||t.isNullOrUndefined(o)||(i.hideSpinner(o),t.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)}else{s.request.emitError=!1,l.abort();var h=new FormData,d=r.element.getAttribute("name");h.append(d,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),r.updateFormData(h,e.customFormData);var u=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.onLoad=function(e){return r.removeChunkFile(e,s,n),{}},u.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var c=this.pausedData.indexOf(s);return c>=0&&this.pausedData.splice(c,1),t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(n)||!n)&&a&&(a&&!t.isNullOrUndefined(a.querySelector("."+Fe))&&t.detach(a.querySelector("."+Fe)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(e,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(e,s)},s.prototype.sendNextRequest=function(e){e.start=e.end,e.end+=this.asyncSettings.chunkSize,e.end=Math.min(e.end,e.file.size),e.chunkIndex+=1,this.sendRequest(e.file,e)},s.prototype.removeChunkFile=function(e,s,n){if(t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),r=a.querySelector("."+Ae),l=r;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Re),this.removeProgressbar(a,"failure"),r&&r.classList.remove(Ae),r&&r.classList.add(Le),r&&r.setAttribute("title",this.localizedTexts("remove"));var o=a.querySelector("."+Fe);o&&o.classList.add(He),o&&o.classList.remove(Fe),o&&o.setAttribute("title",this.localizedTexts("retry")),t.isNullOrUndefined(a)||t.isNullOrUndefined(r)||t.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);var s={event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(e,i,s)},s.prototype.abortUpload=function(e,i,s){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);if(t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(i)||!i)){var a=n.querySelector("."+Fe);a.classList.remove(Fe),a.classList.add("e-file-play-btn"),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Le),a.nextElementSibling.classList.remove(Ae),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].file.name===e.file.name&&this.pausedData.splice(r,1);this.pausedData.push(e),this.trigger("pausing",s)},s.prototype.resumeUpload=function(e,i,s){var n,a=this.getLiElement(e.file);t.isNullOrUndefined(a)||(n=a.querySelector(".e-file-play-btn")),t.isNullOrUndefined(n)||!t.isNullOrUndefined(s)&&s||(n.classList.remove("e-file-play-btn"),n.classList.add(Fe),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(Le),n.nextElementSibling.classList.add(Ae),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),e.file.status=this.localizedTexts("inProgress"),e.file.statusCode="3",this.updateMetaData(e);var r={event:i||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",r);for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].end===this.pausedData[l].file.size?this.chunkUploadComplete(i,e,s):this.pausedData[l].file.name===e.file.name&&(this.pausedData[l].start=this.pausedData[l].end,this.pausedData[l].end=this.pausedData[l].end+this.asyncSettings.chunkSize,this.pausedData[l].end=Math.min(this.pausedData[l].end,this.pausedData[l].file.size),this.pausedData[l].chunkIndex=this.pausedData[l].chunkIndex+1,this.sendRequest(this.pausedData[l].file,this.pausedData[l],s))},s.prototype.updateMetaData=function(e){-1===this.uploadMetaData.indexOf(e)?this.uploadMetaData.push(e):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(e),1),this.uploadMetaData.push(e))},s.prototype.removeChunkProgressBar=function(e){var i=this.getLiElement(e.file);if(!t.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Ue),this.removeProgressbar(i,"success");var s=i.querySelector("."+Ae);t.isNullOrUndefined(s)||(s.classList.add(Be),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(Ae,"e-upload-progress"))}},s.prototype.chunkUploadFailed=function(e,i,s){var n,a=this,r=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!t.isNullOrUndefined(this.template)||!t.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var l=e&&e.currentTarget?this.getResponse(e):null,o={event:e,file:i.file,chunkIndex:i.chunkIndex,totalChunk:r,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:l};this.trigger("chunkFailure",o,function(r){if(!r.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!t.isNullOrUndefined(n)){var o=n.querySelector("."+Fe)?n.querySelector("."+Fe):n.querySelector(".e-file-play-btn");t.isNullOrUndefined(o)||(o.classList.add(He),o.classList.remove(Fe,"e-file-play-btn")),a.updateProgressBarClasses(n,Re),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove("e-upload-progress");var h=n.querySelector("."+Ae)?n.querySelector("."+Ae):n.querySelector("."+Le);h.classList.remove(Ae),t.isNullOrUndefined(n.querySelector("."+Fe))||t.detach(n.querySelector("."+Fe)),i.start>0?(h.classList.add(Be),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Le),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var d=i.file,u=a.localizedTexts("uploadFailedMessage"),c={e:e,response:l,operation:"upload",file:a.updateStatus(d,u,"0",!1),statusText:u};a.trigger("failure",c,function(e){a.updateStatus(d,e.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(e,i,s){t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(s)||!s)&&e&&this.updateProgressBarClasses(e,Re),i.retryCount+=1,this.sendRequest(i.file,i)},s.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);t.classList.contains(Fe)?this.pauseUpload(a,e):t.classList.contains("e-file-play-btn")?this.resumeUpload(a,e):t.classList.contains(He)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(e,t){t?(e.end=e.end+this.asyncSettings.chunkSize,e.start=e.start+this.asyncSettings.chunkSize,this.sendRequest(e.file,e)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file)),this.getLiElement(e.file).classList.add("e-restrict-retry")},s.prototype.chunkUploadInProgress=function(e,i,s){var n=this;if("4"!==i.file.statusCode){"4"!==i.file.statusCode&&"5"!==i.file.statusCode&&(i.file.statusCode="3",i.file.status=this.localizedTexts("inProgress")),this.updateMetaData(i);var a=this.getLiElement(i.file);if(!t.isNullOrUndefined(a)){var r=a.querySelector("."+He);if(t.isNullOrUndefined(r)||(r.classList.add(Fe),r.setAttribute("title",this.localizedTexts("pause")),r.classList.remove(He)),!t.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Ne).length>0)){var l=a.querySelector("."+Pe);t.isNullOrUndefined(this.template)&&(l.classList.add("e-upload-progress"),l.classList.remove(Re),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"));var o=a.querySelector("."+Le)?a.querySelector("."+Le):a.querySelector("."+Be);t.isNullOrUndefined(o)||(o.classList.add(Ae),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Le))}if(!isNaN(Math.round(e.loaded/e.total*100))&&t.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,d=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&d&&(h=Math.round(i.chunkIndex/d*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(t.isNullOrUndefined(a.querySelector("."+Fe))&&t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(a.querySelector("."+Be))){this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie");var u=a.querySelector("."+Ae);u.parentElement.insertBefore(this.pauseButton,u),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){n.checkPausePlayAction(e)},!1)}}}},s.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";do{e/=1024,t++}while(e>99);return t>=2&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},s.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],s=0;s<t.length;s++)i.push(t[s].name);for(var n=[],a=0,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<t.length;s++)l===t[s].name&&n.push(t[s]);return n},s.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.isBlazorSaveUrl||this.isBlazorTemplate||this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var i=0,s=["aria-label","directory","webkitdirectory","tabindex"];i<s.length;i++){var n=s[i];this.element.removeAttribute(n)}this.isServerBlazor?this.uploadWrapper=null:(t.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),t.detach(this.uploadWrapper)),this.uploadWrapper=null,e.prototype.destroy.call(this))},s.prototype.upload=function(e,i){var s=this;if(e=e||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||i))this.sequenceUpload(e);else{var n=this.getFilesInArray(e),a={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",a,function(e){e.cancel||(t.isBlazor()&&(s.currentRequestHeader=e.currentRequest?e.currentRequest:s.currentRequestHeader,s.customFormDatas=e.customFormData&&e.customFormData.length>0?e.customFormData:s.customFormDatas),s.uploadFiles(n,i))})}},s.prototype.getFilesInArray=function(e){var t=[];return e instanceof Array?t=e:t.push(e),t},s.prototype.serverReadFileBase64=function(e,t,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[e].rawFile;try{var l=new FileReader;l.onload=function(e){return function(){try{var t=e.result,i=t?t.split(";base64,")[1]:null;n(i)}catch(e){a(e)}}}(l),l.readAsDataURL(r.slice(t,t+i))}catch(e){a(e)}})},s.prototype.uploadFileCount=function(e){var t=this.filesData;return t&&0!==t.length?t.length:-1},s.prototype.getFileRead=function(e,t){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[e],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.getFileInfo=function(e,t){var i=this.filesData;return i&&0!==i.length&&i[e]?this.filesData[e]:null},s.prototype.uploadFiles=function(e,i){var s=this,n=[];if(""===this.asyncSettings.saveUrl||t.isNullOrUndefined(this.asyncSettings.saveUrl))return void(this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("GetFileDetails",e));if(!i||t.isNullOrUndefined(i))if(this.multiple)n=this.filterfileList(e);else{var a=[];a.push(e[0]),n=this.filterfileList(a)}else n=e;for(var r=this,l=0;l<n.length;l++)!function(e){r.isServerBlazor&&!r.checkChunkUpload()?n[e]&&n[e].rawFile instanceof File&&r.getBase64(n[e].rawFile).then(function(t){s.base64String.push(t),s.uploadFilesRequest(n,e,i)}):r.uploadFilesRequest(n,e,i)}(l)},s.prototype.uploadFilesRequest=function(e,i,s){var n=this,a=[],r=this.checkChunkUpload(),l=new t.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);l.emitError=!1;var o;this.isServerBlazor&&(o=e.slice(0),a.push(o[i].rawFile));var h={fileData:this.isServerBlazor?o[i]:e[i],customFormData:[],cancel:!1},d=new FormData;if(l.beforeSend=function(s){h.currentRequest=l.httpRequest,t.isBlazor()&&(h.fileData.rawFile=r?h.fileData.rawFile:n.base64String[i],n.currentRequestHeader&&n.updateCustomheader(l.httpRequest,n.currentRequestHeader),n.customFormDatas&&n.updateFormData(d,n.customFormDatas)),n.trigger("uploading",h,function(t){n.isServerBlazor&&!r&&(e[i].rawFile=t.fileData.rawFile=a[i]),t.cancel&&n.eventCancelByArgs(s,t,e[i]),n.updateFormData(d,t.customFormData)})},"1"===e[i].statusCode){var u=this.element.getAttribute("name");d.append(u,e[i].rawFile,e[i].name),r&&e[i].size>this.asyncSettings.chunkSize?this.chunkUpload(e[i],s,i):(l.onLoad=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadComplete(t,e[i],s),{})},l.onUploadProgress=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadInProgress(t,e[i],s,l),{})},l.onError=function(t){return n.uploadFailed(t,e[i]),{}},l.send(d))}},s.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),s=+t.getAttribute("data-files-count"),n=0,a=0;a<e;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1;r>=n;r--)i.splice(r,1)},s.prototype.remove=function(e,i,s,n,a){var r=this;t.isNullOrUndefined(n)&&(n=!0);var l={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null},o={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",o,function(n){if(!n.cancel)if(t.isBlazor()&&(r.currentRequestHeader=n.currentRequest,r.customFormDatas=n.customFormData),r.isFormUpload()&&!r.isBlazorSaveUrl)l.filesData=e,r.trigger("removing",l,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,l=r.getFilesInArray(e);a<l.length;a++){var o=l[a];if(s||(n=r.fileList.indexOf(o.list)),n>-1){var h=t.isNullOrUndefined(o.input)?null:o.input;h&&t.detach(h),r.spliceFiles(n),t.detach(r.fileList[n]),r.fileList.splice(n,1),s=!0,n=-1}}});else if(!r.isForm||!t.isNullOrUndefined(r.asyncSettings.removeUrl)&&""!==r.asyncSettings.removeUrl||r.isBlazorSaveUrl){var o=[];(e=t.isNullOrUndefined(e)?r.filesData:e)instanceof Array?o=e:o.push(e),l.filesData=o;for(var h=r.asyncSettings.removeUrl,d=""!==h&&!t.isNullOrUndefined(h),u=0,c=o;u<c.length;u++)!function(e){var t=r.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&d?r.removeUploadedFile(e,l,s,i):s?r.removeFilesData(e,i):r.trigger("removing",l,function(t){t.cancel||r.removeFilesData(e,i)}),a&&!a.target.classList.contains(Le)&&r.checkActionComplete(!1)}(c[u])}else l.filesData=r.getFilesData(),r.trigger("removing",l,function(e){e.cancel||r.clearAll()})})},s.prototype.clearAll=function(){var e=this;if(t.isNullOrUndefined(this.listParent)&&!this.isBlazorSaveUrl&&!this.isBlazorTemplate)return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var i={cancel:!1,filesData:this.filesData};this.trigger("clearing",i,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)})},s.prototype.getFilesData=function(e){if(this.isServerBlazor){for(var i=0;i<this.filesData.length;i++)this.filesData[i].rawFile=this.base64String[i];return this.filesData}return t.isNullOrUndefined(e)?this.filesData:this.getSelectedFiles(e)},s.prototype.pause=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.pauseUploading(i,t)},s.prototype.pauseUploading=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.getFiles=function(e){var i=[];return t.isNullOrUndefined(e)||e instanceof Array?i=e:i.push(e),i},s.prototype.resume=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.resumeFiles(i,t)},s.prototype.resumeFiles=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.retry=function(e,t,i){e=e||this.filesData;var s=this.getFilesInArray(e);this.retryFailedFiles(s,t,i)},s.prototype.retryFailedFiles=function(e,t,i){for(var s=this.getFiles(e),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0)this.retryUpload(this.getCurrentMetaData(s[n],null),t);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},s.prototype.cancel=function(e){e=e||this.filesData;var t=this.getFilesInArray(e);this.cancelUpload(t)},s.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(this.asyncSettings.chunkSize>0){for(s=0;s<t.length;s++)if("3"===t[s].statusCode){var i=this.getCurrentMetaData(t[s],null);i.file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(t[s])}}else for(var s=0;s<t.length;s++)"3"===t[s].statusCode&&(t[s].statusCode="5",t[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(t[s]))},s.prototype.showHideUploadSpinner=function(e){var s=this.getLiElement(e);if(!t.isNullOrUndefined(s)&&t.isNullOrUndefined(this.template)){var n=s.querySelector("."+Ae);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},xe([t.Complex({saveUrl:"",removeUrl:""},Ie)],s.prototype,"asyncSettings",void 0),xe([t.Property(!1)],s.prototype,"sequentialUpload",void 0),xe([t.Property({})],s.prototype,"htmlAttributes",void 0),xe([t.Property("")],s.prototype,"cssClass",void 0),xe([t.Property(!0)],s.prototype,"enabled",void 0),xe([t.Property(null)],s.prototype,"template",void 0),xe([t.Property(!0)],s.prototype,"multiple",void 0),xe([t.Property(!0)],s.prototype,"autoUpload",void 0),xe([t.Complex({},De)],s.prototype,"buttons",void 0),xe([t.Property("")],s.prototype,"allowedExtensions",void 0),xe([t.Property(0)],s.prototype,"minFileSize",void 0),xe([t.Property(3e7)],s.prototype,"maxFileSize",void 0),xe([t.Property(null)],s.prototype,"dropArea",void 0),xe([t.Collection([{}],Me)],s.prototype,"files",void 0),xe([t.Property(!0)],s.prototype,"showFileList",void 0),xe([t.Property(!1)],s.prototype,"directoryUpload",void 0),xe([t.Property("Default")],s.prototype,"dropEffect",void 0),xe([t.Event()],s.prototype,"created",void 0),xe([t.Event()],s.prototype,"actionComplete",void 0),xe([t.Event()],s.prototype,"rendering",void 0),xe([t.Event()],s.prototype,"beforeUpload",void 0),xe([t.Event()],s.prototype,"fileListRendering",void 0),xe([t.Event()],s.prototype,"selected",void 0),xe([t.Event()],s.prototype,"uploading",void 0),xe([t.Event()],s.prototype,"success",void 0),xe([t.Event()],s.prototype,"failure",void 0),xe([t.Event()],s.prototype,"removing",void 0),xe([t.Event()],s.prototype,"beforeRemove",void 0),xe([t.Event()],s.prototype,"clearing",void 0),xe([t.Event()],s.prototype,"progress",void 0),xe([t.Event()],s.prototype,"change",void 0),xe([t.Event()],s.prototype,"chunkSuccess",void 0),xe([t.Event()],s.prototype,"chunkFailure",void 0),xe([t.Event()],s.prototype,"chunkUploading",void 0),xe([t.Event()],s.prototype,"canceling",void 0),xe([t.Event()],s.prototype,"pausing",void 0),xe([t.Event()],s.prototype,"resuming",void 0),s=xe([t.NotifyPropertyChanges],s)}(t.Component),qe=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)}}(),We=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},je="e-switch-ctrl-btn",_e="e-hide-hex-value",Xe="e-hide-switchable-value",Ke="e-hide-value",Ze="e-hsv-color",Ye="e-selected-value",Ge="e-mode-switch-btn",$e="e-nocolor-item",Je="e-opacity-value",Qe="e-preview-container",et="e-show-value",tt="e-selected",it="e-tile",st={default:["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"]},nt=function(n){function a(e,t){return n.call(this,e,t)||this}return qe(a,n),a.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var i={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"};this.l10n=new t.L10n("colorpicker",i,this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||t.addClass([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},a.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),t.attributes(this.element,{tabindex:"-1",spellcheck:"false"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var i=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(i="");var s=i.slice(0,7);t.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.tileRipple=t.rippleEffect(this.container,{selector:"."+it}),this.ctrlBtnRipple=t.rippleEffect(this.container,{selector:".e-btn"})},a.prototype.getWrapper=function(){return this.element.parentElement},a.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),t.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var e=this,n=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(n),this.splitBtn=new s.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,open:this.onOpen.bind(this),click:function(){e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n);var a=this.createElement("span",{className:"e-split-preview"});t.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var r=this.getPopupEle();if(t.addClass([r],"e-colorpicker-popup"),this.cssClass&&t.addClass([r],this.cssClass.split(" ")),t.Browser.isDevice){var l=this.getPopupInst();l.relateTo=document.body,l.position={X:"center",Y:"center"},l.targetType="container",l.collision={X:"fit",Y:"fit"},l.offsetY=4,r.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){this.trigger("open",{element:this.container})},a.prototype.getPopupInst=function(){return t.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var e=this;this.splitBtn.beforeOpen=function(i){var n=new s.Deferred;return e.trigger("beforeOpen",i,function(s){if(!s.cancel){var a=e.getPopupEle();a.style.top=t.formatUnit(0+pageYOffset),a.style.left=t.formatUnit(0+pageXOffset),a.style.display="block",e.createWidget(),a.style.display="",t.Browser.isDevice&&(e.modal=e.createElement("div"),e.modal.className="e-"+e.getModuleName()+" e-modal",e.modal.style.display="none",document.body.insertBefore(e.modal,a),document.body.className+=" e-colorpicker-overflow",e.modal.style.display="block",e.modal.style.zIndex=(Number(a.style.zIndex)-1).toString())}i.cancel=s.cancel,n.resolve(s)}),n},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(t.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:e.container,event:i.event,cancel:!1};e.trigger("beforeClose",a,function(s){t.Browser.isDevice&&i.event.target===e.modal&&(s.cancel=!0),s.cancel||e.onPopupClose(),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",t.select(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",t.removeClass([this.container],["e-color-picker","e-color-palette"]),t.Browser.isDevice&&this.modal&&(t.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(t.classList(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"});this.appendElement(e);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],e);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],e);t.selectAll(".e-row",e).length>10&&t.addClass([e],"e-palette-group")}else this.appendPalette(st.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=t.formatUnit(this.container.children[0].offsetWidth+a+a),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},a.prototype.firstPaletteFocus=function(){t.select("."+tt,this.container.children[0])||t.selectAll(".e-palette",this.container)[0].focus()},a.prototype.appendPalette=function(e,t,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=e.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"presentation"}}),s.appendChild(n)),r=this.roundValue(e[l]).toLowerCase(),a=this.createElement("span",{className:it,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:t,value:e[l]}),n.appendChild(a),this.value===r&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},a.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add($e),this.value||(e.classList.add(tt),t.closest(e,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},a.prototype.appendElement=function(e,t){void 0===t&&(t=0);var i=this.container.children[t];i?this.container.insertBefore(e,i):this.container.appendChild(e)},a.prototype.addTileSelection=function(e){e.classList.add(tt),e.setAttribute("aria-selected","true")},a.prototype.createPicker=function(){t.classList(this.container,["e-color-picker"],["e-color-palette"]);var e=this.createElement("div",{className:"e-hsv-container"});this.appendElement(e),e.appendChild(this.createElement("div",{className:Ze}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});e.appendChild(i),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},a.prototype.setHsvContainerBg=function(e){void 0===e&&(e=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(e,100,100,1))},a.prototype.getHsvContainer=function(){return t.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var e=this.getDragHandler(),i=t.select("."+Ze,this.container);this.enableRtl?e.style.left=t.formatUnit(i.offsetWidth*Math.abs(100-this.hsv[1])/100):e.style.left=t.formatUnit(i.offsetWidth*this.hsv[1]/100),e.style.top=t.formatUnit(i.offsetHeight*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var e=this.createElement("div",{className:"e-slider-preview"});this.appendElement(e,1),this.createPreview(e);var t=this.createElement("div",{className:"e-colorpicker-slider"});e.insertBefore(t,e.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});t.appendChild(i),this.hueSlider=new be({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),t.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(e){this.opacitySlider=new be({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(e);var t=this.createElement("div",{className:"e-opacity-empty-track"});e.appendChild(t),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var e=this.enableRtl?"to left":"to right",i=t.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+e+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(e){this.hsv[0]=e.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(e){var t=e.value,i=this.rgbToHex(this.rgb);this.hsv[3]=t/100,this.rgb[3]=t/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(t);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(e){if(this.enableOpacity&&!this.getWrapper().classList.contains(Ke)){var i=t.getInstance(t.select("."+Je,this.container),Q);i.value=e,i.dataBind()}},a.prototype.createPreview=function(e){var t=this.createElement("div",{className:Qe});e.appendChild(t);var i=this.createElement("span",{className:"e-preview e-current"});t.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),t.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(e,t,i,s){var n=this,a=new Q({value:t,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(e){e.event&&n.inputHandler(e.event)}});a.createElement=this.createElement,a.appendTo(e)},a.prototype.createInput=function(){var t=this.isPicker(),i=this.getWrapper();if(t&&!i.classList.contains(Ke)||!t&&i.classList.contains(et)){var s=this.createElement("div",{className:Ye});t?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(s),!i.classList.contains(_e)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false"}});n.appendChild(a),e.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),e.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(Xe)){var r=void 0,l=void 0;this.isRgb?(r="RGB",l=this.rgb):(r="HSV",l=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(n.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),l[h],r[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(e){this.createNumericInput(e.appendChild(this.createElement("input",{className:Je})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(e){var t=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn"});e.appendChild(t),this.isPicker()&&!this.getWrapper().classList.contains(Xe)&&t.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var e=this.createElement("div",{className:je});if(this.container.appendChild(e),this.showButtons){var t=this.createElement("div",{className:"e-ctrl-btn"});e.appendChild(t);var i=this.l10n.getConstant("Apply");t.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small e-apply",attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");t.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},a.prototype.appendModeSwitchBtn=function(){var e=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Ge,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});t.select("."+je,this.container).insertBefore(e,t.select(".e-ctrl-btn",this.container))},a.prototype.createDragTooltip=function(){var e=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});s.createElement=this.createElement,s.appendTo(this.container),s.open(this.container),this.tooltipEle.style.zIndex=i.getZindexPartial(this.tooltipEle).toString(),t.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return t.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(e){this.getTooltipInst().offsetY=e},a.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(t.selectAll(".e-btn",this.container)).forEach(function(i){e?t.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},a.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},a.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},a.prototype.convertToOtherFormat=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,t,s,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains(Ke)||(s.classList.contains(_e)||e.Input.setValue(i.substr(0,7),t.select(".e-hex",this.container)),s.classList.contains(Xe)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),t.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,t.select("."+Qe+" .e-current",this.container).style.backgroundColor=e,t.select("."+Qe+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return t.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(t.selectAll("."+tt,this.container.children[0])).forEach(function(e){e.classList.remove(tt),e.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(e){return e.slice(e.indexOf("(")+1,e.indexOf(")")).split(",").map(function(e,t){return 3!==t?parseInt(e,10):parseFloat(e)})},a.prototype.getValue=function(e,t){if(e||(e=this.value),t=t?t.toLowerCase():"hex","r"===e[0]){i=this.convertRgbToNumberArray(e);if("hex"===t||"hexa"===t){s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===e[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e));if("rgba"===t)return this.convertToRgbString(i);if("hex"===t||"hexa"===t){var s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"}e=this.roundValue(e);var n=this.hexToRgb(e);return"rgb"!==t&&"hsv"!==t||(n=n.slice(0,3)),"rgba"===t||"rgb"===t?this.convertToRgbString(n):"hsva"===t||"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===t?e.slice(0,7):"a"===t?n[3].toString():"null"},a.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},a.prototype.getModuleName=function(){return"colorpicker"},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.wireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.add(e,"keydown",this.pickerKeyDown,this),t.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),t.EventHandler.add(t.select(".e-previous",this.container),"click",this.previewHandler,this)}else t.EventHandler.add(this.container,"click",this.paletteClickHandler,this),t.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,t.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var e=t.select("."+je,this.container);e&&t.EventHandler.add(e,"click",this.btnClickHandler,this)},a.prototype.pickerKeyDown=function(e){switch(e.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,e);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,e);break;case 38:this.handlerDragPosition(2,1,e);break;case 40:this.handlerDragPosition(2,-1,e);break;case 13:e.preventDefault();var t=this.rgbToHex(this.rgb);this.enterKeyHandler(t,e)}},a.prototype.enterKeyHandler=function(e,t){this.triggerChangeEvent(e),this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.closePopup=function(e){var t=this,i={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",i,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},a.prototype.triggerChangeEvent=function(e){var t=e.slice(0,7);this.trigger("change",{currentValue:{hex:t,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:t}),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:t},!0),this.element.value=t||"#000000"},a.prototype.handlerDragPosition=function(e,t,i){i.preventDefault(),this.hsv[e]+=t*(i.ctrlKey?1:3),this.hsv[e]<0&&(this.hsv[e]=0),this.updateHsv(),this.convertToOtherFormat(!0)},a.prototype.handlerDown=function(e){e.preventDefault(),"mousedown"===e.type?(this.clientX=Math.abs(e.pageX-pageXOffset),this.clientY=Math.abs(e.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(e.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(e.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(),this.getDragHandler().focus(),t.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),t.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault();var i,s;"mousemove"===e.type?(i=Math.abs(e.pageX-pageXOffset),s=Math.abs(e.pageY-pageYOffset)):(i=Math.abs(e.changedTouches[0].pageX-pageXOffset),s=Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(t.select("."+Ze,this.container).style.cursor="pointer",n.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",n.classList.add("e-hide-handler"))},a.prototype.setHsv=function(e,i){var s=t.select("."+Ze,this.container),n=s.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,i=i>n.top?Math.abs(i-n.top):0,this.hsv[2]=Math.round(10*Number(100*(s.offsetHeight-Math.max(0,Math.min(s.offsetHeight,i-s.offsetTop)))/s.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(s.offsetWidth,e-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),t.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),t.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();t.select("."+Ze,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},a.prototype.btnClickHandler=function(e){var i=e.target;t.closest(i,"."+Ge)?(e.stopPropagation(),this.switchToPalette()):(i.classList.contains("e-apply")||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,e)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),t.detach(t.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Ke)||t.remove(t.select("."+Ye,this.container)),t.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshPopupPos=function(){if(!this.inline){var e=this.getPopupEle();e.style.left=t.formatUnit(0+pageXOffset),e.style.top=t.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},a.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},a.prototype.updateValue=function(e,i,s,n){for(var a,r=["e-rh-value","e-gs-value","e-bv-value"],l=0,o=r.length;l<o;l++)(a=t.getInstance(t.select("."+r[l],this.container),Q)).value=Math.round(e[l]),i&&(a.placeholder=r[l].substr(s,1).toUpperCase(),a.max=n?n[l]:255),a.dataBind()},a.prototype.previewHandler=function(e){var i=e.target,s=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(i.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var n=this.rgbToHex(this.rgb),a=this.rgbToHsv.apply(this,this.rgb);a[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:a[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(a[0]),this.enableOpacity&&a[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*a[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=a,this.setHandlerPosition(),this.updateInput(n),t.select("."+Qe+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb))},a.prototype.paletteClickHandler=function(e){e.preventDefault();var i=e.target;if(i.classList.contains(it)){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains($e))this.noColorTile();else{var s=i.getAttribute("aria-label"),n=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(s)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(et)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(e)}else t.closest(i,"."+Ge)?this.switchToPicker():i.classList.contains("e-apply")||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,e):this.getWrapper().classList.contains(et)&&t.closest(i,".e-value-switch-btn")&&this.formatSwitchHandler()},a.prototype.noColorTile=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",t,"",e)},a.prototype.switchToPicker=function(){var e=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(t.selectAll(".e-palette",this.container)).forEach(function(e){t.detach(e)}),e.classList.contains(et)&&t.detach(t.select("."+Ye,this.container)),this.container.style.width="";var i=t.select(".e-custom-palette",this.container);this.presetColors&&t.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(e,t){if(e.classList.contains("e-apply")){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.paletteKeyDown=function(e){var i=e.target;if(i.classList.contains("e-palette")){var s,n,a=[].slice.call(t.selectAll("."+it,i)),r=a.filter(function(e){return e.classList.contains("e-selected")}).pop();switch(!e.altKey&&e.keyCode){case 39:e.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:e.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:e.preventDefault(),s=a[n=r?this.tilePosition(a,r,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:e.preventDefault(),a[n=r?this.tilePosition(a,r,this.columns):a.length-1]?s=a[n]:(n%=a.length,s=a[n+=a[a.length-1].parentElement.childElementCount]),this.keySelectionChanges(s);break;case 13:if(e.preventDefault(),r){var l=r.getAttribute("aria-label");this.enterKeyHandler(l||"",e)}}}},a.prototype.keySelectionChanges=function(e){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains($e))this.noColorTile(!0);else{var t=e.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(et)&&this.updateInput(t),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(e,t,i){var s=(e=Array.prototype.slice.call(e)).length,n=this.columns-e[s-1].parentElement.childElementCount,a=e.indexOf(t);return a+=i,a<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(e){var i=e.target;if(i.value.length){var s,n;switch(t.select(".e-float-text",i.parentElement).textContent){case"HEX":var a="";if(("#"===i.value[0]&&5!==i.value.length||"#"!==i.value[0]&&4!==i.value.length)&&(a=this.roundValue(i.value)),9!==a.length)return;n=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(a+a.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),n,i.value);break;case"R":this.rgb[0]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[0]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"G":this.rgb[1]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[1]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"B":this.rgb[2]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[2]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"H":this.hueSlider.value=Number(i.value);break;case"S":this.hsv[1]!==Number(i.value)&&(this.hsv[1]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(e,t,i){e[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:e[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(e[0])),this.hsv=e;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,t,n)},a.prototype.triggerEvent=function(e,t,i,s){void 0===s&&(s=!1);var n=e.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:t.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(t))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:e}),this.setProperties({value:e},!0),this.element.value=n||"#000000")},a.prototype.destroy=function(){var e=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&t.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),t.detach(i)),this.container=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var e=this.getTooltipInst();e.close(),e.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.remove(e,"keydown",this.pickerKeyDown),t.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&t.EventHandler.remove(t.select("."+je,this.container),"click",this.btnClickHandler),t.EventHandler.remove(t.select(".e-previous",this.container),"click",this.previewHandler)}else t.EventHandler.remove(this.container,"click",this.paletteClickHandler),t.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(e){if(!e)return"";"#"!==e[0]&&(e="#"+e);var t=e.length;if(4===t&&(e+="f",t=5),5===t){for(var i="",s=1,n=e.length;s<n;s++)i+=e.charAt(s)+e.charAt(s);e="#"+i,t=9}return 7===t&&(e+="ff"),e},a.prototype.hexToRgb=function(e){if(!e)return[];9!==(e=e.trim()).length&&(e=this.roundValue(e));var t=Number((parseInt(e.slice(-2),16)/255).toFixed(2));e=e.slice(1,7);var i=parseInt(e,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(t),s},a.prototype.rgbToHsv=function(e,i,s,n){if(this.rgb&&!this.rgb.length)return[];e/=255,i/=255,s/=255;var a,r=Math.max(e,i,s),l=Math.min(e,i,s),o=r,h=r-l,d=0===r?0:h/r;if(r===l)a=0;else{switch(r){case e:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-e)/h+2;break;case s:a=(e-i)/h+4}a/=6}var u=[Math.round(360*a),Math.round(1e3*d)/10,Math.round(1e3*o)/10];return t.isNullOrUndefined(n)||u.push(n),u},a.prototype.hsvToRgb=function(e,i,s,n){var a,r,l;if(i/=100,s/=100,0===i)return a=r=l=s,[Math.round(255*a),Math.round(255*r),Math.round(255*l),n];e/=60;var o=Math.floor(e),h=e-o,d=s*(1-i),u=s*(1-i*h),c=s*(1-i*(1-h));switch(o){case 0:a=s,r=c,l=d;break;case 1:a=u,r=s,l=d;break;case 2:a=d,r=s,l=c;break;case 3:a=d,r=u,l=s;break;case 4:a=c,r=d,l=s;break;default:a=s,r=d,l=u}var p=[Math.round(255*a),Math.round(255*r),Math.round(255*l)];return t.isNullOrUndefined(n)||p.push(n),p},a.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(t.isNullOrUndefined(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(e){var i=t.select("."+je,this.container);e?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?t.detach(t.select("."+Ge,i)):t.remove(i))},a.prototype.changeShowBtnProps=function(e){var i=t.select("."+je,this.container);e?(i&&t.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?t.detach(t.select(".e-ctrl-btn",i)):t.remove(i)},a.prototype.changeValueProp=function(e){if(this.isPicker())this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),t.detach(t.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(e),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(e)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){t.remove(t.select("."+Ye,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(e){this.isPicker()&&(this.hueSlider.enabled=!e,this.opacitySlider.enabled=!e,this.setInputEleProps()),e?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(e,i){var s=this.getWrapper(),n=this.getPopupEle();i&&t.removeClass([s,n],i.split(" ")),e&&t.addClass([s,n],e.split(" "))},a.prototype.changeRtlProps=function(e){e?t.addClass([this.getWrapper()],"e-rtl"):t.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){t.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(e){var i=this.getWrapper();e?(t.removeClass([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(t.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains(Ke)||i.classList.contains(Xe)||this.appendOpacityValue(t.select(".e-input-container",this.container))):(t.addClass([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),t.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains(Ke)||i.classList.contains(Xe)||t.remove(t.select("."+Je,this.container).parentElement))},a.prototype.onPropertyChanged=function(e,i){var n=this;if(!t.isNullOrUndefined(e.value)){var a=this.roundValue(e.value);if(9===a.length){this.element.value=this.roundValue(a).slice(0,7);var r=this.splitBtn&&t.select(".e-split-preview",this.splitBtn.element);r&&(r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(e.value)))}else this.value=i.value}if(!this.inline&&t.isNullOrUndefined(e.inline)){var l=["disabled","enableRtl"];if(this.splitBtn.setProperties(s.getModel(e,l)),!this.isPopupOpen())return this.changeCssClassProps(e.cssClass,i.cssClass),void this.changeRtlProps(e.enableRtl)}for(var o=this,h=0,d=Object.keys(e);h<d.length;h++)!function(s){switch(s){case"inline":e.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),t.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(e.cssClass,i.cssClass);var a=e.cssClass.split(" ").concat(i.cssClass.split(" ")),r=0;(a=a.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[])).forEach(function(e){0!==r||e!==Ke&&"e-hide-valueswitcher"!==e&&e!==et&&e!==_e&&e!==Xe||(t.select("."+Ye,n.container)&&t.remove(t.select("."+Ye,n.container)),n.createInput(),r++)});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=e.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=e.enableRtl),o.setInputEleProps()),o.changeRtlProps(e.enableRtl);break;case"disabled":o.changeDisabledProp(e.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(e.value);break;case"showButtons":o.changeShowBtnProps(e.showButtons);break;case"mode":"Picker"===e.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(e.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":e.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(e.enableOpacity)}}(d[h])},a.prototype.focusIn=function(){this.element.parentElement.focus()},We([t.Property("#008000ff")],a.prototype,"value",void 0),We([t.Property("")],a.prototype,"cssClass",void 0),We([t.Property(!1)],a.prototype,"disabled",void 0),We([t.Property("Picker")],a.prototype,"mode",void 0),We([t.Property(!0)],a.prototype,"modeSwitcher",void 0),We([t.Property(null)],a.prototype,"presetColors",void 0),We([t.Property(!0)],a.prototype,"showButtons",void 0),We([t.Property(10)],a.prototype,"columns",void 0),We([t.Property(!1)],a.prototype,"inline",void 0),We([t.Property(!1)],a.prototype,"noColor",void 0),We([t.Property(!1)],a.prototype,"enablePersistence",void 0),We([t.Property(!0)],a.prototype,"enableOpacity",void 0),We([t.Event()],a.prototype,"select",void 0),We([t.Event()],a.prototype,"change",void 0),We([t.Event()],a.prototype,"beforeTileRender",void 0),We([t.Event()],a.prototype,"beforeOpen",void 0),We([t.Event()],a.prototype,"open",void 0),We([t.Event()],a.prototype,"beforeClose",void 0),We([t.Event()],a.prototype,"beforeModeSwitch",void 0),We([t.Event()],a.prototype,"onModeSwitch",void 0),We([t.Event()],a.prototype,"created",void 0),a=We([t.NotifyPropertyChanges],a)}(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)}}(),rt=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},lt=["title","style","class"],ot=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return at(s,i),s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++)switch(a[n]){case"floatLabelType":e.Input.removeFloating(this.textboxWrapper),e.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":e.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(t.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&t.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),e.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":e.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),e.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":"TEXTAREA"!==this.respectiveElement.tagName&&(e.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent());break;case"enableRtl":e.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":e.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.preRender=function(){if(!t.isBlazor()||!this.isServerRendered){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=t.closest(this.element,"form"),t.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var e=t.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input");for(a=0;a<this.element.attributes.length;a++)"id"!==(r=this.element.attributes[a].nodeName)&&(i.setAttribute(r,this.element.attributes[a].nodeValue),i.innerHTML=this.element.innerHTML,"name"===r&&this.element.removeAttribute("name"));this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),this.element.setAttribute("role","textbox"),this.globalize=new t.Internationalization(this.locale);var s={placeholder:this.placeholder};if(this.l10n=new t.L10n("textbox",s,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",t.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",t.getUniqueID("textarea"));for(var n=["placeholder","disabled","value","readonly","type","autocomplete"],a=0;a<this.element.attributes.length;a++){var r=this.element.attributes[a].nodeName;this.element.hasAttribute(r)&<.indexOf(r)<0&&"id"!==r&&"type"!==r&&"e-mappinguid"!==r&&(this.textarea.setAttribute(r,this.element.attributes[a].nodeValue),n.indexOf(r)<0&&(this.element.removeAttribute(r),a--))}}}},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"autocomplete":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||e){var l="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:l},!e)}break;case"value":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"type":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||e)&&this.setProperties({type:this.element.type},!e)}}},s.prototype.render=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getInputValidClassList(this.cssClass)),t.isBlazor()&&this.isServerRendered?(this.respectiveElement=this.element,this.textboxWrapper={container:this.element.parentElement},this.showClearButton&&!this.multiline&&(this.textboxWrapper.clearButton=this.textboxWrapper.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.respectiveElement,this.textboxWrapper.clearButton,this.textboxWrapper.container)),"Auto"===this.floatLabelType&&e.Input.wireFloatingEvents(this.respectiveElement),e.Input.bindInitialEvent({element:this.respectiveElement,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=e.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement)),this.wireEvents(),t.isNullOrUndefined(this.value)||(e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),t.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,e.Input.setWidth(this.width,this.textboxWrapper.container),this.renderComplete()},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(lt.indexOf(s)>-1)if("class"===s){var n=this.getInputValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.textboxWrapper.container],n.split(" "))}else if("style"===s){var a=this.textboxWrapper.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.textboxWrapper.container.setAttribute(s,a)}else this.textboxWrapper.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];lt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(i))},s.prototype.getInputValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){t.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),t.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),t.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),t.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&t.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},s.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(e.classList.add("e-label-top"),e.classList.contains("e-label-bottom")&&e.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=e,this.isProtectedOnChange=t},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!t.isNullOrUndefined(this.textboxWrapper)){var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.initialValue)||""===this.initialValue?(e.classList.add("e-label-bottom"),e.classList.remove("e-label-top")):""!==this.initialValue&&(e.classList.add("e-label-top"),e.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(e){var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("focus",t)},s.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.respectiveElement.value||this.raiseChangeEvent(e,!0);var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("blur",t)},s.prototype.inputHandler=function(e){var t=this,i={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(t.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),e.stopPropagation()},s.prototype.changeHandler=function(e){this.setProperties({value:this.respectiveElement.value},!0),this.raiseChangeEvent(e,!0),e.stopPropagation()},s.prototype.raiseChangeEvent=function(e,t){var i={event:e,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.bindClearEvent=function(){this.showClearButton&&"TEXTAREA"!==this.respectiveElement.tagName&&(this.enabled?t.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):t.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")){e.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.trigger("input",i),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0)}},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),t.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),t.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),t.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&t.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),t.isBlazor()&&this.isServerRendered?this.textboxWrapper=null:("INPUT"===this.element.tagName&&this.multiline&&(t.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-placeholder","aria-disabled","aria-readonly","aria-labelledby"]),t.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),t.detach(this.textboxWrapper.container)),this.textboxWrapper=null,i.prototype.destroy.call(this))},s.prototype.addIcon=function(t,i){e.Input.addIcon(t,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.addAttributes=function(t){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(t[n]):"placeholder"===n?(this.setProperties({placeholder:t[n]},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,t[n]))}},s.prototype.removeAttributes=function(t){for(var i=0,s=t;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.addClass([this.textboxWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.removeClass([this.textboxWrapper.container],["e-input-focus"]))},rt([t.Property("text")],s.prototype,"type",void 0),rt([t.Property(!1)],s.prototype,"readonly",void 0),rt([t.Property(null)],s.prototype,"value",void 0),rt([t.Property("Never")],s.prototype,"floatLabelType",void 0),rt([t.Property("")],s.prototype,"cssClass",void 0),rt([t.Property(null)],s.prototype,"placeholder",void 0),rt([t.Property("on")],s.prototype,"autocomplete",void 0),rt([t.Property({})],s.prototype,"htmlAttributes",void 0),rt([t.Property(!1)],s.prototype,"multiline",void 0),rt([t.Property(!0)],s.prototype,"enabled",void 0),rt([t.Property(!1)],s.prototype,"showClearButton",void 0),rt([t.Property(!1)],s.prototype,"enablePersistence",void 0),rt([t.Property(null)],s.prototype,"width",void 0),rt([t.Event()],s.prototype,"created",void 0),rt([t.Event()],s.prototype,"destroyed",void 0),rt([t.Event()],s.prototype,"change",void 0),rt([t.Event()],s.prototype,"blur",void 0),rt([t.Event()],s.prototype,"focus",void 0),rt([t.Event()],s.prototype,"input",void 0),s=rt([t.NotifyPropertyChanges],s)}(t.Component);return e.NumericTextBox=Q,e.regularExpressions=re,e.createMask=n,e.applyMask=a,e.wireEvents=r,e.unwireEvents=l,e.bindClearEvent=o,e.unstrippedValue=c,e.strippedValue=p,e.maskInputMouseDownHandler=v,e.maskInputMouseUpHandler=f,e.maskInputFocusHandler=g,e.triggerFocus=y,e.maskInputBlurHandler=b,e.maskInputDropHandler=S,e.mobileRemoveFunction=x,e.setMaskValue=D,e.setElementValue=I,e.maskInput=z,e.getVal=W,e.getMaskedVal=j,e.MaskUndo=le,e.MaskedTextBox=ue,e.TicksData=me,e.ColorRangeData=ve,e.LimitData=fe,e.TooltipData=ge,e.Slider=be,e.regex=Se,e.FormValidator=Te,e.FilesProp=Me,e.ButtonsProps=De,e.AsyncSettings=Ie,e.Uploader=ze,e.ColorPicker=nt,e.TextBox=ot,e}({},ej.base,ej.popups,ej.splitbuttons),this.ejs=ej;
- /*!
- * filename: ej2-lists.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.lists=function(e,t,i,s){"use strict";function n(e,i){var s={};if(t.isNullOrUndefined(e)||"string"==typeof e||"number"==typeof e||!t.isNullOrUndefined(e.isHeader))return e;for(var n=0,l=Object.keys(i);n<l.length;n++){var r=i[l[n]],a=t.isNullOrUndefined(r)||"string"!=typeof r?void 0:t.getValue(r,e);t.isNullOrUndefined(a)||(s[r]=a)}return s}function l(e,i,s,n){var l=[];if(i||(i=e),s&&s.length?s.forEach(function(t){l.push(e.children[t])}):l=[].slice.call(e.children),t.isNullOrUndefined(n))l.forEach(function(e){i.appendChild(e)});else{var r=i.children[n];l.forEach(function(e){i.insertBefore(e,r)})}}e.cssClass={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"},function(s){function l(e,i,s,n,l){var a=t.extend({},D,s),o=t.extend({},k,a.ariaAttributes),h=v(i).typeof;return"string"===h||"number"===h?r(e,i,n,s,l):c(e,i,s,o.level,n,l)}function r(e,t,i,s,n){return E(e,a(e,t,i,s,n),null,s)}function a(i,s,n,l,r){var a=[],o=t.extend({},D,l);e.cssClass=L(o.moduleName);for(var c=w(),h=0;h<s.length;h++)if(!t.isNullOrUndefined(s[h])){var d=void 0;if(o.itemCreating&&"function"==typeof o.itemCreating){u={dataSource:s,curData:s[h],text:s[h],options:o};o.itemCreating(u)}if(d=n?x(i,s[h],void 0,null,null,[],null,c,h,l):V(i,s[h],void 0,null,null,l,r),o.itemCreated&&"function"==typeof o.itemCreated){var u={dataSource:s,curData:s[h],text:s[h],item:d,options:o};o.itemCreated(u)}a.push(d)}return a}function o(i,l,r,a,o,c){var h=t.extend({},D,r);e.cssClass=L(h.moduleName);var d,u=t.extend({},s.defaultMappedFields,h.fields),p=t.extend({},k,h.ariaAttributes),m=[];a&&(p.level=a);var f,g,y=[];l&&l.length&&!t.isNullOrUndefined(v(l).item)&&!v(l).item.hasOwnProperty(u.id)&&(d=w());for(var b=0;b<l.length;b++){var C=n(l[b],u);if(!t.isNullOrUndefined(l[b])){if(h.itemCreating&&"function"==typeof h.itemCreating){A={dataSource:l,curData:l[b],text:C[u.text],options:h,fields:u};h.itemCreating(A)}var E=l[b];h.itemCreating&&"function"==typeof h.itemCreating&&(C=n(l[b],u)),C.hasOwnProperty(u.id)&&!t.isNullOrUndefined(C[u.id])&&(d=C[u.id]);var O=[];if(h.showCheckBox&&(h.itemNavigable&&(C[u.url]||C[u.urlAttributes])?m.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})):O.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}}))),!0===o)h.showIcon&&C.hasOwnProperty(u.iconCss)&&!t.isNullOrUndefined(C[u.iconCss])&&O.push(i("span",{className:e.cssClass.icon+" "+C[u.iconCss]})),g=(f=x(i,E,C,u,h.itemClass,O,!(!E.hasOwnProperty("isHeader")||!E.isHeader),d,b,r)).querySelector("."+e.cssClass.anchorWrap),h.itemNavigable&&m.length&&t.prepend(m,f.firstElementChild);else{if((f=V(i,E,C,u,h.itemClass,r,c)).classList.add(e.cssClass.level+"-"+p.level),f.setAttribute("aria-level",p.level.toString()),g=f.querySelector("."+e.cssClass.anchorWrap),C.hasOwnProperty(u.tooltip)&&f.setAttribute("title",C[u.tooltip]),C.hasOwnProperty(u.htmlAttributes)&&C[u.htmlAttributes]&&I(f,C[u.htmlAttributes]),C.hasOwnProperty(u.enabled)&&!1===C[u.enabled]&&f.classList.add(e.cssClass.disabled),C.hasOwnProperty(u.isVisible)&&!1===C[u.isVisible]&&(f.style.display="none"),C.hasOwnProperty(u.imageUrl)&&!t.isNullOrUndefined(C[u.imageUrl])&&!h.template){var B={src:C[u.imageUrl]};t.merge(B,C[u.imageAttributes]);var T=i("img",{className:e.cssClass.image,attrs:B});g?g.insertAdjacentElement("afterbegin",T):t.prepend([T],f.firstElementChild)}if(h.showIcon&&C.hasOwnProperty(u.iconCss)&&!t.isNullOrUndefined(C[u.iconCss])&&!h.template){var H=i("div",{className:e.cssClass.icon+" "+C[u.iconCss]});g?g.insertAdjacentElement("afterbegin",H):t.prepend([H],f.firstElementChild)}O.length&&t.prepend(O,f.firstElementChild),h.itemNavigable&&m.length&&t.prepend(m,f.firstElementChild),S(i,C,u,l,h,f,p.level)}if(g&&t.addClass([f],[e.cssClass.navigable]),h.itemCreated&&"function"==typeof h.itemCreated){var A={dataSource:l,curData:l[b],text:C[u.text],item:f,options:h,fields:u};h.itemCreated(A)}m=[],y.push(f)}}return y}function c(e,i,s,n,l,r){var a=t.extend({},D,s);return E(e,o(e,i,s,n,l,r),a.listClass,s)}function h(i,s,n){if(e.cssClass=L(D.moduleName),i&&i.length){var l,r,a=Array.prototype.slice.call(i);for(l=a[(r=s?d(s,a):!0===n?a.length:-1)+(!0===n?-1:1)];l&&(!t.isVisible(l)||l.classList.contains(e.cssClass.disabled));)l=a[r+=!0===n?-1:1];return l}}function d(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function u(e,n,l){void 0===l&&(l="None");var r=t.extend({},s.defaultMappedFields,n),a=(new i.Query).group(r.groupBy),o=m(e,a=p(l,"key",a));e=[];for(var c=0;c<o.length;c++){var h=o[c].items,d={};d[r.text]=o[c].key,d.isHeader=!0;var u=r.text;"id"===u&&(d[u="text"]=o[c].key),d._id="group-list-item-"+(o[c].key?o[c].key.toString().trim():"undefined"),d.items=h,e.push(d);for(var f=0;f<h.length;f++)e.push(h[f])}return e}function p(e,t,s){if(void 0===s&&(s=new i.Query),"Ascending"===e)s.sortBy(t,"ascending",!0);else if("Descending"===e)s.sortBy(t,"descending",!0);else for(var n=0;n<s.queries.length;n++)"onSortBy"===s.queries[n].fn&&s.queries.splice(n,1);return s}function m(e,t){return new i.DataManager(e).executeLocal(t)}function f(e,i){var n=t.extend({},D,i),l=t.extend({},s.defaultMappedFields,n.fields),r=e.cloneNode(!0),a=[];r.classList.add("json-parent");var o=r.querySelectorAll(".json-parent>li");r.classList.remove("json-parent");for(var c=0;c<o.length;c++){for(var h=o[c],d=h.querySelector("a"),u=h.querySelector("ul"),p={},m=d?d.childNodes:h.childNodes,v=Object.keys(m),I=0;I<m.length;I++)m[Number(v[I])].hasChildNodes()||(p[l.text]=m[Number(v[I])].textContent);var y=g(h);y.id?(p[l.id]=y.id,delete y.id):p[l.id]=w(),Object.keys(y).length&&(p[l.htmlAttributes]=y),d&&(y=g(d),Object.keys(y).length&&(p[l.urlAttributes]=y)),u&&(p[l.child]=f(u,i)),a.push(p)}return a}function v(e){for(var i={typeof:null,item:null},s=0;s<e.length;s++)if(!t.isNullOrUndefined(e[s]))return i={typeof:typeof e[s],item:e[s]};return i}function I(e,i){var s={};t.merge(s,i),s.class&&(t.addClass([e],s.class.split(" ")),delete s.class),t.attributes(e,s)}function g(e){for(var t={},i=e.attributes,s=0;s<i.length;s++)t[i[s].nodeName]=i[s].nodeValue;return t}function y(i,l,r,a,o,c){e.cssClass=L(D.moduleName);for(var h,d=i("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),u=t.extend({},D,o),p=t.extend({},s.defaultMappedFields,a),m=t.compile(l),f=[],v=w(),I=0;I<r.length;I++){var g=n(r[I],p),y=r[I],b=y.isHeader;if(h="string"==typeof r[I]||"number"==typeof r[I]?y:g[p.value],u.itemCreating&&"function"==typeof u.itemCreating){C={dataSource:r,curData:y,text:h,options:u,fields:p};u.itemCreating(C)}u.itemCreating&&"function"==typeof u.itemCreating&&(g=n(r[I],p),h="string"==typeof r[I]||"number"==typeof r[I]?y:g[p.value]);var S=i("li",{id:v+"-"+I,className:b?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});if(b)"string"==typeof r[I]||"number"==typeof r[I]?S.innerText=y:S.innerText=g[p.text];else{var x=b?u.groupTemplateID:u.templateID;b?t.append(m(y,c,"headerTemplate",x,!!u.isStringTemplate),S):t.append(m(y,c,"template",x,!!u.isStringTemplate),S),S.setAttribute("data-value",t.isNullOrUndefined(h)?"null":h),S.setAttribute("role","option")}if(u.itemCreated&&"function"==typeof u.itemCreated){var C={dataSource:r,curData:y,text:h,item:S,options:u,fields:p};u.itemCreated(C)}f.push(S)}return t.append(f,d),d}function b(e,i,n,l,r,a){for(var o=t.compile(e),c=t.extend({},s.defaultMappedFields,n),h=t.extend({},D,r),d=c.groupBy,u=0,p=l;u<p.length;u++){var m=p[u],f={};f[d]=m.textContent,m.innerHTML="",t.append(o(f,a,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate),m)}return l}function w(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function S(i,s,n,l,r,a,o){var h=s[n.child]||[],d=s[n.hasChildren];if(h.length&&(d=!0,a.classList.add(e.cssClass.hasChild),r.processSubChild)){var u=c(i,h,r,++o);a.appendChild(u)}r.expandCollapse&&d&&!r.template&&(a.firstElementChild.classList.add(e.cssClass.iconWrapper),("Left"===r.expandIconPosition?t.prepend:t.append)([i("div",{className:"e-icons "+r.expandIconClass})],a.querySelector("."+e.cssClass.textContent)))}function x(i,s,n,l,r,a,o,c,h,d){var u,p=t.extend({},D,d),m=t.extend({},k,p.ariaAttributes),f=s,v=s;"string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s&&(u=s,f="boolean"==typeof n[l.text]||"number"==typeof n[l.text]?n[l.text]:n[l.text]||"",v=n[l.value]);var g;g=t.isNullOrUndefined(u)||t.isNullOrUndefined(n[l.id])||""===n[l.id]?c+"-"+h:c;var y=i("li",{className:(!0===o?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(r)?"":r),id:g,attrs:""!==m.groupItemRole&&""!==m.itemRole?{role:!0===o?m.groupItemRole:m.itemRole}:{}});return u&&n.hasOwnProperty(l.enabled)&&"false"===n[l.enabled].toString()&&y.classList.add(e.cssClass.disabled),o?y.innerText=f:(y.setAttribute("data-value",t.isNullOrUndefined(v)?"null":v),y.setAttribute("role","option"),u&&n.hasOwnProperty(l.htmlAttributes)&&n[l.htmlAttributes]&&I(y,n[l.htmlAttributes]),a.length&&!p.itemNavigable&&t.append(a,y),u&&(n[l.url]||n[l.urlAttributes]&&n[l.urlAttributes].href)?y.appendChild(C(i,u,l,f,a,p.itemNavigable)):(a.length&&p.itemNavigable&&t.append(a,y),y.appendChild(document.createTextNode(f)))),y}function L(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function C(i,s,l,r,a,o){var c=n(s,l),h={href:c[l.url]};c.hasOwnProperty(l.urlAttributes)&&c[l.urlAttributes]&&(t.merge(h,c[l.urlAttributes]),h.href=c[l.url]?c[l.url]:c[l.urlAttributes].href);var d;if(o){d=i("a",{className:e.cssClass.text+" "+e.cssClass.url});var u=i("div",{className:e.cssClass.anchorWrap});a&&a.length&&t.append(a,u),u.appendChild(document.createTextNode(r)),t.append([u],d)}else d=i("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:r});return I(d,h),d}function V(i,s,n,l,r,a,o){var c,h,d,u=t.extend({},D,a),p=t.extend({},k,u.ariaAttributes),m=s;"string"!=typeof s&&"number"!=typeof s&&(d=s,m=n[l.text]||"",c=t.isNullOrUndefined(n._id)?n[l.id]:n._id,h=!(!s.hasOwnProperty("isHeader")||!s.isHeader)),a&&a.enableHtmlSanitizer&&(m=m);var f=i("li",{className:(!0===h?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(r)?"":r),attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===h?p.groupItemRole:p.itemRole}:{}});!0==!t.isNullOrUndefined(c)?f.setAttribute("data-uid",c):f.setAttribute("data-uid",w());if(a&&a.removeBlazorID&&"object"==typeof s&&s.hasOwnProperty("BlazId")&&delete s.BlazId,h&&a&&a.groupTemplate){v=t.compile(a.groupTemplate);t.append(v(s,o,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),f)}else if(!h&&a&&a.template){var v=t.compile(a.template);t.append(v(s,o,"template",u.templateID,!!u.isStringTemplate),f)}else{var I=i("div",{className:e.cssClass.textContent,attrs:""!==p.wrapperRole?{role:p.wrapperRole}:{}});if(d&&(n[l.url]||n[l.urlAttributes]&&n[l.urlAttributes].href))I.appendChild(C(i,d,l,m,null,u.itemNavigable));else{var g=i("span",{className:e.cssClass.text,attrs:""!==p.itemText?{role:p.itemText}:{}});a&&a.enableHtmlSanitizer?g.innerText=m:g.innerHTML=m,I.appendChild(g)}f.appendChild(I)}return f}function E(i,s,n,l){var r=t.extend({},D,l),a=t.extend({},k,r.ariaAttributes);e.cssClass=L(r.moduleName);var o=i("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(n)?"":n),attrs:""!==a.listRole?{role:a.listRole}:{}});return t.append(s,o),o}function O(i,s,n,l){var r=t.extend({},D,l);return e.cssClass=L(r.moduleName),("Left"===r.expandIconPosition?t.prepend:t.append)([i("div",{className:"e-icons "+r.expandIconClass+" "+(t.isNullOrUndefined(n)?"":n)})],s.querySelector("."+e.cssClass.textContent)),s}s.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null};var k={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},D={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:s.defaultMappedFields,ariaAttributes:k,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};s.createList=l,s.createListFromArray=r,s.createListItemFromArray=a,s.createListItemFromJson=o,s.createListFromJson=c,s.getSiblingLI=h,s.indexOf=d,s.groupDataSource=u,s.addSorting=p,s.getDataSource=m,s.createJsonFromElement=f,s.renderContentTemplate=y,s.renderGroupTemplate=b,s.generateId=w,s.generateUL=E,s.generateIcon=O}(e.ListBase||(e.ListBase={}));var r=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)}}(),a=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},o={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},c={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},h={root:"e-listview",hover:"e-hover",selected:"e-active",focused:"e-focused",parentItem:"e-list-parent",listItem:"e-list-item",listIcon:"e-list-icon",textContent:"e-text-content",listItemText:"e-list-text",groupListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-list-header",headerText:"e-headertext",headerTemplateText:"e-headertemplate-text",text:"e-text",disable:"e-disabled",content:"e-content",icon:"e-icons",backIcon:"e-icon-back",checkboxWrapper:"e-checkbox-wrapper",checkbox:"e-checkbox",checked:"e-check",checklist:"e-checklist",checkboxIcon:"e-frame",checkboxRight:"e-checkbox-right",checkboxLeft:"e-checkbox-left",listviewCheckbox:"e-listview-checkbox",itemCheckList:"e-checklist",virtualElementContainer:"e-list-virtualcontainer"},d=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(i,e),a([t.Property("id")],i.prototype,"id",void 0),a([t.Property("text")],i.prototype,"text",void 0),a([t.Property("isChecked")],i.prototype,"isChecked",void 0),a([t.Property("isVisible")],i.prototype,"isVisible",void 0),a([t.Property("enabled")],i.prototype,"enabled",void 0),a([t.Property("iconCss")],i.prototype,"iconCss",void 0),a([t.Property("child")],i.prototype,"child",void 0),a([t.Property("tooltip")],i.prototype,"tooltip",void 0),a([t.Property("groupBy")],i.prototype,"groupBy",void 0),a([t.Property("text")],i.prototype,"sortBy",void 0),a([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),a([t.Property("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),u=function(l){function u(e,t){var i=l.call(this,e,t)||this;return i.itemReRender=!1,i.previousSelectedItems=[],i.hiddenItems=[],i.enabledItems=[],i.disabledItems=[],i}return r(u,l),u.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.enableVirtualization?this.isServerRendered&&t.isBlazor()||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?t.isBlazor()&&this.isServerRendered||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":t.isNullOrUndefined(this.contentContainer)||t.detach(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":t.isBlazor()&&this.isServerRendered||(this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox());break;case"dataSource":this.enableVirtualization?this.isServerRendered&&t.isBlazor()||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"sortOrder":case"template":this.enableVirtualization||this.isServerRendered&&t.isBlazor()||this.refresh();break;case"showIcon":t.isBlazor()&&this.isServerRendered?this.interopAdaptor.invokeMethodAsync("ItemSorting"):this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():(this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList())}},u.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},u.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&t.removeClass([this.element],e.split(" ").filter(function(e){return e}))},u.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width),this.isWindow=!this.element.clientHeight},u.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},u.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},u.prototype.enableElement=function(e,t){t?e.classList.remove(h.disable):e.classList.add(h.disable)},u.prototype.header=function(e,i,s){if(t.isBlazor()&&this.isServerRendered){var n={HeaderText:e,BackButton:i};this.interopAdaptor.invokeMethodAsync("HeaderTitle",n)}else if(void 0===this.headerEle&&this.showHeader){this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.headerEle=this.createElement("div",{className:h.header});var l=this.createElement("span",{className:h.headerText,innerHTML:this.headerTitle}),r=this.createElement("div",{className:h.text,innerHTML:l.outerHTML}),a=this.createElement("div",{className:h.icon+" "+h.backIcon+" e-but-back",attrs:{style:"display:none;"}});if(this.headerEle.appendChild(a),this.headerEle.appendChild(r),this.headerTemplate){var o=t.compile(this.headerTemplate),c=this.createElement("div",{className:h.headerTemplateText}),d=o({},this,s,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle);d&&t.append(d,c),t.append([c],this.headerEle),this.updateBlazorTemplates(!1,!0,!0),this.isReact&&this.renderReactTemplates()}this.headerTemplate&&this.headerTitle&&r.classList.add("header"),this.element.classList.add("e-has-header"),t.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";var r=this.headerEle.querySelector("."+h.headerText),a=this.headerEle.querySelector("."+h.backIcon);this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(e)),r.innerHTML=e,this.headerTemplate&&i&&(r.parentElement.classList.remove("header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!i&&(r.parentElement.classList.add("header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.add("header")),a.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},u.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var n=e.style.position,l="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var r=void 0,a=this.animation.duration;if(this.animation.effect)r=this.enableRtl?c[this.animation.effect]:o[this.animation.effect];else{r=o.SlideLeft,i=this.enableRtl,a=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?r[0]:r[1],duration:a,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=l,e.style.position=n,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?r[2]:r[3],duration:a,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},u.prototype.preRender=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim())}catch(e){t.compile(this.template),this.isReact&&this.renderReactTemplates()}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"option",listRole:"presentation",itemText:"",groupItemRole:"group",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:this.element.id+"Template",groupTemplateID:this.element.id+"GroupTemplate",enableHtmlSanitizer:this.enableHtmlSanitizer,removeBlazorID:!0},this.initialization()},u.prototype.updateLiElementHeight=function(){var e=this.element.querySelector("."+h.virtualElementContainer);e.children[0]&&(this.liElementHeight=e.children[0].getBoundingClientRect().height,this.interopAdaptor.invokeMethodAsync("LiElementHeight",this.liElementHeight))},u.prototype.initialization=function(){if(t.isBlazor()&&this.isServerRendered&&this.enableVirtualization){var e=this.element.querySelector("."+h.virtualElementContainer);null!==e&&(""===this.height&&(this.interopAdaptor.invokeMethodAsync("SetComponentHeight",window.innerHeight),this.isWindow=!0,e.scrollIntoView()),-1!==this.height.toString().indexOf("%")&&this.interopAdaptor.invokeMethodAsync("SetContainerHeight",this.element.getBoundingClientRect().height.toString()),e.children[0]&&(this.liElementHeight=e.children[0].getBoundingClientRect().height,this.interopAdaptor.invokeMethodAsync("LiElementHeight",this.liElementHeight)))}this.curDSLevel=[],this.animateOptions={},this.curViewDS=[],this.currentLiElements=[],this.isNestedList=!1,this.selectedData=[],this.selectedId=[],this.LISTVIEW_TEMPLATE_ID=this.element.id+"Template",this.LISTVIEW_GROUPTEMPLATE_ID=this.element.id+"GroupTemplate",this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new t.Animation(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},u.prototype.renderCheckbox=function(e){if(e.item.classList.contains(h.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&this.isValidLI(e.item)){var t=void 0;(t=s.createCheckBox(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:h.listviewCheckbox})).setAttribute("role","checkbox");var i=t.querySelector("."+h.checkboxIcon);e.item.classList.add(h.itemCheckList),e.item.firstElementChild.classList.add(h.checkbox),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?n(e.curData,this.listBaseOption.fields)[this.listBaseOption.fields.isChecked]&&this.checkInternally(e,t):"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]||-1===this.selectedData.indexOf(e.text)||this.checkInternally(e,t),t.setAttribute("aria-checked",i.classList.contains(h.checked)?"true":"false"),"Left"===this.checkBoxPosition?(t.classList.add(h.checkboxLeft),e.item.firstElementChild.classList.add(h.checkboxLeft),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0])):(t.classList.add(h.checkboxRight),e.item.firstElementChild.classList.add(h.checkboxRight),e.item.firstElementChild.appendChild(t)),this.currentLiElements.push(e.item),"Left"===this.checkBoxPosition?this.virtualCheckBox=e.item.firstElementChild.children[0]:this.virtualCheckBox=e.item.firstElementChild.lastElementChild}},u.prototype.checkInternally=function(e,t){e.item.classList.add(h.selected),e.item.setAttribute("aria-selected","true"),t.querySelector("."+h.checkboxIcon).classList.add(h.checked),t.setAttribute("aria-checked","true")},u.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},u.prototype.toggleCheckBase=function(e,i){if(this.showCheckBox){var s=e;if(e instanceof Object&&e.constructor!==HTMLLIElement&&(s=this.getLiFromObjOrElement(e)),!t.isNullOrUndefined(s)){var n=s.querySelector("."+h.checkboxIcon);!0===i?s.classList.add(h.selected):s.classList.remove(h.selected),s.setAttribute("aria-selected",i?"true":"false"),!0===i?n.classList.add(h.checked):n.classList.remove(h.checked),n.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s)}},u.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},u.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},u.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},u.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+h.checkboxIcon);i&&(e?i.classList.contains(h.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(h.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e)}},u.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+h.listItem)),t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""},i=0;i<e.length;i++){var s=e[i];t.item=s,t.curData=this.getItemData(s),s.querySelector("."+h.checkboxWrapper)&&this.removeElement(s.querySelector("."+h.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(h.selected)&&this.checkInternally(t,t.item.querySelector("."+h.checkboxWrapper))}else{for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+h.itemCheckList)),i=0;i<e.length;i++)(s=e[i]).classList.remove(h.selected),s.firstElementChild.classList.remove(h.checkbox),this.removeElement(s.querySelector("."+h.checkboxWrapper));this.selectedItems&&this.selectedItems.item.classList.add(h.selected)}},u.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},u.prototype.clickHandler=function(e){var i,s=e.target,n=s.classList;if(n.contains(h.backIcon)||n.contains(h.headerText))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();else{var l=t.closest(s.parentNode,"."+h.listItem);if(null===l&&(l=s),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(l))if(e.target.classList.contains(h.checkboxIcon)){if(l.classList.add(h.focused),t.isNullOrUndefined(l.querySelector("."+h.checked))){var r={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:l};this.checkInternally(r,r.item.querySelector("."+h.checkboxWrapper))}else this.uncheckItem(l),l.classList.add(h.focused);if(this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(l,e),e){var a=this.selectEventData(l,e),o=l.querySelector("."+h.checkboxIcon);t.merge(a,{isChecked:o.classList.contains(h.checked)}),this.trigger("select",a)}}else l.classList.contains(h.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(l),this.setSelectLI(l,e),l.classList.remove(h.selected)):this.setCheckboxLI(l,e);else this.setSelectLI(l,e);i=t.closest(e.target,"li"),t.isNullOrUndefined(i)||i.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&i.classList.add(h.disable)}if(t.isBlazor()&&this.isServerRendered&&this.enableVirtualization){var c=this.element.querySelector("."+h.virtualElementContainer);if(c.querySelector(".e-active")){var d=c.querySelectorAll(".e-active");if(this.showCheckBox)for(var u=0;u<d.length;u++)this.previousSelectedItems.includes(d[u].getAttribute("data-uid"))||this.previousSelectedItems.push(d[u].getAttribute("data-uid"));else this.previousSelectedItems[0]=c.querySelector(".e-active").getAttribute("data-uid")}if(c.querySelector(".e-focused")){var p=c.querySelector(".e-focused");if(!p.classList.contains("e-active")){var m=p.getAttribute("data-uid");if(this.previousSelectedItems.includes(m)){var f=this.previousSelectedItems.slice(0,this.previousSelectedItems.indexOf(m)),v=this.previousSelectedItems.slice(this.previousSelectedItems.indexOf(m)+1,this.previousSelectedItems.length);this.previousSelectedItems=f.concat(v)}}}}},u.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},u.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+h.listItem);this.setHoverLI(i)},u.prototype.leaveHandler=function(e){this.removeHover()},u.prototype.homeKeyHandler=function(e,t){if(Object.keys(this.dataSource).length&&this.curUL){this.selectedItems&&this.selectedItems.item.setAttribute("aria-selected","false");var i=this.curUL.querySelectorAll("."+h.listItem),s=this.curUL.querySelector("."+h.focused)||this.curUL.querySelector("."+h.selected);s&&(s.classList.remove(h.focused),this.showCheckBox||s.classList.remove(h.selected));var n=t?i.length-1:0;i[n].classList.contains(h.hasChild)||this.showCheckBox?i[n].classList.add(h.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant")}},u.prototype.onArrowKeyDown=function(i,s){var n,l;return!t.isNullOrUndefined(this.curUL.querySelector("."+h.hasChild))||this.showCheckBox?(l=this.curUL.querySelector("."+h.focused)||this.curUL.querySelector("."+h.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+h.listItem),l,s),t.isNullOrUndefined(n)||(l&&(l.classList.remove(h.focused),this.showCheckBox||l.classList.remove(h.selected)),n.classList.contains(h.hasChild)||this.showCheckBox?n.classList.add(h.focused):this.setSelectLI(n,i))):(l=this.curUL.querySelector("."+h.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+h.listItem),l,s),this.setSelectLI(n,i)),n?this.element.setAttribute("aria-activedescendant",n.id.toString()):this.element.removeAttribute("aria-activedescendant"),n},u.prototype.arrowKeyHandler=function(e,t){var i=this;if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var s=this.onArrowKeyDown(e,t),n=this.element.getBoundingClientRect().top,l=this.element.getBoundingClientRect().height,r=this.curUL.querySelector("."+h.listItem).getBoundingClientRect(),a=void 0,o=void 0;if(this.fields.groupBy&&(o=this.curUL.querySelector("."+h.groupListItem).getBoundingClientRect()),s){var c=s.getBoundingClientRect().top,d=s.getBoundingClientRect().height;if(t)(a=this.isWindow?c:c-n)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop+a);else{var u=this.isWindow?window.innerHeight:l;(a=this.isWindow?c+d:c-n+d)>u&&(!0===this.isWindow?window.scroll(0,pageYOffset+(a-u)):this.element.scrollTop=this.element.scrollTop+(a-u))}}else if(this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex)this.onUIScrolled=function(){i.onArrowKeyDown(e,t),i.onUIScrolled=void 0},a=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=this.element.scrollTop-a;else if(t)if(this.showHeader&&this.headerEle){var p=o?o.top:r.top,m=this.headerEle.getBoundingClientRect();a=m.top<0?m.height-p:0,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=0}else this.fields.groupBy&&(a=this.isWindow?o.top<0?o.top:0:n-r.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop-a)}},u.prototype.enterKeyHandler=function(e){if(Object.keys(this.dataSource).length&&this.curUL){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+h.hasChild)),s=this.curUL.querySelector("."+h.focused);i&&s&&(s.classList.remove(h.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))}},u.prototype.spaceKeyHandler=function(){if(this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+h.focused);if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(e.querySelector("."+h.checked))){var i={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:e};this.checkInternally(i,i.item.querySelector("."+h.checkboxWrapper))}else this.uncheckItem(e)}},u.prototype.keyActionHandler=function(e){switch(e.keyCode){case 36:this.homeKeyHandler(e);break;case 35:this.homeKeyHandler(e,!0);break;case 40:this.arrowKeyHandler(e);break;case 38:this.arrowKeyHandler(e,!0);break;case 13:this.enterKeyHandler(e);break;case 8:this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();break;case 32:this.spaceKeyHandler()}},u.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&e.velocity>.5&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},u.prototype.focusout=function(){if(Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+h.focused),t=this.curUL.querySelector("[aria-selected = true]");e&&(e.classList.remove(h.focused),t&&!this.showCheckBox&&t.classList.add(h.selected))}},u.prototype.wireEvents=function(){t.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),t.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},u.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.touchModule.destroy()},u.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+h.focused);e<t.length;e++)t[e].classList.remove(h.focused)},u.prototype.removeHover=function(){var e=this.element.querySelector("."+h.hover);e&&e.classList.remove(h.hover)},u.prototype.removeSelect=function(e){if(t.isNullOrUndefined(e))for(var i=0,s=this.element.querySelectorAll("."+h.selected);i<s.length;i++){var n=s[i];this.showCheckBox&&n.querySelector("."+h.checked)||(n.setAttribute("aria-selected","false"),n.classList.remove(h.selected))}else e.classList.remove(h.selected),e.setAttribute("aria-selected","false")},u.prototype.isValidLI=function(e){return e&&e.classList.contains(h.listItem)&&!e.classList.contains(h.groupListItem)&&!e.classList.contains(h.disable)},u.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+h.focused)&&this.curUL.querySelector("."+h.focused).classList.remove(h.focused),e.classList.add(h.focused);var s=e.querySelector("."+h.checkboxWrapper),n=s.querySelector("."+h.checkboxIcon+"."+h.icon);this.removeHover(),n.classList.contains(h.checked)?(n.classList.remove(h.checked),e.classList.remove(h.selected),e.setAttribute("aria-selected","false")):(n.classList.add(h.checked),e.classList.add(h.selected),e.setAttribute("aria-selected","true")),s.setAttribute("aria-checked",n.classList.contains(h.checked)?"true":"false");var l=this.selectEventData(e,i);t.merge(l,{isChecked:n.classList.contains(h.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,i),this.trigger("select",l),this.setSelectedItemData(e),this.renderSubList(e)}},u.prototype.selectEventData=function(e,i){var s,l=this.getItemData(e),r=n(l,this.listBaseOption.fields);s=!t.isNullOrUndefined(l)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:r&&r[this.listBaseOption.fields.text],data:l};var a={};return t.merge(a,s),i&&t.merge(a,{isInteracted:!0,event:i,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),a},u.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);t.isNullOrUndefined(i)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:s&&s[this.listBaseOption.fields.text],data:i}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},u.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(h.selected)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(h.selected),e.setAttribute("aria-selected","true"),this.removeHover(),this.setSelectedItemData(e),this.enableVirtualization&&this.virtualizationModule.setSelectLI(e,t);var i=this.selectEventData(e,t);this.trigger("select",i),this.selectedLI=e,this.renderSubList(e)}},u.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(h.hover)&&this.enable){var i=this.element.querySelectorAll("."+h.hover);i&&i.length&&t.removeClass(i,h.hover),e.classList.contains(h.selected)&&!this.showCheckBox||e.classList.add(h.hover)}},u.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var l=s[i],r={};r[this.fields.id]=l,this.curDSJSON=this.findItemFromDS(t,r);var a=n(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?a[this.fields.child]:t}return t}return this.localData},u.prototype.getItemData=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource,l=this.getElementUID(e);return s=t.isNullOrUndefined(this.element.querySelector("."+h.hasChild))&&this.fields.groupBy?this.curViewDS:n,this.findItemFromDS(s,l)},u.prototype.findItemFromDS=function(e,i,s){var l,r=this;return e&&e.length&&i?e.some(function(a){var o=n(a,r.listBaseOption.fields);if(!i[r.fields.id]&&!i[r.fields.text]||i[r.fields.id]&&(!t.isNullOrUndefined(o[r.fields.id])&&o[r.fields.id].toString())!==i[r.fields.id].toString()||i[r.fields.text]&&o[r.fields.text]!==i[r.fields.text])if("object"!=typeof a&&-1!==e.indexOf(a))l=s?e:a;else if(!t.isNullOrUndefined(i[r.fields.id])&&t.isNullOrUndefined(o[r.fields.id])){var c=r.element.querySelector('[data-uid="'+i[r.fields.id]+'"]');c&&c.innerText.trim()===o[r.fields.text]&&(l=a)}else o.hasOwnProperty(r.fields.child)&&o[r.fields.child].length&&(l=r.findItemFromDS(o[r.fields.child],i,s));else l=s?e:a;return!!l}):l=e,l},u.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var n=0,l=Object.keys(this.fields.properties);n<l.length;n++){var r=l[n];"tableName"!==r&&this.fields[r]&&this.fields[r]!==e.ListBase.defaultMappedFields[r]&&-1===t.indexOf(this.fields[r])&&t.push(this.fields[r])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},u.prototype.setViewDataSource=function(t){void 0===t&&(t=this.localData),t&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=e.ListBase.groupDataSource(e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)),this.listBaseOption.fields,this.sortOrder):this.curViewDS=e.ListBase.groupDataSource(t,this.listBaseOption.fields,this.sortOrder):t&&"None"!==this.sortOrder?this.curViewDS=e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=t},u.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},u.prototype.setLocalData=function(){var s=this;this.trigger("actionBegin");var n=this;if(this.dataSource instanceof i.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(e){s.isDestroyed||(s.localData=e.result,s.isServerRendered&&t.isBlazor()||(n.removeElement(n.contentContainer),s.isReact&&s.clearTemplate()),s.renderList(),s.trigger("actionComplete",e))}).catch(function(e){s.isDestroyed||s.trigger("actionFailure",e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var l=this.element.querySelector("ul");l&&(t.remove(l),this.setProperties({dataSource:e.ListBase.createJsonFromElement(l)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},u.prototype.reRender=function(){t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||(this.resetBlazorTemplates(),this.removeElement(this.headerEle),this.removeElement(this.ulElement),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),-1===Object.keys(window).indexOf("ejsInterop")&&(this.element.innerHTML=""),this.headerEle=this.ulElement=this.liCollection=void 0,this.header()),this.setLocalData()},u.prototype.resetCurrentList=function(){this.resetBlazorTemplates(),this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},u.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[t];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("aria-selected","false"),i.setAttribute("tabindex","-1"))}},u.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.ListBase.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.setAttributes(this.liCollection),this.updateBlazorTemplates(!0)},u.prototype.resetBlazorTemplates=function(){var e=t.blazorTemplates;this.template&&(e[this.LISTVIEW_TEMPLATE_ID]=[],t.resetBlazorTemplate(this.LISTVIEW_TEMPLATE_ID,"Template")),this.groupTemplate&&(e[this.LISTVIEW_GROUPTEMPLATE_ID]=[],t.resetBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID,"GroupTemplate")),this.headerTemplate&&t.resetBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID,"HeaderTemplate")},u.prototype.updateBlazorTemplates=function(e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=!1),this.template&&e&&!this.enableVirtualization&&t.updateBlazorTemplate(this.LISTVIEW_TEMPLATE_ID,"Template",this,s),this.groupTemplate&&e&&!this.enableVirtualization&&t.updateBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID,"GroupTemplate",this,s),this.headerTemplate&&i&&t.updateBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID,"HeaderTemplate",this,s)},u.prototype.exceptionEvent=function(e){this.trigger("actionFailure",e)},u.prototype.UpdateCurrentUL=function(){this.ulElement=this.curUL=this.element.querySelector("."+h.parentItem),this.curUL&&(this.liCollection=this.curUL.querySelectorAll("."+h.listItem))},u.prototype.removeActiveClass=function(){var e=this;setTimeout(function(){for(var t=e.element.querySelector("."+h.virtualElementContainer),i=0;i<t.childElementCount;i++){var s=t.children[i],n=void 0,l=void 0;if(e.showCheckBox)if(e.previousSelectedItems.length>0)for(var r=0;r<e.previousSelectedItems.length;r++)s.getAttribute("data-uid")===e.previousSelectedItems[r]?(s.classList.add("e-active"),s.setAttribute("aria-selected","true"),s.querySelector(".e-frame.e-icons")&&s.querySelector(".e-frame.e-icons").classList.add("e-check"),n=i):n!==i&&(s.classList.remove("e-active"),s.removeAttribute("aria-selected"),s.querySelector(".e-check")&&s.querySelector(".e-check").classList.remove("e-check"));else s.classList.remove("e-active"),s.removeAttribute("aria-selected"),s.querySelector(".e-check")&&s.querySelector(".e-check").classList.remove("e-check");else s.getAttribute("data-uid")===e.previousSelectedItems[0]?(s.classList.add("e-active"),s.setAttribute("aria-selected","true")):(s.classList.remove("e-active"),s.removeAttribute("aria-selected"));if(e.hiddenItems.length>0)for(var a=0;a<e.hiddenItems.length;a++)s.getAttribute("data-uid")===e.previousSelectedItems[a]?(s.style.display="none",l=i):l!==i&&(s.style.display=null);if(e.enabledItems.length>0)for(var o=0;o<e.enabledItems.length;o++)s.getAttribute("data-uid")===e.enabledItems[o]&&s.classList.contains("e-disabled")&&s.classList.remove("e-disabled");if(e.disabledItems.length>0)for(var c=0;c<e.disabledItems.length;c++)s.getAttribute("data-uid")===e.disabledItems[c]&&(s.classList.contains("e-disabled")||s.classList.add("e-disabled"))}},200)},u.prototype.renderingNestedList=function(){var e=t.closest(this.liElement.parentNode,"."+h.parentItem),i=this.element.id,s=document.getElementById(i),n=s.getElementsByTagName("UL")[s.getElementsByTagName("UL").length-1];this.switchView(e,n),this.liElement=null},u.prototype.renderSubList=function(i){this.liElement=i;var s=i.getAttribute("data-uid");if(i.classList.contains(h.hasChild)&&s){var l=t.closest(i.parentNode,"."+h.parentItem),r=this.element.querySelector("[pid='"+s+"']");if(this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),!r){var a=this.curViewDS;if(t.isBlazor()&&this.isServerRendered)this.interopAdaptor.invokeMethodAsync("ListChildDataSource",a);else{r=e.ListBase.createListFromJson(this.createElement,a,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates();var o=r.querySelectorAll("."+h.listItem);this.setAttributes(o),r.setAttribute("pID",s),r.style.display="none",this.renderIntoDom(r),this.updateBlazorTemplates(!0)}}if(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||this.switchView(l,r),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.selectedItems){var c=n(this.selectedItems.data,this.listBaseOption.fields);this.header(c[this.listBaseOption.fields.text],!0,"header")}this.selectedLI=void 0}},u.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},u.prototype.renderList=function(e){this.setViewDataSource(e),t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||(this.enableVirtualization?(Object.keys(this.dataSource).length&&(t.isBlazor()&&this.isServerRendered||!this.template&&!this.groupTemplate||this.virtualizationModule.isNgTemplate()||(this.listBaseOption.template=null,this.listBaseOption.groupTemplate=null,this.listBaseOption.itemCreated=this.virtualizationModule.createUIItem.bind(this.virtualizationModule))),this.virtualizationModule.uiVirtualization()):(this.createList(),this.contentContainer=this.createElement("div",{className:h.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates()))},u.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},u.prototype.render=function(){t.isBlazor()&&this.isServerRendered?this.initBlazor(!0):(this.element.classList.add(h.root),t.attributes(this.element,{role:"list",tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.isReact&&this.renderReactTemplates()),this.rippleFn=t.rippleEffect(this.element,{selector:"."+h.listItem}),this.renderComplete()},u.prototype.initBlazor=function(e){null===e&&(e=!1),this.setLocalData(),this.setViewDataSource(this.localData),this.contentContainer=this.element.querySelector("."+h.content),e&&this.wireEvents()},u.prototype.destroy=function(){this.resetBlazorTemplates(),this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[h.root,h.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass.split(" ").filter(function(e){return e}));t.removeClass([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,t.isBlazor()&&this.isServerRendered?this.element.style.display="none":(this.element.innerHTML="",l.prototype.destroy.call(this))},u.prototype.back=function(){var e=this.curDSLevel[this.curDSLevel.length-1];if(void 0!==e&&!this.isInAnimation()){this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS());var i=this.element.querySelector("[data-uid='"+e+"']"),s=this.curUL;i?i=t.isBlazor()&&this.isServerRendered&&this.enableVirtualization?i.parentElement.parentElement.parentElement:i.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),i=this.curUL);var l=n(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(s,i,!0),this.removeFocus();var r=this.element.querySelector("[data-uid='"+e+"']");r.classList.remove(h.disable),r.classList.add(h.focused),this.showCheckBox&&r.querySelector("."+h.checkboxIcon).classList.contains(h.checked)?r.setAttribute("aria-selected","true"):(r.classList.remove(h.selected),r.setAttribute("aria-selected","false")),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?l:this.headerTitle,!!this.curDSLevel.length,"header")}},u.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===t.isNullOrUndefined(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},u.prototype.getLiFromObjOrElement=function(e){var s,l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(!t.isNullOrUndefined(e))if("string"==typeof l[0]||"number"==typeof l[0])if(e instanceof Element){for(var r=e.getAttribute("data-uid").toString(),a=0;a<this.liCollection.length;a++)if(this.liCollection[a].getAttribute("data-uid").toString()===r){s=this.liCollection[a];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+h.listItem),function(t){return t.innerText.trim()===e.toString()&&(s=t,!0)});else{var o=this.getItemData(e),c=n(o,this.listBaseOption.fields);if(o&&(s=this.element.querySelector('[data-uid="'+c[this.fields.id]+'"]'),!this.enableVirtualization&&t.isNullOrUndefined(s)))for(var d=this.element.querySelectorAll("."+h.listItem),a=0;a<d.length;a++)d[a].innerText.trim()===c[this.fields.text]&&(s=d[a])}return s},u.prototype.selectMultipleItems=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i])||this.selectItem(e[i])},u.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;t>=0;t--)e.push(this.curDSLevel[t]);return e},u.prototype.getSelectedItems=function(){var e,s=!1;this.selectedId=[];var l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(this.enableVirtualization&&!s)e=this.virtualizationModule.getSelectedItems(),s=!0;else if(this.showCheckBox&&!s){var r=this.curUL.getElementsByClassName(h.selected),a=[],o=[];this.selectedId=[];for(var c=[],d=0;d<r.length;d++)if("string"==typeof l[0]||"number"==typeof l[0])a.push(r[d].innerText.trim());else{var u=this.getItemData(r[d]),p=n(u,this.listBaseOption.fields);this.isNestedList?c.push({data:u,parentId:this.getParentId()}):o.push(u),p?(a.push(p[this.listBaseOption.fields.text]),this.selectedId.push(p[this.listBaseOption.fields.id])):(a.push(void 0),this.selectedId.push(void 0))}"string"!=typeof l[0]&&"number"!=typeof l[0]||s||(e={item:r,data:l,text:a},s=!0),this.isNestedList&&!s?(e={item:r,data:c,text:a},s=!0):s||(e={item:r,data:o,text:a},s=!0)}else if(!s){var m=this.element.getElementsByClassName(h.selected)[0],p=n(this.getItemData(m),this.listBaseOption.fields);"string"!=typeof l[0]&&"number"!=typeof l[0]||s?s||(t.isNullOrUndefined(p)||t.isNullOrUndefined(m)?(e=void 0,s=!0):(this.selectedId.push(p[this.listBaseOption.fields.id]),e={text:p[this.listBaseOption.fields.text],item:m,data:this.getItemData(m)},s=!0)):(e=t.isNullOrUndefined(m)?void 0:{item:m,data:l,text:m.innerText.trim()},s=!0)}return t.isBlazor()?this.blazorGetSelectedItems(e):e},u.prototype.blazorGetSelectedItems=function(e){var i={data:[],index:[],parentId:[],text:[]};if(!t.isNullOrUndefined(e)){if(!t.isNullOrUndefined(e.data))if(this.showCheckBox&&this.isNestedList){for(var s=0;s<e.data.length;s++)i.data.push(e.data[s].data);t.isNullOrUndefined(e.data[0])||t.isNullOrUndefined(e.data[0].parentId)||(i.parentId=e.data[0].parentId)}else i.data=this.convertItemsToArray(e.data);t.isNullOrUndefined(e.text)||(i.text=this.convertItemsToArray(e.text)),t.isNullOrUndefined(e.index)||(i.index=this.convertItemsToArray(e.index))}return i},u.prototype.convertItemsToArray=function(e){return Array.isArray(e)?e.slice():[e]},u.prototype.findItem=function(e){return this.getItemData(e)},u.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},u.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},u.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);if(i){var l=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(l&&l.classList.remove(h.disable),delete i[this.fields.enabled]):t||(l&&l.classList.add(h.disable),i[this.fields.enabled]=!1)}},u.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},u.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},u.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),l=n(s,this.listBaseOption.fields);if(s){var r=this.element.querySelector('[data-uid="'+l[this.fields.id]+'"]');r&&(r.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},u.prototype.addItem=function(e,t){void 0===t&&(t=void 0);var s=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.addItemInternally(e,t,s)},u.prototype.addItemInternally=function(e,t,i){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i);else{var s=this.findItemFromDS(i,t),l=void 0;if(s&&((l=n(s,this.listBaseOption.fields)[this.fields.child])||(l=[]),l=l.concat(e)),s instanceof Array){for(var r=0;r<e.length;r++){i.push(e[r]),this.setViewDataSource(i);var a=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&a?this.addItemIntoDom(e[r],a,this.curViewDS):this.reRender()}this.curUL&&this.updateBlazorTemplates(!0),this.liCollection=this.curUL.querySelectorAll("."+h.listItem)}else s&&(s[this.fields.child]=l,this.addItemInNestedList(s,e))}},u.prototype.addItemInNestedList=function(i,s){var n=i[this.fields.id],l=i[this.fields.child],r=this.element.querySelector("[pid='"+n+"']"),a=this.element.querySelector("[data-uid='"+n+"']"),o=r||(a?t.closest(a,"ul"):null),c=r?l:[i],d=!1;if(!!a&&!a.classList.contains(h.hasChild)){var u=e.ListBase.createListItemFromJson(this.createElement,c,this.listBaseOption,null,null,this);this.setAttributes(u),o.insertBefore(u[0],a),t.detach(a),d=!0}if(r&&s){for(var p=0;p<s.length;p++)c.push(s[p]),this.addItemIntoDom(s[p],o,c);d=!0}d&&this.updateBlazorTemplates(!0)},u.prototype.addItemIntoDom=function(e,t,i){var s=i.indexOf(e);this.addListItem(e,s,t,i);var n=i[s-1];n&&n.isHeader&&1===n.items.length&&this.addListItem(n,s-1,t,i)},u.prototype.addListItem=function(t,i,s,n){var l=this.getLiFromObjOrElement(n[i+1])||this.getLiFromObjOrElement(n[i+2])||null,r=e.ListBase.createListItemFromJson(this.createElement,[t],this.listBaseOption,null,null,this);this.setAttributes(r),this.template&&this.isReact&&this.renderReactTemplates(),s.insertBefore(r[0],l)},u.prototype.removeItem=function(e){var t=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):(this.removeItemFromList(e,t),this.updateBlazorTemplates(!0))},u.prototype.removeItemFromList=function(i,s){var n,l=this,r=this.curViewDS,a=i instanceof Element?this.getElementUID(i):i;if(n=this.findItemFromDS(s,a,!0)){var o;o=this.findItemFromDS(n,a);var c=r.indexOf(o),d=this.getLiFromObjOrElement(i),u=void 0;this.validateNestedView(d),this.fields.groupBy&&this.curViewDS[c-1]&&r[c-1].isHeader&&1===r[c-1].items.length&&d&&d.previousElementSibling.classList.contains(h.groupListItem)&&(t.isNullOrUndefined(d.nextElementSibling)||d.nextElementSibling&&d.nextElementSibling.classList.contains(h.groupListItem))&&(u=d.previousElementSibling),d&&t.detach(d),u&&t.detach(u);var p=n.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===o[l.fields.id]},null):null,m=n.indexOf(o);if(n.splice(m,1),this.setViewDataSource(s),p&&p.parent&&Array.isArray(p.parent[this.fields.child])&&p.parent[this.fields.child].length<=0){var f=this.getLiFromObjOrElement(p.parent);if(f){var v=e.ListBase.createListItemFromJson(this.createElement,[p.parent],this.listBaseOption,null,null,this);this.setAttributes(v),f.parentElement.insertBefore(v[0],f),f.parentElement.removeChild(f)}}n.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+h.listItem))}},u.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&this.curDSLevel.length>0)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},u.prototype.removeMultipleItems=function(e){if(e.length){for(var t=0;t<e.length;t++)this.removeItem(e[t]);this.updateBlazorTemplates(!0)}},u.prototype.findParent=function(e,i,s,n){if(e.hasOwnProperty(i)&&!0===s(e[i]))return t.extend({},e);for(var l=0;l<Object.keys(e).length;l++)if(e[Object.keys(e)[l]]&&"object"==typeof e[Object.keys(e)[l]]){var r=this.findParent(e[Object.keys(e)[l]],i,s,e);if(null!=r)return r.parent||(r.parent=n),r}return null},u.prototype.getModuleName=function(){return"listview"},u.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization"}),e},u.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition"])},a([t.Property("")],u.prototype,"cssClass",void 0),a([t.Property(!1)],u.prototype,"enableVirtualization",void 0),a([t.Property({})],u.prototype,"htmlAttributes",void 0),a([t.Property(!0)],u.prototype,"enable",void 0),a([t.Property([])],u.prototype,"dataSource",void 0),a([t.Property()],u.prototype,"query",void 0),a([t.Complex(e.ListBase.defaultMappedFields,d)],u.prototype,"fields",void 0),a([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],u.prototype,"animation",void 0),a([t.Property("None")],u.prototype,"sortOrder",void 0),a([t.Property(!1)],u.prototype,"showIcon",void 0),a([t.Property(!1)],u.prototype,"showCheckBox",void 0),a([t.Property("Left")],u.prototype,"checkBoxPosition",void 0),a([t.Property("")],u.prototype,"headerTitle",void 0),a([t.Property(!1)],u.prototype,"showHeader",void 0),a([t.Property(!1)],u.prototype,"enableHtmlSanitizer",void 0),a([t.Property("")],u.prototype,"height",void 0),a([t.Property("")],u.prototype,"width",void 0),a([t.Property(null)],u.prototype,"template",void 0),a([t.Property(null)],u.prototype,"headerTemplate",void 0),a([t.Property(null)],u.prototype,"groupTemplate",void 0),a([t.Event()],u.prototype,"select",void 0),a([t.Event()],u.prototype,"actionBegin",void 0),a([t.Event()],u.prototype,"actionComplete",void 0),a([t.Event()],u.prototype,"actionFailure",void 0),u=a([t.NotifyPropertyChanges],u)}(t.Component),p=function(){function s(e){this.elementDifference=0,this.listViewInstance=e}return s.prototype.isNgTemplate=function(){return!t.isNullOrUndefined(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},s.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var i=this.listViewInstance.curViewDS,s=i.slice(0,1);t.isBlazor()||this.listViewInstance.isServerRendered||(this.listViewInstance.ulElement=this.listViewInstance.curUL=e.ListBase.createList(this.listViewInstance.createElement,s,this.listViewInstance.listBaseOption,null,this),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:h.content}),this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer),this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement)),this.listItemHeight=this.listViewInstance.ulElement.firstElementChild.getBoundingClientRect().height,this.expectedDomItemCount=this.ValidateItemCount(1e4),this.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length),this.uiFirstIndex=0,this.uiLastIndex=this.domItemCount-1;var n=i.slice(1,this.domItemCount);if(t.isBlazor()||this.listViewInstance.isServerRendered)this.listViewInstance.contentContainer=this.listViewInstance.element.querySelector(".e-content"),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li");else{var l=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,n,this.listViewInstance.listBaseOption,null,null,this);t.append(l,this.listViewInstance.ulElement),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li"),this.topElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.topElement,this.listViewInstance.ulElement.firstElementChild),this.bottomElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.bottomElement,null),this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight}this.listDiff=0,this.uiIndicesInitialization()},s.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):(t.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll),t.EventHandler.remove(this.listViewInstance.element,"scroll",this.updateUlContainer)):t.isBlazor()&&this.listViewInstance.isServerRendered?this.listViewInstance.isWindow?(this.onVirtualScroll=t.debounce(this.onVirtualUiScroll.bind(this),350),this.updateUl=this.updateUlContainer.bind(this),window.addEventListener("scroll",this.onVirtualScroll),window.addEventListener("scroll",this.updateUl)):(t.EventHandler.add(this.listViewInstance.element,"scroll",t.debounce(this.onVirtualUiScroll,350),this),t.EventHandler.add(this.listViewInstance.element,"scroll",this.updateUlContainer,this)):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):t.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},s.prototype.updateUlContainer=function(e){var i,s=this.listViewInstance.ulElement.querySelector("."+h.virtualElementContainer);t.isNullOrUndefined(this.listViewInstance.liElementHeight)&&this.listViewInstance.updateLiElementHeight(),((i=this.listViewInstance.isWindow?Math.round(e.target.documentElement.scrollTop/this.listViewInstance.liElementHeight)-2:Math.round(e.target.scrollTop/this.listViewInstance.liElementHeight)-2)-1)*this.listViewInstance.liElementHeight<0?s.style.top="0px":s.style.top=i*this.listViewInstance.liElementHeight+"px"},s.prototype.ValidateItemCount=function(e){var i,s=parseFloat(t.formatUnit(this.listViewInstance.height));return(i=this.listViewInstance.isWindow?Math.round(window.innerHeight/this.listItemHeight*3):"string"==typeof this.listViewInstance.height&&-1!==this.listViewInstance.height.indexOf("%")?Math.round(this.listViewInstance.element.getBoundingClientRect().height/this.listItemHeight*1.5):Math.round(s/this.listItemHeight*1.5))>e&&(i=e),i},s.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,i=0;i<e.length;i++)this.listViewInstance.showCheckBox&&e[i][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(i),t.isNullOrUndefined(e[i][this.listViewInstance.fields.enabled])||e[i][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(i);if(this.isNgTemplate())for(var s=this.listViewInstance.element.querySelectorAll("."+h.listItem),n=0;n<s.length;n++)s[n].context=this.listViewInstance.viewContainerRef.get(n).context},s.prototype.refreshItemHeight=function(){if(this.listViewInstance.curViewDS.length){var e=this.listViewInstance.curViewDS;t.isBlazor()&&this.listViewInstance.isServerRendered?this.listViewInstance.ulElement.children[0].style.height=this.listViewInstance.liElementHeight*Object.keys(e).length+"px":(this.listItemHeight=this.topElement.nextSibling.getBoundingClientRect().height,this.totalHeight=Object.keys(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.bottomElementHeight=this.totalHeight,this.bottomElement.style.height=this.totalHeight+"px")}},s.prototype.getscrollerHeight=function(e){return this.listViewInstance.isWindow?pageYOffset-e<=0?0:pageYOffset-e:this.listViewInstance.element.scrollTop-e<=0?0:this.listViewInstance.element.scrollTop-e},s.prototype.onVirtualUiScroll=function(e){var i,s;s=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=t.isNullOrUndefined(this.scrollPosition)?0:this.scrollPosition;var n=this.getscrollerHeight(s);if(this.topElementHeight=this.listItemHeight*Math.floor(n/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,i=n<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=i[0],this.bottomElementHeight=i[1],t.isBlazor()&&this.listViewInstance.isServerRendered){var l=void 0;if(t.isNullOrUndefined(this.listViewInstance.liElementHeight)&&this.listViewInstance.updateLiElementHeight(),(l=this.listViewInstance.isWindow?Math.round(document.documentElement.scrollTop/this.listViewInstance.liElementHeight):Math.round(e.target.scrollTop/this.listViewInstance.liElementHeight))-2-this.elementDifference>=3||l-2-this.elementDifference<=-1){var r={listDiff:l-2,selectedItems:this.listViewInstance.previousSelectedItems};this.listViewInstance.interopAdaptor.invokeMethodAsync("VirtalScrolling",r),this.listViewInstance.ulElement.querySelector(".e-focused")&&this.listViewInstance.ulElement.querySelector(".e-focused").classList.remove("e-focused"),this.elementDifference=l-2}}else this.topElementHeight!==parseFloat(this.topElement.style.height)&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",n>this.scrollPosition?(l=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(l,!0):this.onNormalScroll(l,!0):(l=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(l,!1):this.onNormalScroll(l,!1)),this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled();this.scrollPosition=n},s.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,s=this.listViewInstance.ulElement.querySelectorAll("li"),n=0;n<s.length;n++)this.updateUI(s[n],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},s.prototype.onNormalScroll=function(e,t){if(t)for(i=0;i<e;i++){s=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,s,this.bottomElement),this.uiFirstIndex++}else for(var i=0;i<e;i++){var s=--this.uiFirstIndex,n=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,s,n),this.uiLastIndex--}},s.prototype.updateUiContent=function(i,s){var n=this.listViewInstance.curViewDS;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(i.dataset.uid=e.ListBase.generateId(),i.getElementsByClassName(h.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[s].toString()):(i.dataset.uid=n[s][this.listViewInstance.fields.id]?n[s][this.listViewInstance.fields.id]:e.ListBase.generateId(),i.getElementsByClassName(h.listItemText)[0].innerHTML=n[s][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(i.querySelector("."+h.listIcon)&&t.detach(i.querySelector("."+h.listIcon)),this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss])){var l=i.querySelector("."+h.textContent),r=this.listViewInstance.createElement("div",{className:h.listIcon+" "+this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss]});l.insertBefore(r,i.querySelector("."+h.listItemText))}if(this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy){this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+h.checkboxWrapper).cloneNode(!0));l=i.querySelector("."+h.textContent);this.listViewInstance.curViewDS[s].isHeader?i.querySelector("."+h.checkboxWrapper)&&(i.classList.remove(h.checklist),l.classList.remove(h.checkbox),t.detach(i.querySelector("."+h.checkboxWrapper))):i.querySelector("."+h.checkboxWrapper)||(i.classList.add(h.checklist),l.classList.add(h.checkbox),l.insertBefore(this.checkListWrapper.cloneNode(!0),i.querySelector("."+h.listItemText)))}},s.prototype.changeElementAttributes=function(e,i){if(e.classList.remove(h.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(i)&&e.classList.add(h.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(i)&&(e.style.display="none"),this.listViewInstance.showCheckBox){var s=e.querySelector("."+h.checkboxWrapper);e.classList.remove(h.selected),e.classList.remove(h.focused),s&&(s.removeAttribute("aria-checked"),s.firstElementChild.classList.remove(h.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(i)&&!this.listViewInstance.curUL.querySelector(h.selected)&&(e.classList.add(h.selected),s.firstElementChild.classList.add(h.checked),s.setAttribute("aria-checked","true"),this.activeIndex===i&&e.classList.add(h.focused))}else e.classList.remove(h.selected),e.removeAttribute("aria-selected"),t.isNullOrUndefined(this.activeIndex)||this.activeIndex!==i||this.listViewInstance.curUL.querySelector(h.selected)||(e.classList.add(h.selected),e.setAttribute("aria-selected","true"));this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[i].isHeader?e.classList.contains(h.listItem)&&(e.classList.remove(h.listItem),e.setAttribute("role","group"),e.classList.add(h.groupListItem)):e.classList.contains(h.groupListItem)&&(e.classList.remove(h.groupListItem),e.setAttribute("role","listitem"),e.classList.add(h.listItem)))},s.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),t.isNullOrUndefined(i)||e.some(function(e,t){return!!(i[s.listViewInstance.fields.id]&&i[s.listViewInstance.fields.id]===(e[s.listViewInstance.fields.id]&&e[s.listViewInstance.fields.id])||i===e)&&(n.index=t,n.data=e,!0)}),n},s.prototype.getSelectedItems=function(){var e=this;if(!t.isNullOrUndefined(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var s=[],n=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var l=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var r=this.uiIndices.activeIndices,a=0;a<r.length;a++)s.push(l[r[a]]);return{text:s,data:s,index:this.uiIndices.activeIndices.map(function(t){return e.listViewInstance.dataSource.indexOf(l[t])})}}return{text:l[this.activeIndex],data:l[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(l[this.activeIndex])}}if(t.isBlazor()&&this.listViewInstance.isServerRendered){var o=Math.round(this.listViewInstance.element.scrollTop/this.listViewInstance.liElementHeight)-2;o<0&&(o=0),this.activeIndex+=o}var c=this.listViewInstance.curViewDS,h=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){for(var d=this.uiIndices.activeIndices,a=0;a<d.length;a++)n.push(c[d[a]][h]),s.push(c[d[a]]);var u=this.listViewInstance.dataSource instanceof i.DataManager?c:this.listViewInstance.dataSource;return{text:n,data:s,index:this.uiIndices.activeIndices.map(function(e){return u.indexOf(c[e])})}}var p=this.listViewInstance.dataSource instanceof i.DataManager?c:this.listViewInstance.dataSource;return{text:c[this.activeIndex][this.listViewInstance.fields.text],data:c[this.activeIndex],index:p.indexOf(c[this.activeIndex])}}},s.prototype.selectItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(Object.keys(i).length){var s=this.activeIndex===i.index,n=void 0;if(this.activeIndex=i.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(i.index)?(n=!0,this.uiIndices.activeIndices.push(i.index)):(n=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i.index),1)),this.listViewInstance.curUL.querySelector("."+h.focused)&&this.listViewInstance.curUL.querySelector("."+h.focused).classList.remove(h.focused)),this.listViewInstance.getLiFromObjOrElement(e))this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e));else{var l=void 0;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0])l={text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex};else{var r=this.listViewInstance.curViewDS;l={text:r[this.activeIndex][this.listViewInstance.fields.text],data:r[this.activeIndex],index:this.activeIndex}}this.listViewInstance.showCheckBox?(l.isChecked=n,this.listViewInstance.trigger("select",l)):s||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",l))}}else t.isNullOrUndefined(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var a=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.showCheckBox)if(this.listViewInstance.previousSelectedItems.includes(a)){var o=this.listViewInstance.previousSelectedItems.indexOf(a);o>-1&&this.listViewInstance.previousSelectedItems.splice(o,1)}else this.listViewInstance.previousSelectedItems.push(a);else this.listViewInstance.previousSelectedItems[0]=a;this.listViewInstance.removeActiveClass()}},s.prototype.enableItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.enabledItems.includes(s)||(this.listViewInstance.enabledItems.push(s),this.listViewInstance.removeActiveClass()),this.listViewInstance.disabledItems.includes(s)){var n=this.listViewInstance.disabledItems.indexOf(s);n>-1&&this.listViewInstance.disabledItems.splice(n,1)}}else Object.keys(i).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(i.index),1)},s.prototype.disableItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.disabledItems.includes(s)||(this.listViewInstance.disabledItems.push(s),this.listViewInstance.removeActiveClass()),this.listViewInstance.enabledItems.includes(s)){var n=this.listViewInstance.enabledItems.indexOf(s);n>-1&&this.listViewInstance.enabledItems.splice(n,1)}}else Object.keys(i).length&&-1===this.uiIndices.disabledItemIndices.indexOf(i.index)&&this.uiIndices.disabledItemIndices.push(i.index)},s.prototype.showItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.hiddenItems.includes(s)){var n=this.listViewInstance.hiddenItems.indexOf(s);n>-1&&(this.listViewInstance.previousSelectedItems.splice(n,1),this.listViewInstance.removeActiveClass())}}else Object.keys(i).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(i.index),1)},s.prototype.hideItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];this.listViewInstance.hiddenItems.includes(s)||(this.listViewInstance.hiddenItems.push(s),this.listViewInstance.removeActiveClass())}else Object.keys(i).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(i.index)&&this.uiIndices.hiddenItemIndices.push(i.index)},s.prototype.removeItem=function(e){var s,n=this.listViewInstance.curViewDS,l=this.findDSAndIndexFromId(n,e);t.isBlazor()&&this.listViewInstance.isServerRendered&&void 0!==l.index&&this.listViewInstance.interopAdaptor.invokeMethodAsync("RemoveItemPosition",l.index),Object.keys(l).length&&(s=l.data,n[l.index-1]&&n[l.index-1].isHeader&&1===n[l.index-1].items.length?(this.removeUiItem(l.index-1),this.removeUiItem(l.index-1)):t.isBlazor()&&this.listViewInstance.isServerRendered||this.removeUiItem(l.index));var r=this.listViewInstance.dataSource instanceof i.DataManager?this.listViewInstance.localData:this.listViewInstance.dataSource,a=r.indexOf(s);-1!==a&&(r.splice(a,1),this.listViewInstance.setViewDataSource(r)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},s.prototype.setCheckboxLI=function(e,i){t.isBlazor()&&this.listViewInstance.isServerRendered&&(this.uiFirstIndex=Math.round(this.listViewInstance.element.scrollTop/36)-4,this.uiFirstIndex<0&&(this.uiFirstIndex=0));var s=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex;this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex,e.classList.contains(h.selected)?-1===this.uiIndices.activeIndices.indexOf(s)&&this.uiIndices.activeIndices.push(s):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(s),1)},s.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},s.prototype.checkedItem=function(e){if(e){this.uiIndices.activeIndices=[],this.activeIndex=void 0;for(var t=this.listViewInstance.curViewDS,i=0;i<t.length;i++)t[i].isHeader||this.uiIndices.activeIndices.push(i)}else this.activeIndex=void 0,this.uiIndices.activeIndices=[]},s.prototype.addUiItem=function(e){var t=this.listViewInstance.curViewDS;if(this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&t[e][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(e),parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)||(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px"),parseFloat(this.bottomElement.style.height)){i=this.listViewInstance.curUL.lastElementChild.previousSibling;(s=this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(i,e,s))}else{var i=this.listViewInstance.curUL.firstElementChild.nextSibling,s=void 0;s=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,s&&(this.updateUI(i,e,s),!0===this.listViewInstance.isWindow?window.scrollTo(0,pageYOffset+this.listItemHeight):this.listViewInstance.element.scrollTop+=this.listItemHeight)}this.totalHeight+=this.listItemHeight,this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var i=this.listViewInstance.curViewDS[e],s=this.listViewInstance.getLiFromObjOrElement(i);if(this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,s)if(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length)t.detach(s),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0;else{if(s.classList.contains(h.disable)&&(s.classList.remove(h.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===s.style.display&&(s.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&s.classList.contains(h.selected)){this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1);var n=s.querySelector("."+h.checkboxWrapper);n.removeAttribute("aria-checked"),n.firstElementChild.classList.remove(h.checked),s.classList.contains(h.focused)&&(s.classList.remove(h.focused),this.activeIndex=void 0)}else s.classList.contains(h.selected)&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)?parseFloat(this.bottomElement.style.height)?(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(s,this.uiLastIndex,this.bottomElement)}this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.changeUiIndices=function(e,t){for(var i=Object.keys(this.uiIndices),s=0;s<i.length;s++)this.uiIndices[i[s]]=this.uiIndices[i[s]].map(function(i){return i>=e?t?++i:--i:i})},s.prototype.addItem=function(e,t,i){for(var s=0;s<e.length;s++){var n=e[s];if(i.push(n),this.listViewInstance.setViewDataSource(i),this.domItemCount)if(this.domItemCount<this.expectedDomItemCount){if(this.listViewInstance.findItemFromDS(i,t)instanceof Array){if(this.listViewInstance.ulElement){l=this.listViewInstance.curViewDS.indexOf(n);this.createAndInjectNewItem(n,l),(r=this.listViewInstance.curViewDS[l-1])&&r.isHeader&&1===r.items.length&&(--l,this.createAndInjectNewItem(r,l))}this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")}}else{var l=this.listViewInstance.curViewDS.indexOf(n);this.addUiItem(l);var r=this.listViewInstance.curViewDS[l-1];r&&r.isHeader&&1===r.items.length&&this.addUiItem(l-1)}else!this.listViewInstance.template&&!this.listViewInstance.groupTemplate||this.isNgTemplate()||(this.listViewInstance.listBaseOption.template=null,this.listViewInstance.listBaseOption.groupTemplate=null,this.listViewInstance.listBaseOption.itemCreated=this.createUIItem.bind(this)),this.uiVirtualization()}},s.prototype.createAndInjectNewItem=function(t,i){var s,n=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,[t],this.listViewInstance.listBaseOption,null,null,this);s=Object.keys(this.listViewInstance.curViewDS).length-1===i?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+2]),this.listViewInstance.ulElement.insertBefore(n[0],s),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},s.prototype.createUIItem=function(e){var i=this.listViewInstance.template,s=this.listViewInstance.createElement("div"),n='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>";if(this.listViewInstance.showCheckBox){if(this.listViewInstance.renderCheckbox(e),!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox)&&!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML)){var l=document.createElement("div");l.innerHTML=this.listViewInstance.template||n,l.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?l.children[0].classList.add("e-checkbox-left"):l.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?l.children[0].insertBefore(this.listViewInstance.virtualCheckBox,l.childNodes[0].children[0]):l.children[0].appendChild(this.listViewInstance.virtualCheckBox),this.listViewInstance.template=l.innerHTML}s.innerHTML=this.listViewInstance.template,this.listViewInstance.template=i}else s.innerHTML=this.listViewInstance.template||n;var r=s.getElementsByTagName("*"),a=this.listViewInstance.createElement("div");this.listViewInstance.fields.groupBy&&(a.innerHTML=this.listViewInstance.groupTemplate||n);var o=a.getElementsByTagName("*");e.curData.isHeader&&(this.headerData=e.curData),this.templateData=e.curData.isHeader?e.curData.items[0]:e.curData,e.item.innerHTML="",e.item.context={data:e.curData,nodes:{flatTemplateNodes:[],groupTemplateNodes:[]}};for(c=0;c<r.length;c++)this.compileTemplate(r[c],e.item,!1);for(var c=0;c<o.length;c++)this.compileTemplate(o[c],e.item,!0);e.item.context.template=e.curData.isHeader?s.firstElementChild:a.firstElementChild,e.item.context.type=e.curData.isHeader?"flatList":"groupList";var h=e.curData.isHeader?a:s;e.item.insertBefore(h.firstElementChild,null)},s.prototype.compileTemplate=function(e,t,i){this.textProperty(e,t,i),this.classProperty(e,t,i),this.attributeProperty(e,t,i)},s.prototype.onChange=function(e,i){i.context.data=e;var s=i.context.nodes.groupTemplateNodes,n=i.context.nodes.flatTemplateNodes;if(!t.isNullOrUndefined(e.isHeader)&&e.isHeader&&"groupList"===i.context.type){l=i.firstElementChild;t.detach(i.firstElementChild),i.insertBefore(i.context.template,null),i.context.template=l,i.context.type="flatList";for(r=0;r<s.length;r++)s[r].onChange(e)}else if(e.isHeader||"flatList"!==i.context.type)if(e.isHeader)for(r=0;r<s.length;r++)s[r].onChange(e);else for(r=0;r<n.length;r++)n[r].onChange(e);else{var l=i.firstElementChild;t.detach(i.firstElementChild),i.insertBefore(i.context.template,null),i.context.template=l,i.context.type="groupList";for(var r=0;r<n.length;r++)n[r].onChange(e)}},s.prototype.updateContextData=function(e,t,i){i?e.context.nodes.groupTemplateNodes.push(t):e.context.nodes.flatTemplateNodes.push(t)},s.prototype.classProperty=function(e,i,s){for(var n,l=new RegExp("\\${([^}]*)}","g"),r=[];null!==n;){var a=l.exec(e.className);r.push(a),null===(n=a)&&r.pop()}if(r&&r.length)for(var o=this,c=0;c<r.length;c++)!function(n){var l,a=r[n];l=-1!==a[1].indexOf("?")&&-1!==a[1].indexOf(":")?new Function("data","return "+a[1].replace(/\$/g,"data.")):new Function("data","return data."+a[1]);var c={};c.bindedvalue=l(s?o.headerData:o.templateData),c.onChange=function(i){c.bindedvalue&&t.removeClass([e],c.bindedvalue.split(" ").filter(function(e){return e}));var s=l(i);s&&t.addClass([e],s.split(" ").filter(function(e){return e})),c.bindedvalue=s};for(var h=a[0].split(" "),d=0;d<h.length;d++)e.classList.remove(h[d]);c.bindedvalue&&t.addClass([e],c.bindedvalue.split(" ").filter(function(e){return e})),o.updateContextData(i,c,s)}(c)},s.prototype.attributeProperty=function(e,t,i){for(var s=[],n=0;n<e.attributes.length;n++)s.push(e.attributes[n].nodeName);-1!==s.indexOf("class")&&s.splice(s.indexOf("class"),1);for(var l=this,n=0;n<s.length;n++)!function(n){var r,a,o=s[n],c=new RegExp("\\${([^}]*)}","g").exec(o)||[],h=new RegExp("\\${([^}]*)}","g").exec(e.getAttribute(o))||[];if(c.length||h.length){c[1]&&(r=new Function("data","return data."+c[1])),h[1]&&(a=-1!==h[1].indexOf("?")&&-1!==h[1].indexOf(":")?new Function("data","return "+h[1].replace(/\$/g,"data.")):new Function("data","return data."+h[1]));var d={};d.bindedvalue=i?[void 0===c[1]?void 0:r(l.headerData),void 0===h[1]?void 0:a(l.headerData)]:[void 0===c[1]?void 0:r(l.templateData),void 0===h[1]?void 0:a(l.templateData)],d.attrName=void 0===d.bindedvalue[0]?o:d.bindedvalue[0],d.onChange=function(t){var i=void 0===d.bindedvalue[1]?e.getAttribute(d.attrName):a(t);e.removeAttribute(d.attrName),d.attrName=void 0===d.bindedvalue[0]?d.attrName:r(t),e.setAttribute(d.attrName,i),d.bindedvalue=[void 0===d.bindedvalue[0]?void 0:r(t),void 0===d.bindedvalue[1]?void 0:a(t)]};var u=void 0===d.bindedvalue[1]?e.getAttribute(o):d.bindedvalue[1];e.removeAttribute(o),e.setAttribute(d.attrName,u),l.updateContextData(t,d,i)}}(n)},s.prototype.textProperty=function(e,t,i){for(var s,n=new RegExp("\\${([^}]*)}","g"),l=[];null!==s;){var r=n.exec(e.innerText);l.push(r),null===(s=r)&&l.pop()}var a=Array.prototype.some.call(e.children,function(e){return!!new RegExp("\\${([^}]*)}","g").exec(e.innerText)});if(l&&l.length&&!a)for(var o=this,c=0;c<l.length;c++)!function(s){var n,r=l[s],a={};n=-1!==r[1].indexOf("?")&&-1!==r[1].indexOf(":")?new Function("data","return "+r[1].replace(/\$/g,"data.")):new Function("data","return data."+r[1]),a.bindedvalue=n(i?o.headerData:o.templateData),a.onChange=function(t){e.innerText=e.innerText.replace(a.bindedvalue,n(t)),a.bindedvalue=n(t)},e.innerText=e.innerText.replace(r[0],a.bindedvalue),o.updateContextData(t,a,i)}(c)},s.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&t.detach(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},s.prototype.updateUI=function(t,i,s){var n=this.isNgTemplate()?this.onNgChange:this.onChange;if(this.listViewInstance.template||this.listViewInstance.groupTemplate){var l=this.listViewInstance.curViewDS[i];t.dataset.uid=l[this.listViewInstance.fields.id]?l[this.listViewInstance.fields.id]:e.ListBase.generateId(),n(l,t,this)}else this.updateUiContent(t,i);this.changeElementAttributes(t,i),s&&this.listViewInstance.ulElement.insertBefore(t,s)},s.prototype.onNgChange=function(e,i,s){for(var n=t.compile(s.listViewInstance.template)(e);i.lastChild;)i.removeChild(i.lastChild);i.appendChild(n[0])},s.prototype.getModuleName=function(){return"virtualization"},s.prototype.destroy=function(){this.wireScrollEvent(!0)},s}(),m=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,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},v=function(e){function i(i,s){var n=e.call(this,s,i)||this;return n.getHelper=function(e){var i=n.getSortableElement(e.sender.target);if(!n.isValidTarget(i,n))return!1;var s;return n.helper?s=n.helper({sender:i,element:e.element}):((s=i.cloneNode(!0)).style.width=i.offsetWidth+"px",s.style.height=i.offsetHeight+"px"),t.addClass([s],["e-sortableclone"]),t.removeClass([s],["e-listboxtool-container"]),document.body.appendChild(s),s},n.onDrag=function(e){n.trigger("drag",{event:e.event,element:n.element,target:e.target});var i=n.getSortableInstance(e.target),s=n.getSortableElement(e.target,i);if((n.isValidTarget(s,i)||e.target.className.indexOf("e-list-group-item")>-1)&&(n.curTarget!==s||!t.isNullOrUndefined(i.placeHolder))&&(!i.placeHolderElement||i.placeHolderElement!==e.target)){if(e.target.className.indexOf("e-list-group-item")>-1&&(s=e.target),n.curTarget=s,n.target===s)return;var l=n.getIndex(i.placeHolderElement,i),r=n.getPlaceHolder(s,i),a=void 0;if(r){l=t.isNullOrUndefined(l)?n.getIndex(n.target):l,a=n.getIndex(s,i,e.event);var o=n.isPlaceHolderPresent(i);if(o&&l===a)return;o&&t.remove(i.placeHolderElement),i.placeHolderElement=r,e.target.className.indexOf("e-list-group-item")>-1?i.element.insertBefore(i.placeHolderElement,i.element.children[a]):i.element!==n.element&&a===i.element.childElementCount?i.element.appendChild(i.placeHolderElement):i.element.insertBefore(i.placeHolderElement,i.element.children[a]),n.refreshDisabled(l,a,i)}else{l=t.isNullOrUndefined(l)?n.getIndex(n.target):n.getIndex(s,i)<l||!l?l:l-1,a=n.getIndex(s,i);var c=i.element!==n.element?a:l<a?a+1:a;n.updateItemClass(i),i.element.insertBefore(n.target,i.element.children[c]),n.refreshDisabled(l,a,i),n.curTarget=n.target,n.trigger("drop",{droppedElement:n.target,element:i.element,previousIndex:l,currentIndex:a,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:n.scope})}}if(i=n.getSortableInstance(n.curTarget),t.isNullOrUndefined(s)&&e.target!==i.placeHolderElement)n.isPlaceHolderPresent(i)&&n.removePlaceHolder(i);else{var h;[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(h=n.getSortableInstance(e)).element&&h!==i&&n.removePlaceHolder(h)})}},n.onDragStart=function(e){n.target=n.getSortableElement(e.target);var i=!1;n.target.classList.add("e-grabbed"),n.curTarget=n.target,e.helper=document.getElementsByClassName("e-sortableclone")[0];var s={cancel:!1,element:n.element,target:n.target};n.trigger("beforeDragStart",s,function(t){t.cancel&&(i=t.cancel,n.onDragStop(e))}),i||(t.isBlazor?n.trigger("dragStart",{event:e.event,element:n.element,target:n.target,bindEvents:e.bindEvents,dragElement:e.dragElement}):n.trigger("dragStart",{event:e.event,element:n.element,target:n.target}))},n.onDragStop=function(e){var i,s,l,r=n.getSortableInstance(n.curTarget);i=n.getIndex(n.target);var a=n.isPlaceHolderPresent(r);if(a){var o=n.getIndex(r.placeHolderElement,r),c=n===r&&i-o>0?i-1:i,h={previousIndex:c,currentIndex:n.curTarget===n.target?c:o,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1,handled:!1};n.trigger("beforeDrop",h,function(s){if(!s.cancel){if(l=s.handled,n.updateItemClass(r),s.handled){var a=n.target.cloneNode(!0);n.target.classList.remove("e-grabbed"),n.target=a}r.element.insertBefore(n.target,r.placeHolderElement);var o=n.getIndex(n.target,r);i=n===r&&i-o>1?i-1:i,n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:o,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope,handled:l})}t.remove(r.placeHolderElement)})}if(r=n.getSortableInstance(e.target),s=r.element.childElementCount,i=n.getIndex(n.target),r.element===e.target||!a&&n.curTarget===n.target){var d={previousIndex:i,currentIndex:n.curTarget===n.target?i:s,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1};n.trigger("beforeDrop",d,function(t){r.element!==e.target||t.cancel||(n.updateItemClass(r),r.element.appendChild(n.target),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:s,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope}))})}n.target.classList.remove("e-grabbed"),n.target=null,n.curTarget=null,t.remove(e.helper),t.getComponent(n.element,t.Draggable).intDestroy(e.event)},n.bind(),n}m(i,e),s=i,i.prototype.bind=function(){this.element.id||(this.element.id=t.getUniqueID("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},i.prototype.initializeDraggable=function(){new t.Draggable(this.element,{helper:this.getHelper,dragStart:this.onDragStart,drag:this.onDrag,dragStop:this.onDragStop,dragTarget:"."+this.itemClass,enableTapHold:!0,tapHoldThreshold:200,queryPositionInfo:this.queryPositionInfo,distance:5})},i.prototype.getPlaceHolder=function(e,t){if(t.placeHolder){var i=t.placeHolder({element:t.element,grabbedElement:this.target,target:e});return i.classList.add("e-sortable-placeholder"),i}return null},i.prototype.isValidTarget=function(e,i){return e&&t.compareElementParent(e,i.element)&&e.classList.contains(i.itemClass)&&!e.classList.contains("e-disabled")},i.prototype.removePlaceHolder=function(e){t.remove(e.placeHolderElement),e.placeHolderElement=null},i.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},i.prototype.getSortableInstance=function(e){if(e=t.closest(e,".e-"+this.getModuleName())){var i=t.getComponent(e,s);return i.scope&&this.scope&&i.scope===this.scope?i:this}return this},i.prototype.refreshDisabled=function(e,t,i){if(i===this)for(var s=void 0,n=e<t,l=void 0,r=n?e:t,a=n?t:e;r<=a;)(s=this.element.children[r]).classList.contains("e-disabled")?(l=this.getIndex(s),this.element.insertBefore(s,this.element.children[n?l+2:l-1]),r=n?l+2:l+1):r++},i.prototype.getIndex=function(e,i,s){void 0===i&&(i=this);var n,l;return[].slice.call(i.element.children).forEach(function(i,r){if(i.classList.contains("e-sortable-placeholder")&&(l=!0),i!==e);else if(n=r,!t.isNullOrUndefined(s)){l&&(n-=1);var a=e.getBoundingClientRect(),o=a.bottom-(a.bottom-a.top)/2;n=s.clientY<=o?n:n+1}}),n},i.prototype.getSortableElement=function(e,i){return void 0===i&&(i=this),t.closest(e,"."+i.itemClass)},i.prototype.queryPositionInfo=function(e){return e.left=pageXOffset?parseFloat(e.left)-pageXOffset+"px":e.left,e.top=pageYOffset?parseFloat(e.top)-pageYOffset+"px":e.top,e},i.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!t.closest(e.placeHolderElement,"#"+e.element.id)},i.prototype.moveTo=function(e,t,i){l(this.element,e,t,i)},i.prototype.destroy=function(){"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),t.getComponent(this.element,t.Draggable).destroy(),e.prototype.destroy.call(this)},i.prototype.getModuleName=function(){return"sortable"},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"itemClass":[].slice.call(this.element.children).forEach(function(i){i.classList.contains(t.itemClass)&&i.classList.remove(t.itemClass),e.itemClass&&i.classList.add(e.itemClass)})}};var s;return f([t.Property(!1)],i.prototype,"enableAnimation",void 0),f([t.Property(null)],i.prototype,"itemClass",void 0),f([t.Property(null)],i.prototype,"scope",void 0),f([t.Property()],i.prototype,"helper",void 0),f([t.Property()],i.prototype,"placeHolder",void 0),f([t.Event()],i.prototype,"drag",void 0),f([t.Event()],i.prototype,"beforeDragStart",void 0),f([t.Event()],i.prototype,"dragStart",void 0),f([t.Event()],i.prototype,"beforeDrop",void 0),f([t.Event()],i.prototype,"drop",void 0),i=s=f([t.NotifyPropertyChanges],i)}(t.Base);return u.Inject(p),e.classNames=h,e.FieldSettings=d,e.ListView=u,e.Virtualization=p,e.getFieldValues=n,e.Sortable=v,e.moveTo=l,e}({},ej.base,ej.data,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-navigations.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.navigations=function(e,t,i,s,n,r,l){"use strict";function o(e,t,i,s,n,r){var l,o,d=t.parentElement;if("vscroll"===s?(l=r||t.getBoundingClientRect().height,o=i.getBoundingClientRect().height):(l=t.getBoundingClientRect().width,o=i.getBoundingClientRect().width),l<o)return a(e,t,i,s,n,r);if(d){var h=d.getBoundingClientRect().width;return h<l&&"hscroll"===s?(o=h,t.style.maxWidth=h+"px",a(e,t,i,s,n,r)):i}return i}function a(e,i,s,n,r,l){var o=e("div",{className:"e-menu-"+n});i.appendChild(o),o.appendChild(s),l?(o.style.overflow="hidden",o.style.height=l+"px"):(o.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new m({enableRtl:r},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new p({enableRtl:r},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,o}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,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},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");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,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];i.appendChild(o)}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 l=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(l,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=this.createElement("div",{id:t.concat("_right"),className:i});s.setAttribute("aria-disabled","false");var n=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"}),r="e-"+e.id.concat("_nav e-scroll-nav e-scroll-left-nav"),l=this.createElement("div",{id:t.concat("_left"),className:r+" e-overlay"});l.setAttribute("aria-disabled","true");var o=this.createElement("div",{className:"e-nav-left-arrow e-nav-arrow e-icons"});l.appendChild(o),s.appendChild(n),e.appendChild(s),e.insertBefore(l,e.firstChild),this.ieCheck&&(s.classList.add("e-ie-align"),l.classList.add("e-ie-align")),this.eventBinding([s,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},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.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,n=this.element.querySelector(".e-scroll-left-nav"),r=this.element.querySelector(".e-scroll-right-nav"),l=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||(l=this.element.querySelector(".e-scroll-right-overlay"),o=this.element.querySelector(".e-scroll-left-overlay")),l.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.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(n,r):this.arrowDisabling(r,n);else if(Math.ceil(i+a+.1)>=t.scrollWidth)!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(r,n):this.arrowDisabling(n,r);else{var d=this.element.querySelector(".e-scroll-nav.e-overlay");d&&(d.classList.remove("e-overlay"),d.setAttribute("aria-disabled","false"),d.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,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},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 l=r[n];e.appendChild(l)}i.appendChild(e),s.appendChild(i),i.style.overflowY="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"]);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,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];i.appendChild(o)}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}),l=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"});r.appendChild(l);var o=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(o,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"}),l="e-"+e.id.concat("_nav e-scroll-nav e-scroll-up-nav"),o=t.createElement("div",{id:i.concat("_up"),className:l+" e-overlay"});o.setAttribute("aria-disabled","true");var a=t.createElement("div",{className:"e-nav-up-arrow e-nav-arrow e-icons"});o.appendChild(a),n.appendChild(r),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(o,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),o.classList.add("e-ie-align")),this.eventBinding([n,o])},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"),l=this.element.querySelector(".e-scroll-down-overlay"),o=t.scrollTop;if(o<=0&&(o=-o),this.isDevice&&(r.style.height=o<40?o+"px":"40px",t.scrollHeight-Math.ceil(i+o)<40?l.style.height=t.scrollHeight-Math.ceil(i+o)+"px":l.style.height="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var a=this.element.querySelector(".e-scroll-nav.e-overlay");a&&(a.classList.remove("e-overlay"),a.setAttribute("aria-disabled","false"),a.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),v=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)}}(),g=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},y="e-focused",b="e-menu-header",C="e-selected",N="e-menu-item",E="e-menu-hide",x="e-menu-popup",O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("id")],i.prototype,"itemId",void 0),g([t.Property("parentId")],i.prototype,"parentId",void 0),g([t.Property("text")],i.prototype,"text",void 0),g([t.Property("iconCss")],i.prototype,"iconCss",void 0),g([t.Property("url")],i.prototype,"url",void 0),g([t.Property("separator")],i.prototype,"separator",void 0),g([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),S=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property(null)],i.prototype,"iconCss",void 0),g([t.Property("")],i.prototype,"id",void 0),g([t.Property(!1)],i.prototype,"separator",void 0),g([t.Collection([],i)],i.prototype,"items",void 0),g([t.Property("")],i.prototype,"text",void 0),g([t.Property("")],i.prototype,"url",void 0),i}(t.ChildProperty),w=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("SlideDown")],i.prototype,"effect",void 0),g([t.Property(400)],i.prototype,"duration",void 0),g([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),I=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}return v(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"),l=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,a=s.attributes.length;o<a;o++)r.setAttribute(s.attributes[o].nodeName,s.attributes[o].nodeValue);s.parentNode.insertBefore(l,s),t.detach(s),s=r,l.appendChild(s),t.setValue("ej2_instances",n,s),this.clonedElement=l,this.element=s,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;if(this.initialize(),this.renderItems(),this.isMenu&&this.template&&t.isBlazor()){var i=this.element.id+"Template";t.resetBlazorTemplate(i,"Template"),Object.keys(t.blazorTemplates).length&&t.extend(this.tempItem,t.blazorTemplates[i],[],!0),t.updateBlazorTemplate(i,"Template",this)}this.wireEvents(),this.renderComplete();var s=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){o(e.createElement,s,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.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.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&&(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling)){var n=this.getWrapper();this.element.classList.contains("e-vertical")?o(this.createElement,n,this.element,"vscroll",this.enableRtl):o(this.createElement,n,this.element,"hscroll",this.enableRtl)}},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),r=0,l=n.length;r<l;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 o=0,a=s.getScrollableParent(this.targetElement);o<a.length;o++){var d=a[o];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.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+N})},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"),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.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":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?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();return(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&("downarrow"===i||"rightarrow"===i?t++:t--),((e=s.children[t]).classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){if(void 0===e&&(e=this.navIdx.length),this.isMenu){var i=[this.getWrapper()].concat([].slice.call(t.selectAll("."+x)))[e];return t.isNullOrUndefined(i)?null:t.select(".e-menu-parent",i)}return this.getWrapper().children[e]},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),l=this.getItem(r);l.items.length?(this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,l,-1,-1,e)):"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:l,event:e},this.trigger("select",t),this.closeMenu(null,e))}},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.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 l,o,a=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,v=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&v.classList.contains("e-menu")&&((a=this.getLIByClass(v,C))&&a.classList.remove(C),u=!0),!u){var g=i&&i.target&&this.getLI(i.target);l=this.navIdx.length?this.getItem(this.navIdx):null,o=l?l.items:this.items,c={element:v,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(l,e):l,items:o,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(a){var h,c,p,u="",f=!a.cancel;(f||r.isCMenu)&&(r.isMenu?(h=t.closest(v,"."+x),r.hamburgerMode&&(h.parentElement.style.minHeight="",t.closest(v,".e-menu-item").setAttribute("aria-expanded","false")),r.unWireKeyboardEvent(h),d(t.getInstance(h.children[0],m),h.children[0]),(p=t.getInstance(h,s.Popup)).hide(),u=h.id,p.destroy(),t.detach(h)):r.toggleAnimation(v,!1),c={element:v,parentItem:l,items:o},r.trigger("onClose",c),r.navIdx.pop()),r.updateReactTemplate();var b,N,E,O=r.getWrapper()&&r.getUlByNavIdx();r.isCMenu&&(r.canOpen(i.target)&&r.openMenu(null,null,r.pageY,r.pageX,i),r.isCMenu=!1),r.isMenu&&O&&u.length&&(b=new RegExp("(.*)-ej2menu-"+r.element.id+"-popup").exec(u)[1],N=O.querySelector('[id="'+b+'"]'),E=g&&O.querySelector('[id="'+g.id+'"]'));var S=g&&g.querySelectorAll(".e-menu-item");if(f&&r.hamburgerMode&&e&&!S.length)r.afterCloseMenu(i);else if(f&&!r.hamburgerMode&&r.navIdx.length&&N&&!E){var w=i&&i.target.classList.contains("e-vscroll")?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)):r.closeMenu(r.navIdx[r.navIdx.length-1],i)}else if(f&&!n&&!e&&(r.hamburgerMode&&r.navIdx.length||1===r.navIdx.length))r.closeMenu(null,i);else if(f&&t.isNullOrUndefined(e)&&r.navIdx.length)r.closeMenu(null,i);else if(!f||r.isMenu||e||0!==r.navIdx.length||r.isMenusClosed)if(f&&r.isMenu&&i&&i.target&&0!==r.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))r.closeMenu(0,i);else{if(!f||"right"!==r.keyType&&"click"!==r.keyType){var I=r.getUlByNavIdx(),k=r.getLIByClass(I,C);if(k&&(k.setAttribute("aria-expanded","false"),k.classList.remove(C),a.isFocused&&g&&(k.classList.add(y),k.focus())),!f&&r.hamburgerMode&&g&&"false"===g.getAttribute("aria-expanded")&&"true"===g.getAttribute("aria-haspopup")){t.closest(g,".e-menu-parent.e-control")?r.navIdx=[]:r.navIdx.pop(),r.navIdx.push(r.cliIdx);var L=r.getItem(r.navIdx);g.setAttribute("aria-expanded","true"),r.openMenu(g,L,-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=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("."+N))&&e.getIndex(s.querySelector("."+N).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,l,o){var a=this;void 0===n&&(n=0),void 0===r&&(r=0),void 0===l&&(l=null),void 0===o&&(o=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"},p=new S(this.items[0],"items",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.split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,l,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,l,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(){a.triggerBeforeOpen(e,a.uList,i,l,n,r,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none"))}else this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(o||this.element).toString(),this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none");if(this.isMenu&&this.template&&t.isBlazor()){var f=this.element.id+"Template";if(Object.keys(t.blazorTemplates).length){var m=t.blazorTemplates[f];this.tempItem=this.tempItem.concat(m),t.blazorTemplates[f]=this.tempItem}t.updateBlazorTemplate(f,"Template",this)}},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"),l=getComputedStyle(r),o=parseInt(l.marginRight,10)+r.offsetWidth+s,a=0;a<n.length;a++)n[a].style.textIndent=o+"px"},n.prototype.generatePopup=function(e,i,n,r){var l=this,o=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",o.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",o.element);o.element.style.maxHeight="",i.focus(),l.triggerOpen(i)}});return o},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,l,a){var d=this,h=e?s[this.getField("children",this.navIdx.length-1)]:this.items,c={element:i,items:h,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(s,this.navIdx.length-1):s,event:n,cancel:!1,top:r,left:l,showSubMenuOn:"Auto"},p=a;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&&o(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;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:"."+N}),d.popupWrapper.style.left=d.left+"px",d.popupWrapper.style.top=d.top+"px";var l="None"!==d.animationSettings.effect?{name:d.animationSettings.effect,duration:d.animationSettings.duration,timingFunction:d.animationSettings.easing}:null;d.popupObj.show(l,d.lItem)}else d.setBlankIconStyle(d.uList),d.setPosition(d.lItem,d.uList,d.top,d.left),d.toggleAnimation(d.uList);if("right"===d.keyType){var a=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(),a=d.getUlByNavIdx();var c=d.isValidLI(a.children[0],0,d.action);a.children[c].classList.add(y),a.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)"),s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},r=getComputedStyle(s),l=parseInt(r.fontSize,10);parseInt(r.width,10)&&parseInt(r.width,10)>l&&(l=parseInt(r.width,10));var o=l+parseInt(r[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=o})}}},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,"."+N),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var r=n.scrollLeft+n.offsetWidth,l=s.offsetLeft+s.offsetWidth;r<l&&(n.scrollLeft+=l-r)}},n.prototype.setPosition=function(e,i,n,r){if(this.toggleVisiblity(i),i===this.element||r>-1&&n>-1){if((d=s.isCollide(i,null,r,n)).indexOf("right")>-1&&(r-=i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top-20)<0){var l=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;l>-1&&(n=l)}(d=s.isCollide(i,null,r,n)).indexOf("left")>-1&&(r=(a=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 o=this.enableRtl?"left":"right",a=s.calculatePosition(e,o,"top");n=a.top,r=a.left;var d=s.isCollide(i,null,this.enableRtl?r-i.offsetWidth:r,n),h=d.indexOf("left")>-1||d.indexOf("right")>-1;h&&(r=(a=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||h)&&(r=this.enableRtl&&h?r:r-i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top)}this.toggleVisiblity(i,!1),i.style.top=n+"px",i.style.left=r+"px"},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);if(t.isBlazor()&&this.template&&e.length&&e[0].properties){var l=[];e.forEach(function(e,i){l.push({}),l[i][r.text]=e[r.text],e[r.id]||(e[r.id]=t.getUniqueID("menuitem")),l[i][r.id]=e[r.id],l[i][r.iconCss]=e[r.iconCss],l[i][r.url]=e[r.url],l[i][r.child]=e[r.child],l[i][r.separator]=e[r.separator]}),e=l}var 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")),e.curData.htmlAttributes={role:"menuitem",tabindex:"-1"},s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]),""===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.item.removeAttribute("role")),!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"),s.isMenu||e.item.removeAttribute("role"),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"));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 d=i.ListBase.createList(this.createElement,e,a,!this.template,this);return d.setAttribute("tabindex","0"),this.isMenu&&d.setAttribute("role","menu"),d},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i;var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),r=this.getWrapper(),l=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(n){if((""!==n.id?l.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([y,C],[this.getWrapper()]),!this.navIdx.length)return;o=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!o?(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&&!o&&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?o&&!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)}},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){t.closest(e.target,".e-menu-wrapper").querySelector("ul.e-menu-parent").id===this.element.id&&(this.element.classList.contains("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){if(this.isTapHold)this.isTapHold=!1;else{var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),l=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&l&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===l.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([y],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&l&&this.isMenu){var a=l.id?r.exec(l.id)[1]:l.querySelector(".e-menu-parent").id;if(this.element.id!==a)return}if(o&&"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(o&&("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(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.closeMenu(u+1,e),this.showItemOnClick&&this.setLISelected(n)}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if(this.isMenu&&"DIV"===s.tagName&&this.navIdx.length&&t.closest(s,".e-menu-vscroll")){var m=t.closest(s,"."+x),v=Array.prototype.indexOf.call(this.getPopups(),m)+1;v<this.navIdx.length&&(this.closeMenu(v+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("."+N).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([C],[i]),n&&n.querySelector(".e-caret")||this.closeMenu(null,e))}},n.prototype.afterCloseMenu=function(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(),l=this.getLIByClass(r,C);l&&(l.setAttribute("aria-expanded","false"),l.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){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=t||e.id,n=!1!==i,r=this.getIndex(s,n),l=this.getItem(r);l.iconCss=e.iconCss,l.id=e.id,l.text=e.text,l.url=e.url,l.separator=e.separator,l.items=e.items},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=Array.prototype.indexOf.call(e.querySelectorAll("li"),i);return n=this.isMenu&&this.template&&t.isBlazor()?Array.prototype.indexOf.call(e.querySelectorAll(i.tagName),i):Array.prototype.indexOf.call(e.children,i),s&&e.children[0].classList.contains(b)&&n--,n},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,l=0,a=Object.keys(e);l<a.length;l++)!function(l){switch(l){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.split(" "));break;case"enableRtl":n.classList.toggle("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var a;r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){a=t.select(".e-ul",e),o(s.createElement,e,a,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")?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(Object.keys(i.items).length)for(var v=Object.keys(e.items),g=0;g<v.length;g++)(u=r.getChangedItemIndex(e,[],Number(v[g]))).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.hamburgerMode)for(var g=1,y=n.childElementCount;g<y;g++)t.detach(n.lastElementChild);r.isMenu&&t.isBlazor()?r.updateItemsByNavIdx():r.navIdx=[]}}}(a[l])},n.prototype.updateItem=function(e,i){t.isBlazor()?e=this.removeChildElement(e):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,l=t.selectAll(e),o=0,a=l.length;o<a;o++)n=l[o],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,"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,t){var i=this;void 0===t&&(t=!0);var s,n;"None"!==this.animationSettings.effect&&t?this.animation.animate(e,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){i.hamburgerMode?(n=e.element.parentElement,e.element.style.position="absolute",s=n.offsetHeight,e.element.style.maxHeight=e.element.offsetHeight+"px",n.style.maxHeight=""):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){i.hamburgerMode&&(n.style.minHeight=s+e.element.offsetHeight+"px")},end:function(e){i.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",n.style.minHeight="",e.element.style.top="0px",e.element.children[0].focus(),i.triggerOpen(e.element.children[0])):i.end(e.element,t)}}):this.end(e,t)},n.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,i={element:e,parentItem:t,items:t?t.items:this.items};this.trigger("onOpen",i)},n.prototype.end=function(e,i){if(i)if(e.style.display="block",e.style.maxHeight="",this.triggerOpen(e),e.querySelector("."+y))e.querySelector("."+y).focus();else{var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];s?s.querySelector("."+C).focus():this.element.focus()}else if(e===this.element){var n=this.getLIByClass(this.element,y);n&&n.classList.remove(y);var r=this.getLIByClass(this.element,C);r&&r.classList.remove(C),e.style.display="none"}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 l;r=n?r+1:0;for(var o=0,a=i.length;o<a;o++){if(l=i[o],(t?l[this.getField("itemId",r)]:l[this.getField("text",r)])===e){s.push(o);break}if(l[this.getField("children",r)]&&l[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,l[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(o);break}o!==a-1&&s.pop()}else o===a-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,l,o,a="e-disabled",d=0;d<e.length;d++){if(l=this.getIndex(e[d],s),this.navIdx.length){if(1!==l.length){o=!1;for(var h=0,c=l.length-1;h<c;h++)if(l[h]!==this.navIdx[h]){o=!0;break}if(o)continue}}else if(1!==l.length)continue;r=l.pop(),(n=this.getUlByNavIdx(l.length))&&(i?this.isMenu?(n.children[r].classList.remove(a),n.children[r].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(a):n.children[r].classList.remove(a):this.isMenu?(n.children[r].classList.add(a),n.children[r].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(a):n.children[r].classList.add(a))}},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,i,s){for(var n,r,l,o=0;o<e.length;o++)r=(l=this.getIndex(e[o],s)).pop(),(n=this.getUlByNavIdx(l.length))&&(i?t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(E):n.children[r].classList.add(E):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(E):n.children[r].classList.remove(E))},n.prototype.removeItems=function(e,t){for(var i,s,n,r=0;r<e.length;r++)i=(s=this.getIndex(e[r],t)).pop(),n=this.getItems(s),this.removeItem(n,s,i)},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,l,o,a,d,h=0;h<e.length;h++){l=(o=this.getIndex(i,s)).pop(),a=this.getItems(o),d=new S(a[0],"items",e[h],!0),a.splice(n?l+1:l,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(o.length<c.length){l=n?l+1:l,r=this.createItems(a).children[l];var p=this.isMenu?t.select(".e-menu-parent",c[o.length]):c[o.length];p.insertBefore(r,p.children[l])}}},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.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.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}this.isMenu&&this.clonedElement?(t.detach(this.element),i.style.display="",i.classList.remove("e-"+this.getModuleName()+"-wrapper"),i.removeAttribute("data-ripple")):t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}},g([t.Event()],n.prototype,"beforeItemRender",void 0),g([t.Event()],n.prototype,"beforeOpen",void 0),g([t.Event()],n.prototype,"onOpen",void 0),g([t.Event()],n.prototype,"beforeClose",void 0),g([t.Event()],n.prototype,"onClose",void 0),g([t.Event()],n.prototype,"select",void 0),g([t.Event()],n.prototype,"created",void 0),g([t.Property("")],n.prototype,"cssClass",void 0),g([t.Property(0)],n.prototype,"hoverDelay",void 0),g([t.Property(!1)],n.prototype,"showItemOnClick",void 0),g([t.Property("")],n.prototype,"target",void 0),g([t.Property("")],n.prototype,"filter",void 0),g([t.Property(null)],n.prototype,"template",void 0),g([t.Property(!1)],n.prototype,"enableScrolling",void 0),g([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),g([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],n.prototype,"fields",void 0),g([t.Collection([],S)],n.prototype,"items",void 0),g([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},w)],n.prototype,"animationSettings",void 0),n=g([t.NotifyPropertyChanges],n)}(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)}}(),L=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},A="e-toolbar-items",D="e-toolbar-item",P="e-toolbar-popup",T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("")],i.prototype,"id",void 0),L([t.Property("")],i.prototype,"text",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),L([t.Property(!1)],i.prototype,"disabled",void 0),L([t.Property("")],i.prototype,"prefixIcon",void 0),L([t.Property("")],i.prototype,"suffixIcon",void 0),L([t.Property(!0)],i.prototype,"visible",void 0),L([t.Property("None")],i.prototype,"overflow",void 0),L([t.Property("")],i.prototype,"template",void 0),L([t.Property("Button")],i.prototype,"type",void 0),L([t.Property("Both")],i.prototype,"showTextOn",void 0),L([t.Property(null)],i.prototype,"htmlAttributes",void 0),L([t.Property("")],i.prototype,"tooltipText",void 0),L([t.Property("Left")],i.prototype,"align",void 0),L([t.Event()],i.prototype,"click",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.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return k(i,e),i.prototype.destroy=function(){var i=this;this.isReact&&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[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),e.prototype.destroy.call(this),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")});this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&this.element.appendChild(this.ctrlTem),this.clearProperty(),this.popObj=null,this.tbarAlign=null,this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach(function(e){return i.element.removeAttribute(e)})},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),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.element.setAttribute("tabIndex","0")},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),t.EventHandler.remove(document,"scroll",this.docEvent),t.EventHandler.remove(document,"click",this.docEvent)},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(){this.element&&[].slice.call(this.element.querySelectorAll("."+D)).forEach(function(e){t.detach(e)});var e=this.element.querySelector("."+A);this.tbarAlign&&([].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("."+D):this.element===i||e?this.element.querySelector("."+D+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )"):t.closest(i,"."+D)},i.prototype.keyHandling=function(e,i,s,n,r){var l,o,a=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");p?t.isVisible(this.popObj.element)&&(o=[].slice.call(p.children),l="home"===i.action?o[0]:o[o.length-1]):(o=this.element.querySelectorAll("."+A+" ."+D),l="home"===i.action?o[0]:o[o.length-1]),l&&this.elementFocus(l)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(a&&t.closest(s,".e-popup")){var u=a.element,f=u.firstElementChild;if("previous"===c&&f===e||"next"===c&&u.lastElementChild===e)return;this.eleFocus(e,c)}else"moveDown"===i.action&&a&&t.isVisible(a.element)&&this.elementFocus(e);break;case"tab":if(!r&&!n){var m=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(m),m.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":a&&"Extended"!==this.overflowMode&&a.hide(h);break;case"popupOpen":if(!n)return;a&&!t.isVisible(a.element)?(a.element.style.top=d.offsetHeight+"px",a.show({name:"FadeIn",duration:100})):a.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"),i.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),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)},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("."+D);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)}}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,r=!t.isNullOrUndefined(t.closest(s,".e-toolbar-pop")),l=s.classList,o=t.closest(s,".e-hor-nav");o||(o=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!l.contains("e-hor-nav")||(l=s.querySelector(".e-icons").classList),(l.contains("e-popup-up-icon")||l.contains("e-popup-down-icon"))&&this.popupClickHandler(n,o,"e-rtl");var a,d=t.closest(e.target,"."+D);if(!t.isNullOrUndefined(d)&&!d.classList.contains("e-overlay")||o.classList.contains("e-hor-nav")){d&&(a=this.items[this.tbarEle.indexOf(d)]);var h={originalEvent:e,item:a};a&&!t.isNullOrUndefined(a.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"}),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(n.element.style.minHeight="0px"),i.classList.add("e-nav-active"),n.show({name:"FadeIn",duration:100}))},i.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},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-haspopup":"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[n],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[n],t,n),(s=t.querySelector(".e-toolbar-"+e[n].align.toLowerCase()))?(e[n].showAlwaysInPopup&&"Show"!==e[n].overflow||this.tbarAlgEle[(e[n].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){!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.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("."+D,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"),l=e.querySelector(".e-scroll-nav"),o=0;return r?o=this.isVertical?r.offsetHeight:r.offsetWidth:l&&(o=this.isVertical?2*l.offsetHeight:2*l.offsetWidth),n>s-o},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+" ."+D,e))),this.element.querySelector(".e-hor-nav").setAttribute("tabIndex","0"),this.element.querySelector(".e-hor-nav").setAttribute("role","list")},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[r].offsetLeft<30&&0!==t[r].offsetLeft&&("MultiRow"===this.overflowMode?t[r].classList.add("e-multirow-separator"):"Extended"===this.overflowMode&&t[r].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,l=(n?e.offsetHeight:e.offsetWidth)-r;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,l,!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 l=e.element,o=[].slice.call(t.selectAll("."+P,l.querySelector("."+A))),a=t.selectAll(".e-overflow-show",s),d=0,h=0;o.forEach(function(l,o){a=t.selectAll(".e-overflow-show",s),l.classList.contains("e-overflow-show")&&a.length>0?e.tbResize&&a.length>o?(s.insertBefore(l,a[o]),++h):(s.insertBefore(l,s.children[a.length]),++h):l.classList.contains("e-overflow-show")?(s.insertBefore(l,s.firstChild),++h):e.tbResize&&l.classList.contains("e-overflow-hide")&&s.children.length>0&&0===a.length?(s.insertBefore(l,s.firstChild),++h):l.classList.contains("e-overflow-hide")?i.push(l):e.tbResize?(s.insertBefore(l,s.childNodes[d+h]),++d):s.appendChild(l),l.classList.contains("e-separator")?t.setStyleAttribute(l,{display:"",height:r+"px"}):t.setStyleAttribute(l,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+D,l.querySelector("."+A)),p=c.length-1;p>=0;p--){var u=c[p];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:not(."+P+")"),e="auto"===s.style.height||""===s.style.height?null:i.offsetHeight);var n,r=s.querySelector("."+D+":not(.e-separator):not(."+P+")"),l="auto"===s.style.height||""===s.style.height?null:r&&r.offsetHeight,o=[];if(t.select("#"+s.id+"_popup.e-toolbar-pop",s))n=t.select("#"+s.id+"_popup.e-toolbar-pop",s);else{var a=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?a:d}this.pushingPoppedEle(this,o,n,l,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){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(i),t.setStyleAttribute(this.element,{overflow:""});var r=window.getComputedStyle(this.element),l=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(l.appendTo(i),"Extended"===this.overflowMode&&(l.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth),l.offsetX=0),t.EventHandler.add(document,"scroll",this.docEvent.bind(this)),t.EventHandler.add(document,"click ",this.docEvent.bind(this)),l.element.style.maxHeight=l.element.offsetHeight+"px",this.isVertical&&(l.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 l.hide();this.popObj=l,this.element.setAttribute("aria-haspopup","true")}},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,l=r.querySelector(".e-hor-nav");t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px","Extended"===this.overflowMode&&(i.element.style.minHeight="");var o=n.offsetTop+n.offsetHeight+s.calculatePosition(r).top,a=l.firstElementChild;l.classList.add("e-nav-active"),t.classList(a,["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<o&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(o-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[c];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical){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"),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,l=this.popupPriCount>0,o=s,a=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[p]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[p]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),r=this.isVertical?i[p].offsetHeight:i[p].offsetWidth;var v=m?r+u:r;if(c(i[p],["e-popup-alone"])&&l&&(i[p].classList.add(P),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++),this.isVertical?i[p].offsetTop+i[p].offsetHeight+u>s:i[p].offsetLeft+i[p].offsetWidth+u>s){if(i[p].classList.contains("e-separator")){if("Extended"===this.overflowMode)d===h&&c(g=i[p],["e-separator","e-ignore"])&&(i[p].classList.add(P),h++),d++;else if("Popup"===this.overflowMode){if(a>0&&d===h){var g=i[p+d+(a-1)];c(g,["e-separator","e-ignore"])&&t.setStyleAttribute(g,{display:"none"})}a++,d=0,h=0}}else d++;i[p].classList.contains("e-overflow-show")&&n?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:c(i[p],["e-separator","e-ignore"])?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:(i[p].classList.add(P),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++)}}if(n){var y=t.selectAll("."+D+":not(."+P+")",this.element);this.checkPriority(e,y,o,!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","list"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,r,l,o,a){var d=a,h=this.popObj.element,c=t.selectAll("."+P+":not(.e-overflow-show)",h).length,p=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 u=e.children[i-(i-s)-1],f=!t.isNullOrUndefined(u)&&p(u,"e-ignore");if(!t.isNullOrUndefined(u)&&p(u,"e-separator")&&!t.isVisible(u)||f){u.style.display="inherit";var m=u.offsetWidth+2*parseFloat(window.getComputedStyle(u).marginRight),v=u.previousElementSibling;l+m<o||r?(e.insertBefore(n,e.children[i+d-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):v.classList.contains("e-separator")&&(v.style.display="none"),u.style.display=""}else e.insertBefore(n,e.children[i+d-(i-s)])}else e.insertBefore(n,e.children[i+d-c])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,r=this.isVertical,l=n.querySelector("."+A),o=n.querySelector(".e-hor-nav");if(!t.isNullOrUndefined(o)){l.removeAttribute("style"),e.style.display="block";var a;a=r?n.offsetHeight-(o.offsetHeight+l.offsetHeight):n.offsetWidth-(o.offsetWidth+l.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),a+(r?o.offsetHeight:o.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(a,e,i),e.style.display="",0===e.children.length&&o&&this.popObj&&(t.detach(o),o=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null,n.setAttribute("aria-haspopup","false"))}},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,l=this.popupPriCount>0,o=this.tbarEle,a=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")&&l&&!s)return"continue";var c=h.popupEleWidth(i);if(i===h.tbarEle[0]&&(c+=h.tbarEleMrgn),i.style.position="",!(c<e||s))return"break";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 p=h.items[r].align;r=h.tbarAlgEle[(p+"s").toLowerCase()].indexOf(i),o=h.tbarAlgEle[(p+"s").toLowerCase()],a=h.element.querySelector("."+A+" .e-toolbar-"+p.toLowerCase())}var u=0;"Extended"!==h.overflowMode&&o.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),u++)}),d=h.ignoreEleFetch(r,a),i.classList.contains("e-overflow-show")?(h.tbarPriRef(a,r,u,i,s,c,e,d),e-=i.offsetWidth):0===r?(a.insertBefore(i,a.firstChild),e-=i.offsetWidth):(n=t.selectAll(".e-overflow-show",h.popObj.element).length,a.insertBefore(i,a.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 l=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){l-=this.isVertical?n.offsetHeight:n.offsetWidth;var o=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=o:s[2].style.bottom=o:this.enableRtl?s[2].style.left=o:s[2].style.right=o}if(!(l<=e)){var a=(l-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+a+"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"})),n.push(this.createElement("div",{className:"e-toolbar-center"})),n.push(this.createElement("div",{className:"e-toolbar-right"})),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,l=n[0];[].slice.call(r).forEach(function(e){s.tbarAlgEle.lefts.push(e),l.appendChild(e)}),t.appendChild(l),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(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,D))})},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[n])?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 l=function(e,t){e?(t.classList.remove("e-overlay"),t.setAttribute("aria-disabled","false")):(t.classList.add("e-overlay"),t.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(r)&&r>=1){for(var o=0,a=[].slice.call(n);o<r;o++){var d=a[o];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[o]=s}else s=d;l(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;l(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]: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,l="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==l||(l=e.align)});for(var o=0,a=e;o<a.length;o++){var d=a[o];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+D,this.element),d.align=l,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"===l?this.tbarAlign?((c=t.closest(s[0],"."+A).children[h]).insertBefore(r,c.children[i]),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[i]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+A).children[h]).appendChild(r),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(r),this.refreshPositioning()),this.items.splice(i,0,d),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("."+D,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,l=[].slice.call(s);r<l.length;r++){o=l[r];i=this.tbarEle.indexOf(o),this.removeItemByIndex(i,n),n=t.selectAll("."+D,this.element)}else{var o=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(o),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[e]&&i[e]){var s=this.tbarEle.indexOf(i[e]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].indexOf(this.tbarEle[s]);this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].splice(n,1)}this.isReact&&this.clearTemplate();var r=i[e].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[e]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var r,l=s.type,o=e;if("object"==typeof e&&(r="function"==typeof o.appendTo),"string"!=typeof e&&r){if("Input"===l){var a=this.createElement("input");s.id?a.id=s.id:a.id=t.getUniqueID("tbr-ipt"),i.appendChild(a),o.appendTo(a)}}else{var d=void 0,h=e;h="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName)){if(document.querySelectorAll(h).length){var c=(a=document.querySelector(h)).outerHTML.trim();i.appendChild(a),a.style.display="",t.isNullOrUndefined(c)||this.tempId.push(h)}}else i.appendChild(e)}catch(e){d=t.compile(h)}var p=void 0;t.isNullOrUndefined(d)||(p=d({},this,"template",this.element.id+n+"_template",this.isStringTemplate)),!t.isNullOrUndefined(p)&&p.length>0&&[].slice.call(p).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template"),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,l,o=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var a=this.createElement("span",{className:"e-tbar-btn-text"});o?(a.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o,s.appendChild(a),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",l="Left"):(r=e.suffixIcon+" e-icons",l="Right"));var d=new n.Button({iconCss:r,iconPosition:l});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:D});n.setAttribute("aria-disabled","false");var r=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?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","-1"),s.setAttribute("aria-label",e.text||e.tooltipText),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,"e-separator")}if(e.showTextOn){var l=e.showTextOn;"Toolbar"===l?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===l&&this.add(n,"e-popup-text")}if(e.overflow){var o=e.overflow;"Show"===o?this.add(n,"e-overflow-show"):"Hide"===o&&(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.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){t.isNullOrUndefined(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},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.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"))}if(!i||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var n=window.getComputedStyle(this.element);this.popObj.width=parseFloat(n.width)+2*parseFloat(n.borderRightWidth)}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.extendedOpen=function(){var e=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.onPropertyChanged=function(e,i){var s=this.element,n=s.offsetWidth;this.extendedOpen();for(var r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(e.items instanceof Array&&i.items instanceof Array||this.isServerRendered)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=Object(e.items[d])[h];if("function"!=typeof c){if(this.tbarAlign||"align"===h){this.refresh(),this.trigger("created");break}var p="showAlwaysInPopup"===h&&!c,u="overflow"===h&&0!==this.popupPriCount;(p||this.items[d].showAlwaysInPopup&&u)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var f=[].slice.call(t.selectAll("."+A+" ."+D,s));this.isReact&&this.clearTemplate(),t.detach(f[d]),this.tbarEle.splice(d,1),this.addItems([this.items[d]],d),this.items.splice(d,1),this.items[d].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.renderOverflowMode(),this.popObj&&n<s.offsetWidth&&this.popupRefresh(this.popObj.element,!1);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,r="object"==typeof e,l=e,o=[].slice.call(t.selectAll("."+D,this.element));if(r?n=e:this.tbarEle[l]&&(n=[].slice.call(t.selectAll("."+D,this.element))[l]),n){if(i?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),i&&t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator")){if(t.isNullOrUndefined(n.firstElementChild.getAttribute("tabindex"))){n.firstElementChild.setAttribute("tabindex","-1");var a=[].slice.call(t.selectAll("."+D,this.element));r&&(l=a.indexOf(n));for(var d=a[++l];d;){if(!(u=this.eleContains(d))){d.firstElementChild.removeAttribute("tabindex");break}d=a[++l]}}}else if(t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator"))for(var h=!1,c=!1,p=o[s=0];p;)if(p.classList.contains("e-separator"))p=o[++s];else if(t.isNullOrUndefined(p.firstElementChild.getAttribute("tabindex")))p.firstElementChild.setAttribute("tabindex","-1"),h=!0;else{if(h&&c)break;var u=this.eleContains(p);u||(p.firstElementChild.removeAttribute("tabindex"),c=!0),p=o[++s]}this.refreshOverflow()}},L([t.Collection([],T)],i.prototype,"items",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("auto")],i.prototype,"height",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),L([t.Property()],i.prototype,"scrollStep",void 0),L([t.Property(!0)],i.prototype,"enableCollision",void 0),L([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),L([t.Property(!0)],i.prototype,"allowKeyboard",void 0),L([t.Event()],i.prototype,"clicked",void 0),L([t.Event()],i.prototype,"created",void 0),L([t.Event()],i.prototype,"destroyed",void 0),L([t.Event()],i.prototype,"beforeCreate",void 0),i=L([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)}}(),H=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},B="e-acrdn-item",R="e-acrdn-header",j="e-acrdn-panel",q="e-acrdn-content",F=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property("SlideDown")],i.prototype,"effect",void 0),H([t.Property(400)],i.prototype,"duration",void 0),H([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},F)],i.prototype,"collapse",void 0),H([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},F)],i.prototype,"expand",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property(null)],i.prototype,"content",void 0),H([t.Property(null)],i.prototype,"header",void 0),H([t.Property(null)],i.prototype,"cssClass",void 0),H([t.Property(null)],i.prototype,"iconCss",void 0),H([t.Property(!1)],i.prototype,"expanded",void 0),H([t.Property(!0)],i.prototype,"visible",void 0),H([t.Property(!1)],i.prototype,"disabled",void 0),H([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),W=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 U(i,e),i.prototype.destroy=function(){var i=this;this.isReact&&this.clearTemplate();var s=this.element;if(e.prototype.destroy.call(this),this.unwireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(s.children).forEach(function(e){s.removeChild(e)}),this.trgtEle)for(;this.ctrlTem.firstElementChild;)s.appendChild(this.ctrlTem.firstElementChild);s.classList.remove("e-acrdn-root"),s.removeAttribute("style"),["aria-disabled","aria-multiselectable","role","data-ripple"].forEach(function(e){i.element.removeAttribute(e)}),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+j);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),t.isNullOrUndefined(e)?this.element.classList.add("e-acrdn-root"):(e.classList.add("e-nested"),this.isNested=!0),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.isServerRendered?this.wireFocusEvents():(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});var s={"aria-disabled":"false",role:"presentation","aria-multiselectable":"true"};t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),t.attributes(this.element,s),"Single"===this.expandMode&&this.element.setAttribute("aria-multiselectable","false")},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("."+B));e<i.length;e++){var s=i[e],n=s.querySelector("."+R);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:"."+R})),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{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}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[t]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),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("."+R),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+R),"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("."+R),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+R),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=this,n=e.target,r=this.getItems(),l={};if(t.closest(n,".e-accordion")===this.element){n.classList.add("e-target");var o=t.closest(n,"."+B),a=t.closest(n,"."+R),d=t.closest(n,"."+j);o&&(t.isNullOrUndefined(a)||t.isNullOrUndefined(d))&&(a=o.children[0],d=o.children[1]),a&&(i=t.select(".e-toggle-icon",a));var h;a?h=t.closest(a,"."+B):d&&(h=t.closest(d,"."+B));var c=this.getIndexByItem(o);if(h&&(l.item=r[this.getIndexByItem(h)]),l.originalEvent=e,!(!t.isNullOrUndefined(i)&&o.childElementCount<=1)||!t.isNullOrUndefined(d)&&t.isNullOrUndefined(t.select(".e-acrdn-header .e-toggle-icon",h)))this.afterContentRender(n,l,o,a,d,h);else if(this.isServerRendered){var p=o.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",c).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)}):this.interopAdaptor.invokeMethodAsync("OnDataClick",p).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)})}else o.appendChild(this.contentRendering(c)),this.ariaAttrUpdate(o),this.afterContentRender(n,l,o,a,d,h);this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,r,l){var o=this,a=[];this.trigger("clicked",i);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")===this.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(j)||e.classList.contains(q)||d)){var p=this.element.querySelector(".e-accordion-container"),u=p?p.children:this.element.children;[].slice.call(u).forEach(function(e){e.classList.contains("e-active")&&a.push(e)});var f=[].slice.call(this.element.querySelectorAll(".e-acrdn-item [e-animate]"));if(f.length>0)for(var m=0,v=f;m<v.length;m++){var g=v[m];a.push(g.parentElement)}var y=-1!==a.indexOf(l)&&"true"===r.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+j,s),N=t.closest(s,".e-acrdn-root").querySelector(".e-expand-state");if(t.isNullOrUndefined(C))return;b=N===s,!t.isVisible(C)||y&&!l.classList.contains("e-selected")?(a.length>0&&"Single"===this.expandMode&&!y&&a.forEach(function(e){o.collapse(t.select("."+j,e)),e.classList.remove("e-expand-state")}),this.expand(C)):this.collapse(C),t.isNullOrUndefined(N)||b||N.classList.remove("e-expand-state")}}},i.prototype.eleMoveFocus=function(e,i,s){var n,r=t.closest(s,"."+B);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+R):s.classList.contains(R)&&(r="moveUp"===e?r.previousElementSibling:r.nextElementSibling)&&(n=t.select("."+R,r)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,R);if(!t.isNullOrUndefined(s)||i.classList.contains("e-accordion")||i.classList.contains(R)){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(j)?"true"!==n.getAttribute("e-animate")&&i.click():i.click();break;case"home":case"end":("home"===e.action?r.firstElementChild.children[0]:r.lastElementChild.children[0]).focus()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:R,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"heading","aria-selected":"false","aria-label":"collapsed","aria-disabled":"false","aria-level":this.getItems().length.toString()};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:B});if(s.id=t.getUniqueID("acrdn_item"),t.isNullOrUndefined(e.id)&&(e.id=s.id),t.attributes(s,{"aria-expanded":"false"}),this.headerTemplate){var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});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")){this.enableHtmlSanitizer&&"string"==typeof e.header&&(e.header=t.SanitizeHtmlHelper.sanitize(e.header));var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});n.appendChild(r),n.appendChild(this.fetchElement(r,e.header,i,!0)),s.appendChild(n)}var l=t.select("."+R,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 o=this.createElement("div",{className:"e-acrdn-header-icon"}),a=this.createElement("span",{className:e.iconCss+" e-icons"});o.appendChild(a),t.isNullOrUndefined(l)?((l=this.headerEleGenerate()).appendChild(o),s.appendChild(l)):l.insertBefore(o,l.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var d=this.toggleIconGenerate();t.isNullOrUndefined(l)&&(l=this.headerEleGenerate(),s.appendChild(l)),l.appendChild(d),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,n){var r,l;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);l=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}}catch(s){"string"==typeof i?e.innerHTML=t.SanitizeHtmlHelper.sanitize(i):!t.isNullOrUndefined(this.trgtEle)&&i instanceof HTMLElement?(e.appendChild(i),e.firstElementChild.style.display=""):r=t.compile(i)}var a;if(!t.isNullOrUndefined(r)){this.isReact&&this.renderReactTemplates();var d=void 0,h=void 0;e.classList.contains("e-acrdn-header-content")?(d=this.element.id+s+"_header",h="header"):e.classList.contains(q)&&(d=this.element.id+s+"_content",h="content"),a=r({},this,h,d,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(l)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+R,e),s=t.select("."+j,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","definition")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:j+" e-content-hide",id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:q});return this.dataSource.length>0?(this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[e],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(this.enableHtmlSanitizer&&(this.items[e].content,!0)&&(this.items[e].content=t.SanitizeHtmlHelper.sanitize(this.items[e].content)),i.appendChild(this.fetchElement(s,this.items[e].content,e,!1))),i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+B);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"),l={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=t.select(".e-toggle-icon",n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!0};this.trigger("expanding",a,function(s){s.cancel||(o.classList.add("e-toggle-animation"),i.expandedItemsPush(n),t.isNullOrUndefined(r)||r.classList.remove("e-expand-state"),n.classList.add("e-expand-state"),"None"===l.name?(i.expandProgress("begin",o,e,n,s),i.expandProgress("end",o,e,n,s)):i.expandAnimation(l.name,o,e,n,l,s))})}},i.prototype.expandAnimation=function(e,i,s,n,r,l){var o,a=this;this.lastActiveItemId=n.id,"SlideDown"===e?(r.begin=function(){a.expandProgress("begin",i,s,n,l),s.style.position="absolute",o=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},r.progress=function(){n.style.minHeight=o+s.offsetHeight+"px"},r.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,l)}):(r.begin=function(){a.expandProgress("begin",i,s,n,l)},r.end=function(){a.expandProgress("end",i,s,n,l)}),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(n,{"aria-expanded":"true"}),t.attributes(s.previousElementSibling,{"aria-selected":"true","aria-label":"expanded"}),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(B)&&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,s=this.getItems(),n=t.closest(e,"."+B);if(!t.isNullOrUndefined(e)&&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},l=t.select(".e-toggle-icon",n).firstElementChild,o={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!1};this.trigger("expanding",o,function(t){t.cancel||(i.expandedItemsPop(n),n.classList.add("e-expand-state"),l.classList.add("e-toggle-animation"),"None"===r.name?(i.collapseProgress("begin",l,e,n,t),i.collapseProgress("end",l,e,n,t)):i.collapseAnimation(r.name,e,n,l,r,t))})}},i.prototype.collapseAnimation=function(e,i,s,n,r,l){var o,a,d,h,c=this;this.lastActiveItemId=s.id,"SlideUp"===e?(r.begin=function(){d=s.offsetHeight,s.style.minHeight=d+"px",i.style.position="absolute",o=s.offsetHeight,a=i.offsetHeight,i.style.maxHeight=a+"px",c.collapseProgress("begin",n,i,s,l)},r.progress=function(){(h=o-(a-i.offsetHeight))<d&&(s.style.minHeight=h+"px")},r.end=function(){i.style.display="none",c.collapseProgress("end",n,i,s,l),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(r.begin=function(){c.collapseProgress("begin",n,i,s,l)},r.end=function(){c.collapseProgress("end",n,i,s,l)}),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(n,{"aria-expanded":"false"}),t.attributes(s.previousElementSibling,{"aria-selected":"false","aria-label":"collapsed"}),this.trigger("expanded",r))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.itemAttribUpdate=function(){var e=this.getItems(),i=this.getItemElements(),s=e.length;i.forEach(function(e){t.select("."+R,e).setAttribute("aria-level",""+s)})},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(),l=this.getItems();t.isNullOrUndefined(i)&&(i=l.length),n.childElementCount>=i&&(e instanceof Array?e:[e]).forEach(function(e,o){var a=i+o;l.splice(a,0,e);var d=s.renderInnerItem(e,a);n.childElementCount===a?n.appendChild(d):n.insertBefore(d,r[a]),t.EventHandler.add(d.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+R),"blur",s.focusOut,s),s.itemAttribUpdate(),s.expandedIndices=[],s.expandedItemRefresh(n),e&&e.expanded&&s.expandItem(!0,a)}),this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(e){var t=this,i=this.getItemElements();[].slice.call(i).forEach(function(e){e.classList.contains("e-selected")&&t.expandedItemsPush(e)})},i.prototype.removeItem=function(e){this.isReact&&this.clearTemplate(["headerTemplate","itemTemplate"],e);var i=this.getItemElements()[e],s=this.getItems();t.isNullOrUndefined(i)||(this.restoreContent(e),t.detach(i),s.splice(e,1),this.itemAttribUpdate(),this.expandedIndices=[],this.expandedItemRefresh(this.element))},i.prototype.select=function(e){var i=this.getItemElements()[e];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+R,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[e];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()[e];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.refresh=function(){this.isServerRendered||e.prototype.refresh.call(this)},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){o=n[n.length-1];this.itemExpand(e,o,this.getIndexByItem(o))}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 l=t.select(".e-expand-state",this.element);l&&l.classList.remove("e-expand-state"),r&&r.classList.add("e-expand-state")}else{var o=n[i];if(t.isNullOrUndefined(o)||!o.classList.contains("e-select")||o.classList.contains("e-active")&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,o,i)}},i.prototype.itemExpand=function(e,i,s){var n=this,r=i.children[1];if(!i.classList.contains("e-overlay")){if(t.isNullOrUndefined(r)&&e)if(this.isServerRendered){var l=i.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",s).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))}):this.interopAdaptor.invokeMethodAsync("OnDataClick",l).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))})}else r=this.contentRendering(s),i.appendChild(r),this.ariaAttrUpdate(i),this.expand(r);else t.isNullOrUndefined(r)||(e?this.expand(r):this.collapse(r));this.isReact&&this.renderReactTemplates()}},i.prototype.destroyItems=function(){this.restoreContent(null),this.isReact&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+B)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+B)[e],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[i];s.splice(i,1),this.restoreContent(i),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){t.innerHTML="",this.templateCompile(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.fetchElement(s,t,i,!1),0!==s.childNodes.length&&[].slice.call(s.childNodes).forEach(function(t){e.appendChild(t)})},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,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(this.isServerRendered){this.wireFocusEvents();break}if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=t.selectAll("."+B,this.element)[d],p=Object(i.items[d])[h],u=Object(e.items[d])[h],f=h;if(("header"===f||"iconCss"===f||"expanded"===f||"content"===f&&""===p)&&this.updateItem(c,d),"cssClass"!==h||t.isNullOrUndefined(c)||(c.classList.remove(p),c.classList.add(u)),"visible"!==h||t.isNullOrUndefined(c)||(!1===Object(e.items[d])[h]?c.classList.add("e-hide"):c.classList.remove("e-hide")),"disabled"!==h||t.isNullOrUndefined(c)||this.enableItem(d,!u),"content"===h&&!t.isNullOrUndefined(c)&&2===c.children.length)if("function"==typeof u){var m=c.querySelector("."+q);m.innerHTML="",this.setTemplate(u,m,d)}else c.classList.contains("e-selected")&&this.expandItem(!1,d),t.detach(c.querySelector("."+j))}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?(this.element.setAttribute("aria-multiselectable","false"),this.expandedIndices.length>1&&this.expandItem(!1)):this.element.setAttribute("aria-multiselectable","true")}n&&!this.isServerRendered&&(this.initExpand=[],this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},H([t.Collection([],V)],i.prototype,"items",void 0),H([t.Property([])],i.prototype,"dataSource",void 0),H([t.Property()],i.prototype,"itemTemplate",void 0),H([t.Property()],i.prototype,"headerTemplate",void 0),H([t.Property("100%")],i.prototype,"width",void 0),H([t.Property("auto")],i.prototype,"height",void 0),H([t.Property([])],i.prototype,"expandedIndices",void 0),H([t.Property("Multiple")],i.prototype,"expandMode",void 0),H([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),H([t.Complex({},z)],i.prototype,"animation",void 0),H([t.Event()],i.prototype,"clicked",void 0),H([t.Event()],i.prototype,"expanding",void 0),H([t.Event()],i.prototype,"expanded",void 0),H([t.Event()],i.prototype,"created",void 0),H([t.Event()],i.prototype,"destroyed",void 0),i=H([t.NotifyPropertyChanges],i)}(t.Component),_=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,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Y=function(e){function i(t,i){return e.call(this,t,i)||this}return _(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(){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()}},i.prototype.getModuleName=function(){return"contextmenu"},K([t.Property("")],i.prototype,"target",void 0),K([t.Property("")],i.prototype,"filter",void 0),K([t.Collection([],S)],i.prototype,"items",void 0),i=K([t.NotifyPropertyChanges],i)}(I),X=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)}}(),G=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Q="e-vertical",J=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return X(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{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}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(Q),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(Q),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,l=Object.keys(i);r<l.length;r++)switch(l[r]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(Q),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(Q),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(Q),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(Q):this.element.previousElementSibling.classList.remove(Q),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(Q):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(Q)),this.element.classList.add("e-hide-menu")))}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)},G([t.Property("Horizontal")],i.prototype,"orientation",void 0),G([t.Property("")],i.prototype,"target",void 0),G([t.Property(null)],i.prototype,"template",void 0),G([t.Property(!1)],i.prototype,"enableScrolling",void 0),G([t.Property(!1)],i.prototype,"hamburgerMode",void 0),G([t.Property("Menu")],i.prototype,"title",void 0),G([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),G([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],i.prototype,"fields",void 0),i=G([t.NotifyPropertyChanges],i)}(I),Z=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)}}(),$=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ee="e-tab-header",te="e-tab-wrap",ie="e-toolbar-items",se="e-toolbar-item",ne="e-toolbar-popup",re="e-vertical-tab",le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),$([t.Property(600)],i.prototype,"duration",void 0),$([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},le)],i.prototype,"previous",void 0),$([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},le)],i.prototype,"next",void 0),i}(t.ChildProperty),ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("")],i.prototype,"text",void 0),$([t.Property("")],i.prototype,"iconCss",void 0),$([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 Z(i,e),$([t.Complex({},ae)],i.prototype,"header",void 0),$([t.Property(null)],i.prototype,"headerTemplate",void 0),$([t.Property("")],i.prototype,"content",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(!1)],i.prototype,"disabled",void 0),$([t.Property(!0)],i.prototype,"visible",void 0),$([t.Property()],i.prototype,"id",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.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActElePosition.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 Z(i,e),i.prototype.destroy=function(){var i=this;if(this.isReact&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||this.tbObj.destroy(),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation"].forEach(function(e){i.element.removeAttribute(e)}),this.expTemplateContent(),this.isTemplate){var s=t.select(".e-tab > .e-content",this.element);this.element.classList.remove("e-template"),t.isNullOrUndefined(s)||(s.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),this.isServerRendered?this.isServerRendered&&"Dynamic"!==this.loadOn&&this.setActiveBorder():e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},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.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],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,{role:"tablist","aria-disabled":"false","aria-activedescendant":""}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){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},i.prototype.renderContainer=function(){if(this.isServerRendered)return void(this.isTemplate=!1);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:ee})),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 ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+se,this.element).length>0){this.tbItems=t.select(".e-tab-header ."+ie,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)}if(!t.isNullOrUndefined(this.tbItem))for(var n=0;n<this.items.length;n++){var r=this.items[n].id;this.tbItem[n].setAttribute("data-id",r)}this.setRTL(this.enableRtl)}},i.prototype.serverItemsChanged=function(){if(this.enableAnimation=!1,this.setActive(this.selectedItem,!0),"Dynamic"!==this.loadOn&&!t.isNullOrUndefined(this.cntEle)){var e=[].slice.call(this.cntEle.children),i="e-content"+this.tabId+"_"+this.selectedItem;e.forEach(function(e){e.classList.contains("e-active")&&e.id!==i&&e.classList.remove("e-active"),e.id===i&&e.classList.add("e-active")}),this.prevIndex=this.selectedItem,this.triggerAnimation("e-item"+this.tabId+"_"+this.selectedItem,!1)}this.enableAnimation=!0},i.prototype.headerReady=function(){if(this.initRender=!0,this.hdrEle=this.getTabHeader(),this.setOrientation(this.headerPlacement,this.hdrEle),t.isNullOrUndefined(this.hdrEle)||(this.tbObj=this.hdrEle&&this.hdrEle.ej2_instances[0]),this.tbObj.clicked=this.clickHandler.bind(this),this.tbObj.on("onItemsChanged",this.serverItemsChanged.bind(this)),this.tbItems=t.select(".e-tab-header ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),t.selectAll("."+se,this.element).length>0){this.bdrLine=t.select(".e-indicator.e-ignore",this.element);var e=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstElementChild):e.insertBefore(this.bdrLine,e.firstElementChild),this.select(this.selectedItem)}if(this.cntEle=t.select(".e-tab > .e-content",this.element),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),"Demand"===this.loadOn){var i=this.setActiveContent();this.triggerAnimation(i,!1)}this.initRender=!1,this.renderComplete()},i.prototype.setActiveContent=function(){var e="e-item"+this.tabId+"_"+this.selectedItem,i=this.getTrgContent(this.cntEle,this.extIndex(e));return t.isNullOrUndefined(i)||i.classList.add("e-active"),e},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(ee)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,r=[],l=0;l<n;l++)r.push(this.hdrEle.children.item(l).innerHTML);if(n>0){for(;this.hdrEle.firstElementChild;)t.detach(this.hdrEle.firstElementChild);var o=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(o),r.forEach(function(i,s){e.lastIndex=s;var n={className:"e-item",id:"e-item"+e.tabId+"_"+s,attrs:{role:"tab","aria-controls":"e-content"+e.tabId+"_"+s,"aria-selected":"false"}},r=e.createElement("span",{className:"e-tab-text",innerHTML:i,attrs:{role:"presentation"}}).outerHTML,l=e.createElement("div",{className:"e-text-wrap",innerHTML:r+e.btnCls.outerHTML}).outerHTML,a=e.createElement("div",{className:te,innerHTML:l,attrs:{tabIndex:"-1"}});o.appendChild(e.createElement("div",n)),t.selectAll(".e-item",o)[s].appendChild(a)})}}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}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton)},i.prototype.renderContent=function(){this.cntEle=t.select(".e-content",this.element);var e=t.selectAll("."+se,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&&(i.item(s).className+="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)}},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.parseObject=function(e,i){var s,n=this,r=t.selectAll("."+se,this.element).length,l=[],o=[];return e.forEach(function(e,a){var d=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,h=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&&""===h))return void o.push(a);var c=e.headerTemplate||e.header.text;"string"==typeof c&&n.enableHtmlSanitizer&&(c=t.SanitizeHtmlHelper.sanitize(c)),n.lastIndex=0===r?a:n.isReplace?i+a:n.lastIndex+1;var p=e.disabled?" e-disable e-overlay":"",u=!1===e.visible?" e-hidden":"";s=n.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});var f=c instanceof Object?c.outerHTML:c,m=!t.isNullOrUndefined(f)&&""!==f;t.isNullOrUndefined(c.tagName)?n.headerTextCompile(s,c,a):s.appendChild(c);var v=n.createElement("span",{className:"e-icons e-tab-icon e-icon-"+d+" "+h}),g=n.createElement("div",{className:"e-text-wrap"});g.appendChild(s),""!==c&&void 0!==c&&""!==h?("left"===d||"top"===d?g.insertBefore(v,g.firstElementChild):g.appendChild(v),s,n.isIconAlone=!1):(""===h?s:v)===v&&(t.detach(s),g.appendChild(v),n.isIconAlone=!0);var y=e.disabled?{}:{tabIndex:"-1"};g.appendChild(n.btnCls.cloneNode(!0));var b=n.createElement("div",{className:te,attrs:y});b.appendChild(g),n.itemIndexArray===[]?n.itemIndexArray.push("e-item"+n.tabId+"_"+n.lastIndex):n.itemIndexArray.splice(i+a,0,"e-item"+n.tabId+"_"+n.lastIndex);var C={htmlAttributes:{id:"e-item"+n.tabId+"_"+n.lastIndex,role:"tab","aria-selected":"false"},template:b};C.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+p+" "+u+(""!==h?"e-i"+d:"")+" "+(m?"":"e-icon"),"top"!==d&&"bottom"!==d||n.element.classList.add("e-vertical-icon"),l.push(C),a++}),this.isAdd||o.forEach(function(e){n.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),l},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")})}},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("."+ie,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(ne),this.tbPop.insertBefore(e,t.selectAll("."+ne,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+te).classList.remove("e-ripple")),this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(ne),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("."+se,this.tbItems).length-1},i.prototype.updateOrientationAttribute=function(){t.attributes(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},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.tbObj.refreshOverflow(),this.refreshActElePosition()},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,r=this,l=this.prevIndex;if(!this.isServerRendered||this.isServerRendered&&"Dynamic"!==this.loadOn){[].slice.call(this.element.querySelector(".e-content").children).forEach(function(e){e.id===r.prevActiveEle&&(s=e)});var o=this.tbItem[l];if(n=this.getTrgContent(this.cntEle,this.extIndex(e)),t.isNullOrUndefined(s)&&!t.isNullOrUndefined(o)){var a=this.extIndex(o.id);s=this.getTrgContent(this.cntEle,a)}}else n=this.cntEle.firstElementChild;if(t.isNullOrUndefined(n)||(this.prevActiveEle=n.id),this.initRender||!1===i||this.animation==={}||t.isNullOrUndefined(this.animation))return void(s&&s!==n&&s.classList.remove("e-active"));var d,h=t.select(".e-content",this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var c=this.animation.previous.effect;d={name:"None"===c?"":"SlideLeftIn"!==c?c:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var p=this.animation.next.effect;d={name:"None"===p?"":"SlideRightIn"!==p?p:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}d.progress=function(){h.classList.add("e-progress"),r.setActiveBorder()},d.end=function(){h.classList.remove("e-progress"),n.classList.add("e-active")},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,l),this.isPopup=!1,""===d.name?n.classList.add("e-active"):new t.Animation(d).animate(n)},i.prototype.keyPressed=function(e){var i=t.closest(e,".e-tab-header ."+se),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.select(s),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(ee)});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(ee)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+se,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace("e-item"+this.tabId+"_","")},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(),e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):r=t.compile(i);var l;t.isNullOrUndefined(r)||(l=r({},this,s)),!t.isNullOrUndefined(r)&&l.length>0&&[].slice.call(l).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.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var l=document.querySelector(i);r=l.outerHTML.trim(),"clone"===s?e.appendChild(l.cloneNode(!0)):(e.appendChild(l),l.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],[re,e]):t.addClass([this.element],[re,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],[re]),t.removeClass([this.hdrEle],["e-vertical","e-vertical-left","e-vertical-right"]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(ne)&&this.popupHandler(i)),this.addVerticalClass(),this.updateOrientationAttribute(),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.serverChangeOrientation=function(e,i){this.setOrientation(e,this.hdrEle),t.removeClass([this.element],[re]),("Left"===e||"Right"===e)!==("Left"===i||"Right"===i)&&this.changeToolbarOrientation(),this.isVertical()&&t.addClass([this.element],[re]),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},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,t,i){if(""!==t)for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},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("auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],["e-fill-mode"]),t.setStyleAttribute(this.element,{height:"100%"}),t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.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&&this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_0",className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_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.clearTemplate(["content"]),this.templateEle=[],this.getContent(r,this.items[0].content,"render",0),r.classList.remove("e-active")}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else 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(null!==i){this.isServerRendered&&i.classList.contains(ne)&&this.popupHandler(i);var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+ie,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 l=t.select(".e-indicator",this.element);t.setStyleAttribute(l,{top:i.offsetHeight+i.offsetTop+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var o=t.isNullOrUndefined(r)?this.tbItems.offsetWidth:r.offsetWidth;0!==o?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:o-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.remove("e-hidden")}}},i.prototype.setActive=function(e,i){void 0===i&&(i=!1),this.tbItem=t.selectAll("."+se,this.getTabHeader());var s=this.tbItem[e];if(this.isServerRendered&&s&&(e=parseInt(s.getAttribute("data-index"),10)),!(e<0||isNaN(e)||0===this.tbItem.length)){if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains("e-active"))return void this.setActiveBorder();if(!this.isTemplate){var n=this.tbItem[this.prevIndex];t.isNullOrUndefined(n)||n.removeAttribute("aria-controls"),t.attributes(s,{"aria-controls":"e-content"+this.tabId+"_"+e})}var r=s.id;this.removeActiveClass(),s.classList.add("e-active"),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),s.setAttribute("aria-selected","true");var l=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle="e-content"+this.tabId+"_"+l),t.attributes(this.element,{"aria-activedescendant":r}),this.isTemplate){if(t.select(".e-content",this.element).children.length>0){var o=this.findEle(t.select(".e-content",this.element).children,"e-content"+this.tabId+"_"+l);t.isNullOrUndefined(o)||o.classList.add("e-active"),this.triggerAnimation(r,this.enableAnimation)}}else if(!this.isServerRendered||this.isServerRendered&&"Init"===this.loadOn){this.cntEle=t.select(".e-tab > .e-content",this.element);var a=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(a)){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 a.classList.add("e-active");this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(s),!this.initRender&&!i){s.firstElementChild.focus();var c={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed};this.trigger("selected",c)}}},i.prototype.contentReady=function(){var e=this.setActiveContent();this.triggerAnimation(e,this.enableAnimation)},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+ie,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.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;this.allowDragAndDrop&&this.element.querySelectorAll("."+se).forEach(function(t){e.initializeDrag(t)})},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.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),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(),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,"."+se),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,this.isServerRendered&&!t.isNullOrUndefined(s)?parseInt(s.getAttribute("data-index"),10)!==this.selectedItem&&this.select(n):t.isNullOrUndefined(s)||n===this.selectedItem&&n===this.prevIndex||this.select(n,e.originalEvent))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches))){if(e.originalEvent&&e.originalEvent.stopPropagation(),this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;i>=0;i--)if(!this.tbItem[i].classList.contains("e-hidden")){this.select(i);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+se,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains("e-hidden")){this.select(s);break}this.isSwipeed=!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,"."+se),l=t.closest(i,"."+se);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(te)&&!1===t.closest(i,"."+se).classList.contains("e-active")&&i.setAttribute("tabindex","-1"),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),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(l)){var o=l.nextSibling;!t.isNullOrUndefined(o)&&o.classList.contains(se)&&o.firstElementChild.focus(),this.removeTab(this.getEleIndex(l))}this.setActiveBorder()}}},i.prototype.refreshActElePosition=function(){var e=t.select(".e-toolbar-item.e-toolbar-popup.e-active",this.element);t.isNullOrUndefined(e)||this.select(this.getEleIndex(e)),this.refreshActiveBorder()},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,l=e.offsetLeft,o=e.offsetWidth,a=e.offsetLeft+e.offsetWidth;if(n<l&&r<a){d=r-l;s.scrollLeft=n+(o-d)}else if(n>l&&r>a){var d=a-n;s.scrollLeft=n-(o-d)}}},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){if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{this.isRect&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var s=t.select(".e-tab > .e-content",this.element);s.firstElementChild&&!t.isBlazor();)t.detach(s.firstElementChild);this.select(this.selectedItem)}else for(var n=Object.keys(e.items),r=0;r<n.length;r++){var l=parseInt(Object.keys(e.items)[r],10),o=Object.keys(e.items[l])[0],a=Object(i.items[l])[o],d=Object(e.items[l])[o],h=t.select(".e-toolbar-items #e-item"+this.tabId+"_"+l,this.element),c=t.select(".e-content #e-content"+this.tabId+"_"+l,this.element);if("header"===o||"headerTemplate"===o){var p=t.isNullOrUndefined(this.items[l].header)||t.isNullOrUndefined(this.items[l].header.iconCss)?"":this.items[l].header.iconCss;if(""===(this.items[l].headerTemplate||this.items[l].header.text)&&""===p)this.removeTab(l);else{var u=[];u.push(this.items[l]),this.items.splice(l,1),this.itemIndexArray.splice(l,1),this.tbObj.items.splice(l,1);var f=h.classList.contains("e-hidden");t.detach(h),this.isReplace=!0,this.addTab(u,l),f&&this.hideTab(l),this.isReplace=!1}}if("content"===o&&!t.isNullOrUndefined(c))if(("string"==typeof d||t.isNullOrUndefined(d.innerHTML))&&("."===d[0]||"#"===d[0])&&d.length){var m=document.querySelector(d);c.appendChild(m),m.style.display=""}else""===d&&"#"===a[0]?(document.body.appendChild(this.element.querySelector(a)).style.display="none",c.innerHTML=d):this.isReact&&"object"==typeof d?(c.innerHTML="",this.templateCompile(c,d,l)):"function"!=typeof d&&(c.innerHTML=d);"cssClass"===o&&(t.isNullOrUndefined(h)||(h.classList.remove(a),h.classList.add(d)),t.isNullOrUndefined(c)||(c.classList.remove(a),c.classList.add(d))),"disabled"===o&&this.enableTab(l,!0!==d),"visible"===o&&this.hideTab(l,!0!==d)}},i.prototype.initializeDrag=function(e){var i=this;this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" .e-tab-header":this.dragArea;var s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+se,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,r=i.getEleIndex(i.dragItem),l={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+se),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("."+te).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("."+te).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var o=i.element.querySelector(".e-scroll-right-nav"),a=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(o)&&Math.abs(o.offsetWidth/2+o.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(a)&&Math.abs(a.offsetLeft+a.offsetWidth-i.cloneElement.offsetLeft)>a.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none";var h=i.cloneElement.getBoundingClientRect().left,c=i.cloneElement.getBoundingClientRect().top,p=document.elementFromPoint(h,c);n=t.closest(p,"."+se);var u=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(u=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-u<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,r,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",l)}else i.trigger("dragging",l)},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("."+te)],"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){s.cancel?t.detach(i.cloneElement):(i.removeActiveClass(),t.addClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.dragItem.querySelector("."+te).style.visibility="hidden"),t.isBlazor()&&e.bindEvents(t.getElement(e.dragElement))})},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(e,this.dragItem):"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.dragItem.querySelector("."+te).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=i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+te).style.visibility="",t.removeClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.select(i.droppedIndex))})},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+se,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove("e-disable","e-overlay"),s.firstElementChild.setAttribute("tabindex","-1")):(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.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):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();else{var r=t.selectAll("."+se,this.element).length;if(0!==r&&(n=this.lastIndex+1),t.isNullOrUndefined(i)&&(i=r-1),r<i||i<0||isNaN(i))return;0!==r||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.tbItems=t.select("."+ie,this.getTabHeader()),this.isAdd=!0;var l=this.parseObject(e,i);this.isAdd=!1;var o,a=0;e.forEach(function(e,r){if(o=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(o)||0===o.length&&t.isNullOrUndefined(e.header.iconCss)||(s.items.splice(i+a,0,e),a++),s.isTemplate&&!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)){var l=n+r,d=s.createElement("div",{id:"e-content"+s.tabId+"_"+l,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item_"+l}});s.cntEle.insertBefore(d,s.cntEle.children[i+r]);var h=s.getTrgContent(s.cntEle,l.toString());s.getContent(h,e.content,"render",i)}}),this.tbObj.addItems(l,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):this.setActiveBorder(),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+se,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id)),i.items.splice(e,1),i.itemIndexArray.splice(e,1),i.refreshActiveBorder();var r=t.select("#e-content"+i.tabId+"_"+i.extIndex(s.id),t.select(".e-content",i.element));t.isNullOrUndefined(r)||t.detach(r),i.trigger("removed",n),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.selectedItem=e,i.select(e)),0===t.selectAll("."+se,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+se,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(l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);break}}else for(var l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);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(),n.setAttribute("aria-hidden",""+i),!this.isServerRendered&&"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+ie,n),this.tbItem=t.selectAll("."+se,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","-1");var l={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.isSwipeed,cancel:!1};this.initRender?this.selectingContent(e):this.trigger("selecting",l,function(t){t.cancel||s.selectingContent(e)})},i.prototype.selectingContent=function(e){if("number"==typeof 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}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.tbItem[e].classList.contains(ne)){if(this.setActive(this.popupHandler(this.tbItem[e])),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,s)}}else this.setActive(e);else this.setActive(0)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e))},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);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.isServerRendered||this.setContentHeight(!1);break;case"cssClass":""!==i.cssClass?(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0)):this.setCssClass(this.element,e.cssClass,!0);break;case"items":this.isServerRendered||this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"selectedItem":this.isServerRendered||(this.selectedItem=i.selectedItem,this.select(e.selectedItem));break;case"headerPlacement":this.isServerRendered?this.serverChangeOrientation(e.headerPlacement,i.headerPlacement):this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActElePosition();break;case"heightAdjustMode":this.isServerRendered||(this.setContentHeight(!1),this.select(this.selectedItem));break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+ie),i=this.element.querySelector(".e-toolbar-item.e-active"),s=i.id,n=s.indexOf("_"),r=parseInt(s.substring(n+1),10),l=i.innerText,o=this.element.querySelector(".e-content").querySelector(".e-active").children[0],a=o.innerHTML;t.detach(i),t.detach(o);var d={className:se+" e-template e-active",id:"e-item"+this.tabId+"_"+r,attrs:{role:"tab","aria-controls":"e-content"+this.tabId+"_"+r,"aria-disabled":"false","aria-selected":"true"}},h=this.createElement("span",{className:"e-tab-text",innerHTML:l,attrs:{role:"presentation"}}).outerHTML,c=this.createElement("div",{className:"e-text-wrap",innerHTML:h+this.btnCls.outerHTML}).outerHTML,p=this.createElement("div",{className:te,innerHTML:c,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",d),e.children[r+1]),this.element.querySelector(".e-toolbar-item.e-active").appendChild(p);E=this.createElement("div",{innerHTML:a});this.element.querySelector(".e-content").querySelector(".e-active").appendChild(E)}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 u=this.items[this.selectedItem],f=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconPosition)?"":u.header.iconPosition,m=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconCss)?"":u.header.iconCss,v=u.headerTemplate||u.header.text,g=this.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});t.isNullOrUndefined(v.tagName)?this.headerTextCompile(g,v,this.selectedItem):g.appendChild(v);var y=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+f+" "+m}),b=this.createElement("div",{className:"e-text-wrap"});b.appendChild(g),""!==v&&void 0!==v&&""!==m?("left"===f||"top"===f?b.insertBefore(y,b.firstElementChild):b.appendChild(y),g,this.isIconAlone=!1):(""===m?g:y)===y&&(t.detach(g),b.appendChild(y),this.isIconAlone=!0);var C=u.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var N=this.createElement("div",{className:te,attrs:C});N.appendChild(b),"top"!==f&&"bottom"!==f||this.element.classList.add("e-vertical-icon"),this.element.querySelector(".e-toolbar-item.e-active").appendChild(N);var E=this.createElement("div"),x=u.content,O=void 0;if("string"==typeof x||t.isNullOrUndefined(x.innerHTML))if("string"==typeof x&&this.enableHtmlSanitizer&&(x=t.SanitizeHtmlHelper.sanitize(x)),"."===x[0]||"#"===x[0])if(document.querySelectorAll(x).length){var S=document.querySelector(x);O=S.outerHTML.trim(),E.appendChild(S),S.style.display=""}else this.compileElement(E,x,"content",this.selectedItem);else this.compileElement(E,x,"content",this.selectedItem);else E.appendChild(x);t.isNullOrUndefined(O)||-1===this.templateEle.indexOf(x.toString())&&this.templateEle.push(x.toString()),this.element.querySelector(".e-item.e-active").appendChild(E)}this.isReact&&this.renderReactTemplates()},$([t.Collection([],de)],i.prototype,"items",void 0),$([t.Property("100%")],i.prototype,"width",void 0),$([t.Property("auto")],i.prototype,"height",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(0)],i.prototype,"selectedItem",void 0),$([t.Property("Top")],i.prototype,"headerPlacement",void 0),$([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),$([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),$([t.Property("Dynamic")],i.prototype,"loadOn",void 0),$([t.Property(!1)],i.prototype,"enablePersistence",void 0),$([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),$([t.Property(!1)],i.prototype,"showCloseButton",void 0),$([t.Property()],i.prototype,"scrollStep",void 0),$([t.Property()],i.prototype,"dragArea",void 0),$([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),$([t.Complex({},oe)],i.prototype,"animation",void 0),$([t.Event()],i.prototype,"created",void 0),$([t.Event()],i.prototype,"adding",void 0),$([t.Event()],i.prototype,"added",void 0),$([t.Event()],i.prototype,"selecting",void 0),$([t.Event()],i.prototype,"selected",void 0),$([t.Event()],i.prototype,"removing",void 0),$([t.Event()],i.prototype,"removed",void 0),$([t.Event()],i.prototype,"onDragStart",void 0),$([t.Event()],i.prototype,"dragging",void 0),$([t.Event()],i.prototype,"dragged",void 0),$([t.Event()],i.prototype,"destroyed",void 0),i=$([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,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ue="e-treeview",fe="e-icon-collapsible",me="e-icon-expandable",ve="e-list-item",ge="e-list-text",ye="e-list-parent",be="e-hover",Ce="e-active",Ne="e-icons-spinner",Ee="e-process",xe="e-icons",Oe="e-text-content",Se="e-drop-in",we="e-drop-next",Ie="e-fullrow",ke="e-check",Le="e-checkbox-wrapper",Ae="e-node-focus",De={treeRole:"tree",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("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),Te=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"},Te)],i.prototype,"collapse",void 0),pe([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},Te)],i.prototype,"expand",void 0),i}(t.ChildProperty),Ue=function(e){function o(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.isBlazorExpandedNodes=[],s.hasTemplate=!1,s.mouseDownStatus=!1,s}ce(o,e),a=o,o.prototype.getModuleName=function(){return"treeview"},o.prototype.preRender=function(){var e=this;this.isBlazorPlatform=t.isBlazor()&&this.isServerRendered,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"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:me,ariaAttributes:De,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(),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},o.prototype.getPersistData=function(){var e=["selectedNodes","checkedNodes","expandedNodes"];return this.addOnPersist(e)},o.prototype.render=function(){this.initialRender=!0,this.blazorInitialRender=!1,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.isBlazorPlatform||(this.initialRender=!1),this.renderComplete()},o.prototype.initialize=function(){this.isBlazorPlatform||(this.element.setAttribute("role","tree"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect)),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},o.prototype.setDisabledMode=function(){this.disabled?this.element.classList.add("e-disabled"):this.element.classList.remove("e-disabled")},o.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},o.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+Oe+" > ."+xe+",.e-input-group,.e-input, ."+Le};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+Oe+" > ."+xe,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},o.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},o.prototype.setMultiSelect=function(e){var i=t.select("."+ye,this.element);e?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable")},o.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},o.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager?(this.isOffline=this.isBlazorPlatform?this.fields.dataSource.offline:this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.isBlazorPlatform?i.fields.dataSource.offline: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()},o.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,l=[];if(e.query)n=e.query.clone();else{n=new r.Query;for(var o=this.getActualProperties(e),a=0,d=Object.keys(o);a<d.length;a++){var h=d[a];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[h]&&"url"!==h&&-1===l.indexOf(e[h])&&l.push(e[h])}n.select(l),o.hasOwnProperty("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},o.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},o.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},o.prototype.renderItems=function(e){if(!this.isBlazorPlatform||this.isBlazorPlatform&&this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName||this.changeDataSource){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 l=0;l<n.length;)this.renderChildNodes(n[l],!0,null,!0),l++;(1===t.selectAll("."+ye,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element)}this.updateTemplateForBlazor(),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},o.prototype.updateTemplateForBlazor=function(){this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate()},o.prototype.updateCheckedStateFromDS=function(e){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var i=this.fields,s=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.isChecked,"equal",!0,!1)),n=0;n<s.length;n++){var l=s[n][this.fields.id]?s[n][this.fields.id].toString():null;s[n][this.fields.parentID]&&s[n][this.fields.parentID].toString();if(-1!==this.checkedNodes.indexOf(l)||this.isLoaded||this.checkedNodes.push(l),s[n][this.fields.hasChildren])for(var o=s[n][this.fields.id],a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.parentID,"equal",o,!1)),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(h)&&this.autoCheck&&this.checkedNodes.push(h)}}for(n=0;n<this.checkedNodes.length;n++){var c=this.fields,p=new r.DataManager(this.treeData).executeLocal((new r.Query).where(c.id,"equal",this.checkedNodes[n],!0));if(p[0]&&this.autoCheck&&(this.getCheckedNodeDetails(c,p),this.checkIndeterminateState(p[0])),p.length>0){m=p[0][this.fields.id]?p[0][this.fields.id].toString():null;this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}for(var u=new r.DataManager(this.treeData).executeLocal((new r.Query).where(c.parentID,"equal",this.checkedNodes[n],!0)),f=0;f<u.length;f++){var m=u[f][this.fields.id]?u[f][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(m)&&this.autoCheck&&this.checkedNodes.push(m),this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(f=0;f<this.treeData.length;f++){var v=this.treeData[f][this.fields.id]?this.treeData[f][this.fields.id].toString():"";this.treeData[f][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(v)&&this.checkedNodes.push(v),this.checkedNodes.indexOf(v)>-1&&-1===this.validNodes.indexOf(v)&&this.validNodes.push(v);var g=t.getValue(this.fields.child.toString(),this.treeData[f]);g&&this.updateChildCheckState(g,this.treeData[f])}this.setProperties({checkedNodes:this.validNodes},!0)}},o.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,l=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),o=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(l||o)o&&(t.select("."+ke,o)||this.changeState(o,"indeterminate",null,!0,!0));else{this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var a=this.getChildNodes(this.treeData,s),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===a.length&&-1===this.checkedNodes.indexOf(s)&&this.checkedNodes.push(s)}var c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},o.prototype.updateParentCheckState=function(){for(var e,i=t.selectAll(".e-stop",this.element),s=0;s<i.length;s++){var n=t.closest(i[s],"."+ve),l=n.getAttribute("data-uid").toString(),o=0;if(e=1===this.dataType?new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.parentID,"equal",l,!0)):this.getChildNodes(this.treeData,l)){for(var a=0;a<e.length;a++){var d=e[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}if(o===e.length){var h=n.getAttribute("data-uid");-1===this.checkedNodes.indexOf(h)&&this.checkedNodes.push(h),this.changeState(n,"check",null,!0,!0)}else 0===o&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},o.prototype.checkIndeterminateState=function(e){var t;if(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]'))"true"!==t.querySelector("."+Le).getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0);else if(2===this.dataType){this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())}},o.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 l=e[r][this.fields.id]?e[r][this.fields.id].toString():"";e[r][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.autoCheck&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(l)&&this.autoCheck&&s++,this.checkedNodes.indexOf(l)>-1&&-1===this.validNodes.indexOf(l)&&this.validNodes.push(l);var o=t.getValue(this.fields.child.toString(),e[r]);o&&(this.parentCheckData.push(i),this.updateChildCheckState(o,e[r])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkedNodes.push(n)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var a=0;a<this.parentCheckData.length;a++)i!==this.parentCheckData[a]&&this.parentCheckData[a]&&this.checkIndeterminateState(this.parentCheckData[a])}this.parentCheckData=[]},o.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.setAttribute("role","checkbox");var s=t.select("div."+xe,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 l=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(r)>-1?(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(l)||"true"!==l.toString()?i.setAttribute("aria-checked","false"):(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item));var o=t.select(".e-frame",i);t.EventHandler.add(o,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(o,"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 a=e.fields;if(this.addActionClass(e,a.selected,"e-selected"),this.addActionClass(e,a.expanded,"e-expanded"),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+ge),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)},o.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},o.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)},o.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){for(s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[s])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s])))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[s])))return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[s]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[s])))return 1}return 1},o.prototype.getGroupedData=function(e,t){for(var s=(new r.Query).group(t),n=i.ListBase.getDataSource(e,s),l=[],o=0;o<n.length;o++){var a=n[o].items;l.push(a)}return l},o.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},o.prototype.finalizeNode=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[s].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[r],null);break}t.removeClass(n,"e-selected")}for(var l=t.selectAll(".e-list-item:not(.e-expanded)",e),o=0;o<l.length;o++){var a=t.select("div."+xe,l[o]);a&&a.classList.contains(me)&&this.disableExpandAttr(l[o])}var d=t.selectAll(".e-expanded",e);if(!this.isInitalExpand)for(r=0;r<d.length;r++)this.renderChildNodes(d[r]);t.removeClass(d,"e-expanded"),this.updateList(),this.isLoaded&&this.updateCheckedProp()},o.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},o.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[i].classList.contains(ve)&&(t.select("."+ye,e[i])?this.ensureParentCheckState(e[i]):this.ensureChildCheckState(e[i]));else for(var s=t.selectAll(".e-stop",this.element),i=0;i<s.length;i++)s[i].classList.remove("e-stop")},o.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(ue))return;var i=e;e.classList.contains(ve)&&(i=t.select("."+ye,e));var s=t.selectAll("."+ke,i),n=t.selectAll(".e-stop",i),r=t.selectAll("."+ve,i),l=e.getElementsByClassName(Le)[0];r.length===s.length?this.changeState(l,"check",null,!0,!0):s.length>0||n.length>0?this.changeState(l,"indeterminate",null,!0,!0):0===s.length&&this.changeState(l,"uncheck",null,!0,!0);var o=t.closest(e,"."+ye);if(!t.isNullOrUndefined(o)){var a=t.closest(o,"."+ve);this.ensureParentCheckState(a)}}},o.prototype.ensureChildCheckState=function(e,i){if(!t.isNullOrUndefined(e)){var s=t.select("."+ye,e),n=void 0;if(!t.isNullOrUndefined(s)){n=t.selectAll("."+Le,s);for(var r=e.getElementsByClassName("e-frame")[0].classList.contains(ke),l=e.getElementsByClassName("e-frame")[0].classList.contains("e-stop"),o=s.querySelectorAll("li"),a=(s.parentElement.getAttribute("aria-expanded"),void 0),d=0;d<n.length;d++){var h=o[d].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[d]))){var c=n[d].getElementsByClassName("e-frame")[0].classList.contains(ke);r?a="check":c&&!this.isLoaded?a="check":-1!==this.checkedNodes.indexOf(h)&&this.isLoaded&&(l||r)?a="check":o[d].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):a="uncheck"}else a=t.getValue(this.fields.isChecked,this.currentLoadData[d])?"check":"uncheck",-1!==this.ele&&(a=r?"check":"uncheck"),"uncheck"===a&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(h)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1),a="indeterminate");this.changeState(n[d],a,i,!0,!0)}}this.autoCheck&&this.isLoaded&&this.updateParentCheckState()}},o.prototype.doCheckBoxAction=function(e,i){t.selectAll("."+ve,this.element);if(t.isNullOrUndefined(e)){var s=t.selectAll("."+Le,this.element);if(this.loadOnDemand)for(n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck",null,null,null,i);else for(var n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck")}else for(var r=e.length;r>=0;r--){var l=void 0;if(l=1===e.length?this.getElement(e[r-1]):this.getElement(e[r]),t.isNullOrUndefined(l)){p=void 0;if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[r]?e[r].toString():null)&&i&&p)this.setValidCheckedNode(p),this.dynamicCheckState(p,i);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var o=this.getChildNodes(this.treeData,p);if(o){for(var a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&this.checkedNodes.splice(this.checkedNodes.indexOf(d),1)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,i),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=t.select(".e-list-parent ."+Le,l);this.validateCheckNode(h,!i,l,null)}}if(e)for(var c=0;c<e.length;c++){var p=e[c]?e[c].toString():"";i||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},o.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+ve),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},o.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 l=n[0][this.fields.id]?n[0][this.fields.id].toString():null,o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=((p=this.element.querySelector('[data-uid="'+o+'"]'))&&t.select(".e-stop",p),p?t.select("."+ke,p):null),d=this.element.querySelector('[data-uid="'+l+'"]'),h=this.getChildNodes(this.treeData,o);if(h)for(u=0;u<h.length;u++){var c=h[u][this.fields.id]?h[u][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(c)&&s++}-1!==this.checkedNodes.indexOf(e)&&p&&l===e&&this.autoCheck?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&l===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&l===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0!==s?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0===s?this.changeState(p,"uncheck",null):d||p||l!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(var l=void 0,p=void 0,a=void 0,u=0;u<this.treeData.length;u++){l=this.treeData[u][this.fields.id]?this.treeData[u][this.fields.id].toString():"",a=(p=this.element.querySelector('[data-uid="'+l+'"]'))?t.select("."+ke,p):null,-1===this.checkedNodes.indexOf(l)&&p&&a&&!i&&this.changeState(p,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[u]);f&&this.updateChildIndeterminate(f,l,e,i,l)}},o.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 l=0;l<r.length;l++){var o=r[l][this.fields.id]?r[l][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&n++}var a=this.element.querySelector('[data-uid="'+i+'"]');a&&t?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(a,"uncheck",null):a||(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))},o.prototype.updateChildIndeterminate=function(e,i,s,n,r){for(var l=0,o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(a)&&l++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+ke,d):null,p=this.element.querySelector('[data-uid="'+a+'"]'),u=p?t.select("."+ke,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&a===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||a!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&a===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&a===s&&this.autoCheck&&0===l&&!n)h.classList.remove("e-stop");else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&a===s&&0===l)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(a)&&p&&u&&0===l)this.changeState(p,"uncheck",null);else if(!p&&!d&&a===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+r+'"]');n&&0!==l?this.changeState(f,"indeterminate",null):n&&l===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkedNodes.push(i):n||0!==l||-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!==l?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[o]);m&&this.updateChildIndeterminate(m,a,s,n,r)}},o.prototype.changeState=function(e,i,s,n,r,l){var o,a=this,d=t.closest(e,"."+ve);n?this.nodeCheckAction(e,i,d,o,s,n,r,l):(this.checkActionNodes=[],o=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",o,function(t){t.cancel||a.nodeCheckAction(e,i,d,t,s,n,r,l)}))},o.prototype.nodeCheckAction=function(e,i,s,n,r,l,o,a){var d,h=e.getElementsByClassName("e-frame")[0];if("check"!==i||h.classList.contains(ke)?"uncheck"===i&&(h.classList.contains(ke)||h.classList.contains("e-stop"))?(t.removeClass([h],[ke,"e-stop"]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(ke),h.classList.add("e-stop"),this.removeCheck(s),d="mixed"):(h.classList.remove("e-stop"),h.classList.add(ke),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||e.setAttribute("aria-checked",d),o){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,r),t.isUndefined(l)&&(n.data=c)}void 0!==a&&this.ensureStateChange(s,a),l||t.isNullOrUndefined(d)||(e.setAttribute("aria-checked",d),this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},o.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkedNodes.push(i)},o.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},o.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}},o.prototype.finalize=function(){var e=t.select("."+ye,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",De.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+ve,this.element);i&&(t.addClass([i],Ae),this.updateIdAttr(null,i)),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&this.rootData[0].hasOwnProperty(this.fields.parentID),this.doExpandAction()}},o.prototype.doExpandAction=function(){var e=this.expandedNodes;if(this.isInitalExpand&&e.length>0){if(this.setProperties({expandedNodes:[]},!0),this.isBlazorPlatform&&!this.initialRender)return;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s=t.select('[data-uid="'+e[i]+'"]',this.element);if(t.isNullOrUndefined(s))e[i]&&-1===this.expandChildren.indexOf(e[i])&&this.expandChildren.push(e[i].toString());else{var n=t.select("."+me,t.select("."+Oe,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null)}}this.afterFinalized()}}else this.afterFinalized()},o.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){++t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()})},o.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("."+Oe,s));t.isNullOrUndefined(n)?i():this.expandAction(s,n,null,!1,i)}},o.prototype.afterFinalized=function(){if((!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender)&&this.doSelectionAction(),this.updateCheckedProp(),this.isBlazorPlatform&&(this.initialRender&&this.setCheckedNodes(this.checkedNodes),this.updateInstance(),this.initialRender=!1),this.isAnimate=!0,this.isInitalExpand=!1,!this.isLoaded||this.isFieldChange){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0},o.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[s]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[s]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,"e-selected")},o.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[t].classList.contains("e-disable")||this.selectNode(e[t],null,!0),this.allowMultiSelection);t++);},o.prototype.clickHandler=function(e){var i=e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+ve);if(n){if(3!==e.originalEvent.which){var r=t.select(".e-ripple-element",n),l=t.select("."+xe,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var o=t.closest(i,"."+Le);if(!t.isNullOrUndefined(o)){var a=t.select(".e-frame",o);return this.validateCheckNode(o,a.classList.contains(ke),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&&l?l.classList.contains("e-ripple")&&l.classList.contains(me)?this.expandAction(n,l,e):l.classList.contains("e-ripple")&&l.classList.contains(fe)?this.collapseNode(n,l,e):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1)}this.triggerClickEvent(e.originalEvent,n)}}},o.prototype.nodeCheckedEvent=function(e,i,s){t.closest(e,"."+ve);var n=this.getCheckEvent(e,i?"uncheck":"check",s);n.data=n.data.splice(0,n.data.length-1),this.trigger("nodeChecked",n)},o.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},o.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Ne)&&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 l=0,o=0,a=this,d=t.select("."+ye,e),h=e;this.setHeight(h,d);var c=t.select(".e-list-item."+Ce,e);this.isAnimate&&!this.isRefreshed?this.aniObj.animate(d,{name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(i){h.style.overflow="hidden",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.add("e-animation-active"),l=h.offsetHeight,o=t.select("."+Oe,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,l,o)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.remove("e-animation-active"),n.expandedNode(h,d,i)}}):this.expandedNode(h,d,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")},o.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Ee),this.addExpand(e),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!1,this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.trigger("nodeExpanded",this.expandArgs))},o.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)},o.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Ee)){t.addClass([i],Ee);var r;this.isLoaded?(r=this.getExpandEvent(e,s),this.trigger("nodeCollapsing",r,function(s){s.cancel?t.removeClass([i],Ee):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,r)}},o.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],fe),t.addClass([i],me);var r=0,l=0,o=this,a=t.select("."+ye,e),d=e,h=t.select(".e-list-item."+Ce,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(i){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add("e-animation-active"),r=t.select("."+Oe,e).offsetHeight,l=d.offsetHeight},progress:function(e){o.animateHeight(e,r,l)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove("e-animation-active"),n.collapsedNode(d,a,i,s)}}):this.collapsedNode(d,a,i,s)},o.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Ee),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!1,this.removeExpand(e),this.isLoaded&&(n=this.getExpandEvent(e,null),this.trigger("nodeCollapsed",n))},o.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)},o.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],"e-node-collapsed")},o.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=""},o.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},o.prototype.renderChildNodes=function(e,s,n,l){var o=this,a=t.select("div."+xe,e);if(!t.isNullOrUndefined(a)){this.showSpinner(a);var d;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){var h=this.parents(e,"."+ye).length,c=this.getChildFields(this.fields,h,1);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c.dataSource))return t.detach(a),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager&&this.isOffline?(this.treeList.pop(),d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(d,c,a,e,s,n,l),this.updateTemplateForBlazor()):c.dataSource.executeQuery(this.getQuery(c,e.getAttribute("data-uid"))).then(function(t){o.treeList.pop(),d=t.result,1===o.dataType&&(o.dataType=2),o.loadChild(d,c,a,e,s,n,l),o.updateTemplateForBlazor()}).catch(function(e){o.trigger("actionFailure",{error:e})})}else{if(d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.currentLoadData=this.getSortedData(d),t.isNullOrUndefined(d)||0===d.length)return t.detach(a),void this.removeExpand(e,!0);this.isBlazorPlatform&&this.initialRender||(this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption))),this.expandNode(e,a,l),this.setSelectionForChildNodes(d),this.ensureCheckNode(e),this.finalizeNode(e),this.loadOnDemand&&this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate(),this.disableTreeNodes(d),this.renderSubChild(e,s,l)}}},o.prototype.loadChild=function(e,s,n,l,o,a,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(l,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof r.DataManager&&!this.isOffline){var h=l.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(l.getAttribute("aria-level"))+1,l.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(l,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(l),this.finalizeNode(l),this.disableTreeNodes(e),this.renderSubChild(l,o,d)}a&&a(),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.disableTreeNodes=function(e){for(var t=0;t<e.length;){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},o.prototype.setSelectionForChildNodes=function(e){var t;for(t=0;t<e.length;t++){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},o.prototype.ensureCheckNode=function(e){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e),this.ensureParentCheckState(e))),this.currentLoadData=null},o.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},o.prototype.getChildNodes=function(e,i,s){void 0===s&&(s=!1);var n;if(t.isNullOrUndefined(e))return n;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)for(var r=0,l=e.length;r<l;r++){var o=t.getValue(this.fields.id,e[r]);if(o&&o.toString()===i)return t.getValue(this.fields.child,e[r]);if(!t.isNullOrUndefined(t.getValue(this.fields.child,e[r]))&&void 0!==(n=this.getChildNodes(t.getValue(this.fields.child,e[r]),i)))break}return n},o.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++){if(t.isNullOrUndefined(e[n][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[n][0])))return s?e[n]:[];if(t.getValue(this.fields.parentID,e[n][0]).toString()===i)return e[n]}},o.prototype.renderSubChild=function(e,i,s){if(i)for(var n=t.selectAll("."+me,e),r=0,l=n.length;r<l;r++){var o=n[r];if(e.querySelector(".e-icons")!==n[r]){var a=t.closest(o,"."+ve);this.expandArgs=this.getExpandEvent(a,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(a,i,null,s)}}},o.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))},o.prototype.isActive=function(e){return!!e.classList.contains(Ce)},o.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||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,r,s)},o.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var r=this.liList.indexOf(this.startNode),l=this.liList.indexOf(e);if(r>l){var o=r;r=l,l=o}for(var a=r;a<=l;a++){var d=this.liList[a];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.setFocusElement(e),this.isLoaded&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s))},o.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.allowServerDataBinding=!0,s.updateServerProperties("select"),s.allowServerDataBinding=!1,s.nodeUnselectAction(e,t))})):this.nodeUnselectAction(e,i)},o.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},o.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&t.removeClass([i],Ae),t.addClass([e],Ae),this.updateIdAttr(i,e)}},o.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],Ce);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},o.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],Ce);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},o.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+Ce),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,Ce),this.setProperties({selectedNodes:[]},!0)},o.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},o.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},o.prototype.expandHandler=function(e){var i=e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||this.showCheckBox&&t.closest(i,"."+Le)||this.expandCollapseAction(t.closest(i,"."+ve),e)},o.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+xe,e);if(s&&!s.classList.contains(Ee)){var n=s.classList;n.contains(me)?this.expandAction(e,s,i):n.contains(fe)&&this.collapseNode(e,s,i)}},o.prototype.expandAction=function(e,i,s,n,r){var l=this;i.classList.contains(Ee)||(t.addClass([i],Ee),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Ee):l.nodeExpandAction(e,i,n,r)})):this.nodeExpandAction(e,i,n,r))},o.prototype.nodeExpandAction=function(e,i,s,n){var r=t.select("."+ye,e);if(r&&"UL"===r.nodeName)this.expandNode(e,i);else{this.renderChildNodes(e,s,n);for(var l=t.selectAll("."+ve,e),o=0;o<l.length;o++){var a=this.getId(l[o]);if(-1!==this.expandChildren.indexOf(a)&&void 0!==this.expandChildren){var d=t.select("."+me,t.select("."+Oe,l[o]));t.isNullOrUndefined(d)||this.expandAction(l[o],d,null),this.expandChildren.splice(this.expandChildren.indexOf(a),1)}}}},o.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(),this.element.focus(),t.addClass([n],be)):"escape"===e.action&&(r.value=this.oldText,r.blur(),this.element.focus(),t.addClass([n],be)))}e.preventDefault();var l={cancel:!1,event:e,node:n};this.trigger("keyPress",l,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox&&i.checkNode(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":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n,e);break;case"ctrlA":if(i.allowMultiSelection){var r=t.selectAll(".e-list-item:not(.e-active)",i.element);i.selectGivenNodes(r)}}})},o.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+Oe),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)},o.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)},o.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},o.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)},o.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+Le,i),n=t.select(" .e-frame",s).classList.contains(ke);i.classList.contains("e-disable")||0==i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},o.prototype.validateCheckNode=function(e,i,s,n){var r=this,l=t.closest(e,"."+ve);this.checkActionNodes=[];var o=i?"false":"true";t.isNullOrUndefined(o)||e.setAttribute("aria-checked",o);var a=this.getCheckEvent(l,i?"uncheck":"check",n);this.trigger("nodeChecking",a,function(t){t.cancel||r.nodeCheckingAction(e,i,s,t,n)})},o.prototype.nodeCheckingAction=function(e,i,s,n,r){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))){this.checkedElement.push(s.getAttribute("data-uid"));var l=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==l?this.allCheckNode(l,this.checkedElement,null,null,!1):l=null}if(this.changeState(e,i?"uncheck":"check",r,!0),this.autoCheck){this.ensureChildCheckState(s),this.ensureParentCheckState(t.closest(t.closest(s,"."+ye),"."+ve));var o=void 0;"check"===n.action?o=!0:"uncheck"===n.action&&(o=!1),this.ensureStateChange(s,o)}this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,this.nodeCheckedEvent(e,i,r)},o.prototype.ensureStateChange=function(e,i){var s=t.select("."+ye,e),n=e.getAttribute("data-uid"),l=this.fields;if(1===this.dataType&&this.autoCheck)for(var o=new r.DataManager(this.treeData).executeLocal((new r.Query).where(l.parentID,"equal",n,!0)),a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null,h=o[a][this.fields.isChecked]?o[a][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)){this.checkedNodes.push(d);p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}else if(-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d)){var c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}}else{var p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i)}}else if(1!==this.dataType||this.autoCheck)(p=this.getChildNodes(this.treeData,n))&&this.childStateChange(p,n,s,i);else if(i)for(a=0;a<this.treeData.length;a++){var u=this.treeData[a][this.fields.id]?this.treeData[a][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.checkedNodes.push(u)}else{for(var f=new r.DataManager(this.treeData).executeLocal((new r.Query).where(l.isChecked,"equal",!0,!1)),a=0;a<f.length;a++){var m=f[a][this.fields.id]?f[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(m)&&this.checkedNodes.splice(this.checkedNodes.indexOf(m),1),this.updateField(this.treeData,this.fields,m,"isChecked",null)}this.checkedNodes=[]}},o.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[i][this.fields.id]?e[i][this.fields.id].toString():null,n=e[i][this.fields.isChecked]?e[i][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.checkedNodes.push(s),"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)}},o.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[n][this.fields.id]?e[n][this.fields.id].toString():"",l=e[n][this.fields.isChecked]?e[n][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkedNodes.push(r),-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"===l&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkedNodes.push(r):(-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 o=this.getChildNodes([e[n]],r);o&&this.childStateChange(o,t,i,s)}},o.prototype.allCheckNode=function(e,i,s,n,r){if(e)for(var l=0;l<e.length;l++){var o=t.getValue(this.fields.id,e[l]),a=this.element.querySelector('[data-uid="'+o+'"]');if(!1!==r&&-1===this.checkedElement.indexOf(o.toString())&&(null===a&&!t.isNullOrUndefined(e[l][this.fields.isChecked])&&-1===i.indexOf(o.toString())||0===n||2===s)&&(!1!==e[l][this.fields.isChecked]||2===s?i.push(o.toString()):n=null,n=!1!==e[l][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(o.toString())&&t.isNullOrUndefined(s)&&i.push(o.toString()),!0===t.getValue(this.fields.hasChildren,e[l])||t.getValue(this.fields.child.toString(),e[l])){var d=t.getValue(this.fields.id,e[l]),h=this.getChildNodes(this.treeData,d.toString());h&&(t.isNullOrUndefined(r)?this.allCheckNode(h,i,s,n):this.allCheckNode(h,i,s,n,r),n=null)}n=null}},o.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+xe,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),"."+ve);if(!r)return;r.classList.contains("e-disable")||(this.setFocus(s,r),this.navigateToFocus(!0))}},o.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},o.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))},o.prototype.getFocusedNode=function(){var e,i=t.select(".e-list-item."+Ae,this.element);return t.isNullOrUndefined(i)&&(e=t.select("."+ve,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},o.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(Oe)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},o.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[i],i++}while(!t.isVisible(e));return e},o.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[i],i--}while(!t.isVisible(e));return e},o.prototype.setFocus=function(e,i){t.removeClass([e],[be,Ae]),i.classList.contains("e-disable")||(t.addClass([i],[be,Ae]),this.updateIdAttr(e,i))},o.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")},o.prototype.focusIn=function(){this.mouseDownStatus||t.addClass([this.getFocusedNode()],be),this.mouseDownStatus=!1},o.prototype.focusOut=function(){t.removeClass([this.getFocusedNode()],be)},o.prototype.onMouseOver=function(e){var i=e.target,s=i.classList,n=t.closest(i,"."+ve);if(!n||s.contains(ye)||s.contains(ve))return void this.removeHover();n&&!n.classList.contains("e-disable")&&this.setHover(n)},o.prototype.setHover=function(e){e.classList.contains(be)||(this.removeHover(),t.addClass([e],be))},o.prototype.onMouseLeave=function(e){this.removeHover()},o.prototype.removeHover=function(){var e=t.selectAll("."+be,this.element);e&&e.length&&t.removeClass(e,be)},o.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(ve)&&!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,"."+ve),l=r?r.getAttribute("data-uid"):null,o=e.classList.contains(Ce),a="true"===e.getAttribute("aria-expanded"),d=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+me,e)||t.select("."+fe,e)),h=null;return this.showCheckBox&&(h=t.select("."+Le,e).getAttribute("aria-checked")),{id:s,text:n,parentID:l,selected:o,expanded:a,isChecked:h,hasChildren:d}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},o.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("."+ge,e).textContent},o.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},o.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},o.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},o.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),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)},o.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(" "))},o.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+ve);this.createTextbox(s,e)}},o.prototype.createTextbox=function(e,i){var s=this,n=t.select(".e-tree-input",this.element);n&&n.blur();var r=t.select("."+ge,e);this.updateOldText(e);var o=this.createElement("input",{className:"e-tree-input",attrs:{value:this.oldText}}),a=this.getEditEvent(e,null,o.outerHTML);this.trigger("nodeEditing",a,function(i){if(!i.cancel){var n="width:"+(r.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(e),r.innerHTML=a.innerHtml;var o=t.select(".e-tree-input",r);s.inputObj=l.Input.createInput({element:o,properties:{enableRtl:s.enableRtl}},s.createElement),s.inputObj.container.setAttribute("style",n),o.focus();var d=o;d.setSelectionRange(0,d.value.length),s.wireInputEvents(o)}})},o.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)},o.prototype.inputFocusOut=function(e){if(t.select(".e-tree-input",this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+ge),l=t.closest(i,"."+ve);t.detach(this.inputObj.container),this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?this.crudOperation("update",null,l,s,null,null,!0):this.appendNewText(l,n,s,!0)}},o.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()})},o.prototype.updateText=function(e,i,s,n){var r=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))i.innerText=s;else{i.innerText="";var l=e.getAttribute("data-uid");this.renderNodeTemplate(r,i,l),this.updateBlazorTemplate(),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),i.focus())},o.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},o.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},o.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},o.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[i]);if(!t.isNullOrUndefined(this.treeData[i])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[i]}}},o.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return e[l];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[l]),this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[l]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},o.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},o.prototype.initializeDrag=function(){var e,i=this,s=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Oe,helper:function(n){i.dragTarget=n.sender.target;var r=t.closest(i.dragTarget,"."+ue),l=t.closest(i.dragTarget,"."+Oe);if(i.dragLi=t.closest(i.dragTarget,"."+ve),i.fullRowSelect&&!l&&i.dragTarget.classList.contains(Ie)&&(l=i.dragTarget.nextElementSibling),!i.dragTarget||!n.element.isSameNode(r)||!l||i.dragTarget.classList.contains(ue)||i.dragTarget.classList.contains(ye)||i.dragTarget.classList.contains(ve)||i.dragLi.classList.contains("e-disable"))return!1;var o=l.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+xe,o))){var a=s.createElement("div",{className:xe+" "+me});o.insertBefore(a,o.children[0])}var d="e-drag-item "+ue+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=s.createElement("div",{className:d})).appendChild(o);var h=i.selectedNodes.length;if(h>1&&i.allowMultiSelection&&i.dragLi.classList.contains(Ce)){var c=s.createElement("span",{className:"e-drop-count",innerHTML:""+h});e.appendChild(c)}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 l=i.getDragEvent(s.event,i,null,s.target,null,e,n);l.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",l,function(n){n.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0,t.isBlazor()&&s.bindEvents(t.getElement(s.dragElement))})},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"),i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable"),r=!0;s&&n||(t.detach(e.helper),document.body.style.cursor="",r=!1);var l,o=t.closest(s,".e-list-item");o&&(l=parseInt(o.getAttribute("aria-level"),10));var a=i.getDragEvent(e.event,i,s,s,null,e.helper,l);a.preventTargetExpand=!1,(i.isBlazorPlatform&&i.dragStartAction||!i.isBlazorPlatform)&&i.trigger("nodeDragStop",a,function(s){i.dragParent=s.draggedParentNode,i.preventExpand=s.preventTargetExpand,s.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor="",r=!1),i.dragStartAction=!1,i.isBlazorPlatform&&r&&i.dropAction(e,!0)})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){t.isNullOrUndefined(e)||e.target.classList.contains("e-sibling")||(document.body.style.cursor="not-allowed")},over:function(e){document.body.style.cursor=""},drop:function(e){i.isBlazorPlatform||i.dropAction(e)}})},o.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],"e-dragging"),this.dragStartAction=!1},o.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+Oe),r=t.select("div."+xe,i);t.removeClass([r],[Se,we,"e-drop-out","e-no-drop"]),this.removeVirtualEle(),document.body.style.cursor="";var l=e.target.classList;if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(l)&&l.contains(Ie)&&(n=e.target.nextElementSibling),s){var o=t.closest(e.target,"."+ve),a=t.closest(e.target,"."+Le),d=t.closest(e.target,"."+fe),h=t.closest(e.target,"."+me);if(!s.classList.contains(ue)||n&&!o.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,o))if(this.hasTemplate&&o){var c=t.select(this.fullRowSelect?"."+Ie:"."+Oe,o);if(e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,r,p)}else if(e&&!h&&!d&&!a&&c&&e.event.offsetY>c.offsetHeight-10||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,r,p)}else t.addClass([r],Se)}else if(o&&e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,r,p)}else if(o&&e&&!h&&!d&&e.target.offsetHeight>0&&e.event.offsetY>e.target.offsetHeight-10&&!a||h&&e.event.offsetY>19||d&&e.event.offsetX>19){var p=this.fullRowSelect?2:1;this.appendIndicator(o,r,p)}else t.addClass([r],Se);else"LI"!==e.target.nodeName||o.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,o)?e.target.classList.contains("e-sibling")?t.addClass([r],we):t.addClass([r],"e-drop-out"):(t.addClass([r],we),this.renderVirtualEle(e))}else t.addClass([r],"e-no-drop"),document.body.style.cursor="not-allowed";var u,f=t.closest(e.target,".e-list-item");f&&(u=parseInt(f.getAttribute("aria-level"),10));var m=this.getDragEvent(e.event,this,e.target,e.target,null,i,u);m.dropIndicator&&t.removeClass([r],m.dropIndicator),this.trigger("nodeDragging",m),m.dropIndicator&&t.addClass([r],m.dropIndicator)},o.prototype.appendIndicator=function(e,i,s){t.addClass([i],we);var n=this.createElement("div",{className:"e-sibling"});e.insertBefore(n,e.children[s])},o.prototype.dropAction=function(e,i){var s,n,l,o=e.event.offsetY,d=e.target,h=!1;l=i?e.element:e.dragData.draggable;for(m=0;m<l.ej2_instances.length;m++)if(l.ej2_instances[m]instanceof a){s=l.ej2_instances[m];break}if(s&&s.dragTarget){var c=s.dragTarget,p=t.closest(c,"."+ve),u=t.closest(d,"."+ve);if(null==u&&d.classList.contains(ue)&&(u=d.firstElementChild),i?t.detach(e.helper):t.detach(e.droppedElement),document.body.style.cursor="",!u||u.isSameNode(p)||this.isDescendant(p,u))return void(this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1));if(s.allowMultiSelection&&p.classList.contains(Ce)){var f=t.selectAll("."+Ce,s.element);if(e.target.offsetHeight<=33&&o>e.target.offsetHeight-10&&o>6)for(m=f.length-1;m>=0;m--)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o);else for(var m=0;m<f.length;m++)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o)}else this.appendNode(d,p,u,e,s,o);n=parseInt(p.getAttribute("aria-level"),10),h=!0}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),i?this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.element,null,n,h)):this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.dragData.draggedElement,null,n,h)),s.element.id!==this.element.id&&s.triggerEvent(),this.triggerEvent()},o.prototype.appendNode=function(e,i,s,n,r,l){var o=t.closest(e,"."+Le),a=t.closest(n.target,"."+fe),d=t.closest(n.target,"."+me);i.classList.contains("e-disable")||o||!(d&&n.event.offsetY<5||a&&n.event.offsetX<3||d&&n.event.offsetY>19||a&&n.event.offsetX>19||!d&&!a)?this.dropAsChildNode(i,s,r,null,n,l,!0):"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,l)},o.prototype.dropAsSiblingNode=function(e,i,s,n){var r,l=t.closest(i,"."+ye),o=t.closest(e,"."+ye),a=t.closest(o,"."+ve);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");l.insertBefore(e,r?d:d.nextElementSibling)}else l.insertBefore(e,r?s.target:s.target.nextElementSibling);this.moveData(e,i,l,r,n),this.updateElement(o,a),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},o.prototype.dropAsChildNode=function(e,i,s,n,r,l,o){var a,d=t.closest(e,"."+ye),h=t.closest(d,"."+ve),c=t.closest(i,"."+ye);if(r&&r.target&&(a=t.select(this.fullRowSelect?"."+Ie:"."+Oe,i)),r&&l<7&&!o)c.insertBefore(e,i),this.moveData(e,i,c,!0,s);else if(r&&r.target.offsetHeight>0&&l>r.target.offsetHeight-10&&!o&&!this.hasTemplate)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else if(this.hasTemplate&&a&&l>a.offsetHeight-10&&!o)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else{var p=this.expandParent(i),u=p.childNodes[n];p.insertBefore(e,u),this.moveData(e,u,p,!0,s)}this.updateElement(d,h),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},o.prototype.moveData=function(e,i,s,n,r){var l=t.closest(s,"."+ve),o=this.getId(e),a=r.updateChildField(r.treeData,r.fields,o,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(l);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 a[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,a[0])}if(this.treeData.splice(p,0,a[0]),r.element.id!==this.element.id){var f=r.removeChildNodes(o);p++;for(var m=0,v=f.length;m<v;m++)this.treeData.splice(p,0,f[m]),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,a,n?h:h+1)},o.prototype.expandParent=function(e){var s=t.select("div."+xe,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),(r=t.select("div."+xe,e))&&r.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),r?t.removeClass([r],fe):i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),t.isNullOrUndefined(n)){this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption);var r=t.select("div."+xe,e);r?t.removeClass([r],me):(i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption),r=t.select("div."+xe,e),t.removeClass([r],me)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}return n},o.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+xe,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)}},o.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+ye).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,e),i+1)},o.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,r=s.length;n<r;n++){var l=s[n];l.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,l),i+1)}},o.prototype.renderVirtualEle=function(e){var t;e.event.offsetY>e.target.offsetHeight-2?t=!1:e.event.offsetY<2&&(t=!0);var i=this.createElement("div",{className:"e-sibling"}),s=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(i,e.target.children[s])},o.prototype.removeVirtualEle=function(){var e=t.select(".e-sibling");e&&t.detach(e)},o.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},o.prototype.getDragEvent=function(e,i,s,n,l,o,a,d){var h=s?t.closest(s,"."+ve):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:l,u=i?i.dragData:null,f=s?this.parents(s,"."+ve):null,m=i.dragLi.parentElement,v=i.dragLi?t.closest(m,"."+ve):null,g=null,y=null,b=[we,Se,"e-drop-out","e-no-drop"],C=null,N=!0===d?p:h,E=N?t.closest(N,".e-list-parent"):null,x=0,O=null;if(v=i.dragLi&&null===v?t.closest(m,"."+ue):v,v=!0===d?this.dragParent:v,o)for(;x<4;){if(t.select("."+xe,o).classList.contains(b[x])){C=b[x];break}x++}if(E){var S=0;for(x=0;x<E.childElementCount;x++){if(S=!0!==d&&E.children[x]===p&&h!==p?++S:S,!0!==d&&E.children[x].classList.contains("e-hover")){y=e.offsetY>=23?x+1:x;break}if(E.children[x]===N){e.offsetY,y=x;break}}y=0!==S?--y:y,O="e-drop-in"==C?"Inside":e.offsetY<7?"Before":"After"}if(s&&(g=0===f.length?null:s.classList.contains(ve)?f[0]:f[1]),h===p&&(g=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(g=h,!0!==d)){a=++a;var w=g?t.select(".e-list-parent",g):null;if(y=w?w.children.length:0,!(this.fields.dataSource instanceof r.DataManager)&&null===w&&g){var I=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null;y=I?I.length:0}}return{cancel:!1,clonedNode:o,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:a,draggedParentNode:v,dropTarget:g,dropIndicator:C,target:n,position:O}},o.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(s=0;s<i;s++)this.createFullRow(this.liList[s]);else for(var s=0;s<i;s++){var n=t.select("."+Ie,this.liList[s]);t.detach(n)}},o.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Ie});e.insertBefore(t,e.childNodes[0])},o.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++)(o=s[i]).setAttribute("aria-selected","false");else for(var n=t.selectAll('.e-list-item[aria-selected="false"]',this.element),r=0,l=n;r<l.length;r++){var o=l[r];o.removeAttribute("aria-selected")}},o.prototype.collapseByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+fe,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.collapseNode(o,a,null),this.collapseByLevel(t.select("."+ye,o),i-1,s)}},o.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[s],l=t.closest(r,"."+ve);this.collapseNode(l,r,null)}},o.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+me,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.expandAction(o,a,null),this.expandByLevel(t.select("."+ye,o),i-1,s)}},o.prototype.expandAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+me,this.element)),s=0,n=i.length;s<n;s++){var r=i[s],l=t.closest(r,"."+ve);this.expandAction(l,r,null,!0)}},o.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[n])||(s.splice(n,1),n--);return s},o.prototype.removeNode=function(e){var i=t.closest(e,"."+ye),s=t.closest(i,"."+ve);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.updateInstance(),this.removeData(e)},o.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes(),this.allowServerDataBinding=!1,this.updateServerProperties("expand"),this.updateServerProperties("check"),this.updateServerProperties("select"),this.allowServerDataBinding=!0},o.prototype.updateServerProperties=function(e){this.isBlazorPlatform&&("expand"==e?(this.isBlazorExpandedNodes=this.expandedNodes,this.setProperties({expandedNodes:[]},!0)):"check"==e?this.setProperties({checkedNodes:this.checkedNodes},!0):this.setProperties({selectedNodes:this.selectedNodes},!0))},o.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+ve,this.element))},o.prototype.updateSelectedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({selectedNodes:[]},!0);e=t.selectAll("."+Ce,this.element);this.selectGivenNodes(e)}else if(this.isBlazorPlatform&&this.initialRender)for(var e=t.selectAll("."+Ce,this.element),i=0;i<e.length;i++){var s=e[i].getAttribute("data-uid").toString();t.isNullOrUndefined(s)||-1!==this.selectedNodes.indexOf(s)||this.selectedNodes.push(s)}},o.prototype.updateExpandedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({expandedNodes:[]},!0);for(var e=0,i=(s=t.selectAll('[aria-expanded="true"]',this.element)).length;e<i;e++)this.addExpand(s[e])}else if(this.isBlazorPlatform&&this.initialRender)for(var s=t.selectAll('[aria-expanded="true"]',this.element),n=0;n<s.length;n++){var r=s[n].getAttribute("data-uid").toString();t.isNullOrUndefined(r)||-1!==this.expandedNodes.indexOf(r)||this.expandedNodes.push(r)}},o.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)}},o.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,l=i.length;n<l;n++){var o=new r.DataManager(this.treeData),a=t.getValue(this.fields.id,i[n]).toString(),d={},h=this.isNumberTypeId?parseFloat(a):a;d[this.fields.id]=h;var c=o.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(a)}return s},o.prototype.doGivenAction=function(e,i,s){for(var n=0,r=e.length;n<r;n++){var l=this.getElement(e[n]);if(!t.isNullOrUndefined(l)){var o=t.select("."+i,t.select("."+Oe,l));t.isNullOrUndefined(o)||(s?this.expandAction(l,o,null):this.collapseNode(l,o,null))}}},o.prototype.addGivenNodes=function(e,s,n,r,l){if(0!==e.length){var o=this.getSortedData(e),a=s?parseFloat(s.getAttribute("aria-level"))+1:1;r&&this.updateMapper(a);for(var d,h=i.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a),c=(d=l||(s?this.expandParent(s):t.select("."+ye,this.element))).childNodes[n],p=0;p<h.length;p++)d.insertBefore(h[p],c);this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate();var u=this.getId(s);if(1===this.dataType){this.updateField(this.treeData,this.fields,u,"hasChildren",!0);for(var f=this.getId(c),m=t.isNullOrUndefined(f)?this.treeData.length:this.getDataPos(this.treeData,this.fields,f),v=0;v<e.length;v++){if(!t.isNullOrUndefined(u)){var g=this.isNumberTypeId?parseFloat(u):u;t.setValue(this.fields.parentID,g,e[v])}this.treeData.splice(m,0,e[v]),m++}}else this.addChildData(this.treeData,this.fields,u,e,n);this.finalizeNode(d)}},o.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},o.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=t.hasOwnProperty("navigateUrl")?t.navigateUrl:"navigateUrl"},o.prototype.getDataPos=function(e,i,s){for(var n=null,l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return l;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){var d=t.getValue("child",e[l]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[l]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},o.prototype.addChildData=function(e,i,s,n,l){var o;if(t.isNullOrUndefined(s)){l=t.isNullOrUndefined(l)?e.length:l;for(var a=0,d=n.length;a<d;a++)e.splice(l,0,n[a]),l++;return o}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[h]);if(e[h]&&p&&p.toString()===s){if("string"==typeof i.child&&e[h].hasOwnProperty(i.child)&&null!==e[h][i.child]||this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&e[h].hasOwnProperty("child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[h]);t.isNullOrUndefined(f)&&(f=[]),l=t.isNullOrUndefined(l)?f.length:l;for(var a=0,d=n.length;a<d;a++)f.splice(l,0,n[a]),l++}else{u="string"==typeof i.child?i.child:"child";e[h][u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[h]))){if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&!t.isNullOrUndefined(t.getValue("child",e[h]))){f=t.getValue("child",e[h]);if(void 0!==(o=this.addChildData(f,this.getChildMapper(i),s,n,l)))break}}else{var m=t.getValue(i.child,e[h]);if(void 0!==(o=this.addChildData(m,this.getChildMapper(i),s,n,l)))break}}return o},o.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 l=s[n][this.fields.id].toString();l&&-1===this.disableNode.indexOf(l)&&this.disableNode.push(l);var o=this.getElement(l);o&&(o.setAttribute("aria-disabled","true"),t.addClass([o],"e-disable"))}},o.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var r=this.getElement(i[s]),l=i[s];l&&-1!==this.disableNode.indexOf(l)&&this.disableNode.splice(this.disableNode.indexOf(l),1),r&&(r.removeAttribute("aria-disabled"),t.removeClass([r],"e-disable"))}},o.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[i]?n=e[i]?e[i].toString():null:"object"==typeof e[i]&&(n=e[i]?e[i].getAttribute("data-uid").toString():null),-1==t.indexOf(n)&&t.push(n)}return t},o.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[s][this.fields.id]?this.treeData[s][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[s]);var r=t.getValue(this.fields.child.toString(),this.treeData[s]);r&&this.filterNestedChild(r,e)}return this.validArr},o.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[s][this.fields.id]?e[s][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[s]);var r=t.getValue(this.fields.child.toString(),e[s]);r&&this.filterNestedChild(r,i)}},o.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},o.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[t],"selected",!0);var s=this.expandedNodes;this.isBlazorPlatform&&(s=this.isBlazorExpandedNodes);for(var n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[n],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var l=this.checkedNodes,o=0,r=l.length;o<r;o++)this.updateField(this.treeData,this.fields,l[o],"isChecked",!0)}},o.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,l=e.length;n<l;n++){for(var o=0;o<s.length;o++){var a=this.getMapperProp(i,s[o]);t.isNullOrUndefined(e[n][a])||delete e[n][a]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[n]))?this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[n]))&&this.removeField(t.getValue("child",e[n]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[n]),this.getChildMapper(i),s)}},o.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}},o.prototype.updateField=function(e,i,s,n,l){if(!t.isNullOrUndefined(s))if(1===this.dataType){var o=this.isNumberTypeId?parseFloat(s):s,a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",o,!1));t.setValue(this.getMapperProp(i,n),l,a[0])}else this.updateChildField(e,i,s,n,l)},o.prototype.updateChildField=function(e,i,s,n,l,o){var a;if(t.isNullOrUndefined(e))return a;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[d]);if(e[d]&&c&&c.toString()===s)return o?a=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),l,e[d]),a=[]),a;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[d]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[d]))){var p=t.getValue("child",e[d]);if(void 0!==(a=this.updateChildField(p,this.getChildMapper(i),s,n,l,o)))break}}else{var u=t.getValue(i.child,e[d]);if(void 0!==(a=this.updateChildField(u,this.getChildMapper(i),s,n,l,o)))break}}return a},o.prototype.triggerEvent=function(){this.updateTemplateForBlazor(),this.renderReactTemplates();var e={data:this.treeData};this.trigger("dataSourceChanged",e)},o.prototype.updateBlazorTemplate=function(){t.updateBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate",this,!1)},o.prototype.clientUpdateInitial=function(){this.blazorInitialRender=!0},o.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},o.prototype.wireEditingEvents=function(e){var i=this;if(e&&!this.disabled){var s=this;this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),s.editingHandler(e.originalEvent))}})}else this.touchEditObj&&this.touchEditObj.destroy()},o.prototype.wireClickEvent=function(e){if(e){var i=this;this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}})}else this.touchClickObj&&this.touchClickObj.destroy()},o.prototype.wireExpandOnEvent=function(e){var i=this;if(e){var s=this;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&&s.expandHandler(e)}})}else this.touchExpandObj&&this.touchExpandObj.destroy()},o.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)},o.prototype.preventContextMenu=function(e){e.preventDefault()},o.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,"focus",this.focusIn,this),t.EventHandler.add(this.element,"blur",this.focusOut,this),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"})},o.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"focus",this.focusIn),t.EventHandler.remove(this.element,"blur",this.focusOut),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},o.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},o.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+ve):2===e.tapCount&&(i=t.closest(s,"."+ve))),this.firstTap===i},o.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},o.prototype.showSpinner=function(e){t.addClass([e],Ne),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},o.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Ne)},o.prototype.setCheckedNodes=function(e){e=JSON.parse(JSON.stringify(e)),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},o.prototype.setValidCheckedNode=function(e){if(1===this.dataType){var i=this.fields,s=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",e,!0));if(s[0]&&(this.setChildCheckState(s,e,s[0]),this.autoCheck)){for(var n=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,l=this.getChildNodes(this.treeData,n),o=0,a=0;a<l.length;a++){var d=l[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}o===l.length&&-1===this.checkedNodes.indexOf(n)&&n&&this.checkedNodes.push(n)}}else if(2===this.dataType)for(var h=0;h<this.treeData.length;h++){if((this.treeData[h][this.fields.id]?this.treeData[h][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkedNodes.push(e);break}var c=t.getValue(this.fields.child.toString(),this.treeData[h]);c&&this.setChildCheckState(c,e,this.treeData[h])}},o.prototype.setChildCheckState=function(e,i,s){var n,r=0;if(1===this.dataType){s&&(n=s[this.fields.id]?s[this.fields.id].toString():null);for(o=0;o<e.length;o++){var l=e[o][this.fields.id]?e[o][this.fields.id].toString():null;s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),l===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i),(d=this.getChildNodes(this.treeData,l))&&this.setChildCheckState(d,i,s)}}else{s&&(n=s[this.fields.id]?s[this.fields.id].toString():"");for(var o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(a)&&this.checkedNodes.push(a),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);var d=t.getValue(this.fields.child.toString(),e[o]);d&&this.setChildCheckState(d,i,e[o]),-1!==this.checkedNodes.indexOf(a)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkedNodes.push(n)}}},o.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[t])},o.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[r]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},o.prototype.updateChildPosition=function(e,i,s,n,l){for(var o,a=0,d=e.length;a<d;a++){var h=t.getValue(i.id,e[a]);if(e[a]&&h&&h.toString()===s)return e[a]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[a]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){var c=t.getValue("child",e[a]);if(void 0!==(o=this.updateChildPosition(c,this.getChildMapper(i),s,n,l)))break}}else{var p=t.getValue(i.child,e[a]);if(void 0!==(o=this.updateChildPosition(p,this.getChildMapper(i),s,n,l)))break}}return o},o.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},o.prototype.crudOperation=function(e,i,s,n,r,l,o){var a,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 v=0,g=m.length;v<g;v++){var y=this.getElement(m[v]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[v]);c.push(b)}}switch(e){case"delete":1==i.length?a=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,a=h.saveChanges(f,u,p.fromTable,p)),a.then(function(e){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(a=h.update(u,c[0],p.fromTable,p)).then(function(e){return d.editSucess(s,n,o)}).catch(function(e){return d.dmFailure(e,s,o)});break;case"insert":if(1==r.length)a=h.insert(r[0],p.fromTable,p);else{for(var C=[],v=0,g=r.length;v<g;v++)C.push(r[v]);f.addedRecords=C,a=h.saveChanges(f,u,p.fromTable,p)}a.then(function(e){var t=d.getElement(s);d.addSuccess(r,t,l),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},o.prototype.deleteSuccess=function(e){for(var i=0,s=e.length;i<s;i++){var n=this.getElement(e[i]);t.isNullOrUndefined(n)||this.removeNode(n)}1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent()},o.prototype.editSucess=function(e,i,s){var n=this.getElement(e),r=t.select("."+ge,n);this.appendNewText(n,r,i,s)},o.prototype.addSuccess=function(e,t,i){var s,n=t?t.querySelector("."+xe):null,r=this;t&&n&&n.classList.contains(me)&&null===t.querySelector("."+ye)?r.renderChildNodes(t,null,function(){s=t.querySelector("."+ye),r.addGivenNodes(e,t,i,!0,s),r.triggerEvent()}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent())},o.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},o.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+ge,s);this.updateText(s,n,this.oldText,i)},o.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 r=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(r,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);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.isBlazorPlatform||this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.isBlazorPlatform||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.blazorInitialRender||this.reRenderNodes(),this.blazorInitialRender=!1,this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect);break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var l=this.element.querySelectorAll("li"),o=0;o<l.length;)"true"!==l[o].getAttribute("aria-expanded")&&this.renderChildNodes(l[o],!0,null,!0),o++;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"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},o.prototype.destroy=function(){t.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.element.removeAttribute("tabindex"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.isBlazorPlatform&&(this.ulElement=this.element.querySelector(".e-list-parent.e-ul")),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.isBlazorPlatform||e.prototype.destroy.call(this)},o.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var l=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)this.isOffline?this.addSuccess(e,l,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,l,s);else{if(l)this.addGivenNodes(e,l,s);else{e=this.getSortedData(e);for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.parentID,e[o]);l=a?this.getElement(a.toString()):a,this.addGivenNodes([e[o]],l,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&l&&this.ensureParentCheckState(l),(this.fields.dataSource instanceof r.DataManager==!1||this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"===this.fields.dataSource.adaptorName)&&(this.preventExpand=!1,this.triggerEvent())}},o.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i,null)},o.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},o.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)},o.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},o.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},o.prototype.ensureVisible=function(e){var i=this.getElement(e);if(!t.isNullOrUndefined(i)){var s=this.parents(i,"."+ve);this.expandAll(s),setTimeout(function(){i.scrollIntoView(!0)},450)}},o.prototype.expandAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+ye,this.element),i,s):this.expandAllNodes(s):this.doGivenAction(e,me,!0)},o.prototype.getAllCheckedNodes=function(){return this.checkedNodes},o.prototype.getDisabledNodes=function(){return this.disableNode},o.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},o.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]},o.prototype.moveNodes=function(e,i,s,n){var l=this.getElement(i);if(!t.isNullOrUndefined(l)){for(var o=0;o<e.length;o++){var a=this.getElement(e[o]);t.isNullOrUndefined(a)||l.isSameNode(a)||this.isDescendant(a,l)||(this.preventExpand=n,this.dropAsChildNode(a,l,this,s))}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent()}},o.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n,r=!1;if(1==this.dataType&&s.length>1)r=!0;else if(2==this.dataType&&1===s.length){var l=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(l)||(r=!0)}var o=this.getElement(e);n=o?o.getAttribute("data-uid"):e?e.toString():null,this.refreshData=this.getNodeObject(n),s=JSON.parse(JSON.stringify(s));var a,d;if(1==this.dataType&&r){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[h][this.fields.parentID])){d=s[h],s.splice(h,1);break}a=t.extend({},this.refreshData,d)}else a=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))return void this.updatePosition(n,a,r,s);this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[a],this.listBaseOption,c),u=t.select("."+ye,o),f=t.getValue(this.fields.child.toString(),a);if(r&&u||r&&!t.isNullOrUndefined(f)){var m=o.parentElement,v=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[v]),this.updatePosition(n,a,r,s),r&&u&&this.expandAll([n])}else{var g=t.select("."+Oe,o),y=t.select("."+Oe,p[0]),b=t.select("div."+xe,g),C=t.select("div."+xe,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(g);var N=t.select("."+Ie,o);N.parentNode.insertBefore(y,N.nextSibling),this.updatePosition(n,a,r,s)}if(o=this.getElement(e),a[this.fields.tooltip]&&o.setAttribute("title",a[this.fields.tooltip]),a.hasOwnProperty(this.fields.htmlAttributes)&&a[this.fields.htmlAttributes]){var E={};t.merge(E,a[this.fields.htmlAttributes]),E.class?(t.addClass([o],E.class.split(" ")),delete E.class):t.attributes(o,E)}-1!==this.selectedNodes.indexOf(n)&&(o.setAttribute("aria-selected","true"),t.addClass([o],Ce)),this.isRefreshed=!1,this.triggerEvent()}},o.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?this.crudOperation("delete",e):this.deleteSuccess(e))},o.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 l=t.select("."+ge,n);this.updateOldText(n);var o=this.getEditEvent(n,null,null);this.trigger("nodeEditing",o,function(t){t.cancel||(s.fields.dataSource instanceof r.DataManager&&!s.isOffline&&"BlazorAdaptor"!==s.fields.dataSource.adaptorName?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,l,i,!1))})}}},o.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var a;return pe([t.Property(!1)],o.prototype,"allowDragAndDrop",void 0),pe([t.Property(!1)],o.prototype,"allowEditing",void 0),pe([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),pe([t.Complex({},Me)],o.prototype,"animation",void 0),pe([t.Property()],o.prototype,"checkedNodes",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Property(!1)],o.prototype,"disabled",void 0),pe([t.Property(null)],o.prototype,"dragArea",void 0),pe([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),pe([t.Property(!1)],o.prototype,"enablePersistence",void 0),pe([t.Property()],o.prototype,"expandedNodes",void 0),pe([t.Property("Auto")],o.prototype,"expandOn",void 0),pe([t.Complex({},Pe)],o.prototype,"fields",void 0),pe([t.Property(!0)],o.prototype,"fullRowSelect",void 0),pe([t.Property(!0)],o.prototype,"loadOnDemand",void 0),pe([t.Property()],o.prototype,"locale",void 0),pe([t.Property()],o.prototype,"nodeTemplate",void 0),pe([t.Property()],o.prototype,"selectedNodes",void 0),pe([t.Property("None")],o.prototype,"sortOrder",void 0),pe([t.Property(!1)],o.prototype,"showCheckBox",void 0),pe([t.Property(!0)],o.prototype,"autoCheck",void 0),pe([t.Property(!1)],o.prototype,"fullRowNavigable",void 0),pe([t.Event()],o.prototype,"actionFailure",void 0),pe([t.Event()],o.prototype,"created",void 0),pe([t.Event()],o.prototype,"dataBound",void 0),pe([t.Event()],o.prototype,"dataSourceChanged",void 0),pe([t.Event()],o.prototype,"drawNode",void 0),pe([t.Event()],o.prototype,"destroyed",void 0),pe([t.Event()],o.prototype,"keyPress",void 0),pe([t.Event()],o.prototype,"nodeChecked",void 0),pe([t.Event()],o.prototype,"nodeChecking",void 0),pe([t.Event()],o.prototype,"nodeClicked",void 0),pe([t.Event()],o.prototype,"nodeCollapsed",void 0),pe([t.Event()],o.prototype,"nodeCollapsing",void 0),pe([t.Event()],o.prototype,"nodeDragging",void 0),pe([t.Event()],o.prototype,"nodeDragStart",void 0),pe([t.Event()],o.prototype,"nodeDragStop",void 0),pe([t.Event()],o.prototype,"nodeDropped",void 0),pe([t.Event()],o.prototype,"nodeEdited",void 0),pe([t.Event()],o.prototype,"nodeEditing",void 0),pe([t.Event()],o.prototype,"nodeExpanded",void 0),pe([t.Event()],o.prototype,"nodeExpanding",void 0),pe([t.Event()],o.prototype,"nodeSelected",void 0),pe([t.Event()],o.prototype,"nodeSelecting",void 0),o=a=pe([t.NotifyPropertyChanges],o)}(t.Component),He=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)}}(),Be=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Re="e-close",je="e-open",qe="e-right",Fe="e-left",ze="e-over",Ve="e-push",We="e-sidebar-context",_e=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isBlazor=!1,s}return He(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor()&&this.isServerRendered,this.isBlazor||this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.isBlazor||this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?this.show():this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.isBlazor||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],We),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?t.EventHandler.add(document,"mousedown touchstart",this.documentclickHandler,this):t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler)},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(){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"):"0",this.isBlazor||(this.enableDock||"Auto"===this.type||t.addClass([this.element],["e-visibility"]),t.removeClass([this.element],[je,Re,qe,Fe,"e-slide",Ve,ze]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?qe:Fe),this.enableDock&&t.addClass([this.element],"e-dock"),this.element.setAttribute("tabindex",this.tabIndex)),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],Re):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Re)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.triggerChange(),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.removeClass([e],"e-backdrop"):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};t.isBlazor()&&delete s.model,this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Re))return;i.element.classList.contains(je)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Re),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?"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):this.element.classList.contains(Re)&&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))},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};t.isBlazor()&&delete s.model,this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],"e-visibility"),i.element.classList.contains(je))return;i.element.classList.contains(Re)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[je,"e-transition"]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Re),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(Re)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=document.querySelector(".e-main-content")||this.targetEle;t.addClass([e],"e-backdrop")}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(){"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],ze):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():this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide():!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(),window.addEventListener("resize",this.resize.bind(this))},i.prototype.unWireEvents=function(){window.removeEventListener("resize",this.resize.bind(this)),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,l=0,o=Object.keys(i);l<o.length;l++)switch(o[l]){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],We),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||(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,ze,"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],[ze]),this.enableDock&&this.element.classList.contains(Re)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);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],ze):(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],We),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[je,Re,Ve,"e-slide",ze,Fe,qe,"e-transition"]),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()},Be([t.Property("auto")],i.prototype,"dockSize",void 0),Be([t.Property(null)],i.prototype,"mediaQuery",void 0),Be([t.Property(!1)],i.prototype,"enableDock",void 0),Be([t.Property("en-US")],i.prototype,"locale",void 0),Be([t.Property(!1)],i.prototype,"enablePersistence",void 0),Be([t.Property(!0)],i.prototype,"enableGestures",void 0),Be([t.Property(!1)],i.prototype,"isOpen",void 0),Be([t.Property(!1)],i.prototype,"enableRtl",void 0),Be([t.Property(!0)],i.prototype,"animate",void 0),Be([t.Property("auto")],i.prototype,"height",void 0),Be([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),Be([t.Property("Left")],i.prototype,"position",void 0),Be([t.Property(null)],i.prototype,"target",void 0),Be([t.Property(!1)],i.prototype,"showBackdrop",void 0),Be([t.Property("Auto")],i.prototype,"type",void 0),Be([t.Property("auto")],i.prototype,"width",void 0),Be([t.Property(1e3)],i.prototype,"zIndex",void 0),Be([t.Event()],i.prototype,"created",void 0),Be([t.Event()],i.prototype,"close",void 0),Be([t.Event()],i.prototype,"open",void 0),Be([t.Event()],i.prototype,"change",void 0),Be([t.Event()],i.prototype,"destroyed",void 0),i=Be([t.NotifyPropertyChanges],i)}(t.Component);return e.MenuAnimationSettings=w,e.MenuItem=S,e.HScroll=p,e.VScroll=m,e.addScrolling=o,e.destroyScroll=d,e.Item=T,e.Toolbar=M,e.AccordionActionSettings=F,e.AccordionAnimationSettings=z,e.AccordionItem=V,e.Accordion=W,e.ContextMenu=Y,e.Menu=J,e.TabActionSettings=le,e.TabAnimationSettings=oe,e.Header=ae,e.TabItem=de,e.Tab=he,e.FieldsSettings=Pe,e.ActionSettings=Te,e.NodeAnimationSettings=Me,e.TreeView=Ue,e.Sidebar=_e,e}({},ej.base,ej.lists,ej.popups,ej.buttons,ej.data,ej.inputs),this.ejs=ej;
- /*!
- * filename: ej2-svg-base.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.svgbase=function(t,e){"use strict";function i(t){var e;switch(t){case"Highcontrast":case"HighContrast":e={tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":e={tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A"};break;case"Bootstrap4":e={tooltipFill:"rgba(0, 0, 0, 0.9)",tooltipBoldLabel:"rgba(255, 255, 255)",tooltipLightLabel:"rgba(255, 255, 255, 0.9)",tooltipHeaderLine:"rgba(255, 255, 255, 0.2)"};break;case"Tailwind":e={tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280"};break;case"TailwindDark":e={tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF"};break;default:e={tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return e}function r(t,i){var r=t||"",o=document.getElementById("chartmeasuretext");if(null===o&&(o=e.createElement("text",{id:"chartmeasuretext"}),document.body.appendChild(o)),"string"==typeof t&&(t.indexOf("<")>-1||t.indexOf(">")>-1)){for(var n=t.split(" "),s=0;s<n.length;s++)-1===n[s].indexOf("<br/>")&&(n[s]=n[s].replace(/[<>]/g,"&"));t=n.join(" ")}return o.innerHTML=r.indexOf("<br>")>-1||r.indexOf("<br/>")>-1?r:t,o.style.position="fixed",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",o.style.lineHeight="normal",new u(o.clientWidth,o.clientHeight)}function o(t,e,i,r,o,n,s,a,h,l,p){var d="",c=i.x,u=i.y,y=i.x+i.width,g=i.y+i.height;return p=p||0,n?(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u+" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e))).concat(" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g),0!==o&&(d=(d=d.concat(" L "+(r.x+o/2)+" "+g)).concat(" L "+(h+p)+" "+(g+o-p)),d+=" Q "+h+" "+(g+o)+" "+(h-p)+" "+(g+o-p)),d=r.x-o/2>c?d.concat(" L "+(r.x-o/2)+" "+g+" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z"):0===o?d.concat(" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z"):d.concat(" L "+c+" "+(g+e)+" z")):s?(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u+" L "+(r.x-o/2)+" "+u)).concat(" L "+(h-p)+" "+(r.y+p)),d=(d=(d+=" Q "+h+" "+r.y+" "+(h+p)+" "+(r.y+p)).concat(" L "+(r.x+o/2)+" "+u+" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e))).concat(" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g+" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z")):a?(d=(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u)).concat(" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e)+" L "+y+" "+(r.y-o/2))).concat(" L "+(y+o-p)+" "+(l-p)),d=(d=(d+=" Q "+(y+o)+" "+l+" "+(y+o-p)+" "+(l+p)).concat(" L "+y+" "+(r.y+o/2)+" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g)).concat(" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z")):(d=(d=d.concat("M "+(c+t)+" "+u+" Q "+c+" "+u+" "+c+" "+(u+e)+" L "+c+" "+(r.y-o/2))).concat(" L "+(c-o+p)+" "+(l-p)),d=(d=(d+=" Q "+(c-o)+" "+l+" "+(c-o+p)+" "+(l+p)).concat(" L "+c+" "+(r.y+o/2)+" L "+c+" "+(g-e)+" Q "+c+" "+g+" "+(c+t)+" "+g)).concat(" L "+(y-t)+" "+g+" Q "+y+" "+g+" "+y+" "+(g-e)+" L "+y+" "+(u+e)+" Q "+y+" "+u+" "+(y-t)+" "+u+" z")),d}function n(t){return document.getElementById(t)}function s(t){var i=n(t);i&&e.remove(i)}function a(t,e,i,r,o,n){var s=new p(""),a=h(t,i,e,o,r),l=s["draw"+a.functionName](a.renderOption);return l.setAttribute("aria-label",n),l}function h(t,i,r,o,n){var s,a="Path",h=i.width,l=i.height,p=t.x,d=t.y,c=t.x+-h/2,u=t.y+-l/2;switch(r){case"Circle":case"Bubble":a="Ellipse",e.merge(o,{rx:h/2,ry:l/2,cx:p,cy:d});break;case"Cross":s="M "+c+" "+d+" L "+(p+h/2)+" "+d+" M "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2),e.merge(o,{d:s});break;case"HorizontalLine":s="M "+c+" "+d+" L "+(p+h/2)+" "+d,e.merge(o,{d:s});break;case"VerticalLine":s="M "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2),e.merge(o,{d:s});break;case"Diamond":s="M "+c+" "+d+" L "+p+" "+(d+-l/2)+" L "+(p+h/2)+" "+d+" L "+p+" "+(d+l/2)+" L "+c+" "+d+" z",e.merge(o,{d:s});break;case"Rectangle":s="M "+c+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+l/2)+" L "+c+" "+(d+l/2)+" L "+c+" "+(d+-l/2)+" z",e.merge(o,{d:s});break;case"Triangle":s="M "+c+" "+(d+l/2)+" L "+p+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+l/2)+" L "+c+" "+(d+l/2)+" z",e.merge(o,{d:s});break;case"InvertedTriangle":s="M "+(p+h/2)+" "+(d-l/2)+" L "+p+" "+(d+l/2)+" L "+(p-h/2)+" "+(d-l/2)+" L "+(p+h/2)+" "+(d-l/2)+" z",e.merge(o,{d:s});break;case"Pentagon":for(var y=void 0,g=void 0,f=0;f<=5;f++)y=h/2*Math.cos(Math.PI/180*(72*f)),g=l/2*Math.sin(Math.PI/180*(72*f)),s=0===f?"M "+(p+y)+" "+(d+g)+" ":s.concat("L "+(p+y)+" "+(d+g)+" ");s=s.concat("Z"),e.merge(o,{d:s});break;case"Image":a="Image",e.merge(o,{href:n,height:l,width:h,x:c,y:u})}return{renderOption:o,functionName:a}}function l(t,e,i,r){var o={},n=new p("");o={id:t.id,x:t.x,y:t.y,fill:i,"font-size":e.size,"font-style":e.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight,"text-anchor":t.anchor,transform:t.transform,opacity:e.opacity,"dominant-baseline":t.baseLine};var s="string"==typeof t.text?t.text:t.text[0],a=n.createText(o,s);return a.style.fontFamily=e.fontFamily,a.style.fontStyle=e.fontStyle,a.style.fontSize=e.size,a.style.fontWeight=e.fontWeight,a.style.color=e.color,r.appendChild(a),a}var p=function(){function t(t){this.svgLink="http://www.w3.org/2000/svg",this.rootId=t}return t.prototype.getOptionValue=function(t,e){return t[e]},t.prototype.createSvg=function(t){return e.isNullOrUndefined(t.id)&&(t.id=this.rootId+"_svg"),this.svgObj=document.getElementById(t.id),e.isNullOrUndefined(document.getElementById(t.id))&&(this.svgObj=document.createElementNS(this.svgLink,"svg")),this.svgObj=this.setElementAttributes(t,this.svgObj),this.setSVGSize(t.width,t.height),this.svgObj},t.prototype.setSVGSize=function(t,i){var r=document.getElementById(this.rootId),o=e.isNullOrUndefined(r)?null:r.getBoundingClientRect();e.isNullOrUndefined(this.width)||this.width<=0?this.svgObj.setAttribute("width",t?t.toString():o.width.toString()):this.svgObj.setAttribute("width",this.width.toString()),e.isNullOrUndefined(this.height)||this.height<=0?this.svgObj.setAttribute("height",i?i.toString():"450"):this.svgObj.setAttribute("height",this.height.toString())},t.prototype.drawPath=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"path")),e=this.setElementAttributes(t,e)},t.prototype.drawLine=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"line")),e=this.setElementAttributes(t,e)},t.prototype.drawRectangle=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"rect")),e=this.setElementAttributes(t,e)},t.prototype.drawCircle=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"circle")),e=this.setElementAttributes(t,e)},t.prototype.drawPolyline=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"polyline")),e=this.setElementAttributes(t,e)},t.prototype.drawEllipse=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"ellipse")),e=this.setElementAttributes(t,e)},t.prototype.drawPolygon=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"polygon")),e=this.setElementAttributes(t,e)},t.prototype.drawImage=function(t){var i=document.createElementNS(this.svgLink,"image");return i.setAttributeNS(null,"height",t.height.toString()),i.setAttributeNS(null,"width",t.width.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",t.href),i.setAttributeNS(null,"x",t.x.toString()),i.setAttributeNS(null,"y",t.y.toString()),i.setAttributeNS(null,"id",t.id),i.setAttributeNS(null,"visibility",t.visibility),e.isNullOrUndefined(this.getOptionValue(t,"clip-path"))||i.setAttributeNS(null,"clip-path",this.getOptionValue(t,"clip-path")),e.isNullOrUndefined(t.preserveAspectRatio)||i.setAttributeNS(null,"preserveAspectRatio",t.preserveAspectRatio),i},t.prototype.createText=function(t,i){var r=document.createElementNS(this.svgLink,"text");return r=this.setElementAttributes(t,r),e.isNullOrUndefined(i)||(r.textContent=i),r},t.prototype.createTSpan=function(t,i){var r=document.createElementNS(this.svgLink,"tspan");return r=this.setElementAttributes(t,r),e.isNullOrUndefined(i)||(r.textContent=i),r},t.prototype.createTitle=function(t){var e=document.createElementNS(this.svgLink,"title");return e.textContent=t,e},t.prototype.createDefs=function(){return document.createElementNS(this.svgLink,"defs")},t.prototype.createClipPath=function(t){var e=document.createElementNS(this.svgLink,"clipPath");return e=this.setElementAttributes(t,e)},t.prototype.createForeignObject=function(t){var e=document.createElementNS(this.svgLink,"foreignObject");return e=this.setElementAttributes(t,e)},t.prototype.createGroup=function(t){var e=document.createElementNS(this.svgLink,"g");return e=this.setElementAttributes(t,e)},t.prototype.createPattern=function(t,e){var i=document.createElementNS(this.svgLink,e);return i=this.setElementAttributes(t,i)},t.prototype.createRadialGradient=function(t,i,r){var o;if(e.isNullOrUndefined(t[0].colorStop))o=t[0].color.toString();else{var n={id:this.rootId+"_"+i+"radialGradient",cx:r.cx+"%",cy:r.cy+"%",r:r.r+"%",fx:r.fx+"%",fy:r.fy+"%"};this.drawGradient("radialGradient",n,t),o="url(#"+this.rootId+"_"+i+"radialGradient)"}return o},t.prototype.createLinearGradient=function(t,i,r){var o;if(e.isNullOrUndefined(t[0].colorStop))o=t[0].color.toString();else{var n={id:this.rootId+"_"+i+"linearGradient",x1:r.x1+"%",y1:r.y1+"%",x2:r.x2+"%",y2:r.y2+"%"};this.drawGradient("linearGradient",n,t),o="url(#"+this.rootId+"_"+i+"linearGradient)"}return o},t.prototype.drawGradient=function(t,i,r){var o=this.createDefs(),n=document.createElementNS(this.svgLink,t);n=this.setElementAttributes(i,n);for(var s=0;s<r.length;s++){var a=document.createElementNS(this.svgLink,"stop");a.setAttribute("offset",r[s].colorStop),a.setAttribute("stop-color",r[s].color),a.setAttribute("stop-opacity",r[s].opacity?r[s].opacity:"1"),e.isNullOrUndefined(r[s].style)||a.setAttribute("style",r[s].style),n.appendChild(a)}return o.appendChild(n),o},t.prototype.drawClipPath=function(t){var e=this.createDefs(),i=this.createClipPath({id:t.id});t.id=t.id+"_Rect";var r=this.drawRectangle(t);return i.appendChild(r),e.appendChild(i),e},t.prototype.drawCircularClipPath=function(t){var e=this.createDefs(),i=this.createClipPath({id:t.id});t.id=t.id+"_Circle";var r=this.drawCircle(t);return i.appendChild(r),e.appendChild(i),e},t.prototype.setElementAttributes=function(t,e){for(var i=Object.keys(t),r=0;r<i.length;r++)e.setAttribute(i[r],t[i[r]]);return e},t.prototype.createCanvas=function(){return null},t}(),d=function(){function t(t){this.rootId=t}return t.prototype.getOptionValue=function(t,e){return t[e]},t.prototype.createCanvas=function(t){var e=document.createElement("canvas");return e.setAttribute("id",this.rootId+"_canvas"),this.ctx=e.getContext("2d"),this.canvasObj=e,this.setCanvasSize(t.width,t.height),this.canvasObj},t.prototype.setCanvasSize=function(t,i){var r=document.getElementById(this.rootId),o=e.isNullOrUndefined(r)?null:r.getBoundingClientRect();e.isNullOrUndefined(this.width)?this.canvasObj.setAttribute("width",t?t.toString():o.width.toString()):this.canvasObj.setAttribute("width",this.width.toString()),e.isNullOrUndefined(this.height)?this.canvasObj.setAttribute("height",i?i.toString():"450"):this.canvasObj.setAttribute("height",this.height.toString())},t.prototype.setAttributes=function(t){this.ctx.lineWidth=this.getOptionValue(t,"stroke-width");var i=this.getOptionValue(t,"stroke-dasharray");if(!e.isNullOrUndefined(i)){var r=i.split(",");this.ctx.setLineDash([parseInt(r[0],10),parseInt(r[1],10)])}this.ctx.strokeStyle=this.getOptionValue(t,"stroke")},t.prototype.drawLine=function(t){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.moveTo(t.x1,t.y1),this.ctx.lineTo(t.x2,t.y2),this.ctx.stroke(),this.ctx.restore()},t.prototype.drawRectangle=function(t,e){var i=this.ctx,r=t.rx;return this.ctx.save(),this.ctx.beginPath(),e&&this.ctx.translate(e[0],e[1]),this.ctx.globalAlpha=this.getOptionValue(t,"opacity"),this.setAttributes(t),this.ctx.rect(t.x,t.y,t.width,t.height),null!==r&&r>=0?this.drawCornerRadius(t):("none"===t.fill&&(t.fill="transparent"),this.ctx.fillStyle=t.fill,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.ctx.stroke()),this.ctx.restore(),this.ctx=i,this.canvasObj},t.prototype.drawCornerRadius=function(t){var e=t.rx,i=t.x,r=t.y,o=t.width,n=t.height;"none"===t.fill&&(t.fill="transparent"),this.ctx.fillStyle=t.fill,o<2*e&&(e=o/2),n<2*e&&(e=n/2),this.ctx.beginPath(),this.ctx.moveTo(i+o-e,r),this.ctx.arcTo(i+o,r,i+o,r+n,e),this.ctx.arcTo(i+o,r+n,i,r+n,e),this.ctx.arcTo(i,r+n,i,r,e),this.ctx.arcTo(i,r,i+o,r,e),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke()},t.prototype.drawPath=function(t,e){var i=t.d.split(" "),r=this.getOptionValue(t,"stroke-width"),o=this.ctx,n=!0;this.ctx.save(),this.ctx.beginPath(),e&&this.ctx.translate(e[0],e[1]),this.ctx.globalAlpha=t.opacity?t.opacity:this.getOptionValue(t,"fill-opacity"),this.setAttributes(t);for(var s=0;s<i.length;s+=3){var a=parseFloat(i[s+1]),h=parseFloat(i[s+2]);switch(i[s]){case"M":t.innerR||t.cx||this.ctx.moveTo(a,h);break;case"L":t.innerR||this.ctx.lineTo(a,h);break;case"Q":var l=parseFloat(i[s+3]),p=parseFloat(i[s+4]);this.ctx.quadraticCurveTo(a,h,l,p),s+=2;break;case"C":var d=parseFloat(i[s+3]),c=parseFloat(i[s+4]),u=parseFloat(i[s+5]),y=parseFloat(i[s+6]);this.ctx.bezierCurveTo(a,h,d,c,u,y),s+=4;break;case"A":t.innerR?n&&(this.ctx.arc(t.x,t.y,t.radius,t.start,t.end,t.counterClockWise),this.ctx.arc(t.x,t.y,t.innerR,t.end,t.start,!t.counterClockWise),n=!1):t.cx?this.ctx.arc(t.cx,t.cy,t.radius,0,2*Math.PI,t.counterClockWise):(this.ctx.moveTo(t.x,t.y),this.ctx.arc(t.x,t.y,t.radius,t.start,t.end,t.counterClockWise),this.ctx.lineTo(t.x,t.y)),s+=5;break;case"z":case"Z":this.ctx.closePath(),s-=2}}return"none"!==t.fill&&void 0!==t.fill&&(this.ctx.fillStyle=t.fill,this.ctx.fill()),r>0&&this.ctx.stroke(),this.ctx.restore(),this.ctx=o,this.canvasObj},t.prototype.createText=function(t,i,r,o,n,s){var a=this.getOptionValue(t,"font-weight");e.isNullOrUndefined(a)||"regular"!==a.toLowerCase()||(a="normal");var h=this.getOptionValue(t,"font-size"),l=this.getOptionValue(t,"font-family"),p=this.getOptionValue(t,"font-style").toLowerCase()+" "+a+" "+h+" "+l,d=this.getOptionValue(t,"text-anchor"),c=void 0!==t.opacity?t.opacity:1;if("middle"===d&&(d="center"),this.ctx.save(),this.ctx.fillStyle=t.fill,this.ctx.font=p,this.ctx.textAlign=d,this.ctx.globalAlpha=c,t.baseline&&(this.ctx.textBaseline=t.baseline),!s){this.ctx.translate(t.x+0+(r||0),t.y+(o||0)),this.ctx.rotate(t.labelRotation*Math.PI/180)}return this.ctx.fillText(i,s?t.x:0,s?n:0),this.ctx.restore(),this.canvasObj},t.prototype.drawCircle=function(t,e){var i=this.ctx;return this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),this.ctx.fillStyle=t.fill,this.ctx.globalAlpha=t.opacity,this.ctx.fill(),e&&this.ctx.translate(e[0],e[1]),this.setAttributes(t),this.ctx.stroke(),this.ctx.restore(),this.ctx=i,this.canvasObj},t.prototype.drawPolyline=function(t){this.ctx.save(),this.ctx.beginPath();for(var e=t.points.split(" "),i=0;i<e.length-1;i++){var r=e[i].split(","),o=parseFloat(r[0]),n=parseFloat(r[1]);0===i?this.ctx.moveTo(o,n):this.ctx.lineTo(o,n)}this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.stroke(),this.ctx.restore()},t.prototype.drawEllipse=function(t,e){var i=this.ctx,r=Math.max(t.rx,t.ry),o=t.rx/r,n=t.ry/r;this.ctx.save(),this.ctx.beginPath(),this.ctx.translate(t.cx,t.cy),e&&this.ctx.translate(e[0],e[1]),this.ctx.save(),this.ctx.scale(o,n),this.ctx.arc(0,0,r,0,2*Math.PI,!1),this.ctx.fillStyle=t.fill,this.ctx.fill(),this.ctx.restore(),this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.stroke(),this.ctx.restore(),this.ctx=i},t.prototype.drawImage=function(t){this.ctx.save();var i=new Image;e.isNullOrUndefined(t.href)||(i.src=t.href,this.ctx.drawImage(i,t.x,t.y,t.width,t.height)),this.ctx.restore()},t.prototype.createLinearGradient=function(t){var i;return e.isNullOrUndefined(t[0].colorStop)||(i=this.ctx.createLinearGradient(0,0,0,this.canvasObj.height)),this.setGradientValues(t,i)},t.prototype.createRadialGradient=function(t){var i;return e.isNullOrUndefined(t[0].colorStop)||(i=this.ctx.createRadialGradient(0,0,0,0,0,this.canvasObj.height)),this.setGradientValues(t,i)},t.prototype.setGradientValues=function(t,i){var r;if(e.isNullOrUndefined(t[0].colorStop))r=t[0].color.toString();else{for(var o=0;o<=t.length-1;o++){var n=t[o].color,s=t[o].colorStop.slice(0,-1),a=parseInt(s,10)/100;i.addColorStop(a,n)}r=i.toString()}return r},t.prototype.setElementAttributes=function(t,e){for(var i=Object.keys(t),r=Object.keys(t).map(function(e){return t[e]}),o=0;o<i.length;o++)e.setAttribute(i[o],r[o]);return null},t.prototype.updateCanvasAttributes=function(t){this.setElementAttributes(t,this.canvasObj);var i=this.ctx;if(!e.isNullOrUndefined(this.dataUrl)){var r=new Image;r.onload=function(){i.drawImage(r,0,0)},r.src=this.dataUrl}},t.prototype.clearRect=function(t){this.ctx.restore(),this.ctx.clearRect(t.x,t.y,t.width,t.height)},t.prototype.createGroup=function(){return null},t.prototype.drawClipPath=function(){return null},t.prototype.canvasClip=function(t){this.ctx.save(),this.ctx.fillStyle="transparent",this.ctx.rect(t.x,t.y,t.width,t.height),this.ctx.fill(),this.ctx.clip()},t.prototype.canvasRestore=function(){this.ctx.restore()},t.prototype.drawPolygon=function(){return null},t.prototype.createDefs=function(){return null},t.prototype.createClipPath=function(){return null},t.prototype.createSvg=function(){return null},t}(),c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),u=function(){function t(t,e){this.width=t,this.height=e}return t}(),y=function(){function t(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r}return t}(),g=function(){function t(t,e){this.isRight=e,this.isBottom=t}return t}(),f=function(){function t(t){this.id=t}return t}(),m=function(t){function e(e,i,r,o,n,s,a,h){void 0===s&&(s="");var l=t.call(this,e)||this;return l.transform="",l.baseLine="auto",l.labelRotation=0,l.x=i,l.y=r,l.anchor=o,l.text=n,l.transform=s,l.baseLine=a,l.labelRotation=h,l}return c(e,t),e}(f),x=function(t){function e(e,i,r,o,n,s,a){var h=t.call(this,e)||this;return h.opacity=n,h.fill=i,h.stroke=o,h["stroke-width"]=r,h["stroke-dasharray"]=s,h.d=a,h}return c(e,t),e}(f),v=function(){function t(t,e){this.x=t,this.y=e}return t}(),b=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),w=function(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},S=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(null)],i.prototype,"size",void 0),w([e.Property("")],i.prototype,"color",void 0),w([e.Property("Segoe UI")],i.prototype,"fontFamily",void 0),w([e.Property("Normal")],i.prototype,"fontWeight",void 0),w([e.Property("Normal")],i.prototype,"fontStyle",void 0),w([e.Property(1)],i.prototype,"opacity",void 0),i}(e.ChildProperty),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property("")],i.prototype,"color",void 0),w([e.Property(1)],i.prototype,"width",void 0),i}(e.ChildProperty),L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(0)],i.prototype,"x",void 0),w([e.Property(0)],i.prototype,"y",void 0),w([e.Property(0)],i.prototype,"width",void 0),w([e.Property(0)],i.prototype,"height",void 0),i}(e.ChildProperty),O=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(0)],i.prototype,"x",void 0),w([e.Property(0)],i.prototype,"y",void 0),i}(e.ChildProperty),T=function(t){function h(e,i){return t.call(this,e,i)||this}return b(h,t),h.prototype.preRender=function(){this.allowServerDataBinding=!1,this.initPrivateVariable(),this.isCanvas||this.removeSVG(),this.createTooltipElement()},h.prototype.initPrivateVariable=function(){this.renderer=new p(this.element.id),this.themeStyle=i(this.theme),this.formattedText=[],this.padding=5,this.isFirst=!0,this.markerPoint=[]},h.prototype.removeSVG=function(){var t=document.getElementById(this.element.id+"_svg"),i=document.getElementById(this.element.id+"parent_template");this.blazorTemplate&&e.resetBlazorTemplate(this.element.id+"parent_template_blazorTemplate"),t&&t.parentNode&&e.remove(t),i&&i.parentNode&&e.remove(i)},h.prototype.render=function(){if(this.fadeOuted=!1,this.template)this.updateTemplateFn(),this.createTemplate(this.areaBounds,this.location);else{this.renderText(this.isFirst);var t={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",t);var i=this.renderTooltipElement(this.areaBounds,this.location);this.drawMarker(i.isBottom,i.isRight,this.markerSize)}this.trigger("loaded",{tooltip:this});var r=document.getElementById("chartmeasuretext");r&&e.remove(r),this.allowServerDataBinding=!0},h.prototype.createTooltipElement=function(){if(this.textElements=[],!this.template||this.shared){var t=this.renderer.createSvg({id:this.element.id+"_svg"});this.element.appendChild(t);var e=document.getElementById(this.element.id+"_group");e||(e=this.renderer.createGroup({id:this.element.id+"_group"})).setAttribute("transform","translate(0,0)"),t.appendChild(e);var i=this.renderer.drawPath({id:this.element.id+"_path","stroke-width":this.border.width,fill:this.fill||this.themeStyle.tooltipFill,opacity:"TailwindDark"!==this.theme&&"Tailwind"!==this.theme||.75!==this.opacity?this.opacity:1,stroke:this.border.color});e.appendChild(i)}},h.prototype.drawMarker=function(t,e,i){if(this.shapes.length<=0)return null;for(var r,o=0,s=this.renderer.createGroup({id:this.element.id+"_trackball_group"}),h=n(this.element.id+"_group"),l=2*this.marginX+i/2+(e?this.arrowPadding:0),p=0,d=this.shapes;p<d.length;p++){var c=d[p];"None"!==c&&(r=new x(this.element.id+"_Trackball_"+o,this.palette[o],1,"#cccccc",1,null),this.markerPoint[o]&&s.appendChild(a(new v(l,this.markerPoint[o]-this.padding+(t?this.arrowPadding:0)),c,new u(i,i),"",r,null)),o++)}h.appendChild(s)},h.prototype.renderTooltipElement=function(t,i){var s,a=n(this.element.id),h=new v(0,0),l=new v(0,0),p=n(this.element.id+"_svg"),d=n(this.element.id+"_group"),c=n(this.element.id+"_path"),u=!1,f=!1,m=!1,x=0,b=0;if(this.tipRadius=1,""!==this.header&&(this.elementSize.height+=this.marginY),this.content.length>1?(s=this.sharedTooltipLocation(t,this.location.x,this.location.y),u=!0):(s=this.tooltipLocation(t,i,h,l),this.inverted?x=(f=s.x<i.x+this.clipBounds.x)?0:this.arrowPadding:(m=!(u=s.y<i.y+this.clipBounds.y),b=u?0:this.arrowPadding)),""!==this.header){var w=r(this.isWrap?this.wrappedText:this.header,this.textStyle).height+2*this.marginY+(m?this.arrowPadding:0)+(this.isWrap?5:0),S="M "+(3*this.marginX+(f||u||m?0:this.arrowPadding))+" "+w+"L "+(s.width+(f||u||m?0:this.arrowPadding)-2*this.marginX)+" "+w,P=this.renderer.drawPath({id:this.element.id+"_header_path","stroke-width":1,fill:null,opacity:.8,stroke:this.themeStyle.tooltipHeaderLine,d:S});d.appendChild(P)}var L=this.border.width/2,O=new y(L+x,L+b,s.width-L,s.height-L);if(d.setAttribute("opacity","1"),!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(a,s.x,s.y):this.animateTooltipDiv(a,s),p.setAttribute("height",(s.height+this.border.width+(this.inverted?0:this.arrowPadding)+5).toString()),p.setAttribute("width",(s.width+this.border.width+(this.inverted?this.arrowPadding:0)+5).toString()),p.setAttribute("opacity","1"),e.isNullOrUndefined(this.tooltipPlacement)||(u=this.tooltipPlacement.indexOf("Top")>-1,m=this.tooltipPlacement.indexOf("Bottom")>-1,f=this.tooltipPlacement.indexOf("Left")>-1),c.setAttribute("d",o(this.rx,this.ry,O,h,this.arrowPadding,u,m,f,l.x,l.y,this.tipRadius)),this.enableShadow&&"Bootstrap4"!==this.theme){var T=this.element.id+"_shadow";"Tailwind"===this.theme||"TailwindDark"===this.theme?c.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):c.setAttribute("filter",e.Browser.isIE?"":"url(#"+T+")");var A='<filter id="'+T+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>';A+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/>',A+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';var C=this.renderer.createDefs();C.setAttribute("id",this.element.id+"SVG_tooltip_definition"),d.appendChild(C),C.innerHTML=A}return c.setAttribute("stroke",this.border.color),this.changeText(new v(x,b),m,!f&&!u&&!m),new g(m,!f&&!u&&!m)},h.prototype.changeText=function(t,e,i){var r=document.getElementById(this.element.id+"_text");e&&r.setAttribute("transform","translate(0,"+this.arrowPadding+")"),i&&r.setAttribute("transform","translate("+this.arrowPadding+" 0)")},h.prototype.findFormattedText=function(){this.formattedText=[],""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(this.formattedText=this.formattedText.concat(this.header)),this.formattedText=this.formattedText.concat(this.content)},h.prototype.renderText=function(t){var i,o,a,h,p,d=0,c=0,y=0,g=e.extend({},this.textStyle,null,!0).properties,f=n(this.element.id+"_group"),x="";this.findFormattedText();var v="rtl"===document.body.getAttribute("dir")?"end":"start";this.leftSpace=this.areaBounds.x+this.location.x,this.rightSpace=this.areaBounds.x+this.areaBounds.width-this.leftSpace;var b=this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim(),w=this.header.indexOf("<b>")>-1&&this.header.indexOf("</b>")>-1,S=r(this.formattedText[0],g).width+2*this.marginX+this.arrowPadding,P=this.location.x-S<this.location.x,L=this.areaBounds.x+this.areaBounds.width<this.location.x+S,O=""!==b?this.marginY:0,T=!0,A=!0;this.markerPoint=[];var C,k=this.shapes.length>0?10:0,E=this.shapes.length>0?5:0,B="Normal",N=this.themeStyle.tooltipLightLabel,z=22/parseFloat("13px")*parseFloat(g.size);t&&!this.isCanvas||(s(this.element.id+"_text"),s(this.element.id+"_header_path"),s(this.element.id+"_trackball_group"),s(this.element.id+"SVG_tooltip_definition"));for(var F=new m(this.element.id+"_text",2*this.marginX,2*this.marginY+2*this.padding+(2===this.marginY?3:0),v,""),_=l(F,g,null,f),I=1===this.formattedText.length&&this.formattedText[0].indexOf(" : <b>")>-1,R=""!==this.header,j=R&&w?16:13,M=0,D=this.formattedText.length;M<D;M++)if(a=this.formattedText[M].replace(/<(b|strong)>/g,"<b>").replace(/<\/(b|strong)>/g,"</b>").split(/<br.*?>/g),0===M&&!I&&this.isTextWrap&&(this.leftSpace<S||P)&&(this.rightSpace<S||L)&&(C=Math.round(this.leftSpace>this.rightSpace?this.leftSpace/j:this.rightSpace/j),a=(""!==b?b:this.formattedText[M]).match(new RegExp(".{1,"+C+"}","g")),this.wrappedText=w?"<b>"+a.join("<br>")+"</b>":a.join("<br>"),this.isWrap=a.length>1),""!==a[0]){0===M&&""!==b||this.markerPoint.push((""!==b?this.marginY:0)+F.y+d);for(var V=0,G=a.length;V<G;V++){y=0,A=!0,d+=z;for(var U=0,W=(i=a[V].replace(/<b>/g,"<br><b>").replace(/<\/b>/g,"</b><br>").replace(/:/g,"<br>:<br>").split("<br>")).length;U<W;U++)h=i[U],/\S/.test(h)||""===h||(h=" "),(!A&&" "===h||""!==h.replace(/<b>/g,"").replace(/<\/b>/g,"").trim())&&(y+=" "!==h?4:0,A&&!T?(p={x:2*this.marginX+(k+E),dy:z+(A?O:0),fill:""},O=null):p=T&&A?{x:""===b?2*this.marginX+(k+E):2*this.marginX+(this.isWrap?k+E:0)}:{},A=!1,o=this.renderer.createTSpan(p,""),_.appendChild(o),h.indexOf("<b>")>-1||w&&0===U&&0===M&&(R||this.isWrap)?(B="bold",N=this.themeStyle.tooltipBoldLabel,x="font-weight:"+B,g.fontWeight=B,o.setAttribute("fill",this.textStyle.color||N)):(x="bold"===B?"font-weight:"+B:"",g.fontWeight=B,o.setAttribute("fill",this.textStyle.color||N)),(h.indexOf("</b>")>-1||w&&U===W-1&&0===M&&(R||this.isWrap))&&(B="Normal",N=this.themeStyle.tooltipLightLabel),o.textContent=h=this.getTooltipTextContent(h),y+=r(h,g).width,""!==x&&(o.style.fontWeight=x.split("font-weight:")[1],o.style.color=o.getAttribute("fill")),o.style.fontFamily="inherit",o.style.fontStyle="inherit",o.style.fontSize="inherit",T=!1);y-=4,c=Math.max(c,y)}}this.elementSize=new u(c+(c>0?2*this.marginX:0),d),this.elementSize.width+=k+E;var Q=_.childNodes[0];if(""!==b&&Q&&!this.isWrap){g.fontWeight="bold";var H=(this.elementSize.width+2*this.padding)/2-r(b,g).width/2;Q.setAttribute("x",H.toString())}},h.prototype.getTooltipTextContent=function(t){var i=t.match(/<[a-zA-Z\/](.|\n)*?>/g);if(e.isNullOrUndefined(i))return t;for(var r=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(t),o=0;o<i.length;o++)this.isValidHTMLElement(i[o].replace("<","").replace("/","").replace(">","").trim())&&(t=t.replace(i[o],r?"":""));return t},h.prototype.isValidHTMLElement=function(t){return"[object HTMLUnknownElement]"!=document.createElement(t).toString()},h.prototype.createTemplate=function(t,i){var r={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",r);var o=document.getElementById(this.element.id);this.isCanvas&&this.removeSVG();var s=o.firstElementChild;if(s&&e.remove(s),r.cancel)e.remove(n(this.element.id+"_tooltip"));else{for(var a=e.createElement("div",{id:this.element.id+"parent_template"}),h=this.templateFn(this.data,this.controlInstance,a.id,a.id+"_blazorTemplate","");h&&h.length>0;)e.isBlazor()||1===h.length?(a.appendChild(h[0]),h=null):a.appendChild(h[0]);o.appendChild(a);var l=this.isCanvas?a:this.element,p=l.getBoundingClientRect();this.padding=0,this.elementSize=new u(p.width,p.height);var d=this.shared?this.sharedTooltipLocation(t,this.location.x,this.location.y):this.tooltipLocation(t,i,new v(0,0),new v(0,0));if(!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(l,d.x,d.y):this.animateTooltipDiv(this.element,d),this.blazorTemplate){var c=function(){var e=n(y.element.id).getBoundingClientRect();y.elementSize=new u(e.width,e.height);var r=y.tooltipLocation(t,i,new v(0,0),new v(0,0));y.updateDiv(n(y.element.id),r.x,r.y)},y=this;c.bind(y,t,i),e.updateBlazorTemplate(this.element.id+"parent_template_blazorTemplate",this.blazorTemplate.name,this.blazorTemplate.parent,void 0,c)}}},h.prototype.sharedTooltipLocation=function(t,e,i){var r=this.elementSize.width+2*this.marginX,o=this.elementSize.height+2*this.marginY,n=new y(e+2*this.padding,i-o-this.padding,r,o);return n.y<t.y&&(n.y+=n.height+2*this.padding),n.x+n.width>t.x+t.width&&(n.x-=n.width+4*this.padding),n},h.prototype.getCurrentPosition=function(t,e,i,r){var o=this.tooltipPlacement,n=this.clipBounds.x,s=this.clipBounds.y,a=this.offset,h=this.elementSize.width+2*this.marginX,l=this.elementSize.height+2*this.marginY,p=new v(e.x,e.y);return"Top"===o||"Bottom"===o?(p=new v(p.x+n-this.elementSize.width/2-this.padding,p.y+s-this.elementSize.height-2*this.padding-this.arrowPadding-a),i.x=r.x=h/2,"Bottom"===o&&(p.y=e.y+s+a),t.x+t.width<p.x+h?(p.x=t.width>h?t.x+t.width-h+6:t.x,i.x=r.x=t.width>h?t.x+e.x-p.x:e.x):t.x>p.x&&(p.x=t.x,i.x=r.x=e.x)):(p=new v(p.x+n+a,p.y+s-this.elementSize.height/2-this.padding),i.y=r.y=l/2,"Left"===o&&(p.x=e.x+n-a-(h+this.arrowPadding)),t.y+t.height<p.y+l?(p.y=t.height>l?t.y+t.height-l+6:t.y,i.y=r.y=t.height>l?t.y+e.y-p.y:e.y):t.y>p.y&&(p.y=t.y,i.y=r.y=e.y)),new y(p.x,p.y,h,l)},h.prototype.tooltipLocation=function(t,i,r,o){if(!e.isNullOrUndefined(this.tooltipPlacement))return this.getCurrentPosition(t,i,r,o);var n=new v(i.x,i.y),s=this.elementSize.width+2*this.marginX,a=this.elementSize.height+2*this.marginY,h=this.offset,l=this.clipBounds.x,p=this.clipBounds.y,d=t.x,c=t.y;return this.inverted?(n=new v(n.x+l+h,n.y+p-this.elementSize.height/2-this.padding),r.y=o.y=a/2,(n.x+s+this.arrowPadding>d+t.width||this.isNegative)&&(n.x=(i.x>t.width?t.width:i.x)+l-h-(s+this.arrowPadding)),n.x<d&&(n.x=(i.x<0?0:i.x)+l+h),n.y<=c&&(r.y-=c-n.y,o.y-=c-n.y,n.y=c),n.y+a>=c+t.height&&(r.y+=n.y+a-(c+t.height),o.y+=n.y+a-(c+t.height),n.y-=n.y+a-(c+t.height)),r.y+this.arrowPadding/2>a-this.ry&&(r.y=a-this.ry-this.arrowPadding/2,o.y=a,this.tipRadius=0),r.y-this.arrowPadding/2<this.ry&&(r.y=this.ry+this.arrowPadding/2,o.y=0,this.tipRadius=0)):(n=new v(n.x+l-this.elementSize.width/2-this.padding,n.y+p-this.elementSize.height-2*this.padding-this.arrowPadding-h),r.x=o.x=s/2,(n.y<c||this.isNegative)&&(n.y=(i.y<0?0:i.y)+p+h),n.y+a+this.arrowPadding>c+t.height&&(n.y=Math.min(i.y,c+t.height)+p-this.elementSize.height-2*this.padding-this.arrowPadding-h),o.x=s/2,n.x<d&&(r.x-=d-n.x,o.x-=d-n.x,n.x=d),n.x+s>d+t.width&&(r.x+=n.x+s-(d+t.width),o.x+=n.x+s-(d+t.width),n.x-=n.x+s-(d+t.width)),r.x+this.arrowPadding/2>s-this.rx&&(r.x=s-this.rx-this.arrowPadding/2,o.x=s,this.tipRadius=0),r.x-this.arrowPadding/2<this.rx&&(r.x=this.rx+this.arrowPadding/2,o.x=0,this.tipRadius=0)),new y(n.x,n.y,s,a)},h.prototype.animateTooltipDiv=function(t,i){var r,o=this,n=parseFloat(t.style.left),s=parseFloat(t.style.top);new e.Animation({}).animate(t,{duration:this.duration,progress:function(e){r=e.timeStamp/e.duration,t.style.animation=null,t.style.left=n+r*(i.x-n)+"px",t.style.top=s+r*(i.y-s)+"px"},end:function(e){o.updateDiv(t,i.x,i.y),o.trigger("animationComplete",{tooltip:o})}})},h.prototype.updateDiv=function(t,e,i){t.style.left=e+"px",t.style.top=i+"px"},h.prototype.updateTemplateFn=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.templateFn=e.compile(document.querySelector(this.template).innerHTML.trim()))}catch(t){this.templateFn=e.compile(this.template)}},h.prototype.fadeOut=function(){var t=this,i=n(this.isCanvas&&!this.template?this.element.id+"_svg":this.element.id);if(i){var r=i.firstChild;if(this.isCanvas&&!this.template&&(r=document.getElementById(this.element.id+"_group")?document.getElementById(this.element.id+"_group"):r),!r)return null;var o=parseFloat(r.getAttribute("opacity"))||1;new e.Animation({}).animate(r,{duration:200,progress:function(e){t.progressAnimation(r,o,e.timeStamp/e.duration)},end:function(){t.fadeOuted=!0,t.endAnimation(r)}})}},h.prototype.progressAnimation=function(t,e,i){t.style.animation="",t.setAttribute("opacity",(e-i).toString())},h.prototype.endAnimation=function(t){t.setAttribute("opacity","0"),this.template&&(t.style.display="none"),this.trigger("animationComplete",{tooltip:this})},h.prototype.getPersistData=function(){var t=[];return this.addOnPersist(t)},h.prototype.getModuleName=function(){return"tooltip"},h.prototype.destroy=function(){t.prototype.destroy.call(this),this.element.classList.remove("e-tooltip")},h.prototype.onPropertyChanged=function(t,i){this.blazorTemplate&&e.resetBlazorTemplate(this.element.id+"parent_template_blazorTemplate"),this.isFirst=!1,this.render()},w([e.Property(!1)],h.prototype,"enable",void 0),w([e.Property(!1)],h.prototype,"shared",void 0),w([e.Property(!0)],h.prototype,"enableShadow",void 0),w([e.Property(null)],h.prototype,"fill",void 0),w([e.Property("")],h.prototype,"header",void 0),w([e.Property(.75)],h.prototype,"opacity",void 0),w([e.Complex({size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},S)],h.prototype,"textStyle",void 0),w([e.Property(null)],h.prototype,"template",void 0),w([e.Property(!0)],h.prototype,"enableAnimation",void 0),w([e.Property(300)],h.prototype,"duration",void 0),w([e.Property(!1)],h.prototype,"inverted",void 0),w([e.Property(!1)],h.prototype,"isNegative",void 0),w([e.Complex({color:"#cccccc",width:.5},P)],h.prototype,"border",void 0),w([e.Property([])],h.prototype,"content",void 0),w([e.Property(10)],h.prototype,"markerSize",void 0),w([e.Complex({x:0,y:0},O)],h.prototype,"clipBounds",void 0),w([e.Property([])],h.prototype,"palette",void 0),w([e.Property([])],h.prototype,"shapes",void 0),w([e.Complex({x:0,y:0},O)],h.prototype,"location",void 0),w([e.Property(0)],h.prototype,"offset",void 0),w([e.Property(2)],h.prototype,"rx",void 0),w([e.Property(2)],h.prototype,"ry",void 0),w([e.Property(5)],h.prototype,"marginX",void 0),w([e.Property(5)],h.prototype,"marginY",void 0),w([e.Property(12)],h.prototype,"arrowPadding",void 0),w([e.Property(null)],h.prototype,"data",void 0),w([e.Property("Material")],h.prototype,"theme",void 0),w([e.Complex({x:0,y:0,width:0,height:0},L)],h.prototype,"areaBounds",void 0),w([e.Property(null)],h.prototype,"availableSize",void 0),w([e.Property()],h.prototype,"blazorTemplate",void 0),w([e.Property(!1)],h.prototype,"isCanvas",void 0),w([e.Property(!1)],h.prototype,"isTextWrap",void 0),w([e.Property(null)],h.prototype,"tooltipPlacement",void 0),w([e.Property(null)],h.prototype,"controlInstance",void 0),w([e.Event()],h.prototype,"tooltipRender",void 0),w([e.Event()],h.prototype,"loaded",void 0),w([e.Event()],h.prototype,"animationComplete",void 0),h=w([e.NotifyPropertyChanges],h)}(e.Component);return t.TextStyle=S,t.TooltipBorder=P,t.AreaBounds=L,t.ToolLocation=O,t.Tooltip=T,t.getTooltipThemeColor=i,t.measureText=r,t.findDirection=o,t.Size=u,t.Rect=y,t.Side=g,t.CustomizeOption=f,t.TextOption=m,t.getElement=n,t.removeElement=s,t.drawSymbol=a,t.calculateShapes=h,t.PathOption=x,t.textElement=l,t.TooltipLocation=v,t.SvgRenderer=p,t.CanvasRenderer=d,t}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-charts.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.charts=function(e,t,i,r,o,n,a,s,l){"use strict";function h(e){var t;switch(e){case"Fabric":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"Bootstrap4":case"Bootstrap":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"HighContrastLight":case"Highcontrast":case"HighContrast":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"];break;case"FabricDark":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"BootstrapDark":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"Tailwind":t=["#5A61F6","#65A30D","#334155","#14B8A6","#8B5CF6","#0369A1","#F97316","#9333EA","#F59E0B","#15803D"];break;case"TailwindDark":t=["#8B5CF6","#22D3EE","#F87171","#4ADE80","#E879F9","#FCD34D","#F97316","#2DD4BF","#F472B6","#10B981"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function c(e){var t,i="MaterialDark"===e?"#303030":"FabricDark"===e?"#201F1F":"1A1A1A";switch(e){case"HighContrastLight":case"Highcontrast":case"HighContrast":t={axisLabel:"#ffffff",axisTitle:"#ffffff",axisLine:"#ffffff",majorGridLine:"#BFBFBF",minorGridLine:"#969696",majorTickLine:"#BFBFBF",minorTickLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:"#000000",areaBorder:"#ffffff",errorBar:"#ffffff",crosshairLine:"#ffffff",crosshairFill:"#ffffff",crosshairLabel:"#000000",tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696",markerShadow:"#BFBFBF",selectionRectFill:"rgba(255, 217, 57, 0.3)",selectionRectStroke:"#ffffff",selectionCircleStroke:"#FFD939"};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={axisLabel:"#DADADA",axisTitle:"#ffffff",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",majorTickLine:"#414040",minorTickLine:" #4A4848",chartTitle:"#ffffff",legendLabel:"#DADADA",background:i,areaBorder:" #9A9A9A",errorBar:"#ffffff",crosshairLine:"#F4F4F4",crosshairFill:"#F4F4F4",crosshairLabel:"#282727",tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A",markerShadow:null,selectionRectFill:"rgba(56,169,255, 0.1)",selectionRectStroke:"#38A9FF",selectionCircleStroke:"#282727"};break;case"Bootstrap4":t={axisLabel:"#212529",axisTitle:"#212529",axisLine:"#CED4DA",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",majorTickLine:"#ADB5BD",minorTickLine:"#CED4DA",chartTitle:"#212529",legendLabel:"#212529",background:"#FFFFFF",areaBorder:"#DEE2E6",errorBar:"#000000",crosshairLine:"#6C757D",crosshairFill:"#495057",crosshairLabel:"#FFFFFF",tooltipFill:"rgba(0, 0, 0, 0.9)",tooltipBoldLabel:"rgba(255,255,255)",tooltipLightLabel:"rgba(255,255,255, 0.9)",tooltipHeaderLine:"rgba(255,255,255, 0.2)",markerShadow:null,selectionRectFill:"rgba(255,255,255, 0.1)",selectionRectStroke:"rgba(0, 123, 255)",selectionCircleStroke:"#495057"};break;case"Tailwind":t={axisLabel:"#6B728",axisTitle:"#374151",axisLine:" #D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:" #D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:"rgba(255,255,255, 0.0)",areaBorder:" #E5E7EB",errorBar:"#374151",crosshairLine:"#1F2937",crosshairFill:"#111827",crosshairLabel:"#F9FAFB",tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280",markerShadow:null,selectionRectFill:"rgba(79,70,229, 0.1)",selectionRectStroke:"#4F46E5",selectionCircleStroke:"#6B7280"};break;case"TailwindDark":t={axisLabel:"#9CA3AF",axisTitle:"#9CA3AF",axisLine:" #4B5563",majorGridLine:"#374151",minorGridLine:"#374151",majorTickLine:"#4B5563",minorTickLine:" #4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"rgba(255,255,255, 0.0)",areaBorder:" #374151",errorBar:"#374151",crosshairLine:"#9CA3AF",crosshairFill:"#F9FAFB",crosshairLabel:"#1F2937",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",markerShadow:null,selectionRectFill:"rgba(34,211,238, 0.1)",selectionRectStroke:"#22D3EE",selectionCircleStroke:"#282727"};break;default:t={axisLabel:"#686868",axisTitle:"#424242",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",majorTickLine:"#b5b5b5",minorTickLine:"#d6d6d6",chartTitle:"#424242",legendLabel:"#353535",background:"#FFFFFF",areaBorder:"Gray",errorBar:"#000000",crosshairLine:"#4f4f4f",crosshairFill:"#4f4f4f",crosshairLabel:"#e5e5e5",tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff",markerShadow:null,selectionRectFill:"rgba(41, 171, 226, 0.1)",selectionRectStroke:"#29abe2",selectionCircleStroke:"#29abe2"}}return t}function d(e){var t;switch(e){case"HighContrastLight":t={backRect:"#333",thumb:"#bfbfbf",circle:"#fff",circleHover:"#685708",arrow:"#333",grip:"#333",arrowHover:"#fff",backRectBorder:"#969696"};break;case"Bootstrap":t={backRect:"#f5f5f5",thumb:"#e6e6e6",circle:"#fff",circleHover:"#eee",arrow:"#8c8c8c",grip:"#8c8c8c"};break;case"Fabric":t={backRect:"#f8f8f8",thumb:"#eaeaea",circle:"#fff",circleHover:"#eaeaea",arrow:"#a6a6a6",grip:"#a6a6a6"};break;default:t={backRect:"#f5f5f5",thumb:"#e0e0e0",circle:"#fff",circleHover:"#eee",arrow:"#9e9e9e",grip:"#9e9e9e"}}return t}function p(e,i,r){var o=t.extend([],e,null);return o.sort(function(e,t){for(var o=0,n=0,a=0;a<i.length;a++)o+=e[i[a]],n+=t[i[a]];return!r&&o<n||r&&o>n?-1:o===n?0:1}),o}function u(e){return-1!==e.indexOf("<br>")}function g(e){for(var i,r=t.extend([],e.points,null,!0),o=[],n=0,a=0;a<r.length;a++)i=r[a],t.isNullOrUndefined(i.x)||""===i.x||(i.index=n++,o.push(i));return o}function y(e,r,o,n){var a,s,l,h,c,d=new i.SvgRenderer(n.element.id),p=[],g={id:"rotate_text",x:n.initialClipRect.x,y:n.initialClipRect.y,"font-size":e.size,"font-style":e.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight,transform:"rotate("+o+", 0, 0)","text-anchor":"middle"};a=u(r)?(p=r.split("<br>"))[0]:r;var y=d.createText(g,a);if(n.delayRedraw||n.redraw||n.element.appendChild(n.svgObject),"string"!=typeof p&&p.length>1)for(var m=1,v=p.length;m<v;m++)s=i.measureText(p[m],e).height,l=g.y+m*s,h=p[m],c=d.createTSpan({x:g.x,id:g.id,y:l},h),y.appendChild(c);n.svgObject.appendChild(y);var f=y.getBoundingClientRect();return t.remove(y),n.delayRedraw||n.redraw||t.remove(n.svgObject),new i.Size(f.right-f.left,f.bottom-f.top)}function m(e){if(!e)return null;var i="string"==typeof e?he(e):e;i&&t.remove(i)}function v(e,t){return Math.log(e)/Math.log(t)}function f(e,r,o,n,a,s,l,h){var c=document.getElementById(a),d=i.measureText(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),p=d.width+5;r=r+p>n?r-(p+15):r,o=h?o-d.height/2:o+15,c?(c.innerHTML=e,c.style.top=o.toString()+"px",c.style.left=(r+15).toString()+"px"):(c=t.createElement("div",{innerHTML:e,id:a,styles:"top:"+o.toString()+"px;left:"+(r+15).toString()+'px;background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(112, 112, 112); padding-left : 3px; padding-right : 2px;padding-bottom : 2px; padding-top : 2px; font-size:12px; font-family: "Segoe UI"'}),s.appendChild(c),parseInt(c.style.left.replace("px",""),10)<0&&(c.style.left="0px")),l&&setTimeout(function(){m(a)},1500)}function b(e,t){return e<t.max&&e>t.min}function x(e,t){return e<=t.max&&e>=t.min}function w(e,t){return"Logarithmic"===t.valueType?v(e,t.logBase):e}function S(e,t,i,r){var o=w(t.xValue,r.xAxis),n=e?w(e.xValue,r.xAxis):o,a=i?w(i.xValue,r.xAxis):o,s=Math.floor(r.xAxis.visibleRange.min),l=Math.ceil(r.xAxis.visibleRange.max);return n>=s&&n<=l||o>=s&&o<=l||a>=s&&a<=l||s>=n&&s<=a}function C(e){for(var t=0,i=0,r=e;i<r.length;i++)t+=r[i];return t}function P(e,i,r,o,n){var a=0;if(null!==o)for(s=i+1;s<r;s++)-1===o.indexOf(s)&&(a+=e[s][n.yName]);else for(var s=i+1;s<r;s++)t.isNullOrUndefined(e[s][n.yName])||(a+=e[s][n.yName]);return a}function L(e,t){return e.x+=t.left,e.y+=t.top,e.width-=t.left+t.right,e.height-=t.top+t.bottom,e}function R(e,t){return e.x+=t.x,e.y+=t.y,e.width-=t.x+t.width,e.height-=t.y+t.height,e}function M(e,t,i){var r=e*Math.PI/180;return new Vi(Math.cos(r)*t+i.x,Math.sin(r)*t+i.y)}function A(e){return e*(Math.PI/180)}function k(e,t,i,r){for(var o=[],n=0;n<4;n++){var a=e[n],s=a.x-t,l=a.y-i,h=s*Math.cos(A(r))-l*Math.sin(A(r)),c=s*Math.sin(A(r))+l*Math.cos(A(r));a.x=h+t,a.y=c+i,o.push(new Vi(a.x,a.y))}return o}function T(e,i){var r,o,n,a,s,l,h,c,d=[e,i];for(a=0;a<d.length;a++){var p=d[a];for(s=0;s<p.length;s++){var u=(s+1)%p.length,g=p[s],y=p[u],m=new Vi(y.y-g.y,g.x-y.x);for(r=o=void 0,l=0;l<e.length;l++)n=m.x*e[l].x+m.y*e[l].y,(t.isNullOrUndefined(r)||n<r)&&(r=n),(t.isNullOrUndefined(o)||n>o)&&(o=n);for(h=c=void 0,l=0;l<i.length;l++)n=m.x*i[l].x+m.y*i[l].y,(t.isNullOrUndefined(h)||n<h)&&(h=n),(t.isNullOrUndefined(c)||n>c)&&(c=n);if(o<h||c<r)return!1}}return!0}function _(e,t,i,r,o,n){var a=M(270,i,new Vi(e,t)),s=M(270,i,new Vi(e+o/10,t));return"M "+e+" "+t+" L "+(e+i)+" "+t+" A "+i+" "+i+" 0 1 1 "+a.x+" "+a.y+" Z M "+(e+o/10)+" "+(t-r/10)+" L"+(e+i)+" "+(t-r/10)+" A "+i+" "+i+" 0 0 0 "+s.x+" "+s.y+" Z"}function O(e,t){var i=Math.atan2(t.y-e.y,t.x-e.x);return(i=i<0?6.283+i:i)*(180/Math.PI)}function E(e,t){for(var i=[],r=0;r<=t-1;r++)i.push(e[r]);return i}function I(e,t){var i=t.visibleRange,r=(e-i.min)/i.delta;return t.isInversed?1-r:r}function z(e,t,i,r,o,n){e="Logarithmic"===i.valueType?v(e>1?e:1,i.logBase):e,t="Logarithmic"===r.valueType?v(t>1?t:1,r.logBase):t,e+="Category"===i.valueType&&"BetweenTicks"===i.labelPlacement&&"Radar"!==n.type?.5:0;var a=n.chart.radius*I(t,r),s=B(F(e,i),n.chart.primaryXAxis.startAngle);return{x:n.clipRect.width/2+n.clipRect.x+a*s.x,y:n.clipRect.height/2+n.clipRect.y+a*s.y}}function D(e,t){void 0===t&&(t=!1);var i=["NaN","NaN"];return e.indexOf("_Point_")>-1?i=e.split("_Series_")[1].split("_Point_"):e.indexOf("_shape_")>-1&&(!t||t&&-1===e.indexOf("_legend_"))?(i=e.split("_shape_"))[0]="0":e.indexOf("_text_")>-1&&(!t||t&&-1===e.indexOf("_legend_"))&&((i=e.split("_text_"))[0]="0"),new Jt(parseInt(i[0],10),parseInt(i[1],10))}function B(e,t){t=t<0?t+360:t;var i=Math.PI*(1.5-2*e);return i+=t*Math.PI/180,{x:Math.cos(i),y:Math.sin(i)}}function F(e,t){var i,r,o=t.visibleRange;return"Category"!==t.valueType?(i=o.max-("DateTime"===t.valueType?t.dateTimeInterval:o.interval)-o.min,r=t.visibleLabels.length-1,i=0===i?1:i):(i=1===t.visibleLabels.length?1:t.visibleLabels[t.visibleLabels.length-1].value-t.visibleLabels[0].value,r=t.visibleLabels.length),t.isInversed?(e-o.min)/i*(1-1/r):1-(e-o.min)/i*(1-1/r)}function N(e,i,r,o,n){var a=he(e),s="top:"+r.toString()+"px;left:"+o.toString()+"px;color:black !important; background:#FFFFFF !important; position:absolute;border:1px solid #707070;font-size:"+n+";border-radius:2px; z-index:1";a?(a.setAttribute("innerHTML"," "+i+" "),a.setAttribute("styles",s)):(a=t.createElement("div",{id:e,innerHTML:" "+i+" ",styles:s}),document.body.appendChild(a))}function V(e,t,r,o,n,a){for(var s,l,h,c,d,p=t.opposedPosition,u=n?"start":"auto",g=e.availableSize.width,y=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0,m=0;m<2;m++)s=i.measureText(m?t.endLabel:t.startLabel,t.labelStyle),n?(c=m?new Vi(a.x-y,a.y+3):new Vi(t.rect.x-y,a.y+a.height-3),l=a.x+(p?a.width+5+y:-(s.width+5+5+y)),h=a.y+(m?0:a.height-s.height-5),l+=l<0||g<l+s.width+5?p?-s.width/2:s.width/2:0,d=i.findDirection(3,3,new i.Rect(l,h,s.width+5,s.height+5),c,5,!1,!1,!p,c.x,c.y+(m?-3:3))):(c=m?new Vi(a.x+a.width-3,a.y+a.height+y):new Vi(a.x+3,a.y+a.height+y),l=a.x+(m?a.width-s.width-5:0),h=p?a.y-s.height-10-y:a.y+a.height+5+y,d=i.findDirection(3,3,new i.Rect(l,h,s.width+5,s.height+5),c,5,p,!p,!1,c.x+(m?3:-3),c.y)),l+=2.5,h=h+s.height/4*3+2.5,r.appendChild(e.renderer.drawPath(new i.PathOption(e.element.id+"_Zoom_"+o+"_AxisLabel_Shape_"+m,e.themeStyle.crosshairFill,2,e.themeStyle.crosshairFill,1,null,d))),Ve(e.renderer,new i.TextOption(e.element.id+"_Zoom_"+o+"_AxisLabel_"+m,l,h,u,m?t.endLabel:t.startLabel),{color:e.themeStyle.crosshairLabel,fontFamily:"Segoe UI",fontWeight:"Regular",size:"11px"},e.themeStyle.crosshairLabel,r);return r}function j(e,t,i,r,o){return void 0===r&&(r=0),void 0===o&&(o=0),e>=i.x-r&&e<=i.x+i.width+r&&t>=i.y-o&&t<=i.y+i.height+o}function H(e,t,i){return(i.isInversed?1-e/t:e/t)*i.visibleRange.delta+i.visibleRange.min}function X(e,t,i){return(i.isInversed?e/t:1-e/t)*i.visibleRange.delta+i.visibleRange.min}function Y(e){var t=e.clipRect;e.chart.requireInvertedAxis?(t.x=e.yAxis.rect.x,t.y=e.xAxis.rect.y,t.width=e.yAxis.rect.width,t.height=e.xAxis.rect.height):(t.x=e.xAxis.rect.x,t.y=e.yAxis.rect.y,t.width=e.xAxis.rect.width,t.height=e.yAxis.rect.height)}function G(e){return e.substr(0,1).toLowerCase()+e.substr(1)}function W(e,t,r){var o,n,a,s;return r?(o=t.rect.x,n=e.rect.y,a=t.rect.width,s=e.rect.height):(o=e.rect.x,n=t.rect.y,a=e.rect.width,s=t.rect.height),new i.Rect(o,n,a,s)}function U(e,i){for(var r,o,n,a=Number.MAX_VALUE,s=0;s<i.length;s++){var l=i[s];if(r=[],l.visible&&(e.name===l.xAxisName||"primaryXAxis"===e.name&&null===l.xAxisName||e.name===l.chart.primaryXAxis.name&&!l.xAxisName))if((r=l.points.map(function(e){return e.xValue})).sort(function(e,t){return e-t}),1===r.length)n="DateTime"===e.valueType&&l.xMin===l.xMax?l.xMin-2592e6:l.xMin,0!==(o=r[0]-(t.isNullOrUndefined(n)?e.visibleRange.min:n))&&(a=Math.min(a,o));else for(var h=0;h<r.length;h++){var c=r[h];h>0&&c&&0!==(o=c-r[h-1])&&(a=Math.min(a,o))}}return a===Number.MAX_VALUE&&(a=1),a}function Z(e){var t;switch(e){case"Linear":t=q}return t}function q(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t}function Q(e,i,r,o,n,a,s){var l=a.x,h=a.y,c=0;e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:r,delay:i,progress:function(t){t.timeStamp>t.delay&&(t.element.style.visibility="visible",c=(t.timeStamp-t.delay)/t.duration,e.setAttribute("transform","translate("+l+" "+h+") scale("+c+") translate("+-l+" "+-h+")"))},end:function(){e.style.visibility="","Scatter"!==o.type&&"Bubble"!==o.type||s||n!==o.points.length-1||o.chart.trigger("animationComplete",{series:o.chart.isBlazor?{}:o})}})}function $(e,r,o,n,a){var s=function(t){e.setAttribute("x",t.x+""),e.setAttribute("y",t.y+""),e.setAttribute("width",t.width+""),e.setAttribute("height",t.height+"")};new t.Animation({}).animate(t.createElement("div"),{duration:o,delay:r,progress:function(e){s(new i.Rect(q(e.timeStamp,a.x,n.x-a.x,e.duration),q(e.timeStamp,a.y,n.y-a.y,e.duration),q(e.timeStamp,a.width,n.width-a.width,e.duration),q(e.timeStamp,a.height,n.height-a.height,e.duration)))},end:function(){s(n)}})}function J(e,i,r,o,n){if(!r||!o&&!e)return null;var a=300;n&&(a=n);var s,l,h,c=o||e.getAttribute("d"),d=c.split(/(?=[LMCZAQ])/),p=i.split(/(?=[LMCZAQ])/),u=[],g=[];e.setAttribute("d",c),new t.Animation({}).animate(t.createElement("div"),{duration:a,progress:function(t){s="",d.map(function(e,i){if(u=e.split(" "),g=p[i]?p[i].split(" "):u,"Z"===u[0]?s+="Z ":s+=u[0]+" "+q(t.timeStamp,+u[1],+g[1]-+u[1],t.duration)+" "+q(t.timeStamp,+u[2],+g[2]-+u[2],t.duration)+" ","C"===u[0]||"Q"===u[0])for(l=3,h="Q"===u[0]?4:6;l<h;)s+=q(t.timeStamp,+u[l],+g[l]-+u[l],t.duration)+" "+q(t.timeStamp,+u[++l],+g[l]-+u[l],t.duration)+" ",++l;"A"===u[0]&&(s+="0 0 1 "+q(t.timeStamp,+u[6],+g[6]-+u[6],t.duration)+" "+q(t.timeStamp,+u[7],+g[7]-+u[7],t.duration)+" ")}),e.setAttribute("d",s)},end:function(){e.setAttribute("d",i)}})}function K(e,t,i,r){void 0===r&&(r="drawClipPath");var o=Fe(e,t.id,t,i);if(o){var n=i.createDefs();return n.appendChild(o),n}return i[r](t)}function ee(e,t,i,r,o){var n={cancel:!1,name:ai,axis:o,text:i,value:t,labelStyle:r};if(e.trigger(ai,n),!n.cancel){var a=-1!==n.text.indexOf("<br>"),s=o.enableTrim?a?De(o.maximumLabelWidth,n.text,o.labelStyle):ze(o.maximumLabelWidth,n.text,o.labelStyle):n.text;o.visibleLabels.push(new Ti(s,n.value,n.labelStyle,n.text))}}function te(e){return null!=e.minimum&&null!=e.maximum}function ie(e){return e.zoomFactor<1&&e.zoomPosition>=0}function re(e,i){var r="Horizontal"===i.orientation?e.width:e.height;if(t.isNullOrUndefined(i.desiredIntervals)){var o=("Horizontal"===i.orientation?.533:1)*i.maximumLabels;return o=Math.max(r*(o/100),1)}return i.desiredIntervals}function oe(e,i,r,o,n){new t.Animation({}).animate(e,{duration:r,delay:i,name:o,progress:function(e){e.element.style.visibility="visible"},end:function(e){n?t.remove(e.element):e.element.style.visibility="visible"}})}function ne(e,t,r,o,n,a,s,l,h,c){var d=s||new i.SvgRenderer(""),p=ae(e,r,t,n,o,h,c);return d["draw"+p.functionName](p.renderOption,l?new Int32Array([l.x,l.y]):null)}function ae(e,r,o,n,a,s,l){var h,c,d,p="Path",u=s,g=u&&"Circle"===o?r.width-2:r.width,y=u&&"Circle"===o?r.height-2:r.height,m=u?l.targetWidth:0,v=e.x,f=e.y,b=e.y+-y/2,x=e.x+-g/2;switch(o){case"Bubble":case"Circle":p="Ellipse",t.merge(n,{rx:g/2,ry:y/2,cx:v,cy:f});break;case"Cross":h="M "+x+" "+f+" L "+(v+g/2)+" "+f+" M "+v+" "+(f+y/2)+" L "+v+" "+(f+-y/2),t.merge(n,{d:h,stroke:n.fill});break;case"Multiply":h="M "+(v-m)+" "+(f-m)+" L "+(v+m)+" "+(f+m)+" M "+(v-m)+" "+(f+m)+" L "+(v+m)+" "+(f-m),t.merge(n,{d:h,stroke:n.fill});break;case"HorizontalLine":h="M "+x+" "+f+" L "+(v+g/2)+" "+f,t.merge(n,{d:h});break;case"VerticalLine":h="M "+v+" "+(f+y/2)+" L "+v+" "+(f+-y/2),t.merge(n,{d:h});break;case"Diamond":h="M "+x+" "+f+" L "+v+" "+(f+-y/2)+" L "+(v+g/2)+" "+f+" L "+v+" "+(f+y/2)+" L "+x+" "+f+" z",t.merge(n,{d:h});break;case"ActualRect":h="M "+x+" "+(f+-y/8)+" L "+(v+m)+" "+(f+-y/8)+" L "+(v+m)+" "+(f+y/8)+" L "+x+" "+(f+y/8)+" L "+x+" "+(f+-y/8)+" z",t.merge(n,{d:h});break;case"TargetRect":h="M "+(x+m)+" "+(f+-y/2)+" L "+(v+m/2)+" "+(f+-y/2)+" L "+(v+m/2)+" "+(f+y/2)+" L "+(x+m)+" "+(f+y/2)+" L "+(x+m)+" "+(f+-y/2)+" z",t.merge(n,{d:h});break;case"Rectangle":case"Hilo":case"HiloOpenClose":case"Candle":case"Waterfall":case"BoxAndWhisker":case"StepArea":case"StackingStepArea":case"Square":case"Flag":h="M "+x+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+y/2)+" L "+x+" "+(f+y/2)+" L "+x+" "+(f+-y/2)+" z",t.merge(n,{d:h});break;case"Pyramid":case"Triangle":h="M "+x+" "+(f+y/2)+" L "+v+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+y/2)+" L "+x+" "+(f+y/2)+" z",t.merge(n,{d:h});break;case"Funnel":case"InvertedTriangle":h="M "+(v+g/2)+" "+(f-y/2)+" L "+v+" "+(f+y/2)+" L "+(v-g/2)+" "+(f-y/2)+" L "+(v+g/2)+" "+(f-y/2)+" z",t.merge(n,{d:h});break;case"Pentagon":for(var w=0;w<=5;w++)c=g/2*Math.cos(Math.PI/180*(72*w)),d=y/2*Math.sin(Math.PI/180*(72*w)),h=0===w?"M "+(v+c)+" "+(f+d)+" ":h.concat("L "+(v+c)+" "+(f+d)+" ");h=h.concat("Z"),t.merge(n,{d:h});break;case"Image":p="Image",t.merge(n,{href:a,height:y,width:g,x:x,y:b})}return n=Ie(e,new i.Size(g,y),o,n).renderOption,{renderOption:n,functionName:p}}function se(e,t,r){var o=t.x<r.x?r.x:t.x>r.x+r.width?r.x+r.width:t.x,n=t.y<r.y?r.y:t.y>r.y+r.height?r.y+r.height:t.y;return new i.Rect(o>e.x?e.x:o,n>e.y?e.y:n,Math.abs(o-e.x),Math.abs(n-e.y))}function le(e,t,i){return e>i?i:e<t?t:e}function he(e){return document.getElementById(e)}function ce(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function de(e,t,i,r,o,n,a,s,l,h){var c=e.getBoundingClientRect();t.accumulationDataLabelModule.calculateLabelSize(i,e,n,r,o,a,s,l,h,c,!0)}function pe(e,t,i,r,o,n){var a=document.getElementById(t.element.id+"_Series_"+(void 0===r.index?r.category:r.index)+"_DataLabelCollections");a&&(0===i.index&&(t.dataLabelCollections=[]),t.dataLabelModule.calculateTemplateLabelSize(a,e,i,r,r.marker.dataLabel,o,r.clipRect,n,!0))}function ue(e,t,i,r,o,n,a,s,l,h,c,d,p,u,g){var y,m=ce(i);try{var v=window.Blazor?a?o:{point:o}:{chart:r,series:n,point:o},f=a?a+"_template":"template",b=m?m(v,r,f,a||e.id.replace(/[^a-zA-Z0-9]/g,"")):[];if(b.length)for(var x=(y=Array.prototype.slice.call(b)).length,w=0;w<x;w++)e.appendChild(y[w]);var S=void 0;"accumulationchart"===r.getModuleName()?(S=de.bind(this,e,r,h,c,l,c[t],d,p,u,g),r.isReact&&r.renderReactTemplates(S)):"chart"===r.getModuleName()&&(S=o&&n?pe.bind(this,e,r,o,n,s,g):S,r.isReact&&r.renderReactTemplates(S))}catch(t){return e}return e}function ge(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function ye(e,i,r){void 0===i&&(i=!1),r||document.body.appendChild(e);var o=e.getBoundingClientRect();return i?t.remove(e):r||m(e.id),o}function me(e,t){for(var i,r=0,o=e.length;r<o;r++)e[r].id.indexOf(t)>-1&&(i=e[r]);return i}function ve(e,t,i,r,o){e="Logarithmic"===i.valueType?v(e>0?e:Math.pow(i.logBase,i.visibleRange.min),i.logBase):e,t="Logarithmic"===r.valueType?v(t>0?t:Math.pow(r.logBase,r.visibleRange.min),r.logBase):t,e=I(e,i),t=I(t,r);var n=o?i.rect.height:i.rect.width,a=o?r.rect.width:r.rect.height;return new Vi(o?t*a:e*n,o?(1-e)*n:(1-t)*a)}function fe(e,t,i,r,o,n){if(void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===o&&(o="x"),void 0===n&&(n="y"),!(e&&e.hasChildNodes()&&t))return null;be(!1,t,e,i,r,o,n)}function be(e,t,r,o,n,a,s,l,h,c,d,p,u){if(void 0===n&&(n=!1),void 0===a&&(a="x"),void 0===s&&(s="y"),void 0===c&&(c=!1),void 0===d&&(d=!1),void 0===p&&(p=null),e)return null;var g=t.querySelector("#"+r.id),y=g||he(r.id),m=r,v=u||300;o&&n&&y?(l=l||("DIV"===y.tagName?new Vi(+y.style[a].split("px")[0],+y.style[s].split("px")[0]):new Vi(+y.getAttribute(a),+y.getAttribute(s))),h&&"undefined"!==h?J(r,r.getAttribute("d"),o,h,v):d&&p?$(m,0,v,new i.Rect(+y.getAttribute("x"),+y.getAttribute("y"),+y.getAttribute("width"),+y.getAttribute("height")),p):Ne(m,v,l,"DIV"===m.tagName?new Vi(+m.style[a].split("px")[0],+m.style[s].split("px")[0]):new Vi(+m.getAttribute(a),+m.getAttribute(s)),a,s)):o&&n&&!y&&c&&oe(m,0,600,"FadeIn"),g?t.replaceChild(m,y):t.appendChild(m)}function xe(e,t,r,o,n){var a=Math.abs(e-r),s=Math.abs(t-o),l=Math.max(we(Math.min(e,r),a,n.x,n.width),n.x),h=Math.max(we(Math.min(t,o),s,n.y,n.height),n.y);return new i.Rect(l,h,Math.min(a,n.width),Math.min(s,n.height))}function we(e,t,i,r){return e<i?e=i:e+t>r+i&&(e=r+i-t),e}function Se(e,t,i){var r=t.yAxis.labelFormat,o=[],n=null!==r.match("{value}");switch(t.seriesType){case"XY":"PolarRadar"===t.chart.chartAreaType?-1!==t.drawType.indexOf("Stacking")?("Logarithmic"===t.yAxis.valueType&&w(t.stackedValues.endValues[e.index],t.yAxis)||x(t.stackedValues.endValues[e.index],t.yAxis.visibleRange))&&o.push(e.text||e.yValue.toString()):("Logarithmic"===t.yAxis.valueType&&w(e.yValue,t.yAxis)||x(e.yValue,t.yAxis.visibleRange))&&o.push(e.text||e.yValue.toString()):o.push(e.text||e.yValue.toString());break;case"HighLow":o.push(e.text||Math.max(e.high,e.low).toString()),o.push(e.text||Math.min(e.high,e.low).toString());break;case"HighLowOpenClose":o.push(e.text||Math.max(e.high,e.low).toString()),o.push(e.text||Math.min(e.high,e.low).toString()),o.push(e.text||Math.max(e.open,e.close).toString()),o.push(e.text||Math.min(e.open,e.close).toString());break;case"BoxPlot":o.push(e.text||e.median.toString()),o.push(e.text||e.maximum.toString()),o.push(e.text||e.minimum.toString()),o.push(e.text||e.upperQuartile.toString()),o.push(e.text||e.lowerQuartile.toString());for(var a=0,s=e.outliers;a<s.length;a++){var l=s[a];o.push(e.text||l.toString())}}if(r&&!e.text){t.yAxis.format=i.intl.getNumberFormat({format:n?"":r,useGrouping:i.useGroupingSeparator});for(var h=0;h<o.length;h++)o[h]=n?r.replace("{value}",t.yAxis.format(parseFloat(o[h]))):t.yAxis.format(parseFloat(o[h]))}return o}function Ce(e){window.clearInterval(e)}function Pe(e,t,r){var o=new i.Rect(e.x+r.x,e.y+r.y,e.width,e.height);return t.some(function(e){return o.x<e.x+e.width&&o.x+o.width>e.x&&o.y<e.y+e.height&&o.height+o.y>e.y})}function Le(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.height+e.y>t.y}function Re(e,t){return e.x<=t.x&&e.x+e.width>=t.x+t.width&&e.y<=t.y&&e.height+e.y>=t.y+t.height}function Me(e,t,r){return new i.Rect(e.x-t.width/2-r.left,e.y-t.height/2-r.top,t.width+r.left+r.right,t.height+r.top+r.bottom)}function Ae(e){return"#"+ke(e.r)+ke(e.g)+ke(e.b)}function ke(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Te(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Xi(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Xi(255,255,255)}function _e(e){e="transparent"===e?"white":e,document.body.appendChild(t.createElement("text",{id:"chartmeasuretext"}));var i=document.getElementById("chartmeasuretext");i.style.color=e,e=window.getComputedStyle(i).color,t.remove(i);var r=/^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.exec(e);return Ae(new Xi(parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10)))}function Oe(e,t){(e=(e=_e(e)).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var i,r="#",o=0;o<3;o++)i=parseInt(e.substr(2*o,2),16),r+=("00"+(i=Math.round(Math.min(Math.max(0,i+i*t),255))).toString(16)).substr(i.toString(16).length);return r}function Ee(e){var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function Ie(e,i,r,o){var n="",a=i.height,s=i.width,l=e.x,h=e.y;switch(r){case"MultiColoredLine":case"Line":case"StackingLine":case"StackingLine100":n="M "+(l+-s/2)+" "+h+" L "+(l+s/2)+" "+h,t.merge(o,{d:n});break;case"StepLine":o.fill="transparent",n="M "+(l+-s/2-2.5)+" "+(h+a/2)+" L "+(l+-s/2+s/10)+" "+(h+a/2)+" L "+(l+-s/2+s/10)+" "+h+" L "+(l+-s/10)+" "+h+" L "+(l+-s/10)+" "+(h+a/2)+" L "+(l+s/5)+" "+(h+a/2)+" L "+(l+s/5)+" "+(h+-a/2)+" L "+(l+s/2)+" "+(h+-a/2)+"L "+(l+s/2)+" "+(h+a/2)+" L"+(l+s/2+2.5)+" "+(h+a/2),t.merge(o,{d:n});break;case"UpArrow":o.fill=o.stroke,o.stroke="transparent",n="M "+(l+-s/2)+" "+(h+a/2)+" L "+l+" "+(h-a/2)+" L "+(l+s/2)+" "+(h+a/2)+"L "+(l+s/2-2)+" "+(h+a/2)+" L "+l+" "+(h-a/2+4)+"L"+(l-s/2+2)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"DownArrow":n="M "+(l-s/2)+" "+(h-a/2)+" L "+l+" "+(h+a/2)+" L "+(l+s/2)+" "+(h-a/2)+"L "+(l+s/2-2)+" "+(h-a/2)+" L "+l+" "+(h+a/2-4)+"L"+(l-s/2+2)+" "+(h-a/2)+" Z",t.merge(o,{d:n});break;case"RightArrow":n="M "+(l+-s/2)+" "+(h-a/2)+" L "+(l+s/2)+" "+h+" L "+(l+-s/2)+" "+(h+a/2)+" L "+(l+-s/2)+" "+(h+a/2-2)+" L "+(l+s/2-4)+" "+h+" L"+(l+-s/2)+" "+(h-a/2+2)+" Z",t.merge(o,{d:n});break;case"LeftArrow":o.fill=o.stroke,o.stroke="transparent",n="M "+(l+s/2)+" "+(h-a/2)+" L "+(l+-s/2)+" "+h+" L "+(l+s/2)+" "+(h+a/2)+" L "+(l+s/2)+" "+(h+a/2-2)+" L "+(l+-s/2+4)+" "+h+" L"+(l+s/2)+" "+(h-a/2+2)+" Z",t.merge(o,{d:n});break;case"Column":case"Pareto":case"StackingColumn":case"StackingColumn100":case"RangeColumn":case"Histogram":n="M "+(l-s/5*3)+" "+(h-a/5)+" L "+(l+-s/10*3)+" "+(h-a/5)+" L "+(l+-s/10*3)+" "+(h+a/2)+" L "+(l-s/5*3)+" "+(h+a/2)+" Z M "+(l+-s/10-s/20)+" "+(h-a/4-5)+" L "+(l+s/10+s/20)+" "+(h-a/4-5)+" L "+(l+s/10+s/20)+" "+(h+a/2)+" L "+(l+-s/10-s/20)+" "+(h+a/2)+" Z M "+(l+s/10*3)+" "+h+" L "+(l+s/5*3)+" "+h+" L "+(l+s/5*3)+" "+(h+a/2)+" L "+(l+s/10*3)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"Bar":case"StackingBar":case"StackingBar100":n="M "+(l+-s/2+-2.5)+" "+(h-a/5*3)+" L "+(l+s/10*3)+" "+(h-a/5*3)+" L "+(l+s/10*3)+" "+(h-a/10*3)+" L "+(l-s/2-2.5)+" "+(h-a/10*3)+" Z M "+(l+-s/2+-2.5)+" "+(h-a/5+.5)+" L "+(l+s/2+2.5)+" "+(h-a/5+.5)+" L "+(l+s/2+2.5)+" "+(h+a/10+.5)+" L "+(l-s/2-2.5)+" "+(h+a/10+.5)+" Z M "+(l-s/2-2.5)+" "+(h+a/5+1)+" L "+(l+-s/4)+" "+(h+a/5+1)+" L "+(l+-s/4)+" "+(h+a/2+1)+" L "+(l-s/2-2.5)+" "+(h+a/2+1)+" Z",t.merge(o,{d:n});break;case"Spline":o.fill="transparent",n="M "+(l-s/2)+" "+(h+a/5)+" Q "+l+" "+(h-a)+" "+l+" "+(h+a/5)+" M "+l+" "+(h+a/5)+" Q "+(l+s/2)+" "+(h+a/2)+" "+(l+s/2)+" "+(h-a/2),t.merge(o,{d:n});break;case"Area":case"MultiColoredArea":case"RangeArea":case"StackingArea":case"StackingArea100":n="M "+(l-s/2-2.5)+" "+(h+a/2)+" L "+(l+-s/4+-1.25)+" "+(h-a/2)+" L "+l+" "+(h+a/4)+" L "+(l+s/4+1.25)+" "+(h+-a/2+a/4)+" L "+(l+a/2+2.5)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"SplineArea":case"SplineRangeArea":n="M "+(l-s/2)+" "+(h+a/5)+" Q "+l+" "+(h-a)+" "+l+" "+(h+a/5)+" Z M "+l+" "+(h+a/5)+" Q "+(l+s/2)+" "+(h+a/2)+" "+(l+s/2)+" "+(h-a/2)+" Z",t.merge(o,{d:n});break;case"Pie":case"Doughnut":o.stroke="transparent",n=_(l,h,Math.min(a,s)/2,a,s,r),t.merge(o,{d:n})}return{renderOption:o}}function ze(e,t,r){var o=t,n=i.measureText(t,r).width;if(n>e)for(var a=t.length-1;a>=0;--a)if(o=t.substring(0,a)+"...",(n=i.measureText(o,r).width)<=e)return o;return o}function De(e,t,r){for(var o=[],n=t.split("<br>"),a=0;a<n.length;a++){t=n[a];var s=i.measureText(t,r).width;if(s>e){for(var l=t.length-1;l>=0;--l)if(t=t.substring(0,l)+"...",(s=i.measureText(t,r).width)<=e){o.push(t);break}}else o.push(t)}return o}function Be(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function Fe(e,t,i,r){if(!e)return null;var o=he(t);return o&&i&&r.setElementAttributes(i,"clipPath"===o.tagName?o.childNodes[0]:o),o}function Ne(e,i,r,o,n,a){void 0===n&&(n="x"),void 0===a&&(a="y");var s="DIV"===e.tagName,l=function(t,i){s?(e.style[n]=t+"px",e.style[a]=i+"px"):(e.setAttribute(n,t+""),e.setAttribute(a,i+""))};l(r.x,r.y),new t.Animation({}).animate(t.createElement("div"),{duration:i,progress:function(e){l(q(e.timeStamp,r.x,o.x-r.x,e.duration),q(e.timeStamp,r.y,o.y-r.y,e.duration))},end:function(){l(o.x,o.y)}})}function Ve(e,t,r,o,n,a,s,l,h,c,d,p,u,g){void 0===a&&(a=!1),void 0===h&&(h=!1);var y,m,v,f,b={};b={id:t.id,x:t.x,y:t.y,fill:o||"black","font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":t.anchor,labelRotation:t.labelRotation,transform:t.transform,opacity:r.opacity,"dominant-baseline":t.baseLine};var x="string"==typeof t.text?t.text:a?t.text[t.text.length-1]:t.text[0],w=d?d.x:0,S=d?d.y:0,C=e.createText(b,x,w,S);if(C.style.fontFamily=r.fontFamily,C.style.fontStyle=r.fontStyle,C.style.fontSize=r.size,C.style.fontWeight=r.fontWeight,C.style.color=r.color,C.style.textAnchor=t.anchor,"string"!=typeof t.text&&t.text.length>1)for(var P=1,L=t.text.length;P<L;P++)m=i.measureText(t.text[P],r).height,v=t.y+(a?-P*m:P*m),f=a?t.text[t.text.length-(P+1)]:t.text[P],g?y=e.createText(b,f,null,null,v,!0):(y=e.createTSpan({x:t.x,id:t.id,y:v},f),C.appendChild(y));return u||be(e instanceof i.CanvasRenderer,n,C,s,l,"x","y",null,null,h,!1,null,c),C}function je(e){var r=e.element.clientWidth||e.element.offsetWidth,o=e.element.clientHeight;e.stockChart&&(r=e.stockChart.availableSize.width,o=e.stockChart.availableSize.height);var n,a=450;if("rangeNavigator"===e.getModuleName()){var s=e,l=s.tooltip.enable?35:0,h=s.periodSelectorSettings.periods.length?s.periodSelectorSettings.height:0;n=s.margin.top+s.margin.bottom+l;var c=i.measureText("tempString",s.labelStyle).height;a=(e.series.length?t.Browser.isDevice?80:120:(s.enableGrouping?55+c:40)+n)+h,s.disableRangeSelector&&(a=h)}e.availableSize=new i.Size(Be(e.width,r)||r||600,Be(e.height,o||a)||o||a)}function He(e){e.canvasRender=new i.CanvasRenderer(e.element.id),e.renderer=e.enableCanvas?e.canvasRender:new i.SvgRenderer(e.element.id),je(e),e.stockChart&&"chart"===e.getModuleName()?e.svgObject=e.stockChart.chartObject:e.stockChart&&"rangeNavigator"===e.getModuleName()?e.svgObject=e.stockChart.selectorObject:e.enableCanvas?e.svgObject=e.renderer.createCanvas({id:e.element.id+"_canvas",width:e.availableSize.width,height:e.availableSize.height}):e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function Xe(e,t,i){var r=[];switch(t.textOverflow){case"Wrap":r=Ge(e,i,t);break;case"Trim":r.push(ze(i,e,t));break;default:r.push(e)}return r}function Ye(e,t){return"Near"===t.textAlignment?e.x:"Center"===t.textAlignment?e.x+e.width/2:e.x+e.width}function Ge(e,t,r){for(var o,n=e.split(" "),a="",s=[],l=0,h=n.length;l<h;l++)o=n[l],i.measureText(a.concat(o),r).width<t?a=a.concat((""===a?"":" ")+o):""!==a?(s.push(ze(t,a,r)),a=o):(s.push(ze(t,o,r)),o=""),a&&l===h-1&&s.push(ze(t,a,r));return s}function We(e,t){for(var i=e.replace(t," "),r=e.match(t),o=" ",n=" ",a=0,s={0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉"},l={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},h=0;h<=i.length-1;h++)if(" "===i[h]){o=t===si?r[a].replace(/~/g,""):r[a].replace(/\^/g,"");for(var c=0;c<o.length;c++)n+=t===si?s[o[c]]:l[o[c]];a++}else n+=i[h];return n.trim()}function Ue(e){for(var i=0;i<e.annotations.length;i++)t.resetBlazorTemplate((e.element.id+"_Annotation_"+i).replace(/[^a-zA-Z0-9]/g,""),"ContentTemplate");t.resetBlazorTemplate(e.element.id+"_tooltipparent_template_blazorTemplate","Template"),t.resetBlazorTemplate(e.element.id+"_DataLabel")}function Ze(e,t){return Number(t)===e.start?e.colors[0]:Number(t)===e.end?e.colors[e.colors.length-1]:Ae(qe(Number(t),e))}function qe(e,t){var i=t.start,r=t.end,o=0,n=r-i;o=(e-i)/n;var a,s;if(t.colors.length<=2)a="#"===t.colors[0].charAt(0)?t.colors[0]:_e(t.colors[0]),s="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:_e(t.colors[t.colors.length-1]);else{a="#"===t.colors[0].charAt(0)?t.colors[0]:_e(t.colors[0]),s="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:_e(t.colors[t.colors.length-1]);for(var l=n/(t.colors.length-1),h=t.colors.length-1,c=[],d={},p=1;p<h;p++)d={b:i+p*l,color:t.colors[p]},c.push(d);for(var u=0;u<c.length;u++)i<=e&&e<=c[u].b&&0===u?(s="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),o=e<=c[u].b?1-Math.abs((e-c[u].b)/l):(e-c[u].b)/l):c[u].b<=e&&e<=r&&u===c.length-1&&(a="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),o=e<c[u].b?1-Math.abs((e-c[u].b)/l):(e-c[u].b)/l),u!==c.length-1&&u<c.length&&c[u].b<=e&&e<=c[u+1].b&&(a="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),s="#"===c[u+1].color.charAt(0)?c[u+1].color:_e(c[u+1].color),o=Math.abs(e-c[u+1].b)/l)}return Qe(o,a,s)}function Qe(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],n=$e(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),a=$e(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),s=$e(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Xi(n,a,s)}function $e(e,t,i){var r=i-t;return Math.round(t+r*e)}function Je(e,t){for(var i,r=e.axis.rect,o="Horizontal"===e.axis.orientation,n=!1,a=0,s=0,l=e.axis.series;s<l.length;s++)(d=l[s]).marker.visible&&d.marker.height>a&&(a=d.marker.height);for(var h=0,c=e.axis.series;h<c.length;h++){var d=c[h];if(d.visible&&(i=d.yMin.toString(),n=d.yData.some(function(e){return e===i})),n)break}e.svgObject=t.createSvg({id:e.component.element.id+"_scrollBar_svg"+e.axis.name,width:e.isVertical?e.height:e.width,height:e.isVertical?e.width:e.height,style:"position: absolute;top: "+((e.axis.opposedPosition&&o?-16:n?a:0)+r.y)+"px;left: "+((e.axis.opposedPosition&&!o?16:0)+r.x-(e.isVertical?e.height:0))+"px;cursor:auto;"}),e.elements.push(e.svgObject)}function Ke(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(e===o.index)return o}return t[0]}function et(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(o.index===e)return o}return null}function tt(e,t,i){var r=(e-t.min)/t.delta;return i?1-r:r}function it(e,t,i,r){return(e=tt(e,t,r))*i}function rt(e,t,i,r){return(r?1-e/t:e/t)*i.delta+i.min}function ot(e,t,i){var r=[];return e.map(function(e){e.xValue>=t&&e.xValue<=i&&r.push({x:e.x,y:e.y})}),r}function nt(e,t){return e.reduce(function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e})}function at(e,i){var r=i.navigatorStyleSettings.thumb,o=t.isNullOrUndefined(r.width)?t.Browser.isDevice?15:20:r.width,n=t.isNullOrUndefined(r.height)?t.Browser.isDevice?15:20:r.height,a="HighContrast"===e?"#969696":"#6F6C6C",s="HighContrast"===e?"#4A4848":"#414040",l="MaterialDark"===e?"#303030":"FabricDark"===e?"#201F1F":"1A1A1A",h={gridLineColor:"#E0E0E0",axisLineColor:"#000000",labelFontColor:"#686868",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#EEEEEE",thumpLineColor:"rgba(189, 189, 189, 1)",thumbBackground:"rgba(250, 250, 250, 1)",gripColor:"#757575",background:"#FFFFFF",thumbHoverColor:"#EEEEEE",selectedRegionColor:i.series.length?"transparent":"#FF4081",tooltipBackground:"rgb(0, 8, 22)",tooltipFontColor:"#dbdbdb",thumbWidth:o,thumbHeight:n};switch(e){case"Fabric":h.selectedRegionColor=i.series.length?"transparent":"#007897";break;case"Bootstrap":h.selectedRegionColor=i.series.length?"transparent":"#428BCA";break;case"HighContrastLight":h={gridLineColor:"#bdbdbd",axisLineColor:"#969696",labelFontColor:"#ffffff",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.3)":"#EEEEEE",thumpLineColor:"#ffffff",thumbBackground:"#262626",gripColor:"#ffffff",background:l,thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"transparent":"#FFD939",tooltipBackground:"#ffffff",tooltipFontColor:"#000000",thumbWidth:o,thumbHeight:n};break;case"Highcontrast":case"HighContrast":h={gridLineColor:s,axisLineColor:a,labelFontColor:"#DADADA",unselectedRectColor:i.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:"#000000",thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"rgba(22, 22, 22, 0.6)":"#FFD939",tooltipBackground:"#F4F4F4",tooltipFontColor:"#282727",thumbWidth:o,thumbHeight:n};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":h={labelFontColor:"#DADADA",axisLineColor:" #6F6C6C",gridLineColor:"#414040",tooltipBackground:"#F4F4F4",tooltipFontColor:"#333232",unselectedRectColor:i.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:l,thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"rgba(22, 22, 22, 0.6)":"FabricDark"===e?"#007897":"BootstrapDark"===e?"#428BCA":"#FF4081",thumbWidth:o,thumbHeight:n};break;case"Bootstrap4":h={gridLineColor:"#E0E0E0",axisLineColor:"#CED4DA",labelFontColor:"#212529",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#514F4F",thumpLineColor:"rgba(189, 189, 189, 1)",thumbBackground:"#FFFFFF",gripColor:"#495057",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#EEEEEE",selectedRegionColor:i.series.length?"transparent":"#FFD939",tooltipBackground:"rgba(0, 0, 0, 0.9)",tooltipFontColor:"rgba(255, 255, 255)",thumbWidth:o,thumbHeight:n};break;case"Tailwind":h={gridLineColor:"#E5E7EB",axisLineColor:"#D1D5DB",labelFontColor:"#6B7280",unselectedRectColor:i.series.length?"transparent":"#E5E7EB",thumpLineColor:"#9CA3AF",thumbBackground:"#FFFFFF",gripColor:"#6B7280",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#374151",selectedRegionColor:i.series.length?"rgba(79, 70, 229, 0.3)":"#4F46E5",tooltipBackground:"#111827",tooltipFontColor:"#F9FAFB",thumbWidth:o,thumbHeight:n};break;case"TailwindDark":h={gridLineColor:"#374151",axisLineColor:"#4B5563",labelFontColor:"#9CA3AF",unselectedRectColor:i.series.length?"transparent":"#4B5563",thumpLineColor:"#6B7280",thumbBackground:"#1F2937",gripColor:"#D1D5DB",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#E5E7EB",selectedRegionColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#22D3EE",tooltipBackground:"#F9FAFB",tooltipFontColor:"#1F2937",thumbWidth:o,thumbHeight:n};break;default:h.selectedRegionColor=i.series.length?"transparent":"#FF4081"}return h}function st(e,t,i){for(var r=[],o=0;o<e;++o){for(var n=[],a=0;a<t;++a)n[a]=i;r[o]=n}return r}function lt(e){var t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"rgba(0, 8, 22, 0.75)",legendLabel:"#353535",tooltipBoldLabel:"#ffffff",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"rgba(0,0,0,0.87)",dataLabelFontColor:"#ffffff",titleFontFamily:"SegoeUI",subTitleFontColor:" rgba(0,0,0,0.54)",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};switch(e){case"Fabric":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#666666",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"rgba(0, 8, 22, 0.75)",legendLabel:"#353535",tooltipBoldLabel:"#ffffff",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#333333",dataLabelFontColor:"#ffffff",titleFontFamily:"SegoeUI",subTitleFontColor:"#666666",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"Bootstrap":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"rgba(0,0,0,0.54)",labelFontFamily:"Helvetica",tooltipFill:"rgba(0, 0, 0, 0.9)",legendLabel:"#212529",tooltipBoldLabel:"rgba(255,255,255)",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"rgba(0,0,0,0.87)",dataLabelFontColor:"#ffffff",titleFontFamily:"Helvetica-Bold",subTitleFontColor:" rgba(0,0,0,0.54)",subTitleFontFamily:"Helvetica",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"HighContrast":t={majorTickLineColor:"#FFFFFF",minorTickLineColor:"#FFFFFF",background:"#000000",labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"SegoeUI",tooltipFill:"#ffffff",legendLabel:"#ffffff",tooltipBoldLabel:"#000000",featuredMeasureColor:"#000000",comparativeMeasureColor:"#000000",titleFontColor:"#FFFFFF",dataLabelFontColor:"#ffffff",titleFontFamily:"HelveticaNeue",subTitleFontColor:"#FFFFFF",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#757575"},{color:"#BDBDBD"},{color:"#EEEEEE"}]};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={majorTickLineColor:"#F0F0F0",minorTickLineColor:"#F0F0F0",background:"#000000",labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"Helvetica",tooltipFill:"#F4F4F4",legendLabel:"#DADADA",tooltipBoldLabel:"#282727",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#FFFFFF",dataLabelFontColor:"#ffffff",titleFontFamily:"Helvetica-Bold",subTitleFontColor:"#FFFFFF",subTitleFontFamily:"Helvetica",firstRangeColor:"#8D8D8D",secondRangeColor:"#ADADAD",thirdRangeColor:"#EEEEEE",rangeStrokes:[{color:"#8D8D8D"},{color:"#ADADAD"},{color:"#EEEEEE"}]};break;case"Bootstrap4":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#202528",categoryFontColor:"#202528",labelFontFamily:"HelveticaNeue",tooltipFill:"rgba(0, 0, 0, 0.9)",legendLabel:"#212529",tooltipBoldLabel:"rgba(255,255,255)",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#202528",dataLabelFontColor:"#ffffff",titleFontFamily:"HelveticaNeue-Bold",subTitleFontColor:"HelveticaNeue",subTitleFontFamily:"#202528",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"Tailwind":t={majorTickLineColor:"#D1D5DB",minorTickLineColor:"#D1D5DB",background:"transparent",labelFontColor:"#6B7280",categoryFontColor:"#6B7280",labelFontFamily:"Inter",tooltipFill:"#111827",legendLabel:"#374151",tooltipBoldLabel:"#F9FAFB",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#374151",dataLabelFontColor:"#F9FAFB",titleFontFamily:"Inter",subTitleFontColor:"#374151",subTitleFontFamily:"Inter",firstRangeColor:"#9CA3AF",secondRangeColor:"#D1D5DB",thirdRangeColor:"#E5E7EB",rangeStrokes:[{color:"#9CA3AF"},{color:"#D1D5DB"},{color:"#E5E7EB"}]};break;case"TailwindDark":t={majorTickLineColor:"#4B5563",minorTickLineColor:"#4B5563",background:"transparent",labelFontColor:"#9CA3AF",categoryFontColor:"#9CA3AF",labelFontFamily:"Inter",tooltipFill:"#F9FAFB",legendLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#D1D5DB",dataLabelFontColor:"#D1D5DB",titleFontFamily:"Inter",subTitleFontColor:"#D1D5DB",subTitleFontFamily:"Inter",firstRangeColor:"#6B7280",secondRangeColor:"#4B5563",thirdRangeColor:"#374151",rangeStrokes:[{color:"#6B7280"},{color:"#4B5563"},{color:"#374151"}]};break;default:t=t}return t}function ht(e){e.renderer=new i.SvgRenderer(e.element.id),yt(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function ct(e){return document.getElementById(e)}function dt(e,t,i){var r=t,o=ft(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if(r=t.substring(0,n)+"...",(o=ft(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function pt(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function ut(e,i,r){for(var o=e[0].outerHTML,n=Object.keys(r),a=0;a<n.length;a++)o=o.replace(new RegExp("{{:"+n[a]+"}}","g"),r[n[a].toString()]);return t.createElement("div",{id:i,innerHTML:o,styles:"position: absolute"})}function gt(){for(var e=1;1+.5*e!=1;)e*=.5;return e}function yt(e){var t=e.element.clientWidth,i=e.element.clientHeight;e.availableSize=new $s(vt(e.width,t)||t||600,vt(e.height,i)||i||450)}function mt(e,i,r,o,n){var a,s;new t.Animation({}).animate(i,{duration:o,delay:r,name:n,progress:function(e){a=(e.timeStamp-e.delay)/e.duration,s=0+1*a,e.element.style.opacity=s.toString()},end:function(t){t.element.style.opacity=1..toString(),e.trigger("animationComplete",event)}})}function vt(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function ft(e,i){var r=document.getElementById("smithchartmeasuretext");return null===r&&(r=t.createElement("text",{id:"smithchartmeasuretext"}),document.body.appendChild(r)),r.innerHTML=e,r.style.position="absolute",r.style.visibility="hidden",r.style.left="0",r.style.top="-100",r.style.whiteSpace="nowrap",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.lineHeight="normal",new $s(r.clientWidth,r.clientHeight)}function bt(e){var i=document.getElementById(e);return i?t.remove(i):null}function xt(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t}function wt(e,t,i,r){return-t*Math.sin(e/r*(Math.PI/2))+i+t}function St(e){var t;switch(e){case"Linear":t=xt;break;case"Reverse":t=wt}return t}function Ct(e,t,r,o){var n={id:e.id,x:e.x,y:e.y,fill:r,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,opacity:t.opacity},a=e.text,s=new i.SvgRenderer("").createText(n,a);return o.appendChild(s),s}function Pt(e){var t;switch(e.toLowerCase()){case"highcontrastlight":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"fabric":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"bootstrap":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"tailwind":t=["#5A61F6","#65A30D","#334155","#14B8A6","#8B5CF6","#0369A1","#F97316","#9333EA","#F59E0B","#15803D"];break;case"tailwinddark":t=["#8B5CF6","#22D3EE","#F87171","#4ADE80","#E879F9","#FCD34D","#F97316","#2DD4BF","#F472B6","#10B981"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function Lt(e){var t;switch(e.toLowerCase()){case"highcontrast":t={axisLabel:"#ffffff",axisLine:"#ffffff",majorGridLine:"#BFBFBF",minorGridLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:"#000000",areaBorder:"#ffffff",tooltipFill:"#ffffff",dataLabel:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;case"materialdark":case"bootstrapdark":case"fabricdark":t={axisLabel:"#DADADA",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",chartTitle:"#ffffff",legendLabel:"#DADADA",background:"#000000",areaBorder:" #9A9A9A",tooltipFill:"#F4F4F4",dataLabel:"#DADADA",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A"};break;case"bootstrap4":t={axisLabel:"#212529",axisLine:"#ADB5BD",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",chartTitle:"#212529",legendLabel:"#212529",background:"#FFFFFF",areaBorder:"#DEE2E6",tooltipFill:"#000000",dataLabel:"#212529",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9};break;case"tailwind":t={axisLabel:"#6B7280",axisLine:"#D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:"#FFFFFF",areaBorder:"#D1D5DB6",tooltipFill:"#111827",dataLabel:"#F9FAFB",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#9CA3AF",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1};break;case"tailwinddark":t={axisLabel:"#9CA3AF",axisLine:"#4B5563",majorGridLine:"#374151",minorGridLine:"#4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"transprent",areaBorder:"#4B5563",tooltipFill:"#F9FAFB",dataLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1};break;default:t={axisLabel:"#686868",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",chartTitle:"#424242",legendLabel:"#353535",background:"#FFFFFF",areaBorder:"Gray",tooltipFill:"rgba(0, 8, 22, 0.75)",dataLabel:"#424242",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return t}function Rt(e){var t;switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":case"highcontrast":t={axisLineColor:"#ffffff",dataLabelColor:"#ffffff",rangeBandColor:"#ffffff",tooltipFill:"#ffffff",background:"#000000",tooltipFontColor:"#363F4C",trackerLineColor:"#ffffff"};break;case"bootstrap4":t={axisLineColor:"#6C757D",dataLabelColor:"#212529",rangeBandColor:"#212529",tooltipFill:"#000000",background:"#FFFFFF",tooltipFontColor:"#FFFFFF",trackerLineColor:"#212529",fontFamily:"HelveticaNeue-Medium",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"HelveticaNeue"};break;case"tailwind":t={axisLineColor:"#4B5563",dataLabelColor:"#212529",rangeBandColor:"#212529",background:"#FFFFFF",tooltipFill:"#111827",tooltipFontColor:"#F9FAFB",trackerLineColor:"#1F2937",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter"};break;case"tailwinddark":t={axisLineColor:"#D1D5DB",dataLabelColor:"#F9FAFB",rangeBandColor:"#F9FAFB",background:"transparent",tooltipFill:"#F9FAFB",tooltipFontColor:"#1F2937",trackerLineColor:"#9CA3AF",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter"};break;default:t={axisLineColor:"#000000",dataLabelColor:"#424242",rangeBandColor:"#000000",background:"#FFFFFF",tooltipFill:"#363F4C",tooltipFontColor:"#ffffff",trackerLineColor:"#000000"}}return t}function Mt(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function At(e){var t=e.element.clientWidth?e.element.clientWidth:e.element.parentElement?e.element.parentElement.clientWidth?e.element.parentElement.clientWidth:window.innerWidth:100,i=e.element.clientHeight?e.element.clientHeight:e.element.parentElement?e.element.parentElement.clientHeight:50;e.availableSize=new oh(Mt(e.width,t)||t,Mt(e.height,i)||i||(e.isDevice?Math.min(window.innerWidth,window.innerHeight):i))}function kt(e){e.renderer=new i.SvgRenderer(e.element.id),At(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function Tt(e,t){return t&&t.appendChild(e),e}function _t(e,t,i){return Tt(e.renderer.drawCircle(t),i)}function Ot(e,t,i,r,o){return"M "+e.x+" "+(t+e.y)+" Q "+e.x+" "+e.y+" "+(e.x+t)+" "+e.y+" L "+(e.x+e.width-i)+" "+e.y+" Q "+(e.x+e.width)+" "+e.y+" "+(e.x+e.width)+" "+(e.y+i)+" L "+(e.x+e.width)+" "+(e.y+e.height-o)+" Q "+(e.x+e.width)+" "+(e.y+e.height)+" "+(e.x+e.width-o)+" "+(e.y+e.height)+" L "+(e.x+r)+" "+(e.y+e.height)+" Q "+e.x+" "+(e.y+e.height)+" "+e.x+" "+(e.y+e.height-r)+" L "+e.x+" "+(t+e.y)+" Z"}function Et(e,t,i){return t.d=Ot(t.rect,t.topLeft,t.topRight,t.bottomLeft,t.bottomRight),Tt(e.renderer.drawPath(t),i)}function It(e,t,i){return Tt(e.renderer.drawPath(t),i)}function zt(e,i){var r=document.getElementById("sparklinesmeasuretext");return null===r&&(r=t.createElement("text",{id:"sparklinesmeasuretext"}),document.body.appendChild(r)),r.innerHTML=e,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new oh(r.clientWidth,r.clientHeight)}function Dt(e,t,r,o){var n={id:e.id,x:e.x,y:e.y,transform:e.transform,opacity:t.opacity,fill:r,"font-family":t.fontFamily,"font-weight":t.fontWeight,"font-size":t.size,"font-style":t.fontStyle,"text-anchor":e.anchor,"dominant-baseline":e.baseLine},a=new i.SvgRenderer("").createText(n,e.text);return a.style["user-select"]="none",a.style["-moz-user-select"]="none",a.style["-webkit-touch-callout"]="none",a.style["-webkit-user-select"]="none",a.style["-khtml-user-select"]="none",a.style["-ms-user-select"]="none",a.style["-o-user-select"]="none",o.appendChild(a),a}function Bt(e){var i=document.getElementById(e);return i?t.remove(i):null}function Ft(e){return document.getElementById(e)}function Nt(e,t,i){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisTitleFont={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartSubTitleFont={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.crosshairLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.tooltipLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendTitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.stripLineLabelFont={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},e.stockEventFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"}}(e.Theme||(e.Theme={}));var Vt=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jt=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Line")],i.prototype,"type",void 0),jt([t.Property(null)],i.prototype,"color",void 0),jt([t.Property(1)],i.prototype,"width",void 0),jt([t.Property(null)],i.prototype,"length",void 0),jt([t.Property("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),Xt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Normal")],i.prototype,"fontStyle",void 0),jt([t.Property("16px")],i.prototype,"size",void 0),jt([t.Property("Normal")],i.prototype,"fontWeight",void 0),jt([t.Property("")],i.prototype,"color",void 0),jt([t.Property("Center")],i.prototype,"textAlignment",void 0),jt([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),jt([t.Property(1)],i.prototype,"opacity",void 0),jt([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("")],i.prototype,"color",void 0),jt([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Gt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"x",void 0),jt([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),Wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Complex({},Yt)],i.prototype,"border",void 0),jt([t.Property("transparent")],i.prototype,"background",void 0),jt([t.Property(1)],i.prototype,"opacity",void 0),jt([t.Property(null)],i.prototype,"backgroundImage",void 0),i}(t.ChildProperty),Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(10)],i.prototype,"left",void 0),jt([t.Property(10)],i.prototype,"right",void 0),jt([t.Property(10)],i.prototype,"top",void 0),jt([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"left",void 0),jt([t.Property(0)],i.prototype,"right",void 0),jt([t.Property(0)],i.prototype,"top",void 0),jt([t.Property(0)],i.prototype,"bottom",void 0),i}(t.ChildProperty),qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(!0)],i.prototype,"enable",void 0),jt([t.Property(1e3)],i.prototype,"duration",void 0),jt([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty),Qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"series",void 0),jt([t.Property(0)],i.prototype,"point",void 0),i}(t.ChildProperty),$t=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"topLeft",void 0),jt([t.Property(0)],i.prototype,"topRight",void 0),jt([t.Property(0)],i.prototype,"bottomLeft",void 0),jt([t.Property(0)],i.prototype,"bottomRight",void 0),i}(t.ChildProperty),Jt=function(){function e(e,t){this.series=e,this.point=t}return e}(),Kt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(null)],i.prototype,"fill",void 0),jt([t.Complex({color:"transparent",width:0},Yt)],i.prototype,"border",void 0),jt([t.Property("Gap")],i.prototype,"mode",void 0),i}(t.ChildProperty),ei=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(!1)],i.prototype,"enable",void 0),jt([t.Property(null)],i.prototype,"minY",void 0),jt([t.Property(null)],i.prototype,"maxY",void 0),jt([t.Property(null)],i.prototype,"fill",void 0),i}(t.ChildProperty),ti=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Vt(r,i),jt([t.Property(!1)],r.prototype,"enable",void 0),jt([t.Property(!0)],r.prototype,"enableMarker",void 0),jt([t.Property(!1)],r.prototype,"shared",void 0),jt([t.Property(null)],r.prototype,"fill",void 0),jt([t.Property(null)],r.prototype,"header",void 0),jt([t.Property(.75)],r.prototype,"opacity",void 0),jt([t.Complex(e.Theme.tooltipLabelFont,Xt)],r.prototype,"textStyle",void 0),jt([t.Property(null)],r.prototype,"format",void 0),jt([t.Property(null)],r.prototype,"template",void 0),jt([t.Property(!0)],r.prototype,"enableAnimation",void 0),jt([t.Property(300)],r.prototype,"duration",void 0),jt([t.Property(1e3)],r.prototype,"fadeOutDuration",void 0),jt([t.Property(!1)],r.prototype,"enableTextWrap",void 0),jt([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),r}(t.ChildProperty),ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Years")],i.prototype,"intervalType",void 0),jt([t.Property(1)],i.prototype,"interval",void 0),jt([t.Property(null)],i.prototype,"text",void 0),jt([t.Property(!1)],i.prototype,"selected",void 0),i}(t.ChildProperty),ri=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(43)],i.prototype,"height",void 0),jt([t.Property("Bottom")],i.prototype,"position",void 0),jt([t.Collection([],ii)],i.prototype,"periods",void 0),i}(t.ChildProperty),oi=function(){function e(e,t){e<t?(this.mStart=e,this.mEnd=t):(this.mStart=t,this.mEnd=e)}return Object.defineProperty(e.prototype,"start",{get:function(){return this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.mEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delta",{get:function(){return this.mEnd-this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"median",{get:function(){return this.mStart+(this.mEnd-this.mStart)/2},enumerable:!0,configurable:!0}),e}(),ni=function(){function e(e){this.isColumn=0,this.chart=e}return e.prototype.calculateNumericNiceInterval=function(e,i,r){var o=re(r,e),n=i/o;if(!t.isNullOrUndefined(e.desiredIntervals))return n;for(var a=Math.pow(10,Math.floor(v(n,10))),s=0,l=e.intervalDivs;s<l.length;s++){var h=a*l[s];if(o<i/h)break;n=h}return n},e.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),!e.startFromZero&&this.isColumn>0?(e.actualRange.interval=e.interval||this.calculateNumericNiceInterval(e,e.doubleRange.delta,t),e.actualRange.max=e.doubleRange.end+e.actualRange.interval,e.doubleRange.start-e.actualRange.interval<0&&e.doubleRange.start>0?e.actualRange.min=0:e.actualRange.min=e.doubleRange.start-e.actualRange.interval):(e.actualRange.interval=e.interval||this.calculateNumericNiceInterval(e,e.doubleRange.delta,t),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end)},e.prototype.initializeDoubleRange=function(e){null!==e.minimum?this.min=e.minimum:null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=0),null!==e.maximum?this.max=e.maximum:null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=5),this.min===this.max&&(this.max=e.valueType.indexOf("Category")>-1?this.max:this.min+1),e.doubleRange=new oi(this.min,this.max),e.actualRange={}},e.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},e.prototype.calculateRange=function(e){if(this.min=null,this.max=null,!te(e))for(var t=0,i=e.series;t<i.length;t++){var r=i[t];r.visible&&(this.paddingInterval=0,e.maxPointLength=r.points.length,((r.type.indexOf("Column")>-1||r.type.indexOf("Histogram")>-1)&&"Horizontal"===e.orientation||r.type.indexOf("Bar")>-1&&"Vertical"===e.orientation)&&("Double"!==r.xAxis.valueType&&"DateTime"!==r.xAxis.valueType||"Auto"!==r.xAxis.rangePadding||(this.paddingInterval=.5*U(r.xAxis,e.series))),"Horizontal"===e.orientation&&(this.chart.requireInvertedAxis?this.yAxisRange(e,r):this.findMinMax(r.xMin-this.paddingInterval,r.xMax+this.paddingInterval)),"Vertical"===e.orientation&&(this.isColumn+="Column"===r.type||"Bar"===r.type||"Column"===r.drawType?1:0,this.chart.requireInvertedAxis?this.findMinMax(r.xMin-this.paddingInterval,r.xMax+this.paddingInterval):this.yAxisRange(e,r)))}},e.prototype.yAxisRange=function(e,t){t.dragSettings.enable&&this.chart.dragY&&(this.chart.dragY>=e.visibleRange.max&&(t.yMax=this.chart.dragY+e.visibleRange.interval),this.chart.dragY<=e.visibleRange.min&&(t.yMin=this.chart.dragY-e.visibleRange.interval)),this.findMinMax(t.yMin,t.yMax)},e.prototype.findMinMax=function(e,t){(null===this.min||this.min>e)&&(this.min=e),(null===this.max||this.max<t)&&(this.max=t),this.max===this.min&&this.max<0&&this.min<0&&(this.max=0)},e.prototype.applyRangePadding=function(e,t){var i=e.actualRange.min,r=e.actualRange.max;if(!te(e)){var o=e.actualRange.interval,n=e.getRangePadding(this.chart);"Additional"===n||"Round"===n?this.findAdditional(e,i,r,o):"Normal"===n?this.findNormal(e,i,r,o,t):this.updateActualRange(e,i,r,o)}e.actualRange.delta=e.actualRange.max-e.actualRange.min,this.calculateVisibleRange(t,e)},e.prototype.updateActualRange=function(e,t,i,r){e.actualRange={min:null!=e.minimum?e.minimum:t,max:null!=e.maximum?e.maximum:i,interval:null!=e.interval?e.interval:r,delta:e.actualRange.delta}},e.prototype.findAdditional=function(e,t,i,r){var o,n;o=Math.floor(t/r)*r,n=Math.ceil(i/r)*r,"Additional"===e.rangePadding&&(o-=r,n+=r),this.updateActualRange(e,o,n,r)},e.prototype.findNormal=function(e,t,i,r,o){var n,a,s=t;t<0?(s=0,.365*r>=r+(n=t+.05*t)%r&&(n-=r),n%r<0&&(n=n-r-n%r)):(n=t<5/6*i?0:t-.5*(i-t))%r>0&&(n-=n%r),.365*r>=r-(a=i>0?i+.05*(i-s):i-.05*(i-s))%r&&(a+=r),a%r>0&&(a=a+r-a%r),e.doubleRange=new oi(n,a),0===n&&(r=this.calculateNumericNiceInterval(e,e.doubleRange.delta,o),a=Math.ceil(a/r)*r),this.updateActualRange(e,n,a,r)},e.prototype.calculateVisibleRange=function(e,i){if(i.visibleRange={max:i.actualRange.max,min:i.actualRange.min,delta:i.actualRange.delta,interval:i.actualRange.interval},"Cartesian"===this.chart.chartAreaType){var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;(i.zoomFactor<1||i.zoomPosition>0)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.calculateAxisRange(e,this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming&&"Category"!==i.valueType?this.calculateNumericNiceInterval(i,i.doubleRange.delta,e):i.visibleRange.interval)}i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval)},e.prototype.calculateVisibleLabels=function(e,i){e.visibleLabels=[];var r,o=e.visibleRange.min;!("chart"===i.getModuleName()&&"PolarRadar"===i.chartAreaType)&&(e.zoomFactor<1||e.zoomPosition>0||this.paddingInterval)&&(o=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var n=this.getFormat(e),a=null!==n.match("{value}"),s=0,l=0;e.labelFormat&&e.labelFormat.indexOf("n")>-1&&(l=parseInt(e.labelFormat.substring(1,e.labelFormat.length),10)),e.format=i.intl.getNumberFormat({format:a?"":n,useGrouping:i.useGroupingSeparator}),e.startLabel=e.format(e.visibleRange.min),e.endLabel=e.format(e.visibleRange.max),e.visibleRange.interval&&(e.visibleRange.interval+"").indexOf(".")>=0&&(s=(e.visibleRange.interval+"").split(".")[1].length);for(var h;o<=e.visibleRange.max&&h!==o;o+=e.visibleRange.interval)h=o,r=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(o,e.visibleRange)&&ee(i,o,this.formatValue(e,a,n,o),r,e);o&&(o+"").indexOf(".")>=0&&(o+"").split(".")[1].length>10&&(o=(o+"").split(".")[1].length>(l||s)?+o.toFixed(l||s):o)<=e.visibleRange.max&&ee(i,o,this.formatValue(e,a,n,o),r,e),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},e.prototype.getFormat=function(e){return e.labelFormat?0===e.labelFormat.indexOf("p")&&-1===e.labelFormat.indexOf("{value}")&&e.isStack100?"{value}%":e.labelFormat:e.isStack100?"{value}%":""},e.prototype.formatValue=function(e,t,i,r){return t?i.replace("{value}",e.format(r)):e.format(r)},e}(),ai="axisLabelRender",si=/~\d+~/g,li=/\^\d+\^/g,hi="onZooming",ci=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),di=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property("0")],i.prototype,"x",void 0),di([t.Property("0")],i.prototype,"y",void 0),di([t.Property(null)],i.prototype,"content",void 0),di([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),di([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),di([t.Property("Chart")],i.prototype,"region",void 0),di([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),di([t.Property(null)],i.prototype,"xAxisName",void 0),di([t.Property(null)],i.prototype,"yAxisName",void 0),di([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),ui=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property("")],i.prototype,"color",void 0),di([t.Property(1)],i.prototype,"width",void 0),di([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),gi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(null)],i.prototype,"start",void 0),di([t.Property(null)],i.prototype,"end",void 0),di([t.Property("")],i.prototype,"text",void 0),di([t.Property(null)],i.prototype,"maximumTextWidth",void 0),di([t.Property(null)],i.prototype,"customAttributes",void 0),di([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),yi=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ci(r,i),di([t.Property(!0)],r.prototype,"visible",void 0),di([t.Property(!1)],r.prototype,"startFromAxis",void 0),di([t.Property(null)],r.prototype,"start",void 0),di([t.Property(null)],r.prototype,"end",void 0),di([t.Property(null)],r.prototype,"size",void 0),di([t.Property("#808080")],r.prototype,"color",void 0),di([t.Property(null)],r.prototype,"dashArray",void 0),di([t.Property("Auto")],r.prototype,"sizeType",void 0),di([t.Property(!1)],r.prototype,"isRepeat",void 0),di([t.Property(null)],r.prototype,"repeatEvery",void 0),di([t.Property(null)],r.prototype,"repeatUntil",void 0),di([t.Property(!1)],r.prototype,"isSegmented",void 0),di([t.Property(null)],r.prototype,"segmentStart",void 0),di([t.Property(null)],r.prototype,"segmentEnd",void 0),di([t.Property(null)],r.prototype,"segmentAxisName",void 0),di([t.Complex({color:"transparent",width:1},Yt)],r.prototype,"border",void 0),di([t.Property("")],r.prototype,"text",void 0),di([t.Property(null)],r.prototype,"rotation",void 0),di([t.Property("Middle")],r.prototype,"horizontalAlignment",void 0),di([t.Property("Middle")],r.prototype,"verticalAlignment",void 0),di([t.Complex(e.Theme.stripLineLabelFont,Xt)],r.prototype,"textStyle",void 0),di([t.Property("Behind")],r.prototype,"zIndex",void 0),di([t.Property(1)],r.prototype,"opacity",void 0),r}(t.ChildProperty),mi=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ci(r,i),di([t.Property("Center")],r.prototype,"alignment",void 0),di([t.Property("Wrap")],r.prototype,"overflow",void 0),di([t.Complex(e.Theme.axisLabelFont,Xt)],r.prototype,"textStyle",void 0),di([t.Complex({color:null,width:1,type:"Rectangle"},ui)],r.prototype,"border",void 0),di([t.Collection([],gi)],r.prototype,"categories",void 0),r}(t.ChildProperty),vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(null)],i.prototype,"minimum",void 0),di([t.Property(null)],i.prototype,"maximum",void 0),i}(t.ChildProperty),fi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(!1)],i.prototype,"enable",void 0),di([t.Property(null)],i.prototype,"pointsLength",void 0),di([t.Complex({},vi)],i.prototype,"range",void 0),i}(t.ChildProperty),bi=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xi=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},wi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.axes=[],t.nearSizes=[],t.farSizes=[],t}return bi(i,e),i.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.findTickSize(e.crossInAxis)+t+e.findLabelSize(e.crossInAxis,5)+.5*e.lineStyle.width),e.opposedPosition?this.farSizes.push(i):this.nearSizes.push(i)},xi([t.Property("100%")],i.prototype,"height",void 0),xi([t.Complex({},Yt)],i.prototype,"border",void 0),i}(t.ChildProperty),Si=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.axes=[],t.nearSizes=[],t.farSizes=[],t.padding=0,t}return bi(i,e),i.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.findTickSize(e.crossInAxis)+t+e.findLabelSize(e.crossInAxis,5)+.5*e.lineStyle.width),e.opposedPosition?this.farSizes.push(i):this.nearSizes.push(i)},xi([t.Property("100%")],i.prototype,"width",void 0),xi([t.Complex({},Yt)],i.prototype,"border",void 0),i}(t.ChildProperty),Ci=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(.7)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ri=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property(5)],i.prototype,"height",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(.7)],i.prototype,"width",void 0),xi([t.Property(5)],i.prototype,"height",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ai=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return bi(r,i),xi([t.Property(!1)],r.prototype,"enable",void 0),xi([t.Property(null)],r.prototype,"fill",void 0),xi([t.Complex(e.Theme.crosshairLabelFont,Xt)],r.prototype,"textStyle",void 0),r}(t.ChildProperty),ki=function(r){function o(e,t,o,n){var a=r.call(this,e,t,o,n)||this;return a.visibleLabels=[],a.series=[],a.rect=new i.Rect(void 0,void 0,0,0),a.axisBottomLine=null,a.intervalDivs=[10,5,2,1],a.isStack100=!1,a.crossAt=null,a.updatedRect=null,a.multiLevelLabelHeight=0,a.isChart=!0,a.isIntervalInDecimal=!0,a.titleCollection=[],a.titleSize=new i.Size(0,0),a.internalVisibility=!0,a.angle=a.labelRotation,a}return bi(o,r),o.prototype.findTickSize=function(e){return"Inside"===this.tickPosition?0:!e||e.visibleRange&&!this.isInside(e.visibleRange)?this.majorTickLines.height:0},o.prototype.isInside=function(e){return b(this.crossAt,e)||!this.opposedPosition&&this.crossAt>=e.max||this.opposedPosition&&this.crossAt<=e.min},o.prototype.findLabelSize=function(e,t){var r=0,o="Horizontal"===this.orientation;if(this.title&&(this.titleSize=i.measureText(this.title,this.titleStyle),r=this.titleSize.height+t,this.rect.width||this.rect.height)){var n=o?this.rect.width:this.rect.height;this.titleCollection=Xe(this.title,this.titleStyle,n),r*=this.titleCollection.length}if("Inside"===this.labelPosition)return r+t;var a,s,l=r+t+this.titlePadding+this.labelPadding+("Vertical"===this.orientation?this.maxLabelSize.width:this.maxLabelSize.height)+this.multiLevelLabelHeight;if(e&&this.placeNextToAxisLine){var h=e.visibleRange,c="Horizontal"===e.orientation?e.rect.width:e.rect.height;if(!h||!c)return 0;this.isInside(h)&&(l=(a=(s=this.findDifference(e))*((c-((a=s*(c/h.delta))<l?l-a:0))/h.delta))<l?l-a:0)}return l},o.prototype.updateCrossValue=function(){var e=this.crossAt;if(null===e||!this.isInside(this.crossInAxis.visibleRange))return this.updatedRect=this.rect,null;var i=this.crossInAxis.visibleRange;this.opposedPosition?this.crossAt<i.min&&(e=i.min):this.crossAt>i.max&&(e=i.max),this.updatedRect=t.extend({},this.rect,null,!0),"Horizontal"===this.orientation?(e=this.crossInAxis.rect.height-I(e,this.crossInAxis)*this.crossInAxis.rect.height,this.updatedRect.y=this.crossInAxis.rect.y+e):(e=I(e,this.crossInAxis)*this.crossInAxis.rect.width,this.updatedRect.x=this.crossInAxis.rect.x+e)},o.prototype.findDifference=function(e){var t=0;return t=this.opposedPosition?e.isInversed?e.visibleRange.min:e.visibleRange.max:e.isInversed?e.visibleRange.max:e.visibleRange.min,Math.abs(this.crossAt-t)},o.prototype.calculateVisibleRangeOnZooming=function(e){if(ie(this)){var t=this.actualRange,i=void 0,r=void 0;r=!this.isInversed||e.zoomModule?(i=this.actualRange.min+this.zoomPosition*this.actualRange.delta)+this.zoomFactor*this.actualRange.delta:(i=this.actualRange.max-this.zoomPosition*this.actualRange.delta)-this.zoomFactor*this.actualRange.delta,i<t.min&&(r+=t.min-i,i=t.min),r>t.max&&(i-=r-t.max,r=t.max),this.doubleRange=new oi(i,r),this.visibleRange={min:this.doubleRange.start,max:this.doubleRange.end,delta:this.doubleRange.delta,interval:this.visibleRange.interval}}},o.prototype.calculateAxisRange=function(e,i){if(i.enableAutoIntervalOnBothAxis){if("Horizontal"===this.orientation&&"X"===i.zoomSettings.mode)for(l=0;l<this.series.length;l++){for(var r=[],o=0,n=this.series[l].visiblePoints;o<n.length;o++)(p=n[o]).xValue>this.visibleRange.min&&p.xValue<this.visibleRange.max&&r.push(p.yValue);for(var a=0,s=i.axisCollections;a<s.length;a++)"Vertical"!==(y=s[a]).orientation||t.isNullOrUndefined(y.series[l])||(y.series[l].yMin=Math.min.apply(Math,r),y.series[l].yMax=Math.max.apply(Math,r),y.baseModule.calculateRangeAndInterval(e,y))}if("Vertical"===this.orientation&&"Y"===i.zoomSettings.mode)for(var l=0;l<this.series.length;l++){for(var h=[],c=0,d=this.series[l].visiblePoints;c<d.length;c++){var p=d[c];p.yValue>this.visibleRange.min&&p.yValue<this.visibleRange.max&&h.push(p.xValue)}for(var u=0,g=i.axisCollections;u<g.length;u++){var y=g[u];"Horizontal"!==y.orientation||t.isNullOrUndefined(y.series[l])||(y.series[l].xMin=Math.min.apply(Math,h),y.series[l].xMax=Math.max.apply(Math,h),y.baseModule.calculateRangeAndInterval(e,y))}}}},o.prototype.triggerRangeRender=function(e,t,i,r){var o={cancel:!1,name:"axisRangeCalculated",axis:this,minimum:t,maximum:i,interval:r};e.trigger("axisRangeCalculated",o),o.cancel||(this.visibleRange={min:o.minimum,max:o.maximum,interval:o.interval,delta:o.maximum-o.minimum})},o.prototype.getRangePadding=function(e){var t=this.rangePadding;if("Auto"!==t)return t;switch(this.orientation){case"Horizontal":t=e.requireInvertedAxis?this.isStack100||this.baseModule.chart.stockChart?"Round":"Normal":"None";break;case"Vertical":t=e.requireInvertedAxis?"None":this.isStack100||this.baseModule.chart.stockChart?"Round":"Normal"}return t},o.prototype.getMaxLabelWidth=function(e){var r,o,n=0,a=!1;this.angle=this.labelRotation,this.maxLabelSize=new i.Size(0,0);for(var s,l=this.labelIntersectAction,h=0,c=this.visibleLabels.length;h<c;h++){(o=u((s=this.visibleLabels[h]).originalText))?(s.size=i.measureText(s.originalText.replace(/<br>/g," "),this.labelStyle),s.breakLabelSize=i.measureText(this.enableTrim?s.text.join("<br>"):s.originalText,this.labelStyle)):s.size=i.measureText(s.text,this.labelStyle);var d=o?s.breakLabelSize.width:s.size.width;d>this.maxLabelSize.width&&(this.maxLabelSize.width=d,this.rotatedLabel=s.text);var p=o?s.breakLabelSize.height:s.size.height;if(p>this.maxLabelSize.height&&(this.maxLabelSize.height=p),o&&(s.text=this.enableTrim?s.text:s.originalText.split("<br>")),"None"!==l&&"Hide"!==l&&"Trim"!==l&&("None"!==l||this.angle%360==0)&&"Horizontal"===this.orientation&&this.rect.width>0&&!a){var g=o?s.breakLabelSize.width:s.size.width;switch(r=I(s.value,this)*this.rect.width+this.rect.x,r-=g/2,"Shift"===this.edgeLabelPlacement&&(0===h&&r<this.rect.x&&(r=this.rect.x),h===this.visibleLabels.length-1&&r+g>this.rect.x+this.rect.width&&(r=this.rect.x+this.rect.width-g)),l){case"MultipleRows":h>0&&this.findMultiRows(h,r,s,o);break;case"Rotate45":case"Rotate90":h>0&&(this.isInversed?r+g>=n:r<=n)&&(this.angle="Rotate45"===l?45:90,a=!0);break;default:if(o){for(var m=void 0,v=[],f=void 0,b=0;b<s.text.length;b++)if((m=Ge(s.text[b],this.rect.width/this.visibleLabels.length,this.labelStyle)).length>1)for(var x=0;x<m.length;x++)f=m[x],v.push(f);else v.push(m[0]);s.text=v}else s.text=Ge(s.text,this.rect.width/this.visibleLabels.length,this.labelStyle);var w=s.size.height*s.text.length;w>this.maxLabelSize.height&&(this.maxLabelSize.height=w)}n=this.isInversed?r:r+g}}if(0!==this.angle&&"Horizontal"===this.orientation){this.rotatedLabel=t.isNullOrUndefined(this.rotatedLabel)?"":this.rotatedLabel;var S=-360===this.angle||0===this.angle||-180===this.angle||180===this.angle||360===this.angle;"Outside"===this.labelPosition&&!S&&u(this.rotatedLabel)?this.maxLabelSize=new i.Size(this.maxLabelSize.height,this.maxLabelSize.width):this.maxLabelSize=y(this.labelStyle,this.rotatedLabel,this.angle,e)}e.multiLevelLabelModule&&this.multiLevelLabels.length>0&&e.multiLevelLabelModule.getMultilevelLabelsHeight(this)},o.prototype.findMultiRows=function(e,t,i,r){for(var o,n,a,s=[],l=e-1;l>=0;l--)o=this.visibleLabels[l],a=r?o.breakLabelSize.width:o.size.width,n=I(o.value,this)*this.rect.width+this.rect.x,(this.isInversed?t+i.size.width>n-.5*a:t<n+.5*a)?(s.push(o.index),i.index=i.index>o.index?i.index:o.index+1):i.index=s.indexOf(o.index)>-1?i.index:o.index;var h=(r?i.breakLabelSize.height:i.size.height)*i.index+5*(i.index-1);h>this.maxLabelSize.height&&(this.maxLabelSize.height=h)},o.prototype.getModule=function(e){"Double"===this.valueType?this.baseModule=new ni(e):this.baseModule=e[G(this.valueType)+"Module"]},xi([t.Complex(e.Theme.axisLabelFont,Xt)],o.prototype,"labelStyle",void 0),xi([t.Complex({},Ai)],o.prototype,"crosshairTooltip",void 0),xi([t.Property("")],o.prototype,"title",void 0),xi([t.Complex(e.Theme.axisTitleFont,Xt)],o.prototype,"titleStyle",void 0),xi([t.Property("")],o.prototype,"labelFormat",void 0),xi([t.Property("")],o.prototype,"skeleton",void 0),xi([t.Property("DateTime")],o.prototype,"skeletonType",void 0),xi([t.Property("Center")],o.prototype,"lineBreakAlignment",void 0),xi([t.Property(0)],o.prototype,"plotOffset",void 0),xi([t.Property(null)],o.prototype,"plotOffsetLeft",void 0),xi([t.Property(null)],o.prototype,"plotOffsetTop",void 0),xi([t.Property(null)],o.prototype,"plotOffsetRight",void 0),xi([t.Property(null)],o.prototype,"plotOffsetBottom",void 0),xi([t.Property(!1)],o.prototype,"isIndexed",void 0),xi([t.Property(10)],o.prototype,"logBase",void 0),xi([t.Property(0)],o.prototype,"columnIndex",void 0),xi([t.Property(0)],o.prototype,"rowIndex",void 0),xi([t.Property(1)],o.prototype,"span",void 0),xi([t.Property(null)],o.prototype,"desiredIntervals",void 0),xi([t.Property(3)],o.prototype,"maximumLabels",void 0),xi([t.Property(1)],o.prototype,"zoomFactor",void 0),xi([t.Property(0)],o.prototype,"zoomPosition",void 0),xi([t.Property(!0)],o.prototype,"enableScrollbarOnZooming",void 0),xi([t.Property(!1)],o.prototype,"opposedPosition",void 0),xi([t.Property(!0)],o.prototype,"enableAutoIntervalOnZooming",void 0),xi([t.Property("Auto")],o.prototype,"rangePadding",void 0),xi([t.Property("Double")],o.prototype,"valueType",void 0),xi([t.Property("None")],o.prototype,"edgeLabelPlacement",void 0),xi([t.Property("Auto")],o.prototype,"intervalType",void 0),xi([t.Property("BetweenTicks")],o.prototype,"labelPlacement",void 0),xi([t.Property("Outside")],o.prototype,"tickPosition",void 0),xi([t.Property("Outside")],o.prototype,"labelPosition",void 0),xi([t.Property("")],o.prototype,"name",void 0),xi([t.Property(!0)],o.prototype,"visible",void 0),xi([t.Property(0)],o.prototype,"minorTicksPerInterval",void 0),xi([t.Property(0)],o.prototype,"labelRotation",void 0),xi([t.Property(null)],o.prototype,"crossesAt",void 0),xi([t.Property(!0)],o.prototype,"placeNextToAxisLine",void 0),xi([t.Property(null)],o.prototype,"crossesInAxis",void 0),xi([t.Property(null)],o.prototype,"minimum",void 0),xi([t.Property(null)],o.prototype,"maximum",void 0),xi([t.Property(null)],o.prototype,"interval",void 0),xi([t.Property(34)],o.prototype,"maximumLabelWidth",void 0),xi([t.Property(!1)],o.prototype,"enableTrim",void 0),xi([t.Property(5)],o.prototype,"labelPadding",void 0),xi([t.Property(5)],o.prototype,"titlePadding",void 0),xi([t.Complex({},Ri)],o.prototype,"majorTickLines",void 0),xi([t.Complex({},Mi)],o.prototype,"minorTickLines",void 0),xi([t.Complex({},Ci)],o.prototype,"majorGridLines",void 0),xi([t.Complex({},Pi)],o.prototype,"minorGridLines",void 0),xi([t.Complex({},Li)],o.prototype,"lineStyle",void 0),xi([t.Property("Trim")],o.prototype,"labelIntersectAction",void 0),xi([t.Property(!1)],o.prototype,"isInversed",void 0),xi([t.Property(100)],o.prototype,"coefficient",void 0),xi([t.Property(0)],o.prototype,"startAngle",void 0),xi([t.Property(!0)],o.prototype,"startFromZero",void 0),xi([t.Property(null)],o.prototype,"description",void 0),xi([t.Property(2)],o.prototype,"tabIndex",void 0),xi([t.Collection([],yi)],o.prototype,"stripLines",void 0),xi([t.Collection([],mi)],o.prototype,"multiLevelLabels",void 0),xi([t.Complex({color:null,width:0,type:"Rectangle"},ui)],o.prototype,"border",void 0),xi([t.Complex({},fi)],o.prototype,"scrollbarSettings",void 0),o}(t.ChildProperty),Ti=function(){function e(e,t,r,o,n,a,s){void 0===n&&(n=new i.Size(0,0)),void 0===a&&(a=new i.Size(0,0)),void 0===s&&(s=1),this.text=e,this.originalText=o,this.value=t,this.labelStyle=r,this.size=n,this.breakLabelSize=a,this.index=s}return e}(),_i=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oi=function(){function e(e,t,i,r,o,n){this.verticalStandardMean=e,this.horizontalStandardMean=i,this.verticalSquareRoot=t,this.horizontalSquareRoot=r,this.verticalMean=o,this.horizontalMean=n}return e}(),Ei=function(){function e(e,t,i,r,o){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.radius=r,this.currentXPosition=o}return e}(),Ii=function(){function e(e){this.id=e}return e}(),zi=function(){function e(e,t){this.startValues=e,this.endValues=t}return e}(),Di=function(e){function t(t,i,r,o,n,a,s,l,h){var c=e.call(this,t,i,r.width,r.color,o,h)||this;return c.y=n.y,c.x=n.x,c.height=n.height,c.width=n.width,c.rx=a||0,c.ry=s||0,c.transform=l||"",c.stroke=0!==r.width&&""!==c.stroke?r.color:"transparent",c}return _i(t,e),t}(i.PathOption),Bi=function(){function e(e,t,i,r,o,n,a,s){this.height=e,this.width=t,this.href=i,this.x=r,this.y=o,this.id=n,this.visibility=a,this.preserveAspectRatio=s}return e}(),Fi=function(e){function t(t,i,r,o,n,a,s){var l=e.call(this,t,i,r.width,r.color,o)||this;return l.cy=a,l.cx=n,l.r=s,l}return _i(t,e),t}(i.PathOption),Ni=function(){function e(e,t,i){this.id=e,this.points=t,this.fill=i}return e}(),Vi=function(){function e(e,t){this.x=e,this.y=t}return e}(),ji=function(){function e(e,t){this.x=0,this.y=0,this.x=e,this.y=t}return e}(),Hi=function(){function e(e,t,i,r){this.left=e,this.right=t,this.top=i,this.bottom=r}return e}(),Xi=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Yi=function(){function e(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.lierIndex=i}return e}(),Gi=function(){function e(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.index=i}return e}(),Wi=function(){function e(e,t){this.controlPoint1=e,this.controlPoint2=t}return e}(),Ui=function(){function e(e){this.chart=e,this.padding=5}return e.prototype.measureAxis=function(e){var t=this.chart;this.crossAt(t),this.seriesClipRect=new i.Rect(e.x,e.y,e.width,e.height),this.initialClipRect=e,this.leftSize=0,this.rightSize=0,this.topSize=0,this.bottomSize=0,this.measureRowAxis(t,this.initialClipRect),this.initialClipRect=L(this.initialClipRect,new Hi(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.initialClipRect=L(this.initialClipRect,new Hi(0,0,this.topSize,this.bottomSize)),this.chart.delayRedraw||this.calculateAxisSize(this.initialClipRect),this.leftSize=0,this.rightSize=0,this.topSize=0,this.bottomSize=0,this.measureRowAxis(t,this.initialClipRect),this.seriesClipRect=L(this.seriesClipRect,new Hi(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.seriesClipRect=L(this.seriesClipRect,new Hi(0,0,this.topSize,this.bottomSize)),this.chart.delayRedraw||(t.refreshAxis(),this.calculateAxisSize(this.seriesClipRect))},e.prototype.measureRowAxis=function(e,t){var r;this.calculateRowSize(t);for(var o=0,n=e.rows;o<n.length;o++)(r=n[o]).nearSizes=[],r.farSizes=[],this.arrangeAxis(r),this.measureDefinition(r,e,new i.Size(e.availableSize.width,r.computedHeight)),this.leftSize<C(r.nearSizes)&&(this.leftSize=C(r.nearSizes)),this.rightSize<C(r.farSizes)&&(this.rightSize=C(r.farSizes))},e.prototype.measureColumnAxis=function(e,t){var r;this.calculateColumnSize(t);for(var o=0,n=e.columns;o<n.length;o++)(r=n[o]).farSizes=[],r.nearSizes=[],this.arrangeAxis(r),this.measureDefinition(r,e,new i.Size(r.computedWidth,e.availableSize.height)),this.bottomSize<C(r.nearSizes)&&(this.bottomSize=C(r.nearSizes)),this.topSize<C(r.farSizes)&&(this.topSize=C(r.farSizes))},e.prototype.measureDefinition=function(e,t,i){for(var r=0,o=e.axes;r<o.length;r++){var n=o[r];n.scrollBarHeight=t.scrollBarModule&&t.zoomModule&&t.zoomSettings.enableScrollbar&&n.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(n.zoomFactor<1||n.zoomPosition>0)?16:0,n.scrollBarHeight=t.scrollBarModule&&(t.zoomModule&&t.zoomSettings.enableScrollbar&&n.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(n.zoomFactor<1||n.zoomPosition>0)||n.scrollbarSettings.enable)?16:0,n.getModule(t),n.baseModule.calculateRangeAndInterval(i,n),e.computeSize(n,n.scrollBarHeight)}e.farSizes.length>0&&(e.farSizes[e.farSizes.length-1]-=10),e.nearSizes.length>0&&(e.nearSizes[e.nearSizes.length-1]-=10)},e.prototype.calculateAxisSize=function(e){var t,i,r,o,n,a,s,l=this.chart,h=0,c=0,d=0;this.calculateRowSize(e);for(var p=0,u=l.rows.length;p<u;p++){h=0,c=0;for(var g=0,y=(t=l.rows[p]).axes.length;g<y;g++){if(o=t.axes[g],s=o.plotOffset,0===o.rect.height){o.rect.height=t.computedHeight,d=0;for(var m=p+1,v=p+o.span;m<v;m++)d+=(r=l.rows[m]).computedHeight;o.rect.y=t.computedTop-d+(o.plotOffsetTop?o.plotOffsetTop:s),o.rect.height=o.rect.height+d-this.getAxisOffsetValue(o.plotOffsetTop,o.plotOffsetBottom,o.plotOffset),o.rect.width=0}o.opposedPosition?(n=e.x+e.width+C(E(t.farSizes,c)),o.rect.x=o.rect.x>=n?o.rect.x:n,c++):(n=e.x-C(E(t.nearSizes,h)),o.rect.x=o.rect.x<=n?o.rect.x:n,h++)}}this.calculateColumnSize(e);for(var p=0,u=l.columns.length;p<u;p++){h=0,c=0;for(var g=0,f=(i=l.columns[p]).axes.length;g<f;g++){if(o=i.axes[g],s=o.plotOffset,0===o.rect.width){for(var m=p,b=p+o.span;m<b;m++)r=l.columns[m],o.rect.width+=r.computedWidth;o.rect.x=i.computedLeft+(o.plotOffsetLeft?o.plotOffsetLeft:s),o.rect.width-=this.getAxisOffsetValue(o.plotOffsetLeft,o.plotOffsetRight,o.plotOffset),o.rect.height=0}o.opposedPosition?(a=e.y-C(E(i.farSizes,c)),o.rect.y=o.rect.y<=a?o.rect.y:a,c++):(a=e.y+e.height+C(E(i.nearSizes,h)),o.rect.y=o.rect.y>=a?o.rect.y:a,h++)}}},e.prototype.measure=function(){for(var e,t,i,r,o,n=this.chart,a=0,s=n.axisCollections;a<s.length;a++){var l=s[a];if("Vertical"===l.orientation){n.verticalAxes.push(l),r=this.getActualRow(l),e=n.rows[r],this.pushAxis(e,l),o=r+l.span>n.rows.length?n.rows.length:r+l.span;for(h=r+1;h<o;h++)(i=n.rows[h]).axes[e.axes.length-1]=l,n.rows[h]=i;n.rows[r]=e}else{n.horizontalAxes.push(l),r=this.getActualColumn(l),t=n.columns[r],this.pushAxis(t,l),o=r+l.span>n.columns.length?n.columns.length:r+l.span;for(var h=r+1;h<o;h++)(i=n.columns[h]).axes[t.axes.length-1]=l,n.columns[h]=i;n.columns[r]=t}}},e.prototype.getAxisOffsetValue=function(e,t,i){return e?e+(t||i):t?t+i:2*i},e.prototype.crossAt=function(e){for(var t=0,i=e.axisCollections;t<i.length;t++){var r=i[t];if(null!==r.crossesAt)if(r.crossesInAxis)for(var o=2,n=e.axisCollections.length;o<n;o++)r.crossesInAxis!==e.axisCollections[o].name||(r.crossInAxis=e.axisCollections[o],r.crossAt=this.updateCrossAt(r.crossInAxis,r.crossesAt));else e.requireInvertedAxis?r.crossInAxis="Horizontal"===r.orientation?e.primaryXAxis:e.primaryYAxis:r.crossInAxis="Horizontal"===r.orientation?e.primaryYAxis:e.primaryXAxis,r.crossAt=this.updateCrossAt(r.crossInAxis,r.crossesAt)}},e.prototype.updateCrossAt=function(e,t){switch(e.valueType){case"DateTime":var i={skeleton:"full",type:"dateTime"},o=this.chart.intl.getDateParser(i),n=this.chart.intl.getDateFormat(i);return Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:t}).val))));case"Category":return parseFloat(t)?parseFloat(t):e.labels.indexOf(t);case"Logarithmic":return v(t,e.logBase);default:return t}},e.prototype.pushAxis=function(e,t){for(var i=0,r=e.axes.length;i<=r;i++)if(!e.axes[i]){e.axes[i]=t;break}},e.prototype.arrangeAxis=function(e){for(var t=[],i=0,r=e.axes.length;i<=r;i++)e.axes[i]&&t.push(e.axes[i]);e.axes=t},e.prototype.getActualColumn=function(e){var t=this.chart.columns.length,i=e.columnIndex;return i>=t?t-1:i<0?0:i},e.prototype.getActualRow=function(e){var t=this.chart.rows.length,i=e.rowIndex;return i>=t?t-1:i<0?0:i},e.prototype.calculateRowSize=function(e){for(var t,i=this.chart,r=e.y+e.height,o=0,n=Math.max(0,e.height),a=0,s=i.rows.length;a<s;a++)o=-1!==(t=i.rows[a]).height.indexOf("%")?Math.min(n,e.height*parseInt(t.height,10)/100):Math.min(n,parseInt(t.height,10)),o=a!==s-1?o:n,t.computedHeight=o,r-=o,t.computedTop=r,n-=o},e.prototype.calculateColumnSize=function(e){for(var t,i=this.chart,r=e.x,o=0,n=Math.max(0,e.width),a=0,s=i.columns.length;a<s;a++)o=-1!==(t=i.columns[a]).width.indexOf("%")?Math.min(n,e.width*parseInt(t.width,10)/100):Math.min(n,parseInt(t.width,10)),o=a!==s-1?o:n,t.computedWidth=o,t.computedLeft=r,r+=o,n-=o},e.prototype.renderAxes=function(){for(var e,t,i,r=this.chart,o=r.renderer.createGroup({id:r.element.id+"AxisInsideCollection"}),n=r.renderer.createGroup({id:r.element.id+"AxisOutsideCollection"}),a=0,s=r.axisCollections.length;a<s;a++)e=r.axisCollections[a],this.element=r.renderer.createGroup({id:r.element.id+"AxisGroup"+a+"Inside"}),t=r.renderer.createGroup({id:r.element.id+"AxisGroup"+a+"Outside"}),i=this.findAxisPosition(e),"Horizontal"===e.orientation?(e.updateCrossValue(),e.visible&&e.internalVisibility&&e.lineStyle.width>0&&this.drawAxisLine(e,a,e.plotOffset,0,i?t:this.element,e.updatedRect),(e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawXAxisGridLine(e,a,i||"Inside"===e.tickPosition?t:this.element,e.updatedRect),e.visible&&e.internalVisibility&&(this.drawXAxisLabels(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawXAxisBorder(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawXAxisTitle(e,a,i?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect))):(e.updateCrossValue(),e.visible&&e.internalVisibility&&e.lineStyle.width>0&&this.drawAxisLine(e,a,0,e.plotOffset,i?t:this.element,e.updatedRect),(e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawYAxisGridLine(e,a,i||"Inside"===e.tickPosition?t:this.element,e.updatedRect),e.visible&&e.internalVisibility&&(this.drawYAxisLabels(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawYAxisBorder(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawYAxisTitle(e,a,i?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect))),this.chart.enableCanvas||(o.appendChild(this.element),t&&t.childNodes.length>0&&n.appendChild(t)),r.scrollBarModule&&(r.zoomSettings.enableScrollbar&&e.enableScrollbarOnZooming||e.scrollbarSettings.enable)&&this.renderScrollbar(r,e);this.element=r.renderer.createGroup({id:r.element.id+"DefinitionLine"});for(var l=0,s=r.rows.length;l<s;l++){var h=r.rows[l];h.border.color&&this.drawBottomLine(h,l,!0)}for(var l=0,s=r.columns.length;l<s;l++){var c=r.columns[l];c.border.color&&this.drawBottomLine(c,l,!1)}return this.chart.enableCanvas||o.appendChild(this.element),be(r.enableCanvas,r.svgObject,o,r.redraw),n},e.prototype.renderScrollbar=function(e,i){(!t.isNullOrUndefined(e.zoomModule)&&e.zoomModule.isZoomed&&(i.zoomFactor<1||i.zoomPosition>0)||i.scrollbarSettings.enable&&(i.zoomFactor<=1||i.zoomPosition>=0))&&(!i.zoomingScrollBar.isScrollUI||e.visibleSeries[0].type.indexOf("Bar")>=0)?(e.scrollElement||(e.scrollElement=Fe(e.redraw,e.element.id+"_scrollElement")||t.createElement("div",{id:e.element.id+"_scrollElement"})),be(!1,e.scrollElement,i.zoomingScrollBar.render(!0),!0)):1===i.zoomFactor&&0===i.zoomPosition&&i.zoomingScrollBar.svgObject&&!i.scrollbarSettings.enable&&i.zoomingScrollBar.destroy(),i.zoomingScrollBar.isScrollUI&&(i.zoomingScrollBar.isScrollUI=!1)},e.prototype.findAxisPosition=function(e){return null!==e.crossAt&&e.isInside(e.crossInAxis.visibleRange)},e.prototype.drawBottomLine=function(e,t,i){var r,o,n,a,s,l=this.chart,h={};i?(n=a=(e=e).computedTop+e.computedHeight,o=(r=this.seriesClipRect.x)+this.seriesClipRect.width,s="Row"):(r=o=(e=e).computedLeft,a=(n=this.seriesClipRect.y)+this.seriesClipRect.height,s="Column"),h={id:l.element.id+"_AxisBottom_"+s+t,x1:r,y1:n,x2:o,y2:a,"stroke-width":e.border.width,stroke:e.border.color},this.htmlObject=l.renderer.drawLine(h),this.element.appendChild(this.htmlObject)},e.prototype.drawAxisLine=function(e,t,i,r,o,n){var a=this.chart,s={},l=he(a.element.id+"AxisLine_"+t),h=l?l.getAttribute("d"):"";l=null,s={id:a.element.id+"AxisLine_"+t,d:"M "+(n.x-i)+" "+(n.y-r)+" L "+(n.x+n.width+i)+" "+(n.y+n.height+r),"stroke-dasharray":e.lineStyle.dashArray,"stroke-width":e.lineStyle.width,stroke:e.lineStyle.color||a.themeStyle.axisLine},this.htmlObject=a.renderer.drawPath(s),be(a.enableCanvas,o,this.htmlObject,a.redraw,!0,"x","y",null,h)},e.prototype.drawYAxisGridLine=function(e,i,r,o){var n,a,s="Logarithmic"===e.valueType,l=e.valueType.indexOf("Category")>-1,h=0,c="",d="",p=e.opposedPosition?e.majorTickLines.height:-e.majorTickLines.height,u=e.opposedPosition?.5*e.lineStyle.width:.5*-e.lineStyle.width,g="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,y=t.isNullOrUndefined(e.crossesAt)?e.opposedPosition?e.scrollBarHeight:-e.scrollBarHeight:0,m="Inside"===e.tickPosition,v=m?o.x-p-u:o.x+p+u+y,f=e.visibleLabels.length,x=this.chart.themeStyle;e.valueType.indexOf("Category")>-1&&"BetweenTicks"===e.labelPlacement&&f>0&&(f+=1);for(var w=e.minorGridLines,S=e.minorTickLines,C=0;C<f;C++)(h=-1*(h=I(n=e.visibleLabels[C]?e.visibleLabels[C].value-g:e.visibleLabels[C-1].value+e.visibleRange.interval-g,e)*o.height)+(o.y+o.height))>=o.y&&o.y+o.height>=h&&((b(n,e.visibleRange)||this.isBorder(e,C,h))&&(c="M "+this.seriesClipRect.x+" "+h+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+h,this.renderGridLine(e,i,c,e.majorGridLines,"_MajorGridLine_",C,this.element,x.majorGridLine,e.majorGridLines.dashArray)),d="M "+(o.x+u+(m?y:0))+" "+h+" L "+v+" "+h,this.renderGridLine(e,i,d,e.majorTickLines,"_MajorTickLine_",C,r,x.majorTickLine),(w.width>0||S.width>0)&&e.minorTicksPerInterval>0&&(0!==C||!ie(e)||s||l||this.renderMinorGridOnZooming(e,n,o,C,i,x,r),a=this.drawAxisMinorLine(e,n,o,C),this.renderGridLine(e,i,a[0],w,"_MinorGridLine_",C,this.element,x.minorGridLine,w.dashArray),this.renderGridLine(e,i,a[1],S,"_MinorTickLine_",C,r,x.minorTickLine),C===f-1&&ie(e)&&s&&!l&&this.renderMinorGridOnZooming(e,n+e.visibleRange.interval,o,C,i,x,r)))},e.prototype.isBorder=function(e,t,i){var r=this.chart.chartArea.border,o=this.seriesClipRect,n=e.orientation,a="Horizontal"===n?o.x:o.y,s="Horizontal"===n?o.width:o.height,l="Horizontal"===n?0:e.visibleLabels.length-1,h="Horizontal"===n?e.visibleLabels.length-1:0;return e.plotOffset>0||((i===a||i===a+s)&&(r.width<=0||"transparent"===r.color)||(i!==a&&t===l||i!==a+s&&t===h))},e.prototype.drawYAxisLabels=function(e,r,o,n){var a,s,l,h=this.chart,c=0,d=0,p=e.labelPadding,g="Inside"===e.labelPosition,y=e.opposedPosition,m=(e.labelPosition===e.tickPosition?e.majorTickLines.height:0)+p+.5*e.lineStyle.width;m=e.opposedPosition?m:-m;var v=y&&g||!y&&!g?"end":"start";v=h.isRtlEnabled?e.opposedPosition?"end":"start":v;for(var f,b,x,w=h.renderer.createGroup({id:h.element.id+"AxisLabels"+r}),S=t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight*(y?1:-1):0,C=0,P=e.visibleLabels.length;C<P;C++){l=u(e.visibleLabels[C].originalText),c=g?n.x-m:n.x+m+S,a=l?e.visibleLabels[C].breakLabelSize:e.visibleLabels[C].size,d=I(e.visibleLabels[C].value,e)*n.height+(h.stockChart?7:0),d=Math.floor(-1*d+(n.y+n.height)),f=a.height/8*e.visibleLabels[C].text.length/2,b=a.height/4*3+3,d=l?"Inside"===e.labelPosition?d-a.height/2-f+b:d-f:"Inside"===e.labelPosition?d+b:d+a.height/4,x=e.majorGridLines.width>e.majorTickLines.width?e.majorGridLines.width:e.majorTickLines.width,"Far"===e.labelStyle.textAlignment?d=d-x-10:"Near"===e.labelStyle.textAlignment?d=d+x+10:"Center"===e.labelStyle.textAlignment&&(d=d),c=l?this.getAxisLabelXvalue(c,e,a.width):c;var L=l?this.getAnchor(e):v;if(s=new i.TextOption(h.element.id+r+"_AxisLabel_"+C,c,d,L,e.visibleLabels[C].text),e.edgeLabelPlacement)switch(e.edgeLabelPlacement){case"None":break;case"Hide":((0===C||e.isInversed&&C===P-1)&&s.y>n.y+n.height||(C===P-1||e.isInversed&&0===C)&&s.y-.5*a.height<n.y)&&(s.text="");break;case"Shift":(0===C||e.isInversed&&C===P-1)&&s.y>n.y+n.height?s.y=d=n.y+n.height:(C===P-1||e.isInversed&&0===C)&&s.y-.5*a.height<n.y&&(s.y=d=n.y+.5*a.height)}Ve(h.renderer,s,e.labelStyle,e.labelStyle.color||h.themeStyle.axisLabel,w,!1,h.redraw,!0,!0,null,null,null,null,h.enableCanvas)}this.chart.enableCanvas||(h.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,w,e,r,n):be(h.enableCanvas,o,w,h.redraw))},e.prototype.getAxisLabelXvalue=function(e,t,i){var r=t.lineBreakAlignment,o="Inside"===t.labelPosition,n=t.opposedPosition;return n&&o||!n&&!o?"Right"===r?e:"Center"===r?e-i/2:e-i:"Left"===r?e:"Center"===r?e+i/2:e+i},e.prototype.drawYAxisBorder=function(e,t,i,r){if(e.border.width>0){var o=void 0,n=void 0,a="Outside"===e.labelPosition?e.scrollBarHeight:0;a=(e.opposedPosition?1:-1)*a;for(var s=r.height/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval),l=void 0,h=e.maxLabelSize.width+10+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),c="",d="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,p=e.opposedPosition&&"Inside"===e.labelPosition||!e.opposedPosition&&"Outside"===e.labelPosition?r.x-h+a:r.x+h+a,u=0,g=e.visibleLabels.length;u<g;u++)switch(n=I(e.visibleLabels[u].value+d,e),n=(e.isInversed?1-n:n)*r.height,"Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(o=-1*n+(r.y+r.height),l=-1*n-s+(r.y+r.height)):(o=-1*n+s/2+(r.y+r.height),l=-1*n-s/2+(r.y+r.height)),e.border.type){case"Rectangle":case"WithoutTopBorder":o>r.y+r.height?c+="M "+p+" "+(r.y+r.height)+" L "+p+" "+l+" ":Math.floor(r.y)>l?c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" L "+p+" "+r.y+" ":(c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" L "+p+" "+l+" ",u===e.visibleLabels.length-1&&(c+="M "+(r.x+a)+" "+l+" L "+p+" "+l+" "));break;case"WithoutTopandBottomBorder":o>r.y+r.height||l<Math.floor(r.y)||(c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" M "+p+" "+l+" L "+(r.x+a)+" "+l)}""!==(c+="Rectangle"===e.border.type?"M "+(r.x+a)+" "+r.y+" L "+(r.x+a)+" "+(r.y+r.height)+" ":"")&&this.createAxisBorderElement(e,t,c,i)}e.multiLevelLabels.length>0&&this.chart.multiLevelLabelModule&&this.chart.multiLevelLabelModule.renderYAxisMultiLevelLabels(e,t,i,r)},e.prototype.drawYAxisTitle=function(e,t,r,o){if(e.title){var n=this.chart,a=e.opposedPosition?90:-90,s=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.width+e.multiLevelLabelHeight+this.padding);s=e.opposedPosition?s+e.scrollBarHeight:-s-e.scrollBarHeight;var l=o.x+s,h=o.y+.5*o.height,c=e.titleSize.height*(e.titleCollection.length-1),d=new i.TextOption(n.element.id+"_AxisTitle_"+t,l,h-e.labelPadding-c,"middle",e.titleCollection,"rotate("+a+","+l+","+h+")",null,a),p=Ve(n.renderer,d,e.titleStyle,e.titleStyle.color||n.themeStyle.axisTitle,r,null,null,null,null,null,null,null,null,n.enableCanvas);p.setAttribute("tabindex",e.tabIndex.toString()),p.setAttribute("aria-label",e.description||e.title)}},e.prototype.drawXAxisGridLine=function(e,i,r,o){var n,a,s="Logarithmic"===e.valueType,l=e.valueType.indexOf("Category")>-1,h=0,c="",d="",p=e.opposedPosition?-e.majorTickLines.height:e.majorTickLines.height,u=e.opposedPosition?.5*-e.lineStyle.width:.5*e.lineStyle.width,g=t.isNullOrUndefined(e.crossesAt)?e.opposedPosition?-e.scrollBarHeight:e.scrollBarHeight:0,y=e.valueType.indexOf("Category")>-1&&"BetweenTicks"===e.labelPlacement?.5:0,m=e.visibleLabels.length,v="Inside"===e.tickPosition,f=v?o.y-p-u:o.y+p+u+g,x=this.chart.themeStyle;e.valueType.indexOf("Category")>-1&&m>0&&"BetweenTicks"===e.labelPlacement&&(m+=1);for(var w=0;w<m;w++)(h=I(n="DateTimeCategory"!==e.valueType?e.visibleLabels[w]?e.visibleLabels[w].value-y:e.visibleLabels[w-1].value+e.visibleRange.interval-y:e.visibleLabels[w]?e.visibleLabels[w].value-y:e.visibleRange.max,e)*o.width+o.x)>=o.x&&o.x+o.width>=h&&((b(n,e.visibleRange)||this.isBorder(e,w,h))&&(c="M "+h+" "+(this.seriesClipRect.y+this.seriesClipRect.height)+" L "+h+" "+this.seriesClipRect.y,this.renderGridLine(e,i,c,e.majorGridLines,"_MajorGridLine_",w,this.element,x.majorGridLine,e.majorGridLines.dashArray)),d="M "+h+" "+(o.y+u+(v?g:0))+" L "+h+" "+f,this.renderGridLine(e,i,d,e.majorTickLines,"_MajorTickLine_",w,r,x.majorTickLine),e.minorTicksPerInterval>0&&(e.minorGridLines.width>0||e.minorTickLines.width>0)&&(0!==w||!ie(e)||s||l||this.renderMinorGridOnZooming(e,n,o,w,i,x,r),a=this.drawAxisMinorLine(e,n,o,w),this.renderGridLine(e,i,a[0],e.minorGridLines,"_MinorGridLine_",w,this.element,x.minorGridLine,e.minorGridLines.dashArray),this.renderGridLine(e,i,a[1],e.minorTickLines,"_MinorTickLine_",w,r,x.minorTickLine),w===m-1&&ie(e)&&s&&!l&&this.renderMinorGridOnZooming(e,n+e.visibleRange.interval,o,w,i,x,r)))},e.prototype.renderMinorGridOnZooming=function(e,t,i,r,o,n,a){var s=this.drawAxisMinorLine(e,t,i,r,!0);this.renderGridLine(e,o,s[0],e.minorGridLines,"_MinorGridLine_",-1,this.element,n.minorGridLine,e.minorGridLines.dashArray),this.renderGridLine(e,o,s[1],e.minorTickLines,"_MinorTickLine_",-1,a,n.minorTickLine)},e.prototype.drawAxisMinorLine=function(e,t,i,r,o){var n,a=t,s=0,l=0,h=e.visibleRange,c="Inside"===e.tickPosition,d=[],p=e.opposedPosition?-e.minorTickLines.height:e.minorTickLines.height,u=1,g=1,y=c?i.y-p:i.y+p,m=c?i.x+p:i.x-p,v="",f="";if("Logarithmic"===e.valueType&&(g=(n=Math.pow(e.logBase,a-h.interval))+(u=(Math.pow(e.logBase,a)-n)/(e.minorTicksPerInterval+1))),"Horizontal"===e.orientation)for(x=0;x<e.minorTicksPerInterval;x++)a=this.findLogNumeric(e,g,a,r,o),g+=u,b(a,h)&&(l=(a-h.min)/(h.max-h.min),l=Math.ceil((e.isInversed?1-l:l)*i.width),s=Math.floor(l+i.x),v=v.concat("M "+s+" "+this.seriesClipRect.y+"L "+s+" "+(this.seriesClipRect.y+this.seriesClipRect.height)),s=Math.floor(l+i.x),f=f.concat("M "+s+" "+i.y+"L "+s+" "+(y+e.scrollBarHeight)));else for(var x=0;x<e.minorTicksPerInterval;x++)b(a=this.findLogNumeric(e,g,a,r,o),h)&&(l=(a-h.min)/(h.max-h.min),l=-1*Math.ceil((e.isInversed?1-l:l)*i.height),s=Math.floor(l+i.y+i.height),v=v.concat("M "+this.seriesClipRect.x+" "+s+"L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+s+" "),s=Math.floor(l+i.y+i.height),f=f.concat("M "+i.x+" "+s+"L "+(m-e.scrollBarHeight)+" "+s+" ")),g+=u;return d.push(v),d.push(f),d},e.prototype.findLogNumeric=function(e,t,i,r,o){var n,a=e.visibleRange;if("Logarithmic"===e.valueType)i=v(t,e.logBase);else if("DateTime"===e.valueType)n=e.dateTimeInterval/(e.minorTicksPerInterval+1),i=o?i-n:i+n;else if("DateTimeCategory"===e.valueType){var s="BetweenTicks"===e.labelPlacement?.5:0;i+=((e.visibleLabels[r+1]?e.visibleLabels[r+1].value-s:e.visibleRange.max)-(e.visibleLabels[r]?e.visibleLabels[r].value-s:e.visibleRange.min))/(e.minorTicksPerInterval+1)}else n=a.interval/(e.minorTicksPerInterval+1),i=o?i-n:i+n;return i},e.prototype.drawXAxisLabels=function(e,r,o,n){var a,s,l,h,c,d,p,g,y,m=this.chart,v=0,f=0,b=e.labelPadding,x=m.renderer.createGroup({id:m.element.id+"AxisLabels"+r}),w="Inside"===e.labelPosition,S=e.opposedPosition,C=e.labelPosition===e.tickPosition?e.majorTickLines.height:0,P=C+b+.5*e.lineStyle.width,L=e.angle%360,R=0===L||-180===L||180===L,M=e.isInversed?n.x+n.width:n.x,A=0,_=e.visibleLabels.length,O=e.scrollbarSettings.enable||!w&&t.isNullOrUndefined(e.crossesAt)&&(e.zoomFactor<1||e.zoomPosition>0)?e.scrollBarHeight:0,E=[],z=!1;P+=90===L||270===L||-90===L||-270===L?w?5:-5:0;for(var D=!S&&!w||S&&w,B=D?360>=L&&L>=180||-1>=L&&L>=-180:1<=L&&L<=180||-181>=L&&L>=-360,F=0,N=_;F<N;F++){y=u((g=e.visibleLabels[F]).originalText),v=I(g.value,e)*n.width+n.x,s=g.size,p=n.width/_,d=y?g.breakLabelSize.width:s.width,A=("Trim"===e.labelIntersectAction||"Wrap"===e.labelIntersectAction)&&0===L&&d>p?p:d,a=s.height/4,v-=y||0!==L?0:A/2,0!==L&&(v-=y?"Left"===e.lineBreakAlignment?g.breakLabelSize.width/2:"Right"===e.lineBreakAlignment?-g.breakLabelSize.width/2:0:-90===L||270===L?-a:90===L||-270===L?a:0),"Far"===e.labelStyle.textAlignment?v=v+A-10:"Near"===e.labelStyle.textAlignment?v=v-A+10:"Center"===e.labelStyle.textAlignment&&(v=v),y&&"Center"!==e.lineBreakAlignment&&0===L&&(v+="Left"===e.lineBreakAlignment?-A/2:A/2);var V=y?R?s.height:g.breakLabelSize.width/2:0;if(P=y?C+b+.5*e.lineStyle.width:P,w&&L?f=y?S?n.y+P+V:n.y-P-V:S?n.y+P+a:n.y-P-a:(l=y?D?P+O+(L?V:3*a):-(P+O+V):D?P+O+(L?1:3)*a:-(P+O+(L?a:g.index>1?2*a:0)),f=n.y+l*g.index),h=y?this.getAnchor(e):m.isRtlEnabled||B?"end":"",c=new i.TextOption(m.element.id+r+"_AxisLabel_"+F,v,f,h),e.edgeLabelPlacement&&0===L)switch(e.edgeLabelPlacement){case"None":break;case"Hide":if((0===F||e.isInversed&&F===N-1)&&c.x<n.x||(F===N-1||e.isInversed&&0===F)&&c.x+A>n.x+n.width)continue;break;case"Shift":(0===F||e.isInversed&&F===N-1)&&c.x<n.x?(p-=n.x-c.x,c.x=v=n.x):(F===N-1||e.isInversed&&0===F)&&c.x+A>n.x+n.width&&(s.width>p&&"Trim"===e.labelIntersectAction?p-=c.x+A-(n.x+n.width):p=A,c.x=v=n.x+n.width-p)}c.text=this.getLabelText(g,e,p);var j=void 0,H=void 0;if(y&&0===L?"Right"===e.lineBreakAlignment?(j=c.x-A,H=c.x):"Center"===e.lineBreakAlignment?(j=c.x-A/2,H=c.x+A/2):(j=c.x,H=c.x+A):(j=c.x,H=c.x+A),0!==L||"Hide"!==e.labelIntersectAction||0===F||!(e.isInversed?H>=M:j<=M)){if(M=y?"Right"===e.lineBreakAlignment?e.isInversed?c.x-A:c.x:"Center"===e.lineBreakAlignment?e.isInversed?c.x-A/2:c.x+A/2:e.isInversed?c.x:c.x+A:e.isInversed?c.x:c.x+A,0!==L){var X=void 0,Y=void 0;if(y){var G=0,W=0;X=g.breakLabelSize.height,W=g.breakLabelSize.height-4,"Center"===e.lineBreakAlignment?G=-g.breakLabelSize.width/2:"Right"===e.lineBreakAlignment&&(G=-g.breakLabelSize.width),D&&(W=g.breakLabelSize.height/(c.text.length+1)),Y=new i.Rect(c.x+G,c.y-W,g.breakLabelSize.width,X)}else X=f-(c.y-(g.size.height/2+10)),Y=new i.Rect(c.x,c.y-(g.size.height/2-5),g.size.width,X);var U=this.getRectanglePoints(Y),Z=y?Y.x+Y.width/2:v,q=y?Y.y+Y.height/2:f-X/2;c.transform=y?"rotate("+L+","+Z+","+q+")":"rotate("+L+","+v+","+f+")",E.push(k(U,Z,q,L)),z=!1;for(var Q=F;Q>0;Q--)if(E[F]&&E[Q-1]&&T(E[F],E[Q-1])){z=!0,E[F]=null;break}}Ve(m.renderer,c,g.labelStyle,g.labelStyle.color||m.themeStyle.axisLabel,x,e.opposedPosition!==("Inside"===e.labelPosition),m.redraw,!0,null,null,null,g.size,z,m.enableCanvas)}}this.chart.enableCanvas||(m.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,x,e,r,n):o.appendChild(x))},e.prototype.getAnchor=function(e){return"Center"===e.lineBreakAlignment?"middle":"Left"===e.lineBreakAlignment?"start":"end"},e.prototype.getRectanglePoints=function(e){return[new Vi(e.x,e.y),new Vi(e.x+e.width,e.y),new Vi(e.x+e.width,e.y+e.height),new Vi(e.x,e.y+e.height)]},e.prototype.getLabelText=function(e,t,i){if(u(e.originalText)){for(var r=[],o=void 0,n=0;n<e.text.length;n++)o=this.findAxisLabel(t,e.text[n],i),r.push(o);return r}return this.findAxisLabel(t,e.text,i)},e.prototype.drawXAxisBorder=function(e,t,i,r){if(e.border.width>0){for(var o="Outside"===e.labelPosition?e.scrollBarHeight:0,n=void 0,a=r.y+(e.opposedPosition?-1:1)*o,s=void 0,l=r.width/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval),h=void 0,c=e.maxLabelSize.height+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),d="",p="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,u=e.opposedPosition&&"Inside"===e.labelPosition||!e.opposedPosition&&"Outside"===e.labelPosition?r.y+c+10+o:r.y-c-10-o,g=0,y=e.visibleLabels.length;g<y;g++)switch(s=I(e.visibleLabels[g].value+p,e),s=(e.isInversed?1-s:s)*r.width,"Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(n=s+r.x,h=s+l+r.x):(n=s-.5*l+r.x,h=s+.5*l+r.x),e.border.type){case"Rectangle":case"WithoutTopBorder":n<r.x?d+="M "+r.x+" "+u+" L "+h+" "+u+" ":Math.floor(h)>r.width+r.x&&1!==e.visibleLabels.length?d+="M "+n+" "+a+" L "+n+" "+u+" L "+(r.width+r.x)+" "+u+" ":(d+="M "+n+" "+a+" L "+n+" "+u+" L "+h+" "+u+" ",0===g&&(d+="M "+n+" "+a+" L "+n+" "+u+" M "+n+" "+u+" L "+r.x+" "+u),g===e.visibleLabels.length-1&&(d+="M "+h+" "+a+" L "+h+" "+u+" M "+h+" "+u+" L "+(r.width+r.x)+" "+u));break;case"WithoutTopandBottomBorder":n<r.x||Math.floor(h)>r.width+r.x||(d+="M "+n+" "+a+" L "+n+" "+u+" M "+h+" "+a+" L "+h+" "+u)}""!==(d+="Rectangle"===e.border.type?"M "+r.x+" "+a+"L "+(r.x+r.width)+" "+a:"")&&this.createAxisBorderElement(e,t,d,i)}this.chart.multiLevelLabelModule&&e.multiLevelLabels.length>0&&this.chart.multiLevelLabelModule.renderXAxisMultiLevelLabels(e,t,i,r)},e.prototype.createAxisBorderElement=function(e,t,r,o){var n=he(this.chart.element.id+"_BorderLine_"+t),a=n?n.getAttribute("d"):"",s=this.chart.renderer.drawPath(new i.PathOption(this.chart.element.id+"_BorderLine_"+t,"transparent",e.border.width,e.border.color||this.chart.themeStyle.axisLine,1,"",r));s.setAttribute("style","pointer-events: none"),be(this.chart.enableCanvas,o,s,this.chart.redraw,!0,"x","y",null,a,!0)},e.prototype.findAxisLabel=function(e,t,i){return"Trim"===e.labelIntersectAction?e.angle%360!=0||e.enableTrim?t:ze(i,t,e.labelStyle):t},e.prototype.drawXAxisTitle=function(e,r,o,n){if(e.title){var a=this.chart,s=i.measureText(e.title,e.titleStyle),l=t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0,h=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.height+e.multiLevelLabelHeight+e.labelPadding),c=e.titleSize.height*(e.titleCollection.length-1);h=e.opposedPosition?-(h+s.height/4+l+c):h+3*s.height/4+l;var d=new i.TextOption(a.element.id+"_AxisTitle_"+r,n.x+.5*n.width,n.y+h,"middle",e.titleCollection),p=Ve(a.renderer,d,e.titleStyle,e.titleStyle.color||a.themeStyle.axisTitle,o,null,null,null,null,null,null,null,null,a.enableCanvas);p.setAttribute("aria-label",e.description||e.title),p.setAttribute("tabindex",e.tabIndex.toString())}},e.prototype.renderGridLine=function(e,t,r,o,n,a,s,l,h){void 0===h&&(h=null);var c,d,p=this.chart;o.width>0&&e.visible&&e.internalVisibility&&r&&(c=(d=he(p.element.id+n+t+"_"+a))?d.getAttribute("d"):null,d=null,this.htmlObject=p.renderer.drawPath(new i.PathOption(p.element.id+n+t+"_"+a,"transparent",o.width,o.color||l,null,h,r)),be(p.enableCanvas,s,this.htmlObject,p.redraw,!0,"x","y",null,c,!0))},e.prototype.findParentNode=function(e,t,i){return document.getElementById(e+"AxisGroup"+i+"Inside").contains(document.getElementById(t.id))?document.getElementById(e+"AxisGroup"+i+"Inside"):document.getElementById(e+"AxisGroup"+i+"Outside")},e.prototype.createZoomingLabel=function(e,t,i,r,o){var n=this.findParentNode(e.element.id,t,r);t.setAttribute("opacity","0.3");var a=e.renderer.createGroup({id:e.element.id+"AxisLabels_Zoom"+r});a=V(e,i,a,r,"Vertical"===i.orientation,o),n.replaceChild(t,document.getElementById(t.id)),he(e.element.id+"AxisLabels_Zoom"+r)?n.replaceChild(a,document.getElementById(a.id)):n.appendChild(a)},e}(),Zi=function(){function e(e){this.currentPoints=[],this.previousPoints=[],this.insideRegion=!1,this.chart=e,this.lierIndex=0}return e.prototype.getData=function(){for(var e,t,i,r,o=this.chart,n=null,a=null,s=o.visibleSeries.length-1;s>=0;s--){if(a=o.visibleSeries[s],e="Scatter"===a.type||"Scatter"===a.drawType||a.marker.visible?(a.marker.height+5)/2:0,t="Scatter"===a.type||"Scatter"===a.drawType||a.marker.visible?(a.marker.width+5)/2:0,i=o.mouseX,r=o.mouseY,a.dragSettings.enable&&a.isRectSeries)if("Bar"===a.type&&o.isTransposed||!o.isTransposed&&"Bar"!==a.type){var l=a.marker.height/2;r=a.yAxis.isInversed?r-l:r+l}else{var h=a.marker.width/2;i=a.yAxis.isInversed?i+h:i-h}if(a.visible&&j(i,r,a.clipRect,e,t)&&(n=this.getRectPoint(a,a.clipRect,i,r)),n)return new Yi(n,a)}return new Yi(n,a)},e.prototype.isSelected=function(e){return(e.selectionMode.indexOf("Drag")>-1||e.selectionMode.indexOf("Lasso")>-1)&&e.selectionModule&&null!==e.selectionModule.rectPoints},e.prototype.getRectPoint=function(e,t,i,r){var o,n,a,s,l,h,c=0;if(this.chart.isScrolling)return null;for(var d=0,p=e.points;d<p.length;d++){var u=p[d];if(u.regionData||u.regions&&u.regions.length){if(u.regionData&&"PolarRadar"===this.chart.chartAreaType&&e.drawType.indexOf("Column")>-1&&(o=i-(e.clipRect.width/2+e.clipRect.x),n=r-(e.clipRect.height/2+e.clipRect.y),c=2*Math.PI*(u.regionData.currentXPosition<0?1+u.regionData.currentXPosition:u.regionData.currentXPosition),a=(Math.atan2(n,o)+.5*Math.PI-c)%(2*Math.PI),a=a<0?2*Math.PI+a:a,a+=2*Math.PI*e.chart.primaryXAxis.startAngle,s=u.regionData.startAngle,s-=c,s=s<0?2*Math.PI+s:s,l=u.regionData.endAngle,l-=c,l=l<0?2*Math.PI+l:l,h=Math.sqrt(Math.pow(Math.abs(o),2)+Math.pow(Math.abs(n),2)),a>=s&&a<=l&&(h>=u.regionData.innerRadius&&h<=u.regionData.radius||h<=u.regionData.innerRadius&&h>=u.regionData.radius)&&h<=e.chart.radius))return u;if((e.dragSettings.enable&&e.isRectSeries||e.isRectSeries&&e.marker.visible)&&this.isPointInThresholdRegion(i,r,u,t,e))return this.insideRegion=!0,u;if(!this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,r))return u;if(this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,r))return u}}return null},e.prototype.checkRegionContainsPoint=function(e,t,r,o){var n=this;return e.some(function(e,a){return n.lierIndex=a,j(r,o,new i.Rect(("Cartesian"===n.chart.chartAreaType?t.x:0)+e.x,("Cartesian"===n.chart.chartAreaType?t.y:0)+e.y,e.width,e.height))})},e.prototype.isPointInThresholdRegion=function(e,t,r,o,n){var a,s=this,l="Bar"===n.type,h=n.yAxis.isInversed,c=n.chart.isTransposed,d=0,p=0,u=a=20;return h&&c?l?(d=r.regions[0].height-10,a=r.regions[0].width):(p=-10,u=r.regions[0].height):h||r.yValue<0?l?(p=-10,u=r.regions[0].height):(d=r.regions[0].height-10,a=r.regions[0].width):c?l?(d=-10,a=r.regions[0].width):(p=r.regions[0].width-10,u=r.regions[0].height):l?(p=r.regions[0].width-10,u=r.regions[0].height):(d=-10,a=r.regions[0].width),r.regions.some(function(r){return j(e,t,new i.Rect(("Cartesian"===s.chart.chartAreaType?o.x:0)+r.x+p,("Cartesian"===s.chart.chartAreaType?o.y:0)+r.y+d,a,u))})},e.prototype.getClosest=function(e,t,i){var r,o,n=i||e.xData;if(t>=e.xMin-.5&&t<=e.xMax+.5)for(var a=0;a<n.length;a++)o=n[a],(null==r||Math.abs(o-t)<Math.abs(r-t))&&(r=o);return-1!==e.xData.indexOf(r)?r:null},e.prototype.getClosestX=function(e,t,i){var r,o=t.clipRect;r=e.requireInvertedAxis?X(e.mouseY-o.y,o.height,t.xAxis):H(e.mouseX-o.x,o.width,t.xAxis);for(var n=this.getClosest(t,r,i),a=0,s=t.points;a<s.length;a++){var l=s[a];if(n===l.xValue&&l.visible)return new Yi(l,t)}return null},e.prototype.mergeXvalues=function(e){for(var t=[],i=0;i<e.length;i++)t=t.concat(e[i].xData);return t.filter(function(e,i){return i===t.indexOf(e)})},e}(),qi=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qi=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},$i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property(!0)],i.prototype,"showZero",void 0),Qi([t.Property(null)],i.prototype,"name",void 0),Qi([t.Property("transparent")],i.prototype,"fill",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Property(0)],i.prototype,"angle",void 0),Qi([t.Property(!1)],i.prototype,"enableRotation",void 0),Qi([t.Property("Auto")],i.prototype,"position",void 0),Qi([t.Property(5)],i.prototype,"rx",void 0),Qi([t.Property(5)],i.prototype,"ry",void 0),Qi([t.Property("Center")],i.prototype,"alignment",void 0),Qi([t.Complex({width:null,color:null},Yt)],i.prototype,"border",void 0),Qi([t.Complex({left:5,right:5,top:5,bottom:5},Ut)],i.prototype,"margin",void 0),Qi([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Xt)],i.prototype,"font",void 0),Qi([t.Property(null)],i.prototype,"template",void 0),Qi([t.Property("Hide")],i.prototype,"labelIntersectAction",void 0),i}(t.ChildProperty),Ji=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property("Circle")],i.prototype,"shape",void 0),Qi([t.Property("")],i.prototype,"imageUrl",void 0),Qi([t.Property(5)],i.prototype,"height",void 0),Qi([t.Property(5)],i.prototype,"width",void 0),Qi([t.Complex({width:2,color:null},Yt)],i.prototype,"border",void 0),Qi([t.Complex({x:0,y:0},Gt)],i.prototype,"offset",void 0),Qi([t.Property(null)],i.prototype,"fill",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Complex({},$i)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),Ki=function(){function e(){this.symbolLocations=null,this.regions=null,this.percentage=null,this.regionData=null,this.isSelect=!1,this.marker={visible:!1},this.isPointInRange=!0}return e}(),er=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return qi(r,e),r.prototype.setDataSource=function(e,t){e&&(this.points=e.points),t.trendLineModule.initDataSource(this),t.visibleSeriesCount++},Qi([t.Property("")],r.prototype,"name",void 0),Qi([t.Property("0")],r.prototype,"dashArray",void 0),Qi([t.Property(!0)],r.prototype,"visible",void 0),Qi([t.Property("Linear")],r.prototype,"type",void 0),Qi([t.Property(2)],r.prototype,"period",void 0),Qi([t.Property(2)],r.prototype,"polynomialOrder",void 0),Qi([t.Property(0)],r.prototype,"backwardForecast",void 0),Qi([t.Property(0)],r.prototype,"forwardForecast",void 0),Qi([t.Complex({},qt)],r.prototype,"animation",void 0),Qi([t.Complex({},Ji)],r.prototype,"marker",void 0),Qi([t.Property(!0)],r.prototype,"enableTooltip",void 0),Qi([t.Property(null)],r.prototype,"intercept",void 0),Qi([t.Property("")],r.prototype,"fill",void 0),Qi([t.Property(1)],r.prototype,"width",void 0),Qi([t.Property("SeriesType")],r.prototype,"legendShape",void 0),r}(t.ChildProperty),tr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(1)],i.prototype,"width",void 0),Qi([t.Property(10)],i.prototype,"length",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ir=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(null)],i.prototype,"value",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property("0")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),rr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property("Fixed")],i.prototype,"type",void 0),Qi([t.Property("Both")],i.prototype,"direction",void 0),Qi([t.Property("Vertical")],i.prototype,"mode",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property(1)],i.prototype,"verticalError",void 0),Qi([t.Property(1)],i.prototype,"width",void 0),Qi([t.Property(1)],i.prototype,"horizontalError",void 0),Qi([t.Property(3)],i.prototype,"verticalPositiveError",void 0),Qi([t.Property(3)],i.prototype,"verticalNegativeError",void 0),Qi([t.Property(1)],i.prototype,"horizontalPositiveError",void 0),Qi([t.Property(1)],i.prototype,"horizontalNegativeError",void 0),Qi([t.Complex(null,tr)],i.prototype,"errorBarCap",void 0),i}(t.ChildProperty),or=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.currentViewData=[],t.clipRect=new i.Rect(0,0,0,0),t.seriesType="XY",t.isRectTypeSeries=!1,t}return qi(o,e),o.prototype.processJsonData=function(){var e=0,i=new Ki,o=this instanceof nr&&"Histogram"===this.type?"x":this.xName,n=this instanceof nr&&this.marker.dataLabel.name?this.marker.dataLabel.name:"";this instanceof nr&&("Waterfall"!==this.type&&"Histogram"!==this.type||(this.currentViewData=this.chart[G(this.type)+"SeriesModule"].processInternalData(t.extend([],this.currentViewData,null,!0),this)),"Pareto"===this.category&&(this.currentViewData=p(t.extend([],this.currentViewData,null,!0),[this.yName],!0),"Line"===this.type&&(this.currentViewData=this.chart.paretoSeriesModule.performCumulativeCalculation(this.currentViewData,this))),this.isRectTypeSeries=this.type.indexOf("Column")>-1||this.type.indexOf("Bar")>-1||this.type.indexOf("Histogram")>-1);var a=Object.keys(this.currentViewData).length;if(this.points=[],this.xMin=1/0,this.xMax=-1/0,this.yMin=1/0,this.yMax=-1/0,this.sizeMax=-1/0,this.getSeriesType(),"Category"===this.xAxis.valueType)for(;e<a;)i=this.dataPoint(e,n,o),this.pushCategoryData(i,e,i.x),this.pushData(i,e),this.setEmptyPoint(i,e),e++;else if(this.xAxis.valueType.indexOf("DateTime")>-1)for(var s={skeleton:"full",type:"dateTime"},l=this.chart.intl.getDateParser(s),h=this.chart.intl.getDateFormat(s);e<a;)i=this.dataPoint(e,n,o),t.isNullOrUndefined(i.x)||""===i.x?i.visible=!1:(i.x=new Date(r.DataUtil.parse.parseJson({val:i.x}).val),"DateTime"===this.xAxis.valueType?i.xValue=Date.parse(i.x.toString()):this.chart.isBlazor?this.pushCategoryData(i,e,Date.parse(i.x.toString()).toString()):this.pushCategoryData(i,e,Date.parse(l(h(i.x))).toString()),this.pushData(i,e),this.setEmptyPoint(i,e)),e++;else for(;e<a;)(i=this.dataPoint(e,n,o)).xValue=i.x,this.pushData(i,e),this.setEmptyPoint(i,e),e++;if(this instanceof nr)if(this.type.indexOf("Spline")>-1||this.drawType.indexOf("Spline")>-1&&"PolarRadar"===this.chart.chartAreaType){var c=this.type.indexOf("Area")>-1||this.drawType.indexOf("Area")>-1,d=this.type.indexOf("Range")>-1;this.chart["spline"+(c?d?"RangeArea":"Area":"")+"SeriesModule"].findSplinePoint(this)}else this.type.indexOf("Histogram")>-1&&(this.xAxis.maximum||this.xAxis.minimum)&&this.chart.histogramSeriesModule.calculateBinValues(this)},o.prototype.pushData=function(e,t){e.index=t,e.yValue=e.y,this.xMin=Math.min(this.xMin,e.xValue),this.xMax=Math.max(this.xMax,e.xValue),this.xData.push(e.xValue)},o.prototype.dataPoint=function(e,i,r){this.points[e]=new Ki;var o=this.points[e],n=this.currentViewData,a=this.enableComplexProperty?t.getValue:this.getObjectValue;return o.x=a(r,n[e]),o.high=a(this.high,n[e]),o.low=a(this.low,n[e]),o.open=a(this.open,n[e]),o.close=a(this.close,n[e]),o.volume=a(this.volume,n[e]),o.interior=a(this.pointColorMapping,n[e]),this instanceof nr&&(o.y=a(this.yName,n[e]),o.size=a(this.size,n[e]),o.text=a(i,n[e]),o.tooltip=a(this.tooltipMappingName,n[e]),this.chart.rangeColorSettings&&this.chart.rangeColorSettings.length>0&&this.isAdvancedColorSupported()&&(this.colorName&&this.colorName.length>0?o.colorValue=a(this.colorName,n[e]):o.colorValue=a(this.yName,n[e]),o.interior=this.getPointFillColor(o.interior,o.colorValue))),o},o.prototype.isAdvancedColorSupported=function(){return 1===this.chart.visibleSeries.length&&("Column"===this.chart.series[0].type||"Bar"===this.chart.series[0].type||"Scatter"===this.chart.series[0].type||"Bubble"===this.chart.series[0].type)},o.prototype.getPointFillColor=function(e,t){var i=e;if(t&&this.chart.rangeColorSettings&&this.chart.rangeColorSettings.length>0)for(var r=0,o=this.chart.rangeColorSettings;r<o.length;r++){var n=o[r];t>=n.start&&t<=n.end&&(i=n.colors.length>1?Ze(n,t):n.colors[0])}return i},o.prototype.getObjectValue=function(e,t){return t[e]},o.prototype.setEmptyPoint=function(e,i){if(!this.findVisibility(e))return e.visible=!0,null;switch(e.isEmpty=!0,this instanceof nr&&e.isPointInRange?this.emptyPointSettings.mode:"Drop"){case"Zero":e.visible=!0,this instanceof nr&&this.seriesType.indexOf("HighLow")>-1?(e.high=e.low=0,this.seriesType.indexOf("HighLowOpenClose")>-1&&(e.open=e.close=0)):e.y=e.yValue=this.yData[i]=0;break;case"Average":this instanceof nr&&(this.seriesType.indexOf("HighLow")>-1?(e.high=t.isNullOrUndefined(e.high)||isNaN(+e.high)?this.getAverage(this.high,i):e.high,e.low=t.isNullOrUndefined(e.low)||isNaN(+e.low)?this.getAverage(this.low,i):e.low,this.seriesType.indexOf("HighLowOpenClose")>-1&&(e.open=t.isNullOrUndefined(e.open)||isNaN(+e.open)?this.getAverage(this.open,i):e.open,e.close=t.isNullOrUndefined(e.close)||isNaN(+e.close)?this.getAverage(this.close,i):e.close)):e.y=e.yValue=this.yData[i]=this.getAverage(this.yName,i)),e.visible=!0;break;case"Drop":case"Gap":this.yData[i]=null,e.visible=!1}},o.prototype.findVisibility=function(e){var i,r=this instanceof nr?this.seriesType:"HighLowOpenClose",o=this.yAxis.minimum,n=this.yAxis.maximum;switch(r){case"XY":return"PolarRadar"===this.chart.chartAreaType&&(!t.isNullOrUndefined(o)&&e.yValue<o||!t.isNullOrUndefined(n)&&e.yValue>n)?(e.isPointInRange=!1,!0):(this.setXYMinMax(e.yValue),this.yData.push(e.yValue),this instanceof nr&&"Bubble"===this.type&&(this.sizeMax=Math.max(this.sizeMax,t.isNullOrUndefined(e.size)||isNaN(+e.size)?this.sizeMax:e.size)),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.y)||isNaN(+e.y));case"HighLow":return this.setHiloMinMax(e.high,e.low),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.low)||isNaN(+e.low)||t.isNullOrUndefined(e.high)||isNaN(+e.high);case"HighLowOpenClose":return this.setHiloMinMax(e.high,e.low),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.low)||isNaN(+e.low)||t.isNullOrUndefined(e.open)||isNaN(+e.open)||t.isNullOrUndefined(e.close)||isNaN(+e.close)||t.isNullOrUndefined(e.high)||isNaN(+e.high);case"BoxPlot":return i=(e.y||[null]).filter(function(e){return!t.isNullOrUndefined(e)&&!isNaN(e)}).sort(function(e,t){return e-t}),e.y=i,this.yMin=Math.min(this.yMin,Math.min.apply(Math,i)),this.yMax=Math.max(this.yMax,Math.max.apply(Math,i)),!i.length}},o.prototype.setXYMinMax=function(e){var i,r="Logarithmic"===this.yAxis.valueType||"Logarithmic"===this.xAxis.valueType,o=e<0;i=this.isRectTypeSeries&&!te(this.yAxis)?r?e:o?e:0:e,this.yMin=r?Math.min(this.yMin,t.isNullOrUndefined(i)||isNaN(i)||0===i?this.yMin:i):Math.min(this.yMin,t.isNullOrUndefined(i)||isNaN(i)?this.yMin:i),this.yMax=Math.max(this.yMax,t.isNullOrUndefined(e)||isNaN(e)?this.yMax:e)},o.prototype.setHiloMinMax=function(e,i){this.yMin=Math.min(this.yMin,Math.min(t.isNullOrUndefined(i)||isNaN(i)?this.yMin:i,t.isNullOrUndefined(e)||isNaN(e)?this.yMin:e)),this.yMax=Math.max(this.yMax,Math.max(t.isNullOrUndefined(i)||isNaN(i)?this.yMax:i,t.isNullOrUndefined(e)||isNaN(e)?this.yMax:e))},o.prototype.getSeriesType=function(){var e;if(this instanceof nr){var t="PolarRadar"===this.chart.chartAreaType?this.drawType:this.type;if(t)switch(t){case"RangeColumn":case"RangeArea":case"SplineRangeArea":case"Hilo":e="HighLow";break;case"HiloOpenClose":case"Candle":e="HighLowOpenClose";break;case"BoxAndWhisker":e="BoxPlot";break;default:e="XY"}}this.seriesType=e},o.prototype.pushCategoryData=function(e,t,i){if(!this.chart.tooltip.shared&&!this.visible)return null;this.xAxis.isIndexed?(this.xAxis.labels[t]?this.xAxis.labels[t]+=", "+i:this.xAxis.labels.push(i),e.xValue=t):(this.xAxis.labels.indexOf(i)<0&&this.xAxis.labels.push(i),e.xValue=this.xAxis.labels.indexOf(i))},o.prototype.getAverage=function(e,t,i){return void 0===i&&(i=this.currentViewData),((i[t-1]?i[t-1][e]||0:0)+(i[t+1]?i[t+1][e]||0:0))/2},o.prototype.refreshDataManager=function(e){var i=this;this.chart=e;var o;if(!((o=e.isAngular?Object.keys(this.dataSource).length?this.dataSource:e.dataSource:this.dataSource||e.dataSource)instanceof r.DataManager)&&t.isNullOrUndefined(this.query))return void this.dataManagerSuccess({result:o,count:o.length},!1);this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return i.dataManagerSuccess(e)})},o.prototype.dataManagerSuccess=function(e,t){if(void 0===t&&(t=!0),this.currentViewData=e.count?e.result:[],this.chart.allowServerDataBinding=!1,this instanceof nr){this.chart.stockChart&&(this.chart.stockChart.series[this.index].localData=this.currentViewData);var i={name:"seriesRender",series:this,data:this.currentViewData,fill:this.interior};this.chart.trigger("seriesRender",i),this.interior=i.fill,this.currentViewData=i.data}!this.chart.stockChart||this instanceof nr||(this.currentViewData=this.chart.stockChart.findCurrentData(this.chart.stockChart.series[0].localData,this.chart.stockChart.series[0].xName)),this.processJsonData(),this.recordsCount=e.count,this.refreshChart(t),this.currentViewData=null},o.prototype.refreshChart=function(e){var t=this.chart;if(this instanceof nr&&(t.visibleSeriesCount+=e?1:0),t.refreshTechnicalIndicator(this),this instanceof nr&&"TrendLine"!==this.category)for(var i=0,r=this.trendlines;i<r.length;i++)r[i].setDataSource(this,t);t.visibleSeries.length===t.visibleSeriesCount&&(t.refreshBound(),t.trigger("loaded",{chart:t.isBlazor?{}:t}),this.chart.stockChart&&this.chart.stockChart.initialRender&&(this.chart.stockChart.initialRender=!1,this.chart.stockChart.stockChartDataManagerSuccess())),this instanceof nr&&(t.visibleSeriesCount+=e?0:1)},Qi([t.Property("")],o.prototype,"xName",void 0),Qi([t.Property("")],o.prototype,"colorName",void 0),Qi([t.Property("")],o.prototype,"high",void 0),Qi([t.Property("")],o.prototype,"low",void 0),Qi([t.Property("")],o.prototype,"open",void 0),Qi([t.Property("")],o.prototype,"close",void 0),Qi([t.Property("")],o.prototype,"volume",void 0),Qi([t.Property("")],o.prototype,"pointColorMapping",void 0),Qi([t.Property(!0)],o.prototype,"visible",void 0),Qi([t.Property(null)],o.prototype,"xAxisName",void 0),Qi([t.Property(null)],o.prototype,"yAxisName",void 0),Qi([t.Complex(null,qt)],o.prototype,"animation",void 0),Qi([t.Property(null)],o.prototype,"fill",void 0),Qi([t.Property(1)],o.prototype,"width",void 0),Qi([t.Property("0")],o.prototype,"dashArray",void 0),Qi([t.Property("")],o.prototype,"dataSource",void 0),Qi([t.Property()],o.prototype,"query",void 0),Qi([t.Collection([],ir)],o.prototype,"segments",void 0),Qi([t.Property("X")],o.prototype,"segmentAxis",void 0),Qi([t.Property(!1)],o.prototype,"enableComplexProperty",void 0),o}(t.ChildProperty),nr=function(e){function i(t,i,r,o){var n=e.call(this,t,i,r,o)||this;return n.visibleSeriesCount=0,n.category="Series",n.isRectSeries=!1,n.drawPoints=[],n.lowDrawPoints=[],n.delayedAnimation=!1,n}return qi(i,e),i.prototype.refreshAxisLabel=function(){if("Category"!==this.xAxis.valueType)return null;this.xAxis.labels=[];for(var e=0,t=this.xAxis.series;e<t.length;e++){var i=t[e];if(i.visible&&"TrendLine"!==i.category){i.xMin=1/0,i.xMax=-1/0;for(var r=0,o=i.points;r<o.length;r++){var n=o[r];i.pushCategoryData(n,n.index,n.x),i.xMin=Math.min(i.xMin,n.xValue),i.xMax=Math.max(i.xMax,n.xValue)}}}},i.prototype.findSeriesCollection=function(e,t,i){for(var r=[],o=0,n=t.axes;o<n.length;o++)for(var a=0,s=n[o].series;a<s.length;a++)for(var l=s[a],h=0,c=e.axes;h<c.length;h++)for(var d=0,p=c[h].series;d<p.length;d++){var u=p[d];u===l&&u.visible&&this.rectSeriesInChart(u,i)&&r.push(u)}return r},i.prototype.rectSeriesInChart=function(e,t){var i=e.type.toLowerCase();return-1!==i.indexOf("column")||-1!==i.indexOf("bar")||-1!==i.indexOf("histogram")||-1!==i.indexOf("hiloopenclose")||-1!==i.indexOf("candle")||-1!==i.indexOf("pareto")||-1!==i.indexOf("hilo")||-1!==e.drawType.indexOf("Column")||-1!==i.indexOf("waterfall")||-1!==i.indexOf("boxandwhisker")||t},i.prototype.calculateStackedValue=function(e,t){for(var i=0,r=t.columns;i<r.length;i++)for(var o=r[i],n=0,a=t.rows;n<a.length;n++){var s=a[n];this.calculateStackingValues(this.findSeriesCollection(o,s,!0),e)}},i.prototype.calculateStackingValues=function(e,t){var i,r,o,n,a,s=[],l=[],h=[],c=[];t&&(c=this.findFrequencies(e));for(var d=[],p=[],u=[],y=0,m=e;y<m.length;y++){var v=m[y];if(-1!==v.type.indexOf("Stacking")||-1!==v.drawType.indexOf("Stacking")&&"PolarRadar"===v.chart.chartAreaType){l[o=-1!==v.type.indexOf("StackingArea")?"StackingArea100":-1!==v.type.indexOf("StackingLine")?"StackingLine100":v.stackingGroup]||(l[o]=[],h[o]=[]),s=v.yData,i=[],r=[],d.push(v);for(var f=0,b=(u=g(v)).length;f<b;f++)n=0,a=+s[f],void 0===l[o][u[f].xValue]&&(l[o][u[f].xValue]=0),void 0===h[o][u[f].xValue]&&(h[o][u[f].xValue]=0),t?(a=a/c[o][u[f].xValue]*100,a=isNaN(a)?0:a,u[f].percentage=+a.toFixed(2)):p[f]=p[f]?p[f]+Math.abs(a):Math.abs(a),a>=0?(n=l[o][u[f].xValue],l[o][u[f].xValue]+=a):(n=h[o][u[f].xValue],h[o][u[f].xValue]+=a),i.push(n),r.push(a+n),t&&r[f]>100&&(r[f]=100);v.stackedValues=new zi(i,r);var x="Logarithmic"===v.yAxis.valueType,w=-1!==v.type.indexOf("Column")||-1!==v.type.indexOf("Bar");v.yMin=x&&w&&v.yMin<1?v.yMin:Math.min.apply(0,i),v.yMax=Math.max.apply(0,r),v.yMin>Math.min.apply(0,r)&&(v.yMin=t?-100:x&&w&&v.yMin<1?v.yMin:Math.min.apply(0,r)),v.yMax<Math.max.apply(0,i)&&(v.yMax=0)}}this.findPercentageOfStacking(d,p,t)},i.prototype.findPercentageOfStacking=function(e,t,i){for(var r=0,o=e;r<o.length;r++){var n=o[r];if(i)return null;for(var a=0,s=g(n);a<s.length;a++){var l=s[a];l.percentage=Math.abs(+(l.y/t[l.index]*100).toFixed(2))}}},i.prototype.findFrequencies=function(e){for(var t,i=[],r=[],o=0,n=e;o<n.length;o++){var a=n[o];if(a.yAxis.isStack100=-1!==a.type.indexOf("100"),r=g(a),-1!==a.type.indexOf("Stacking")){i[t=-1!==a.type.indexOf("StackingArea")?"StackingArea100":-1!==a.type.indexOf("StackingLine")?"StackingLine100":a.stackingGroup]||(i[t]=[]);for(var s=0,l=r.length;s<l;s++)void 0===i[t][r[s].xValue]&&(i[t][r[s].xValue]=0),a.yData[s]>0?i[t][r[s].xValue]+=a.yData[s]:i[t][r[s].xValue]-=a.yData[s]}}return i},i.prototype.renderSeries=function(e){var t=G(this.type);e[(t=t.replace("100",""))+"SeriesModule"]&&("Indicator"!==this.category&&"TrendLine"!==this.category&&this.createSeriesElements(e),this.visiblePoints=g(this),e[t+"SeriesModule"].render(this,this.xAxis,this.yAxis,e.requireInvertedAxis),"Indicator"!==this.category&&(this.errorBar.visible&&this.chart.errorBarModule.render(this),this.marker.dataLabel.visible&&e.dataLabelModule.render(this,this.chart,this.marker.dataLabel),this.appendSeriesElement(e.seriesElements,e)),this.chart.enableCanvas||this.performAnimation(e,t,this.errorBar,this.marker,this.marker.dataLabel))},i.prototype.createSeriesElements=function(e){if("Indicator"!==this.category){var t=e.element.id,i=this.marker.border.width+8+5,r="Scatter"===this.type||"Bubble"===this.type?e.svgRenderer:e.renderer,o=void 0===this.index?this.category:this.index,n=void 0,a=void 0,s=void 0;if("Scatter"===this.type?(n=e.primaryYAxis.maximum||e.primaryXAxis.maximum?0:(this.marker.height+i)/2,a=e.primaryYAxis.maximum||e.primaryXAxis.maximum?0:(this.marker.width+i)/2):(n=0,a=0),"PolarRadar"===e.chartAreaType){var l="Scatter"===this.drawType?Math.max(this.marker.width,this.marker.height):0;s=new Fi(t+"_ChartSeriesClipRect_"+o,"transparent",{width:1,color:"Gray"},1,this.clipRect.width/2+this.clipRect.x,this.clipRect.height/2+this.clipRect.y,e.radius+l),this.clipRectElement=K(e.redraw,s,r,"drawCircularClipPath")}else s=new Di(t+"_ChartSeriesClipRect_"+o,"transparent",{width:1,color:"Gray"},1,{x:-a,y:-n,width:this.clipRect.width+2*a,height:this.clipRect.height+2*n}),this.clipRectElement=K(e.redraw,s,r);var h="Cartesian"===e.chartAreaType?"translate("+this.clipRect.x+","+this.clipRect.y+")":"";this.symbolElement=null,this.seriesElement=r.createGroup({id:t+"SeriesGroup"+o,transform:h,"clip-path":"url(#"+t+"_ChartSeriesClipRect_"+o+")"}),this.chart.enableCanvas&&"Scatter"!==this.type&&"Bubble"!==this.type||this.seriesElement.appendChild(this.clipRectElement)}},i.prototype.appendSeriesElement=function(e,t){var i=this.marker,r=i.dataLabel,o=t.redraw;"TrendLine"!==this.category&&(be(t.enableCanvas,t.seriesElements,this.seriesElement,o),this.errorBar.visible&&("PolarRadar"===t.chartAreaType?be(t.enableCanvas,t.seriesElements,this.seriesElement,o):be(t.enableCanvas,t.seriesElements,this.errorBarElement,o)),"Scatter"!==this.type&&"Bubble"!==this.type||be(!1,t.seriesElements,this.seriesElement,o)),i.visible&&("Cartesian"===t.chartAreaType||"Scatter"!==this.drawType&&"PolarRadar"===t.chartAreaType)&&"Scatter"!==this.type&&"Bubble"!==this.type&&"Candle"!==this.type&&"Hilo"!==this.type&&"HiloOpenClose"!==this.type&&this.symbolElement&&be(t.enableCanvas,t.seriesElements,this.symbolElement,o),r.visible&&this.textElement&&(be(t.enableCanvas,t.dataLabelElements,this.shapeElement,o),be(t.enableCanvas,t.dataLabelElements,this.textElement,o)),!t.enableCanvas&&t.dataLabelElements.hasChildNodes()&&t.seriesElements.appendChild(t.dataLabelElements)},i.prototype.performAnimation=function(e,i,r,o,n){this.animation.enable&&e.animateSeries&&(e[i+"SeriesModule"].doAnimation(this),r.visible&&e.errorBarModule.doErrorBarAnimation(this),o.visible&&e.markerRender.doMarkerAnimation(this),n.visible&&"edge"!==t.Browser.info.name&&!t.Browser.isIE&&e.dataLabelModule.doDataLabelAnimation(this))},i.prototype.setPointColor=function(e,t){return t=e.interior||t,e.isEmpty?this.emptyPointSettings.fill||t:t},i.prototype.setBorderColor=function(e,t){return t.width=e.isEmpty?this.emptyPointSettings.border.width||t.width:t.width,t.color=e.isEmpty?this.emptyPointSettings.border.color||t.color:t.color,t},Qi([t.Property("")],i.prototype,"name",void 0),Qi([t.Property("")],i.prototype,"yName",void 0),Qi([t.Property("Line")],i.prototype,"drawType",void 0),Qi([t.Property(!0)],i.prototype,"isClosed",void 0),Qi([t.Property("#2ecd71")],i.prototype,"bearFillColor",void 0),Qi([t.Property("#e74c3d")],i.prototype,"bullFillColor",void 0),Qi([t.Property(!1)],i.prototype,"enableSolidCandles",void 0),Qi([t.Property("")],i.prototype,"size",void 0),Qi([t.Property(null)],i.prototype,"binInterval",void 0),Qi([t.Property(!1)],i.prototype,"showNormalDistribution",void 0),Qi([t.Property("")],i.prototype,"stackingGroup",void 0),Qi([t.Complex({color:"transparent",width:0},Yt)],i.prototype,"border",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Property(0)],i.prototype,"zOrder",void 0),Qi([t.Property("Line")],i.prototype,"type",void 0),Qi([t.Complex(null,rr)],i.prototype,"errorBar",void 0),Qi([t.Complex(null,Ji)],i.prototype,"marker",void 0),Qi([t.Complex({},ei)],i.prototype,"dragSettings",void 0),Qi([t.Collection([],er)],i.prototype,"trendlines",void 0),Qi([t.Property(!0)],i.prototype,"enableTooltip",void 0),Qi([t.Property("")],i.prototype,"tooltipFormat",void 0),Qi([t.Property("")],i.prototype,"tooltipMappingName",void 0),Qi([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Qi([t.Property("")],i.prototype,"legendImageUrl",void 0),Qi([t.Property(null)],i.prototype,"selectionStyle",void 0),Qi([t.Property(null)],i.prototype,"unSelectedStyle",void 0),Qi([t.Property(null)],i.prototype,"nonHighlightStyle",void 0),Qi([t.Property(1)],i.prototype,"minRadius",void 0),Qi([t.Property(3)],i.prototype,"maxRadius",void 0),Qi([t.Property("Natural")],i.prototype,"splineType",void 0),Qi([t.Property(.5)],i.prototype,"cardinalSplineTension",void 0),Qi([t.Complex(null,Kt)],i.prototype,"emptyPointSettings",void 0),Qi([t.Property(!0)],i.prototype,"showMean",void 0),Qi([t.Property("Normal")],i.prototype,"boxPlotMode",void 0),Qi([t.Property(null)],i.prototype,"columnWidth",void 0),Qi([t.Property(0)],i.prototype,"columnSpacing",void 0),Qi([t.Property("#C64E4A")],i.prototype,"negativeFillColor",void 0),Qi([t.Property("#4E81BC")],i.prototype,"summaryFillColor",void 0),Qi([t.Property()],i.prototype,"intermediateSumIndexes",void 0),Qi([t.Property()],i.prototype,"sumIndexes",void 0),Qi([t.Complex({color:"black",width:2},Ht)],i.prototype,"connector",void 0),Qi([t.Complex(null,$t)],i.prototype,"cornerRadius",void 0),i}(or),ar=function(){function e(e,t){this.initDataManager(e,t)}return e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof r.DataManager?e:new r.DataManager(e),this.query=t instanceof r.Query?t:new r.Query},e.prototype.generateQuery=function(){return this.query.clone()},e.prototype.getData=function(e){var t=this;if(this.dataManager.ready){var i=new r.Deferred;return this.dataManager.ready.then(function(){t.dataManager.executeQuery(e).then(function(e){i.resolve(e)})}).catch(function(e){i.reject(e)}),i.promise}return this.dataManager.executeQuery(e)},e}(),sr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lr=function(e){function r(t){var i=e.call(this,t)||this;return i.elementId=t.element.id,i}return sr(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.chart.off(t.Browser.touchEndEvent,this.mouseUpHandler))},r.prototype.mouseUpHandler=function(){var e=this.chart;!e.isTouch||e.crosshair.enable||this.isSelected(e)||this.markerMove(!0)},r.prototype.mouseMoveHandler=function(){var e=this.chart;e.crosshair.enable&&!e.tooltip.enable||e.isTouch&&!e.startMove||this.isSelected(e)||this.markerMove(!1)},r.prototype.markerMove=function(e){var i=this,r=this.chart;this.currentPoints=[];var o,n,a,s;if(r.tooltip.shared&&r.tooltip.enable){if(!j(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect))return null;if(r.tooltip.enable)for(var l="PolarRadar"===r.chartAreaType?this.getData():null,h=this.mergeXvalues(this.chart.visibleSeries),c=0,d=r.visibleSeries;c<d.length;c++){var p=d[c];p.enableTooltip&&"Indicator"!==p.category&&("Cartesian"===r.chartAreaType&&p.visible?o=this.getClosestX(r,p,h):"PolarRadar"===r.chartAreaType&&p.visible&&null!==l.point&&(o=new Yi(p.points[l.point.index],p)),o&&(this.currentPoints.push(o),o=null))}}else o=this.getData(),s=o.series,n=this.previousPoints[0],a=s&&("Bubble"===s.type||"Scatter"===s.drawType||"Scatter"===s.type||"Candle"!==s.type&&"Hilo"!==s.type&&"HiloOpenClose"!==s.type&&s.marker.visible&&0!==s.marker.width&&0!==s.marker.height),o.lierIndex=this.lierIndex,o.point&&a&&(!n||n.point!==o.point||n&&n.lierIndex>3&&n.lierIndex!==this.lierIndex)&&this.currentPoints.push(o),o.point&&a&&r.isPointMouseDown&&this.currentPoints.push(o);var u=this.previousPoints.length;if(this.currentPoints.length>0&&(0===u||r.isPointMouseDown||u>0&&this.previousPoints[0].point!==this.currentPoints[0].point)){this.previousPoints.length>0&&this.removeHighlightedMarker();for(var g=this,y=0,m=this.currentPoints;y<m.length;y++)!function(e){(e&&e.point||"Candle"!==s.type&&"Hilo"!==s.type&&"HiloOpenClose"!==s.type)&&(Ce(g.markerExplode),g.isRemove=!0,e.point.symbolLocations.map(function(t,r){e.series.isRectSeries&&!e.point.marker.visible||i.drawTrackBall(e.series,e.point,t,r)}))}(m[y]);this.previousPoints=t.extend([],this.currentPoints,null,!0)}r.tooltip.enable||!(0===this.currentPoints.length&&this.isRemove||e&&this.isRemove)&&j(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect)||(this.isRemove=!1,this.markerExplode=+setTimeout(function(){i.removeHighlightedMarker()},2e3)),this.currentPoints=[]},r.prototype.drawTrackBall=function(e,r,o,n){var a=r.marker,s=e.marker,l=a.shape||s.shape;if("None"===l)return null;var h,c=e.symbolElement||e.seriesElement;this.chart.highlightModule&&"None"!==this.chart.highlightMode&&(h=this.chart.highlightModule.generateStyle(e)),this.chart.selectionModule&&"None"!==this.chart.selectionMode&&(h=this.chart.selectionModule.generateStyle(e));for(var d=this.elementId+"_Series_"+e.index+"_Point_"+r.index+"_Trackball"+(n||""),p=new i.Size((a.width||s.width)+5,(a.height||s.height)+5),u=a.border||e.border,g="BoxAndWhisker"===e.type||"Bubble"===e.type||"Scatter"===e.type,y=u.color&&"transparent"!==u.color?u.color:a.fill||r.interior||(g?r.color:e.interior),m=Te(_e(y)),v=a.border?a.border.width:s.border.width,f=e.chart.themeStyle.markerShadow||"rgba("+m.r+","+m.g+","+m.b+",0.2)",b=0;b<2;b++){var x=new i.PathOption(d+"_"+b,b?a.fill||r.color||(g?e.interior:"#ffffff"):"transparent",v+(b?0:8),b?y:f,a.opacity||s.opacity,null,null),w=ne(o,l,p,a.imageUrl,x,"",this.chart.svgRenderer,e.clipRect);w.setAttribute("class","EJ2-Trackball");var S=-1!==c.id.indexOf("Symbol")?"_Symbol":"",C=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+r.index+S);""===h||t.isNullOrUndefined(h)||t.isNullOrUndefined(C)||!C.hasAttribute("class")||h!==C.getAttribute("class")||w.classList.add(h),w.setAttribute("clip-path",c.getAttribute("clip-path")),w.setAttribute("transform",c.getAttribute("transform")),this.chart.svgObject.appendChild(w)}},r.prototype.removeHighlightedMarker=function(){for(var e=document.getElementsByClassName("EJ2-Trackball"),i=0,r=e.length;i<r;i++)t.remove(e[0]);this.previousPoints=[]},r}(Zi),hr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cr=function(e){function r(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return hr(r,e),r.prototype.render=function(e){var t=this,i=e.chart.redraw;this.createElement(e,i);for(var r=0,o=e.points;r<o.length;r++)!function(r){r.visible&&r.symbolLocations&&r.symbolLocations.length&&r.symbolLocations.map(function(o,n){"None"!==e.marker.shape&&t.renderMarker(e,r,o,n,i)})}(o[r])},r.prototype.renderMarker=function(e,r,o,n,a){var s,l,h,c,d=void 0===e.index?e.category:e.index,p=e.marker,u={color:p.border.color,width:p.border.width},g=p.border.color;o.x=o.x+p.offset.x,o.y=o.y-p.offset.y;var y,m="BoxAndWhisker"===e.type,v=p.fill||(m?r.interior||e.interior:"#ffffff"),f=m?me(e.seriesElement.childNodes,"Series_"+e.index+"_Point_"+r.index):e.symbolElement;u.color=g||e.setPointColor(r,e.interior);var b=this.elementId+"_Series_"+d+"_Point_"+r.index+"_Symbol"+(n||""),x={cancel:!1,name:"pointRender",series:e,point:r,fill:r.isEmpty?e.emptyPointSettings.fill||v:v,border:{color:"BoxAndWhisker"===e.type?t.isNullOrUndefined(g)||"transparent"===g?Oe(v,-.6):g:u.color,width:u.width},height:p.height,width:p.width,shape:p.shape};if(x.border=e.setBorderColor(r,{width:x.border.width,color:x.border.color}),e.isRectSeries&&"BoxAndWhisker"!==e.type||(this.chart.trigger("pointRender",x),r.color=x.fill),r.color=x.fill,x.cancel)o=null,r.marker={visible:!1};else{var w=void 0;w="RangeArea"===e.type||"RangeColumn"===e.type||"RangeColumn"===e.drawType||"SplineRangeArea"===e.type?n?r.low:r.high:m?r.outliers[n]:r.y;var S=x.point.marker.fill||x.fill,C=void 0;C=t.isNullOrUndefined(x.point.marker.border)?{color:x.border.color,width:x.border.width}:{color:x.point.marker.border.color||x.border.color,width:x.point.marker.border.width||x.border.width};var P=x.point.marker.width||x.width,L=x.point.marker.height||x.height,R=x.point.marker.opacity||p.opacity,M=x.point.marker.shape||x.shape,A=x.point.marker.imageUrl||p.imageUrl;c=new i.PathOption(b,S,C.width,C.color,R,null),(void 0!==f&&null!==f||this.chart.enableCanvas)&&(a&&he(c.id)&&(y=he(c.id),h="Circle"===M?"c":"",s={x:+y.getAttribute(h+"x"),y:+y.getAttribute(h+"y")},l=y.getAttribute("d")),y=ne(o,M,new i.Size(P,L),A,c,r.x.toString()+":"+w.toString(),this.chart.renderer,e.clipRect),be(this.chart.enableCanvas,f,y,a,!0,h+"x",h+"y",s,l,!1,!1,null,e.chart.duration)),r.marker={border:C,fill:S,height:L,visible:!0,shape:M,width:P,imageUrl:A}}},r.prototype.createElement=function(e,t){var i,r,o=e.marker,n=o.border.width+8+5,a=e.chart.svgRenderer,s=void 0===e.index?e.category:e.index,l="Cartesian"===e.chart.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"";if(o.visible){var h=(o.height+n)/2,c=(o.width+n)/2;i="Cartesian"===e.chart.chartAreaType?K(t,r=new Di(this.elementId+"_ChartMarkerClipRect_"+s,"transparent",{width:1,color:"Gray"},1,{x:-c,y:-h,width:e.clipRect.width+2*c,height:e.clipRect.height+2*h}),a):K(t,r=new Fi(this.elementId+"_ChartMarkerClipRect_"+s,"transparent",{width:1,color:"Gray"},1,e.clipRect.width/2+e.clipRect.x,e.clipRect.height/2+e.clipRect.y,e.chart.radius+Math.max(h,c)),a,"drawCircularClipPath"),r={id:this.elementId+"SymbolGroup"+s,transform:l,"clip-path":"url(#"+this.elementId+"_ChartMarkerClipRect_"+s+")"},e.symbolElement=a.createGroup(r),e.symbolElement.appendChild(i),this.chart.enableCanvas&&document.getElementById(this.chart.element.id+"_tooltip_svg").appendChild(e.symbolElement)}},r.prototype.getRangeLowPoint=function(e,t){var i=e.x,r=e.y;return t.chart.requireInvertedAxis?(r+=e.height/2,i+=t.yAxis.isInversed?e.width:0):(r+=t.yAxis.isInversed?0:e.height,i+=e.width/2),{x:i,y:r}},r.prototype.doMarkerAnimation=function(e){if("Scatter"!==e.type&&"Bubble"!==e.type&&"Candle"!==e.type&&"Hilo"!==e.type&&"HiloOpenClose"!==e.type&&("PolarRadar"!==e.chart.chartAreaType||"Scatter"!==e.drawType))for(var t=e.symbolElement.childNodes,i=e.animation.delay+e.animation.duration,r=e.chart.animated?e.chart.duration:200,o=1,n="RangeArea"===e.type||"RangeColumn"===e.type||"SplineRangeArea"===e.type?2:1,a=0;a<e.points.length;a++)if(e.points[a].symbolLocations){if(!e.points[a].symbolLocations.length||!t[o])continue;if(Q(t[o],i,r,e,a,e.points[a].symbolLocations[0],!1),2===n){var s=this.getRangeLowPoint(e.points[a].regions[0],e);Q(t[o+1],i,r,e,a,s,!1)}o+=n}},r}(lr),dr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return dr(i,e),pr([t.Property(0)],i.prototype,"x",void 0),pr([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),gr=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return dr(r,i),pr([t.Property(!0)],r.prototype,"visible",void 0),pr([t.Property(null)],r.prototype,"height",void 0),pr([t.Property(null)],r.prototype,"width",void 0),pr([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),pr([t.Property("Auto")],r.prototype,"position",void 0),pr([t.Property("Series")],r.prototype,"mode",void 0),pr([t.Property(8)],r.prototype,"padding",void 0),pr([t.Property("Center")],r.prototype,"alignment",void 0),pr([t.Complex(e.Theme.legendLabelFont,Xt)],r.prototype,"textStyle",void 0),pr([t.Property(10)],r.prototype,"shapeHeight",void 0),pr([t.Property(10)],r.prototype,"shapeWidth",void 0),pr([t.Complex({},Yt)],r.prototype,"border",void 0),pr([t.Complex({left:0,right:0,top:0,bottom:0},Ut)],r.prototype,"margin",void 0),pr([t.Complex({left:0,right:0,top:0,bottom:0},Zt)],r.prototype,"containerPadding",void 0),pr([t.Property(5)],r.prototype,"shapePadding",void 0),pr([t.Property("transparent")],r.prototype,"background",void 0),pr([t.Property(1)],r.prototype,"opacity",void 0),pr([t.Property(!0)],r.prototype,"toggleVisibility",void 0),pr([t.Property(null)],r.prototype,"description",void 0),pr([t.Property(3)],r.prototype,"tabIndex",void 0),pr([t.Property(null)],r.prototype,"title",void 0),pr([t.Complex(e.Theme.legendTitleFont,Xt)],r.prototype,"titleStyle",void 0),pr([t.Property("Top")],r.prototype,"titlePosition",void 0),pr([t.Property(100)],r.prototype,"maximumTitleWidth",void 0),pr([t.Property(!0)],r.prototype,"enablePages",void 0),pr([t.Property(!1)],r.prototype,"isInversed",void 0),r}(t.ChildProperty),yr=function(){function e(e){this.pageXCollections=[],this.legendTitleCollections=[],this.legendRegions=[],this.pagingRegions=[],this.chart=e,this.legend=e.legendSettings,this.legendID=e.element.id+"_chart_legend",this.isChartControl="chart"===e.getModuleName(),this.isBulletChartControl="bulletChart"===e.getModuleName(),this.isStockChartControl="stockChart"===e.getModuleName(),this.bulletChart=this.chart,this.fivePixel=5,this.rowCount=0,this.pageButtonSize=8,this.maxColumns=0,this.maxWidth=0,this.currentPage=1,this.backwardArrowOpacity=0,this.forwardArrowOpacity=1,this.arrowWidth=2*(this.fivePixel+this.pageButtonSize+this.fivePixel),this.arrowHeight=this.arrowWidth,this.isTop=!1,this.isTitle=!1,this.currentPageNumber=1}return e.prototype.calculateLegendBounds=function(e,t,r){var o=this.legend,n=this.isBulletChartControl?"40%":"20%";this.getPosition(o.position,t),this.legendBounds=new i.Rect(e.x,e.y,0,0),this.isVertical="Left"===this.position||"Right"===this.position,this.isVertical?(this.legendBounds.height=Be(o.height,t.height-(e.y-this.chart.margin.top))||e.height,this.legendBounds.width=Be(o.width||n,t.width)):(this.legendBounds.width=Be(o.width,t.width)||e.width,this.legendBounds.height=Be(o.height||n,t.height)),this.library.getLegendBounds(t,this.legendBounds,o),this.isBulletChartControl||(this.legendBounds.width+=this.legend.containerPadding.left+this.legend.containerPadding.right,this.legendBounds.height+=this.legend.containerPadding.top+this.legend.containerPadding.bottom),this.getLocation(this.position,o.alignment,this.legendBounds,e,t,r)},e.prototype.getPosition=function(e,t){var i=this.chart,r=this.chart;this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.position="Auto"!==e?e:"Bottom":("Auto"===e&&((i||r).visibleSeries&&"Funnel"===(i||r).visibleSeries[0].type||"Pyramid"===(i||r).visibleSeries[0].type)&&(e="Top"),this.position="Auto"!==e?e:t.width>t.height?"Right":"Bottom")},e.prototype.setBounds=function(e,t,i,r){var o=i.title&&"Top"===i.titlePosition?this.legendTitleSize.height+this.fivePixel:0;this.isVertical&&this.isPaging&&!i.enablePages&&!this.isBulletChartControl&&(o=i.title&&"Top"===i.titlePosition?this.legendTitleSize.height+this.fivePixel:0,o+=this.pageButtonSize+this.fivePixel),e=Math.min(e,r.width),t=Math.min(t,r.height),"Gradient"===i.mode?(r.width=i.width?r.width:this.isVertical?e:.75*r.width,r.height=i.height?r.height:this.isVertical?.75*r.height:t):(r.width=i.width?r.width:e,r.height=i.height?r.height:t),this.isBulletChartControl||this.isTop&&"None"!==i.titleStyle.textOverflow&&(this.calculateLegendTitle(i,r),r.height+="Wrap"===i.titleStyle.textOverflow&&this.legendTitleCollections.length>1?this.legendTitleSize.height-this.legendTitleSize.height/this.legendTitleCollections.length:0),this.rowCount=Math.max(1,Math.ceil((r.height-i.padding-o)/(this.maxItemHeight+i.padding)))},e.prototype.getLocation=function(e,t,i,r,o,n){var a=this.legend.border.width,s=this.isBulletChartControl,l=this.bulletChart,h="Inside"===l.labelPosition,c="Inside"===l.tickPosition,d="Vertical"===l.orientation,p=s&&""!==l.categoryField?n.width+this.chart.border.width+3*a:0,u=this.chart.margin.bottom,g=i.height+a+this.legend.margin.top+this.legend.margin.bottom,y=i.width+a+this.legend.margin.left+this.legend.margin.right;"Bottom"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=r.y+(r.height-g)+a+this.legend.margin.top,i.y+=!s||l.opposedPosition||h||c||d?d&&""!==l.categoryField?n.height+2*a:0:l.majorTickLines.height+u+this.legend.border.width+2*a,L(r,new Hi(0,0,0,g))):"Top"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=r.y+a+this.legend.margin.top,i.y-=!s||!l.opposedPosition||h||c||d?0:l.majorTickLines.height+this.chart.margin.top,L(r,new Hi(0,0,g-=s?2*-a:0,0))):"Right"===e?(i.x=r.x+(r.width-i.width)-this.legend.margin.right,i.y=r.y+this.alignLegend(0,o.height-(r.y+u),i.height,t),y+=s&&l.opposedPosition&&!h&&!c&&d?this.chart.margin.left+this.chart.margin.right+l.majorTickLines.height:0,L(r,new Hi(0,y,0,0))):"Left"===e?(i.x=i.x+this.legend.margin.left,i.y=r.y+this.alignLegend(0,o.height-(r.y+u),i.height,t),y+=!s||l.opposedPosition||h||c||!d?"Vertical"!==l.orientation&&""!==l.categoryField?p:0:i.x-this.chart.margin.left+a+l.majorTickLines.height,L(r,new Hi(y,0,0,0))):(i.x=this.legend.location.x,i.y=this.legend.location.y,L(r,new Hi(0,0,0,0)))},e.prototype.alignLegend=function(e,t,i,r){switch(r){case"Far":e=t-i-e;break;case"Center":e=(t-i)/2}return e},e.prototype.renderLegend=function(e,t,r,o){var n=0,a=0,s=(new i.Rect(0,0,0,0),new i.Rect(0,0,0,0)),l=this.findFirstLegendPosition(this.legendCollections),h=t.padding,c=t.enablePages,d=t.titlePosition,p=this.isPaging&&!t.enablePages&&this.isVertical?this.pageButtonSize:0,u=e.renderer.createGroup({id:this.legendID+"_g"}),g=this.createLegendElements(e,r,u,t,this.legendID,o);this.legendRegions=[];for(var y=0,m=0;m<this.legendCollections.length;m++)if(""!==this.legendCollections[m].text){y=Math.max(this.legendCollections[m].textSize.height,y);break}if(this.maxItemHeight=Math.max(y,t.shapeHeight),c||!this.isPaging||this.isVertical?this.isPaging||this.isVertical||(a=this.isTitle&&"Left"===d?this.fivePixel+this.legendTitleSize.width:0):(a=this.isTitle&&"Left"===d?this.legendTitleSize.width:0,a+=this.pageButtonSize+2*this.fivePixel),n=this.isTitle&&(this.isTop||this.isVertical)?this.legendTitleSize.height:0,"Gradient"===e.legendSettings.mode&&this.legendCollections.length>1)this.getLinearLegend(r,e,t,g),this.totalPages=1;else if(l!==this.legendCollections.length){var v=void 0,f=0,b=this.legendCollections[l],x=new Vi(this.isBulletChartControl?r.x+a+h+t.shapeWidth/2:r.x+a+h+t.shapeWidth/2+t.containerPadding.left,this.isBulletChartControl?r.y+n+p+h+this.maxItemHeight/2:r.y+n+p+h+this.maxItemHeight/2+t.containerPadding.top),w=e.isRtlEnabled?"end":"start",S=new i.TextOption("",x.x,x.y,w),C=t.shapePadding+h+t.shapeWidth;if(this.totalPages=this.totalPages=this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.totalPages:0,this.pageXCollections=[],this.legendCollections[l].location=x,!t.enablePages&&this.isPaging){var P=x.x-this.fivePixel,L=x.y-this.fivePixel,R=this.isTitle&&!this.isVertical&&"Left"===d?this.legendTitleSize.width+this.fivePixel:0,M=this.isVertical?this.pageButtonSize+Math.abs(L-r.y):0,A=this.isTitle&&!this.isVertical&&"Right"===d?this.legendTitleSize.width+this.fivePixel:0;A+=this.isVertical?0:this.fivePixel+this.pageButtonSize+this.fivePixel,s=new i.Rect(P,L,r.width-A-R,r.height-M)}else s=r;for(var k=0,T=this.legendCollections;k<T.length;k++){var _=T[k];"accumulationchart"===this.chart.getModuleName()&&(_.fill=(this.chart||this.chart||this.chart).visibleSeries[0].points[_.pointIndex].color),"stockChart"===this.chart.getModuleName()&&(_.type=this.chart.visibleSeries[f].type),this.accessbilityText=this.isBulletChartControl?"Legend of bullet chart"+_.text:"Click to show or hide the "+_.text+" series",_.render&&""!==_.text&&((v=e.renderer.createGroup({id:this.legendID+this.generateId(_,"_g_",f)}))&&(v.setAttribute("tabindex",t.tabIndex.toString()),v.setAttribute("aria-label",t.description||this.accessbilityText)),this.library.getRenderPoint(_,x,C,b,s,f,l),this.renderSymbol(_,v,f),this.renderText(e,_,v,S,f),v&&v.setAttribute("style","outline: none; cursor: "+(!t.toggleVisibility&&("None"===e.selectionMode||"None"===e.highlightMode||"None"===e.selectionMode)||this.isBulletChartControl?"auto":"pointer")),g&&g.appendChild(v),b=_),f++}this.isPaging?this.renderPagingElements(e,r,S,u):this.totalPages=1}be(e.enableCanvas,e.svgObject,u,o)},e.prototype.getLinearLegend=function(e,t,r,o){var n="http://www.w3.org/2000/svg",a=this.legendCollections[0],s=this.legendCollections[1],l=this.chart.renderer.createDefs(),h=document.createElementNS(n,"linearGradient"),c=[],d=[];r.title&&(this.isVertical?(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height):"Left"===r.titlePosition?(e.x+=this.legendTitleSize.width,e.width-=this.legendTitleSize.width):"Right"===r.titlePosition?e.width-=this.legendTitleSize.width:"Top"===r.titlePosition&&(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height));for(var p=0,u=this.chart.rangeColorSettings;p<u.length;p++){var g=u[p];if(d.indexOf(g.start)<0&&d.push(g.start),g.colors.length>2){var y=g.end-g.start,m=g.colors.length-1;if(y>0){y/=m;for(f=1;f<m;f++){var v=g.start+y*f;d.push(v)}}else for(var f=1;f<m;f++)d.push(g.start)}d.indexOf(g.end)<0&&d.push(g.end);for(var b=0,x=g.colors;b<x.length;b++){var w=x[b];c.indexOf(w)<0&&c.push(w)}g.colors.length>0&&g.colors.length<2&&c.push(g.colors[0])}var S=this.isVertical?"0":"100",C=this.isVertical?"100":"0";h.setAttribute("id",this.generateId(a,"linearGradient",0)),h.setAttribute("x1","0%"),h.setAttribute("y1","0%"),h.setAttribute("x2",S+"%"),h.setAttribute("y2",C+"%");for(var P=d[d.length-1]-d[0],L=0;L<c.length;L++){var R=d[L]-d[0];R/=P;var M=document.createElementNS(n,"stop");M.setAttribute("offset",R.toString()),M.setAttribute("stop-color",c[L]),M.setAttribute("stop-opacity",1..toString()),h.appendChild(M)}var A,k,T,_,O=a.text.toString(),E=s.text.toString(),I=i.measureText(O,r.textStyle),z=i.measureText(E,r.textStyle),D=I.width>z.width?I.width:z.width,B=I.height>z.height?I.height:z.height,F=2*D+4*r.padding,N=e.width,V=e.height,j=e.x+D+2*r.padding,H=e.y+r.padding;if(this.isVertical){if(F=2*B+4*r.padding,N=e.width-2*r.padding,V=e.height-F,j=e.x+r.padding,H=e.y+B+2*r.padding,A=e.y+r.padding+B,k=H+V+B,T=e.x+.5*e.width-.5*D,_=T,N>30){var X=N-30;N=30,j+=X/2}}else if(N=e.width-F,V=e.height-2*r.padding,T=e.x+r.padding+(D-I.width),_=e.x+N+3*r.padding+D,A=e.y+.5*e.height+.25*B,k=A,V>30){var Y=V-30;V=30,H+=Y/2}var G=new i.TextOption("",T,A,"",O);G.id=this.legendID+this.generateId(a,"_text_",1);var W=a.visible?r.textStyle.color||t.themeStyle.legendLabel:"#D3D3D3",U=!this.isStockChartControl&&this.chart.enableCanvas;Ve(t.renderer,G,r.textStyle,W,o,!1,!1,!1,!1,null,this.currentPageNumber&&U?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null),(G=new i.TextOption("",_,k,"",E)).id=this.legendID+this.generateId(a,"_text_",2),Ve(t.renderer,G,r.textStyle,W,o,!1,!1,!1,!1,null,this.currentPageNumber&&U?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null);var Z=t.renderer.drawRectangle({width:N,height:V,x:j,y:H,fill:"url(#"+this.generateId(a,"linearGradient",0)+")"});l.appendChild(h),o.appendChild(l),o.appendChild(Z)},e.prototype.findFirstLegendPosition=function(e){for(var t=0,i=0,r=e;i<r.length;i++){var o=r[i];if(o.render&&""!==o.text)break;t++}return t},e.prototype.calculateLegendTitle=function(e,t){if(e.title){this.isTop="Top"===e.titlePosition;var r="Trim"===e.titleStyle.textOverflow?2*e.padding:0;this.isTop||this.isVertical?this.legendTitleCollections=Xe(e.title,e.titleStyle,t.width-r):this.legendTitleCollections[0]=ze(e.maximumTitleWidth,e.title,e.titleStyle);var o=this.isTop?e.title:this.legendTitleCollections[0];this.legendTitleSize=i.measureText(o,e.titleStyle),this.legendTitleSize.height*=this.legendTitleCollections.length}else this.legendTitleSize=new i.Size(0,0)},e.prototype.renderLegendTitle=function(e,t,r,o){var n=t.padding,a=t.titleStyle.textAlignment;this.isTop="Top"===t.titlePosition;var s="Near"===a?"start":"Far"===a?"end":"middle",l=Ye(r,t.titleStyle);s=this.isTop||this.isVertical?s:"",l="Near"===a?l+n:"Far"===a?l-n:l,l=this.isTop||this.isVertical?l:r.x+("Left"===t.titlePosition?5:r.width-this.legendTitleSize.width-5);var h=r.height/2+this.legendTitleSize.height/4,c=r.y+(this.isTop||this.isVertical?this.legendTitleSize.height/this.legendTitleCollections.length:h),d=new i.TextOption(this.legendID+"_title",l,c,s,this.legendTitleCollections);Ve(e.renderer,d,t.titleStyle,t.titleStyle.color,o)},e.prototype.createLegendElements=function(e,t,i,r,o,n){var a=r.padding,s=new Di(o+"_element",r.background,r.border,r.opacity,t),l=e.renderer.createGroup({id:o+"_collections"}),h=!this.isStockChartControl&&e.enableCanvas,c=e.renderer.createClipPath({id:o+"_clipPath"});return i?i.appendChild(e.renderer.drawRectangle(s)):e.renderer.drawRectangle(s),r.title&&this.renderLegendTitle(e,r,t,i),h||i.appendChild(l),this.legendTranslateGroup=e.renderer.createGroup({id:o+"_translate_g"}),h||l.appendChild(this.legendTranslateGroup),s.y+=a+(this.isTop?this.legendTitleSize.height:0),s.id+="_clipPath_rect",s.width=this.isChartControl||"bulletChart"===e.getModuleName()||this.isStockChartControl||!this.isVertical?t.width:this.maxWidth-a+r.containerPadding.left+r.containerPadding.right,h?this.pagingClipRect=s:(this.clipRect=e.renderer.drawRectangle(s),c.appendChild(this.clipRect)),be(h,e.svgObject,c,n),h||l.setAttribute("style","clip-path:url(#"+c.id+")"),this.legendTranslateGroup},e.prototype.renderSymbol=function(e,t,r){var o,n,a=this.isBulletChartControl?this.chart:null,s=e.visible?e.fill:"#D3D3D3",l=("chart"===this.chart.getModuleName()||"stockChart"===this.chart.getModuleName())&&"SeriesType"===e.shape&&e.type.toLowerCase().indexOf("line")>-1&&-1===e.type.toLowerCase().indexOf("area"),h=!("chart"!==this.chart.getModuleName()&&"stockChart"!==this.chart.getModuleName()||"Scatter"!==e.type&&"Bubble"!==e.type),c=!this.isStockChartControl&&this.chart.enableCanvas,d="SeriesType"===e.shape?e.type:e.shape,p=l?"Series"===this.legend.mode?this.chart.visibleSeries[r].width:this.chart.visibleSeries[0].width:this.isBulletChartControl&&"Multiply"===e.shape?4:1;if(d="Scatter"===d?e.markerShape:d,h&&r<this.chart.visibleSeries.length){var u=this.chart.visibleSeries[r].border;o=u.color?u.color:s,p=u.width?u.width:1}var g=new i.PathOption(this.legendID+this.generateId(e,"_shape_",r),s,p,h?o:s,1,"",""),y=i.measureText(e.text,this.legend.textStyle),m=this.legend.isInversed?e.location.x+y.width+this.legend.shapePadding:e.location.x,v=e.location.y;c?(n=-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth,this.legend.shapeHeight),"",g,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new i.Rect(0,n,0,0):null,this.isBulletChartControl,a),this.legendRegions.push({rect:new i.Rect(e.location.x,e.location.y,this.legend.shapeWidth,this.legend.shapeHeight+n),index:r})):t.appendChild(ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth,this.legend.shapeHeight),e.url,g,this.accessbilityText,this.chart.renderer,null,this.isBulletChartControl,a)),("Line"===d&&e.markerVisibility&&"Image"!==e.markerShape||"Doughnut"===e.type&&"Doughnut"===d)&&(g.id=this.legendID+this.generateId(e,"_shape_marker_",r),d="Doughnut"===e.type?"Circle":e.markerShape,g.fill="Doughnut"===e.type?"#FFFFFF":g.fill,c?ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",g,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,this.isBulletChartControl,a):t.appendChild(ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",g,this.accessbilityText,null,null,this.isBulletChartControl,a)))},e.prototype.renderText=function(e,t,r,o,n){var a=e.legendSettings,s=t.visible?a.textStyle.color||e.themeStyle.legendLabel:"#D3D3D3",l=!this.isStockChartControl&&this.chart.enableCanvas;o.id=this.legendID+this.generateId(t,"_text_",n),o.text=t.text,o.x=a.isInversed?t.location.x-a.shapeWidth/2:t.location.x+a.shapeWidth/2+a.shapePadding,o.y=t.location.y+this.maxItemHeight/4;var h=Ve(e.renderer,o,a.textStyle,s,r,!1,!1,!1,!1,null,this.currentPageNumber&&l?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null);if(h&&h.setAttribute("aria-label",a.description||this.accessbilityText),l){var c=i.measureText(o.text,a.textStyle);this.legendRegions[n].rect.y=o.y<this.legendRegions[n].rect.y?o.y:this.legendRegions[n].rect.y,this.legendRegions[n].rect.width+=c.width,this.legendRegions[n].rect.height=c.height,this.legendRegions[n].rect.y-=.5*c.height}},e.prototype.renderPagingElements=function(e,t,r,o){var n=e.renderer.createGroup({id:this.legendID+"_navigation"}),a=!this.isStockChartControl&&e.enableCanvas,s=this.isBulletChartControl?0:this.legendTitleSize.height,l=e.legendSettings,h=new i.PathOption(this.legendID+"_pageup","transparent",5,"#545454",1,"",""),c=this.pageButtonSize,d=l.enablePages||!this.isPaging||this.isVertical||this.isBulletChartControl?this.rowCount-1:1,p=this.isTitle&&"Left"===l.titlePosition?this.legendTitleSize.width:0;this.pagingRegions=[],this.backwardArrowOpacity=1!==this.currentPage?1:0,this.forwardArrowOpacity=this.currentPage===this.totalPages?0:1,a||o.appendChild(n),this.isChartControl||this.isBulletChartControl||this.isStockChartControl||!this.isVertical?this.totalPages=Math.ceil(this.totalPages/Math.max(1,this.rowCount-1)):this.totalPages=Math.ceil(this.totalPages/this.maxColumns),n&&n.setAttribute("style","cursor: pointer"),this.clipPathHeight=d*(this.maxItemHeight+l.padding),a?(this.pagingClipRect.height=this.legendBounds.height-this.clipPathHeight-(this.pagingClipRect.y-this.legendBounds.y)-l.border.width,this.pagingClipRect.y=this.pagingClipRect.y+this.clipPathHeight,this.pagingClipRect.x+=l.border.width,this.pagingClipRect.width-=l.border.width+l.border.width/2,this.chart.renderer.clearRect(new i.Rect(this.pagingClipRect.x,this.pagingClipRect.y,this.pagingClipRect.width,this.pagingClipRect.height))):this.clipRect.setAttribute("height",this.clipPathHeight.toString());var u,g=t.x+c/2,y=t.y+this.clipPathHeight+(s+t.height-this.clipPathHeight)/2;!this.isPaging||l.enablePages||this.isVertical||this.isBulletChartControl||(g=t.x+this.fivePixel+this.pageButtonSize+p,y=l.title&&this.isTop?t.y+8+s+c/1+.5:t.y+8+c+.5);var m=i.measureText(this.totalPages+"/"+this.totalPages,l.textStyle);a?ne({x:g,y:y},"LeftArrow",new i.Size(c,c),"",h,"LeftArrow",this.chart.renderer,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0)):!this.isVertical||l.enablePages||this.isBulletChartControl?(h.opacity=this.isBulletChartControl?h.opacity:l.enablePages?1:this.backwardArrowOpacity,n.appendChild(ne({x:g,y:y},"LeftArrow",new i.Size(c,c),"",h,"LeftArrow"))):(g=t.x+t.width/2,y=t.y+c/2+8+s,h.opacity=this.backwardArrowOpacity,n.appendChild(ne({x:g,y:y},"UpArrow",new i.Size(c,c),"",h,"UpArrow"))),this.pagingRegions.push(new i.Rect(g+t.width-(2*(c+8)+8+m.width)-.5*c,y-.5*c,c,c)),r.x=g+c/2+8,r.y=y+m.height/4,r.id=this.legendID+"_pagenumber",r.text="1/"+this.totalPages,a&&this.totalNoOfPages&&(r.text=this.currentPageNumber+"/"+this.totalNoOfPages),(l.enablePages||this.isBulletChartControl)&&(u=Ve(e.renderer,r,l.textStyle,l.textStyle.color,n,!1,!1,!1,!1,null,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0))),g=r.x+8+c/2+m.width,!this.isPaging||l.enablePages||this.isVertical||(g=t.x+t.width-this.fivePixel-this.pageButtonSize-(l.title&&"Right"===l.titlePosition?this.legendTitleSize.width+this.fivePixel:0)),h.id=this.legendID+"_pagedown",h.opacity=l.enablePages?1:this.forwardArrowOpacity,a?ne({x:g,y:y},"RightArrow",new i.Size(c,c),"",h,"RightArrow",this.chart.renderer,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0)):!this.isVertical||l.enablePages||this.isBulletChartControl?n.appendChild(ne({x:g,y:y},"RightArrow",new i.Size(c,c),"",h,"RightArrow")):(g=t.x+t.width/2,y=t.y+t.height-c/2-8,n.appendChild(ne({x:g,y:y},"DownArrow",new i.Size(c,c),"",h,"DownArrow"))),this.pagingRegions.push(new i.Rect(g+(t.width-(2*(c+8)+8+m.width)-.5*c),y-.5*c,c,c)),a||!l.enablePages&&!this.isBulletChartControl?(1===this.currentPageNumber&&this.calTotalPage&&(l.enablePages||this.isBulletChartControl)&&(this.totalNoOfPages=this.totalPages,this.calTotalPage=!1),l.enablePages||this.isBulletChartControl||this.translatePage(null,this.currentPage-1,this.currentPage,l)):n.setAttribute("transform","translate("+(t.width-(2*(c+8)+8+m.width))+", 0)"),(l.enablePages||this.isBulletChartControl)&&this.translatePage(u,this.currentPage-1,this.currentPage,l)},e.prototype.translatePage=function(e,t,i,r){var o=this.clipPathHeight*t,n="translate(0,-"+o+")";return this.isChartControl||this.isBulletChartControl||this.isStockChartControl||!this.isVertical||(n="translate(-"+(o=(o=this.pageXCollections[t*this.maxColumns]-this.legendBounds.x)<0?0:o)+",0)"),this.chart.enableCanvas||this.legendTranslateGroup.setAttribute("transform",n),this.chart.enableCanvas||!r.enablePages&&!this.isBulletChartControl||(e.textContent=i+"/"+this.totalPages),this.currentPage=i,o},e.prototype.changePage=function(e,t){var i=this.chart.legendSettings,r=document.getElementById(this.legendID+"_pageup"),o=document.getElementById(this.legendID+"_pagedown"),n=i.enablePages||this.isBulletChartControl?document.getElementById(this.legendID+"_pagenumber"):null,a=i.enablePages||this.isBulletChartControl?parseInt(n.textContent.split("/")[0],10):this.currentPage;t&&a>1?this.translatePage(n,a-2,a-1,i):!t&&a<this.totalPages&&this.translatePage(n,a,a+1,i),!this.isPaging||i.enablePages||this.isBulletChartControl||(this.currentPage===this.totalPages?this.hideArrow(o):this.showArrow(o),1===this.currentPage?this.hideArrow(r):this.showArrow(r))},e.prototype.hideArrow=function(e){e.setAttribute("opacity","0")},e.prototype.showArrow=function(e){e.setAttribute("opacity","1")},e.prototype.generateId=function(e,t,i){return this.isChartControl||this.isStockChartControl?t+i:t+e.pointIndex},e.prototype.move=function(e){var t=this,i=this.chart.mouseX,r=this.chart.mouseY;if(e.target.textContent.indexOf("...")>-1){var o=e.target.id.split(this.legendID+"_text_");if(2===o.length){var n=parseInt(o[1],10),a=this.chart.element;isNaN(n)||(this.chart.isTouch&&m(this.chart.element.id+"_EJ2_Legend_Tooltip"),this.isChartControl?f(this.chart.series[n].name,i,r,a.offsetWidth,a.id+"_EJ2_Legend_Tooltip",he(this.chart.element.id+"_Secondary_Element")):f(this.chart.visibleSeries[0].points[n].x.toString(),i+10,r+10,a.offsetWidth,a.id+"_EJ2_Legend_Tooltip",he(this.chart.element.id+"_Secondary_Element")))}}else m(this.chart.element.id+"_EJ2_Legend_Tooltip");this.chart.isTouch&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){m(t.chart.element.id+"_EJ2_Legend_Tooltip")},1e3))},e}(),mr=function(){function e(e,t,i,r,o,n,a,s,l,h){this.location={x:0,y:0},this.text=e,this.fill=t,this.shape=i,this.url=n,this.visible=r,this.type=o,this.markerVisibility=s,this.markerShape=a,this.pointIndex=l,this.seriesIndex=h}return e}(),vr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},br=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return vr(r,e),r.prototype.setDataSource=function(e,t){e&&(this.xData=e.xData,this.yData=e.yData,this.points=e.points),t[G(this.type)+"IndicatorModule"].initDataSource(this,t),t.visibleSeriesCount+=this.targetSeries.length},fr([t.Property("Sma")],r.prototype,"type",void 0),fr([t.Property(14)],r.prototype,"period",void 0),fr([t.Property(14)],r.prototype,"kPeriod",void 0),fr([t.Property(3)],r.prototype,"dPeriod",void 0),fr([t.Property(80)],r.prototype,"overBought",void 0),fr([t.Property(20)],r.prototype,"overSold",void 0),fr([t.Property(2)],r.prototype,"standardDeviation",void 0),fr([t.Property("Close")],r.prototype,"field",void 0),fr([t.Property(12)],r.prototype,"slowPeriod",void 0),fr([t.Property(26)],r.prototype,"fastPeriod",void 0),fr([t.Property(!0)],r.prototype,"showZones",void 0),fr([t.Complex({color:"#ff9933",width:2},Ht)],r.prototype,"macdLine",void 0),fr([t.Property("Both")],r.prototype,"macdType",void 0),fr([t.Property("#2ecd71")],r.prototype,"macdPositiveColor",void 0),fr([t.Property("#e74c3d")],r.prototype,"macdNegativeColor",void 0),fr([t.Property("rgba(211,211,211,0.25)")],r.prototype,"bandColor",void 0),fr([t.Complex({color:"#ffb735",width:1},Ht)],r.prototype,"upperLine",void 0),fr([t.Complex({color:"#f2ec2f",width:1},Ht)],r.prototype,"lowerLine",void 0),fr([t.Complex({color:"#f2ec2f",width:1},Ht)],r.prototype,"periodLine",void 0),fr([t.Property("")],r.prototype,"seriesName",void 0),r}(or),xr=function(){function e(e){this.control=e}return e.prototype.print=function(e){this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight);var i={cancel:!1,htmlContent:this.getHTMLContent(e),name:"beforePrint"};this.control.trigger("beforePrint",i),i.cancel||t.print(i.htmlContent,this.printWindow)},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");if(e)if(e instanceof Array)for(var r=0;r<e.length;r++){var o=e[r];i.appendChild(he(o).cloneNode(!0))}else e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(he(e).cloneNode(!0));else i.appendChild(this.control.element.cloneNode(!0));return i},e.prototype.export=function(e,i,r,n,a,s,l,h,c){var d=this,p=this.getControlsValue(n,l);a=a||p.width,s=s||p.height;var u,g=this.control.svgObject,y=this.control.enableCanvas;y||(g=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:a.toString(),height:s.toString()}}));var v=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var f='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+p.svg.outerHTML+"</svg>",b=window.URL.createObjectURL(new Blob("SVG"===e?[f]:[(new XMLSerializer).serializeToString(p.svg)],{type:"image/svg+xml"}));if("SVG"===e)if("msie"===t.Browser.info.name){var x=new Blob([(new XMLSerializer).serializeToString(p.svg)],{type:"application/octet-stream"});window.navigator.msSaveOrOpenBlob(x,i+"."+e.toLocaleLowerCase())}else this.triggerDownload(i,e,b,v);else if("msie"===t.Browser.info.name){var w=g;y||(w=this.createCanvas()),u=w.toDataURL(),"PDF"===e?this.exportPdf(w,r,a,s,v,i,h,c):this.doexport(e,u,i)}else{var S=new Image,C=g.getContext("2d");S.onload=function(){C.drawImage(S,0,0),window.URL.revokeObjectURL(b),"PDF"===e?d.exportPdf(g,r,a,s,v,i,h,c):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(g.toBlob(null),i+"."+e.toLocaleLowerCase()):d.triggerDownload(i,e,g.toDataURL("image/"+e.toLowerCase()),v)},S.src=b}y||m(document.getElementById(this.control.element.id+"_canvas"))},e.prototype.getDataUrl=function(e){var i=this.getControlsValue([e]),r=this.control.svgObject,o=this.control.enableCanvas;o||(r=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:i.width.toString(),height:i.height.toString()}}));var n=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(i.svg)],{type:"image/svg+xml"}));if("msie"===t.Browser.info.name){var a=r;o||(a=this.createCanvas());var s={name:"afterExport",cancel:!1,dataUrl:r.toDataURL("image/png")};return e.trigger("afterExport",s),{element:a,dataUrl:a.toDataURL()}}var l=new Image,h=r.getContext("2d");return l.onload=function(){h.drawImage(l,0,0),window.URL.revokeObjectURL(n);var t={name:"afterExport",cancel:!1,dataUrl:r.toDataURL("image/png")};return e.trigger("afterExport",t),t.dataUrl},l.src=n,{element:r,blobUrl:n}},e.prototype.triggerDownload=function(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},e.prototype.getControlsValue=function(e,r){var o=0,n=0,a=this.control.enableCanvas,s=new i.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var i=e.svgObject.cloneNode(!0),l=e.renderer.createGroup({style:t.isNullOrUndefined(r)||r?"transform: translateY("+n+"px)":"transform: translateX("+o+"px)"}),h=i.childNodes[0].getAttribute("fill");"Tailwind"!==e.theme&&"TailwindDark"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||i.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),a||l.appendChild(i),o=t.isNullOrUndefined(r)||r?Math.max(e.availableSize.width,o):o+e.availableSize.width,n=t.isNullOrUndefined(r)||r?n+e.availableSize.height:Math.max(e.availableSize.height,n),a||s.appendChild(l)}),a||(s.setAttribute("width",o+""),s.setAttribute("height",n+"")),{width:o,height:n,svg:s}},e.prototype.createCanvas=function(){var e=this.control;this.canvasRender(!0,e);var t=e.svgObject;return this.canvasRender(!1,e),t},e.prototype.canvasRender=function(e,t){t.enableCanvas=e,t.preRender(),t.render()},e.prototype.exportPdf=function(e,t,i,r,n,a,s,l){var h=new o.PdfDocument,c=h.pageSettings.margins,d=h.pageSettings.width,p=h.pageSettings.height,u=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");h.pageSettings.orientation=t;var g=d<i?i+c.left+c.right:d,y=p<r?r+c.top+c.bottom:p;if(void 0!==s){var m=new o.PdfStandardFont(1,s.fontSize||15),v=new o.PdfPageTemplateElement(g,40);v.graphics.drawString(s.content+"",m,null,new o.PdfSolidBrush(new o.PdfColor(0,0,0)),s.x,s.y,null),h.template.top=v}if(void 0!==l){var m=new o.PdfStandardFont(1,l.fontSize||15),f=new o.PdfPageTemplateElement(g,40);f.graphics.drawString(l.content+"",m,null,new o.PdfSolidBrush(new o.PdfColor(0,0,0)),l.x,l.y,null),h.template.bottom=f}h.pageSettings.size=new o.SizeF(g,y),u=u.slice(u.indexOf(",")+1),h.pages.add().graphics.drawImage(new o.PdfBitmap(u),0,0,i,r),n&&(h.save(a+".pdf"),h.destroy())},e.prototype.doexport=function(e,t,i){var r=[],o=e||"JPG";r=[t],this.exportImage(r,i,o,t)},e.prototype.exportImage=function(e,i,r,o){for(var n=[],a=e instanceof HTMLElement?0:e.length,s=0;s<a;s++){for(var l=(o=(o=e[s]).replace(/^data:[a-z]*;,/,"")).split(","),h=atob(l[1]),c=new ArrayBuffer(h.length),d=new Uint8Array(c),p=0;p<h.length;p++)d[p]=h.charCodeAt(p);n.push(c)}for(var u=0;u<n.length;u++){var g=new Blob([n[u]],{type:"application/octet-stream"});"msie"===t.Browser.info.name&&window.navigator.msSaveOrOpenBlob(g,i+"."+r.toLocaleLowerCase())}},e}(),wr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property()],i.prototype,"start",void 0),Sr([t.Property()],i.prototype,"end",void 0),Sr([t.Property([])],i.prototype,"colors",void 0),Sr([t.Property("")],i.prototype,"label",void 0),i}(t.ChildProperty),Pr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property(!1)],i.prototype,"enable",void 0),Sr([t.Property("")],i.prototype,"dashArray",void 0),Sr([t.Complex({color:null,width:1},Yt)],i.prototype,"line",void 0),Sr([t.Property("Both")],i.prototype,"lineType",void 0),i}(t.ChildProperty),Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property(!1)],i.prototype,"enableSelectionZooming",void 0),Sr([t.Property(!1)],i.prototype,"enablePinchZooming",void 0),Sr([t.Property(!1)],i.prototype,"enableMouseWheelZooming",void 0),Sr([t.Property(!0)],i.prototype,"enableDeferredZooming",void 0),Sr([t.Property("XY")],i.prototype,"mode",void 0),Sr([t.Property(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],i.prototype,"toolbarItems",void 0),Sr([t.Property(!1)],i.prototype,"enablePan",void 0),Sr([t.Property(!1)],i.prototype,"enableScrollbar",void 0),i}(t.ChildProperty),Rr=function(r){function o(e,i){var o=r.call(this,e,i)||this;return o.rotatedDataLabelCollections=[],o.animated=!1,o.isPointMouseDown=!1,o.isScrolling=!1,o.checkResize=0,o.visible=0,o.clickCount=0,o.singleClickTimer=0,o.chartAreaType="Cartesian",o.isRtlEnabled=!1,o.chartid=57723,t.setValue("mergePersistData",o.mergePersistChartData,o),o}return wr(o,r),o.prototype.mergePersistChartData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!t.isNullOrUndefined(e)&&""!==e){var i=JSON.parse(e),r=Object.keys(i);this.isProtectedOnChange=!0;for(var o=0,n=r;o<n.length;o++){var a=n[o];"object"!=typeof this[a]||t.isNullOrUndefined(this[a])?this[a]=i[a]:t.extend(this[a],i[a])}this.isProtectedOnChange=!1}},o.prototype.isIdHasSpecialCharacter=function(e){var t=/^[A-Za-z0-9 ]+$/,i="";if(t.test(e))return e;for(var r=0;r<e.length;r++)t.test(e[r])||-1!==e.indexOf("-")||-1!==e.indexOf("_")||-1!==e.indexOf("\\")?i+=e[r]:i+="\\"+e[r];return i},o.prototype.preRender=function(){this.element.id=this.isIdHasSpecialCharacter(this.element.id);this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateVariable(),this.setCulture(),this.wireEvents(),this.stockChart&&(null===this.stockChart.tooltip.header&&(this.tooltip.header="<b>${point.x}</b>"),null===this.stockChart.tooltip.format&&(this.tooltip.format="High : <b>${point.high}</b><br/>Low : <b>${point.low}</b><br/>Open : <b>${point.open}</b><br/>Close : <b>${point.close}</b>",""!==this.stockChart.series[0].volume&&(this.tooltip.format+="<br/>Volume : <b>${point.volume}</b>")),this.animateSeries=!1)},o.prototype.initPrivateVariable=function(){if(this.animateSeries=!0,this.delayRedraw=!1,this.horizontalAxes=[],this.verticalAxes=[],this.refreshAxis(),this.refreshDefinition(this.rows),this.refreshDefinition(this.columns),this.tooltipModule&&(this.tooltipModule.previousPoints=[]),""===this.element.id){var e=document.getElementsByClassName("e-chart").length;this.element.id="chart_"+this.chartid+"_"+e}this.svgId=this.stockChart?this.stockChart.element.id+"_stockChart_chart":this.element.id+(this.enableCanvas?"_canvas":"_svg")},o.prototype.render=function(){var e=this;this.svgRenderer=new i.SvgRenderer(this.element.id);var t={chart:this.isBlazor?{}:this,theme:this.theme,name:"load",cancel:!1};this.stockChart?(this.isRtlEnabled="rtl"===window.getComputedStyle(document.querySelector("body")).direction,this.cartesianChartRendering(t)):this.trigger("load",t,function(){t.cancel||e.cartesianChartRendering(t)})},o.prototype.cartesianChartRendering=function(e){this.theme=this.isBlazor?e.theme:this.theme,this.createChartSvg(),this.setTheme(),this.markerRender=new cr(this),this.calculateAreaType(),this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.calculateVisibleAxis(),this.processData(),this.renderComplete(),this.allowServerDataBinding=!0},o.prototype.getLocalizedLabel=function(e){return this.localeObject.getConstant(e)},o.prototype.animate=function(e){this.redraw=!0,this.animated=!0,this.duration=e||1e3},o.prototype.refreshBound=function(){if(this.rotatedDataLabelCollections=[],this.legendModule&&this.legendSettings.visible&&this.legendModule.getLegendOptions(this.visibleSeries,this),this.tooltip.enable&&this.tooltipModule&&(this.tooltipModule.previousPoints=[]),this.calculateStackValues(),this.calculateBounds(),this.stockChart&&!this.stockChart.rangeFound&&(this.stockChart.enablePeriodSelector||this.stockChart.enableSelector))return null;this.renderElements(),m("chartmeasuretext"),this.removeSelection()},o.prototype.calculateStackValues=function(){for(var e,t=!1,i=0,r=this.visibleSeries.length;i<r;i++)(e=this.visibleSeries[i]).position=e.rectCount=void 0,-1===e.type.indexOf("Stacking")&&(-1===e.drawType.indexOf("Stacking")||"PolarRadar"!==this.chartAreaType)||t||(e.calculateStackedValue(e.type.indexOf("100")>-1,this),t=!0)},o.prototype.removeSelection=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var r=t[e];if(r.visible)for(var o=0,n=r.points;o<n.length;o++)n[o].isSelect=!1}he(this.element.id+"_ej2_drag_multi_group")?(this.selectionMode.indexOf("Drag")>-1&&(this.selectionModule.filterArray=[]),m(this.element.id+"_ej2_drag_multi_group"),this.selectionModule.calculateDragSelectedElements(this,new i.Rect(0,0,0,0),!0)):he(this.element.id+"_ej2_drag_group")&&("Lasso"!==this.selectionMode&&(this.selectionModule.filterArray=[]),m(this.element.id+"_ej2_drag_group"),this.selectionModule.calculateDragSelectedElements(this,new i.Rect(0,0,0,0),!0))},o.prototype.renderElements=function(){this.renderBorder(),this.renderTitle(),this.renderAreaBorder(),this.renderSeriesElements(this.renderAxes()),this.renderLegend(),this.applyZoomkit(),this.performSelection(),this.setSecondaryElementPosition();for(var e=0,i=this.visibleSeries;e<i.length;e++){var r=i[e];t.updateBlazorTemplate(this.element.id+"_DataLabel","Template",r.marker.dataLabel)}this.renderAnnotation()},o.prototype.renderAxes=function(){this.yAxisElements=this.renderer.createGroup({id:this.element.id+"yAxisCollection"});var e;return this.rows.length>0&&this.columns.length>0&&(e=this.chartAxisLayoutPanel.renderAxes()),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Behind",this.axisCollections),e},o.prototype.renderLegend=function(){if(this.legendModule&&this.legendModule.legendCollections.length&&this.legendSettings.visible){this.legendModule.calTotalPage=!0;var e=this.legendSettings.border.width,t=this.legendModule.legendBounds,r=new i.Rect(t.x,t.y,t.width,t.height);this.enableCanvas&&(r=new i.Rect(r.x-e/2,r.y-e/2,r.width+e,r.height+e),this.renderer.canvasClip(r)),this.legendModule.renderLegend(this,this.legendSettings,t),this.enableCanvas&&this.renderer.canvasRestore()}this.redraw||(this.stockChart?he(this.stockChart.chartObject.id)||this.stockChart.mainObject.appendChild(this.svgObject):this.element.appendChild(this.svgObject))},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.svgId).getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},o.prototype.initializeModuleElements=function(){this.dataLabelCollections=[];var e=this.element.id;this.series.length&&(this.seriesElements="Scatter"===this.series[0].type||"Bubble"===this.series[0].type?this.svgRenderer.createGroup({id:e+"SeriesCollection"}):this.renderer.createGroup({id:e+"SeriesCollection"})),this.indicators.length&&(this.indicatorElements=this.renderer.createGroup({id:e+"IndicatorCollection"})),this.hasTrendlines()&&(this.trendLineElements=this.renderer.createGroup({id:e+"TrendLineCollection"})),this.dataLabelElements=this.renderer.createGroup({id:e+"DataLabelCollection"})},o.prototype.hasTrendlines=function(){for(var e,t=0,i=this.series;t<i.length&&!(e=!!i[t].trendlines.length);t++);return e},o.prototype.renderSeriesElements=function(e){this.initializeModuleElements();var t=this.element.id;if("g"!==this.element.tagName){var i=Fe(this.redraw,t+"_Secondary_Element")||this.createElement("div");i.id=t+"_Secondary_Element",i.setAttribute("style","position: relative"),be(!1,this.element,i,this.redraw)}if(this.enableCanvas){var r=document.getElementById(t+"_Secondary_Element");r=r||this.createElement("div",{id:t+"_Secondary_Element",attrs:{style:"position: relative; left:0px; top:0px"}});var o=this.svgRenderer.createSvg({id:t+"_tooltip_svg",width:this.availableSize.width,height:this.availableSize.height});o.setAttribute("style","position: absolute; pointer-events: none"),r.appendChild(o)}this.tooltip.enable&&be(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:t+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.rows.length>0&&this.columns.length>0&&(this.initializeIndicator(),this.initializeTrendLine(),this.renderSeries(),this.trendLineElements&&be(this.enableCanvas,this.svgObject,this.trendLineElements,this.redraw),this.appendElementsAfterSeries(e))},o.prototype.renderSeries=function(){this.enableCanvas&&this.renderer.canvasClip(this.chartAxisLayoutPanel.seriesClipRect);for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];("TrendLine"===i.category?this.series[i.sourceIndex].trendlines[i.index].visible:i.visible)&&(this.visible++,Y(i),this.enableCanvas&&this.renderCanvasSeries(i),i.renderSeries(this),this.enableCanvas&&this.renderer.canvasRestore())}this.visible=0;var r={id:this.element.id+"_ChartAreaClipRect_",x:this.chartAxisLayoutPanel.seriesClipRect.x,y:this.chartAxisLayoutPanel.seriesClipRect.y,width:this.chartAxisLayoutPanel.seriesClipRect.width,height:this.chartAxisLayoutPanel.seriesClipRect.height,fill:"transparent","stroke-width":1,stroke:"Gray"};if(this.seriesElements){this.enableCanvas||this.seriesElements.appendChild(K(this.redraw,r,this.renderer));var o=document.getElementById(this.element.id+"_series_svg");o?be(!1,o,this.seriesElements,this.redraw):be(this.enableCanvas,this.svgObject,this.seriesElements,this.redraw)}},o.prototype.renderCanvasSeries=function(e){var t,i;if("Bubble"===e.type||"Scatter"===e.type){t=t||this.svgRenderer.createSvg({id:this.element.id+"_series_svg",width:this.availableSize.width,height:this.availableSize.height}),(i=i||this.createElement("div",{id:this.element.id+"_series"})).setAttribute("style","position: absolute");var r=document.getElementById(this.element.id+"_Secondary_Element");i.appendChild(t),r.appendChild(i)}t=!this.enableCanvas||"Bubble"!==e.type&&"Scatter"!==e.type?this.svgObject:t;(!this.enableCanvas||"Bubble"!==e.type&&"Scatter"!==e.type)&&this.enableCanvas},o.prototype.initializeIndicator=function(){for(var e=0,t=this.indicators;e<t.length;e++){var i=t[e];this[G(i.type)+"IndicatorModule"]&&this[G(i.type)+"IndicatorModule"].createIndicatorElements(this,i,i.index)}this.indicatorElements&&be(this.enableCanvas,this.svgObject,this.indicatorElements,this.redraw)},o.prototype.initializeTrendLine=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];i.trendlines.length&&this.trendLineModule.getTrendLineElements(i,this)}},o.prototype.appendElementsAfterSeries=function(e){"PolarRadar"===this.chartAreaType&&be(this.enableCanvas,this.svgObject,this.yAxisElements,this.redraw),be(this.enableCanvas,this.svgObject,e,this.redraw),(this.zoomModule&&this.zoomSettings.enableScrollbar&&this.scrollElement.childElementCount||this.scrollElement&&this.scrollElement.childElementCount)&&be(!1,he(this.element.id+"_Secondary_Element"),this.scrollElement,this.redraw),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Over",this.axisCollections),this.tooltip.enable||be(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:this.element.id+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.stockChart&&this.stockChart.calculateStockEvents()},o.prototype.applyZoomkit=function(){"PolarRadar"!==this.chartAreaType&&(this.redraw||!this.zoomModule||this.zoomSettings.enablePan&&!this.zoomModule.performedUI||this.zoomModule.applyZoomToolkit(this,this.axisCollections))},o.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(he((this.stockChart?this.stockChart.element.id:this.element.id)+"_Secondary_Element"))},o.prototype.performSelection=function(){var e=[];this.selectionModule&&(e=t.extend([],this.selectionModule.selectedDataIndexes,null,!0),this.selectionModule.invokeSelection(this)),this.highlightModule&&this.highlightModule.invokeHighlight(this),e.length>0&&(this.selectionModule.selectedDataIndexes=e,this.selectionModule.redrawSelection(this,this.selectionMode))},o.prototype.processData=function(e){void 0===e&&(e=!0),this.visibleSeriesCount=0;for(var t=!0,i=0,r=this.visibleSeries;i<r.length;i++){var o=r[i];o.visible||this.legendSettings.visible?"Indicator"!==o.category&&"TrendLine"!==o.category&&this.initializeDataModule(o):this.visibleSeriesCount++}for(var n=0,a=this.indicators;n<a.length;n++){var s=a[n];if(s.dataSource){var l=s;this.initializeDataModule(l),t=!1}}e&&(!this.visibleSeries.length||this.visibleSeriesCount===this.visibleSeries.length&&t)&&(this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}))},o.prototype.initializeDataModule=function(e){e.xData=[],e.yData=[];var t;t=this.isAngular?Object.keys(e.dataSource).length?e.dataSource:this.dataSource:e.dataSource||this.dataSource,e.dataModule=new ar(t,e.query),e.points=[],e.refreshDataManager(this)},o.prototype.calculateBounds=function(){var e=this.margin,t=0,r=0,o=0,n=e.left,a=this.availableSize.width-n-e.right-this.border.width;if(this.titleCollection=[],this.subTitleCollection=[],this.title&&(this.titleCollection=Xe(this.title,this.titleStyle,a),t=i.measureText(this.title,this.titleStyle).height*this.titleCollection.length+15,this.subTitle)){for(var s=0,l=0,h=this.titleCollection;l<h.length;l++){var c=h[l];s=(o=i.measureText(c,this.titleStyle).width)>s?o:s}this.subTitleCollection=Xe(this.subTitle,this.subTitleStyle,s),r=i.measureText(this.subTitle,this.subTitleStyle).height*this.subTitleCollection.length+15}var d=e.top+r+t+.5*this.chartArea.border.width,p=this.availableSize.height-d-this.border.width-e.bottom;this.stockChart&&this.stockChart.legendSettings.visible&&this.stockChart.stockLegendModule&&("Top"===this.stockChart.legendSettings.position?d+=this.stockChart.stockLegendModule.legendBounds.height:"Left"===this.stockChart.legendSettings.position&&(n+=this.stockChart.stockLegendModule.legendBounds.width)),this.initialClipRect=new i.Rect(n,d,a,p),this.legendModule&&this.legendSettings.visible&&this.legendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null),this.chartAxisLayoutPanel.measureAxis(this.initialClipRect)},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.initTrendLines=function(){this.isProtectedOnChange=!0;for(var e=0,t=this.visibleSeries;e<t.length;e++)for(var i=t[e],r=0,o=0,n=i.trendlines;o<n.length;o++){var a=n[o];this.trendLineModule&&(a.index=r,a.sourceIndex=i.index,this.trendLineModule.initSeriesCollection(a,this),a.targetSeries&&(a.targetSeries.xAxisName=i.xAxisName,a.targetSeries.yAxisName=i.yAxisName,this.visibleSeries.push(a.targetSeries))),r++}this.isProtectedOnChange=!1},o.prototype.calculateAreaType=function(){var e=this.series[0];this.chartArea.border.width=this.stockChart?0:this.chartArea.border.width,e&&(this.requireInvertedAxis=-1!==e.type.indexOf("Bar")&&!this.isTransposed||-1===e.type.indexOf("Bar")&&this.isTransposed&&"PolarRadar"!==this.chartAreaType),this.chartAxisLayoutPanel="PolarRadar"===this.chartAreaType?this.polarSeriesModule||this.radarSeriesModule:new Ui(this)},o.prototype.calculateVisibleAxis=function(){var e,t=[this.primaryXAxis,this.primaryYAxis];t="Cartesian"===this.chartAreaType?t.concat(this.axes):t,this.paretoSeriesModule&&"Pareto"===this.series[0].type&&(t=t.concat(this.paretoSeriesModule.paretoAxes)),this.axisCollections=[],this.zoomModule&&(this.zoomModule.isPanning=this.zoomModule.isAxisZoomed(t)&&this.zoomSettings.enablePan,this.svgObject.setAttribute("cursor",this.zoomModule.isPanning?"pointer":"auto"),this.scrollBarModule&&(this.scrollBarModule.axes=t)),this.scrollSettingEnabled&&this.scrollBarModule&&(this.scrollBarModule.axes=t);for(var i=0,r=t.length;i<r;i++){(e=t[i]).series=[],e.labels=[];for(var o=0,n=this.visibleSeries;o<n.length;o++){var a=n[o];this.initAxis(a,e,!0)}for(var s=0,l=this.indicators;s<l.length;s++){var h=l[s];this.initAxis(h,e,!1)}this.scrollBarModule&&!e.zoomingScrollBar&&this.scrollBarModule.injectTo(e,this),null!=e.orientation&&this.axisCollections.push(e)}this.rows.length>0&&this.columns.length>0&&this.chartAxisLayoutPanel.measure()},o.prototype.initAxis=function(e,t,i){e.xAxisName===t.name||null==e.xAxisName&&"primaryXAxis"===t.name?(t.orientation=this.requireInvertedAxis?"Vertical":"Horizontal",e.xAxis=t,i&&t.series.push(e)):(e.yAxisName===t.name||null==e.yAxisName&&"primaryYAxis"===t.name)&&(t.orientation=this.requireInvertedAxis?"Horizontal":"Vertical",e.yAxis=t,i&&t.series.push(e))},o.prototype.initTechnicalIndicators=function(){for(var e=0,t=0,i=this.indicators;t<i.length;t++){var r=i[t],o=r,n=G(o.type);if(this[n+"IndicatorModule"]){o.index=e,this[n+"IndicatorModule"].initSeriesCollection(o,this);for(var a=0,s=o.targetSeries;a<s.length;a++){var l=s[a];(r.seriesName||r.dataSource)&&this.visibleSeries.push(l)}}e++}},o.prototype.refreshTechnicalIndicator=function(e){if(this.indicators.length){if(e instanceof nr&&"Indicator"!==e.category)for(var t=0,i=this.indicators;t<i.length;t++){var r=i[t];r.seriesName!==e.name||r.dataSource||r.setDataSource(e,this)}else e instanceof br&&e.setDataSource(e instanceof nr?e:null,this)}},o.prototype.calculateVisibleSeries=function(){var e;this.visibleSeries=[];for(var t=this.palettes.length?this.palettes:h(this.theme),i=t.length,r=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,n=r.length;o<n;o++){switch(e=r[o],e.category="Pareto"===r[0].type?"Pareto":"Series",e.index=o,e.interior=e.fill||t[o%i],e.type){case"Bar":case"StackingBar":case"StackingBar100":if(-1===r[0].type.indexOf("Bar"))continue;break;case"Polar":case"Radar":if("PolarRadar"!==this.chartAreaType)continue;if("PolarRadar"===this.chartAreaType&&(null===e.xAxisName&&null!==e.yAxisName||null!==e.xAxisName&&null===e.yAxisName||null!==e.xAxisName&&null!==e.yAxisName))continue;break;case"Pareto":this.visibleSeries.push(e),this.paretoSeriesModule.initSeries(e,this);continue;default:if("PolarRadar"===this.chartAreaType||r[0].type.indexOf("Bar")>-1)continue}this.visibleSeries.push(e),r[o]=e}},o.prototype.renderTitle=function(){var e,t=this.margin;if(this.title){var r=this.titleStyle.textAlignment,o="Near"===r?"start":"Far"===r?"end":"middle",n=i.measureText(this.title,this.titleStyle);e=new i.Rect(t.left,0,this.availableSize.width-t.left-t.right,0);var a=new i.TextOption(this.element.id+"_ChartTitle",Ye(e,this.titleStyle),this.margin.top+3*n.height/4,o,this.titleCollection,"","auto"),s=Fe(this.redraw,this.element.id+"_ChartTitle",a,this.renderer)||Ve(this.renderer,a,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitle,this.svgObject,null,null,null,null,null,null,null,null,this.enableCanvas);s&&(s.setAttribute("aria-label",this.description||this.title),s.setAttribute("tabindex",this.tabIndex.toString())),this.subTitle&&this.renderSubTitle(a)}},o.prototype.renderSubTitle=function(e){for(var t=0,r=0,o=this.titleStyle.textAlignment,n=0,a=this.titleCollection;n<a.length;n++){var s=a[n];t=(r=i.measureText(s,this.titleStyle).width)>t?r:t}var l=i.measureText(this.subTitle,this.subTitleStyle),h=new i.Rect("Center"===o?e.x-.5*t:"Far"===o?e.x-t:e.x,0,t,0),c=new i.TextOption(this.element.id+"_ChartSubTitle",Ye(h,this.subTitleStyle),e.y*e.text.length+3*l.height/4+10,function(e){return"Near"===e?"start":"Far"===e?"end":"middle"}(this.subTitleStyle.textAlignment),this.subTitleCollection,"","auto"),d=Fe(this.redraw,this.element.id+"_ChartSubTitle",c,this.renderer)||Ve(this.renderer,c,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartTitle,this.svgObject,null,null,null,null,null,null,null,null,this.enableCanvas);d&&(d.setAttribute("aria-label",this.description||this.subTitle),d.setAttribute("tabindex",this.tabIndex.toString()))},o.prototype.renderBorder=function(){if(!this.stockChart){var e=this.border.width,t=this.backgroundImage,r=t?"transparent":this.background||this.themeStyle.background,o=new Di(this.element.id+"_ChartBorder",r,this.border,1,new i.Rect(.5*e,.5*e,this.availableSize.width-e,this.availableSize.height-e));if(this.htmlObject=Fe(this.redraw,this.element.id+"_ChartBorder",o,this.renderer)||this.renderer.drawRectangle(o),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw),t){var n=new Bi(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"_ChartBackground","visible","none");this.htmlObject=Fe(this.redraw,this.element.id+"_ChartBackground",n,this.renderer)||this.renderer.drawImage(n),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw)}}},o.prototype.renderAreaBorder=function(){if("PolarRadar"===this.chartAreaType)return null;var e=he(this.element.id+"_ChartAreaBorder"),t=e?new i.Rect(+e.getAttribute("x"),+e.getAttribute("y"),+e.getAttribute("width"),+e.getAttribute("height")):null,r=new Di(this.element.id+"_ChartAreaBorder",this.chartArea.background,{width:this.chartArea.border.width,color:this.chartArea.border.color||this.themeStyle.areaBorder},this.chartArea.opacity,this.chartAxisLayoutPanel.seriesClipRect);this.htmlObject=this.renderer.drawRectangle(r),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0,t),this.htmlObject=null;var o=this.chartArea.backgroundImage;if(o){var n=this.chartArea.border.width,a=new Bi(this.initialClipRect.height-n,this.initialClipRect.width-n,o,this.initialClipRect.x,this.initialClipRect.y,this.element.id+"_ChartAreaBackground","visible","none");this.htmlObject=this.renderer.drawImage(a),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0)}},o.prototype.addSeries=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r=new nr(this,"series",r),this.series.push(r)}this.refresh()},o.prototype.removeSeries=function(e){this.redraw=!1,this.series.splice(e,1),this.refresh()},o.prototype.clearSeries=function(){this.series=[],this.refresh()},o.prototype.addAxes=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r=new ki(this,"axes",r),this.isBlazor&&(r.interval=isNaN(r.interval)?null:r.interval,r.desiredIntervals=isNaN(r.desiredIntervals)?null:r.desiredIntervals),this.axes.push(r)}this.refresh()},o.prototype.removeAxis=function(e){this.redraw=!1,this.axes.splice(e,1),this.refresh()},o.prototype.destroy=function(){this.scrollBarModule&&this.scrollBarModule.destroy(),this.markerRender&&(this.markerRender.removeEventListener(),this.markerRender=null),this.horizontalAxes=[],this.verticalAxes=[],this.visibleSeries=[],this.axisCollections=[],this.rotatedDataLabelCollections=[],this.seriesElements=null,this.chartAxisLayoutPanel=null,this.dataLabelCollections=null,this.dataLabelElements=null,this.yAxisElements=null,this.element&&(this.unWireEvents(),this.isReact&&this.clearTemplate(),r.prototype.destroy.call(this),this.enableCanvas||(this.removeSvg(),this.svgObject=null))},o.prototype.getModuleName=function(){return"chart"},o.prototype.getPersistData=function(){var e=["loaded","animationComplete","primaryXAxis","primaryYAxis"];return this.addOnPersist(e)},o.prototype.createChartSvg=function(){this.removeSvg(),He(this)},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.chartOnMouseDown),t.EventHandler.remove(this.element,i,this.mouseMove),t.EventHandler.remove(this.element,r,this.mouseEnd),t.EventHandler.remove(this.element,"click",this.chartOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.chartRightClick),t.EventHandler.remove(this.element,o,this.mouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.touchObject&&(this.touchObject.destroy(),this.touchObject=null)},o.prototype.wireEvents=function(){if(this.element){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.chartOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),t.EventHandler.add(this.element,"click",this.chartOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.chartRightClick,this),t.EventHandler.add(this.element,e,this.mouseLeave,this),this.resizeBound=this.chartResize.bind(this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.longPressBound=this.longPress.bind(this),this.touchObject=new t.Touch(this.element,{tapHold:this.longPressBound,tapHoldThreshold:500}),this.setStyle(this.element)}},o.prototype.chartRightClick=function(e){return!this.crosshair.enable||!this.crosshairModule||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.setStyle=function(e){var t=this.zoomSettings,i=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||this.crosshair.enable||"None"!==this.highlightMode;e.style.touchAction=i?"none":"element",e.style.msTouchAction=i?"none":"element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block",e.style.overflow="hidden"},o.prototype.isOrientation=function(){return"orientation"in window&&"onorientationchange"in window},o.prototype.longPress=function(e){return this.mouseX=e&&e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].clientX:0,this.mouseY=e&&e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].clientY:0,this.startMove=!0,this.setMouseXY(this.mouseX,this.mouseY),this.notify("tapHold",e),!1},o.prototype.setMouseXY=function(e,t){if(he(this.svgId)){var i=he(this.svgId).getBoundingClientRect(),r=this.element.getBoundingClientRect();this.mouseY=t-r.top-Math.max(i.top-r.top,0),this.mouseX=e-r.left-Math.max(i.left-r.left,0)}},o.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport&&this.exportModule.getDataUrl(this))},o.prototype.chartResize=function(){var e=this;this.animateSeries=!1;var t={chart:this.isBlazor?{}:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)},r={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger("beforeResize",r),r.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){if(e.isDestroyed||e.stockChart)return void clearTimeout(e.resizeTo);e.createChartSvg(),t.currentSize=e.availableSize,e.trigger("resized",t),e.refreshAxis(),e.refreshBound(),e.trigger("loaded",{chart:e.isBlazor?{}:e})},500)),!1},o.prototype.mouseMove=function(e){var t,i,r;return"touchmove"===e.type?(this.isTouch=!0,t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,i=e.clientY),he(this.svgId)&&(this.setMouseXY(t,i),this.chartOnMouseMove(e)),!1},o.prototype.mouseLeave=function(e){var t,i,r;return"touchleave"===e.type?(this.isTouch=!0,t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,i=e.clientY),this.setMouseXY(t,i),this.chartOnMouseLeave(e),!1},o.prototype.chartOnMouseLeave=function(e){var i=e.target,r=t.Browser.isPointer?"pointerleave":"mouseleave";return this.trigger("chartMouseLeave",{target:i.id,x:this.mouseX,y:this.mouseY}),m(this.element.id+"_EJ2_AxisLabel_Tooltip"),this.isChartDrag=this.isPointMouseDown=!1,this.notify(r,e),!1},o.prototype.chartOnMouseClick=function(e){var t=this,i=e.target;this.trigger("chartMouseClick",{target:i.id,x:this.mouseX,y:this.mouseY}),this.clickCount++;var r=0;if(this.isAngular){r=this.pointDoubleClick.observers.length>0?400:0}else r=this.pointDoubleClick?400:0;return 1===this.clickCount&&this.pointClick?this.singleClickTimer=+setTimeout(function(){t.clickCount=0,t.triggerPointEvent("pointClick",e)},r):2===this.clickCount&&this.pointDoubleClick&&(clearTimeout(this.singleClickTimer),this.clickCount=0,this.triggerPointEvent("pointDoubleClick",e)),this.axisLabelClick&&this.triggerAxisLabelClickEvent("axisLabelClick",e),this.notify("click",e),!1},o.prototype.triggerPointEvent=function(e,t){var i=t,r=new Zi(this).getData();r.series&&r.point&&this.trigger(e,{series:this.isBlazor?{}:r.series,point:r.point,seriesIndex:r.series.index,pointIndex:r.point.index,x:this.mouseX,y:this.mouseY,pageX:i.pageX,pageY:i.pageY})},o.prototype.triggerAxisLabelClickEvent=function(e,t){var i=t.target,r=t;if(-1!==i.id.indexOf("_AxisLabel_")){var o=i.id.split("_AxisLabel_"),n=+o[0].slice(-1),a=+o[1],s=this.axisCollections[n];!s.visible||0!==n&&1!==n||this.trigger(e,{chart:this,axis:s,text:s.visibleLabels[a].text,labelID:i.id,index:a,location:new Vi(r.pageX,r.pageY),value:s.visibleLabels[a].value})}},o.prototype.chartOnMouseMove=function(e){var i=e.target;return this.trigger("chartMouseMove",{target:i.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent("pointMove",e),this.isTouch||(this.titleTooltip(e,this.mouseX,this.mouseY),this.axisTooltip(e,this.mouseX,this.mouseY)),this.dataEditingModule&&this.dataEditingModule.pointMouseMove(e),this.notify(t.Browser.touchMoveEvent,e),this.isTouch=!1,!1},o.prototype.titleTooltip=function(e,t,i,r){var o=e.target.id,n=o===this.element.id+"_ChartTitle"||o===this.element.id+"_ChartSubTitle"||o.indexOf("_AxisTitle")>-1||o.indexOf("_legend_title")>-1,a=0;o.indexOf("_AxisTitle")>-1&&(a=parseInt(o.replace(this.element.id,"").replace("AxisLabel_","").split("_")[2],10)),n&&e.target.textContent.indexOf("...")>-1?f(o===this.element.id+"_ChartTitle"?this.title:o.indexOf("_AxisTitle")>-1?this.axisCollections[a].title:o.indexOf("_ChartSubTitle")>-1?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",he(this.element.id+"_Secondary_Element"),r):m(this.element.id+"_EJ2_Title_Tooltip")},o.prototype.axisTooltip=function(e,t,i,r){var o=e.target.id;if((o.indexOf("AxisLabel")>-1||o.indexOf("Axis_MultiLevelLabel")>-1)&&e.target.textContent.indexOf("...")>-1){var n=this.legendSettings.visible||""===this.primaryXAxis.title;f(this.findAxisLabel(o),t,i,this.element.offsetWidth,this.element.id+"_EJ2_AxisLabel_Tooltip",he(this.element.id+"_Secondary_Element"),r,n)}else m(this.element.id+"_EJ2_AxisLabel_Tooltip")},o.prototype.findAxisLabel=function(e){var t;return e.indexOf("AxisLabel")>-1?(t=e.replace(this.element.id,"").replace("AxisLabel_","").split("_"),this.axisCollections[parseInt(t[0],10)].visibleLabels[parseInt(t[1],10)].originalText):(t=e.replace(this.element.id,"").replace("Axis_MultiLevelLabel_Level_","").replace("Text_","").split("_"),this.axisCollections[parseInt(t[0],10)].multiLevelLabels[parseInt(t[1],10)].categories[parseInt(t[2],10)].text)},o.prototype.chartOnMouseDown=function(e){var i,r,o,n,a=t.Browser.isDevice?20:30,s=this.element.getBoundingClientRect(),l=e.target;this.trigger("chartMouseDown",{target:l.id,x:this.mouseX,y:this.mouseY}),"touchstart"===e.type?(this.isTouch=!0,i=(n=e).changedTouches[0].clientX,r=n.changedTouches[0].clientY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.clientX,r=e.clientY,o=e.target);var h=he(this.svgId).getBoundingClientRect();return this.mouseDownX=this.previousMouseMoveX=i-s.left-Math.max(h.left-s.left,0),this.mouseDownY=this.previousMouseMoveY=r-s.top-Math.max(h.top-s.top,0),this.isTouch&&(this.isDoubleTap=(new Date).getTime()<this.threshold&&-1===o.id.indexOf(this.element.id+"_Zooming_")&&(this.mouseDownX-a>=this.mouseX||this.mouseDownX+a>=this.mouseX)&&(this.mouseDownY-a>=this.mouseY||this.mouseDownY+a>=this.mouseY)&&(this.mouseX-a>=this.mouseDownX||this.mouseX+a>=this.mouseDownX)&&(this.mouseY-a>=this.mouseDownY||this.mouseY+a>=this.mouseDownY)),this.dataEditingModule&&this.dataEditingModule.pointMouseDown(),this.notify(t.Browser.touchStartEvent,e),!1},o.prototype.mouseEnd=function(e){var t,i,r;return"touchend"===e.type?(i=(r=e).changedTouches[0].clientX,this.isTouch=!0,t=r.changedTouches[0].clientY):(t=e.clientY,i=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(i,t),this.chartOnMouseUp(e),!1},o.prototype.chartOnMouseUp=function(e){var i=e.target;return this.trigger("chartMouseUp",{target:i.id,x:this.mouseX,y:this.mouseY}),this.isChartDrag=!1,this.isTouch&&(this.titleTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.axisTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.threshold=(new Date).getTime()+300),this.dataEditingModule&&this.dataEditingModule.pointMouseUp(),!this.enableCanvas&&this.seriesElements&&this.seriesElements.removeAttribute("clip-path"),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.setCulture=function(){this.intl=new t.Internationalization,this.setLocaleConstants(),this.localeObject=new t.L10n(this.getModuleName(),this.defaultLocalConstants,this.locale)},o.prototype.setAnnotationValue=function(e,t){var i,r=he(this.element.id+"_Annotation_Collections"),o=this.annotations[e];null!==t&&(o.content=t,r?(m(this.element.id+"_Annotation_"+e),i=this.createElement("div"),this.annotationModule.processAnnotation(o,e,i),r.appendChild(i.children[0])):this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element")))},o.prototype.setLocaleConstants=function(){this.defaultLocalConstants={ZoomIn:"Zoom in",Zoom:"Zoom",ZoomOut:"Zoom out",Pan:"Pan",Reset:"Reset",ResetZoom:"Reset Zoom"}},o.prototype.setTheme=function(){this.themeStyle=c(this.theme)},o.prototype.requiredModules=function(){var e,t=this,i=[],r=this.series,o=!1,n=!1,a=!1,s=!1,l=this.zoomSettings;return this.chartAreaType=r.length>0&&("Polar"===r[0].type||"Radar"===r[0].type)?"PolarRadar":"Cartesian",this.tooltip.enable&&i.push({member:"Tooltip",args:[this]}),r.map(function(o){t.isLegend=t.legendSettings.visible&&(""!==o.name||!!t.isLegend),e=-1!==o.type.indexOf("100")?o.type.replace("100","")+"Series":o.type+"Series",n=o.errorBar.visible||n,s=o.marker.dataLabel.visible||s,a=o.dragSettings.enable||a,i.some(function(t){return t.member===e})||i.push({member:e,args:[t,r]}),"PolarRadar"===t.chartAreaType&&i.push({member:o.drawType+"Series",args:[t,r]}),"Pareto"===o.type&&(i.push({member:"ColumnSeries",args:[t,r]}),i.push({member:"LineSeries",args:[t,r]}))}),this.findIndicatorModules(i),this.findTrendLineModules(i),i=this.findAxisModule(i),o=this.annotations.some(function(e){return null!==e.content}),n&&i.push({member:"ErrorBar",args:[this,r]}),this.isLegend&&i.push({member:"Legend",args:[this]}),(this.enableExport||this.allowExport)&&i.push({member:"Export",args:[this]}),"PolarRadar"!==this.chartAreaType&&!this.scrollSettingEnabled&&(l.enableSelectionZooming||l.enableMouseWheelZooming||l.enablePinchZooming||l.enablePan||l.enableScrollbar)&&(i.push({member:"Zoom",args:[this,this.zoomSettings]}),l.enableScrollbar&&i.push({member:"ScrollBar",args:[this]})),"None"===this.selectionMode||"PolarRadar"===this.chartAreaType&&this.selectionMode.indexOf("Drag")>-1||i.push({member:"Selection",args:[this]}),"None"!==this.highlightMode&&i.push({member:"Highlight",args:[this]}),s&&i.push({member:"DataLabel",args:[this,r]}),a&&i.push({member:"DataEditing",args:[this]}),o&&i.push({member:"Annotation",args:[this]}),"PolarRadar"!==this.chartAreaType&&this.crosshair.enable&&i.push({member:"Crosshair",args:[this]}),i},o.prototype.findAxisModule=function(e){var t=[];t.push(this.primaryXAxis),t.push(this.primaryYAxis);for(var i=!1,r=!1,o=!1,n=!1,a=!1,s=!1,l=0,h=t=t.concat(this.axes);l<h.length;l++){var c=h[l];i="DateTime"===c.valueType||i,r="Category"===c.valueType||r,o="Logarithmic"===c.valueType||o,a="DateTimeCategory"===c.valueType||a,n=this.findStriplineVisibility(c.stripLines)||n,s=c.multiLevelLabels.length>0||s,this.scrollSettingEnabled=!!c.scrollbarSettings.enable||this.scrollSettingEnabled}return i&&e.push({member:"DateTime",args:[this]}),r&&e.push({member:"Category",args:[this]}),o&&e.push({member:"Logarithmic",args:[this]}),n&&e.push({member:"StripLine",args:[this]}),s&&e.push({member:"MultiLevelLabel",args:[this]}),a&&e.push({member:"DateTimeCategory",args:[this]}),this.scrollSettingEnabled&&e.push({member:"ScrollBar",args:[this]}),e},o.prototype.findIndicatorModules=function(e){var t,i,r=this.indicators;if(this.indicators.length){e.push({member:"LineSeries",args:[this]}),r.map(function(e){t=t||"Macd"===e.type,i=i||"BollingerBands"===e.type}),t&&e.push({member:"ColumnSeries",args:[this]}),i&&e.push({member:"RangeAreaSeries",args:[this]}),i&&e.push({member:"SplineRangeAreaSeries",args:[this]});for(var o=0,n=this.indicators;o<n.length;o++){var a=n[o];e.push({member:a.type+"Indicator",args:[this]})}}},o.prototype.findTrendLineModules=function(e){for(var t,i,r=this,o=0,n=this.series;o<n.length;o++)!function(o){var n;o.trendlines.map(function(e){n=n||e.marker.visible,t=!(!t&&"Linear"!==e.type&&"MovingAverage"!==e.type),i=!(!i&&t)}),n&&e.push({member:"Marker",args:[r,o]})}(n[o]);(t||i)&&e.push({member:"TrendLine",args:[this]}),t&&e.push({member:"LineSeries",args:[this]}),i&&e.push({member:"SplineSeries",args:[this]})},o.prototype.findStriplineVisibility=function(e){for(var t=!1,i=0,r=e;i<r.length;i++)if(r[i].visible){t=!0;break}return t},o.prototype.removeSvg=function(){if(this.redraw)return null;if(Ue(this),this.enableCanvas&&this.svgObject&&"CANVAS"===this.svgObject.tagName)return this.renderer.clearRect(new i.Rect(0,0,this.availableSize.width,this.availableSize.height)),this.svgObject.parentNode&&t.remove(this.svgObject),null;m(this.element.id+"_Secondary_Element"),this.isReact&&this.clearTemplate();var e=0;if(this.zoomModule&&this.zoomModule.pinchTarget&&(this.zoomModule.pinchTarget.id="",this.zoomModule.pinchTarget.setAttribute("opacity","0"),this.svgObject.appendChild(this.zoomModule.pinchTarget),e=1),!t.isNullOrUndefined(this.resizeTo)){if(this.resizeTo!==this.checkResize&&this.isBlazor&&this.element.childElementCount)for(var r=document.querySelectorAll(".e-chart"),o=0;o<r.length;o++)for(var n=r[o];n.firstChild;)t.remove(n.firstChild);this.checkResize=this.resizeTo}if(this.svgObject){for(;this.svgObject.childNodes.length>e;)this.svgObject.removeChild(this.svgObject.firstChild);this.svgObject.hasChildNodes()||!this.svgObject.parentNode||this.stockChart||t.remove(this.svgObject)}},o.prototype.refreshDefinition=function(e){for(var t=0,i=e;t<i.length;t++)i[t].axes=[]},o.prototype.refreshAxis=function(){var e=this.primaryXAxis;e.rect=new i.Rect(void 0,void 0,0,0),(e=this.primaryYAxis).isStack100=!1,e.rect=new i.Rect(void 0,void 0,0,0);for(var t=0,r=this.axes;t<r.length;t++)(e=a=r[t]).rect=new i.Rect(void 0,void 0,0,0),e.isStack100=!1;if(this.paretoSeriesModule&&"Pareto"===this.series[0].type)for(var o=0,n=this.paretoSeriesModule.paretoAxes;o<n.length;o++){var a=n[o];(e=a).rect=new i.Rect(void 0,void 0,0,0),e.isStack100=!1}},o.prototype.axisChange=function(e){return!(!e.name&&!e.valueType)&&(this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(),!0)},o.prototype.getVisibleSeries=function(e,t){for(var i=0,r=e;i<r.length;i++){var o=r[i];if(t===o.index)return o}return null},o.prototype.refreshLiveData=function(){this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),this.isBlazor||(this.enableCanvas?this.createChartSvg():this.removeSvg(),this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}))},o.prototype.removeStyles=function(){m(this.element.id+"_ej2_chart_selection"),m(this.element.id+"_ej2_chart_highlight")},o.prototype.onPropertyChanged=function(e,i){var r=!1,o=!1;if(this.animateSeries=!1,!this.delayRedraw){for(var n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"primaryXAxis":o=this.axisChange(e.primaryXAxis),e.primaryXAxis.edgeLabelPlacement&&(r=!0),e.primaryXAxis.crosshairTooltip||(o=!0);break;case"primaryYAxis":o=this.axisChange(e.primaryYAxis),e.primaryYAxis.edgeLabelPlacement&&(r=!0),e.primaryYAxis.crosshairTooltip||(o=!0);break;case"axes":for(var s=0,l=Object.keys(e.axes);s<l.length;s++){var h=l[s];o=o||this.axisChange(e.axes[h]),e.axes[h].crosshairTooltip||(o=!0)}break;case"height":case"width":this.createChartSvg(),o=!0;break;case"subTitle":case"title":o=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?o=!0:r=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?o=!0:r=!0;break;case"border":r=!0;break;case"dataSource":this.processData(!1),o=!0;break;case"enableCanvas":this.refresh();break;case"series":for(var c=this.series.length,d=!1,p=void 0,u=void 0,g=0;g<c;g++)p=e.series[g],this.isBlazor&&p&&(p.visible!==i.series[g].visible||p.isClosed||p.marker||p.emptyPointSettings||p.type||p.boxPlotMode||p.showMean)&&(u=!0),p&&(p.dataSource||p.query||p.errorBar||p.xName||p.yName||p.size||p.high||p.low||p.open||p.close||p.fill||p.name||p.marker||u)&&(t.extend(this.getVisibleSeries(this.visibleSeries,g),p,null,!0),d=!0);d&&(this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),o=!0);break;case"indicators":o=!0;break;case"zoomSettings":(e.zoomSettings.enableScrollbar||i.zoomSettings.enableScrollbar)&&(o=!0),r=!0;break;case"background":r=!0;break;case"chartArea":e.chartArea.border&&e.chartArea.border.width&&(o=!0),r=!0;break;case"legendSettings":e.legendSettings.background&&e.legendSettings.opacity||(o=!0),r=!0;break;case"palettes":this.calculateVisibleSeries(),r=!0;break;case"selectedDataIndexes":case"selectionMode":this.selectionModule&&e.selectionMode&&-1===e.selectionMode.indexOf("Drag")&&(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,i.selectionMode,!0));break;case"isMultiSelect":this.selectionModule&&!e.isMultiSelect&&this.selectionModule.selectedDataIndexes.length>1&&(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,i.selectionMode));break;case"highlightMode":case"selectionPattern":case"highlightPattern":this.removeStyles(),r=!0;break;case"theme":this.animateSeries=!0;break;case"locale":case"currencyCode":this.isBlazor?(this.setCulture(),r=!0):this.refresh();break;case"tooltip":this.tooltipModule&&(this.tooltipModule.previousPoints=[])}!o&&r&&(this.removeSvg(),this.renderElements(),this.trigger("loaded",{chart:this.isBlazor?{}:this})),o&&(this.enableCanvas?this.createChartSvg():this.removeSvg(),this.isReact&&this.clearTemplate(),this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}),this.redraw=!1,this.animated=!1)}},Sr([t.Property(null)],o.prototype,"width",void 0),Sr([t.Property(null)],o.prototype,"height",void 0),Sr([t.Property("")],o.prototype,"title",void 0),Sr([t.Property("")],o.prototype,"dataSource",void 0),Sr([t.Complex(e.Theme.chartTitleFont,Xt)],o.prototype,"titleStyle",void 0),Sr([t.Property("")],o.prototype,"subTitle",void 0),Sr([t.Complex(e.Theme.chartSubTitleFont,Xt)],o.prototype,"subTitleStyle",void 0),Sr([t.Complex({},Ut)],o.prototype,"margin",void 0),Sr([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),Sr([t.Property(null)],o.prototype,"background",void 0),Sr([t.Complex({border:{color:null,width:.5},background:"transparent"},Wt)],o.prototype,"chartArea",void 0),Sr([t.Complex({name:"primaryXAxis"},ki)],o.prototype,"primaryXAxis",void 0),Sr([t.Complex({name:"primaryYAxis"},ki)],o.prototype,"primaryYAxis",void 0),Sr([t.Collection([{}],wi)],o.prototype,"rows",void 0),Sr([t.Collection([{}],Si)],o.prototype,"columns",void 0),Sr([t.Collection([{}],ki)],o.prototype,"axes",void 0),Sr([t.Collection([{}],nr)],o.prototype,"series",void 0),Sr([t.Collection([{}],pi)],o.prototype,"annotations",void 0),Sr([t.Property([])],o.prototype,"palettes",void 0),Sr([t.Property("Material")],o.prototype,"theme",void 0),Sr([t.Complex({},ti)],o.prototype,"tooltip",void 0),Sr([t.Complex({},Pr)],o.prototype,"crosshair",void 0),Sr([t.Complex({},gr)],o.prototype,"legendSettings",void 0),Sr([t.Collection([{}],Cr)],o.prototype,"rangeColorSettings",void 0),Sr([t.Complex({},Lr)],o.prototype,"zoomSettings",void 0),Sr([t.Property("None")],o.prototype,"selectionMode",void 0),Sr([t.Property("None")],o.prototype,"highlightMode",void 0),Sr([t.Property("None")],o.prototype,"selectionPattern",void 0),Sr([t.Property("None")],o.prototype,"highlightPattern",void 0),Sr([t.Property(!1)],o.prototype,"isMultiSelect",void 0),Sr([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),Sr([t.Property(!0)],o.prototype,"enableExport",void 0),Sr([t.Property(!1)],o.prototype,"allowExport",void 0),Sr([t.Collection([],Qt)],o.prototype,"selectedDataIndexes",void 0),Sr([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Sr([t.Property(!1)],o.prototype,"enableAutoIntervalOnBothAxis",void 0),Sr([t.Property(!1)],o.prototype,"isTransposed",void 0),Sr([t.Property(!1)],o.prototype,"enableCanvas",void 0),Sr([t.Property(null)],o.prototype,"backgroundImage",void 0),Sr([t.Collection([],br)],o.prototype,"indicators",void 0),Sr([t.Property(!0)],o.prototype,"enableAnimation",void 0),Sr([t.Property(null)],o.prototype,"description",void 0),Sr([t.Property(1)],o.prototype,"tabIndex",void 0),Sr([t.Property(!0)],o.prototype,"enableSideBySidePlacement",void 0),Sr([t.Event()],o.prototype,"resized",void 0),Sr([t.Event()],o.prototype,"beforeResize",void 0),Sr([t.Event()],o.prototype,"annotationRender",void 0),Sr([t.Event()],o.prototype,"beforePrint",void 0),Sr([t.Event()],o.prototype,"loaded",void 0),Sr([t.Event()],o.prototype,"beforeExport",void 0),Sr([t.Event()],o.prototype,"afterExport",void 0),Sr([t.Event()],o.prototype,"load",void 0),Sr([t.Event()],o.prototype,"animationComplete",void 0),Sr([t.Event()],o.prototype,"legendRender",void 0),Sr([t.Event()],o.prototype,"textRender",void 0),Sr([t.Event()],o.prototype,"pointRender",void 0),Sr([t.Event()],o.prototype,"seriesRender",void 0),Sr([t.Event()],o.prototype,"axisLabelRender",void 0),Sr([t.Event()],o.prototype,"axisLabelClick",void 0),Sr([t.Event()],o.prototype,"axisRangeCalculated",void 0),Sr([t.Event()],o.prototype,"axisMultiLabelRender",void 0),Sr([t.Event()],o.prototype,"legendClick",void 0),Sr([t.Event()],o.prototype,"multiLevelLabelClick",void 0),Sr([t.Event()],o.prototype,"tooltipRender",void 0),Sr([t.Event()],o.prototype,"sharedTooltipRender",void 0),Sr([t.Event()],o.prototype,"chartMouseMove",void 0),Sr([t.Event()],o.prototype,"chartMouseClick",void 0),Sr([t.Event()],o.prototype,"pointClick",void 0),Sr([t.Event()],o.prototype,"pointDoubleClick",void 0),Sr([t.Event()],o.prototype,"pointMove",void 0),Sr([t.Event()],o.prototype,"chartMouseLeave",void 0),Sr([t.Event()],o.prototype,"chartMouseDown",void 0),Sr([t.Event()],o.prototype,"chartMouseUp",void 0),Sr([t.Event()],o.prototype,"dragComplete",void 0),Sr([t.Event()],o.prototype,"selectionComplete",void 0),Sr([t.Event()],o.prototype,"zoomComplete",void 0),Sr([t.Event()],o.prototype,"onZooming",void 0),Sr([t.Event()],o.prototype,"scrollStart",void 0),Sr([t.Event()],o.prototype,"scrollEnd",void 0),Sr([t.Event()],o.prototype,"scrollChanged",void 0),Sr([t.Event()],o.prototype,"dragStart",void 0),Sr([t.Event()],o.prototype,"drag",void 0),Sr([t.Event()],o.prototype,"dragEnd",void 0),Sr([t.Property("USD")],o.prototype,"currencyCode",void 0),o=Sr([t.NotifyPropertyChanges],o)}(t.Component),Mr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Mr(t,e),t.prototype.calculateDateTimeNiceInterval=function(e,t,i,r,o){void 0===o&&(o=!0);var n,a=new Date(i),s=new Date(r),l=Math.abs((a.getTime()-s.getTime())/864e5);switch(e.actualIntervalType=e.intervalType,e.intervalType){case"Years":n=this.calculateNumericNiceInterval(e,l/365,t);break;case"Quarter":n=this.calculateNumericNiceInterval(e,l/365*4,t);break;case"Months":n=this.calculateNumericNiceInterval(e,l/30,t);break;case"Weeks":n=this.calculateNumericNiceInterval(e,l/7,t);break;case"Days":n=this.calculateNumericNiceInterval(e,l,t);break;case"Hours":n=this.calculateNumericNiceInterval(e,24*l,t);break;case"Minutes":n=this.calculateNumericNiceInterval(e,24*l*60,t);break;case"Seconds":n=this.calculateNumericNiceInterval(e,24*l*60*60,t);break;case"Auto":return(n=this.calculateNumericNiceInterval(e,l/365,t))>=1?(e.actualIntervalType="Years",n):(n=this.calculateNumericNiceInterval(e,l/365*4,t))>=1&&!o?(e.actualIntervalType="Quarter",n):(n=this.calculateNumericNiceInterval(e,l/30,t))>=1?(e.actualIntervalType="Months",n):(n=this.calculateNumericNiceInterval(e,l/7,t))>=1&&!o?(e.actualIntervalType="Weeks",n):(n=this.calculateNumericNiceInterval(e,l,t))>=1?(e.actualIntervalType="Days",n):(n=this.calculateNumericNiceInterval(e,24*l,t))>=1?(e.actualIntervalType="Hours",n):(n=this.calculateNumericNiceInterval(e,24*l*60,t))>=1?(e.actualIntervalType="Minutes",n):(n=this.calculateNumericNiceInterval(e,24*l*60*60,t),e.actualIntervalType="Seconds",n)}return n},t.prototype.getSkeleton=function(e,t,i,r){var o,n=e.actualIntervalType;return e.skeleton?e.skeleton:("Years"===n?o=r?e.isChart?(e.valueType,"y"):"y":e.isChart?"DateTime"===e.valueType&&e.isIntervalInDecimal?"y":"yMMM":"y":"Quarter"===n?o=r?"y":"yMMM":"Months"===n?r?(e.isChart,o="m"):o=e.isChart?"MMMd":"MMM":o="Weeks"===n?r?"m":"MEd":"Days"===n?r?"d":e.isChart?this.getDayFormat(e,t,i):"MMMd":"Hours"===n?r?"t":e.isChart?"DateTime"===e.valueType?"Hm":"EHm":"h":"Minutes"===n?r?"T":e.isChart?"Hms":"hm":r?"T":e.isChart?"Hms":"hms",o)},t.prototype.getMonthFormat=function(e,t,i){return new Date(t).getFullYear()===new Date(i).getFullYear()?e.isIntervalInDecimal?"MMM":"MMM d":"y MMM"},t.prototype.getDayFormat=function(e,t,i){return"DateTime"===e.valueType?new Date(t).getMonth()!==new Date(i).getMonth()?"MMMd":e.isIntervalInDecimal?"d":"Ehm":"yMd"},t.prototype.findCustomFormats=function(e,t,i){var r=e.labelFormat?e.labelFormat:"";return!e.isChart||e.skeleton||"Months"!==e.actualIntervalType||r||(r="DateTime"===e.valueType?this.getMonthFormat(e,t,i):"yMMM"),r},t}(ni),kr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tr=function(e){function i(t){return e.call(this,t)||this}return kr(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},i.prototype.getActualRange=function(e,t){var i={skeleton:"full",type:"dateTime"},o=this.chart.intl.getDateParser(i),n=this.chart.intl.getDateFormat(i);null!==e.minimum?this.min=this.chart.isBlazor?Date.parse(e.minimum.toString()):Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:e.minimum}).val)))):null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=Date.parse(o(n(new Date(1970,1,1))))),null!==e.maximum?this.max=this.chart.isBlazor?Date.parse(e.maximum.toString()):Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:e.maximum}).val)))):null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=Date.parse(o(n(new Date(1970,5,1))))),this.min===this.max&&(this.max=this.max+2592e6,this.min=this.min-2592e6),e.actualRange={},e.doubleRange=new oi(this.min,this.max);var a=this.calculateDateTimeNiceInterval(e,t,e.doubleRange.start,e.doubleRange.end);e.interval?e.actualRange.interval=e.interval:e.actualRange.interval=a,e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end},i.prototype.applyRangePadding=function(e,t){this.min=e.actualRange.min,this.max=e.actualRange.max;var i,r,o=e.actualRange.interval;if(!te(e)){var n=e.getRangePadding(this.chart);i=new Date(this.min),r=new Date(this.max);var a=e.actualIntervalType;if("None"===n)this.min=i.getTime(),this.max=r.getTime();else if("Additional"===n||"Round"===n)switch(a){case"Years":this.getYear(i,r,n,o);break;case"Months":this.getMonth(i,r,n,o);break;case"Days":this.getDay(i,r,n,o);break;case"Hours":this.getHour(i,r,n,o);break;case"Minutes":var s=i.getMinutes()/o*o,l=r.getMinutes()+(i.getMinutes()-s);"Round"===n?(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),s,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,59).getTime()):(this.min=new Date(i.getFullYear(),r.getMonth(),i.getDate(),i.getHours(),s+-o,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l+o,0).getTime());break;case"Seconds":var h=i.getSeconds()/o*o,c=r.getSeconds()+(i.getSeconds()-h);"Round"===n?(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),h,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),c,0).getTime()):(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),h+-o,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),c+o,0).getTime())}}e.actualRange.min=(e.minimum,this.min),e.actualRange.max=(e.maximum,this.max),e.actualRange.delta=e.actualRange.max-e.actualRange.min,e.doubleRange=new oi(e.actualRange.min,e.actualRange.max),this.calculateVisibleRange(t,e)},i.prototype.getYear=function(e,t,i,r){var o=e.getFullYear(),n=t.getFullYear();"Additional"===i?(this.min=new Date(o-r,1,1,0,0,0).getTime(),this.max=new Date(n+r,1,1,0,0,0).getTime()):(this.min=new Date(o,0,0,0,0,0).getTime(),this.max=new Date(n,11,30,23,59,59).getTime())},i.prototype.getMonth=function(e,t,i,r){var o=e.getMonth(),n=t.getMonth();"Round"===i?(this.min=new Date(e.getFullYear(),o,0,0,0,0).getTime(),this.max=new Date(t.getFullYear(),n,new Date(t.getFullYear(),t.getMonth(),0).getDate(),23,59,59).getTime()):(this.min=new Date(e.getFullYear(),o+-r,1,0,0,0).getTime(),this.max=new Date(t.getFullYear(),n+r,2===n?28:30,0,0,0).getTime())},i.prototype.getDay=function(e,t,i,r){var o=e.getDate(),n=t.getDate();"Round"===i?(this.min=new Date(e.getFullYear(),e.getMonth(),o,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),n,23,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),o+-r,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),n+r,0,0,0).getTime())},i.prototype.getHour=function(e,t,i,r){var o=e.getHours()/r*r,n=t.getHours()+(e.getHours()-o);"Round"===i?(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o+-r,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n+r,0,0).getTime())},i.prototype.calculateVisibleRange=function(e,i){i.visibleRange={min:i.actualRange.min,max:i.actualRange.max,interval:i.actualRange.interval,delta:i.actualRange.delta};var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;ie(i)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.calculateAxisRange(e,this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming?this.calculateDateTimeNiceInterval(i,e,i.visibleRange.min,i.visibleRange.max):i.visibleRange.interval),i.dateTimeInterval=this.increaseDateTimeInterval(i,i.visibleRange.min,i.visibleRange.interval).getTime()-i.visibleRange.min,i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval)},i.prototype.calculateVisibleLabels=function(e,i){e.visibleLabels=[];var r,o,n=e.visibleRange.min,a=e.visibleLabels;for(te(e)||(n=this.alignRangeStart(e,n,e.visibleRange.interval).getTime());n<=e.visibleRange.max;)r=t.extend({},t.getValue("properties",e.labelStyle),null,!0),o=a.length?e.visibleLabels[a.length-1].value:n,e.format=i.intl.getDateFormat({format:this.findCustomFormats(e,n,o)||this.blazorCustomFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,n,o,i.isBlazor)}),e.startLabel=e.format(new Date(e.visibleRange.min)),e.endLabel=e.format(new Date(e.visibleRange.max)),x(n,e.visibleRange)&&ee(i,n,e.format(new Date(n)),r,e),n=this.increaseDateTimeInterval(e,n,e.visibleRange.interval).getTime();"Months"!==e.actualIntervalType&&"Days"!==e.actualIntervalType||!e.isChart||(e.format=i.intl.getDateFormat({format:e.labelFormat||("Months"!==e.actualIntervalType||e.skeleton?"":"y MMM"),type:G(e.skeletonType),skeleton:e.skeleton||("Days"===e.actualIntervalType?"MMMd":"")})),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor?"Years"===e.actualIntervalType?e.isIntervalInDecimal?"yyyy":"MMM y":"Days"!==e.actualIntervalType||e.isIntervalInDecimal?"":"ddd HH tt":""},i.prototype.increaseDateTimeInterval=function(e,t,i){var r=new Date(t);e.interval?(e.isIntervalInDecimal=i%1==0,e.visibleRange.interval=i):(i=Math.ceil(i),e.visibleRange.interval=i);var o=e.actualIntervalType;if(e.isIntervalInDecimal)switch(o){case"Years":return r.setFullYear(r.getFullYear()+i),r;case"Quarter":return r.setMonth(r.getMonth()+3*i),r;case"Months":return r.setMonth(r.getMonth()+i),r;case"Weeks":return r.setDate(r.getDate()+7*i),r;case"Days":return r.setDate(r.getDate()+i),r;case"Hours":return r.setHours(r.getHours()+i),r;case"Minutes":return r.setMinutes(r.getMinutes()+i),r;case"Seconds":return r.setSeconds(r.getSeconds()+i),r}else r=this.getDecimalInterval(r,i,o);return r},i.prototype.alignRangeStart=function(e,t,i){var r=new Date(t);switch(e.actualIntervalType){case"Years":var o=Math.floor(Math.floor(r.getFullYear()/i)*i);return r=new Date(o,r.getMonth(),r.getDate(),0,0,0);case"Months":var n=Math.floor(Math.floor(r.getMonth()/i)*i);return r=new Date(r.getFullYear(),n,r.getDate(),0,0,0);case"Days":var a=Math.floor(Math.floor(r.getDate()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),a,0,0,0);case"Hours":var s=Math.floor(Math.floor(r.getHours()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),s,0,0);case"Minutes":var l=Math.floor(Math.floor(r.getMinutes()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,0,0);case"Seconds":var h=Math.floor(Math.floor(r.getSeconds()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),h,0)}return r},i.prototype.getDecimalInterval=function(e,t,i){var r=Math.floor(t),o=t-r;switch(i){case"Years":var n=Math.round(12*o);return e.setFullYear(e.getFullYear()+r),e.setMonth(e.getMonth()+n),e;case"Quarter":return e.setMonth(e.getMonth()+3*t),e;case"Months":var a=Math.round(30*o);return e.setMonth(e.getMonth()+r),e.setDate(e.getDate()+a),e;case"Weeks":return e.setDate(e.getDate()+7*t),e;case"Days":var s=Math.round(24*o);return e.setDate(e.getDate()+r),e.setHours(e.getHours()+s),e;case"Hours":var l=Math.round(60*o);return e.setHours(e.getHours()+r),e.setMinutes(e.getMinutes()+l),e;case"Minutes":var h=Math.round(60*o);return e.setMinutes(e.getMinutes()+r),e.setSeconds(e.getSeconds()+h),e;case"Seconds":var c=Math.round(1e3*o);return e.setSeconds(e.getSeconds()+r),e.setMilliseconds(e.getMilliseconds()+c),e}return e},i.prototype.getModuleName=function(){return"DateTime"},i.prototype.destroy=function(){},i}(Ar),_r=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Or=function(e){function i(t){return e.call(this,t)||this}return _r(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},i.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),e.actualRange={},e.interval?e.actualRange.interval=Math.ceil(e.interval):e.actualRange.interval=Math.max(1,Math.floor(e.doubleRange.delta/re(t,e))),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end,e.actualRange.delta=e.doubleRange.delta},i.prototype.applyRangePadding=function(e,t){var i="BetweenTicks"===e.labelPlacement&&"PolarRadar"!==this.chart.chartAreaType?.5:0;i>0?(e.actualRange.min-=i,e.actualRange.max+=i):e.actualRange.max+=e.actualRange.max?0:.5,e.doubleRange=new oi(e.actualRange.min,e.actualRange.max),e.actualRange.delta=e.doubleRange.delta,this.calculateVisibleRange(t,e)},i.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var i,r=Math.ceil(e.visibleRange.min);(e.zoomFactor<1||e.zoomPosition>0)&&(r=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var o;for(e.startLabel=e.labels[Math.round(e.visibleRange.min)],e.endLabel=e.labels[Math.floor(e.visibleRange.max)];r<=e.visibleRange.max;r+=e.visibleRange.interval)i=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(r,e.visibleRange)&&e.labels.length>0&&(o=Math.round(r),ee(this.chart,o,e.labels[o]?e.labels[o].toString():o.toString(),i,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.getModuleName=function(){return"Category"},i.prototype.destroy=function(){},i}(Ar),Er=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ir=function(e){function i(t){return e.call(this,t)||this}return Er(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.calculateVisibleRange(e,t),this.calculateVisibleLabels(t,this.chart)},i.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),this.min=this.min<0?0:this.min;var i=v(this.min,e.logBase);i=isFinite(i)?i:this.min;var r=1===this.max?1:v(this.max,e.logBase);r=isFinite(i)?r:this.max,this.min=Math.floor(i/1),e.series&&e.series.some(function(e){return(-1!==e.type.indexOf("Column")||-1!==e.type.indexOf("Bar"))&&-1===e.type.indexOf("Range")})&&(this.min=this.min<=0?+this.min-1:this.min),this.max=Math.ceil(r/1),e.actualRange.interval=e.interval||this.calculateLogNiceInterval(this.max-this.min,t,e),e.actualRange.min=this.min,e.actualRange.max=this.max,e.actualRange.delta=this.max-this.min},i.prototype.calculateVisibleRange=function(e,i){i.visibleRange={interval:i.actualRange.interval,max:i.actualRange.max,min:i.actualRange.min,delta:i.actualRange.delta};var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;(i.zoomFactor<1||i.zoomPosition>0)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming?this.calculateLogNiceInterval(i.doubleRange.delta,e,i):i.visibleRange.interval,i.visibleRange.interval=0===Math.floor(i.visibleRange.interval)?1:Math.floor(i.visibleRange.interval),i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval))},i.prototype.calculateLogNiceInterval=function(e,t,i){for(var r=re(t,i),o=e,n=Math.pow(i.logBase,Math.floor(v(o,10))),a=0,s=i.intervalDivs.length;a<s;a++){var l=n*i.intervalDivs[a];if(r<e/l)break;o=l}return o},i.prototype.calculateVisibleLabels=function(e,i){var r=e.visibleRange.min;e.visibleLabels=[];var o,n;(e.zoomFactor<1||e.zoomPosition>0)&&(r=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var a=this.getFormat(e),s=null!==a.match("{value}"),l=Math.pow(e.logBase,e.visibleRange.min);for(e.format=i.intl.getNumberFormat({format:s?"":a,useGrouping:i.useGroupingSeparator,maximumFractionDigits:l<1?20:3}),e.startLabel=e.format(l<1?+l.toPrecision(1):l),e.endLabel=e.format(Math.pow(e.logBase,e.visibleRange.max));r<=e.visibleRange.max;r+=e.visibleRange.interval)o=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(r,e.visibleRange)&&(n=Math.pow(e.logBase,r),ee(this.chart,r,this.formatValue(e,s,a,n<1?+n.toPrecision(1):n),o,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.getModuleName=function(){return"Logarithmic"},i.prototype.destroy=function(){},i}(ni),zr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dr=function(e){function i(t){return e.call(this,t)||this}return zr(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.axisSize=e,this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},i.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var i,r="BetweenTicks"===e.labelPlacement?.5:0;"Auto"===e.intervalType?this.calculateDateTimeNiceInterval(e,this.axisSize,parseInt(e.labels[0],10),parseInt(e.labels[e.labels.length-1],10)):e.actualIntervalType=e.intervalType,e.format=this.chart.intl.getDateFormat({format:e.labelFormat||this.blazorCustomFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,null,null,this.chart.isBlazor)});for(var o=0;o<e.labels.length;o++)i=t.extend({},t.getValue("properties",e.labelStyle),null,!0),this.sameInterval(e.labels.map(Number)[o],e.labels.map(Number)[o-1],e.actualIntervalType,o)&&!e.isIndexed||x(o-r,e.visibleRange)&&ee(this.chart,o,e.isIndexed?this.getIndexedAxisLabel(e.labels[o],e.format):e.format(new Date(e.labels.map(Number)[o])),i,e);e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor&&"Years"===e.actualIntervalType?"yyyy":""},i.prototype.getIndexedAxisLabel=function(e,t){for(var i=e.split(","),r=0;r<i.length;r++)i[r]=t(new Date(parseInt(i[r],10)));return i.join(", ")},i.prototype.sameInterval=function(e,t,i,r){var o;if(0===r)o=!1;else switch(i){case"Years":o=new Date(e).getFullYear()===new Date(t).getFullYear();break;case"Months":o=new Date(e).getFullYear()===new Date(t).getFullYear()&&new Date(e).getMonth()===new Date(t).getMonth();break;case"Days":o=Math.abs(e-t)<864e5&&new Date(e).getDay()===new Date(t).getDay();break;case"Hours":o=Math.abs(e-t)<36e5&&new Date(e).getDay()===new Date(t).getDay();break;case"Minutes":o=Math.abs(e-t)<6e4&&new Date(e).getMinutes()===new Date(t).getMinutes();break;case"Seconds":o=Math.abs(e-t)<1e3&&new Date(e).getDay()===new Date(t).getDay()}return o},i.prototype.getModuleName=function(){return"DateTimeCategory"},i.prototype.destroy=function(){},i}(Or),Br=function(){function e(){}return e.prototype.measureStripLine=function(e,t,r,o,n,a){var s,l,h=e.orientation,c="DateTime"===e.valueType;if(t.isRepeat&&null!==t.size)s=o,l=null;else if("DateTimeCategory"===e.valueType){var d=t.start,p=t.end;s=null!=d&&"number"!=typeof d?e.labels.indexOf(this.dateToMilliSeconds(d,a).toString()):d,l=null!=p&&"number"!=typeof p?e.labels.indexOf(this.dateToMilliSeconds(p,a).toString()):p}else s=null===t.start?null:c&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.start,a):+t.start,l=null===t.end?null:c&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.end,a):+t.end;var u=this.getFromTovalue(s,l,t.size,t.startFromAxis,e,t),g="Vertical"===h?(u.to-u.from)*e.rect.height:r.height,y="Horizontal"===h?(u.to-u.from)*e.rect.width:r.width,m="Vertical"===h?r.x:u.from*e.rect.width+e.rect.x,v="Horizontal"===h?r.y:e.rect.y+e.rect.height-("Pixel"===t.sizeType?u.from:u.to)*e.rect.height;if(t.isSegmented&&null!=t.segmentStart&&null!=t.segmentEnd&&"Pixel"!==t.sizeType){var d=c&&this.isCoreDate(t.segmentStart)?this.dateToMilliSeconds(t.segmentStart,a):+t.segmentStart,p=c&&this.isCoreDate(t.segmentEnd)?this.dateToMilliSeconds(t.segmentEnd,a):+t.segmentEnd,f=this.getFromTovalue(d,p,null,null,n,t);"Vertical"===n.orientation?(v=n.rect.y+n.rect.height-f.to*n.rect.height,g=(f.to-f.from)*n.rect.height):(m=f.from*n.rect.width+n.rect.x,y=(f.to-f.from)*n.rect.width)}return 0!==g&&0!==y||"Pixel"===t.sizeType&&(null!==t.start||t.startFromAxis)?new i.Rect(m,v,y,g):new i.Rect(0,0,0,0)},e.prototype.getFromTovalue=function(e,i,r,o,n,a){var s=!a.isRepeat&&o?n.visibleRange.min:e,l=this.getToValue(Math.max(e,t.isNullOrUndefined(i)?e:i),s,r,n,i,a);return s=this.findValue(s,n),l=this.findValue(l,n),{from:I(n.isInversed?l:s,n),to:I(n.isInversed?s:l,n)}},e.prototype.getToValue=function(e,t,i,r,o,n){var a=n.sizeType,s=null===o;if("DateTime"!==r.valueType)return"Pixel"===n.sizeType?t:s?t+i:e;var l=new Date(t);switch("Auto"===a&&(a=r.actualIntervalType,i*=r.visibleRange.interval),a){case"Years":return s?new Date(l.setFullYear(l.getFullYear()+i)):e;case"Months":return s?new Date(l.setMonth(l.getMonth()+i)):e;case"Days":return s?new Date(l.setDate(l.getDate()+i)):e;case"Hours":return s?new Date(l.setHours(l.getHours()+i)):e;case"Minutes":return s?new Date(l.setMinutes(l.getMinutes()+i)):e;case"Seconds":return s?new Date(l.setSeconds(l.getSeconds()+i)):e;default:return t}},e.prototype.findValue=function(e,t){return e<t.visibleRange.min?e=t.visibleRange.min:e>t.visibleRange.max&&(e=t.visibleRange.max),e},e.prototype.dateParse=function(e,t){var i=t.intl.getDateParser({skeleton:"full",type:"dateTime"}),o=t.intl.getDateFormat({skeleton:"full",type:"dateTime"});return new Date(Date.parse(i(o(new Date(r.DataUtil.parse.parseJson({val:e}).val)))))},e.prototype.renderStripLine=function(e,t,i){var r,o=e.element.id+"_stripline_"+t+"_",n=e.chartAxisLayoutPanel.seriesClipRect,a=0,s=0,l=null,h=new Di(o+"ClipRect","transparent",{width:1,color:"Gray"},1,{x:e.initialClipRect.x,y:e.initialClipRect.y,width:e.initialClipRect.width,height:e.initialClipRect.height}),c=e.renderer.createGroup({id:o+"collections","clip-path":"url(#"+o+"ClipRect)"});e.enableCanvas||c.appendChild(K(e.redraw,h,e.renderer));for(var d=0,p=i;d<p.length;d++)for(var u=p[d],g=0,y=0,m=u.stripLines;y<m.length;y++){var v=m[y];if(v.visible&&v.zIndex===t)if(v.isSegmented&&null!=v.segmentStart&&null!=v.segmentEnd&&"Pixel"!==v.sizeType&&(l=this.getSegmentAxis(i,u,v)),v.isRepeat&&null!=v.repeatEvery&&null!==v.size&&"Pixel"!==v.sizeType)for(a=null!=v.repeatUntil?"DateTime"===u.valueType?this.dateToMilliSeconds(v.repeatUntil,e):+v.repeatUntil:u.actualRange.max,s="DateTime"===u.valueType&&this.isCoreDate(v.start)?this.dateToMilliSeconds(v.start,e):v.start,(v.startFromAxis&&"DateTime"===u.valueType&&"Auto"===v.sizeType||v.start<u.visibleRange.min)&&(s=u.visibleLabels[0].value===u.visibleRange.min?u.visibleRange.min:u.visibleLabels[0].value-("DateTime"===u.valueType?u.dateTimeInterval:u.visibleRange.interval)),s=v.startFromAxis&&"DateTime"!==u.valueType?u.visibleRange.min:s;s<a;)r=x(s+("DateTime"===u.valueType?u.dateTimeInterval*+v.size:v.size),u.visibleRange),(s>=u.visibleRange.min&&s<u.visibleRange.max||r)&&this.renderStripLineElement(u,v,n,o,c,e,s,l,g),g++,s=this.getStartValue(u,v,s,e);else this.renderStripLineElement(u,v,n,o,c,e,null,l,g),g++}be(e.enableCanvas,e.svgObject,c,e.redraw)},e.prototype.isCoreDate=function(e){return"string"==typeof e},e.prototype.dateToMilliSeconds=function(e,t){return this.dateParse(e,t).getTime()},e.prototype.renderPath=function(e,t,r,o,n,a){var s=he(r),l=s?s.getAttribute("d"):"",h="Vertical"===a.orientation?"M"+t.x+" "+t.y+" L"+(t.x+t.width)+" "+t.y:"M"+t.x+" "+t.y+" L"+t.x+" "+(t.y+t.height);be(n.enableCanvas,o,n.renderer.drawPath(new i.PathOption(r,"none",e.size,e.color,e.opacity,e.dashArray,h)),n.redraw,!0,"x","y",null,l,!0)},e.prototype.renderRectangle=function(e,t,r,o,n){var a=he(r),s=a?new i.Rect(+a.getAttribute("x"),+a.getAttribute("y"),+a.getAttribute("width"),+a.getAttribute("height")):null;be(n.enableCanvas,o,n.renderer.drawRectangle(new Di(r,e.color,e.border,e.opacity,t,0,0,"",e.dashArray)),n.redraw,!0,"x","y",null,null,!0,!0,s)},e.prototype.renderText=function(e,t,r,o,n,a){var s,l=i.measureText(e.text,e.textStyle),h=null===e.rotation,c=h?l.height/8*3:0,d=t.y+t.height/2+c,p=h?"Vertical"===a.orientation?0:-90:e.rotation,u=t.x+t.width/2;"Horizontal"===a.orientation?(u=this.getTextStart(u+c*this.factor(e.horizontalAlignment),t.width,e.horizontalAlignment),d=this.getTextStart(d-c,t.height,e.verticalAlignment)+("Start"!==e.verticalAlignment||h?0:l.height/4),s=h?this.invertAlignment(e.verticalAlignment):e.horizontalAlignment):(u=this.getTextStart(u,t.width,e.horizontalAlignment),d=this.getTextStart(d+c*this.factor(e.verticalAlignment)-5,t.height,e.verticalAlignment),s=e.horizontalAlignment),Ve(n.renderer,new i.TextOption(r,u,d,s,e.text,"rotate("+p+" "+u+","+d+")","middle"),e.textStyle,e.textStyle.color,o,null,null,null,null,null,null,null,null,n.enableCanvas)},e.prototype.invertAlignment=function(e){switch(e){case"Start":e="End";break;case"End":e="Start"}return e},e.prototype.getStartValue=function(e,t,i,r){return"DateTime"===e.valueType?this.getToValue(null,i,+t.repeatEvery,e,null,t):i+ +t.repeatEvery},e.prototype.getSegmentAxis=function(e,t,i){var r;if(null==i.segmentAxisName)return"Horizontal"===t.orientation?e[1]:e[0];for(var o=0;o<e.length;o++)i.segmentAxisName===e[o].name&&(r=e[o]);return r},e.prototype.renderStripLineElement=function(e,t,i,r,o,n,a,s,l){var h=this.measureStripLine(e,t,i,a,s,n);"Pixel"===t.sizeType?this.renderPath(t,h,r+"path_"+e.name+"_"+l,o,n,e):0!==h.height&&0!==h.width&&this.renderRectangle(t,h,r+"rect_"+e.name+"_"+l,o,n),""!==t.text&&this.renderText(t,h,r+"text_"+e.name+"_"+l,o,n,e)},e.prototype.factor=function(e){var t=0;switch(e){case"Start":t=1;break;case"End":t=-1}return t},e.prototype.getTextStart=function(e,t,i){switch(i){case"Start":e=e-t/2+5;break;case"End":e=e+t/2-5}return e},e.prototype.getModuleName=function(){return"StripLine"},e.prototype.destroy=function(){},e}(),Fr=function(){function e(e){this.chart=e}return e.prototype.enableComplexProperty=function(e){for(var i=[],r=[],o=e.xAxis.visibleRange,n=e.yAxis.visibleRange,a=e.points,s=e.clipRect,l=Math.abs(o.delta/s.width),h=Math.abs(n.delta/s.height),c=a[0]&&a[0].x>l?0:l,d=a[0]&&a[0].y>h?0:h,p=0,u=0,g=0,y=a;g<y.length;g++){var m=y[g];m.symbolLocations=[],p=m.xValue?m.xValue:o.min,u=m.yValue?m.yValue:n.min,(Math.abs(c-p)>=l||Math.abs(d-u)>=h)&&(i.push(m),c=p,d=u)}for(var v,f=0;f<i.length;f++)v=i[f],t.isNullOrUndefined(v.x)||""===v.x||r.push(v);return r},e.prototype.getLineDirection=function(e,t,i,r,o,n){var a="";if(null!=e){var s=o(e.xValue,e.yValue,i.xAxis,i.yAxis,r,i),l=o(t.xValue,t.yValue,i.xAxis,i.yAxis,r,i);a=n+" "+s.x+" "+s.y+" L "+l.x+" "+l.y+" "}return a},e.prototype.appendLinePath=function(e,t,i){var r=he(e.id),o=t.chart,n=r?r.getAttribute("d"):null,a=t.chart.renderer.drawPath(e,new Int32Array([t.clipRect.x,t.clipRect.y]));a&&a.setAttribute("clip-path",i),t.pathElement=a,t.chart.enableCanvas||t.seriesElement.appendChild(a),t.isRectSeries=!1,J(r,e.d,t.chart.redraw,n,o.duration)},e.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},e.prototype.doProgressiveAnimation=function(e,i){var r,o=new t.Animation({}),n=e.pathElement,a=n.getAttribute("stroke-dasharray"),s=e.pathElement.getTotalLength();n.style.visibility="hidden",o.animate(n,{duration:i.duration,delay:i.delay,progress:function(e){e.timeStamp>=e.delay&&(n.style.visibility="visible",r=Math.abs(Math.round((e.timeStamp-e.delay)*s/e.duration)),n.setAttribute("stroke-dasharray",r+","+s))},end:function(){n.setAttribute("stroke-dasharray",a),e.chart.trigger("animationComplete",{series:e.chart.isBlazor?{}:e})}})},e.prototype.storePointLocation=function(e,t,r,o){var n=t.marker&&t.marker.width?t.marker.width:0,a=t.marker&&t.marker.height?t.marker.height:0;e.symbolLocations.push(o(e.xValue,e.yValue,t.xAxis,t.yAxis,r,t)),e.regions.push(new i.Rect(e.symbolLocations[0].x-n,e.symbolLocations[0].y-a,2*n,2*a))},e.prototype.withinYRange=function(e,t){return e.yValue>=t.visibleRange.min&&e.yValue<=t.visibleRange.max},e.prototype.getFirstLastVisiblePoint=function(e){for(var t=null,i=null,r=0,o=e;r<o.length;r++){var n=o[r];null===t&&n.visible&&(t=i=n),i=n.visible?n:i}return{first:t||e[0],last:i||e[e.length-1]}},e.prototype.doLinearAnimation=function(e,i){var r,o=e.clipRectElement.childNodes[0].childNodes[0],n=e.chart.animated?e.chart.duration:i.duration,a=Z("Linear"),s=+o.getAttribute("height"),l=+o.getAttribute("width"),h=+o.getAttribute("x"),c=e.chart.requireInvertedAxis?+o.getAttribute("height")+ +o.getAttribute("y"):+o.getAttribute("y");o.style.visibility="hidden",new t.Animation({}).animate(o,{duration:n,delay:i.delay,progress:function(t){t.timeStamp>=t.delay&&(o.style.visibility="visible",e.chart.requireInvertedAxis?(r=a(t.timeStamp-t.delay,0,s,t.duration),o.setAttribute("transform","translate("+h+" "+c+") scale(1,"+r/s+") translate("+-h+" "+-c+")")):(r=a(t.timeStamp-t.delay,0,l,t.duration),o.setAttribute("transform","translate("+h+" "+c+") scale("+r/l+", 1) translate("+-h+" "+-c+")")))},end:function(){o.setAttribute("transform","translate(0,0)"),e.chart.trigger("animationComplete",{series:e.chart.isBlazor?{}:e})}})},e}(),Nr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nr(t,e),t.prototype.render=function(e,t,r,o){for(var n,a,s="",l=null,h="M",c=e.chart&&"PolarRadar"===e.chart.chartAreaType,d=e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode,p=c?z:ve,u="TrendLine"===e.category?e.points:this.enableComplexProperty(e),g=0,y=u;g<y.length;g++){var m=y[g];m.regions=[],m.symbolLocations=[],m.visible&&S(u[m.index-1],m,u[m.index+1],e)?(s+=this.getLineDirection(l,m,e,o,p,h),h=l?"L":h,l=m,this.storePointLocation(m,e,o,p)):(l=d?l:null,h=d?h:"M")}if(c&&e.isClosed){var v=this.getFirstLastVisiblePoint(u);a=p(v.last.xValue,v.last.yValue,t,r,o,e),n=p(v.first.xValue,v.first.yValue,t,r,o,e),s=s.concat(h+" "+a.x+" "+a.y+" L "+n.x+" "+n.y)}var f="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:"TrendLine"===e.category?e.chart.element.id+"_Series_"+e.sourceIndex+"_TrendLine_"+e.index:e.chart.element.id+"_Series_"+(void 0===e.index?e.category:e.index),b=new i.PathOption(f,"none",e.width,e.interior,e.opacity,e.dashArray,s);this.appendLinePath(b,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doProgressiveAnimation(e,t)},t.prototype.getModuleName=function(){return"LineSeries"},t.prototype.destroy=function(){},t}(Fr),jr=function(){function e(){}return e.prototype.getSideBySideInfo=function(e){e.chart.enableSideBySidePlacement&&!e.position&&this.getSideBySidePositions(e);var t=e.chart.enableSideBySidePlacement?e.position:0,i=e.chart.enableSideBySidePlacement?e.rectCount:1;e.isRectSeries=!0;var r,o=e.chart.visibleSeries,n=e.chart.enableSideBySidePlacement?e.columnSpacing:0,a=null===e.columnWidth||isNaN(+e.columnWidth)?"Histogram"===e.type?1:.7:e.columnWidth,s=U(e.xAxis,o)*a,l=t/i-.5,h=new oi(l,l+1/i);return isNaN(h.start)||isNaN(h.end)||(r=n*(h=new oi(h.start*s,h.end*s)).delta,h=new oi(h.start+r/2,h.end-r/2)),h},e.prototype.getRectangle=function(e,t,r,o,n){var a=ve(e,t,n.xAxis,n.yAxis,n.chart.requireInvertedAxis),s=ve(r,o,n.xAxis,n.yAxis,n.chart.requireInvertedAxis);return new i.Rect(Math.min(a.x,s.x),Math.min(a.y,s.y),Math.abs(s.x-a.x),Math.abs(s.y-a.y))},e.prototype.getSideBySidePositions=function(e){for(var t=e.chart,i=0,r=t.columns;i<r.length;i++)for(var o=r[i],n=0,a=t.rows;n<a.length;n++){var s=a[n];this.findRectPosition(e.findSeriesCollection(o,s,!1))}},e.prototype.findRectPosition=function(e){for(var t=[],i={rectCount:0,position:null},r=0;r<e.length;r++)-1!==(o=e[r]).type.indexOf("Stacking")?o.stackingGroup?void 0===t[o.stackingGroup]?(o.position=i.rectCount,t[o.stackingGroup]=i.rectCount++):o.position=t[o.stackingGroup]:null===i.position?(o.position=i.rectCount,i.position=i.rectCount++):o.position=i.position:o.position=i.rectCount++;for(r=0;r<e.length;r++){var o=e[r];o.rectCount=i.rectCount}},e.prototype.updateSymbolLocation=function(e,t,i){i.chart.requireInvertedAxis?this.updateYRegion(e,t,i):this.updateXRegion(e,t,i),"Histogram"===i.type&&(e.minimum=+e.x-i.histogramValues.binWidth/2,e.maximum=+e.x+i.histogramValues.binWidth/2)},e.prototype.updateXRegion=function(e,t,i){e.symbolLocations.push({x:t.x+t.width/2,y:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||e.yValue>=0==!i.yAxis.isInversed?t.y:t.y+t.height}),this.getRegion(e,t,i),"RangeColumn"===i.type&&e.symbolLocations.push({x:t.x+t.width/2,y:t.y+t.height})},e.prototype.updateYRegion=function(e,t,i){e.symbolLocations.push({x:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||e.yValue>=0==!i.yAxis.isInversed?t.x+t.width:t.x,y:t.y+t.height/2}),this.getRegion(e,t,i),"RangeColumn"===i.type&&e.symbolLocations.push({x:t.x,y:t.y+t.height/2})},e.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},e.prototype.getRegion=function(e,t,r){if(0===e.y){var o=r.marker&&r.marker.width?r.marker.width:0,n=r.marker&&r.marker.height?r.marker.height:0;e.regions.push(new i.Rect(e.symbolLocations[0].x-o,e.symbolLocations[0].y-n,2*o,2*n))}else e.regions.push(t)},e.prototype.triggerEvent=function(e,t,i,r){var o={cancel:!1,name:"pointRender",series:e,point:t,fill:e.setPointColor(t,i),border:e.setBorderColor(t,r)};return e.chart.trigger("pointRender",o),t.color=o.fill,o},e.prototype.drawRectangle=function(e,t,r,o){var n=e.chart;if((n.requireInvertedAxis?r.height:r.width)<=0)return null;var a;a=0===t.y?this.calculateRoundedRectPath(r,0,0,0,0):this.calculateRoundedRectPath(r,e.cornerRadius.topLeft,e.cornerRadius.topRight,e.cornerRadius.bottomLeft,e.cornerRadius.bottomRight);var s="Indicator"===e.category?n.element.id+"_Indicator_"+e.index+"_"+e.name+"_Point_"+t.index:n.element.id+"_Series_"+e.index+"_Point_"+t.index,l=Fe(n.redraw,s),h=l?l.getAttribute("d"):"",c=new i.PathOption(s,o.fill,o.border.width,o.border.color,e.opacity,e.dashArray,a),d=n.renderer.drawPath(c,new Int32Array([e.clipRect.x,e.clipRect.y]));switch(e.seriesType){case"XY":d.setAttribute("aria-label",t.x.toString()+":"+t.yValue.toString());break;case"HighLow":d.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString())}be(e.chart.enableCanvas,e.seriesElement,d,n.redraw),e.chart.enableCanvas||J(d,a,n.redraw,h,n.duration)},e.prototype.animate=function(e){for(var t=e.seriesElement.childNodes,i="Indicator"===e.category?0:1,r=0,o=g(e);r<o.length;r++){var n=o[r];(n.symbolLocations.length||"BoxAndWhisker"===e.type&&n.regions.length)&&(this.animateRect(t[i],e,n),i++)}},e.prototype.animateRect=function(e,i,r){var o,n,a,s,l=i.animation,h=i.chart.animated?i.chart.duration:l.duration,c=Z("Linear"),d=r.yValue<0,p=+r.regions[0].height,u=+r.regions[0].width;i.chart.requireInvertedAxis?(n=+r.regions[0].y,i.type.indexOf("Stacking")>-1?(o=I(0,i.yAxis)*i.yAxis.rect.width,a=o,s=n):(o=+r.regions[0].x,s=d?n:n+p,a=-1!==i.seriesType.indexOf("HighLow")||-1!==i.type.indexOf("Waterfall")?o+u/2:d!==i.yAxis.isInversed?o+u:o)):(o=+r.regions[0].x,i.type.indexOf("Stacking")>-1?(n=(1-I(0,i.yAxis))*i.yAxis.rect.height,a=o,s=n):(n=+r.regions[0].y,s=-1!==i.seriesType.indexOf("HighLow")||-1!==i.type.indexOf("Waterfall")?n+p/2:d!==i.yAxis.isInversed?n:n+p,a=d?o:o+u));var g;t.isNullOrUndefined(e)||(e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:h,delay:l.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",i.chart.requireInvertedAxis?(u=u||1,g=c(t.timeStamp-t.delay,0,u,t.duration),e.setAttribute("transform","translate("+a+" "+s+") scale("+g/u+", 1) translate("+-a+" "+-s+")")):(p=p||1,g=c(t.timeStamp-t.delay,0,p,t.duration),e.setAttribute("transform","translate("+a+" "+s+") scale(1,"+g/p+") translate("+-a+" "+-s+")")))},end:function(){e.setAttribute("transform","translate(0,0)");var t=i.seriesElement;if((e===t.lastElementChild||r.index===i.points.length-1||"Waterfall"===i.type&&e===t.children[t.childElementCount-2])&&(i.chart.trigger("animationComplete",{series:i.chart.isBlazor?{}:i}),"Waterfall"===i.type))for(var o=t.childNodes,n=0;n<o.length;n++)-1!==o[n].id.indexOf("Connector")&&(o[n].style.visibility="visible",o[n].setAttribute("transform","translate(0,0)"))}}))},e.prototype.calculateRoundedRectPath=function(e,t,i,r,o){return"M "+e.x+" "+(t+e.y)+" Q "+e.x+" "+e.y+" "+(e.x+t)+" "+e.y+" L "+(e.x+e.width-i)+" "+e.y+" Q "+(e.x+e.width)+" "+e.y+" "+(e.x+e.width)+" "+(e.y+i)+" L "+(e.x+e.width)+" "+(e.y+e.height-o)+" Q "+(e.x+e.width)+" "+(e.y+e.height)+" "+(e.x+e.width-o)+" "+(e.y+e.height)+" L "+(e.x+r)+" "+(e.y+e.height)+" Q "+e.x+" "+(e.y+e.height)+" "+e.x+" "+(e.y+e.height-r)+" L "+e.x+" "+(t+e.y)+" Z"},e}(),Hr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Hr(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=Math.max(e.yAxis.visibleRange.min,0),n=0,a=e.points;n<a.length;n++){var s=a[n];if(s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)){t=this.getRectangle(s.xValue+r.start,s.yValue,s.xValue+r.end,o,e);var l="Indicator"===e.category?s.color:e.interior;(i=this.triggerEvent(e,s,l,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(s,t,e),this.drawRectangle(e,s,t,i))}}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"ColumnSeries"},t.prototype.destroy=function(){},t}(jr),Yr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Yr(t,e),t.prototype.getAreaPathDirection=function(e,t,i,r,o,n,a){var s,l="";return null===n&&(l+=a+" "+(s=o(e,t,i.xAxis,i.yAxis,r,i)).x+" "+s.y+" "),l},t.prototype.getAreaEmptyDirection=function(e,t,i,r,o){var n="";return n+=this.getAreaPathDirection(e.x,e.y,i,r,o,null,"L"),n+=this.getAreaPathDirection(t.x,t.y,i,r,o,null,"L")},t.prototype.setPointColor=function(e,t,i,r,o){if(""===i.pointColorMapping){for(var n=void 0,a=0;a<o.length;a++)if(n=o[a],(r?e.xValue:e.yValue)<=this.getAxisValue(n.value,r?i.xAxis:i.yAxis,i.chart)||!n.value){e.interior=n.color;break}return null==e.interior&&(e.interior=i.interior),!1}return!!t&&i.setPointColor(e,i.interior)!==i.setPointColor(t,i.interior)},t.prototype.sortSegments=function(e,t){var i=this,r="X"===e.segmentAxis?e.xAxis:e.yAxis;return[].concat(t).sort(function(t,o){return i.getAxisValue(t.value,r,e.chart)-i.getAxisValue(o.value,r,e.chart)})},t.prototype.applySegmentAxis=function(e,t,i){var r=this;if(""!==e.pointColorMapping)return t.map(function(t){r.appendLinePath(t,e,"")}),null;var o,n="X"===e.segmentAxis,a=n?e.xAxis:e.yAxis,s=e.chart;this.includeSegment(i,a,e,i.length);for(var l,h,c,d=i.length,p=this,u=0;u<d;u++)!function(r){o=i[r],l=p.getAxisValue(o.value,a,e.chart),(h=p.createClipRect(r?p.getAxisValue(i[r-1].value,a,e.chart):a.visibleRange.min,l,e,r,n))&&t.map(function(t){J(he((c={"clip-path":h,"stroke-dasharray":o.dashArray,opacity:t.opacity,stroke:e.type.indexOf("Line")>-1?o.color||e.interior:e.border.color,"stroke-width":t["stroke-width"],fill:e.type.indexOf("Line")>-1?"none":o.color||e.interior,id:t.id+"_Segment_"+r,d:t.d}).id),c.d,s.redraw),e.seriesElement.appendChild(s.renderer.drawPath(c))})}(u)},t.prototype.includeSegment=function(e,t,i,r){if(r<=0)return e.push({value:t.visibleRange.max,color:i.interior}),null;this.getAxisValue(e[r-1].value,t,i.chart)<t.visibleRange.max&&e.push({value:t.visibleRange.max,color:i.interior})},t.prototype.createClipRect=function(e,t,i,r,o){var n,a=i.chart.requireInvertedAxis,s=ve(o?e:i.xAxis.visibleRange.min,o?i.yAxis.visibleRange.max:t,i.xAxis,i.yAxis,a),l=ve(o?t:i.xAxis.visibleRange.max,o?i.yAxis.visibleRange.min:e,i.xAxis,i.yAxis,a);return(l=a?[s,s=l][0]:l).x-s.x>0&&l.y-s.y>0?(n=new Di(i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:s.x,y:s.y,width:l.x-s.x,height:l.y-s.y}),i.seriesElement.appendChild(K(i.chart.redraw,n,i.chart.renderer)),"url(#"+i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+r+")"):null},t.prototype.getAxisValue=function(e,t,i){if(null===e&&(e=t.visibleRange.max),"DateTime"===t.valueType){var o={skeleton:"full",type:"dateTime"};return Date.parse(i.intl.getDateParser(o)(i.intl.getDateFormat(o)(new Date(r.DataUtil.parse.parseJson({val:e}).val))))}if(t.valueType.indexOf("Category")>-1){var n="DateTimeCategory"===t.valueType?e.getTime().toString():e;return t.labels.indexOf(n)<0?+e:t.labels.indexOf(n)}return+e},t}(Fr),Wr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ur=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wr(t,e),t.prototype.render=function(e,t,r,o){var n=null,a="",s=e.chart&&"PolarRadar"===e.chart.chartAreaType,l=Math.max(e.yAxis.visibleRange.min,0);s&&(l=this.getFirstLastVisiblePoint(e.points).first.yValue);for(var h,c,d=e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode,p=e.border?e.border.width:0,u=e.border?e.border.color:"transparent",g="PolarRadar"===e.chart.chartAreaType?z:ve,y=this.enableComplexProperty(e),m=0;m<y.length;m++)h=(c=y[m]).xValue,c.symbolLocations=[],c.regions=[],c.visible&&S(y[m-1],c,y[m+1],e)&&(a+=this.getAreaPathDirection(h,l,e,o,g,n,"M"),n=n||new Vi(h,l),a+=this.getAreaPathDirection(h,c.yValue,e,o,g,null,"L"),y[m+1]&&!y[m+1].visible&&(!s||s&&this.withinYRange(y[m+1],r))&&!d&&(a+=this.getAreaEmptyDirection({x:h,y:l},n,e,o,g),n=null),this.storePointLocation(c,e,o,g));if(s&&""!==a){var v="",f=this.chart;v+=this.getAreaPathDirection(0,l,e,o,g,null,"L"),(t.isInversed||r.isInversed)&&(a+="Polar"===e.type?f.polarSeriesModule.getPolarIsInversedPath(t,v):f.radarSeriesModule.getRadarIsInversedPath(t,v)),a=a.concat(a+" Z")}this.appendLinePath(new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,p,u,e.opacity,e.dashArray,e.points.length>1&&""!==a?a+this.getAreaPathDirection(e.points[e.points.length-1].xValue,"PolarRadar"===e.chart.chartAreaType?e.points[e.points.length-1].yValue:l,e,o,g,null,"L"):""),e,""),this.renderMarker(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AreaSeries"},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t}(Gr),Zr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Zr(t,e),t.prototype.render=function(e){for(var t,i,r=Math.max(e.yAxis.visibleRange.min,0),o=this.getSideBySideInfo(e),n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)&&(t=this.getRectangle(s.xValue+o.start,s.yValue,s.xValue+o.end,r,e),(i=this.triggerEvent(e,s,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(s,t,e),this.drawRectangle(e,s,t,i)))}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"BarSeries"},t}(jr),Qr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleAxisLabelRect=[],t}return Qr(t,e),t.prototype.measureAxis=function(e){var t=this.chart;this.initialClipRect=e,this.seriesClipRect=new i.Rect(e.x,e.y,e.width,e.height),this.measureRowAxis(t,this.initialClipRect),this.measureColumnAxis(t,this.initialClipRect),this.calculateAxisSize()},t.prototype.measureRowAxis=function(e,t){this.calculateRowSize(t);var r=e.rows[0];this.measureDefinition(r,e,new i.Size(e.availableSize.width,r.computedHeight))},t.prototype.measureColumnAxis=function(e,t){this.calculateColumnSize(t);var r=e.columns[0];this.measureDefinition(r,e,new i.Size(r.computedWidth,e.availableSize.height))},t.prototype.measureDefinition=function(e,t,i){for(var r=0,o=e.axes;r<o.length;r++){var n=o[r];n.getModule(t),n.baseModule.calculateRangeAndInterval(i,n)}},t.prototype.calculateAxisSize=function(){var e=this.chart;this.centerX=.5*this.initialClipRect.width+this.initialClipRect.x,this.centerY=.5*this.initialClipRect.height+this.initialClipRect.y,e.radius=Math.min(this.initialClipRect.width,this.initialClipRect.height)/2-5-e.primaryXAxis.majorTickLines.height-e.primaryXAxis.maxLabelSize.height,e.radius=e.primaryXAxis.coefficient*e.radius/100,this.seriesClipRect.y=this.centerY-e.radius,this.seriesClipRect.x=this.centerX-e.radius,this.seriesClipRect.height=2*e.radius,this.seriesClipRect.width=2*e.radius,this.calculateRowSize(this.seriesClipRect),e.primaryYAxis.rect=this.seriesClipRect,this.calculateColumnSize(this.seriesClipRect),e.primaryXAxis.rect=this.seriesClipRect},t.prototype.measure=function(){var e=this.chart;e.verticalAxes.push(e.primaryYAxis);var t=e.rows[0];t.axes[0]=e.primaryYAxis,e.rows[0]=t,e.horizontalAxes.push(e.primaryXAxis);var i=e.columns[0];i.axes[0]=e.primaryXAxis,e.columns[0]=i},t.prototype.calculateRowSize=function(e){var t=this.chart,i=t.rows[0];i.computedHeight=e.height/2,i.computedTop=e.y,t.rows[0]=i},t.prototype.calculateColumnSize=function(e){var t=this.chart,i=t.columns[0];i.computedLeft=e.x,i.computedWidth=e.width,t.columns[0]=i},t.prototype.renderAxes=function(){var e,t=this.chart;this.startAngle=t.primaryXAxis.startAngle;for(var i=t.renderer.createGroup({id:t.element.id+"AxisCollection"}),r=t.renderer.createGroup({id:t.element.id+"AxisOutsideCollection"}),o=0,n=t.axisCollections.length;o<n;o++)this.element=t.renderer.createGroup({id:t.element.id+"AxisGroup"+o}),"Horizontal"===(e=t.axisCollections[o]).orientation?((e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawXAxisGridLine(e,o),e.visible&&e.internalVisibility&&this.drawXAxisLabels(e,o)):(this.drawYAxisGridLine(e,o),e.lineStyle.width>0&&this.drawYAxisLine(e,o),e.visible&&e.internalVisibility&&this.drawYAxisLabels(e,o)),i.appendChild(this.element);return i.appendChild(this.element),be(t.enableCanvas,t.svgObject,i,t.redraw),r},t.prototype.drawYAxisLine=function(e,t){var i=this.chart,r={},o=B(F(e.visibleLabels[0].value,e),this.startAngle),n="M "+this.centerX+" "+this.centerY+"L "+(this.centerX+i.radius*o.x)+" "+(this.centerY+i.radius*o.y);r={id:i.element.id+"AxisLine_"+t,d:n,"stroke-dasharray":e.lineStyle.dashArray,"stroke-width":e.lineStyle.width,stroke:e.lineStyle.color||i.themeStyle.axisLine};var a=i.renderer.drawPath(r);this.setPointerEventNone(a),i.yAxisElements.appendChild(a)},t.prototype.drawYAxisLabels=function(e,t){var r,o,n,a,s=this.chart,l=0,h=0,c=this.startAngle<0?this.startAngle+360:this.startAngle,d=[],p=[];p[0]=!0;for(var u=e.labelIntersectAction,g=s.renderer.createGroup({id:s.element.id+"AxisLabels"+t}),y=B(F(e.visibleLabels[0].value,e),this.startAngle),m=0,v=e.visibleLabels.length;m<v;m++){if(a=!1,n=s.radius*I(e.visibleLabels[m].value,e),r=e.visibleLabels[m].size,n=s.radius*I(e.visibleLabels[m].value,e),l=this.centerX+n*y.x+(e.majorTickLines.height+r.width/2+2.5)*Math.cos(c*Math.PI/180)*("Inside"===e.labelPosition?1:-1),h=this.centerY+n*y.y+(e.majorTickLines.height+r.height/2)*Math.sin(c*Math.PI/180)*("Inside"===e.labelPosition?1:-1),h+=r.height/4,d[m]=this.getLabelRegion(l,h,e.visibleLabels[m],"middle"),0!==m&&"Hide"===u){for(var f=m;f>=0;f--){if(f=0===f?0:f===m?f-1:f,p[f]&&Le(d[m],d[f])){a=!0,p[m]=!1;break}p[m]=!0}if(a)continue;for(var b=0,x=this.visibleAxisLabelRect;b<x.length;b++){var w=x[b];if(Le(d[m],w)){a=!0;break}}}a||(this.visibleAxisLabelRect.push(d[m]),o=new i.TextOption(s.element.id+t+"_AxisLabel_"+m,l,h,"middle",e.visibleLabels[m].text),Ve(s.renderer,o,e.labelStyle,e.labelStyle.color||s.themeStyle.axisLabel,g,!1,s.redraw,!0,!0,null,null,null,null,s.enableCanvas))}s.yAxisElements.appendChild(g)},t.prototype.drawYAxisGridLine=function(e,t){var r,o,n,a,s,l,h,c=this.chart,d="",p="",u=this.startAngle<0?this.startAngle+360:this.startAngle,g={color:e.majorGridLines.color||c.themeStyle.majorGridLine,width:e.majorGridLines.width};if(e.majorGridLines.width>0)if("Polar"===c.visibleSeries[0].type){for(y=0;y<e.visibleLabels.length;y++)l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+y))?h.getAttribute("r"):null,o=c.radius*I(e.visibleLabels[y].value,e),r=new Fi(c.element.id+"_MajorGridLine_"+t+"_"+y,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,o),be(c.enableCanvas,this.element,c.renderer.drawCircle(r),c.redraw,!0,"r","r",new Vi(+l,+l),null,!0);o!==c.radius&&(r=new Fi(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length+1,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,c.radius),be(c.enableCanvas,this.element,c.renderer.drawCircle(r),c.redraw,!0,"r","r",new Vi(+l,+l),null,!0))}else{for(var y=0;y<e.visibleLabels.length;y++)o=c.radius*I(e.visibleLabels[y].value,e),p=this.renderRadarGrid(o,"",c),l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+y))?h.getAttribute("d"):null,r=new i.PathOption(c.element.id+"_MajorGridLine_"+t+"_"+y,"transparent",e.majorGridLines.width,e.majorGridLines.color||c.themeStyle.majorGridLine,null,null,p),be(c.enableCanvas,this.element,c.renderer.drawPath(r),c.redraw,!0,"x","y",null,l,!0);o!==c.radius&&(p=this.renderRadarGrid(c.radius,"",c),l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length))?h.getAttribute("d"):null,r=new i.PathOption(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length,"transparent",e.majorGridLines.width,e.majorGridLines.color||c.themeStyle.majorGridLine,null,null,p),be(c.enableCanvas,this.element,c.renderer.drawPath(r),c.redraw,!0,"x","y",null,l,!0))}if(e.majorTickLines.width>0){n=B(F(e.visibleLabels[0].value,e),this.startAngle);for(var m=0;m<e.visibleLabels.length;m++)o=c.radius*I(e.visibleLabels[m].value,e),d="M "+(a=this.centerX+o*n.x)+" "+(s=this.centerY+o*n.y)+" L "+(a+e.majorTickLines.height*Math.cos(u*Math.PI/180)*("Inside"===e.tickPosition?1:-1))+" "+(s+e.majorTickLines.height*Math.sin(u*Math.PI/180)*("Inside"===e.tickPosition?1:-1)),this.renderTickLine(e,t,d,"",m)}},t.prototype.renderRadarGrid=function(e,t,i){for(var r,o,n,a,s,l,h=0,c=i.primaryXAxis.visibleLabels.length;h<c;h++)r=B(F(i.primaryXAxis.visibleLabels[h].value,i.primaryXAxis),this.startAngle),o=h+1<c?B(F(i.primaryXAxis.visibleLabels[h+1].value,i.primaryXAxis),this.startAngle):B(F(i.primaryXAxis.visibleLabels[0].value,i.primaryXAxis),this.startAngle),n=this.centerX+e*r.x,a=this.centerY+e*r.y,s=this.centerX+e*o.x,l=this.centerY+e*o.y,t=t.concat((h?"L ":"M ")+" "+n+" "+a+" L "+s+" "+l+" ");return t},t.prototype.drawXAxisGridLine=function(e,t){for(var i,r,o,n,a,s=this.chart,l="",h="",c="",d="",p=this.centerX,u=this.centerY,g=e.visibleLabels.length,y=0;y<g;y++)i=e.visibleLabels[y].value,r=B(F(e.visibleLabels[y].value,e),this.startAngle),l="M "+p+" "+u+" L "+(o=this.centerX+s.radius*r.x)+" "+(n=this.centerY+s.radius*r.y),h="M "+o+" "+n+" L "+(o+e.majorTickLines.height*r.x*("Inside"===e.tickPosition?-1:1))+" "+(n+e.majorTickLines.height*r.y*("Inside"===e.tickPosition?-1:1)),e.minorTicksPerInterval>0&&(e.minorGridLines.width>0||e.minorTickLines.width>0)&&"Category"!==e.valueType&&"Radar"!==s.visibleSeries[0].type&&(c=(a=this.drawAxisMinorLine(e,i,c,d))[0],d=a[1]),this.renderTickLine(e,t,h,d,y),this.renderGridLine(e,t,l,c,y)},t.prototype.drawAxisMinorLine=function(e,t,i,r){for(var o,n,a,s=t,l=e.visibleRange,h=[],c=0;c<e.minorTicksPerInterval;c++)if(s+=("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval)/(e.minorTicksPerInterval+1),b(s,l)){a=B(F(s,e),this.startAngle),o=this.centerX+this.chart.radius*a.x,n=this.centerY+this.chart.radius*a.y;var d=o+e.minorTickLines.height*a.x*("Inside"===e.tickPosition?-1:1),p=n+e.minorTickLines.height*a.y*("Inside"===e.tickPosition?-1:1);i=i.concat("M "+this.centerX+" "+this.centerY+"L "+o+" "+n),r=r.concat("M "+o+" "+n+"L "+d+" "+p)}return h.push(i),h.push(r),h},t.prototype.drawXAxisLabels=function(e,t){this.visibleAxisLabelRect=[];var r;this.chart.legendModule&&(r=this.chart.legendModule.legendBounds);var o,n,a,s,l,h,c,d=this.chart,p=0,u=0,g=d.renderer.createGroup({id:d.element.id+"AxisLabels"+t}),y="Inside"===e.labelPosition,m="",v=[],f=[];f[0]=!0;var b=e.labelIntersectAction,x="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,w=d.radius+e.majorTickLines.height;w=y?-w:w;for(var S=0,C=e.visibleLabels.length;S<C;S++){if(c=!1,n=B(F(e.visibleLabels[S].value+x,e),this.startAngle),isNaN(n.x)||isNaN(n.y)||(p=this.centerX+(w+e.majorTickLines.height+5)*n.x,u=this.centerY+(w+e.majorTickLines.height+5)*n.y,m=parseFloat(p.toFixed(1))===parseFloat(this.centerX.toFixed(1))?"middle":p<this.centerX&&!y||p>this.centerX&&y?"end":"start"),h=e.visibleLabels[S],a=h.text,e.enableTrim||"Trim"===b)for(var P=e.visibleLabels[S].originalText,L=void 0,R=void 0,M=e.labelPosition,A=d.availableSize.width,k=P.length,T=k-1;T>=0;--T)if(L=P.substring(0,T)+"...",R=i.measureText(L,e.labelStyle).width,p===A/2?p-R/2>=0&&p+R/2<=A:"Outside"===M&&(p>=A/2&&p+R<=A||p<=A/2&&p-R>=0)||"Inside"===M&&(p+R<=A/2||p-R>=A/2)){a=T===k-1?P:L,h.size.width=i.measureText(a,e.labelStyle).width,h.text=a;break}if(v[S]=this.getLabelRegion(p,u,h,m),0===S?s=p:S===e.visibleLabels.length-1&&"Category"!==e.valueType&&(l=i.measureText(a,e.labelStyle).height,a=(l+=p)>s?"":a),0!==S&&"Hide"===b)for(var _=S;_>=0;_--){if(_=0===_?0:_===S?_-1:_,f[_]&&Le(v[S],v[_])){c=!0,f[S]=!1;break}f[S]=!0}if(!c&&r&&(c=Le(v[S],r))){var O=this.getAvailableSpaceToTrim(r,v[S]);O>0&&(a=ze(O,e.visibleLabels[S].originalText,e.labelStyle),c=!1)}o=new i.TextOption(d.element.id+t+"_AxisLabel_"+S,p,u,m,a,"","central"),c||(this.visibleAxisLabelRect.push(v[S]),Ve(d.renderer,o,h.labelStyle,h.labelStyle.color||d.themeStyle.axisLabel,g,!1,d.redraw,!0,!0,null,null,null,null,d.enableCanvas))}this.element.appendChild(g)},t.prototype.getAvailableSpaceToTrim=function(e,t){var i=e.x,r=i+e.width,o=t.x,n=o+t.width,a=0;return o>i&&o<r&&n>r?a=n-r:o>i&&o<r&&n<r?a=0:n>i&&n<r&&o<i?a=i-o:n>i&&n>r&&o<i&&(a=i-o),a},t.prototype.getLabelRegion=function(e,t,r,o){return"middle"===o?e-=r.size.width/2:"end"===o?e-=r.size.width:e=e,t-=r.size.height/2,new i.Rect(e,t,r.size.width,r.size.height)},t.prototype.renderTickLine=function(e,t,r,o,n){var a,s,l,h=this.chart;e.majorTickLines.width>0&&(s=(l=he(h.element.id+"_MajorTickLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MajorTickLine_"+t+"_"+n,"transparent",e.majorTickLines.width,e.majorTickLines.color||h.themeStyle.majorTickLine,null,null,r),l=h.renderer.drawPath(a),this.setPointerEventNone(l),be(h.enableCanvas,h.yAxisElements,l,h.redraw,!0,"x","y",null,s)),e.minorTickLines.width>0&&(s=(l=he(h.element.id+"_MinorTickLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MinorTickLine_"+t+"_"+n,"transparent",e.minorTickLines.width,e.minorTickLines.color||h.themeStyle.minorTickLine,null,null,o),l=h.renderer.drawPath(a),this.setPointerEventNone(l),be(h.enableCanvas,h.yAxisElements,l,h.redraw,!0,"x","y",null,s))},t.prototype.renderGridLine=function(e,t,r,o,n){var a,s,l,h=this.chart;e.majorGridLines.width>0&&(s=(l=he(h.element.id+"_MajorGridLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MajorGridLine_"+t+"_"+n,"transparent",e.majorGridLines.width,e.majorGridLines.color||h.themeStyle.majorGridLine,null,e.majorGridLines.dashArray,r),be(h.enableCanvas,this.element,h.renderer.drawPath(a),h.redraw,!0,"x","y",null,s)),e.minorGridLines.width>0&&(s=(l=he(h.element.id+"_MinorGridLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MinorGridLine_"+t+"_"+n,"transparent",e.minorGridLines.width,e.minorGridLines.color||h.themeStyle.minorGridLine,null,e.minorGridLines.dashArray,o),be(h.enableCanvas,this.element,h.renderer.drawPath(a),h.redraw,!0,"x","y",null,s))},t.prototype.setPointerEventNone=function(e){e&&e.setAttribute("style","pointer-events:none")},t}(Fr),Jr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Jr(r,e),r.prototype.render=function(e,i,r,o){for(var n=G(e.drawType),a=r.minimum,s=r.maximum,l=0,h=e.points;l<h.length;l++){var c=h[l];c.visible=c.visible&&!(!t.isNullOrUndefined(a)&&c.yValue<a||!t.isNullOrUndefined(s)&&c.yValue>s)}e.points.length&&(e.drawType.indexOf("Column")>-1?this.columnDrawTypeRender(e,i,r):e.chart[n+"SeriesModule"].render(e,i,r,o))},r.prototype.columnDrawTypeRender=function(e,t,r){var o,n,a,s,l,h,c,d,p,u,g,y,m,f,b,x,w,C,P,L,R=t.actualRange.min,M=e.clipRect.width/2+e.clipRect.x,A=e.clipRect.height/2+e.clipRect.y,k="RangeColumn"===e.drawType,T="Polar"===e.type,_="Logarithmic"===r.valueType,O="StackingColumn"===e.drawType,E="",z=0,D=(e.points[1]?e.points[1].xValue:2*e.points[0].xValue)-e.points[0].xValue,B="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?0:t.isInversed?-D/2:D/2,F="DateTime"===t.valueType?t.dateTimeInterval:1;this.getSeriesPosition(e);var N=t.isInversed?e.rectCount-1-e.position:e.position;do{z+=F,R+=F}while(R<=t.actualRange.max-("Category"===t.valueType?0:1));for(var V=0,j=e.points;V<j.length;V++){var H=j[V];H.symbolLocations=[],H.regions=[],H.visible&&S(e.points[H.index-1],H,e.points[H.index+1],e)&&(l=(t.isInversed?t.visibleRange.max-H.xValue:H.xValue-t.visibleRange.min)+(D/e.rectCount*N-B)+z/360*t.startAngle,l/=z,a=2*Math.PI*(l+t.startAngle),s=2*Math.PI*(l+t.startAngle+D/e.rectCount/z),0===a&&0===s?(s=2*Math.PI,L="1"):L="0",c=a,d=s,a=a-.5*Math.PI+e.columnSpacing/2,s=s-.5*Math.PI-1e-6-e.columnSpacing/2,O||k?(m=k?H.low:e.stackedValues.startValues[H.index],f=k?H.high:e.stackedValues.endValues[H.index],f=(f=_?v(0===f?1:f,r.logBase):f)>r.actualRange.max?r.actualRange.max:f):(m=r.visibleRange.min,f=H.yValue>r.actualRange.max?r.actualRange.max:H.yValue),p=M+(h=m===f?0:e.chart.radius*I(f,r))*Math.cos(a),u=M+h*Math.cos(s),g=A+h*Math.sin(a),y=A+h*Math.sin(s),x=M+(b=e.chart.radius*I(0===m&&0!==r.visibleRange.min?r.visibleRange.min:m,r))*Math.cos(a),w=A+b*Math.sin(a),C=M+b*Math.cos(s),P=A+b*Math.sin(s),E=T?"M "+p+" "+g+" A "+h+" "+h+" 0 "+L+" 1 "+u+" "+y+" L "+C+" "+P+" A "+b+" "+b+" 1 0 0 "+x+" "+w+" Z":"M "+p+" "+g+" L "+u+" "+y+" L "+C+" "+P+" L "+x+" "+w+" Z",H.regionData=new Ei(c,d,b,h,l),n=this.triggerEvent(e.chart,e,H),o=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+H.index,n.fill,n.border.width,n.border.color,e.opacity,e.dashArray,E),n.cancel||(this.appendLinePath(o,e,""),T?(H.symbolLocations.push({x:M+h*Math.cos(a+(s-a)/2),y:A+h*Math.sin(a+(s-a)/2)}),k&&H.symbolLocations.push({x:M+b*Math.cos(a+(s-a)/2),y:A+b*Math.sin(a+(s-a)/2)})):(H.symbolLocations.push({x:(p+u)/2,y:(g+y)/2}),k&&H.symbolLocations.push({x:(C+x)/2,y:(P+w)/2}))))}this.renderMarker(e),e.isRectSeries=!0},r.prototype.triggerEvent=function(e,t,i){var r={cancel:!1,name:"pointRender",series:t,point:i,fill:t.setPointColor(i,t.interior),border:t.setBorderColor(i,{width:t.border.width,color:t.border.color})};return e.trigger("pointRender",r),i.color=r.fill,r},r.prototype.getSeriesPosition=function(e){for(var t=[],i=[],r={rectCount:0,position:null},o=0,n=e.chart.visibleSeries;o<n.length;o++){var a=n[o];!a.visible||"Polar"!==a.type&&"Radar"!==a.type||-1===a.drawType.indexOf("Column")||t.push(a)}for(l=0;l<t.length;l++){var s=t[l];-1!==s.drawType.indexOf("Stacking")?s.stackingGroup?void 0===i[s.stackingGroup]?(s.position=r.rectCount,i[s.stackingGroup]=r.rectCount++):s.position=i[s.stackingGroup]:null===r.position?(s.position=r.rectCount,r.position=r.rectCount++):s.position=r.position:s.position=r.rectCount++}for(var l=0;l<t.length;l++)t[l].rectCount=r.rectCount},r.prototype.doAnimation=function(e){var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1;if("Scatter"===e.drawType)for(var n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&r[o]&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}else for(o=1;o<r.length;o++)this.doPolarRadarAnimation(r[o],i,t,e)},r.prototype.doPolarRadarAnimation=function(e,i,r,o){var n=o.clipRect.width/2+o.clipRect.x,a=o.clipRect.height/2+o.clipRect.y,s=0;e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:r,delay:i,progress:function(t){t.timeStamp>t.delay&&(t.element.style.visibility="visible",s=(t.timeStamp-t.delay)/t.duration,e.setAttribute("transform","translate("+n+" "+a+") scale("+s+") translate("+-n+" "+-a+")"))},end:function(){e.style.visibility="visible",e.removeAttribute("transform"),o.chart.trigger("animationComplete",{series:o.chart.isBlazor?{}:o})}})},r.prototype.getPolarIsInversedPath=function(e,t){var i,r,o,n=this.chart.radius,a=t,s=e.isInversed?"1 1 ":"1 0 ";return i=B(F(e.visibleLabels[0].value,e),this.startAngle),r=this.centerX+n*i.x,o=this.centerY+n*i.y,a+="L "+r+" "+o+" A "+n+" "+n+" 0 "+s+r+" "+(this.centerY+n)+" A "+n+" "+n+" 0 "+s+r+" "+o+" "},r.prototype.getModuleName=function(){return"PolarSeries"},r.prototype.destroy=function(){},r}($r),eo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),to=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return eo(i,e),i.prototype.render=function(e,i,r,o){for(var n=G(e.drawType),a=r.minimum,s=r.maximum,l=0,h=e.points;l<h.length;l++){var c=h[l];c.visible=c.visible&&!(!t.isNullOrUndefined(a)&&c.yValue<a||!t.isNullOrUndefined(s)&&c.yValue>s)}e.points.length&&(-1===e.drawType.indexOf("Column")?e.chart[n+"SeriesModule"].render(e,i,r,o):this.columnDrawTypeRender(e,i,r))},i.prototype.getRadarIsInversedPath=function(e,t){var i,r,o=this.chart.radius,n=e.visibleLabels.length,a=t;r=B(F(e.visibleLabels[0].value,e),this.startAngle),i=this.centerY+o*r.y,a+=" L "+(this.centerX+o*r.x)+" "+i+" ";for(var s=n-1;s>=0;s--)r=B(F(e.visibleLabels[s].value,e),this.startAngle),i=this.centerY+o*r.y,a+="L "+(this.centerX+o*r.x)+" "+i+" ";return a},i.prototype.getModuleName=function(){return"RadarSeries"},i.prototype.destroy=function(){},i}(Kr),io=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ro=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return io(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=e.stackedValues,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)&&(t=this.getRectangle(s.xValue+r.start,o.endValues[s.index],s.xValue+r.end,o.startValues[s.index],e),(i=this.triggerEvent(e,s,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.drawRectangle(e,s,t,i),this.updateSymbolLocation(s,t,e)))}this.renderMarker(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingBarSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t}(jr),oo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),no=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oo(t,e),t.prototype.render=function(e){for(var t,i=this.getSideBySideInfo(e),r=Math.max(e.border.width,1),o=0,n=e.points;o<n.length;o++){var a=n[o],s="",l=void 0,h=void 0;a.regions=[],a.symbolLocations=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(h=this.getRectangle(a.xValue+i.median,Math.max(a.high,a.low),a.xValue+i.median,Math.min(a.high,a.low),e),e.chart.requireInvertedAxis?(h.y-=r/2,h.height=r):(h.x-=r/2,h.width=r),l=this.getRectangle(a.xValue+i.start,Math.max(a.open,a.close),a.xValue+i.end,Math.min(a.open,a.close),e),s=this.getPathString(h,l,e),(t=this.triggerPointRenderEvent(e,a)).cancel||(this.drawCandle(e,a,l,t,s),this.updateSymbolLocation(a,h,e),this.updateSymbolLocation(a,l,e)))}},t.prototype.triggerPointRenderEvent=function(e,t){var i=this.getCandleColor(t,e),r={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,r)},t.prototype.getCandleColor=function(e,t){var i=t.points[e.index-1];return!1===t.enableSolidCandles?i&&i.close>e.close?t.bullFillColor:t.bearFillColor:e.open>e.close?t.bullFillColor:t.bearFillColor},t.prototype.getPathString=function(e,t,i){var r="",o=i.chart.requireInvertedAxis?e.y+e.height/2:e.x+e.width/2;return r+=i.chart.requireInvertedAxis?"M "+e.x+" "+o+" L "+t.x+" "+o:"M "+o+" "+e.y+" L "+o+" "+t.y,r=r.concat(" M "+t.x+" "+t.y+" L "+(t.x+t.width)+" "+t.y+" L "+(t.x+t.width)+" "+(t.y+t.height)+" L "+t.x+" "+(t.y+t.height)+" Z"),r+=i.chart.requireInvertedAxis?" M "+(t.x+t.width)+" "+o+" L "+(e.x+e.width)+" "+o:" M "+o+" "+(t.y+t.height)+" L "+o+" "+(e.y+e.height)},t.prototype.drawCandle=function(e,t,r,o,n){if((e.chart.requireInvertedAxis?r.height:r.width)<=0)return null;var a=e.enableSolidCandles?o.fill:t.open>t.close?o.fill:"transparent";o.border.color=o.fill;var s=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,a,o.border.width,o.border.color,e.opacity,e.dashArray,n),l=he(s.id),h=l?l.getAttribute("d"):null,c=e.chart.renderer.drawPath(s,new Int32Array([e.clipRect.x,e.clipRect.y]));c.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(c),J(l,n,e.chart.redraw,h)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"CandleSeries"},t.prototype.destroy=function(){},t}(jr),ao=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),so=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ao(t,e),t.prototype.render=function(e){e.isRectSeries=!0;for(var t,i,r=this.getSideBySideInfo(e),o=e.stackedValues,n=g(e),a=0,s=n;a<s.length;a++){var l=s[a];l.symbolLocations=[],l.regions=[],l.visible&&S(n[l.index-1],l,n[l.index+1],e)&&(t=this.getRectangle(l.xValue+r.start,o.endValues[l.index],l.xValue+r.end,o.startValues[l.index],e),(i=this.triggerEvent(e,l,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.drawRectangle(e,l,t,i),this.updateSymbolLocation(l,t,e)))}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingColumnSeries"},t}(jr),lo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ho=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l="",h="M",c=null,d=this.enableComplexProperty(e);n="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var p=0,u=d;p<u.length;p++){var g=u[p];g.symbolLocations=[],g.regions=[],g.visible&&S(d[g.index-1],g,d[g.index+1],e)?(null!=c?(s=ve(g.xValue,g.yValue,t,r,o),a=ve(c.xValue,c.yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" L "+s.x+" "+a.y+" L "+s.x+" "+s.y+" "),h="L"):(a=ve(g.xValue-n,g.yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" "),h="L"),this.storePointLocation(g,e,o,ve),c=g):(c="Drop"===e.emptyPointSettings.mode?c:null,h="Drop"===e.emptyPointSettings.mode?h:"M")}d.length>0&&(a=ve(d[d.length-1].xValue+n,d[d.length-1].yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" "));var y=new i.PathOption(e.chart.element.id+"_Series_"+e.index,"transparent",e.width,e.interior,e.opacity,e.dashArray,l);this.appendLinePath(y,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StepLineSeries"},t}(Fr),co=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),po=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return co(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c=null,d="",p=this.enableComplexProperty(e),u=p.length,g=Math.max(e.yAxis.visibleRange.min,0),y=null;h="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var m=0;m<u;m++)l=(s=p[m]).xValue,s.symbolLocations=[],s.regions=[],s.visible&&S(p[m-1],s,p[m+1],e)&&(null===c&&(c=new Vi(l,0),d+="M "+(n=ve(l-h,g,t,r,o)).x+" "+n.y+" ",d+="L "+(n=ve(l-h,s.yValue,t,r,o)).x+" "+n.y+" "),null!=y?(n=ve(s.xValue,s.yValue,t,r,o),a=ve(y.xValue,y.yValue,t,r,o),d+="L "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):"Gap"===e.emptyPointSettings.mode&&(d+="L "+(n=ve(s.xValue,s.yValue,t,r,o)).x+" "+n.y+" "),this.storePointLocation(s,e,o,ve),y=s),p[m+1]&&!p[m+1].visible&&"Drop"!==e.emptyPointSettings.mode&&(d+="L "+(n=ve(l+h,g,t,r,o)).x+" "+n.y,c=null,y=null);u>1&&""!==d?(d+="L "+(a=ve((c={x:p[u-1].xValue+h,y:p[u-1].yValue}).x,c.y,t,r,o)).x+" "+a.y+" ",d+="L "+(a=ve((c={x:p[u-1].xValue+h,y:g}).x,c.y,t,r,o)).x+" "+a.y+" "):d="";var v=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,d);this.appendLinePath(v,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StepAreaSeries"},t}(Fr),uo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),go=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s="PolarRadar"===e.chart.chartAreaType,l=s?z:ve,h="",c=this.enableComplexProperty(e),d=c.length,p=e.stackedValues,u=s?Math.max(e.yAxis.visibleRange.min,p.endValues[0]):Math.max(e.yAxis.visibleRange.min,p.startValues[0]),g=0;d>0&&(n=l(c[0].xValue,u,t,r,o,e),h=h.concat("M "+n.x+" "+n.y+" "));for(var y=e.chart&&"PolarRadar"===e.chart.chartAreaType,m=0;m<d;m++)if(c[m].symbolLocations=[],c[m].regions=[],c[m].visible&&S(c[m-1],c[m],c[m+1],e))n=l(c[m].xValue,p.endValues[m],t,r,o,e),h=h.concat("L "+n.x+" "+n.y+" "),c[m].symbolLocations.push(l(c[m].xValue,p.endValues[m],t,r,o,e)),c[m].regions.push(new i.Rect(c[m].symbolLocations[0].x-e.marker.width,c[m].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height));else if(!y&&"Drop"!==e.emptyPointSettings.mode){for(b=m-1;b>=g;b--)a=l(c[b].xValue,p.startValues[b],t,r,o,e),h=h.concat("L "+a.x+" "+a.y+" ");c[m+1]&&c[m+1].visible&&(!y||y&&this.withinYRange(c[m+1],r))&&(n=l(c[m+1].xValue,p.startValues[m+1],t,r,o,e),h=h.concat("M "+n.x+" "+n.y+" ")),g=m+1}if("PolarRadar"===e.chart.chartAreaType&&c.length>1){var v=this.getFirstLastVisiblePoint(e.points),f=this.chart;h+="L "+(a=l((n={x:v.first.xValue,y:p.endValues[v.first.index]}).x,n.y,t,r,o,e)).x+" "+a.y+" ",1===this.chart.visible&&(t.isInversed||r.isInversed)&&(this.chart.enableAnimation=!1,h="Polar"===e.type?f.polarSeriesModule.getPolarIsInversedPath(t,h):f.radarSeriesModule.getRadarIsInversedPath(t,h))}if(!y||y&&e.index!==this.getFirstSeriesIndex(e.chart.visibleSeries))for(var b=d-1;b>=g;b--)if(!y||c[b].visible){var x=this.getPreviousSeries(e);"Drop"===x.emptyPointSettings.mode&&x.points[b].isEmpty||(a=l(c[b].xValue,p.startValues[b],t,r,o,e),p.startValues[b]===p.endValues[b]&&(a.y=Math.floor(a.y)),h=h.concat((b===d-1&&s?"M":"L")+" "+a.x+" "+a.y+" "))}var w=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,h);this.appendLinePath(w,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingAreaSeries"},t.prototype.getPreviousSeries=function(e){for(var t=e.chart.visibleSeries,i=0,r=t.length;i<r;i++)if(e.index===t[i].index&&0!==i)return t[i-1];return t[0]},t.prototype.getFirstSeriesIndex=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];if(r.visible)return r.index}return 0},t}(Fr),yo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d,p,u,g,y=null,m="",v=e.stackedValues,f=this.enableComplexProperty(e),b=Math.max(e.yAxis.visibleRange.min,v.startValues[0]),x=f.length,w=null,C=0;p="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var P=0;P<x;P++)if(l=f[P],d=l.xValue,l.symbolLocations=[],l.regions=[],g=l.index,l.visible&&S(f[P-1],l,f[P+1],e)&&(null===y&&(y=new Vi(d,0),m+="M "+(n=ve(d-p,b,t,r,o)).x+" "+n.y+" ",m+="L "+(n=ve(d-p,v.endValues[g],t,r,o)).x+" "+n.y+" "),null!=w?(n=ve(l.xValue,v.endValues[g],t,r,o),a=ve(w.xValue,v.endValues[w.index],t,r,o),m+="L "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):"Gap"===e.emptyPointSettings.mode&&(m+="L "+(n=ve(l.xValue,v.endValues[g],t,r,o)).x+" "+n.y+" "),f[P].symbolLocations.push(ve(f[P].xValue,v.endValues[g],t,r,o)),f[P].regions.push(new i.Rect(f[P].symbolLocations[0].x-e.marker.width,f[P].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height)),w=l),f[P+1]&&!f[P+1].visible&&"Drop"!==e.emptyPointSettings.mode){for(var L=void 0,R=P;R>=C;R--)g=f[R].index,L=0===R?0:f[R-1].index,0!==R&&(v.startValues[g]<v.startValues[L]||v.startValues[g]>v.startValues[L])?(n=ve(f[g].xValue,v.startValues[g],t,r,o),m=m.concat("L "+n.x+" "+n.y+" "),n=ve(f[g].xValue,v.startValues[L],t,r,o)):n=ve(f[g].xValue,v.startValues[g],t,r,o),m=m.concat("L "+n.x+" "+n.y+" ");C=P+1,y=null,w=null}if(""!==m){x>1&&(g=f[x-1].index,m+="L "+(a=ve((y={x:f[x-1].xValue+p,y:v.endValues[g]}).x,y.y,t,r,o)).x+" "+a.y+" ",m+="L "+(a=ve((y={x:f[x-1].xValue+p,y:v.startValues[g]}).x,y.y,t,r,o)).x+" "+a.y+" ");for(R=x-1;R>=C;R--){var M=void 0;f[R].visible&&(g=f[R].index,h=ve(f[R].xValue,v.startValues[g],t,r,o),m=m.concat("L "+h.x+" "+h.y+" ")),0===R||f[R-1].visible||(M=this.getNextVisiblePointIndex(f,R)),0!==R&&(u=M||R-1,g=M?f[M].index:f[R-1].index,c=ve(f[u].xValue,v.startValues[g],t,r,o),m=m.concat("L "+h.x+" "+c.y+" "))}s=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,m),this.appendLinePath(s,e,""),this.renderMarker(e)}},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingStepAreaSeries"},t.prototype.getNextVisiblePointIndex=function(e,t){var i;for(i=t-1;i>=0;i--)if(e[i].visible)return i;return 0},t}(Fr),vo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vo(t,e),t.prototype.render=function(e,t,r,o){for(var n,a,s="PolarRadar"===e.chart.chartAreaType?z:ve,l="",h=this.enableComplexProperty(e),c=h.length,d=e.stackedValues,p=0;p<c;p++)h[p].regions=[],h[p].symbolLocations=[],h[p].visible&&S(h[p-1],h[p],h[p+1],e)?(n=s(h[p].xValue,d.endValues[p],t,r,o,e),l=l.concat((p?"L":"M")+" "+n.x+" "+n.y+" "),h[p].symbolLocations.push(s(h[p].xValue,d.endValues[p],t,r,o,e)),h[p].regions.push(new i.Rect(h[p].symbolLocations[0].x-e.marker.width,h[p].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height))):"Drop"!==e.emptyPointSettings.mode&&h[p+1]&&h[p+1].visible&&(n=s(h[p+1].xValue,d.endValues[p+1],t,r,o,e),l=l.concat("M "+n.x+" "+n.y+" "));"PolarRadar"===e.chart.chartAreaType&&h.length>1&&(l+="L "+(a=s((n={y:d.endValues[0],x:e.points[0].xValue}).x,n.y,t,r,o,e)).x+" "+a.y+" ");var u=new i.PathOption(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.interior,e.opacity,e.dashArray,l);this.appendLinePath(u,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingLineSeries"},t}(Fr),bo=function(){function e(){}return e.prototype.render=function(e,t,i,r){e.isRectSeries=!1;for(var o,n,a=e.marker,s=this.enableComplexProperty(e),l="PolarRadar"===e.chart.chartAreaType?z:ve,h=e.chart.redraw,c=0,d=s;c<d.length;c++){var p=d[c];n=h&&p.symbolLocations?p.symbolLocations[0]:null,p.symbolLocations=[],p.regions=[],p.visible&&S(s[p.index-1],p,s[p.index+1],e)&&(o={cancel:!1,name:"pointRender",series:e,point:p,fill:e.setPointColor(p,e.interior),border:e.setBorderColor(p,{width:e.border.width,color:e.border.color}),height:a.height,width:a.width,shape:a.shape},e.chart.trigger("pointRender",o),o.cancel?p.marker={visible:!0}:(p.symbolLocations.push(l(p.xValue,p.yValue,t,i,r,e)),p.color=o.fill,this.refresh(e,p,o,n)))}},e.prototype.enableComplexProperty=function(e){for(var i=[],r=[],o=e.yAxis.visibleRange,n=e.xAxis.visibleRange,a=e.clipRect,s=e.points,l=Math.abs(o.delta/a.height),h=Math.abs(n.delta/a.width),c=s[0]&&s[0].y>l?0:l,d=s[0]&&s[0].x>h?0:h,p=0,u=0,g=0,y=s;g<y.length;g++){var m=y[g];m.symbolLocations=[],p=m.yValue?m.yValue:o.min,u=m.xValue?m.xValue:n.min,(Math.abs(c-p)>=l||Math.abs(d-u)>=h)&&(r.push(m),c=p,d=u)}for(var v,f=0;f<r.length;f++)v=r[f],t.isNullOrUndefined(v.x)||""===v.x||i.push(v);return i},e.prototype.refresh=function(e,t,r,o){var n,a,s=e.chart,l=e.marker,h=r.point.marker.imageUrl||l.imageUrl,c=new i.PathOption(s.element.id+"_Series_"+e.index+"_Point_"+t.index,r.fill,r.border.width,r.border.color,e.opacity,null);s.redraw&&he(c.id)&&(n="Circle"===r.shape?"c":"",a=he(c.id).getAttribute("d")),be(!1,e.seriesElement,ne(t.symbolLocations[0],r.shape,new i.Size(r.width,r.height),h,c,t.x.toString()+":"+t.yValue.toString(),e.chart.svgRenderer,e.clipRect),s.redraw,!0,n+"x",n+"y",o,a),t.regions.push(new i.Rect(t.symbolLocations[0].x-l.width,t.symbolLocations[0].y-l.height,2*l.width,2*l.height)),t.marker={border:r.border,fill:r.fill,height:r.height,visible:!0,width:r.width,shape:r.shape,imageUrl:h}},e.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&r[o]&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}},e.prototype.getModuleName=function(){return"ScatterSeries"},e.prototype.destroy=function(){},e}(),xo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xo(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=0,n=e.points;o<n.length;o++){var a=n[o];a.symbolLocations=[],a.regions=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(t=this.getRectangle(a.xValue+r.start,a.high,a.xValue+r.end,a.low,e),(i=this.triggerEvent(e,a,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(a,t,e),this.drawRectangle(e,a,t,i)))}this.renderMarker(e)},t.prototype.getModuleName=function(){return"RangeColumnSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),So=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Co=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return So(t,e),t.prototype.render=function(e){for(var t,r,o,n,a=this.getSideBySideInfo(e),s=Math.max(e.yAxis.visibleRange.min,0),l=0,h="",c=0,d=null,p=e.chart.requireInvertedAxis,u=0,g=e.chart.redraw,y=0,m=e.points;y<m.length;y++){var v=m[y];if(v.symbolLocations=[],v.regions=[],v.visible&&S(e.points[v.index-1],v,e.points[v.index+1],e)){var f=this.isIntermediateSum(e,v.index),b=this.isSumIndex(e,v.index);c+=f||!0===b?0:v.yValue,o=!0===f?u:null===l||b?s:l,t=this.getRectangle(v.xValue+a.start,c,v.xValue+a.end,o,e),r=this.triggerPointRenderEvent(e,v),f&&(u=c),l=c,r.cancel||(this.updateSymbolLocation(v,t,e),this.drawRectangle(e,v,t,r));var x=v.regions[0];if(null!==d){var w=p?d.x:d.y,C=p?x.x:x.y,P=void 0,L=void 0,R=x.y,M=x.x,A=e.points[v.index-1];0===v.yValue?(P=p?d.x+d.width:d.y+d.height,L=p?v.symbolLocations[0].x:v.symbolLocations[0].y):(P=p?0===A.yValue?A.symbolLocations[0].x:d.x+d.width:0===A.yValue?A.symbolLocations[0].y:d.y+d.height,L=p?x.x+x.width:x.y+x.height),Math.round(w)===Math.round(C)||Math.round(P)===Math.round(C)?(n=p?0===x.x&&0===d.x?L:x.x:x.y,n=0===v.yValue?p?v.symbolLocations[0].x:v.symbolLocations[0].y:n):n=L,p?(0===A.yValue&&(d.y=d.y+d.height/2+t.height/2-d.height),0===v.yValue&&(R=x.y+x.height/2-t.height/2),h=h.concat("M "+n+" "+(d.y+d.height)+" L "+n+" "+R+" ")):(0===A.yValue&&(d.x=d.x+d.width/2-t.width/2,M=x.x+x.width/2+t.width/2-x.width),h=h.concat("M "+d.x+" "+n+" L "+(M+x.width)+" "+n+" "))}d=v.regions[0]}}var k=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Connector_","none",e.connector.width,e.connector.color,e.opacity,e.connector.dashArray,h);g&&he(k.id)&&(h=he(k.id).getAttribute("d"));var T=Fe(g,k.id,k,e.chart.renderer)||e.chart.renderer.drawPath(k,new Int32Array([e.clipRect.x,e.clipRect.y]));T.style.visibility=e.chart.enableCanvas?null:e.animation.enable&&e.chart.animateSeries?"hidden":"visible",be(e.chart.enableCanvas,e.seriesElement,T,g,!0,null,null,null,h),this.renderMarker(e)},t.prototype.isIntermediateSum=function(e,t){return void 0!==e.intermediateSumIndexes&&-1!==e.intermediateSumIndexes.indexOf(t)},t.prototype.isSumIndex=function(e,t){return void 0!==e.sumIndexes&&-1!==e.sumIndexes.indexOf(t)},t.prototype.triggerPointRenderEvent=function(e,t){var i,r=this.isIntermediateSum(e,t.index),o=this.isSumIndex(e,t.index);return i=r||o?e.summaryFillColor:t.y<0?e.negativeFillColor:e.interior,this.triggerEvent(e,t,i,{color:e.border.color,width:e.border.width})},t.prototype.processInternalData=function(e,t){var i,r=e,o=t.intermediateSumIndexes,n=t.sumIndexes;if(void 0!==o&&o.length>0)for(var a=0;a<o.length;a++)for(l=0;l<r.length;l++)l===o[a]&&(i=0===a?P(r,-1,o[a],null,t):P(r,o[a-1],o[a],null,t),r[l][t.yName]=i);if(void 0!==n&&n.length>0)for(var s=0;s<n.length;s++)for(var l=0;l<r.length;l++)l===n[s]&&(i=void 0!==o?P(r,o[s]-1,n[s],n,t):P(r,-1,n[s],null,t),r[l][t.yName]=i);return r},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"WaterfallSeries"},t.prototype.destroy=function(){},t}(jr),Po=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=0,n=e.points;o<n.length;o++){var a=n[o];a.symbolLocations=[],a.regions=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(t=this.getRectangle(a.xValue+r.median,a.high,a.xValue+r.median,a.low,e),(i=this.triggerPointRenderEvent(e,a)).cancel||(e.chart.requireInvertedAxis?(t.height=i.border.width,t.y=t.y-t.height/2):(t.width=i.border.width,t.x=t.x-t.width/2),i.border.width=0,this.updateSymbolLocation(a,t,e),this.drawRectangle(e,a,t,i)))}},t.prototype.triggerPointRenderEvent=function(t,i){var r={color:t.fill,width:Math.max(t.border.width,2)};return e.prototype.triggerEvent.call(this,t,i,t.interior,r)},t.prototype.getModuleName=function(){return"HiloSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),Ro=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ro(t,e),t.prototype.render=function(e){for(var t,i,r,o,n=this.getSideBySideInfo(e),a=Math.max(e.border.width,2),s=0,l=e.points;s<l.length;s++){var h=l[s];if(h.symbolLocations=[],h.regions=[],h.visible&&S(e.points[h.index-1],h,e.points[h.index+1],e)){if(t=this.getRectangle(h.xValue+n.start,Math.max(h.high,h.low),h.xValue+n.end,Math.min(h.high,h.low),e),h.regions.push(this.getRectangle(h.xValue+n.median,Math.max(h.high,h.low),h.xValue+n.median,Math.min(h.high,h.low),e)),this.updateTickRegion(!e.chart.requireInvertedAxis,h.regions[0],a),h.regions.push(this.getRectangle(h.xValue+n.start,Math.max(h.open,h.close),h.xValue+n.median,Math.max(h.open,h.close),e)),h.regions.push(this.getRectangle(h.xValue+n.median,Math.min(h.open,h.close),h.xValue+n.end,Math.min(h.open,h.close),e)),!(o=this.triggerPointRenderEvent(e,h)).cancel){this.updateSymbolLocation(h,h.regions[0],e),i=h.open>h.close?1:2,r=h.open>h.close?2:1;var c={x:h.regions[i].x,y:h.regions[i].y},d={x:h.regions[r].x,y:h.regions[r].y};this.drawHiloOpenClosePath(e,h,c,d,t,o)}this.updateTickRegion(e.chart.requireInvertedAxis,h.regions[1],a),this.updateTickRegion(e.chart.requireInvertedAxis,h.regions[2],a)}}},t.prototype.updateTickRegion=function(e,t,i){e?(t.x-=i/2,t.width=i):(t.y-=i/2,t.height=i)},t.prototype.triggerPointRenderEvent=function(e,t){var i=t.open<=t.close?e.bearFillColor:e.bullFillColor,r={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,r)},t.prototype.drawHiloOpenClosePath=function(e,t,r,o,n,a){var s;e.chart.requireInvertedAxis?(s="M "+n.x+" "+(n.y+n.height/2)+" L "+(n.x+n.width)+" "+(n.y+n.height/2)+" ",s+="M "+r.x+" "+(n.y+n.height/2)+" L "+r.x+" "+(n.y+n.height)+" ",s+="M "+o.x+" "+(n.y+n.height/2)+" L "+o.x+" "+n.y+" "):(s="M "+(n.x+n.width/2)+" "+(n.y+n.height)+" L "+(n.x+n.width/2)+" "+n.y+" ",s+="M "+n.x+" "+r.y+" L "+(n.x+n.width/2)+" "+r.y+" ",s+="M "+(n.x+n.width/2)+" "+o.y+" L "+(n.x+n.width)+" "+o.y+" ");var l=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,a.fill,a.border.width,a.fill,e.opacity,e.dashArray,s);J(he(l.id),s,e.chart.redraw);var h=e.chart.renderer.drawPath(l,new Int32Array([e.clipRect.x,e.clipRect.y]));h.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(h)},t.prototype.getModuleName=function(){return"HiloOpenCloseSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),Ao=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ko=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ao(t,e),t.prototype.render=function(e,t,r,o){for(var n,a="",s="M",l=void 0,h=this.enableComplexProperty(e),c=0,d=h.length;c<d;c++){(n=h[c]).symbolLocations=[],n.regions=[];var p=Math.min(n.low,n.high),u=Math.max(n.low,n.high);if(r.isInversed){var g=p;p=u,u=g}var y=ve(n.xValue,p,t,r,o),m=ve(n.xValue,u,t,r,o);n.symbolLocations.push(m),n.symbolLocations.push(y);var v=new i.Rect(Math.min(y.x,m.x),Math.min(y.y,m.y),Math.max(Math.abs(m.x-y.x),e.marker.width),Math.max(Math.abs(m.y-y.y),e.marker.width));o?v.y-=e.marker.width/2:v.x-=e.marker.width/2,n.regions.push(v),n.visible&&S(h[n.index-1],n,h[n.index+1],e)?(a=a.concat(s+" "+y.x+" "+y.y+" "),l=!1,(c+1<h.length&&!h[c+1].visible||c===h.length-1)&&(s="M",a=(a=this.closeRangeAreaPath(h,n,e,a,c)).concat(" Z"),l=!0),s="L"):(!1===l&&0!==c&&(a=this.closeRangeAreaPath(h,n,e,a,c),l=!0),s="M",n.symbolLocations=[])}var f="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,b=new i.PathOption(f,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,a);this.appendLinePath(b,e,""),this.renderMarker(e)},t.prototype.closeRangeAreaPath=function(e,t,i,r,o){for(var n=o;n>=0&&(e[n].visible&&e[n].symbolLocations[0]);n--)r+="L "+(t=e[n]).symbolLocations[0].x+" "+t.symbolLocations[0].y+" ";return r},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.getModuleName=function(){return"RangeAreaSeries"},t.prototype.destroy=function(){},t}(Fr),To=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_o=function(e){function i(t){var i=e.call(this,t)||this;return i.splinePoints=[],i.lowSplinePoints=[],i}return To(i,e),i.prototype.findSplinePoint=function(e){var t,i,r,o=[],n=[],a=0;o=this.filterEmptyPoints(e);for(var s=0;s<o.length;s++)null!==(r=o[s]).x&&""!==r.x&&(r.index=a,a++,n.push(r));var l=!1;if(this.splinePoints=this.findSplineCoefficients(n,e,l),"SplineRangeArea"===e.type&&(l=!l,this.lowSplinePoints=this.findSplineCoefficients(n,e,l)),n.length>1){e.drawPoints=[],e.lowDrawPoints=[];for(var h=0,c=n;h<c.length;h++){var d=c[h];if(0!==d.index){var p=this.getPreviousIndex(n,d.index-1,e);"SplineRangeArea"===e.type&&(n[p].yValue=n[p].high>n[p].low?n[p].high:n[p].low,d.yValue=d.high>d.low?d.high:d.low),t=this.getControlPoints(n[p],d,this.splinePoints[p],this.splinePoints[d.index],e),e.drawPoints.push(t),"SplineRangeArea"===e.type&&(n[p].yValue=n[p].low<n[p].high?n[p].low:n[p].high,d.yValue=d.low<d.high?d.low:d.high,i=this.getControlPoints(n[p],d,this.lowSplinePoints[p],this.lowSplinePoints[d.index],e),e.lowDrawPoints.push(i));var u=e.yMax-e.yMin;d.yValue&&t.controlPoint1.y&&t.controlPoint2.y&&u>1&&(e.yMin=Math.min(e.yMin,d.yValue,t.controlPoint1.y,t.controlPoint2.y),e.yMax=Math.ceil(Math.max(e.yMax,d.yValue,t.controlPoint1.y,t.controlPoint2.y)),e.yMin="Logarithmic"!==e.yAxis.valueType?Math.floor(e.yMin):e.yMin)}}"PolarRadar"===e.chart.chartAreaType&&e.isClosed&&(t=this.getControlPoints({xValue:n[n.length-1].xValue,yValue:n[n.length-1].yValue},{xValue:n[n.length-1].xValue+1,yValue:n[0].yValue},this.splinePoints[0],this.splinePoints[n[n.length-1].index],e),e.drawPoints.push(t))}},i.prototype.getPreviousIndex=function(e,i,r){if("Drop"!==r.emptyPointSettings.mode)return i;for(;t.isNullOrUndefined(e[i])&&i>-1;)i-=1;return i},i.prototype.getNextIndex=function(e,i,r){if("Drop"!==r.emptyPointSettings.mode)return i;for(;t.isNullOrUndefined(e[i])&&i<e.length;)i+=1;return i},i.prototype.filterEmptyPoints=function(e,i){if("Drop"!==e.emptyPointSettings.mode&&this.isPointInRange(e.points))return i||e.points;for(var r=i||t.extend([],e.points,null,!0),o=0;o<r.length;o++)r[o].index=o,r[o].isEmpty&&(r[o].symbolLocations=[],r[o].regions=[],r.splice(o,1),o--);return r},i.prototype.isPointInRange=function(e){for(var t=0,i=e;t<i.length;t++)if(!i[t].isPointInRange)return!1;return!0},i.prototype.findSplineCoefficients=function(e,t,i){var r=[],o=[],n=t.cardinalSplineTension?t.cardinalSplineTension:.5;switch(n=n<0?0:n>1?1:n,t.splineType){case"Monotonic":r=this.monotonicSplineCoefficients(e,t,i);break;case"Cardinal":r=this.cardinalSplineCofficients(e,t,i);break;default:"Clamped"===t.splineType?r=this.clampedSplineCofficients(e,t,i):(r[0]=o[0]=0,r[e.length-1]=0),r=this.naturalSplineCoefficients(e,t,i)}return r},i.prototype.monotonicSplineCoefficients=function(e,t,i){for(var r,o,n=e.length,a=[],s=[],l=[],h=[],c=0;c<n-1;c++)"SplineRangeArea"===t.type&&(i||(e[c+1].yValue=e[c+1].high>e[c+1].low?e[c+1].high:e[c+1].low,e[c].yValue=e[c].high>e[c].low?e[c].high:e[c].low),i&&(e[c+1].yValue=e[c+1].low<e[c+1].high?e[c+1].low:e[c+1].high,e[c].yValue=e[c].low<e[c].high?e[c].low:e[c].high)),s[c]=e[c+1].xValue-e[c].xValue,l[c]=e[c+1].yValue-e[c].yValue,h[c]=l[c]/s[c];o=h.length,a[0]=h[0],a[n-1]=h[o-1];for(var d=0;d<s.length;d++)o>d+1&&(h[d]*h[d+1]<=0?a[d+1]=0:(r=s[d]+s[d+1],a[d+1]=3*r/((r+s[d+1])/h[d]+(r+s[d])/h[d+1])));return a},i.prototype.cardinalSplineCofficients=function(e,t,i){var r=e.length,o=[],n=t.cardinalSplineTension?t.cardinalSplineTension:.5;n=n<0?0:n>1?1:n;for(var a=0;a<r;a++)o[a]=0===a?r>2?n*(e[a+2].xValue-e[a].xValue):0:a===r-1?r>2?n*(e[r-1].xValue-e[r-3].xValue):0:n*(e[a+1].xValue-e[a-1].xValue);return o},i.prototype.clampedSplineCofficients=function(e,t,i){for(var r=e.length,o=[],n=[],a=0;a<r-1;a++)"SplineRangeArea"===t.type&&(i||(e[1].yValue=e[1].high>e[1].low?e[1].high:e[1].low,e[0].yValue=e[0].high>e[0].low?e[0].high:e[0].low,e[e.length-1].yValue=e[e.length-1].high>e[e.length-1].low?e[e.length-1].high:e[e.length-1].low,e[e.length-2].yValue=e[e.length-2].high>e[e.length-2].low?e[e.length-2].high:e[e.length-2].low),i&&(e[1].yValue=e[1].low<e[1].high?e[1].low:e[1].high,e[0].yValue=e[0].low<e[0].high?e[0].low:e[0].high,e[e.length-1].yValue=e[e.length-1].low<e[e.length-1].high?e[e.length-1].low:e[e.length-1].high,e[e.length-2].yValue=e[e.length-2].low<e[e.length-2].high?e[e.length-2].low:e[e.length-2].high)),o[0]=3*(e[1].yValue-e[0].yValue)/(e[1].xValue-e[0].xValue)-3,n[0]=.5,o[e.length-1]=3*(e[e.length-1].yValue-e[e.length-2].yValue)/(e[e.length-1].xValue-e[e.length-2].xValue),o[0]=n[0]=Math.abs(o[0])===1/0?0:o[0],o[e.length-1]=n[e.length-1]=Math.abs(o[e.length-1])===1/0?0:o[e.length-1];return o},i.prototype.naturalSplineCoefficients=function(e,t,i){var r,o,n,a,s,l=e.length,h=[],c=[];h[0]=c[0]=0,h[e.length-1]=0;for(var d=1;d<l-1;d++)if("SplineRangeArea"===t.type&&(i||(e[d+1].yValue=e[d+1].low>e[d+1].high?e[d+1].low:e[d+1].high,e[d].yValue=e[d].low>e[d].high?e[d].low:e[d].high,e[d-1].yValue=e[d-1].low>e[d-1].high?e[d-1].low:e[d-1].high),i&&(e[d+1].yValue=e[d+1].high<e[d+1].low?e[d+1].high:e[d+1].low,e[d].yValue=e[d].high<e[d].low?e[d].high:e[d].low,e[d-1].yValue=e[d-1].high<e[d-1].low?e[d-1].high:e[d-1].low)),n=e[d].xValue-e[d-1].xValue,a=e[d+1].xValue-e[d-1].xValue,s=e[d+1].xValue-e[d].xValue,r=e[d+1].yValue-e[d].yValue||null,o=e[d].yValue-e[d-1].yValue||null,0===n||0===a||0===s)h[d]=0,c[d]=0;else{var p=1/(n*h[d-1]+2*a);h[d]=-p*s,c[d]=p*(6*(r/s-o/n)-n*c[d-1])}for(var u=l-2;u>=0;u--)h[u]=h[u]*h[u+1]+c[u];return h},i.prototype.getControlPoints=function(e,t,i,r,o){var n,a,s,l=i,h=r,c=e.xValue,d=e.yValue,p=t.xValue,u=t.yValue;switch(o.splineType){case"Cardinal":"DateTime"===o.xAxis.valueType&&(l=i/this.dateTimeInterval(o),h=r/this.dateTimeInterval(o)),n=new Vi(c+i/3,d+l/3),a=new Vi(p-r/3,u-h/3),s=new Wi(n,a);break;case"Monotonic":var g=(p-c)/3;n=new Vi(c+g,d+i*g),a=new Vi(p-g,u-r*g),s=new Wi(n,a);break;default:var y=p-c,m=1/3*(d+2*u-1/3*(y*=y)*(.5*i+r));n=new Vi((2*c+p)*(1/3),1/3*(2*d+u-1/3*y*(i+.5*r))),a=new Vi((c+2*p)*(1/3),m),s=new Wi(n,a)}return s},i.prototype.dateTimeInterval=function(e){var t=e.xAxis.actualIntervalType;return"Years"===t?31536e6:"Months"===t?2592e6:"Days"===t?864e5:"Hours"===t?36e5:"Minutes"===t?6e4:"Seconds"===t?1e3:2592e6},i.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},i}(Fr),Oo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Oo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d="",p=void 0,u=null,g=[],y=[],m=0;g=this.filterEmptyPoints(e);for(w=0;w<g.length;w++)null!==(n=g[w]).x&&""!==n.x&&(n.index=m,m++,y.push(n));for(var v,f,b=this.enableComplexProperty(e),x=b.length,w=0;w<x;w++){(n=b[w]).regions=[],n.symbolLocations=[],f=this.getNextIndex(y,n.index-1,e),v=this.getPreviousIndex(y,n.index-1,e);var C=Math.min(n.low,n.high),P=Math.max(n.low,n.high);if(r.isInversed){var L=C;C=P,P=L}var R=ve(n.xValue,C,t,r,o),M=ve(n.xValue,P,t,r,o);n.symbolLocations.push(M),n.symbolLocations.push(R);var A=new i.Rect(Math.min(R.x,M.x),Math.min(R.y,M.y),Math.max(Math.abs(M.x-R.x),e.marker.width),Math.max(Math.abs(M.y-R.y),e.marker.width));o?A.y-=e.marker.width/2:A.x-=e.marker.width/2,n.regions.push(A),n.visible&&S(b[v],n,b[f],e)?(u?(h=e.drawPoints[v].controlPoint1,c=e.drawPoints[v].controlPoint2,a=ve(n.xValue,n.high>n.low?n.high:n.low,t,r,o),s=ve(h.x,h.y,t,r,o),l=ve(c.x,c.y,t,r,o),d=d.concat("C "+s.x+" "+s.y+" "+l.x+" "+l.y+" "+a.x+" "+a.y+" ")):(d=r.isInversed?d.concat("M "+M.x+" "+M.y+" L "+R.x+" "+R.y+" "):d.concat("M "+R.x+" "+R.y+" L "+M.x+" "+M.y+" "),p=!1),(w+1<b.length&&!b[w+1].visible||w===b.length-1)&&(d=(d=this.closeSplineRangeAreaPath(b,n,e,d,w,t,r,o)).concat(" Z"),p=!0),u=n):(!1===p&&0!==w&&(d=this.closeSplineRangeAreaPath(b,n,e,d,w,t,r,o),p=!0),u=null,n.symbolLocations=[])}var k="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,T=new i.PathOption(k,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,d);this.appendLinePath(T,e,""),this.renderMarker(e)},t.prototype.closeSplineRangeAreaPath=function(e,t,i,r,o,n,a,s){for(var l,h,c,d,p,u=null,g=o;g>0&&e[g].visible;g--){t=e[g];var y=Math.min(t.low,t.high),m=Math.max(t.low,t.high);if(a.isInversed){var v=y;y=m,m=v}var f=ve(t.xValue,y,n,a,s),b=ve(t.xValue,m,n,a,s);u?(d=i.lowDrawPoints[g].controlPoint1,p=i.lowDrawPoints[g].controlPoint2,l=ve(t.xValue,t.low<t.high?t.low:t.high,n,a,s),h=ve(d.x,d.y,n,a,s),c=ve(p.x,p.y,n,a,s),r=r.concat("C "+c.x+" "+c.y+" "+h.x+" "+h.y+" "+l.x+" "+l.y+" ")):r=a.isInversed?r.concat("L "+b.x+" "+b.y+" "):r.concat("L "+f.x+" "+f.y+" "),u=t}return r},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.getModuleName=function(){return"SplineRangeAreaSeries"},t.prototype.destroy=function(){},t}(_o),Io=function(){function e(){}return e.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d=e.marker,p=e.points,u=Math.max(e.chart.initialClipRect.height,e.chart.initialClipRect.width),g=u/100,y=e.maxRadius*g,m=e.minRadius*g,v=null,f=e.chart.redraw;if(null===e.maxRadius||null===e.minRadius){for(var b=0,x=e.chart.visibleSeries;b<x.length;b++){var w=x[b];"Bubble"!==w.type||!0!==w.visible||null!==w.maxRadius&&null!==w.minRadius||(v=w.sizeMax>v?w.sizeMax:v)}m=y=1,l=u/5/2*y}else v=e.sizeMax,l=y-m;for(var C=0,P=p;C<P.length;C++){var L=P[C];L.symbolLocations=[],L.regions=[],L.visible&&S(p[L.index-1],L,p[L.index+1],e)&&(s=(s=null===e.maxRadius||null===e.minRadius?l*Math.abs(+L.size/v):m+l*Math.abs(+L.size/v))||m,a={cancel:!1,name:"pointRender",series:e,point:L,fill:e.setPointColor(L,e.interior),border:e.setBorderColor(L,{width:e.border.width,color:e.border.color}),height:2*s,width:2*s},e.chart.trigger("pointRender",a),a.cancel?L.marker={visible:!1}:(L.symbolLocations.push(ve(L.xValue,L.yValue,t,r,o)),L.color=a.fill,n=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+L.index,a.fill,a.border.width,a.border.color,e.opacity,null),h=ne(L.symbolLocations[0],"Circle",new i.Size(a.width,a.height),d.imageUrl,n,L.x.toString()+":"+L.yValue.toString(),e.chart.svgRenderer,e.clipRect),be(!1,e.seriesElement,h,f),L.regions.push(new i.Rect(L.symbolLocations[0].x-s,L.symbolLocations[0].y-s,2*s,2*s)),L.marker={border:a.border,fill:a.fill,height:a.height,visible:!0,shape:"Circle",width:a.width},c=f?L.symbolLocations[0]:null,f&&Ne(h,300,c,L.symbolLocations[0],"cx","cy")))}},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"BubbleSeries"},e.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}},e}(),zo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Do=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zo(t,e),t.prototype.render=function(e,t,r,o){var n=null,a="",s="M",l=[],h="TrendLine"===e.category?e.points:this.enableComplexProperty(e);l=this.filterEmptyPoints(e,h);for(var c,d="PolarRadar"===e.chart.chartAreaType?z:ve,p=0,u=l;p<u.length;p++){var g=u[p];c=this.getPreviousIndex(l,g.index-1,e),g.symbolLocations=[],g.regions=[],g.visible&&S(l[c],g,l[this.getNextIndex(l,g.index-1,e)],e)?(null!==n&&(a=this.getSplineDirection(e.drawPoints[c],n,g,t,r,o,e,s,d,a),s="L"),n=g,this.storePointLocation(g,e,o,d)):(s="M",n=null,g.symbolLocations=[])}if(l.length>0&&e.drawPoints.length>0&&"PolarRadar"===e.chart.chartAreaType&&e.isClosed){var y=this.getFirstLastVisiblePoint(l);a=this.getSplineDirection(e.drawPoints[e.drawPoints.length-1],y.last,{xValue:y.first.xValue,yValue:y.first.yValue},t,r,o,e,s,d,a),s="L"}var m="TrendLine"===e.category?e.chart.element.id+"_Series_"+e.sourceIndex+"_TrendLine_"+e.index:e.chart.element.id+"_Series_"+e.index,v=new i.PathOption(m,"transparent",e.width,e.interior,e.opacity,e.dashArray,a);this.appendLinePath(v,e,""),this.renderMarker(e)},t.prototype.getSplineDirection=function(e,t,i,r,o,n,a,s,l,h){var c=e.controlPoint1,d=e.controlPoint2,p=l(t.xValue,t.yValue,r,o,n,a),u=l(i.xValue,i.yValue,r,o,n,a),g=l(c.x,c.y,r,o,n,a),y=l(d.x,d.y,r,o,n,a);return h.concat(s+" "+p.x+" "+p.y+" C "+g.x+" "+g.y+" "+y.x+" "+y.y+" "+u.x+" "+u.y+" ")},t.prototype.getModuleName=function(){return"SplineSeries"},t.prototype.destroy=function(){},t}(_o),Bo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bo(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),t.showNormalDistribution&&this.renderNormalDistribution(t)},t.prototype.calculateBinInterval=function(e,t){for(var i=C(e)/e.length,r=0,o=0,n=e;o<n.length;o++){var a=n[o];r+=(a-i)*(a-i)}t.histogramValues.mean=i,t.histogramValues.sDValue=Math.round(Math.sqrt(r/e.length-1)),t.histogramValues.binWidth=t.binInterval||Math.round(3.5*t.histogramValues.sDValue/Math.pow(e.length,1/3))||1},t.prototype.processInternalData=function(e,t){for(var i,r=[],o=[],n=Object.keys(e),a=0;a<n.length;a++){var s=n[a];o.push(e[s][t.yName])}t.histogramValues={yValues:o};var l=Math.min.apply(Math,t.histogramValues.yValues),h=Math.max.apply(Math,t.histogramValues.yValues);this.calculateBinInterval(t.histogramValues.yValues,t);for(var c,d=t.histogramValues.binWidth,p=0;p<e.length;)c=o.filter(function(e){return e>=l&&e<l+d}).length,l+d===h&&(c+=o.filter(function(e){return e>=h}).length),r.push((i={x:l+d/2},i[t.yName]=c,i)),l+=d,p+=c;return r},t.prototype.calculateBinValues=function(e){var t,i,r=e.histogramValues.yValues.length,o=e.histogramValues.binWidth,n=e.histogramValues.mean,a=e.histogramValues.sDValue,s=e.xAxis.minimum?parseInt(e.xAxis.minimum.toString()):e.xMin,l=((e.xAxis.maximum?parseInt(e.xAxis.maximum.toString()):e.xMax)-s)/499;if(e.points.length)for(var h=0;h<500;h++)t=s+h*l,i=Math.exp(-(t-n)*(t-n)/(2*a*a))/(a*Math.sqrt(2*Math.PI))*o*r,e.yMin=e.yMin>i?i:e.yMin,e.yMax=e.yMax<i?i:e.yMax},t.prototype.renderNormalDistribution=function(e){var t,r,o=e.xAxis.actualRange.min,n=e.xAxis.actualRange.max,a="",s="M",l=e.histogramValues.yValues.length,h=e.histogramValues.binWidth,c=e.histogramValues.mean,d=e.histogramValues.sDValue,p=(n-o)/499;if(e.points.length)for(var u=0;u<500;u++)a+=s+" "+(r=ve(t=o+u*p,Math.exp(-(t-c)*(t-c)/(2*d*d))/(d*Math.sqrt(2*Math.PI))*h*l,e.xAxis,e.yAxis,e.chart.requireInvertedAxis)).x+" "+r.y+" ",s="L";var g=e.chart.renderer.drawPath(new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_NDLine","transparent",2,e.chart.themeStyle.errorBar,e.opacity,e.dashArray,a),new Int32Array([e.clipRect.x,e.clipRect.y]));g.style.visibility=e.chart.enableCanvas?null:e.animation.enable&&e.chart.animateSeries?"hidden":"visible",e.chart.enableCanvas||e.seriesElement.appendChild(g)},t.prototype.doAnimation=function(t){e.prototype.doAnimation.call(this,t),t.showNormalDistribution&&oe(t.seriesElement.lastElementChild,t.animation.duration,500,"FadeIn")},t.prototype.getModuleName=function(){return"HistogramSeries"},t.prototype.destroy=function(){},t}(Xr),No=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return No(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d=null,p="",u=null,g=null,y=[],m=[],v=0;y=this.filterEmptyPoints(e);for(C=0;C<y.length;C++)null!==(c=y[C]).x&&""!==c.x&&(c.index=v,v++,m.push(c));for(var f,b=m.length,x="PolarRadar"===e.chart.chartAreaType?z:ve,w="PolarRadar"===e.chart.chartAreaType?e.points[0].yValue:Math.max(e.yAxis.visibleRange.min,0),C=0;C<b;C++)(c=m[C]).symbolLocations=[],c.regions=[],f=this.getPreviousIndex(m,c.index-1,e),c.visible&&S(m[f],c,m[this.getNextIndex(m,c.index-1,e)],e)?(d?(l=e.drawPoints[f].controlPoint1,h=e.drawPoints[f].controlPoint2,n=x(c.xValue,c.yValue,t,r,o,e),a=x(l.x,l.y,t,r,o,e),s=x(h.x,h.y,t,r,o,e),p=p.concat("C "+a.x+" "+a.y+" "+s.x+" "+s.y+" "+n.x+" "+n.y+" ")):(p+="M "+(u=x(c.xValue,w,t,r,o,e)).x+" "+u.y+" ",p+="L "+(g=x(c.xValue,c.yValue,t,r,o,e)).x+" "+g.y+" "),this.storePointLocation(c,e,o,x),d=c):(d=null,c.symbolLocations=[]),(C+1<b&&!m[C+1].visible||C===b-1)&&n&&u&&(u=x(c.xValue,w,t,r,o,e),p=p.concat("L "+u.x+" "+u.y));this.appendLinePath(new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,p),e,""),this.renderMarker(e)},t.prototype.getModuleName=function(){return"SplineAreaSeries"},t.prototype.destroy=function(){},t}(_o),jo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ho=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),t.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(i,e,e.type,e.fill,e.width,t)},t.prototype.setSeriesProperties=function(e,t,i,r,o,n){e.name=i.length<=4?i.toLocaleUpperCase():i,e.xName="x",e.yName="y",e.fill=r||"#606eff",e.dashArray=t.dashArray,e.width=o,e.xAxisName=t.xAxisName,e.animation=t.animation,e.yAxisName=t.yAxisName,e.clipRectElement=t.clipRectElement,e.points=[],e.enableTooltip=!0,e.interior=e.fill,e.category="Indicator",e.index=t.index,e.chart=n,e.xMin=1/0,e.xMax=-1/0,e.yMin=1/0,e.yMax=-1/0,e.xData=[],e.yData=[],e.marker.visible=!1,t.targetSeries.push(e)},t.prototype.createIndicatorElements=function(e,t,r){(t.seriesName||t.dataSource)&&Y(t.targetSeries[0]);var o=new i.Rect(0,0,0,0);(t.seriesName||t.dataSource)&&(o=t.targetSeries[0].clipRect);var n=new Di(e.element.id+"_ChartIndicatorClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:o.width,height:o.height}),a=K(e.redraw,n,e.renderer);t.indicatorElement=e.renderer.createGroup({id:e.element.id+"IndicatorGroup"+r,transform:"translate("+o.x+","+o.y+")","clip-path":"url(#"+e.element.id+"_ChartIndicatorClipRect_"+r+")"}),t.indicatorElement.appendChild(a);for(var s=0,l=t.targetSeries;s<l.length;s++){var h=l[s];h.clipRectElement=a;var c=h.chart.renderer.createGroup({id:h.chart.element.id+"_Indicator_"+t.index+"_"+h.name+"_Group"});t.indicatorElement.appendChild(c),h.seriesElement=c}e.indicatorElements.appendChild(t.indicatorElement)},t.prototype.getDataPoint=function(e,t,i,r,o,n){void 0===n&&(n=null);var a=new Ki;return a.x=e,a.y=t,a.xValue=i.xValue,a.color=r.fill,a.index=o,a.yValue=t,a.visible=!0,r.xMin=Math.min(r.xMin,a.xValue),r.yMin=Math.min(r.yMin,a.yValue),r.xMax=Math.max(r.xMax,a.xValue),r.yMax=Math.max(r.yMax,a.yValue),r.xData.push(a.xValue),n&&"Macd"===n.type&&"Column"===r.type&&(a.y>=0?a.color=n.macdPositiveColor:a.color=n.macdNegativeColor),a},t.prototype.getRangePoint=function(e,t,i,r,o,n){var a=new Ki;return a.x=e,a.high=t,a.low=i,a.xValue=r.xValue,a.color=o.fill,a.index=n,a.visible=!0,o.xData.push(a.xValue),a},t.prototype.setSeriesRange=function(e,t,i){void 0===i&&(i=null),i?i.points=e:t.targetSeries[0].points=e},t}(Fr),Xo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xo(t,e),t.prototype.initDataSource=function(e,t){var i=[],r=e.points;if(r&&r.length){var o=r,n=G(e.field),a=e.targetSeries[0];if(o&&o.length&&o.length>=e.period){for(var s=0,l=0,h=0;h<e.period;h++)l+=o[h][n];s=l/e.period,i.push(this.getDataPoint(o[e.period-1].x,s,o[e.period-1],a,i.length));for(var c=e.period;c<o.length;)l-=o[c-e.period][n],s=(l+=o[c][n])/e.period,i.push(this.getDataPoint(o[c].x,s,o[c],a,i.length)),c++}this.setSeriesRange(i,e)}},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"SmaIndicator"},t}(Ho),Go=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),t.prototype.initDataSource=function(e,t){var i=G(e.field),r=[],o=e.targetSeries[0],n=e.points;if(n&&n.length&&n.length>=e.period){for(var a=0,s=0,l=2/(e.period+1),h=0;h<e.period;h++)a+=n[h][i];s=a/e.period,r.push(this.getDataPoint(n[e.period-1].x,s,n[e.period-1],o,r.length));for(var c=e.period;c<n.length;){var d=r[c-e.period][o.yName],p=(n[c][i]-d)*l+d;r.push(this.getDataPoint(n[c].x,p,n[c],o,r.length)),c++}}this.setSeriesRange(r,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"EmaIndicator"},t}(Ho),Uo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Uo(t,e),t.prototype.initDataSource=function(e,t){var i=[],r=G(e.field),o=e.points;if(o&&o.length&&o.length>=e.period){var n=e.targetSeries[0],a=e.points;if(a.length&&a.length>=e.period){for(var s=0,l=[],h=0,c=a.length,d=e.period;c>=d;){s=0;for(u=h=a.length-c;u<h+d;u++)s+=a[u][r];s/=d,l.push(s),c--}for(var p=0;p<d-1;p++){s=0;for(u=0;u<p+1;u++)s+=a[u][r];s/=p+1,l.splice(p,0,s)}for(h=e.period;h<=l.length;){s=0;for(var u=h-e.period;u<h;u++)s+=l[u];s/=e.period,i.push(this.getDataPoint(a[h-1].x,s,a[h-1],n,i.length)),h++}}}this.setSeriesRange(i,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"TmaIndicator"},t}(Ho),qo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qo(t,e),t.prototype.initDataSource=function(e){var t=[],i=e.points;i.length>0&&i.length>e.period&&(t=this.calculateADPoints(e,i)),this.setSeriesRange(t,e)},t.prototype.calculateADPoints=function(e,t){var i=[],r=0,o=0,n=0,a=0,s=0,l=e.targetSeries[0];for(o=0;o<t.length;o++)n=Number(t[o].high),a=Number(t[o].low),r+=((s=Number(t[o].close))-a-(n-s))/(n-a)*Number(t[o].volume),i[o]=this.getDataPoint(t[o].x,r,t[o],l,i.length);return i},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AccumulationDistributionIndicator"},t}(Ho),$o=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $o(t,e),t.prototype.initDataSource=function(e,t){var i=e.points;i.length>0&&i.length>e.period&&this.calculateATRPoints(e,i)},t.prototype.calculateATRPoints=function(e,t){for(var i=0,r=0,o=0,n=0,a=0,s=[],l=[],h=e.period,c=0,d=e.targetSeries[0],p=0;p<t.length;p++)r=Number(t[p].high)-Number(t[p].low),p>0&&(o=Math.abs(Number(t[p].high)-Number(t[p-1].close)),n=Math.abs(Number(t[p].low)-Number(t[p-1].close))),c+=a=Math.max(r,o,n),p>=h?(i=(Number(l[p-1].y)*(h-1)+a)/h,s.push(this.getDataPoint(t[p].x,i,t[p],d,s.length))):(i=c/h,p===h-1&&s.push(this.getDataPoint(t[p].x,i,t[p],d,s.length))),l[p]={x:t[p].x,y:i};this.setSeriesRange(s,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AtrIndicator"},t}(Ho),Ko=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),en=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ko(t,e),t.prototype.initSeriesCollection=function(t,i){e.prototype.initSeriesCollection.call(this,t,i);var r=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,r,t,"UpperLine",t.upperLine.color,t.upperLine.width,i)},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=e.points;if(o&&o.length){var n=e.targetSeries[1],a=e.targetSeries[0],s=e.period;if(o.length>=e.period)for(var l=0;l<o.length;l++)i.push(this.getDataPoint(o[l].x,100,o[l],n,i.length)),l<s||r.push(this.getDataPoint(o[l].x,Number(o[l].close)/Number(o[l-s].close)*100,o[l],a,r.length));this.setSeriesRange(r,e,e.targetSeries[0]),this.setSeriesRange(i,e,e.targetSeries[1])}},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"MomentumIndicator"},t}(Ho),tn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tn(t,e),t.prototype.initSeriesCollection=function(t,i){if(e.prototype.initSeriesCollection.call(this,t,i),t.showZones){var r=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,r,t,"LowerLine",t.lowerLine.color,t.lowerLine.width,i);var o=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,o,t,"UpperLine",t.upperLine.color,t.upperLine.width,i)}},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=[],n=e.targetSeries[0],a=e.points;if(a.length&&a.length>=e.period){if(e.showZones)for(c=0;c<a.length;c++)o.push(this.getDataPoint(a[c].x,e.overBought,a[c],e.targetSeries[1],o.length)),r.push(this.getDataPoint(a[c].x,e.overSold,a[c],e.targetSeries[2],r.length));for(var s=Number(a[0].close),l=0,h=0,c=1;c<=e.period;c++){var d=Number(a[c].close);d>s?l+=d-s:h+=s-d,s=d}l/=e.period,h/=e.period,i.push(this.getDataPoint(a[e.period].x,100-100/(1+l/h),a[e.period],n,i.length));for(var p=e.period+1;p<a.length;p++){var u=Number(a[p].close);u>s?(l=(l*(e.period-1)+(u-s))/e.period,h=h*(e.period-1)/e.period):u<s&&(h=(h*(e.period-1)+(s-u))/e.period,l=l*(e.period-1)/e.period),s=u,i.push(this.getDataPoint(a[p].x,100-100/(1+l/h),a[p],n,i.length))}}this.setSeriesRange(i,e,e.targetSeries[0]),e.showZones&&(this.setSeriesRange(o,e,e.targetSeries[1]),this.setSeriesRange(r,e,e.targetSeries[2]))},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"RsiIndicator"},t}(Ho),on=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return on(t,e),t.prototype.initSeriesCollection=function(t,i){e.prototype.initSeriesCollection.call(this,t,i);var r=new nr(t,"targetSeries",{},!0);if(this.setSeriesProperties(r,t,"PeriodLine",t.periodLine.color,t.periodLine.width,i),t.showZones){var o=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(o,t,"UpperLine",t.upperLine.color,t.upperLine.width,i);var n=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(n,t,"LowerLine",t.lowerLine.color,t.lowerLine.width,i)}},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=[],n=[],a=[],s=e.points;if(s.length&&s.length>=e.period){if(e.showZones)for(var l=0;l<s.length;l++)r.push(this.getDataPoint(s[l].x,e.overBought,s[l],e.targetSeries[2],r.length)),o.push(this.getDataPoint(s[l].x,e.overSold,s[l],e.targetSeries[3],o.length));a=this.calculatePeriod(e.period,e.kPeriod,s,e.targetSeries[1]),n=this.smaCalculation(e.period,e.kPeriod,a,e.targetSeries[1]),i=this.smaCalculation(e.period+e.kPeriod-1,e.dPeriod,a,e.targetSeries[0])}this.setSeriesRange(i,e,e.targetSeries[0]),this.setSeriesRange(n,e,e.targetSeries[1]),e.showZones&&(this.setSeriesRange(r,e,e.targetSeries[2]),this.setSeriesRange(o,e,e.targetSeries[3]))},t.prototype.smaCalculation=function(e,t,i,r){var o=[];if(i.length>=e+t){for(var n=e+(t-1),a=[],s=[],l=0;l<i.length;l++){var h=Number(i[l].y);a.push(h)}for(var c=a.length;c>=n;){for(var d=0,l=e-1;l<e+t-1;l++)d+=a[l];d/=t,s.push(d.toFixed(2)),a.splice(0,1),c=a.length}for(var p=n-1,l=0;l<i.length;l++)l<p||(o.push(this.getDataPoint(i[l].x,Number(s[l-p]),i[l],r,o.length)),i[l].y=Number(s[l-p]))}return o},t.prototype.calculatePeriod=function(e,t,i,r){for(var o=[],n=[],a=[],s=[],l=0;l<i.length;l++)o[l]=i[l].low,n[l]=i[l].high,a[l]=i[l].close;if(i.length>e){for(var h=[],c=[],d=0;d<e-1;++d)c.push(0),h.push(0),s.push(this.getDataPoint(i[d].x,i[d].close,i[d],r,s.length));for(d=e-1;d<i.length;++d){for(var p=Number.MAX_VALUE,u=Number.MIN_VALUE,l=0;l<e;++l)p=Math.min(p,o[d-l]),u=Math.max(u,n[d-l]);c.push(u),h.push(p)}for(d=e-1;d<i.length;++d){var g=0,y=0;g+=a[d]-h[d],y+=c[d]-h[d],s.push(this.getDataPoint(i[d].x,g/y*100,i[d],r,s.length))}}return s},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StochasticIndicator"},t}(Ho),an=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return an(t,e),t.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new nr(e,"targetSeries",{},!0);i.type="RangeArea","transparent"!==e.bandColor&&"none"!==e.bandColor&&this.setSeriesProperties(i,e,"BollingerBand",e.bandColor,0,t);var r=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(r,e,"BollingerBand",e.fill,e.width,t);var o=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(o,e,"UpperLine",e.upperLine.color,e.upperLine.width,t);var n=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(n,e,"LowerLine",e.lowerLine.color,e.lowerLine.width,t)},t.prototype.initDataSource=function(e,t){var i="transparent"!==e.bandColor&&"none"!==e.bandColor,r=i?1:0,o=[],n=[],a=[],s=[],l=e.targetSeries[r+1],h=e.targetSeries[r+2],c=e.targetSeries[r],d=i?e.targetSeries[0]:null,p=e.points;if(p.length&&p.length>=e.period){for(var u=0,g=0,y=e.standardDeviation,m=p.length,v=Math.round(e.period),f=[],b=[],x=[],w=0;w<v;w++)u+=Number(p[w].close);for(var S=u/e.period,C=0;C<m;C++){var P=Number(p[C].close);if(C>=v-1&&C<m){C-e.period>=0?(S=(u+=P-Number(p[C-v].close))/e.period,f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C]-b[C-v]):(f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C]);var L=Math.sqrt(g/e.period),R=f[C]-y*L,M=f[C]+y*L;if(C+1===v)for(var A=0;A<v-1;A++)x[A]={X:p[A].x,mb:f[C],lb:R,ub:M,visible:!0};x[C]={X:p[C].x,mb:f[C],lb:R,ub:M,visible:!0}}else C<e.period-1&&(f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C])}for(var k=-1,T=-1,_=0;_<m;_++)if(_>=v-1){n.push(this.getDataPoint(p[_].x,x[_].ub,p[_],l,n.length)),a.push(this.getDataPoint(p[_].x,x[_].lb,p[_],h,a.length)),o.push(this.getDataPoint(p[_].x,x[_].mb,p[_],c,o.length)),i&&s.push(this.getRangePoint(p[_].x,n[++k].y,a[++T].y,p[_],d,s.length))}}i&&this.setSeriesRange(s,e,e.targetSeries[0]),this.setSeriesRange(o,e,e.targetSeries[r]),this.setSeriesRange(n,e,e.targetSeries[r+1]),this.setSeriesRange(a,e,e.targetSeries[r+2])},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"BollingerBandsIndicator"},t}(Ho),ln=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ln(t,e),t.prototype.initSeriesCollection=function(t,i){if(e.prototype.initSeriesCollection.call(this,t,i),"Line"===t.macdType||"Both"===t.macdType){var r=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(r,t,"MacdLine",t.macdLine.color,t.macdLine.width,i)}if("Histogram"===t.macdType||"Both"===t.macdType){var o=new nr(t,"targetSeries",{},!0);o.type="Column",this.setSeriesProperties(o,t,"Histogram",t.macdPositiveColor,t.width,i)}},t.prototype.initDataSource=function(e,t){var i,r,o=[],n=e.fastPeriod,a=e.slowPeriod,s=e.period,l=n+s,h=[],c=[],d=e.points,p=e.targetSeries[0];if("Histogram"===e.macdType?i=e.targetSeries[1]:(r=e.targetSeries[1],"Both"===e.macdType&&(i=e.targetSeries[2])),d&&l<d.length&&a<=n&&a>0&&l-2>=0){var u=this.calculateEMAValues(a,d,"close"),g=this.calculateEMAValues(n,d,"close"),y=this.getMACDVales(e,u,g);h=this.getMACDPoints(e,y,d,r||p);var m=this.calculateEMAValues(s,h,"y");o=this.getSignalPoints(e,m,d,p),i&&(c=this.getHistogramPoints(e,y,m,d,i))}this.setSeriesRange(o,e,e.targetSeries[0]),i&&this.setSeriesRange(c,e,i),r&&this.setSeriesRange(h,e,r)},t.prototype.calculateEMAValues=function(e,t,i){for(var r=0,o=0,n=[],a=2/(e+1),s=0;s<e;s++)r+=Number(t[s][i]);o=r/e,n.push(o);for(var l=o,h=e;h<t.length;h++)l=(Number(t[h][i])-l)*a+l,n.push(l);return n},t.prototype.getMACDPoints=function(e,t,i,r){for(var o=[],n=e.fastPeriod-1,a=0;n<i.length;)o.push(this.getDataPoint(i[n].x,t[a],i[n],r,o.length)),n++,a++;return o},t.prototype.getSignalPoints=function(e,t,i,r){for(var o=e.fastPeriod+e.period-2,n=0,a=[];o<i.length;)a.push(this.getDataPoint(i[o].x,t[n],i[o],r,a.length)),o++,n++;return a},t.prototype.getMACDVales=function(e,t,i){for(var r=[],o=e.fastPeriod-e.slowPeriod,n=0;n<i.length;n++)r.push(t[n+o]-i[n]);return r},t.prototype.getHistogramPoints=function(e,t,i,r,o){for(var n=e.fastPeriod+e.period-2,a=0,s=[];n<r.length;)s.push(this.getDataPoint(r[n].x,t[a+(e.period-1)]-i[a],r[n],o,s.length,e)),n++,a++;return s},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"MacdIndicator"},t}(Ho),cn=function(){function e(){}return e.prototype.initSeriesCollection=function(e,t){var i=new nr(e,"targetSeries",{},!0);"Linear"===e.type||"MovingAverage"===e.type?i.type="Line":i.type="Spline",this.setSeriesProperties(i,e,e.type,e.fill,e.width,t)},e.prototype.setSeriesProperties=function(e,t,i,r,o,n){e.name=t.name,e.xName="x",e.yName="y",e.fill=r||"blue",e.width=o,e.dashArray=t.dashArray,e.clipRectElement=t.clipRectElement,e.points=[],e.enableTooltip=t.enableTooltip,e.index=t.index,e.sourceIndex=t.sourceIndex,e.interior=e.fill,e.animation=t.animation,e.legendShape="HorizontalLine",e.marker=t.marker,e.category="TrendLine",e.chart=n,e.xMin=1/0,e.xMax=-1/0,e.yMin=1/0,e.yMax=-1/0,e.xData=[],e.yData=[],t.targetSeries=e,n.isBlazor&&(t.targetSeries.border={},t.targetSeries.connector={})},e.prototype.createTrendLineElements=function(e,t,i,r,o){t.trendLineElement=r,t.targetSeries.clipRectElement=o,t.targetSeries.seriesElement=r,e.trendLineElements&&e.trendLineElements.appendChild(t.trendLineElement)},e.prototype.getDataPoint=function(e,t,i,r){var o=new Ki;return o.x="DateTime"===i.xAxis.valueType?new Date(Number(e)):e,o.y=t,o.xValue=Number(e),o.color=i.fill,o.index=r,o.yValue=Number(t),o.visible=!0,i.xMin=Math.min(i.xMin,o.xValue),i.yMin=Math.min(i.yMin,o.yValue),i.xMax=Math.max(i.xMax,o.xValue),i.yMax=Math.max(i.yMax,o.yValue),i.xData.push(o.xValue),o},e.prototype.findSlopeIntercept=function(e,t,i,r){for(var o=0,n=0,a=0,s=0,l=0,h=0,c=0;l<r.length;)isNaN(t[l])&&(t[l]=(t[l-1]+t[l+1])/2),o+=e[l],n+=t[l],a+=e[l]*t[l],s+=e[l]*e[l],l++;var d=i.type;if(!i.intercept||"Linear"!==d&&"Exponential"!==d)h=(r.length*a-o*n)/(r.length*s-o*o),h="Linear"===d?h:Math.abs(h),c="Exponential"===d||"Power"===d?Math.exp((n-h*o)/r.length):(n-h*o)/r.length;else switch(c=i.intercept,d){case"Linear":h=(a-i.intercept*o)/s;break;case"Exponential":h=(a-Math.log(Math.abs(i.intercept))*o)/s}return{slope:h,intercept:c}},e.prototype.initDataSource=function(e){var t=e.points;if(t&&t.length){var i=e.targetSeries;switch(e.type){case"Linear":this.setLinearRange(t,e,i);break;case"Exponential":this.setExponentialRange(t,e,i);break;case"MovingAverage":this.setMovingAverageRange(t,e,i);break;case"Polynomial":this.setPolynomialRange(t,e,i);break;case"Power":this.setPowerRange(t,e,i);break;case"Logarithmic":this.setLogarithmicRange(t,e,i)}"Linear"!==e.type&&"MovingAverage"!==e.type&&i.chart.splineSeriesModule.findSplinePoint(i)}},e.prototype.setExponentialRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n],s=a.yValue?Math.log(a.yValue):0;r.push(a.xValue),o.push(s),n++}var l=this.findSlopeIntercept(r,o,t,e);i.points=this.getExponentialPoints(t,e,r,o,i,l)},e.prototype.setLogarithmicRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a],l=s.xValue?Math.log(s.xValue):0;n.push(s.xValue),r.push(l),o.push(s.yValue),a++}var h=this.findSlopeIntercept(r,o,t,e);i.points=this.getLogarithmicPoints(t,e,n,o,i,h)},e.prototype.setPolynomialRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n];r.push(a.xValue),o.push(a.yValue),n++}i.points=this.getPolynomialPoints(t,e,r,o,i)},e.prototype.setPowerRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a],l=s.xValue?Math.log(s.xValue):0,h=s.yValue?Math.log(s.yValue):0;n.push(s.xValue),r.push(l),o.push(h),a++}var c=this.findSlopeIntercept(r,o,t,e);i.points=this.getPowerPoints(t,e,n,o,i,c)},e.prototype.setLinearRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n];r.push(a.xValue),o.push(a.yValue),n++}var s=this.findSlopeIntercept(r,o,t,e);i.points=this.getLinearPoints(t,e,r,o,i,s)},e.prototype.setMovingAverageRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a];n.push(s.xValue),r.push(a+1),o.push(s.yValue),a++}i.points=this.getMovingAveragePoints(t,e,n,o,i)},e.prototype.getLogarithmicPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast,h=l?Math.log(l):0,c=n.intercept+n.slope*h,d=i[a-1],p=d?Math.log(d):0,u=n.intercept+n.slope*p,g=i[i.length-1]+e.forwardForecast,y=g?Math.log(g):0,m=n.intercept+n.slope*y;return s.push(this.getDataPoint(l,c,o,s.length)),s.push(this.getDataPoint(d,u,o,s.length)),s.push(this.getDataPoint(g,m,o,s.length)),s},e.prototype.getPowerPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast;l=l>-1?l:0;var h=n.intercept*Math.pow(l,n.slope),c=i[a-1],d=n.intercept*Math.pow(c,n.slope),p=i[i.length-1]+e.forwardForecast,u=n.intercept*Math.pow(p,n.slope);return s.push(this.getDataPoint(l,h,o,s.length)),s.push(this.getDataPoint(c,d,o,s.length)),s.push(this.getDataPoint(p,u,o,s.length)),s},e.prototype.getPolynomialPoints=function(e,t,i,r,o){var n=t.length<=e.polynomialOrder?t.length:e.polynomialOrder;n=Math.max(2,n),n=Math.min(6,n),e.polynomialOrder=n,e.polynomialSlopes=[],e.polynomialSlopes.length=e.polynomialOrder+1;for(var a=0;a<i.length;){for(var s=i[a],l=r[a],h=0;h<=e.polynomialOrder;)e.polynomialSlopes[h]||(e.polynomialSlopes[h]=0),e.polynomialSlopes[h]+=Math.pow(s,h)*l,++h;a++}var c=[];c.length=1+2*e.polynomialOrder;var d=[];d.length=e.polynomialOrder+1;for(var p=0;p<e.polynomialOrder+1;)d[p]=[],d[p].length=3,p++;for(var u=0;u<i.length;){for(var g=i[u],y=1,m=0;m<c.length;)c[m]||(c[m]=0),c[m]+=y,y*=g,++m;++u}for(var v=0;v<=e.polynomialOrder;){for(var f=0;f<=e.polynomialOrder;)d[v][f]=c[v+f],++f;++v}return this.gaussJordanElimination(d,e.polynomialSlopes)||(e.polynomialSlopes=null),this.getPoints(e,t,i,o)},e.prototype.getMovingAveragePoints=function(e,t,i,r,o){var n=[],a=e.period>=t.length?t.length-1:e.period;a=Math.max(2,a);for(var s,l,h,c,d=0;d<t.length-1;){s=h=c=0;for(var p=d;h<a;p++)h++,r[p]||c++,s+=r[p];(s=a-c<=0?null:s/(a-c))&&!isNaN(s)&&(l=i[a-1+d],n.push(this.getDataPoint(l,s,o,n.length))),d++}return n},e.prototype.getLinearPoints=function(e,t,i,r,o,n){var a=[],s=i.indexOf(Math.max.apply(null,i)),l=i[i.indexOf(Math.min.apply(null,i))]-e.backwardForecast,h=n.slope*l+n.intercept,c=i[s]+e.forwardForecast,d=n.slope*c+n.intercept;return a.push(this.getDataPoint(l,h,o,a.length)),a.push(this.getDataPoint(c,d,o,a.length)),a},e.prototype.getExponentialPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast,h=n.intercept*Math.exp(n.slope*l),c=i[a-1],d=n.intercept*Math.exp(n.slope*c),p=i[i.length-1]+e.forwardForecast,u=n.intercept*Math.exp(n.slope*p);return s.push(this.getDataPoint(l,h,o,s.length)),s.push(this.getDataPoint(c,d,o,s.length)),s.push(this.getDataPoint(p,u,o,s.length)),s},e.prototype.getPoints=function(e,t,i,r){var o,n,a=e.polynomialSlopes,s=[],l=1,h=1;for(t.sort(function(e,t){return e.xValue-t.xValue}),i.sort(function(e,t){return e-t});h<=a.length;)1===h?(o=i[0]-e.backwardForecast,n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))):h===a.length?(o=i[t.length-1]+e.forwardForecast,n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))):(l+=(t.length+e.forwardForecast)/a.length,o=i[parseInt(l.toString(),10)-1],n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))),h++;return s},e.prototype.getPolynomialYValue=function(e,t){for(var i=0,r=0;r<e.length;)i+=e[r]*Math.pow(t,r),r++;return i},e.prototype.gaussJordanElimination=function(e,t){var i=e.length,r=[],o=[],n=[];r.length=i,o.length=i,n.length=i;for(var a=0;a<i;)n[a]=0,++a;for(var s=0;s<i;){for(var l=0,h=0,c=0,d=0;d<i;){if(1!==n[d])for(f=0;f<i;)0===n[f]&&Math.abs(e[d][f])>=l&&(l=Math.abs(e[d][f]),h=d,c=f),++f;++d}if(++n[c],h!==c){for(var p=0;p<i;){v=e[h][p];e[h][p]=e[c][p],e[c][p]=v,++p}var u=t[h];t[h]=t[c],t[c]=u}if(o[s]=h,r[s]=c,0===e[c][c])return!1;var g=1/e[c][c];e[c][c]=1;for(var y=0;y<i;)e[c][y]*=g,++y;t[c]*=g;for(var m=0;m<i;){if(m!==c){var v=e[m][c];e[m][c]=0;for(var f=0;f<i;)e[m][f]-=e[c][f]*v,++f;t[m]-=t[c]*v}++m}++s}for(var b=i-1;b>=0;){if(o[b]!==r[b])for(var x=0;x<i;){var w=e[x][o[b]];e[x][o[b]]=e[x][r[b]],e[x][r[b]]=w,++x}--b}return!0},e.prototype.getTrendLineElements=function(e,t){Y(e);var i=e.clipRect,r=t.renderer.drawClipPath(new Di(t.element.id+"_ChartTrendlineClipRect_"+e.index,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:i.width,height:i.height})),o=t.renderer.createGroup({id:t.element.id+"TrendlineSeriesGroup"+e.index,transform:"translate("+i.x+","+i.y+")","clip-path":"url(#"+t.element.id+"_ChartTrendlineClipRect_"+e.index+")"});o&&o.appendChild(r);for(var n=0,a=e.trendlines;n<a.length;n++){var s=a[n];this.createTrendLineElements(t,s,s.index,o,r)}},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"TrendLine"},e}(),dn=function(){function e(e){this.arrowLocation=new Vi(0,0),this.rx=2,this.ry=2,this.chart=e,this.elementID=this.chart.element.id,this.svgRenderer=new i.SvgRenderer(this.chart.element.id),this.addEventListener()}return e.prototype.addEventListener=function(){if(!this.chart.isDestroyed){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this)}},e.prototype.mouseUpHandler=function(){this.chart.startMove&&this.removeCrosshair(2e3)},e.prototype.mouseLeaveHandler=function(){this.removeCrosshair(1e3)},e.prototype.mouseMoveHandler=function(e){var i=this.chart;"touchmove"===e.type&&(t.Browser.isIos||t.Browser.isIos7)&&i.startMove&&e.preventDefault&&e.preventDefault(),i.disableTrackTooltip||(j(i.mouseX,i.mouseY,i.chartAxisLayoutPanel.seriesClipRect)?!i.startMove&&i.isTouch||this.crosshair():this.removeCrosshair(1e3))},e.prototype.longPress=function(){var e=this.chart;return j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&this.crosshair(),!1},e.prototype.crosshair=function(){var e,r,o=this.chart,n="",a="",s=document.getElementById(this.elementID+"_crosshair_axis"),l=o.crosshair,h=document.getElementById(this.elementID+"_tooltip"),c=o.chartAxisLayoutPanel.seriesClipRect,d=o.enableCanvas?document.getElementById(this.elementID+"_Secondary_Element"):document.getElementById(this.elementID+"_UserInteraction"),p=document.getElementById(this.elementID+"_Crosshair");if(o.enableCanvas&&(p||(p=t.createElement("div",{id:this.elementID+"_Crosshair",styles:"position: absolute; pointer-events: none"}),d.appendChild(p))),this.stopAnimation(),o.tooltip.enable&&!j(o.tooltipModule.valueX,o.tooltipModule.valueY,c))return null;if(o.stockChart&&o.stockChart.onPanning)return this.removeCrosshair(1e3),null;if(this.valueX=o.tooltip.enable?o.tooltipModule.valueX:o.mouseX,this.valueY=o.tooltip.enable?o.tooltipModule.valueY:o.mouseY,o.enableCanvas||d.setAttribute("opacity","1"),"Both"!==l.lineType&&"Horizontal"!==l.lineType||(n+="M "+c.x+" "+this.valueY+" L "+(c.x+c.width)+" "+this.valueY),"Both"!==l.lineType&&"Vertical"!==l.lineType||(a+="M "+this.valueX+" "+c.y+" L "+this.valueX+" "+(c.y+c.height)),o.enableCanvas){s||(s=this.svgRenderer.createGroup({id:this.elementID+"_crosshair_axis"}));var u=o.tooltip.enable?o.element.id+"_tooltip_svg":o.element.id+"_svg";r=this.svgRenderer.createSvg({id:u,width:o.availableSize.width,height:o.availableSize.height}),o.tooltip.enable&&((h=h||o.tooltipModule.createElement()).appendChild(r),d.appendChild(h)),e=new i.PathOption(this.elementID+"_HorizontalLine","none",l.line.width,l.line.color||o.themeStyle.crosshairLine,1,l.dashArray,n),this.drawCrosshairLine(e,p,c.x,this.valueY,c.width,0,n),e.d=a,e.id=this.elementID+"_VerticalLine",this.drawCrosshairLine(e,p,this.valueX,c.y,0,c.height,a),this.renderAxisTooltip(o,c,s),r.appendChild(s),o.tooltip.enable||p.appendChild(r)}else 0===d.childNodes.length?(s=o.renderer.createGroup({id:this.elementID+"_crosshair_axis"}),e=new i.PathOption(this.elementID+"_HorizontalLine","none",l.line.width,l.line.color||o.themeStyle.crosshairLine,1,l.dashArray,n),this.renderCrosshairLine(e,d),e.d=a,e.id=this.elementID+"_VerticalLine",this.renderCrosshairLine(e,d),d.appendChild(s),this.renderAxisTooltip(o,c,d.lastChild)):(document.getElementById(this.elementID+"_HorizontalLine").setAttribute("d",n),document.getElementById(this.elementID+"_VerticalLine").setAttribute("d",a),this.renderAxisTooltip(o,c,d.lastChild))},e.prototype.renderCrosshairLine=function(e,t){var i=this.chart.renderer.drawPath(e);t.appendChild(i)},e.prototype.drawCrosshairLine=function(e,i,r,o,n,a,s){if(!document.getElementById(e.id)&&s){var l=t.createElement("div",{id:e.id});i.appendChild(l)}if(document.getElementById(e.id)){var h="top:"+o.toString()+"px;left:"+r.toString()+"px;width:"+n+"px;height:"+a+"px;fill:"+e.stroke+";border: 0.5px solid black;position: absolute",c=document.getElementById(e.id),d=document.getElementById(this.elementID+"_crosshair_axis");c.setAttribute("style",h),i.style.opacity="1",d&&(d.style.opacity="1")}},e.prototype.renderAxisTooltip=function(e,t,r){for(var o,n,a,s,l,h,c,d,p=0,u=e.axisCollections.length;p<u;p++)if(o=e.axisCollections[p],d=o.placeNextToAxisLine?o.updatedRect:o.rect,o.crosshairTooltip.enable)if(this.valueX<=d.x+d.width&&d.x<=this.valueX||this.valueY<=d.y+d.height&&d.y<=this.valueY){if(s=document.getElementById(this.elementID+"_axis_tooltip_"+p),l=document.getElementById(this.elementID+"_axis_tooltip_text_"+p),!(n=this.getAxisText(o)))continue;a=this.tooltipLocation(n,o,t,d),null===s&&(s=e.enableCanvas?this.svgRenderer.drawPath({id:this.elementID+"_axis_tooltip_"+p,fill:o.crosshairTooltip.fill||e.themeStyle.crosshairFill}):e.renderer.drawPath({id:this.elementID+"_axis_tooltip_"+p,fill:o.crosshairTooltip.fill||e.themeStyle.crosshairFill},null),r.appendChild(s),h=new i.TextOption(this.elementID+"_axis_tooltip_text_"+p,0,0,"start",n),l=Ve(e.enableCanvas?this.svgRenderer:e.renderer,h,o.crosshairTooltip.textStyle,o.crosshairTooltip.textStyle.color||e.themeStyle.crosshairLabel,r,null,null,null,null,null,null,null,null,e.enableCanvas)),c=i.findDirection(this.rx,this.ry,a,this.arrowLocation,10,this.isTop,this.isBottom,this.isLeft,this.valueX,this.valueY),s.setAttribute("d",c),l.textContent=n,l.setAttribute("x",(a.x+5).toString()),l.setAttribute("y",(a.y+5+3*this.elementSize.height/4).toString())}else m(this.elementID+"_axis_tooltip_"+p),m(this.elementID+"_axis_tooltip_text_"+p)},e.prototype.getAxisText=function(e){var t;this.isBottom=!1,this.isTop=!1,this.isLeft=!1,this.isRight=!1;var i="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0;return"Horizontal"===e.orientation?(t=H(Math.abs(this.valueX-e.rect.x),e.rect.width,e)+i,this.isBottom=!e.opposedPosition,this.isTop=e.opposedPosition):(t=X(Math.abs(this.valueY-e.rect.y),e.rect.height,e)+i,this.isRight=e.opposedPosition,this.isLeft=!e.opposedPosition),"DateTime"===e.valueType?e.format(new Date(t)):"Category"===e.valueType?e.labels[Math.floor(t)]:"DateTimeCategory"===e.valueType?this.chart.dateTimeCategoryModule.getIndexedAxisLabel(e.labels[Math.floor(t)],e.format):"Logarithmic"===e.valueType?t=e.format(Math.pow(e.logBase,t)):e.labelFormat&&null!==e.labelFormat.match("{value}")?e.labelFormat.replace("{value}",e.format(t)):e.format(t)},e.prototype.tooltipLocation=function(e,t,r,o){var n,a=r.x,s=r.y,l="Inside"===t.labelPosition,h=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0;if(this.elementSize=i.measureText(e,t.crosshairTooltip.textStyle),"Horizontal"===t.orientation){var c=l?o.y-this.elementSize.height-20:o.y+h,d=l?o.y-this.elementSize.height-10:o.y+10;this.arrowLocation=new Vi(this.valueX,c),n=new i.Rect(this.valueX-this.elementSize.width/2-5,d+(l?0:h),this.elementSize.width+10,this.elementSize.height+10),t.opposedPosition&&(n.y=l?o.y:o.y-(this.elementSize.height+10+10)-h),n.x<a&&(n.x=a),n.x+n.width>a+r.width&&(n.x-=n.x+n.width-(a+r.width)),this.arrowLocation.x+5>n.x+n.width-this.rx&&(this.arrowLocation.x=n.x+n.width-this.rx-5),this.arrowLocation.x-5<n.x+this.rx&&(this.arrowLocation.x=n.x+this.rx+5)}else{h*=t.opposedPosition?1:-1,this.arrowLocation=new Vi(o.x,this.valueY);var p=l?o.x-h:o.x-this.elementSize.width-20;n=new i.Rect(p+h,this.valueY-this.elementSize.height/2-5,this.elementSize.width+10,this.elementSize.height+10),t.opposedPosition?(n.x=l?o.x-this.elementSize.width-10:o.x+10+h,n.x+n.width>this.chart.availableSize.width&&(this.arrowLocation.x-=n.x+n.width-this.chart.availableSize.width,n.x-=n.x+n.width-this.chart.availableSize.width)):n.x<0&&(this.arrowLocation.x-=n.x,n.x=0),n.y<s&&(n.y=s),n.y+n.height>=s+r.height&&(n.y-=n.y+n.height-(s+r.height)),this.arrowLocation.y+5>n.y+n.height-this.ry&&(this.arrowLocation.y=n.y+n.height-this.ry-5),this.arrowLocation.y-5<n.y+this.ry&&(this.arrowLocation.y=n.y+this.ry+5)}return n},e.prototype.stopAnimation=function(){Ce(this.crosshairInterval)},e.prototype.progressAnimation=function(){Ce(this.crosshairInterval)},e.prototype.removeCrosshair=function(e){var i=this.chart,r=i.enableCanvas?document.getElementById(this.elementID+"_Crosshair"):document.getElementById(this.elementID+"_UserInteraction"),o=i.enableCanvas?document.getElementById(this.elementID+"_crosshair_axis"):null;this.stopAnimation(),r&&"0"!==r.getAttribute("opacity")&&(this.crosshairInterval=+setTimeout(function(){new t.Animation({}).animate(r,{duration:200,progress:function(e){r.style.animation="",i.enableCanvas?(r.style.opacity=(1-e.timeStamp/e.duration).toString(),o.style.opacity=(1-e.timeStamp/e.duration).toString()):r.setAttribute("opacity",(1-e.timeStamp/e.duration).toString())},end:function(){i.enableCanvas?(r.style.opacity="0",o.style.opacity="0"):r.setAttribute("opacity","0"),i.startMove=!1,i.tooltipModule&&(i.tooltipModule.valueX=null,i.tooltipModule.valueY=null)}})},e))},e.prototype.getModuleName=function(){return"Crosshair"},e.prototype.destroy=function(){},e}(),pn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),un=function(e){function r(t){var i=e.call(this,t)||this;return i.element=i.chart.element,i.textStyle=t.tooltip.textStyle,i.control=t,i}return pn(r,e),r.prototype.getElement=function(e){return document.getElementById(e)},r.prototype.getTooltipElement=function(e){this.inverted=this.chart.requireInvertedAxis,this.header=null===this.control.tooltip.header?this.control.tooltip.shared?"<b>${point.x}</b>":"<b>${series.name}</b>":this.control.tooltip.header,this.formattedText=[];var t=document.getElementById(this.chart.element.id+"_tooltip"),i=this.chart.element.id.indexOf("stockChart")>-1;return!e&&!t||i?this.createElement():null},r.prototype.createElement=function(){var e=document.createElement("div");return e.id=this.element.id+"_tooltip",e.className="ejSVGTooltip",e.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),e},r.prototype.pushData=function(e,t,i,r){return!!e.series.enableTooltip&&(this.currentPoints.push(e),this.stopAnimation(),i&&!document.getElementById(i.id)&&(this.chart.stockChart?document.getElementById(this.chart.stockChart.element.id+"_Secondary_Element").appendChild(i):document.getElementById(this.element.id+"_Secondary_Element").appendChild(i)),!0)},r.prototype.removeHighlight=function(){for(var e,t=0,i=this.previousPoints.length;t<i;t++)(e=this.previousPoints[t]).series.isRectSeries?e.series.visible&&this.highlightPoint(e.series,e.point.index,!1):e.series.marker.visible||"Scatter"===e.series.type||"Bubble"===e.series.type||(this.previousPoints.shift(),i-=1)},r.prototype.highlightPoint=function(e,t,i){var r=this.getElement(this.element.id+"_Series_"+e.index+"_Point_"+t),o=this.control.accumulationSelectionModule,n=!!(o&&o.selectedDataIndexes.length>0);r&&(!n||n&&r.getAttribute("class")&&-1===r.getAttribute("class").indexOf("_ej2_chart_selection_series_")?r.setAttribute("opacity",(i?e.opacity/2:e.opacity).toString()):r.setAttribute("opacity",e.opacity.toString()))},r.prototype.highlightPoints=function(){for(var e=0,t=this.currentPoints;e<t.length;e++){var i=t[e];i.series.isRectSeries&&"Series"===i.series.category&&this.highlightPoint(i.series,i.point.index,!0)}},r.prototype.createTooltip=function(e,t,r,o,n,a,s,l,h,c,d){void 0===h&&(h=null),void 0===c&&(c=null);var p=this.currentPoints[0].series,u=e.tooltipModule||e.accumulationTooltipModule;if(u){var g=p.isRectSeries&&"Waterfall"!==p.type&&n&&n.y<0,y=this.chart.requireInvertedAxis&&p.isRectSeries,m=null;if(this.text.length<=1){var v=void 0,f=void 0;if(e.tooltip.template&&"chart"===e.getModuleName()&&"#"!==e.tooltip.template[0]&&"string"==typeof e.tooltip.template){var b=document.createElement("div");b.id="testing_template",b.className="ejSVGTooltip",b.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),document.getElementById(this.chart.element.id+"_Secondary_Element").appendChild(b);var x=e.tooltip.template.replaceAll("${x}",n.x).replaceAll("${y}",n.y);b.innerHTML=x,v=new i.Size(b.firstElementChild.offsetWidth,b.firstElementChild.offsetHeight),f=new i.Size(0,0),b.remove()}else v=i.measureText(this.text[0],e.tooltip.textStyle),f=""!==this.header&&"<b></b>"!==this.header?i.measureText(this.header,this.textStyle):new i.Size(0,0);v.width=Math.max(v.width,f.width)+(a.length>0?47:0);var w=32+(f.height>0?20:0);v.height=v.height+f.height+w,m=this.getCurrentPosition(g,y),g="Left"===(m=this.getPositionBySize(v,new i.Rect(0,0,l.width,l.height),r,m))||"Bottom"===m,y="Left"===m||"Right"===m}t?this.svgTooltip=new i.Tooltip({opacity:e.tooltip.opacity,header:this.headerText,content:this.text,fill:e.tooltip.fill,border:e.tooltip.border,enableAnimation:e.tooltip.enableAnimation,location:r,shared:e.tooltip.shared,shapes:a,clipBounds:"PolarRadar"===this.chart.chartAreaType?new Vi(0,0):o,areaBounds:l,palette:this.findPalette(),template:d||e.tooltip.template,data:c,theme:e.theme,offset:s,textStyle:e.tooltip.textStyle,isNegative:g,inverted:y,arrowPadding:this.text.length>1||this.chart.stockChart?0:12,availableSize:e.availableSize,duration:this.chart.tooltip.duration,isCanvas:this.chart.enableCanvas,isTextWrap:e.tooltip.enableTextWrap&&"chart"===e.getModuleName(),blazorTemplate:{name:"Template",parent:this.chart.tooltip},controlInstance:this.chart,tooltipPlacement:m,tooltipRender:function(){u.removeHighlight(),u.highlightPoints(),u.updatePreviousPoint(h)},animationComplete:function(e){e.tooltip.fadeOuted&&u.fadeOut(u.previousPoints)}},"#"+this.element.id+"_tooltip"):this.svgTooltip&&(this.svgTooltip.location=r,this.svgTooltip.content=this.text,this.svgTooltip.header=this.headerText,this.svgTooltip.offset=s,this.svgTooltip.palette=this.findPalette(),this.svgTooltip.shapes=a,this.svgTooltip.data=c,this.svgTooltip.template=e.tooltip.template,this.svgTooltip.textStyle=e.tooltip.textStyle,this.svgTooltip.isNegative=g,this.svgTooltip.inverted=y,this.svgTooltip.clipBounds="PolarRadar"===this.chart.chartAreaType?new Vi(0,0):o,this.svgTooltip.arrowPadding=this.text.length>1||this.chart.stockChart?0:12,this.svgTooltip.tooltipPlacement=m,this.svgTooltip.dataBind()),this.chart.isReact&&this.chart.renderReactTemplates()}},r.prototype.getPositionBySize=function(e,t,r,o){var n=this.isTooltipFitPosition("Top",new i.Rect(0,0,t.width,t.height),r,e),a=this.isTooltipFitPosition("Bottom",new i.Rect(0,0,t.width,t.height),r,e),s=this.isTooltipFitPosition("Right",new i.Rect(0,0,t.width,t.height),r,e),l=this.isTooltipFitPosition("Left",new i.Rect(0,0,t.width,t.height),r,e);if(!(n||a||s||l)){var h=[r.x-t.x,t.x+t.width-r.x,r.y-t.y,t.y+t.height-r.y],c=h.indexOf(Math.max.apply(this,h));return o=0===c?"Left":1===c?"Right":2===c?"Top":"Bottom"}return"Top"===o?n?"Top":a?"Bottom":s?"Right":"Left":"Bottom"===o?a?"Bottom":n?"Top":s?"Right":"Left":"Right"===o?s?"Right":l?"Left":n?"Top":"Bottom":l?"Left":s?"Right":n?"Top":"Bottom"},r.prototype.isTooltipFitPosition=function(e,t,i,r){var o=new Vi(0,0),n=new Vi(0,0);switch(e){case"Top":o.x=i.x-r.width/2,o.y=i.y-r.height,n.x=i.x+r.width/2,n.y=i.y;break;case"Bottom":o.x=i.x-r.width/2,o.y=i.y,n.x=i.x+r.width/2,n.y=i.y+r.height;break;case"Right":o.x=i.x,o.y=i.y-r.height/2,n.x=i.x+r.width,n.y=i.y+r.height/2;break;case"Left":o.x=i.x-r.width,o.y=i.y-r.height/2,n.x=i.x,n.y=i.y+r.height/2}return j(o.x,o.y,t)&&j(n.x,n.y,t)},r.prototype.getCurrentPosition=function(e,t){return t?e?"Left":"Right":e?"Bottom":"Top"},r.prototype.findPalette=function(){for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var r=i[t];e.push(this.findColor(r,r.series))}return e},r.prototype.findColor=function(e,t){return!t.isRectSeries||"Candle"!==t.type&&"Hilo"!==t.type&&"HiloOpenClose"!==t.type?(e.point.color&&"#ffffff"!==e.point.color?e.point.color:e.point.interior)||t.marker.fill||t.interior:e.point.color},r.prototype.updatePreviousPoint=function(e){e&&(this.currentPoints=this.currentPoints.concat(e)),this.previousPoints=t.extend([],this.currentPoints,null,!0)},r.prototype.fadeOut=function(e){var t=this.chart.enableCanvas?this.getElement(this.element.id+"_tooltip_group"):this.getElement(this.element.id+"_tooltip_svg");t&&parseInt(t.getAttribute("opacity"),10)>0||(this.valueX=null,this.valueY=null,this.currentPoints=[],this.removeHighlight(),this.removeHighlightedMarker(e),this.svgTooltip=null,this.control.trigger("animationComplete",{}))},r.prototype.removeHighlightedMarker=function(e){if(this.chart.markerRender){for(var t=0,i=e;t<i.length;t++){var r=i[t];m(this.element.id+"_Series_"+r.series.index+"_Point_"+r.point.index+"_Trackball")}this.chart.markerRender.removeHighlightedMarker()}this.previousPoints=[]},r.prototype.removeText=function(){this.textElements=[];var e=this.getElement(this.element.id+"_tooltip_group");if(e&&e.childNodes.length>0)for(;e.lastChild&&1!==e.childNodes.length;)e.removeChild(e.lastChild)},r.prototype.stopAnimation=function(){Ce(this.toolTipInterval)},r.prototype.removeTooltip=function(e){var t=this,i=this.getElement(this.element.id+"_tooltip"),r=i?this.getElement(i.id+"parent_template"):null,o=r&&"<div></div>"!==r.innerHTML;this.stopAnimation(),this.chart.isReact&&o&&this.chart.clearTemplate([r.id],[0]),i&&this.previousPoints.length>0&&(this.toolTipInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))},r}(Zi),gn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yn=function(e){function r(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return gn(r,e),r.prototype.addEventListener=function(){if(!this.chart.isDestroyed){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this)}},r.prototype.mouseUpHandler=function(){var e=this.control;e.isTouch&&!this.isSelected(e)&&(j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&e.tooltip.shared||!e.tooltip.shared)&&(e.crosshair.enable?e.startMove&&this.removeTooltip(2e3):(this.tooltip(),this.removeTooltip(2e3)))},r.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.chart.tooltip.fadeOutDuration)},r.prototype.mouseMoveHandler=function(){var e=this.chart;e.disableTrackTooltip||this.isSelected(e)||(e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip(),j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)?!e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip():e.tooltip.shared&&this.removeTooltip(this.chart.tooltip.fadeOutDuration))},r.prototype.longPress=function(){var e=this.chart;return e.crosshair.enable&&j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&this.tooltip(),!1},r.prototype.tooltip=function(){if(this.chart.stockChart&&this.chart.stockChart.onPanning)return this.removeTooltip(1e3),null;var e=this.chart.enableCanvas?this.element.id+"_tooltip_group":this.element.id+"_tooltip_svg",t=this.getElement(e),i=this.chart.stockChart&&t&&t.firstChild.childNodes.length>1,r=t&&parseInt(t.getAttribute("opacity"),10)>0&&!i,o=this.getTooltipElement(r);this.chart.enableCanvas&&o&&(document.getElementById(this.chart.element.id+"_Secondary_Element").appendChild(o),o.appendChild(document.getElementById(this.chart.element.id+"_tooltip_svg"))),this.chart.tooltip.shared?this.renderGroupedTooltip(this.chart,!r,o):this.renderSeriesTooltip(this.chart,!r,o)},r.prototype.findHeader=function(e){return""===this.header?"":(this.header=this.parseTemplate(e.point,e.series,this.header,e.series.xAxis,e.series.yAxis),""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()?this.header:"")},r.prototype.findShapes=function(){if(!this.chart.tooltip.enableMarker)return[];for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var r=i[t];e.push(r.point.marker.shape||r.series.marker.shape)}return e},r.prototype.renderSeriesTooltip=function(e,t,i){var r=this.getData();if(r.lierIndex=this.lierIndex,this.currentPoints=[],this.findData(r,this.previousPoints[0])){if((!e.dataEditingModule||!e.dataEditingModule.isPointDragging)&&this.previousPoints[0]&&r.point.index===this.previousPoints[0].point.index&&r.series.index===this.previousPoints[0].series.index)return null;this.pushData(r,t,i,!0)&&this.triggerTooltipRender(r,t,this.getTooltipText(r),this.findHeader(r))}else if(!r.point&&this.isRemove)this.removeTooltip(this.chart.tooltip.fadeOutDuration),this.isRemove=!1;else for(var o=this.mergeXvalues(this.chart.visibleSeries),n=0,a=e.visibleSeries;n<a.length;n++){var s=a[n];s.visible&&"TrendLine"!==s.category&&(r=this.getClosestX(e,s,o)||r)}r&&r.point&&this.findMouseValue(r,e)},r.prototype.triggerTooltipRender=function(e,i,r,o){var n=this,a={cancel:!1,name:"tooltipRender",text:r,headerText:o,template:void 0,series:this.chart.isBlazor?{}:e.series,textStyle:this.textStyle,point:e.point,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,seriesName:e.series.name,pointIndex:e.point.index,pointText:e.point.text}},s=function(r){r.cancel?(n.removeHighlight(),t.remove(n.getElement(n.element.id+"_tooltip"))):("BoxAndWhisker"===e.series.type&&(n.removeText(),i=!0),n.headerText=r.headerText,n.formattedText=n.formattedText.concat(r.text),n.text=n.formattedText,n.createTooltip(n.chart,i,n.getSymbolLocation(e),e.series.clipRect,e.point,n.findShapes(),n.findMarkerHeight(n.currentPoints[0]),n.chart.chartAxisLayoutPanel.seriesClipRect,null,n.getTemplateText(e),n.chart.tooltip.template?r.template:"")),n.isRemove=!0};s.bind(this,e),this.chart.trigger("tooltipRender",a,s)},r.prototype.findMarkerHeight=function(e){if(!this.chart.tooltip.enableMarker)return 0;var t=e.series;return(t.marker.visible||this.chart.tooltip.shared&&(!t.isRectSeries||t.marker.visible)||"Scatter"===t.type||"Scatter"===t.drawType)&&"Candle"!==t.type&&"Hilo"!==t.type&&"HiloOpenClose"!==t.type?(t.marker.height+2)/2+2*t.marker.border.width:0},r.prototype.findData=function(e,t){return e.point&&(!t||t.point!==e.point||t&&t.lierIndex>3&&t.lierIndex!==this.lierIndex||t.point===e.point)},r.prototype.getSymbolLocation=function(e){var t;if("BoxAndWhisker"!==e.series.type){if(!e.point.symbolLocations[0])return null;t=new Vi(e.point.symbolLocations[0].x,e.point.symbolLocations[0].y)}switch(e.series.type){case"BoxAndWhisker":return this.getBoxLocation(e);case"Waterfall":return this.getWaterfallRegion(e,t);case"RangeArea":case"SplineRangeArea":return this.getRangeArea(e,t);default:return t}},r.prototype.getRangeArea=function(e,t){return e.point.regions[0]&&(this.inverted?t.x=e.point.regions[0].x+e.point.regions[0].width/2:t.y=e.point.regions[0].y+e.point.regions[0].height/2),t},r.prototype.getWaterfallRegion=function(e,t){return this.inverted?t.x=e.point.y<0?t.x+e.point.regions[0].width:t.x:t.y=e.point.y<0?t.y-e.point.regions[0].height:t.y,t},r.prototype.getTooltipText=function(e){var t=e.series;return this.parseTemplate(e.point,t,this.getFormat(this.chart,t),t.xAxis,t.yAxis)},r.prototype.getTemplateText=function(e){if(this.chart.tooltip.template){var i=t.extend({},e.point);return i.x=this.formatPointValue(e.point,e.series.xAxis,"x",!0,!1),"XY"===e.series.seriesType?i.y=this.formatPointValue(e.point,e.series.yAxis,"y",!1,!0):(i.low=this.formatPointValue(e.point,e.series.yAxis,"low",!1,!0),i.high=this.formatPointValue(e.point,e.series.yAxis,"high",!1,!0)),i}return e.point},r.prototype.findMouseValue=function(e,t){t.requireInvertedAxis?(this.valueY=(1-I(e.point.xValue,e.series.xAxis))*e.series.xAxis.rect.height+e.series.xAxis.rect.y,this.valueX=t.mouseX):("PolarRadar"===t.chartAreaType?this.valueX=F(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x:this.valueX="TrendLine"===e.series.category&&t.tooltip.shared?this.valueX:I(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x,this.valueY=t.mouseY)},r.prototype.renderGroupedTooltip=function(e,t,r){var o,n,a="PolarRadar"===e.chartAreaType?this.getData():null;this.stopAnimation(),this.removeHighlight(),this.currentPoints=[];var s=[];t&&(e.stockChart?r&&!i.getElement(r.id)&&document.getElementById(e.stockChart.element.id+"_Secondary_Element").appendChild(r):r&&document.getElementById(this.element.id+"_Secondary_Element").appendChild(r)),this.removeText();for(var l={text:[],cancel:!1,name:"sharedTooltipRender",data:[],headerText:"",textStyle:this.textStyle},h=this.mergeXvalues(this.chart.visibleSeries),c=0,d=e.visibleSeries;c<d.length;c++){var p=d[c];p.enableTooltip&&p.visible&&("Cartesian"===e.chartAreaType&&p.visible?o=this.getClosestX(e,p,h):"PolarRadar"===e.chartAreaType&&p.visible&&null!==a.point&&(o=new Yi(p.points[a.point.index],p)),o&&(e.isBlazor?(l.data.push({pointX:o.point.x,pointY:o.point.y,seriesIndex:o.series.index,seriesName:o.series.name,pointIndex:o.point.index,pointText:o.point.text}),l.headerText=this.findHeader(o),this.currentPoints.push(o),l.text.push(this.getTooltipText(o)),n="TrendLine"===o.series.category&&e.tooltip.shared?n:o):this.triggerSharedTooltip(o,t,this.getTooltipText(o),this.findHeader(o),s)))}e.isBlazor&&o&&this.triggerBlazorSharedTooltip(l,n,s,e,t),this.currentPoints.length>0?this.createTooltip(e,t,this.findSharedLocation(),1===this.currentPoints.length?this.currentPoints[0].series.clipRect:null,null,this.findShapes(),this.findMarkerHeight(this.currentPoints[0]),e.chartAxisLayoutPanel.seriesClipRect,s,this.chart.tooltip.template?this.getTemplateText(o):null,this.chart.tooltip.template?l.template:""):this.getElement(this.element.id+"_tooltip_path")&&this.getElement(this.element.id+"_tooltip_path").setAttribute("d","")},r.prototype.triggerBlazorSharedTooltip=function(e,t,i,r,o){var n=this,a={cancel:!1,name:"sharedTooltipRender",text:e.text,headerText:e.headerText,textStyle:e.textStyle,data:e.data},s=function(e){e.cancel?i.push(t):(n.text=e.text,n.headerText=e.headerText,n.findMouseValue(t,n.chart),t=null,n.createTooltip(r,o,n.findSharedLocation(),null,null,n.findShapes(),n.findMarkerHeight(n.currentPoints[0]),r.chartAxisLayoutPanel.seriesClipRect,i))};s.bind(this,t,i),this.chart.trigger("sharedTooltipRender",a,s)},r.prototype.triggerSharedTooltip=function(e,t,i,r,o){var n=this,a={cancel:!1,name:"tooltipRender",text:i,headerText:r,point:e.point,series:this.chart.isBlazor?{}:e.series,textStyle:this.textStyle,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,seriesName:e.series.name,pointIndex:e.point.index,pointText:e.point.text}},s=function(i){i.cancel?o.push(e):("BoxAndWhisker"===e.series.type&&(n.removeText(),t=!0),n.formattedText=n.formattedText.concat(i.text),n.text=n.formattedText,n.headerText=i.headerText,n.findMouseValue(e,n.chart),n.currentPoints.push(e),e=null)};s.bind(this,e,o),this.chart.trigger("tooltipRender",a,s),a.template&&(this.chart.tooltip.template=a.template)},r.prototype.findSharedLocation=function(){var e=this.chart.stockChart;if(e){1===this.text.length&&this.text.push("");var t=e.enablePeriodSelector?e.toolbarHeight:0,i=document.getElementById(e.element.id+"_ChartTitle"),r=""!==e.title?i.getBoundingClientRect().height+10:0;return new Vi(this.chart.chartAxisLayoutPanel.seriesClipRect.x+5,this.chart.chartAxisLayoutPanel.seriesClipRect.y+t+5+r)}return this.currentPoints.length>1?new Vi(this.valueX,this.valueY):this.getSymbolLocation(this.currentPoints[0])},r.prototype.getBoxLocation=function(e){return this.lierIndex>3?e.point.symbolLocations[this.lierIndex-4]:{x:e.point.regions[0].x+e.point.regions[0].width/2,y:e.point.regions[0].y+e.point.regions[0].height/2}},r.prototype.parseTemplate=function(e,t,i,r,o){for(var n,a,s=0,l=Object.keys(e);s<l.length;s++){d=l[s];n=new RegExp("${point."+d+"}","gm"),i=i.replace(n.source,this.formatPointValue(e,"${point.x}"===n.source?r:o,d,"${point.x}"===n.source,"${point.high}"===n.source||"${point.open}"===n.source||"${point.close}"===n.source||"${point.low}"===n.source||"${point.y}"===n.source||"${point.minimum}"===n.source||"${point.maximum}"===n.source||"${point.outliers}"===n.source||"${point.upperQuartile}"===n.source||"${point.lowerQuartile}"===n.source||"${point.median}"===n.source))}for(var h=0,c=Object.keys(Object.getPrototypeOf(t));h<c.length;h++){var d=c[h];n=new RegExp("${series."+d+"}","gm"),a=t[d],i=i.replace(n.source,a)}return i},r.prototype.formatPointValue=function(e,i,r,o,n){var a,s,l;return"Category"!==i.valueType&&o?a=(s=i.labelFormat&&null!==i.labelFormat.match("{value}"))?i.labelFormat.replace("{value}",i.format(e[r])):i.format(e[r]):n&&!t.isNullOrUndefined(e[r])?(s=i.labelFormat&&null!==i.labelFormat.match("{value}"),l="outliers"===r?i.format(e[r][this.lierIndex-4]):i.format(e[r]),a=s?i.labelFormat.replace("{value}",l):l):a=e[r],a},r.prototype.getFormat=function(e,t){if(t.tooltipFormat)return"XY"===t.seriesType&&"Indicator"===t.category?this.getIndicatorTooltipFormat(t,e,e.tooltip.format):t.tooltipFormat;if(!t.tooltipFormat&&e.tooltip.format)return"XY"===t.seriesType&&"Indicator"===t.category?this.getIndicatorTooltipFormat(t,e,e.tooltip.format):e.tooltip.format;var i="Histogram"===t.type?"${point.minimum}-${point.maximum}":"${point.x}",r=e.tooltip.shared?"${series.name}":i;switch(t.seriesType){case"XY":return"Indicator"===t.category&&this.getIndicatorTooltipFormat(t,e,e.tooltip.format),r+" : "+("Bubble"===t.type?"<b>${point.y}</b> Size : <b>${point.size}</b>":"<b>${point.y}</b>");case"HighLow":return r+"<br/>High : <b>${point.high}</b><br/>Low : <b>${point.low}</b>";case"HighLowOpenClose":return r+"<br/>High : <b>${point.high}</b><br/>Low : <b>${point.low}</b><br/>Open : <b>${point.open}</b><br/>Close : <b>${point.close}</b>";case"BoxPlot":return r+"<br/>"+(this.lierIndex>3?"Outliers : <b>${point.outliers}</b>":"Maximum : <b>${point.maximum}</b><br/>Q3 : <b>${point.upperQuartile}</b><br/>Median : <b>${point.median}</b><br/>Q1 : <b>${point.lowerQuartile}</b><br/>Minimum : <b>${point.minimum}</b>");default:return""}},r.prototype.getIndicatorTooltipFormat=function(e,t,i){return"XY"===e.seriesType?e.name+" : <b>${point.y}</b>":i},r.prototype.removeHighlightedMarker=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];m(this.element.id+"_Series_"+r.series.index+"_Point_"+r.point.index+"_Trackball")}this.chart.markerRender&&this.chart.markerRender.removeHighlightedMarker(),this.previousPoints=[]},r.prototype.getModuleName=function(){return"Tooltip"},r.prototype.destroy=function(){},r}(un),mn=function(){function e(e){this.iconRectOverFill="transparent",this.iconRectSelectionFill="transparent",this.zoomCompleteEvtCollection=[],this.chart=e,this.elementId=e.element.id,this.chart.svgRenderer=new i.SvgRenderer(this.elementId),this.selectionColor="Bootstrap4"===e.theme?"#FFFFFF":"Tailwind"===e.theme?"#374151":"TailwindDark"===e.theme?"#F3F4F6":"#ff4081",this.fillColor="Bootstrap4"===e.theme?"#495057":"Tailwind"===e.theme?"#6B7280":"TailwindDark"===e.theme?"#D1D5DB":"#737373",this.iconRectOverFill="Bootstrap4"===e.theme?"#5A6268":this.iconRectOverFill,this.iconRectSelectionFill="Bootstrap4"===e.theme?"#5B6269":this.iconRectSelectionFill,this.iconRect="Bootstrap4"===e.theme?new i.Rect(-5,-5,26,26):new i.Rect(0,0,16,16)}return e.prototype.createPanButton=function(e,t){var r=this.chart.svgRenderer,o=this.chart.zoomModule.isPanning?this.selectionColor:this.fillColor,n="M5,3h2.3L7.275,5.875h1.4L8.65,3H11L8,0L5,3z M3,11V8.7l2.875,0.025v-1.4L3,7.35V5L0,8L3,";n+="11z M11,13H8.7l0.025-2.875h-1.4L7.35,13H5l3,3L11,13z M13,5v2.3l-2.875-0.025v1.4L13,8.65V11l3-3L13,5z",e.id=this.elementId+"_Zooming_Pan",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Pan")),this.panElements=e,e.appendChild(r.drawRectangle(new Di(this.elementId+"_Zooming_Pan_1","transparent",{},1,this.iconRect))),e.appendChild(r.drawPath(new i.PathOption(this.elementId+"_Zooming_Pan_2",o,null,null,1,null,n))),t.appendChild(e),this.wireEvents(e,this.pan)},e.prototype.createZoomButton=function(e,t){var r=this.chart.svgRenderer,o=this.chart.zoomModule.isPanning?this.fillColor:this.selectionColor,n=this.chart.zoomModule.isPanning?"transparent":this.iconRectSelectionFill,a="M0.001,14.629L1.372,16l4.571-4.571v-0.685l0.228-0.274c1.051,0.868,2.423,1.417,3.885,1.417c3.291,0,";a+="5.943-2.651,5.943-5.943S13.395,0,10.103,0S4.16,2.651,4.16,5.943c0,1.508,0.503,2.834,1.417,3.885l-0.274,0.228H4.571",a+="L0.001,14.629L0.001,14.629z M5.943,5.943c0-2.285,1.828-4.114,4.114-4.114s4.114,1.828,4.114,",e.id=this.elementId+"_Zooming_Zoom",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Zoom")),this.zoomElements=e,this.selectedID=this.chart.zoomModule.isPanning?this.chart.element.id+"_Zooming_Pan_1":this.elementId+"_Zooming_Zoom_1",e.appendChild(r.drawRectangle(new Di(this.elementId+"_Zooming_Zoom_1",n,{},1,this.iconRect))),e.appendChild(r.drawPath(new i.PathOption(this.elementId+"_Zooming_Zoom_3",o,null,null,1,null,a+"4.114s-1.828,4.114-4.114,4.114S5.943,8.229,5.943,5.943z"))),t.appendChild(e),this.wireEvents(e,this.zoom)},e.prototype.createZoomInButton=function(e,t,r){var o=this.chart.svgRenderer,n=this.fillColor,a="M10.103,0C6.812,0,4.16,2.651,4.16,5.943c0,1.509,0.503,2.834,1.417,3.885l-0.274,0.229H4.571L0,";a+="14.628l0,0L1.372,16l4.571-4.572v-0.685l0.228-0.275c1.052,0.868,2.423,1.417,3.885,1.417c3.291,0,5.943-2.651,",a+="5.943-5.943C16,2.651,13.395,0,10.103,0z M10.058,10.058c-2.286,0-4.114-1.828-4.114-4.114c0-2.286,1.828-4.114,",e.id=this.elementId+"_Zooming_ZoomIn",e.setAttribute("aria-label",this.chart.getLocalizedLabel("ZoomIn"));e.appendChild(o.drawRectangle(new Di(this.elementId+"_Zooming_ZoomIn_1","transparent",{},1,this.iconRect))),e.appendChild(o.drawPath(new i.PathOption(this.elementId+"_Zooming_ZoomIn_2",n,null,null,1,null,a+"4.114-4.114c2.286,0,4.114,1.828,4.114,4.114C14.172,8.229,12.344,10.058,10.058,10.058z"))),e.appendChild(o.drawPolygon(new Ni(this.elementId+"_Zooming_ZoomIn_3","12.749,5.466 10.749,5.466 10.749,3.466 9.749,3.466 9.749,5.466 7.749,5.466 7.749,6.466 9.749,6.466 9.749,8.466 10.749,8.466 10.749,6.466 12.749,6.466",n))),this.zoomInElements=e,this.elementOpacity=r.zoomModule.isPanning?"0.2":"1",e.setAttribute("opacity",this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomIn)},e.prototype.createZoomOutButton=function(e,t,r){var o=this.chart.svgRenderer,n=this.fillColor,a="M0,14.622L1.378,16l4.533-4.533v-0.711l0.266-0.266c1.022,0.889,2.4,1.422,3.866,";a+="1.422c3.289,0,5.955-2.666,5.955-5.955S13.333,0,10.044,0S4.089,2.667,4.134,5.911c0,1.466,0.533,2.844,",a+="1.422,3.866l-0.266,0.266H4.578L0,14.622L0,14.622z M5.911,5.911c0-2.311,1.822-4.133,4.133-4.133s4.133,1.822,4.133,",e.id=this.elementId+"_Zooming_ZoomOut",e.setAttribute("aria-label",this.chart.getLocalizedLabel("ZoomOut")),e.appendChild(o.drawRectangle(new Di(this.elementId+"_Zooming_ZoomOut_1","transparent",{},1,this.iconRect))),e.appendChild(o.drawPath(new i.PathOption(this.elementId+"_Zooming_ZoomOut_2",n,null,null,1,null,a+"4.133s-1.866,4.133-4.133,4.133S5.911,8.222,5.911,5.911z M12.567,6.466h-5v-1h5V6.466z"))),this.zoomOutElements=e,this.elementOpacity=r.zoomModule.isPanning?"0.2":"1",e.setAttribute("opacity",this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomOut)},e.prototype.createResetButton=function(e,t,r,o){var n,a=this.chart.svgRenderer,s=this.fillColor,l="M12.364,8h-2.182l2.909,3.25L16,8h-2.182c0-3.575-2.618-6.5-5.818-6.5c-1.128,0-2.218,0.366-3.091,";l+="1.016l1.055,1.178C6.581,3.328,7.272,3.125,8,3.125C10.4,3.125,12.363,5.319,12.364,8L12.364,8z M11.091,",l+="13.484l-1.055-1.178C9.419,12.672,8.728,12.875,8,12.875c-2.4,0-4.364-2.194-4.364-4.875h2.182L2.909,4.75L0,8h2.182c0,",e.id=this.elementId+"_Zooming_Reset",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Reset")),o?(n=i.measureText(this.chart.getLocalizedLabel("ResetZoom"),{size:"12px"}),e.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Reset_1","transparent",{},1,new i.Rect(0,0,n.width,n.height)))),Ve(r.renderer,new i.TextOption(this.elementId+"_Zooming_Reset_2",0+n.width/2,0+3*n.height/4,"middle",this.chart.getLocalizedLabel("ResetZoom"),"rotate(0,0,0)","auto"),{size:"12px"},"black",e,null,null,null,null,null,null,null,null,r.enableCanvas)):(e.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Reset_1","transparent",{},1,this.iconRect))),e.appendChild(a.drawPath(new i.PathOption(this.elementId+"_Zooming_Reset_2",s,null,null,1,null,l+"3.575,2.618,6.5,5.818,6.5C9.128,14.5,10.219,14.134,11.091,13.484L11.091,13.484z")))),t.appendChild(e),this.wireEvents(e,this.reset)},e.prototype.wireEvents=function(e,i){t.EventHandler.add(e,"mousedown touchstart",i,this),t.EventHandler.add(e,"mouseover",this.showTooltip,this),t.EventHandler.add(e,"mouseout",this.removeTooltip,this)},e.prototype.showTooltip=function(e){var t=e.currentTarget.id.split("_Zooming_")[1],r=e.pageX-(i.measureText(t,{size:"10px"}).width+5),o=he(e.currentTarget.id+"_1"),n=he(e.currentTarget.id+"_2"),a=he(e.currentTarget.id+"_3");o&&(this.hoveredID=o.id,o.setAttribute("fill",this.iconRectOverFill)),n&&n.setAttribute("fill",this.selectionColor),a&&a.setAttribute("fill",this.selectionColor),this.chart.isTouch||N("EJ2_Chart_ZoomTip",this.chart.getLocalizedLabel(t),e.pageY+10,r,"10px")},e.prototype.removeTooltip=function(){if(he(this.hoveredID)){var e=this.chart.zoomModule.isPanning?this.hoveredID.indexOf("_Pan_")>-1?this.iconRectSelectionFill:"transparent":this.hoveredID.indexOf("_Zoom_")>-1?this.iconRectSelectionFill:"transparent";he(this.hoveredID).setAttribute("fill",e)}var t=this.hoveredID?he(this.hoveredID.replace("_1","_2")):null,i=this.hoveredID?he(this.hoveredID.replace("_1","_3")):null;if(t){r=this.chart.zoomModule.isPanning?this.hoveredID.indexOf("_Pan_")>-1?this.selectionColor:this.fillColor:this.hoveredID.indexOf("_Zoom_")>-1?this.selectionColor:this.fillColor;t.setAttribute("fill",r)}if(i){var r=this.chart.zoomModule.isPanning?this.fillColor:this.hoveredID.indexOf("_Zoom_")>-1?this.selectionColor:this.fillColor;i.setAttribute("fill",r)}m("EJ2_Chart_ZoomTip")},e.prototype.reset=function(){var e=this,i=this.chart;i.zoomModule.isDevice||t.remove(i.zoomModule.toolkitElements);var r;this.removeTooltip(),i.svgObject.setAttribute("cursor","auto");var o,n=[];this.zoomCompleteEvtCollection=[];for(var a=0,s=i.axisCollections;a<s.length;a++){var l=s[a];r={cancel:!1,name:"zoomComplete",axis:l,previousZoomFactor:l.zoomFactor,previousZoomPosition:l.zoomPosition,currentZoomFactor:1,currentZoomPosition:0,previousVisibleRange:l.visibleRange,currentVisibleRange:null},l.zoomFactor=1,l.zoomPosition=0,l.zoomingScrollBar&&(l.zoomingScrollBar.isScrollUI=!1),r.cancel||(l.zoomFactor=r.currentZoomFactor,l.zoomPosition=r.currentZoomPosition,this.zoomCompleteEvtCollection.push(r)),n.push({zoomFactor:l.zoomFactor,zoomPosition:l.zoomFactor,axisName:l.name,axisRange:l.visibleRange})}return o={cancel:!1,axisCollection:n,name:hi},!o.cancel&&this.chart.isBlazor?(this.chart.trigger(hi,o,function(){e.setDefferedZoom(i)}),!1):this.setDefferedZoom(i)},e.prototype.setDefferedZoom=function(e){return e.disableTrackTooltip=!1,e.zoomModule.isZoomed=e.zoomModule.isPanning=e.isChartDrag=e.delayRedraw=!1,e.zoomModule.touchMoveList=e.zoomModule.touchStartList=[],e.zoomModule.pinchTarget=null,e.removeSvg(),e.enableAutoIntervalOnBothAxis&&e.processData(!1),e.refreshAxis(),e.refreshBound(),this.elementOpacity="1",!1},e.prototype.zoomIn=function(e){return this.zoomInOutCalculation(1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},e.prototype.zoomOut=function(e){return this.zoomInOutCalculation(-1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},e.prototype.zoom=function(e){this.chart.zoomModule.isPanning=!1;this.chart.zoomModule;return this.elementOpacity="1",this.chart.svgObject.setAttribute("cursor","auto"),this.zoomInElements.setAttribute("opacity",this.elementOpacity),this.zoomOutElements.setAttribute("opacity",this.elementOpacity),this.applySelection(this.zoomElements.childNodes,this.selectionColor),this.applySelection(this.panElements.childNodes,"#737373"),he(this.selectedID)&&he(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Zoom_1",he(this.selectedID).setAttribute("fill",this.iconRectSelectionFill),!1},e.prototype.pan=function(){return this.chart.zoomModule.isPanning=!0,this.chart.svgObject.setAttribute("cursor","pointer"),this.elementOpacity="0.2",this.zoomInElements?this.zoomInElements.setAttribute("opacity",this.elementOpacity):null,this.zoomOutElements?this.zoomOutElements.setAttribute("opacity",this.elementOpacity):null,this.panElements?this.applySelection(this.panElements.childNodes,this.selectionColor):null,this.zoomElements?this.applySelection(this.zoomElements.childNodes,"#737373"):null,he(this.selectedID)&&he(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Pan_1",he(this.selectedID).setAttribute("fill",this.iconRectSelectionFill),!1},e.prototype.zoomInOutCalculation=function(e,t,i,r){if(!t.zoomModule.isPanning&&"0.2"!==this.elementOpacity){var o=void 0,n=void 0,a=void 0;t.disableTrackTooltip=!0,t.delayRedraw=!0;var s=void 0;this.zoomCompleteEvtCollection=[];for(var l=0,h=i;l<h.length;l++){var c=h[l];s={cancel:!1,name:"zoomComplete",axis:c,previousZoomFactor:c.zoomFactor,previousZoomPosition:c.zoomPosition,currentZoomFactor:c.zoomFactor,currentZoomPosition:c.zoomPosition,previousVisibleRange:c.visibleRange,currentVisibleRange:null},("Horizontal"===c.orientation&&"Y"!==r||"Vertical"===c.orientation&&"X"!==r)&&(o=1===(a=Math.max(Math.max(1/le(c.zoomFactor,0,1),1)+.25*e,1))?1:le(1/a,0,1),n=1===a?0:c.zoomPosition+.5*(c.zoomFactor-o),c.zoomPosition===n&&c.zoomFactor===o||(o=n+o>1?1-n:o),s.currentZoomFactor=o,s.currentZoomPosition=n,s.cancel||(c.zoomFactor=s.currentZoomFactor,c.zoomPosition=s.currentZoomPosition,this.zoomCompleteEvtCollection.push(s)))}}},e.prototype.applySelection=function(e,t){for(var i=1,r=e.length;i<r;i++)e[i].setAttribute("fill",t)},e}(),vn=function(){function e(e){this.zoomCompleteEvtCollection=[],this.chart=e,this.isPointer=t.Browser.isPointer,this.browserName=t.Browser.info.name,this.wheelEvent="mozilla"===this.browserName?this.isPointer?"mousewheel":"DOMMouseScroll":"mousewheel",this.cancelEvent=this.isPointer?"pointerleave":"mouseleave",this.addEventListener(),this.isDevice=t.Browser.isDevice;var r=e.zoomSettings;this.toolkit=new mn(e),this.zooming=r,this.elementId=e.element.id,this.zoomingRect=new i.Rect(0,0,0,0),this.zoomAxes=[],this.zoomkitOpacity=.3,this.isIOS=t.Browser.isIos||t.Browser.isIos7,this.isZoomed=this.performedUI=this.zooming.enablePan&&this.zooming.enableSelectionZooming,r.enableScrollbar&&(e.scrollElement=t.createElement("div",{id:e.element.id+"_scrollElement"}))}return e.prototype.renderZooming=function(e,t,i){this.calculateZoomAxesRange(t),!this.zooming.enableSelectionZooming||i&&(!t.isDoubleTap||1!==this.touchStartList.length)||this.isPanning&&!t.isDoubleTap?this.isPanning&&t.isChartDrag&&(!i||i&&1===this.touchStartList.length)&&(this.pinchTarget=i?e.target:null,this.doPan(t,t.axisCollections)):(this.isPanning=!!this.isDevice||this.isPanning,this.performedUI=!0,this.drawZoomingRectangle(t))},e.prototype.drawZoomingRectangle=function(e){var t=e.chartAxisLayoutPanel.seriesClipRect,i=new Vi(e.previousMouseMoveX,e.previousMouseMoveY),r=new Vi(e.mouseX,e.mouseY),o=this.zoomingRect=se(i,r,t);o.width>0&&o.height>0&&(this.isZoomed=!0,e.disableTrackTooltip=!0,e.svgObject.setAttribute("cursor","crosshair"),"X"===this.zooming.mode?(o.height=t.height,o.y=t.y):"Y"===this.zooming.mode&&(o.width=t.width,o.x=t.x),(e.enableCanvas?document.getElementById(this.elementId+"_tooltip_svg"):e.svgObject).appendChild(e.svgRenderer.drawRectangle(new Di(this.elementId+"_ZoomArea",e.themeStyle.selectionRectFill,{color:e.themeStyle.selectionRectStroke,width:1},1,o,0,0,"","3"))))},e.prototype.doPan=function(e,t){var i=this;if(e.startMove&&e.crosshair.enable)return null;var r,o;this.isZoomed=!0,this.offset=e.delayRedraw?this.offset:e.chartAxisLayoutPanel.seriesClipRect,e.delayRedraw=!0,this.zoomCompleteEvtCollection=[],e.disableTrackTooltip=!0;for(var n,a=[],s=0,l=t;s<l.length;s++){var h=l[s];n={cancel:!1,name:"zoomComplete",axis:h,previousZoomFactor:h.zoomFactor,previousZoomPosition:h.zoomPosition,currentZoomFactor:h.zoomFactor,currentZoomPosition:h.zoomPosition,previousVisibleRange:h.visibleRange,currentVisibleRange:null},r=Math.max(1/le(h.zoomFactor,0,1),1),"Horizontal"===h.orientation?(o=(e.previousMouseMoveX-e.mouseX)/h.rect.width/r,n.currentZoomPosition=le(h.zoomPosition+o,0,1-h.zoomFactor)):(o=(e.previousMouseMoveY-e.mouseY)/h.rect.height/r,n.currentZoomPosition=le(h.zoomPosition-o,0,1-h.zoomFactor)),n.cancel||(h.zoomFactor=n.currentZoomFactor,h.zoomPosition=n.currentZoomPosition,this.zoomCompleteEvtCollection.push(n)),a.push({zoomFactor:h.zoomFactor,zoomPosition:h.zoomFactor,axisName:h.name,axisRange:h.visibleRange})}var c={cancel:!1,axisCollection:a,name:hi};!c.cancel&&this.chart.isBlazor?this.chart.trigger(hi,c,function(){i.performDefferedZoom(e)}):(this.performDefferedZoom(e),this.redrawOnZooming(e,!1))},e.prototype.performDefferedZoom=function(e){var t,i;if(this.zooming.enableDeferredZooming){switch(t=e.mouseX-e.mouseDownX,i=e.mouseY-e.mouseDownY,this.zooming.mode){case"X":i=0;break;case"Y":t=0}this.setTransform(t,i,null,null,e,!1),this.refreshAxis(e.chartAxisLayoutPanel,e,e.axisCollections),e.enableCanvas&&this.performZoomRedraw(e)}else this.performZoomRedraw(e);e.previousMouseMoveX=e.mouseX,e.previousMouseMoveY=e.mouseY},e.prototype.performZoomRedraw=function(e){var t=this.zoomingRect;e.animateSeries=!1,this.isZoomed&&(t.width>0&&t.height>0?(this.performedUI=!0,e.svgObject.setAttribute("cursor","auto"),this.doZoom(e,e.axisCollections,e.chartAxisLayoutPanel.seriesClipRect),e.isDoubleTap=!1):e.disableTrackTooltip&&(e.disableTrackTooltip=!1,e.delayRedraw=!1,e.enableCanvas?e.createChartSvg():e.removeSvg(),e.refreshAxis(),e.refreshBound()))},e.prototype.refreshAxis=function(e,t,r){var o=t.zoomSettings.mode;e.measureAxis(new i.Rect(t.initialClipRect.x,t.initialClipRect.y,t.initialClipRect.width,t.initialClipRect.height)),r.map(function(t,i){"Horizontal"===t.orientation&&"Y"!==o&&e.drawXAxisLabels(t,i,null,t.placeNextToAxisLine?t.updatedRect:t.rect),"Vertical"===t.orientation&&"X"!==o&&e.drawYAxisLabels(t,i,null,t.placeNextToAxisLine?t.updatedRect:t.rect)})},e.prototype.doZoom=function(e,t,r){var o,n=this,a=this.zoomingRect,s=this.zooming.mode;this.isPanning=e.zoomSettings.enablePan||this.isPanning;var l=[];this.zoomCompleteEvtCollection=[];for(var h=0,c=t;h<c.length;h++){var d=c[h];o={cancel:!1,name:"zoomComplete",axis:d,previousZoomFactor:d.zoomFactor,previousZoomPosition:d.zoomPosition,currentZoomFactor:d.zoomFactor,currentZoomPosition:d.zoomPosition,previousVisibleRange:d.visibleRange,currentVisibleRange:null},"Horizontal"===d.orientation?"Y"!==s&&(o.currentZoomPosition+=Math.abs((a.x-r.x)/r.width)*d.zoomFactor,o.currentZoomFactor*=a.width/r.width):"X"!==s&&(o.currentZoomPosition+=(1-Math.abs((a.height+(a.y-r.y))/r.height))*d.zoomFactor,o.currentZoomFactor*=a.height/r.height),o.cancel||(d.zoomFactor=o.currentZoomFactor,d.zoomPosition=o.currentZoomPosition,this.zoomCompleteEvtCollection.push(o)),l.push({zoomFactor:d.zoomFactor,zoomPosition:d.zoomFactor,axisName:d.name,axisRange:d.visibleRange})}var p={cancel:!1,axisCollection:l,name:hi};!p.cancel&&this.chart.isBlazor?this.chart.trigger(hi,p,function(){n.zoomingRect=new i.Rect(0,0,0,0),n.performZoomRedraw(e)}):(this.zoomingRect=new i.Rect(0,0,0,0),this.redrawOnZooming(e))},e.prototype.redrawOnZooming=function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1);var r=i?this.toolkit.zoomCompleteEvtCollection:this.zoomCompleteEvtCollection;t&&this.performZoomRedraw(e);for(var o,n=0;n<r.length;n++)r[n].cancel||(o={cancel:!1,name:"zoomComplete",axis:e.axisCollections[n],previousZoomFactor:r[n].previousZoomFactor,previousZoomPosition:r[n].previousZoomPosition,currentZoomFactor:e.axisCollections[n].zoomFactor,currentZoomPosition:e.axisCollections[n].zoomPosition,currentVisibleRange:e.axisCollections[n].visibleRange,previousVisibleRange:r[n].previousVisibleRange},e.trigger("zoomComplete",o))},e.prototype.performMouseWheelZooming=function(e,t,i,r,o){var n,a,s,l=this,h="mozilla"!==this.browserName||this.isPointer?e.wheelDelta>0?1:-1:-e.detail/3>0?1:-1,c=this.zooming.mode,d=.5;this.isZoomed=!0,this.calculateZoomAxesRange(r),r.disableTrackTooltip=!0,this.performedUI=!0,this.isPanning=r.zoomSettings.enablePan||this.isPanning,this.zoomCompleteEvtCollection=[];for(var p,u=[],g=0,y=o;g<y.length;g++){var m=y[g];p={cancel:!1,name:"zoomComplete",axis:m,previousZoomFactor:m.zoomFactor,previousZoomPosition:m.zoomPosition,currentZoomFactor:m.zoomFactor,currentZoomPosition:m.zoomPosition,currentVisibleRange:null,previousVisibleRange:m.visibleRange},("Vertical"===m.orientation&&"X"!==c||"Horizontal"===m.orientation&&"Y"!==c)&&((n=Math.max(Math.max(1/le(m.zoomFactor,0,1),1)+.25*h,1))>=1&&(d=(d="Horizontal"===m.orientation?t/m.rect.width:1-i/m.rect.height)>1?1:d<0?0:d,a=1===n?1:le((h>0?.9:1.1)/n,0,1),s=1===n?0:m.zoomPosition+(m.zoomFactor-a)*d,m.zoomPosition===s&&m.zoomFactor===a||(a=s+a>1?1-s:a),p.currentZoomFactor=a,p.currentZoomPosition=s),p.cancel||(m.zoomFactor=p.currentZoomFactor,m.zoomPosition=p.currentZoomPosition,this.zoomCompleteEvtCollection.push(p))),u.push({zoomFactor:m.zoomFactor,zoomPosition:m.zoomFactor,axisName:m.name,axisRange:m.visibleRange})}var v={cancel:!1,axisCollection:u,name:hi};!v.cancel&&this.chart.isBlazor?this.chart.trigger(hi,v,function(){l.performZoomRedraw(r)}):this.redrawOnZooming(r)},e.prototype.performPinchZooming=function(e,t){if(this.zoomingRect.width>0&&this.zoomingRect.height>0||t.startMove&&t.crosshair.enable)return!1;this.calculateZoomAxesRange(t),this.isZoomed=!0,this.isPanning=!0,this.performedUI=!0,this.offset=t.delayRedraw?this.offset:t.chartAxisLayoutPanel.seriesClipRect,t.delayRedraw=!0,t.disableTrackTooltip=!0;var r=t.element.getBoundingClientRect(),o=this.touchStartList,n=this.touchMoveList,a=o[0].pageX-r.left,s=o[0].pageY-r.top,l=n[0].pageX-r.left,h=n[0].pageY-r.top,c=o[1].pageX-r.left,d=o[1].pageY-r.top,p=n[1].pageX-r.left,u=n[1].pageY-r.top,g=Math.abs(l-p)/Math.abs(a-c),y=Math.abs(h-u)/Math.abs(s-d),m=(this.offset.x-l)/g+a,v=(this.offset.y-h)/y+s,f=new i.Rect(m,v,this.offset.width/g,this.offset.height/y),b=l-g*a,x=h-y*s;if(!isNaN(g-g)&&!isNaN(y-y))switch(this.zooming.mode){case"XY":this.setTransform(b,x,g,y,t,!0);break;case"X":this.setTransform(b,0,g,1,t,!0);break;case"Y":this.setTransform(0,x,1,y,t,!0)}return this.calculatePinchZoomFactor(t,f),this.refreshAxis(t.chartAxisLayoutPanel,t,t.axisCollections),this.redrawOnZooming(t,!1),!0},e.prototype.calculatePinchZoomFactor=function(e,t){var i,r,o,n,a,s,l,h,c,d=this.zooming.mode,p=[];this.zoomCompleteEvtCollection=[];for(var u=0;u<e.axisCollections.length;u++){var g=e.axisCollections[u];("Horizontal"===g.orientation&&"Y"!==d||"Vertical"===g.orientation&&"X"!==d)&&(h=g.zoomFactor,c=g.zoomPosition,l={cancel:!1,name:"zoomComplete",axis:g,previousZoomFactor:g.zoomFactor,previousZoomPosition:g.zoomPosition,currentZoomFactor:h,currentZoomPosition:c,previousVisibleRange:g.visibleRange,currentVisibleRange:null},"Horizontal"===g.orientation?(o=(a=t.x-this.offset.x)/(s=g.rect.width/this.zoomAxes[u].delta)+this.zoomAxes[u].min,n=(a=t.x+t.width-this.offset.x)/s+this.zoomAxes[u].min):(a=t.y-this.offset.y,s=g.rect.height/this.zoomAxes[u].delta,o=(-1*a+g.rect.height)/s+this.zoomAxes[u].min,n=(-1*(a=t.y+t.height-this.offset.y)+g.rect.height)/s+this.zoomAxes[u].min),i=Math.min(o,n),r=Math.max(o,n),c=(i-this.zoomAxes[u].actualMin)/this.zoomAxes[u].actualDelta,h=(r-i)/this.zoomAxes[u].actualDelta,l.currentZoomPosition=c<0?0:c,l.currentZoomFactor=h>1?1:h,l.cancel||(g.zoomFactor=l.currentZoomFactor,g.zoomPosition=l.currentZoomPosition,this.zoomCompleteEvtCollection.push(l)),p.push({zoomFactor:g.zoomFactor,zoomPosition:g.zoomFactor,axisName:g.name,axisRange:g.visibleRange}))}var y={cancel:!1,axisCollection:p,name:hi};!y.cancel&&this.chart.isBlazor&&this.chart.trigger(hi,y)},e.prototype.setTransform=function(e,t,i,r,o,n){o.enableCanvas||o.seriesElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)"),o.indicatorElements&&o.indicatorElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)");var a,s,l,h;if(null!==e&&null!==t)for(var c=0,d=o.visibleSeries;c<d.length;c++){var p=d[c];s=o.requireInvertedAxis?p.yAxis.rect.x:p.xAxis.rect.x,l=o.requireInvertedAxis?p.xAxis.rect.y:p.yAxis.rect.y,a="translate("+(e+(n?i*s:s))+","+(t+(n?r*l:l))+")",a=i||r?a+" scale("+i+" "+r+")":a,p.visible&&("Indicator"===p.category?p.seriesElement.parentNode.setAttribute("transform",a):o.enableCanvas||p.seriesElement.setAttribute("transform",a),h=he(o.element.id+"_Series_"+p.index+"_DataLabelCollections"),p.errorBarElement&&p.errorBarElement.setAttribute("transform",a),p.symbolElement&&p.symbolElement.setAttribute("transform",a),p.textElement&&(p.textElement.setAttribute("visibility","hidden"),p.shapeElement.setAttribute("visibility","hidden")),h&&(h.style.visibility="hidden"))}},e.prototype.calculateZoomAxesRange=function(e){for(var t,i,r=0;r<e.axisCollections.length;r++){var o=e.axisCollections[r];i=o.visibleRange,this.zoomAxes[r]?e.delayRedraw||(this.zoomAxes[r].min=i.min,this.zoomAxes[r].delta=i.delta):(t={actualMin:o.actualRange.min,actualDelta:o.actualRange.delta,min:i.min,delta:i.delta},this.zoomAxes[r]=t)}},e.prototype.showZoomingToolkit=function(e){var r,o=this.zooming.toolbarItems,n=e.chartAxisLayoutPanel.seriesClipRect,a=e.svgRenderer,s=this.isDevice?1:o.length,l=this.isDevice?i.measureText("Reset Zoom",{size:"12px"}).width:16,h=this.isDevice?i.measureText("Reset Zoom",{size:"12px"}).height:22,c=s*l+5*(s+1)+5*(s-1),d=n.x+n.width-c-5,p=n.y+5,u=5,g=this.toolkit,y='<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/>';if(y+='<feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/>',y+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',0===s||he(this.elementId+"_Zooming_KitCollection"))return!1;var m=a.createDefs();o=this.isDevice?["Reset"]:o,m.innerHTML=y,this.toolkitElements=a.createGroup({id:this.elementId+"_Zooming_KitCollection",transform:"translate("+d+","+p+")"}),this.toolkitElements.appendChild(m);var v="Tailwind"===this.chart.theme?"#F3F4F6":"TailwindDark"===this.chart.theme?"#374151":"#fafafa";this.toolkitElements.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Rect",v,{color:"transparent",width:1},1,new i.Rect(0,0,c,h+10),0,0)));var f=a.drawRectangle(new Di(this.elementId+"_Zooming_Rect",v,{color:"transparent",width:1},.1,new i.Rect(0,0,c,h+10),0,0));"Tailwind"===this.chart.theme||"TailwindDark"===this.chart.theme?f.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):f.setAttribute("filter","url(#chart_shadow)"),this.toolkitElements.appendChild(f);for(var b,x=!1,w=1;w<=s;w++){switch(b=o[w-1],r=a.createGroup({transform:"translate("+u+","+(this.isDevice?5:8)+")"}),b){case"Pan":g.createPanButton(r,this.toolkitElements),x=!0;break;case"Zoom":g.createZoomButton(r,this.toolkitElements);break;case"ZoomIn":g.createZoomInButton(r,this.toolkitElements,e);break;case"ZoomOut":g.createZoomOutButton(r,this.toolkitElements,e);break;case"Reset":g.createResetButton(r,this.toolkitElements,e,this.isDevice)}u+=l+10}if(this.toolkitElements.setAttribute("opacity",this.isDevice?"1":""+this.zoomkitOpacity),this.toolkitElements.setAttribute("cursor","auto"),e.enableCanvas){var S=document.createElement("div");S.id=e.element.id+"_zoom",S.setAttribute("style","position:absolute; z-index:1");var C=e.availableSize.height/2,P=e.svgRenderer.createSvg({id:e.element.id+"_zoomkit_svg",width:e.availableSize.width,height:C});P.setAttribute("style","position:absolute"),P.appendChild(this.toolkitElements),S.appendChild(P),document.getElementById(this.elementId+"_Secondary_Element").appendChild(S)}else e.svgObject.appendChild(this.toolkitElements);return this.isDevice||(t.EventHandler.add(this.toolkitElements,"mousemove touchstart",this.zoomToolkitMove,this),t.EventHandler.add(this.toolkitElements,"mouseleave touchend",this.zoomToolkitLeave,this),this.isPanning&&x&&g.pan()),!0},e.prototype.applyZoomToolkit=function(e,t){this.isAxisZoomed(t)?(this.showZoomingToolkit(e),this.isZoomed=!0):(this.toolkit.removeTooltip(),this.isPanning=!1,this.isZoomed=!1,e.svgObject.setAttribute("cursor","auto"))},e.prototype.isAxisZoomed=function(e){for(var t=!1,i=0,r=e;i<r.length;i++){var o=r[i];t=t||1!==o.zoomFactor||0!==o.zoomPosition}return t},e.prototype.zoomToolkitMove=function(){var e=this.toolkitElements;return this.zoomkitOpacity=1,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},e.prototype.zoomToolkitLeave=function(){var e=this.toolkitElements;return this.zoomkitOpacity=.3,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},e.prototype.addEventListener=function(){this.chart.isDestroyed||(t.EventHandler.add(this.chart.element,this.wheelEvent,this.chartMouseWheel,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchStartEvent,this.mouseDownHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.chart.on(this.cancelEvent,this.mouseCancelHandler,this))},e.prototype.removeEventListener=function(){this.chart.isDestroyed||(t.EventHandler.remove(this.chart.element,this.wheelEvent,this.chartMouseWheel),this.chart.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.chart.off(t.Browser.touchStartEvent,this.mouseDownHandler),this.chart.off(t.Browser.touchEndEvent,this.mouseUpHandler),this.chart.off(this.cancelEvent,this.mouseCancelHandler))},e.prototype.chartMouseWheel=function(e){var t=this.chart,i=t.element.getBoundingClientRect(),r=he(t.svgId).getBoundingClientRect(),o=e.clientX-i.left-Math.max(r.left-i.left,0),n=e.clientY-i.top-Math.max(r.top-i.top,0);return this.zooming.enableMouseWheelZooming&&j(o,n,t.chartAxisLayoutPanel.seriesClipRect)&&(e.preventDefault(),this.performMouseWheelZooming(e,o,n,t,t.axisCollections)),!1},e.prototype.mouseMoveHandler=function(e){var t=this.chart,i=null;"touchmove"===e.type&&(e.preventDefault&&this.isIOS&&(this.isPanning||t.isDoubleTap||this.zooming.enablePinchZooming&&this.touchStartList.length>1)&&e.preventDefault(),i=e.touches),t.isChartDrag&&(t.isTouch&&(this.touchMoveList=this.addTouchPointer(this.touchMoveList,e,i),this.zooming.enablePinchZooming&&this.touchMoveList.length>1&&this.touchStartList.length>1&&this.performPinchZooming(e,t)),this.renderZooming(e,t,t.isTouch))},e.prototype.mouseDownHandler=function(e){var t,i=this.chart,r=null;"touchstart"===e.type?(r=e.touches,t=e.target):t=e.target,-1===t.id.indexOf(i.element.id+"_Zooming_")&&j(i.previousMouseMoveX,i.previousMouseMoveY,i.chartAxisLayoutPanel.seriesClipRect)&&(i.isChartDrag=!0),i.isTouch&&(this.touchStartList=this.addTouchPointer(this.touchStartList,e,r))},e.prototype.mouseUpHandler=function(e){var t=this.chart,i=-1===e.target.id.indexOf(t.element.id+"_ZoomOut_")||-1===e.target.id.indexOf(t.element.id+"_ZoomIn_");(t.isChartDrag||i)&&this.redrawOnZooming(t,!0,!0),t.isTouch&&(t.isDoubleTap&&j(t.mouseX,t.mouseY,t.chartAxisLayoutPanel.seriesClipRect)&&1===this.touchStartList.length&&this.isZoomed&&this.toolkit.reset(),this.touchStartList=[],t.isDoubleTap=!1)},e.prototype.mouseCancelHandler=function(){this.isZoomed&&this.performZoomRedraw(this.chart),this.pinchTarget=null,this.touchStartList=[],this.touchMoveList=[]},e.prototype.addTouchPointer=function(e,t,i){if(i){e=[];for(var r=0,o=i.length;r<o;r++)e.push({pageX:i[r].clientX,pageY:i[r].clientY,pointerId:null})}else if(0===(e=e||[]).length)e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});else for(var r=0,n=e.length;r<n;r++)e[r].pointerId===t.pointerId?e[r]={pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId}:e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});return e},e.prototype.getModuleName=function(){return"Zoom"},e.prototype.destroy=function(){this.removeEventListener()},e}(),fn=function(){function e(e){this.control=e}return e.prototype.seriesStyles=function(){var e,i,r=document.getElementById(this.styleId),o="{}",n=this.control.selectionPattern,a=this.control.highlightPattern;if(t.isNullOrUndefined(r)||"None"!==n||"None"!==a){(r=document.createElement("style")).setAttribute("id",this.styleId);for(var s=0,l=this.control.visibleSeries;s<l.length;s++){var h=l[s],c=this.control.visibleSeries[h.index]||this.control.visibleSeries[h.index];if(!(t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)||"None"===n&&"None"===a)){var d=this.styleId.indexOf("highlight")>0?a:n;if("Pie"===c.type||"Funnel"===c.type||"Pyramid"===c.type)for(var p=0;p<c.points.length;p++)i=c.opacity,o="{ fill:"+this.pattern(this.control,c.points[p].color,h.index,d,i)+"}";else c.type&&(i=c.opacity,o="{ fill:"+this.pattern(this.control,c.interior,h.index,d,i)+"}")}e=h.selectionStyle||this.styleId+"_series_"+h.index+",."+this.styleId+"_series_"+h.index+"> *",o=o.indexOf("None")>-1?"{}":o,r.innerHTML+=h.selectionStyle?"":"."+e+o}r.innerHTML+="."+this.unselected+" { opacity:0.3;} ",document.body.appendChild(r)}},e.prototype.pattern=function(e,t,i,r,o){var n=e.svgObject,a=[],s={id:e.element.id+"_"+r+"_Selection_"+i,patternUnits:"userSpaceOnUse"};switch(r){case"Dots":s.height=s.width=6,s.width=6,a[0]={x:0,y:0,width:7,height:7,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={cx:3,cy:3,r:2,"stroke-width":1,fill:t,name:"circle"};break;case"Pacman":s.height="18.384",s.width="17.917",a[0]={name:"rect",x:0,y:0,width:17.917,height:18.384,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M9.081,9.194l5.806-3.08c-0.812-1.496-2.403-3.052-4.291-3.052H8.835C6.138,3.063,3,6.151,3,8.723v1.679 c0,2.572,3.138,5.661,5.835,5.661h1.761c2.085,0,3.835-1.76,4.535-3.514L9.081,9.194z","stroke-width":1,stroke:t,fill:t};break;case"Chessboard":s.height=s.width=10,a[0]={x:0,y:0,width:10,height:10,fill:"#ffffff",opacity:o,name:"rect"},a[1]={x:0,y:0,width:5,height:5,fill:t,opacity:o,name:"rect"},a[2]={x:5,y:5,width:5,height:5,fill:t,opacity:o,name:"rect"};break;case"Crosshatch":s.height=s.width="8",a[0]={x:0,y:0,width:8,height:8,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M0 0L8 8ZM8 0L0 8Z","stroke-width":1,stroke:t,name:"path"};break;case"DiagonalForward":s.height=s.width=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M 3 -3 L 9 3 M 6 6 L 0 0 M 3 9 L -3 3","stroke-width":2,stroke:t,name:"path"};break;case"DiagonalBackward":s.height=s.width=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M 3 -3 L -3 3 M 0 6 L 6 0 M 9 3 L 3 9","stroke-width":2,stroke:t,name:"path"};break;case"Grid":s.height=s.width=6,a[0]={name:"rect",x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M1 3.5L11 3.5 M0 3.5L11 3.5 M0 7.5L11 7.5 M0 11.5L11 11.5 M5.5 0L5.5 12 M11.5 0L11.5 12Z","stroke-width":1,stroke:t};break;case"Turquoise":s.height=s.width=17,a[0]={name:"rect",x:0,y:0,width:17,height:17,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0.5739999999999998,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[2]={name:"path",d:"M11.805,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[3]={name:"path",d:"M6.19,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[4]={name:"path",d:"M11.805,8.217a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[5]={name:"path",d:"M6.19,8.217a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[6]={name:"path",d:"M11.805,13.899a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[7]={name:"path",d:"M6.19,13.899a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t};break;case"Star":s.height=s.width=21,a[0]={name:"rect",x:0,y:0,width:21,height:21,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M15.913,18.59L10.762 12.842 5.613 18.75 8.291 11.422 0.325 9.91 8.154 8.33 5.337 0.91 10.488 6.658 15.637 0.75 12.959 8.078 20.925 9.59 13.096 11.17 z","stroke-width":1,stroke:t,fill:t};break;case"Triangle":s.height=s.width=10,a[0]={name:"rect",x:0,y:0,width:10,height:10,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M4.987,0L7.48 4.847 9.974 9.694 4.987 9.694 0 9.694 2.493 4.847 z","stroke-width":1,stroke:t,fill:t};break;case"Circle":s.height=s.width=9,a[0]={name:"rect",x:0,y:0,width:9,height:9,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"circle",cx:5.125,cy:3.875,r:3.625,"stroke-width":1,fill:t};break;case"Tile":s.height=s.width=18,a[0]={name:"rect",x:0,y:0,width:18,height:18,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,9L0 0 9 0 z","stroke-width":1,stroke:t,fill:t},a[2]={name:"path",d:"M9,9L9 0 18 0 z","stroke-width":1,stroke:t,fill:t},a[3]={name:"path",d:"M0,18L0 9 9 9 z","stroke-width":1,stroke:t,fill:t},a[4]={name:"path",d:"M9,18L9 9 18 9 z","stroke-width":1,stroke:t,fill:t};break;case"HorizontalDash":s.height=s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,1.5 L10 1.5 M0,5.5 L10 5.5 M0,9.5 L10 9.5 z","stroke-width":1,stroke:t,fill:t};break;case"VerticalDash":s.height=s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M1.5,0 L1.5 10 M5.5,0 L5.5 10 M9.5,0 L9.5 10 z","stroke-width":1,stroke:t,fill:t};break;case"Rectangle":s.height=s.width=12,a[0]={name:"rect",width:12,height:12,fill:"#ffffff",opacity:o},a[1]={name:"rect",x:1,y:2,width:4,height:9,fill:t,opacity:o},a[2]={name:"rect",x:7,y:2,width:4,height:9,fill:t,opacity:o};break;case"Box":s.height=s.width=10,a[0]={name:"rect",width:13,height:13,fill:"#ffffff",opacity:o},a[1]={name:"rect",x:1.5,y:1.5,width:10,height:9,fill:t,opacity:o};break;case"HorizontalStripe":s.height=12,s.width=10,a[0]={name:"rect",x:0,y:0,width:10,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,0.5 L10 0.5 M0,4.5 L10 4.5 M0,8.5 L10 8.5 z","stroke-width":1,stroke:t,fill:t};break;case"VerticalStripe":s.height=10,s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:10,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0.5,0 L0.5 10 M4.5,0 L4.5 10 M8.5,0 L8.5 10 z","stroke-width":1,stroke:t,fill:t};break;case"Bubble":s.height=s.width=20,a[0]={name:"rect",x:0,y:0,width:20,height:20,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"circle",cx:5.217,cy:11.325,r:3.429,"stroke-width":1,fill:"#D0A6D1"},a[2]={name:"circle",cx:13.328,cy:6.24,r:4.884,"stroke-width":1,fill:t},a[3]={name:"circle",cx:13.277,cy:14.66,r:3.018,"stroke-width":1,fill:"#D0A6D1"}}var l=e.svgRenderer||e.renderer,h=l.createPattern(s,"pattern");return this.loadPattern(e,a,h,l),n.appendChild(h),"url(#"+e.element.id+"_"+r+"_Selection_"+i+")"},e.prototype.loadPattern=function(e,t,i,r){var o;for(o=0;o<t.length;o++){var n=r.createPattern(t[o],t[o].name);i.appendChild(n)}},e.prototype.concatIndexes=function(e,t){return e.concat(t)},e.prototype.checkVisibility=function(e){if(!e)return!1;for(var t=!1,i=[],r=0,o=e;r<o.length;r++){s=o[r];-1===i.indexOf(s.series)&&i.push(s.series)}for(var n=0,a=i;n<a.length;n++){var s=a[n];if(this.control.series[s].visible){t=!0;break}}return t},e.prototype.addSvgClass=function(e,t){var i=e.getAttribute("class")||"";-1===(i+=""!==i?" ":"").indexOf(t)&&e.setAttribute("class",i+t)},e.prototype.removeSvgClass=function(e,t){var i=e.getAttribute("class")||"";i.indexOf(t)>-1&&e.setAttribute("class",i.replace(t,""))},e.prototype.getChildren=function(e){for(var t=[],i=0;i<e.childNodes.length;i++)"defs"!==e.childNodes[i].tagName&&t.push(e.childNodes[i]);return t},e}(),bn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xn=function(e){function r(t){var i=e.call(this,t)||this;i.isdrawRect=!0,i.multiDataIndexes=[],i.pathIndex=0,i.seriesIndex=0,i.count=-1,i.dragRectArray=[],i.filterArray=[],i.totalSelectedPoints=[],i.chart=t,i.renderer=t.renderer;var r=t.selectionMode;return i.isMultiDrag=t.isMultiSelect&&r.indexOf("Drag")>-1,i.addEventListener(),i}return bn(r,e),r.prototype.addEventListener=function(){if(!(this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning)){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this),this.chart.on(e,this.completeSelection,this),this.chart.on("click",this.calculateSelectedElements,this),this.chart.on(t.Browser.touchStartEvent,this.mousedown,this),this.chart.on(t.Browser.touchEndEvent,this.completeSelection,this)}},r.prototype.mousedown=function(e){var t=this.chart;t.isPointMouseDown||"None"===t.selectionMode||t.isChartDrag||(t.isDoubleTap||!t.isTouch||this.rectPoints)&&this.dragStart(t,t.chartAxisLayoutPanel.seriesClipRect,t.mouseDownX,t.mouseDownY,e)},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMove),this.chart.off("pointerleave",this.completeSelection),this.chart.off("click",this.calculateSelectedElements),this.chart.off(t.Browser.touchStartEvent,this.mousedown),this.chart.off(t.Browser.touchEndEvent,this.completeSelection))},r.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.closeIconId=e.element.id+"_ej2_drag_close",this.draggedRectGroup=e.element.id+"_ej2_drag_group",this.multiRectGroup=e.element.id+"_ej2_drag_multi_group",this.draggedRect=e.element.id+"_ej2_drag_rect",this.lassoPath=e.element.id+"_ej2_drag_path",this.selectedDataIndexes=[],this.rectPoints=null,this.isSeriesMode="Series"===e.selectionMode},r.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,e.selectionMode.indexOf("Drag")>-1||this.selectDataIndex(e,this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes))},r.prototype.generateStyle=function(e){return e?(this.styleId.indexOf("selection")>1&&"None"!==this.chart.selectionMode&&(this.unselected=e.unSelectedStyle||this.unselected),this.styleId.indexOf("highlight")>0&&"None"!==this.chart.highlightMode&&(this.unselected=e.nonHighlightStyle||this.unselected),e.selectionStyle||this.styleId+"_series_"+e.index):"undefined"},r.prototype.selectDataIndex=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];this.performSelection(o,e,this.getElementByIndex(e,o)[0])}},r.prototype.getElementByIndex=function(e,t,i){void 0===i&&(i="");var r=e.element.id+"_Series_"+t.series+"_Point_"+t.point,o=e.series[t.series];return r=!o.isRectSeries&&"Scatter"!==o.type&&"Bubble"!==o.type&&o.marker.visible?r+"_Symbol"+i:r,[he(r),"RangeArea"!==o.type&&"SplineRangeArea"!==o.type||!o.marker.visible?null:he(r+"1")]},r.prototype.getClusterElements=function(e,t){for(var i,r,o=[],n=0,a=e.visibleSeries;n<a.length;n++){var s=a[n];s.visible&&(t=new Jt(s.index,t.point),o.push(this.getElementByIndex(e,t)[0]),i=this.generateStyle(e.visibleSeries[t.series]),r=document.querySelectorAll("."+i),this.findTrackballElements(r,i),!e.isMultiSelect&&r.length>0&&r[0].id!==o[o.length-1].id&&this.removeSelection(e,t.series,r,i,!0))}return o},r.prototype.findTrackballElements=function(e,i){for(var r,o,n=0;n<e.length;n++)if(!t.isNullOrUndefined(e[n])&&(r=t.isNullOrUndefined(e[n].parentNode)?[]:[].slice.call(e[0].parentNode.querySelectorAll("."+i))).length>0){o=[];for(var a=0;a<r.length;a++)r[a].id.indexOf("Trackball")>-1&&o.push(r[a]);this.removeStyles(o)}},r.prototype.findElements=function(e,t,i,r){return void 0===r&&(r=""),this.isSeriesMode?this.getSeriesElements(t):"Cluster"===this.currentMode?this.getClusterElements(e,i):this.getElementByIndex(e,i,r)},r.prototype.isAlreadySelected=function(e){var t=e.target;if("click"===e.type?(this.currentMode=this.chart.selectionMode,this.styleId=this.chart.element.id+"_ej2_chart_selection"):"mousemove"===e.type&&(this.currentMode=this.chart.highlightMode,this.highlightDataIndexes=[],this.styleId=this.chart.element.id+"_ej2_chart_highlight"),"None"!==this.chart.highlightMode&&"None"===this.chart.selectionMode&&"click"===e.type)return!1;if("None"!==this.chart.highlightMode&&this.previousSelectedEle&&this.previousSelectedEle[0]){var i=t.parentNode.id,r=void 0;t.parentNode&&(r=i.indexOf("SeriesGroup")>0||i.indexOf("SymbolGroup")>0);for(var o=0;o<this.previousSelectedEle.length;o++)this.previousSelectedEle[o].hasAttribute("class")&&(this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")>-1&&(r||"click"===e.type)?(this.previousSelectedEle[o].removeAttribute("class"),this.addOrRemoveIndex(this.highlightDataIndexes,this.indexFinder(this.previousSelectedEle[o].id))):!r&&this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")>-1&&this.performSelection(this.indexFinder(this.previousSelectedEle[o].id),this.chart,this.previousSelectedEle[o]))}return!0},r.prototype.calculateSelectedElements=function(e){if(!t.isNullOrUndefined(e.target)){var i=e.target;if(("None"!==this.chart.selectionMode||"None"!==this.chart.highlightMode)&&-1!==i.id.indexOf(this.chart.element.id+"_")){if("mousemove"===e.type){if(i.hasAttribute("class")&&(i.getAttribute("class").indexOf("highlight")>-1||i.getAttribute("class").indexOf("selection")>-1))return;if(!t.isNullOrUndefined(i.parentNode)&&i.parentNode.hasAttribute("class")&&(i.parentNode.getAttribute("class").indexOf("highlight")>0||i.parentNode.getAttribute("class").indexOf("selection")>0))return}if(this.isAlreadySelected(e),i.id.indexOf("_Series_")>-1){var r=void 0;if(i.id.indexOf("_Trackball_1")>-1)r=he(i.id.split("_Trackball_")[0]+"_Symbol"),r=t.isNullOrUndefined(r)?he(i.id.split("_Trackball_")[0]):r;else if(i.id.indexOf("_Trackball_0")>-1)return null;this.performSelection(this.indexFinder(i.id),this.chart,r||i)}}}},r.prototype.performSelection=function(e,t,i){if(this.isSeriesMode="Series"===this.currentMode,"BoxAndWhisker"===t.series[e.series].type&&i&&i.id===t.element.id+"_Series_"+e.series+"_Point_"+e.point+"_BoxPath"&&(i=i.parentNode),"Area"===t.series[e.series].type&&("Point"===this.currentMode||"Cluster"===this.currentMode)&&i&&i.id===this.chart.element.id+"_Series_"+e.series){var r=this.generateStyle(t.series[e.series]),o=document.querySelectorAll("."+r);this.findTrackballElements(o,r),this.blurEffect(t.element.id,t.visibleSeries)}switch(this.currentMode){case"Series":this.selection(t,e,this.getSeriesElements(t.series[e.series])),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries);break;case"Point":!isNaN(e.point)&&i&&(this.selection(t,e,[i]),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries));break;case"Cluster":isNaN(e.point)||(this.clusterSelection(t,e),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries))}},r.prototype.selectionComplete=function(e,t,i){var r,o,n,a,s,l=[];if("Cluster"===i){for(var h=0,c=e.visibleSeries;h<c.length;h++)if((p=c[h]).visible)for(d=0;d<this.selectedDataIndexes.length;d++)o=e.isMultiSelect?this.selectedDataIndexes[d].point:t.point,n=p.index,r=p.points,isNaN(o)||(p.type,a=r[o].yValue,s=r[o].xValue,"Category"===e.primaryXAxis.valueType?s=r[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(s=new Date(r[o].xValue)),"Indicator"!==p.category&&l.push({x:s,y:a,seriesIndex:n,pointIndex:o}),"RangeArea"!==p.type&&"SplineRangeArea"!==p.type||l.push({x:s,y:r[o].regions[0].y,seriesIndex:n,pointIndex:o}))}else if("Series"===i)if(e.isMultiSelect)for(d=0;d<this.selectedDataIndexes.length;d++)n=this.selectedDataIndexes[d].series,l.push({seriesIndex:n});else n=this.selectedDataIndexes.length>0?this.selectedDataIndexes[0].series:0,l.push({seriesIndex:n});else if("Point"===i)for(var d=0;d<this.selectedDataIndexes.length;d++){o=this.selectedDataIndexes[d].point,n=this.selectedDataIndexes[d].series;var p=e.series[n];r=p.points,isNaN(o)||(s=r[o].xValue,p.type,a=r[o].yValue,"Category"===e.primaryXAxis.valueType?s=r[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(s=new Date(r[o].xValue)),l.push({x:s,y:a,seriesIndex:n,pointIndex:o}))}var u={name:"selectionComplete",selectedDataValues:l,cancel:!1};e.trigger("selectionComplete",u)},r.prototype.selection=function(e,i,r){if("Lasso"!==this.currentMode&&(e.isMultiSelect||-1!==this.currentMode.indexOf("Drag")||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectElements(e,this.selectedDataIndexes,i,e.series)),!t.isNullOrUndefined(r[0])){var o=void 0,n=r[0]&&(r[0].getAttribute("class")||""),a=r[0].parentNode&&(r[0].parentNode.getAttribute("class")||"");""!==n&&"Cluster"!==this.currentMode&&this.findTrackballElements(r,n),r[0]&&n.indexOf(this.getSelectionClass(r[0].id))>-1?this.removeStyles(r):r[0].parentNode&&a.indexOf(this.getSelectionClass(r[0].id))>-1?this.removeStyles([r[0].parentNode]):(this.previousSelectedEle="None"!==e.highlightMode?r:[],this.applyStyles(r),o=!0),this.styleId.indexOf("highlight")>0&&"None"!==e.highlightMode?this.addOrRemoveIndex(this.highlightDataIndexes,i,o):this.addOrRemoveIndex(this.selectedDataIndexes,i,o)}},r.prototype.clusterSelection=function(e,t){this.selection(e,t,this.getClusterElements(e,new Jt(t.series,t.point)))},r.prototype.removeMultiSelectElements=function(e,t,i,r){for(var o,n=0;n<t.length;n++)o=r[t[n].series],(this.isSeriesMode&&!this.toEquals(t[n],i,this.isSeriesMode)||"Cluster"===this.currentMode&&!this.toEquals(t[n],i,!1)||!this.isSeriesMode&&this.toEquals(t[n],i,!0)&&!this.toEquals(t[n],i,!1))&&(this.removeStyles(this.findElements(e,o,t[n])),t.splice(n,1),n--)},r.prototype.blurEffect=function(e,i,r){void 0===r&&(r=!1);for(var o=this.checkVisibility(this.highlightDataIndexes)||this.checkVisibility(this.selectedDataIndexes),n=0,a=i;n<a.length;n++){var s=a[n];s.visible&&(this.checkSelectionElements(he(e+"SeriesGroup"+s.index),this.generateStyle(s),o,r,s.index),t.isNullOrUndefined(he(e+"SymbolGroup"+s.index))||this.checkSelectionElements(he(e+"SymbolGroup"+s.index),this.generateStyle(s),o,r,s.index))}},r.prototype.checkSelectionElements=function(e,t,i,r,o){var n=this.isSeriesMode?[e]:e.childNodes;"None"!==this.chart.selectionMode&&"None"!==this.chart.highlightMode&&(n=e.children);for(var a,s,l,h=e,c=0;c<n.length;c++)a=n[c].getAttribute("class")||"",s=n[c].parentNode.getAttribute("class")||"","None"!==this.chart.selectionMode&&"None"!==this.chart.highlightMode&&(t=a.indexOf("selection")>0||a.indexOf("highlight")>0?a:t,t=s.indexOf("selection")>0||s.indexOf("highlight")>0?s:t),-1===a.indexOf(t)&&-1===s.indexOf(t)&&i?this.addSvgClass(n[c],this.unselected):(h=n[c],this.removeSvgClass(n[c],this.unselected),this.removeSvgClass(n[c].parentNode,this.unselected)),n[c].id.indexOf("Trackball")>0&&h.classList[0]===t&&(this.removeSvgClass(n[c],this.unselected),this.removeSvgClass(n[c].parentNode,this.unselected),this.addSvgClass(n[c],t));if(e.id.indexOf("Symbol")>-1&&e.querySelectorAll("."+t)[0]&&e.querySelectorAll("."+t)[0].getAttribute("class")===t){var d=he(this.control.element.id+"_Series_"+e.id[e.id.length-1]);(d&&d.hasAttribute("class")?d.getAttribute("class"):"").indexOf(this.unselected)>-1&&this.removeSvgClass(d,this.unselected)}this.control.legendModule&&this.control.legendSettings.visible&&(l=he(this.control.element.id+"_chart_legend_shape_"+o))&&(l.hasAttribute("class")&&this.removeSvgClass(l,l.getAttribute("class")),a=h.getAttribute("class")||"",s=h.parentNode.getAttribute("class")||"",-1===a.indexOf(t)&&-1===s.indexOf(t)&&i?(this.addSvgClass(l,this.unselected),this.removeSvgClass(l,t)):(this.removeSvgClass(l,this.unselected),""===a&&""===s||"EJ2-Trackball"===a.trim()?this.removeSvgClass(l,t):this.addSvgClass(l,t)),r&&s.indexOf(t)>-1&&this.addSvgClass(l,t))},r.prototype.applyStyles=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&(this.removeSvgClass(r.parentNode,this.unselected),this.removeSvgClass(r,this.unselected),this.addSvgClass(r,this.getSelectionClass(r.id)))}},r.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.series[this.indexFinder(e).series])},r.prototype.removeStyles=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&this.removeSvgClass(r,this.getSelectionClass(r.id))}},r.prototype.addOrRemoveIndex=function(e,t,i){for(var r=0;r<e.length;r++)this.toEquals(e[r],t,this.isSeriesMode)&&(e.splice(r,1),r--);i&&e.push(t)},r.prototype.toEquals=function(e,t,i){return(e.series===t.series||"Cluster"===this.currentMode&&!i)&&(i||e.point===t.point)},r.prototype.redrawSelection=function(e,i,r){this.isSeriesMode="Series"===i,t.isNullOrUndefined(i)||(-1!==i.indexOf("Drag")||"Lasso"===i||r?e.isRedrawSelection=!1:e.isRedrawSelection=!0);var o=t.extend([],this.selectedDataIndexes,null,!0),n=t.extend([],this.highlightDataIndexes,null,!0);this.styleId.indexOf("highlight")>0&&n.length>0?(this.removeSelectedElements(e,this.highlightDataIndexes,e.series),o=n):this.removeSelectedElements(e,this.selectedDataIndexes,e.series),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(e,o)},r.prototype.legendSelection=function(e,i,r){var o=r.target;if("mousemove"===r.type){if(r.target.id.indexOf("text")>1&&(o=he(r.target.id.replace("text","shape"))),o.hasAttribute("class")&&(o.getAttribute("class").indexOf("highlight")>-1||o.getAttribute("class").indexOf("selection")>-1))return;this.currentMode=this.chart.highlightMode}if(this.isAlreadySelected(r)){var n=this.generateStyle(e.visibleSeries[i]),a=document.querySelectorAll("."+n);this.isSeriesMode="Series"===this.currentMode;if(a.length>0)this.removeSelection(e,i,a,n,!0);else{for(var s=0,l=e.visibleSeries;s<l.length;s++){var h=l[s];h.index===i||e.isMultiSelect||(n=this.generateStyle(e.visibleSeries[h.index]),a=document.querySelectorAll("."+n),this.removeSelection(e,i,a,n,!0))}for(var c=this.getSeriesElements(e.visibleSeries[i]),d=0,p=c;d<p.length;d++){var u=p[d];if(t.isNullOrUndefined(u))return;this.checkSelectionElements(u,n,!1,!0,i)}this.isSeriesMode=!0,this.selection(e,new Jt(i,NaN),c),this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries,!0)}}},r.prototype.removeSelection=function(e,t,i,r,o){if(i.length>0){for(var n=[],a=0;a<i.length;a++)n.push(i[a]);this.removeStyles(n),this.isSeriesMode=!0,this.addOrRemoveIndex(this.selectedDataIndexes,new Jt(t,NaN));for(var s=0,l=e.visibleSeries;s<l.length;s++){var h=l[s];if(r=this.generateStyle(h),document.querySelectorAll("."+r).length>0){for(var c=0,d=n;c<d.length;c++){var p=d[c];this.checkSelectionElements(p,r,!0,!0,t)}o=!1;break}}o&&(this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries))}},r.prototype.getSeriesElements=function(e){var t=[e.seriesElement];return e.marker.visible&&"Scatter"!==e.type&&"Bubble"!==e.type&&!e.isRectSeries&&t.push(e.symbolElement),t},r.prototype.indexFinder=function(e){var t=["NaN","NaN"];return e.indexOf("SeriesGroup")>-1?(t=e.split("SeriesGroup"))[0]=t[1]:e.indexOf("SymbolGroup")>-1?(t=e.split("SymbolGroup"))[0]=t[1]:e.indexOf("_Point_")>-1?t=e.split("_Series_")[1].split("_Point_"):e.indexOf("_Series_")>-1?t[0]=e.split("_Series_")[1]:e.indexOf("_chart_legend_shape_")>-1&&((t=e.split("_chart_legend_shape_"))[0]=t[1]),new Jt(parseInt(t[0],10),parseInt(t[1],10))},r.prototype.calculateDragSelectedElements=function(e,t,r){this.removeSelectedElements(e,this.selectedDataIndexes,e.series);var o="Lasso"===e.selectionMode,n=new i.Rect(t.x,t.y,t.width,t.height),a=new Vi(e.chartAxisLayoutPanel.seriesClipRect.x,e.chartAxisLayoutPanel.seriesClipRect.y);this.removeOffset(n,a);var s,l,h=[],c=[];this.isSeriesMode=!1;var d=e.allowMultiSelection&&(this.rectGrabbing||this.resizing);if(this.rectPoints=this.dragRectArray[d?this.targetIndex:this.count]=new i.Rect(t.x,t.y,t.width,t.height),t.width&&t.height&&!r){var p=new i.Rect(t.x,t.y,t.width,t.height);this.removeOffset(p,a),this.filterArray[d?this.targetIndex:this.count]=p}for(var u=this,g=0,y=e.visibleSeries;g<y.length;g++)!function(t){if(t.visible){s=t.points,h=[];var i,r;!e.isTransposed&&-1===t.type.indexOf("Bar")||e.isTransposed&&-1!==t.type.indexOf("Bar")?(i=t.xAxis.rect.x-a.x,r=t.yAxis.rect.y-a.y):(i=t.xAxis.rect.y-a.y,r=t.yAxis.rect.x-a.x);for(var o=0;o<s.length;o++){var d=(t.type,s[o].yValue),p=void 0,g=s[o].xValue;"Category"===e.primaryXAxis.valueType?g=s[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(g=new Date(s[o].xValue)),(p="BoxAndWhisker"===t.type?s[o].regions.some(function(e){return j(e.x+i,e.y+r,n)}):"Lasso"===e.selectionMode?s[o].isSelect:e.allowMultiSelection?u.isPointSelect(s[o],i,r,u.filterArray):s[o].symbolLocations.some(function(e){return e&&j(e.x+i,e.y+r,n)}))&&"Indicator"!==t.category&&(l=new Jt(t.index,s[o].index),u.selection(e,l,u.findElements(e,t,l)),h.push({x:g,y:d})),!p||"RangeArea"!==t.type&&"SplineRangeArea"!==t.type||h.push({x:g,y:s[o].regions[0].y})}c.push(h)}}(y[g]);this.blurEffect(e.element.id,e.visibleSeries);var m=o?e.mouseDownX:t.x+t.width,v=o?e.mouseDownY:t.y;r||this.createCloseButton(m,v);var f={name:"dragComplete",selectedDataValues:c,cancel:!1};e.trigger("dragComplete",f)},r.prototype.removeOffset=function(e,t){e.x-=t.x,e.y-=t.y},r.prototype.isPointSelect=function(e,t,i,r){for(var o=e.symbolLocations[0],n=0,a=r;n<a.length;n++){var s=a[n];if(s&&o&&j(o.x+t,o.y+i,s))return!0}return!1},r.prototype.drawDraggingRect=function(e,r,o){var n=e.chartAxisLayoutPanel.seriesClipRect,a=e.chartArea.border.width,s=e.themeStyle.selectionRectFill,l=e.themeStyle.selectionRectStroke,h="Lasso"===e.selectionMode;switch(this.isdrawRect&&(n.x=n.x-a/2,n.y=n.y-a/2,n.width=n.width+a,n.height=n.height+a,this.isdrawRect=!1),e.selectionMode){case"DragX":r.y=n.y,r.height=n.height;break;case"DragY":r.x=n.x,r.width=n.width}if((r.width<5||r.height<5)&&!h)return null;var c=e.selectionMode.indexOf("Drag")>-1||"Lasso"===e.selectionMode;if(e.allowMultiSelection&&c){var d=void 0,p=void 0,u=he(this.multiRectGroup);if(u||(u=e.svgRenderer.createGroup({id:this.multiRectGroup}),e.svgObject.appendChild(u)),this.rectGrabbing||this.resizing){var g=void 0;(g=he(this.draggedRect+this.targetIndex)).nextSibling&&t.remove(g.nextSibling),this.setAttributes(g,r)}else if(!he(this.draggedRectGroup+this.count)){p=e.svgRenderer.createGroup({id:this.draggedRectGroup+this.count});y=document.getElementById(e.element.id+"_series_svg");e.enableCanvas?y.appendChild(p):u.appendChild(p)}"Lasso"!==e.selectionMode?(d=e.svgRenderer.drawRectangle(new Di(this.draggedRect+this.count,s,{color:l,width:1},1,r))).setAttribute("style","cursor:move;"):d=e.svgRenderer.drawPath(new i.PathOption(this.lassoPath+this.count,s,3,l,1,"",this.path)),p||this.rectGrabbing||this.resizing?this.rectGrabbing||this.resizing||p.appendChild(d):he(this.draggedRectGroup+this.count).appendChild(d)}else{d=he(h?this.lassoPath:this.draggedRect);if(this.closeIcon&&m(this.closeIconId),d)h?d.setAttribute("d",this.path):this.setAttributes(d,r);else{var p=e.svgRenderer.createGroup({id:this.draggedRectGroup}),y=document.getElementById(e.element.id+"_series_svg");e.enableCanvas?y.appendChild(p):e.svgObject.appendChild(p),d="Lasso"!==e.selectionMode?e.svgRenderer.drawRectangle(new Di(this.draggedRect,s,{color:l,width:1},1,r)):e.svgRenderer.drawPath(new i.PathOption(this.lassoPath,s,3,l,1,"",this.path)),p.appendChild(d)}}},r.prototype.getIndex=function(e){var t;for(t=e.length-1;t>0;t--){var i=Number(e[t]);if(isNaN(i))break}return+e.substr(t+1,e.length-1)},r.prototype.createCloseButton=function(e,t){var i=this.chart.allowMultiSelection,r=this.chart.themeStyle.selectionCircleStroke,o=this.rectGrabbing||this.resizing,n=this.chart.svgRenderer.createGroup({id:this.closeIconId+(i?o?this.targetIndex:this.count:""),style:"cursor:pointer; visibility: visible;"});n.appendChild(this.chart.svgRenderer.drawCircle(new Fi(this.closeIconId+"_circle"+(i?o?this.targetIndex:this.count:""),"#FFFFFF",{color:r,width:1},1,e,t,10)));var a="M "+(e-4)+" "+(t-4)+" L "+(e+4)+" "+(t+4)+" M "+(e-4)+" "+(t+4)+" L "+(e+4)+" "+(t-4);n.appendChild(this.chart.svgRenderer.drawPath({id:this.closeIconId+"_cross"+(i?o?this.targetIndex:this.count:""),d:a,stroke:r,"stroke-width":2,fill:r})),this.closeIcon=n;var s=he(this.draggedRectGroup+(i?o?this.targetIndex:this.count:""));s&&s.appendChild(n)},r.prototype.removeDraggedElements=function(e,r){if(r.target.id.indexOf(this.closeIconId)>-1&&-1===r.type.indexOf("move")){var o=!0;if(e.allowMultiSelection){var n=this.getIndex(r.target.id),a=he(this.multiRectGroup);if(t.remove(he(this.draggedRectGroup+n)),this.dragRectArray[n]=null,this.filterArray[n]=null,this.totalSelectedPoints[n]=null,a&&0===a.childElementCount&&(m(a),this.dragRectArray=[],this.filterArray=[],this.totalSelectedPoints=[]),"Lasso"===this.currentMode){if(null!=this.multiDataIndexes[n])for(h=0;h<this.multiDataIndexes[n].length;h++)this.multiDataIndexes[n][h].isSelect=!1;this.multiDataIndexes[n]=null;for(var s=0;s<this.multiDataIndexes.length;s++)if(null!=this.multiDataIndexes[s]){o=!1;for(var l=0;l<this.multiDataIndexes[s].length;l++)this.multiDataIndexes[s][l].isSelect=!0}this.calculateDragSelectedElements(e,this.dragRect,!0)}else if(this.filterArray.length)for(var h=0;h<this.filterArray.length;h++)this.filterArray[h]&&(o=!1,this.calculateDragSelectedElements(e,this.filterArray[h],!0));else this.calculateDragSelectedElements(e,new i.Rect(0,0,0,0),!0)}else t.remove(he(this.draggedRectGroup)),this.removeSelectedElements(e,this.selectedDataIndexes,e.series);this.blurEffect(e.element.id,e.visibleSeries),this.changeCursorStyle(!1,e.svgObject,"auto"),e.allowMultiSelection&&!o||(this.rectPoints=null)}},r.prototype.resizingSelectionRect=function(e,t,r,o){var n;if(e.allowMultiSelection&&o.id.indexOf("_ej2_drag_rect")>-1||this.dragRectArray[this.targetIndex]){o.id.indexOf("_ej2_drag_rect")>-1&&(this.targetIndex=this.getIndex(o.id));var a=this.dragRectArray[this.targetIndex];n=new i.Rect(a.x,a.y,a.width,a.height)}if(e.allowMultiSelection||(n=new i.Rect(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height)),n){var s=this.findResizeMode(e.svgObject,n,t);this.resizing&&(n=xe(n.x,n.y,n.x+n.width,n.y+n.height,e.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(e,n),this.dragRect=n),r&&(this.resizing=s)}},r.prototype.findResizeMode=function(e,t,r){var o="se-resize",n=!1;if(this.resizing){var a=t.x,s=t.y,l=r.x-a,h=r.y-s;switch(this.resizeMode){case 0:h=Math.abs(t.height+t.y-r.y),t.y=Math.min(t.height+t.y,r.y),t.height=h;break;case 1:l=Math.abs(t.width+t.x-r.x),t.x=Math.min(t.width+t.x,r.x),t.width=l;break;case 2:t.height=Math.abs(h),t.y=Math.min(r.y,s);break;case 3:t.width=Math.abs(l),t.x=Math.min(r.x,a);break;case 4:t.width=Math.abs(l),t.height=Math.abs(h),t.x=Math.min(r.x,a),t.y=Math.min(r.y,s)}}else for(var c=[new i.Rect(t.x,t.y,t.width-5,5),new i.Rect(t.x,t.y,5,t.height),new i.Rect(t.x,t.y+t.height-5,t.width-5,5),new i.Rect(t.x+t.width-5,t.y+5,5,t.height-15),new i.Rect(t.x+t.width-10,t.y+t.height-10,10,10)],d=0;d<c.length;d++)if(j(r.x,r.y,c[d])){o=4===d?o:d%2==0?"ns-resize":"ew-resize",n=!0,this.resizeMode=d;break}return"Lasso"!==this.currentMode&&this.changeCursorStyle(n,he(this.chart.allowMultiSelection?this.draggedRect+this.targetIndex:this.draggedRect),o),this.changeCursorStyle(n,e,o),n},r.prototype.changeCursorStyle=function(e,t,i){i=e?i:this.control.svgObject===t?"auto":"move",t&&t.setAttribute("style","cursor:"+i+";")},r.prototype.removeSelectedElements=function(e,t,i){t=e.isRedrawSelection?t:t.splice(0,t.length);for(var r,o=0,n=i;o<n.length;o++){var a=n[o];r=this.getSeriesElements(a),this.removeStyles(r);for(var s=0,l=r;s<l.length;s++){var h=l[s];this.removeStyles(this.getChildren(h))}}},r.prototype.setAttributes=function(e,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var o=r[i];e.setAttribute(o,t[o])}},r.prototype.draggedRectMoved=function(e,t,r,o){var n;if((this.resizing||this.rectGrabbing)&&e.allowMultiSelection){var a=this.dragRectArray[this.targetIndex];n=new i.Rect(a.x,a.y,a.width,a.height)}else n=new i.Rect(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height);n.x-=t.x-e.mouseX,n.y-=t.y-e.mouseY,n=xe(n.x,n.y,n.x+n.width,n.height+n.y,e.chartAxisLayoutPanel.seriesClipRect),r?this.drawDraggingRect(e,n,o):this.calculateDragSelectedElements(e,n)},r.prototype.completeSelection=function(e){var t=this.chart;"None"!==t.selectionMode&&(this.currentMode=t.selectionMode,(this.dragging||this.resizing)&&this.dragRect.width>5&&this.dragRect.height>5?this.calculateDragSelectedElements(t,this.dragRect):!t.allowMultiSelection&&this.rectGrabbing&&this.rectPoints.width&&this.rectPoints.height?this.draggedRectMoved(t,this.dragRect):this.rectGrabbing&&this.dragRectArray[this.targetIndex].width&&this.dragRectArray[this.targetIndex].height&&this.draggedRectMoved(t,this.dragRect),"Lasso"===t.selectionMode&&this.dragging&&this.path&&-1!==this.path.indexOf("L")&&(t.allowMultiSelection?he(this.lassoPath+this.count)&&(he(this.lassoPath+this.count).setAttribute("d",this.path+"Z"),this.pointChecking(he(this.lassoPath+this.count))):(he(this.lassoPath).setAttribute("d",this.path+"Z"),this.pointChecking(he(this.lassoPath))),(this.dragging||this.resizing)&&this.calculateDragSelectedElements(t,this.dragRect)),this.dragging=!1,this.rectGrabbing=!1,this.resizing=!1,this.removeDraggedElements(t,e))},r.prototype.getDragRect=function(e,t){return xe(e.mouseDownX,e.mouseDownY,e.mouseX,e.mouseY,t)},r.prototype.dragStart=function(e,t,r,o,n){var a=e.selectionMode;this.currentMode=e.selectionMode,this.dragging=(a.indexOf("Drag")>-1||"Lasso"===a)&&(e.isDoubleTap||!e.isTouch)&&"PolarRadar"!==e.chartAreaType;var s=n.target;if(this.path=void 0,this.dragging&&(this.count=he(this.multiRectGroup)?this.count+1:0,this.dragRect=new i.Rect(e.mouseDownX,e.mouseDownY,0,0),(e.mouseDownX<t.x||e.mouseDownX>t.x+t.width||e.mouseDownY<t.y||e.mouseDownY>t.y+t.height)&&(this.dragging=!1)),"Lasso"===a)for(var l=0,h=e.visibleSeries;l<h.length;l++){var c=h[l];if(c.visible)for(var d=0,p=c.points;d<p.length;d++){var u=p[d];e.allowMultiSelection||(u.isSelect=!1)}}if("Lasso"!==a&&(this.rectPoints&&!e.allowMultiSelection&&(this.dragRect=new i.Rect(e.mouseDownX,e.mouseDownY,0,0),this.resizingSelectionRect(e,new Vi(r,o),!0),this.rectGrabbing=j(r,o,this.rectPoints)),e.allowMultiSelection)){var g=this.getIndex(s.id);this.targetIndex=this.isDragRect(s.id)?g:void 0,this.dragRectArray.length&&this.isDragRect(s.id)&&(this.resizingSelectionRect(e,new Vi(r,o),!0,s),this.rectGrabbing=j(r,o,this.dragRectArray[g]))}},r.prototype.isDragRect=function(e){return e.indexOf("_ej2_drag_rect")>-1},r.prototype.mouseMove=function(e){var i=this.chart,r=e.target;if("None"!==i.highlightMode&&!t.isNullOrUndefined(r)){if(e.target.id.indexOf("text")>1&&(r=he(e.target.id.replace("text","shape"))),r.hasAttribute("class")&&(r.getAttribute("class").indexOf("highlight")>-1||r.getAttribute("class").indexOf("selection")>-1))return;return void this.calculateSelectedElements(e)}"None"!==i.selectionMode&&("touchmove"===e.type&&(t.Browser.isIos||t.Browser.isIos7)&&this.dragging&&e.preventDefault&&e.preventDefault(),j(i.mouseX,i.mouseY,i.chartAxisLayoutPanel.seriesClipRect)?(this.rectGrabbing&&!this.resizing?this.draggedRectMoved(i,this.dragRect,!0,r):this.dragging&&!this.resizing&&("Lasso"===i.selectionMode?(this.getPath(i.mouseDownX,i.mouseDownY,i.mouseX,i.mouseY),this.drawDraggingRect(i,this.dragRect,r)):(this.dragRect=this.getDragRect(i,i.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(i,this.dragRect,r))),this.rectPoints&&!i.allowMultiSelection?this.resizingSelectionRect(i,new Vi(i.mouseX,i.mouseY),null,r):(i.allowMultiSelection&&!this.dragging||this.resizing)&&this.resizingSelectionRect(i,new Vi(i.mouseX,i.mouseY),null,r)):this.completeSelection(e))},r.prototype.getPath=function(e,t,i,r){this.dragging&&(this.path?this.path=this.path+" L"+i+" "+r:this.path="M "+e+" "+t)},r.prototype.pointChecking=function(e){var t,i=this,r=this.chart,o=he(r.svgId).getBoundingClientRect(),n=r.chartAxisLayoutPanel.seriesClipRect.x+Math.max(o.left,0),a=r.chartAxisLayoutPanel.seriesClipRect.y+Math.max(o.top,0);this.multiDataIndexes[this.count]=[];for(var s=0,l=r.visibleSeries;s<l.length;s++)l[s].points.filter(function(o){o.symbolLocations&&o.symbolLocations.length&&(t=document.elementFromPoint(o.symbolLocations[0].x+n,o.symbolLocations[0].y+a)),t===e?(o.isSelect=!0,i.chart.allowMultiSelection&&"Lasso"===i.currentMode&&(i.multiDataIndexes[i.count][i.seriesIndex]=o,i.seriesIndex++)):r.allowMultiSelection||(o.isSelect=!1)});this.seriesIndex=0},r.prototype.getModuleName=function(){return"Selection"},r.prototype.destroy=function(){this.removeEventListener()},r}(fn),wn=function(){function e(e){this.isPointDragging=!1,this.chart=e}return e.prototype.pointMouseDown=function(){var e=this.chart,t=new Zi(e),i=t.getData();!i.point||!t.insideRegion&&i.series.isRectSeries||(this.seriesIndex=i.series.index,this.pointIndex=i.point.index,e.series[this.seriesIndex].dragSettings.enable&&!e.zoomModule&&(e.trigger("dragStart",{series:i.series,seriesIndex:this.seriesIndex,pointIndex:this.pointIndex,point:i.point,oldValue:e.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue}),e.isPointMouseDown=!0,e.zoomSettings.enableDeferredZooming=!1))},e.prototype.pointMouseMove=function(e){var t,i=this.chart;"touchmove"===e.type&&e.preventDefault&&e.preventDefault();var r=new Zi(i),o=r.getData();o.series.dragSettings.enable&&o.point&&(r.insideRegion||!o.series.isRectSeries)?this.getCursorStyle(o):i.svgObject.setAttribute("style","cursor: null"),i.isPointMouseDown&&((t=i.series[this.seriesIndex]).type.indexOf("Spline")>-1&&i[G(t.type)+"SeriesModule"].findSplinePoint(t),this.pointDragging(this.seriesIndex,this.pointIndex))},e.prototype.getCursorStyle=function(e){var t=this.chart;"Bar"===e.series.type&&t.isTransposed?t.svgObject.setAttribute("style","cursor:ns-resize"):t.isTransposed||"Bar"===e.series.type?t.svgObject.setAttribute("style","cursor:ew-resize"):t.svgObject.setAttribute("style","cursor:ns-resize")},e.prototype.pointDragging=function(e,i){var r,o,n,a=this.chart,s=[],l=a.visibleSeries[e],h=l.dragSettings,c=l.xAxis,d=l.yAxis,p=l.isRectSeries?1:0,u=W(c,d,a.requireInvertedAxis);"Bar"===l.type?(r=a.isTransposed?u.y+u.height-a.mouseY:a.mouseX-u.x,o=a.isTransposed?u.height:u.width):(r=a.isTransposed?a.mouseX-u.x:u.y+u.height-a.mouseY,o=a.isTransposed?u.width:u.height),n=(n=d.isInversed?1-r/o:r/o)*d.visibleRange.delta+d.visibleRange.min;var g=null!==d.minimum?d.visibleRange.min+p:t.isNullOrUndefined(h.minY)?n:h.minY;if((null!==d.maximum?d.visibleRange.max+p:t.isNullOrUndefined(h.maxY)?n:h.maxY)>=n&&g<=n){l.points[i].yValue=l.points[i].y=a.dragY="Logarithmic"===d.valueType?Math.pow(d.logBase,n):parseFloat(n.toFixed(2)),l.points[i].interior=h.fill;for(var y=0;y<l.points.length;y++)s[y]=l.points[y].yValue;l.yMin=Math.min.apply(null,s),l.yMax=Math.max.apply(null,s),this.isPointDragging=!0,a.refreshBound(),a.trigger("drag",{seriesIndex:e,pointIndex:i,series:l,point:l.points[i],oldValue:a.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:l.points[i].yValue})}},e.prototype.pointMouseUp=function(){var e=this.chart;e.isPointMouseDown&&e.series[this.seriesIndex].dragSettings.enable&&(e.trigger("dragEnd",{series:e.series[this.seriesIndex],point:e.visibleSeries[this.seriesIndex].points[this.pointIndex],seriesIndex:this.seriesIndex,pointIndex:this.pointIndex,oldValue:e.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue}),e.visibleSeries[this.seriesIndex].points[this.pointIndex].y=e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue,e.isPointMouseDown=!1,this.isPointDragging=!1,this.seriesIndex=this.pointIndex=void 0)},e.prototype.getModuleName=function(){return"DataEditing"},e.prototype.destroy=function(){},e}(),Sn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cn=function(e){function i(t){var i=e.call(this,t)||this;return i.chart=t,i.renderer=t.renderer,i.wireEvents(),i}return Sn(i,e),i.prototype.wireEvents=function(){this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning||this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this)},i.prototype.unWireEvents=function(){this.chart.isDestroyed||this.chart.off(t.Browser.touchMoveEvent,this.mouseMove)},i.prototype.declarePrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_highlight",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.highlightDataIndexes=[],this.isSeriesMode="Series"===e.highlightMode},i.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},i.prototype.getModuleName=function(){return"Highlight"},i.prototype.destroy=function(){this.unWireEvents()},i}(xn),Pn=function(){function e(e){this.errorHeight=0,this.chart=e}return e.prototype.initPrivateVariables=function(e,t){var i="",r="",o=e.chart.renderer,n=void 0===e.index?e.category:e.index;"Cartesian"===e.chart.chartAreaType&&(i="translate("+e.clipRect.x+","+e.clipRect.y+")",r="url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+n+")"),t.dataLabel.visible&&(e.shapeElement=o.createGroup({id:this.chart.element.id+"ShapeGroup"+n,transform:i,"clip-path":"url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+n+")"}),e.textElement=o.createGroup({id:this.chart.element.id+"TextGroup"+n,transform:i,"clip-path":r})),this.markerHeight="Scatter"===e.type||t.visible?t.height/2:0,this.commonId=this.chart.element.id+"_Series_"+n+"_Point_",this.calculateErrorHeight(e,e.marker.dataLabel.position),this.chartBackground="transparent"===this.chart.chartArea.background?this.chart.background||this.chart.themeStyle.background:this.chart.chartArea.background},e.prototype.calculateErrorHeight=function(e,t){if(!e.errorBar.visible)return null;if(e.errorBar.visible&&"PolarRadar"!==this.chart.chartAreaType){var i=e.errorBar.direction,r=this.chart.errorBarModule.positiveHeight,o=this.chart.errorBarModule.negativeHeight;this.isRectSeries(e)?("Top"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Minus"===i?o:0),"Outer"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Plus"===i?r:0)):("Top"!==t&&"Outer"!==t&&"Auto"!==t||("Both"!==i&&"Plus"!==i||e.chart.isTransposed?this.errorHeight=0:this.errorHeight=r),"Bottom"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Minus"===i?o:0))}else this.errorHeight=0},e.prototype.isRectSeries=function(e){return e.isRectSeries||"RangeArea"===e.type||"SplineRangeArea"===e.type},e.prototype.render=function(e,r,o){this.initPrivateVariables(e,e.marker);var n,a,s,l,h,c,d,p,u={x:0,y:0};this.inverted=r.requireInvertedAxis,this.yAxisInversed=e.yAxis.isInversed;for(var y,m,v,f=r.redraw,b=!1,x=[],w=r.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections",S=t.createElement("div",{id:w}),C=g(e),P=0;P<C.length;P++){if(y=C[P],!o.showZero&&(0!==y.y||0===y.y&&"Zero"===e.emptyPointSettings.mode))return null;this.margin=o.margin;var L=[],R=void 0,M=void 0,A=void 0,_=void 0,O=void 0,E=!0,I=e.clipRect,z=void 0;b=!1,d=p=o.angle,h={width:o.border.width,color:o.border.color};var D=t.extend({},t.getValue("properties",o.font),null,!0);if(y.symbolLocations.length&&y.symbolLocations[0]||"BoxAndWhisker"===e.type&&y.regions.length){R=(L=Se(y,e,r)).length;for(var B=0;B<R;B++)if(l={cancel:!1,name:"textRender",series:e,point:y,text:L[B],border:h,color:o.fill,template:o.template,font:D,location:u,textSize:i.measureText(L[B],o.font)},r.trigger("textRender",l),!l.cancel)if(this.fontBackground=l.color,this.isDataLabelShape(l),this.markerHeight="Bubble"===e.type?y.regions[0].height/2:this.markerHeight,null!==l.template)this.createDataLabelTemplate(S,e,o,y,l,B,f);else{if(c=i.measureText(l.text,o.font),n=this.calculateTextPosition(y,e,c,o,B),"PolarRadar"===r.chartAreaType)for(var F=0,N=r.chartAxisLayoutPanel.visibleAxisLabelRect;F<N.length;F++){var V=N[F];if(Le(new i.Rect(n.x,n.y,n.width,n.height),V)){E=!1;break}}var j=new i.Rect(n.x+I.x,n.y+I.y,n.width,n.height);if(o.enableRotation){var H=this.getRectanglePoints(n);if(m=n.x+n.width/2,v=n.y+n.height/2,x=k(H,m,v,d),!(b=this.isDataLabelOverlapWithChartBound(x,r,I))){this.chart.rotatedDataLabelCollections.push(x);for(var X=this.chart.rotatedDataLabelCollections.length-1,Y=X;Y>=0;Y--)if(this.chart.rotatedDataLabelCollections[X]&&this.chart.rotatedDataLabelCollections[Y-1]&&T(this.chart.rotatedDataLabelCollections[X],this.chart.rotatedDataLabelCollections[Y-1])){b=!0,this.chart.rotatedDataLabelCollections[X]=null;break}}}else b=Pe(n,r.dataLabelCollections,I);b&&"None"!==o.labelIntersectAction||!E||(r.dataLabelCollections.push(j),this.isShape&&(z=r.renderer.drawRectangle(new Di(this.commonId+y.index+"_TextShape_"+B,l.color,l.border,o.opacity,n,o.rx,o.ry),new Int32Array([I.x,I.y])),e.shapeElement&&e.shapeElement.appendChild(z)),a=Te(_e(this.fontBackground)),s=Math.round((299*a.r+587*a.g+114*a.b)/1e3),M=n.x+this.margin.left+c.width/2+u.x,A=n.y+this.margin.top+3*c.height/4+u.y,u={x:0,y:0},0!==d&&o.enableRotation?(_=m,O=v,p=d>360?d-360:d<-360?d+360:d):(p=0,_=n.x,O=n.y),Ve(r.renderer,new i.TextOption(this.commonId+y.index+"_Text_"+B,M,A,"middle",l.text,"rotate("+p+","+_+","+O+")","auto",p),l.font,l.font.color||(s>=128||"Hilo"===e.type?"black":"white"),e.textElement,!1,f,!0,!1,e.chart.duration,e.clipRect,null,null,r.enableCanvas))}}}S.childElementCount&&(r.enableCanvas?he(r.element.id+"_Secondary_Element").appendChild(S):be(r.enableCanvas,he(r.element.id+"_Secondary_Element"),S,r.redraw,!1,"x","y",null,"",!1,!1,null,r.duration))},e.prototype.getRectanglePoints=function(e){return[new Vi(e.x,e.y),new Vi(e.x+e.width,e.y),new Vi(e.x+e.width,e.y+e.height),new Vi(e.x,e.y+e.height)]},e.prototype.isDataLabelOverlapWithChartBound=function(e,t,i){for(var r=0;r<e.length;r++)if(!j(e[r].x+i.x,e[r].y+i.y,t.initialClipRect))return!0;return!1},e.prototype.createDataLabelTemplate=function(e,i,r,o,n,a,s){this.margin={left:0,right:0,bottom:0,top:0};var l=i.clipRect,h=ue(t.createElement("div",{id:this.chart.element.id+"_Series_"+(void 0===i.index?i.category:i.index)+"_DataLabel_"+o.index+(a?"_"+a:""),styles:"position: absolute;background-color:"+n.color+";"+ge(r.font)+";border:"+n.border.width+"px solid "+n.border.color+";"}),o.index,n.template,this.chart,o,i,this.chart.element.id+"_DataLabel",a);this.calculateTemplateLabelSize(e,h,o,i,r,a,l,s)},e.prototype.calculateTemplateLabelSize=function(e,t,r,o,n,a,s,l,h){var c=ye(t,l,h),d=this.calculateTextPosition(r,o,{width:c.width,height:c.height},n,a),p=!1;h&&(p=0===c.width||0===c.height),t.style.left=("PolarRadar"===this.chart.chartAreaType?0:o.clipRect.x)+d.x-0+"px",t.style.top=("PolarRadar"===this.chart.chartAreaType?0:o.clipRect.y)+d.y+0+"px";var u=Te(_e(this.fontBackground)),g=o.chart.requireInvertedAxis?o.xAxis:o.yAxis,y=o.chart.requireInvertedAxis?o.yAxis:o.xAxis;t.style.color=n.font.color||(Math.round((299*u.r+587*u.g+114*u.b)/1e3)>=128?"black":"white"),t.childElementCount&&!p&&(!Pe(d,this.chart.dataLabelCollections,s)||"None"===n.labelIntersectAction)&&("XY"!==o.seriesType||void 0===r.yValue||x(r.yValue,o.yAxis.visibleRange)||o.type.indexOf("Stacking")>-1||o.type.indexOf("100")>-1&&x(o.stackedValues.endValues[r.index],o.yAxis.visibleRange))&&x(r.xValue,o.xAxis.visibleRange)&&parseFloat(t.style.top)>=g.rect.y&&parseFloat(t.style.left)>=y.rect.x&&parseFloat(t.style.top)<=g.rect.y+g.rect.height&&parseFloat(t.style.left)<=y.rect.x+y.rect.width&&(this.chart.dataLabelCollections.push(new i.Rect(d.x+s.x,d.y+s.y,d.width,d.height)),be(this.chart.enableCanvas,e,t,l,!0,"left","top"),o.animation.enable&&this.chart.animateSeries&&!this.chart.enableCanvas?this.doDataLabelAnimation(o,t):this.chart.enableCanvas&&e.appendChild(t))},e.prototype.calculateTextPosition=function(e,t,i,r,o){var n=o>1&&"Candle"===t.type?e.regions[1]:e.regions[0];o>1&&"HiloOpenClose"===t.type&&(n=2===o?e.regions[1]:e.regions[2]);var a;a=this.getLabelLocation(e,t,i,o);var s=t.clipRect;if(this.chart.requireInvertedAxis&&this.isRectSeries(t)&&"BoxAndWhisker"!==t.type){this.locationY=a.y;l=i.width+this.borderWidth+this.margin.left+this.margin.right-5;a.x="Auto"===r.position?a.x:this.calculateAlignment(l,a.x,r.alignment,e.yValue<0),a.x=this.calculateRectPosition(a.x,n,e.yValue<0!==this.yAxisInversed,r.position,t,i,o,e)}else{this.locationX=a.x;var l=i.height+2*this.borderWidth+this.markerHeight+this.margin.bottom+this.margin.top+5;a.y="Auto"===r.position?a.y:this.calculateAlignment(l,a.y,r.alignment,!!this.isRectSeries(t)&&e.yValue<0),a.y=this.isRectSeries(t)&&"BoxAndWhisker"!==t.type?this.calculateRectPosition(a.y,n,e.yValue<0!==this.yAxisInversed,r.position,t,i,o,e):this.calculatePathPosition(a.y,r.position,t,e,i,o),this.isRectSeries(t)&&"PolarRadar"===this.chart.chartAreaType&&(a=this.calculatePolarRectPosition(a,r.position,t,e,i,o,r.alignment,l))}var h=Me(a,i,this.margin);return!0===r.enableRotation&&0!==r.angle||h.y>s.y+s.height||h.x>s.x+s.width||h.x+h.width<0||h.y+h.height<0||(h.x=h.x<0?5:h.x,h.y=h.y<0&&"None"!==r.labelIntersectAction?5:h.y,h.x-=h.x+h.width>s.x+s.width?h.x+h.width-(s.x+s.width)+5:0,h.y-=h.y+h.height>s.y+s.height?h.y+h.height-(s.y+s.height)+5:0,this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground),h},e.prototype.calculatePolarRectPosition=function(e,t,i,r,o,n,a,s){var l,h=this.chart.availableSize.width,c="Center"===a?0:"Far"===a?1:-1,d=r.regionData.startAngle-.5*Math.PI+(r.regionData.endAngle-r.regionData.startAngle)/2;return l=0===n?r.regionData.radius<r.regionData.innerRadius?r.regionData.innerRadius:r.regionData.radius:r.regionData.radius>r.regionData.innerRadius?r.regionData.innerRadius:r.regionData.radius,this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground,i.drawType.indexOf("Stacking")>-1?t="Outer"===t?"Top":t:i.drawType.indexOf("Range")>-1&&(t="Outer"===t||"Top"===t?t:"Auto"),"Outer"===t?l=0===n?l+10+this.markerHeight:l-10-this.markerHeight:"Middle"===t?(l=l/2+5,"StackingColumn"===i.drawType&&(l=r.regionData.innerRadius+(r.regionData.radius-r.regionData.innerRadius)/2+5-o.height/2)):"Top"===t?l=0===n?l-10-this.markerHeight:l+10+this.markerHeight:"Bottom"===t?(l=10,l+="StackingColumn"===i.drawType?r.regionData.innerRadius+this.markerHeight:0):l=0===n?l>=i.chart.radius?l-5:"StackingColumn"===i.drawType?l-10:l+10:l>=i.chart.radius?l+5:l-10,l+=s*c,e.x=i.clipRect.width/2+i.clipRect.x+l*Math.cos(d),"StackingColumn"===i.drawType?e.x=e.x<h/2?e.x+o.width/2:e.x>h/2?e.x-o.width/2:e.x:"Column"===i.drawType&&(e.x=e.x<h/2?e.x-o.width/2:e.x>h/2?e.x+o.width/2:e.x),e.y=i.clipRect.height/2+i.clipRect.y+l*Math.sin(d),e},e.prototype.getLabelLocation=function(e,t,i,r){var o=new Vi(0,0),n="Candle"===t.type&&r>1?e.regions[1]:e.regions[0];"HiloOpenClose"===t.type&&(n=2===r?e.regions[1]:e.regions[2]);var a=t.xAxis,s=t.yAxis,l=t.chart.requireInvertedAxis;if("BoxAndWhisker"===t.type){switch(this.markerHeight=0,r){case 0:o=ve(e.xValue,e.median,a,s,l);break;case 1:o=ve(e.xValue,e.maximum,a,s,l);break;case 2:o=ve(e.xValue,e.minimum,a,s,l);break;case 3:o=ve(e.xValue,e.upperQuartile,a,s,l);break;case 4:o=ve(e.xValue,e.lowerQuartile,a,s,l);break;default:o=ve(e.xValue,e.outliers[r-5],a,s,l),this.markerHeight=t.marker.height/2}l?o.y=e.regions[0].y+e.regions[0].height/2:o.x=e.regions[0].x+e.regions[0].width/2}else o=0===r||1===r?new Vi(e.symbolLocations[0].x,e.symbolLocations[0].y):2!==r&&3!==r||"Candle"!==t.type?l?{x:n.x+n.width/2,y:n.y}:{x:n.x+n.width,y:n.y+n.height/2}:new Vi(e.symbolLocations[1].x,e.symbolLocations[1].y);if(r>1&&"HiloOpenClose"===t.type)if(t.chart.requireInvertedAxis){var h=n.height;o.y=n.y+h/2+2*(2===r?1:-1)}else{var c=n.width;o.x=n.x+c/2+2*(2===r?1:-1)}return o},e.prototype.calculateRectPosition=function(e,t,i,r,o,n,a,s){if("PolarRadar"===o.chart.chartAreaType)return null;var l=this.margin,h=this.inverted?n.width:n.height,c=this.borderWidth+h/2+5;switch("StackingColumn100"===o.type||"StackingBar100"===o.type?r="Outer"===r?"Top":r:o.type.indexOf("Range")>-1?r="Outer"===r||"Top"===r?r:"Auto":"Waterfall"===o.type&&(r="Auto"===r?"Middle":r),r){case"Bottom":e=this.inverted?i?e+t.width-c-l.left:e-t.width+c+l.right:i?e-t.height+c+l.top:e+t.height-c-l.bottom;break;case"Middle":e=e=this.inverted?i?e+t.width/2:e-t.width/2:i?e-t.height/2:e+t.height/2;break;case"Auto":e=this.calculateRectActualPosition(e,t,i,o,n,a,s);break;default:c+=this.errorHeight,e=this.calculateTopAndOuterPosition(e,t,r,o,a,c,i)}var d=this.inverted?e<t.x||e>t.x+t.width:e<t.y||e>t.y+t.height;this.fontBackground=d?"transparent"===this.fontBackground?this.chartBackground:this.fontBackground:"transparent"===this.fontBackground?s.color||o.interior:this.fontBackground;var p=o.chart.series.length;if("Outer"===r&&o.type.indexOf("Stacking")>-1&&p-1>o.index)for(var u=void 0,g=void 0,y=o.index+1;y<p;y++)if(u=o.chart.series[y],g=u.points[s.index],u.type.indexOf("Stacking")>-1&&-1===u.type.indexOf("100")){this.fontBackground=g&&(g.yValue<0&&s.yValue<0||g.yValue>0&&s.yValue>0)?g?g.color:u.interior:this.fontBackground;break}return e},e.prototype.calculatePathPosition=function(e,t,i,r,o,n){switch(i.type.indexOf("Area")>-1&&"RangeArea"!==i.type&&"SplineRangeArea"!==i.type&&this.yAxisInversed&&"Auto"!==i.marker.dataLabel.position&&(t="Top"===t?"Bottom":"Bottom"===t?"Top":t),this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground,t){case"Top":case"Outer":e=e-this.markerHeight-this.borderWidth-o.height/2-this.margin.bottom-5-this.errorHeight;break;case"Bottom":e=e+this.markerHeight+this.borderWidth+o.height/2+this.margin.top+5+this.errorHeight;break;case"Auto":e=this.calculatePathActualPosition(e,this.markerHeight,i,r,o,n)}return e},e.prototype.isDataLabelShape=function(e){this.isShape="transparent"!==e.color||e.border.width>0,this.borderWidth=e.border.width,this.isShape||(this.margin={left:0,right:0,bottom:0,top:0})},e.prototype.calculateRectActualPosition=function(e,t,i,r,o,n,a){for(var s,l,h=!0,c=0,d=this.chart.dataLabelCollections,p=-1!==r.type.indexOf("Range")||"Hilo"===r.type?2:4;h&&c<p;){var u=this.getPosition(c);r.type.indexOf("Stacking")>-1&&"Outer"===u&&(u="Top",c++),s=this.calculateRectPosition(e,t,i,u,r,o,n,a),h=this.inverted?(l=Me(new Vi(s,this.locationY),o,this.margin)).x<0||Pe(l,d,r.clipRect)||l.x+l.width>r.clipRect.width:(l=Me(new Vi(this.locationX,s),o,this.margin)).y<0||Pe(l,d,r.clipRect)||l.y>r.clipRect.height,c++}return s},e.prototype.calculateAlignment=function(e,t,i,r){switch(i){case"Far":t=this.inverted?r?t-e:t+e:r?t+e:t-e;break;case"Near":t=this.inverted?r?t+e:t-e:r?t-e:t+e;break;case"Center":t=t}return t},e.prototype.calculateTopAndOuterPosition=function(e,t,i,r,o,n,a){var s,l=this.margin;switch(r.type){case"RangeColumn":case"RangeArea":case"SplineRangeArea":case"Hilo":s=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s);break;case"Candle":s=(0===o||2===o)&&!this.yAxisInversed||(1===o||3===o)&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s,o>1);break;case"HiloOpenClose":o<=1?(s=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s)):e=this.yAxisInversed?this.inverted?e-n-l.right:e+n+l.top:this.inverted?e+n+l.left:e-n-l.bottom;break;default:e=a&&"Top"===i||!a&&"Outer"===i?this.inverted?e+n+l.left+this.markerHeight:e-n-l.bottom-this.markerHeight:this.inverted?e-n-l.right-this.markerHeight:e+n+l.top+this.markerHeight}return e},e.prototype.updateLabelLocation=function(e,t,i,r,o,n,a){return void 0===a&&(a=!1),t=this.inverted?n?"Outer"!==e||a?t-i-r.right-this.markerHeight:t+i+r.left+this.markerHeight:"Outer"!==e||a?t-o.width+i+r.left+this.markerHeight:t-o.width-i-r.right-this.markerHeight:n?"Outer"!==e||a?t+i+r.top+this.markerHeight:t-i-r.bottom-this.markerHeight:"Outer"!==e||a?t+o.height-i-r.bottom-this.markerHeight:t+o.height+i+r.top+this.markerHeight},e.prototype.calculatePathActualPosition=function(e,t,i,r,o,n){var a,s,l,h,c,d=i.points,p=r.index,u=d[p].yValue,g=d.length-1>p?d[p+1]:null,y=p>0?d[p-1]:null,m=!0,v=this.chart.dataLabelCollections;if("Bubble"===i.type)a="Top";else if(i.type.indexOf("Step")>-1)a="Top",p&&(a=y&&y.visible&&u>y.yValue===this.yAxisInversed&&u!==y.yValue?"Bottom":"Top");else if("BoxAndWhisker"===i.type)1===n||3===n||n>4?a=i.yAxis.isInversed?"Bottom":"Top":2===n||4===n?a=i.yAxis.isInversed?"Top":"Bottom":(m=!1,a="Middle",s=this.calculatePathPosition(e,a,i,r,o,n));else if(0===p)a=!g||!g.visible||u>g.yValue||u<g.yValue&&this.yAxisInversed?"Top":"Bottom";else if(p===d.length-1)a=!y||!y.visible||u>y.yValue||u<y.yValue&&this.yAxisInversed?"Top":"Bottom";else if(g.visible||y&&y.visible)if(g.visible&&y){var f=(g.yValue-y.yValue)/2,b=f*p+(g.yValue-f*(p+1));a=this.yAxisInversed?b<u?"Bottom":"Top":b<u?"Top":"Bottom"}else a=g.yValue>u||y&&y.yValue>u?"Bottom":"Top";else a="Top";for(h="Bottom"===a,c=["Outer","Top","Bottom","Middle","Auto"].indexOf(a);m&&c<4;)s=this.calculatePathPosition(e,this.getPosition(c),i,r,o,n),m=(l=Me(new Vi(this.locationX,s),o,this.margin)).y<0||Pe(l,v,i.clipRect)||l.y+l.height>i.clipRect.height,c=h?c-1:c+1,h=!1;return s},e.prototype.doDataLabelAnimation=function(e,t){for(var i,r=e.shapeElement.childNodes,o=e.textElement.childNodes,n=e.animation.delay+e.animation.duration,a=e.chart.animated?e.chart.duration:200,s=t?1:o.length,l=0;l<s;l++)i=o[l],t?(t.style.visibility="hidden",oe(t,n,a,"ZoomIn")):(Q(i,n,a,e,null,new Vi(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),!0),r[l]&&Q(i=r[l],n,a,e,null,new Vi(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),!0))},e.prototype.getPosition=function(e){return["Outer","Top","Bottom","Middle","Auto"][e]},e.prototype.getModuleName=function(){return"DataLabel"},e.prototype.destroy=function(){},e}(),Ln=function(){function e(e){this.chart=e}return e.prototype.render=function(e){if("PolarRadar"===this.chart.chartAreaType)return null;this.createElement(e,this.chart),this.renderErrorBar(e)},e.prototype.renderErrorBar=function(e){for(var t,r,o=e.index,n=e.errorBar,a=e.errorBar.errorBarCap,s=["",""],l=e.chart.redraw,h=0,c=e.points;h<c.length;h++){var d=c[h];if(d.visible&&d.symbolLocations[0]){var p=0,u=0;switch(n.mode){case"Vertical":u=n.verticalError;break;case"Horizontal":p=n.horizontalError;break;case"Both":p=n.horizontalError,u=n.verticalError}s=this["calculate"+n.type+"Value"](d,e,this.chart.requireInvertedAxis,p,u),t=this.chart.element.id+"_Series__ErrorBarGroup_"+o+"_Point_"+d.index,r=this.chart.element.id+"_Series__ErrorBarCap_"+o+"_Point_"+d.index;var g=new i.PathOption(t,"",n.width,n.color||this.chart.themeStyle.errorBar,null,"",s[0]),y=he(g.id),m=y?y.getAttribute("d"):null;e.errorBarElement.appendChild(this.chart.renderer.drawPath(g)),J(y,s[0],l,m);var v=new i.PathOption(r,"",a.width,a.color||this.chart.themeStyle.errorBar,null,"",s[1]);m=(y=he(v.id))?y.getAttribute("d"):null,be(this.chart.enableCanvas,e.errorBarElement,this.chart.renderer.drawPath(v),l),J(y,s[1],l,m)}}},e.prototype.findLocation=function(e,t,i,r,o){var n=t.errorBar,a=n.direction,s=[],l=t.type.indexOf("Stacking")>-1?t.stackedValues.endValues[e.index]:"HighLow"===t.seriesType||"HighLowOpenClose"===t.seriesType?t.points[e.index].high:e.yValue,h=ve(e.xValue+("Plus"===a||"Both"===a?"Custom"!==n.type||"Horizontal"!==n.mode&&"Both"!==n.mode?r:r=n.horizontalPositiveError:0),l+("Plus"===a||"Both"===a?"Custom"!==n.type||"Vertical"!==n.mode&&"Both"!==n.mode?o:o=n.verticalPositiveError:0),t.xAxis,t.yAxis,i);if(s.push(h),t.isRectSeries){c=e.symbolLocations[0];s.push(c)}else{var c=ve(e.xValue,e.yValue,t.xAxis,t.yAxis,i);s.push(c)}var d=ve(e.xValue-("Minus"===a||"Both"===a?"Custom"!==n.type||"Horizontal"!==n.mode&&"Both"!==n.mode?r:r=n.horizontalNegativeError:0),l-("Minus"===a||"Both"===a?"Custom"!==n.type||"Vertical"!==n.mode&&"Both"!==n.mode?o:o=n.verticalNegativeError:0),t.xAxis,t.yAxis,i);return s.push(d),e.error="Vertical"===n.mode?n.verticalError:n.horizontalError,this.negativeHeight="Vertical"===n.mode||"Both"===n.mode?i?s[1].x-s[2].x:s[2].y-s[1].y:0,this.positiveHeight="Vertical"===n.mode||"Both"===n.mode?i?s[0].x-s[1].x:s[1].y-s[0].y:0,this.getErrorDirection(s[0],s[1],s[2],t,i)},e.prototype.calculateFixedValue=function(e,t,i,r,o,n,a){t.errorBar;return this.findLocation(e,t,i,r,o)},e.prototype.calculatePercentageValue=function(e,t,i,r,o,n,a){return r=r/100*e.xValue,o=o/100*e.yValue,this.findLocation(e,t,i,r,o)},e.prototype.calculateStandardDeviationValue=function(e,t,i,r,o,n,a){var s=this.meanCalculation(t,t.errorBar.mode);return r*=s.horizontalSquareRoot+s.horizontalMean,o*=s.verticalSquareRoot+s.verticalMean,this.findLocation(e,t,i,r,o)},e.prototype.calculateStandardErrorValue=function(e,t,i,r,o,n,a){var s=t.points.length,l=this.meanCalculation(t,t.errorBar.mode);return r=r*l.horizontalSquareRoot/Math.sqrt(s),o=o*l.verticalSquareRoot/Math.sqrt(s),this.findLocation(e,t,i,r,o)},e.prototype.calculateCustomValue=function(e,t,i,r,o,n,a){t.errorBar;return this.findLocation(e,t,i,r,o)},e.prototype.getHorizontalDirection=function(e,t,i,r,o,n){var a="",s="";return a+="M "+e.x+" "+t.y+" L "+i.x+" "+t.y,s+="Plus"===r||"Both"===r?"M "+e.x+" "+(t.y-n)+" L "+e.x+" "+(t.y+n):"",s+="Minus"===r||"Both"===r?"M "+i.x+" "+(t.y-n)+" L "+i.x+" "+(t.y+n):" ",[a,s]},e.prototype.getVerticalDirection=function(e,t,i,r,o,n){var a="",s="";return a+="M "+t.x+" "+e.y+" L "+t.x+" "+i.y,s+="Plus"===r||"Both"===r?"M "+(t.x-n)+" "+e.y+" L "+(t.x+n)+" "+e.y:"",s+="Minus"===r||"Both"===r?"M "+(t.x-n)+" "+i.y+" L "+(t.x+n)+" "+i.y:"",[a,s]},e.prototype.getBothDirection=function(e,t,i,r,o,n){var a="",s="",l=this.getHorizontalDirection(e,t,i,r,o,n),h=this.getVerticalDirection(e,t,i,r,o,n);return s=l[0].concat(h[0]),a=l[1].concat(h[1]),[s,a]},e.prototype.getErrorDirection=function(e,t,i,r,o){var n,a=r.errorBar.direction,s=r.errorBar.mode,l=r.errorBar.errorBarCap.length,h=s;switch(s){case"Both":h=s;break;case"Horizontal":h=o?"Vertical":s;break;case"Vertical":h=o?"Horizontal":s}switch(h){case"Horizontal":n=this.getHorizontalDirection(e,t,i,a,h,l);break;case"Vertical":n=this.getVerticalDirection(e,t,i,a,h,l);break;case"Both":n=this.getBothDirection(e,t,i,a,h,l)}return[n[0],n[1]]},e.prototype.meanCalculation=function(e,t){var i=0,r=0,o=0,n=0,a=e.points.length;switch(t){case"Vertical":o=(r=C(e.yData))/a;break;case"Horizontal":n=(i=C(e.xData))/a;break;case"Both":o=(r=C(e.yData))/a,n=(i=C(e.xData))/a}for(var s=0,l=e.points;s<l.length;s++){var h=l[s];"Vertical"===t?r+=Math.pow(h.yValue-o,2):"Horizontal"===t?i+=Math.pow(h.xValue-n,2):(r+=Math.pow(h.yValue-o,2),i+=Math.pow(h.xValue-n,2))}var c=r/(a-1),d=Math.sqrt(r/(a-1)),p=i/(a-1),u=Math.sqrt(i/(a-1));return new Oi(c,d,p,u,o,n)},e.prototype.createElement=function(e,t){var i="Cartesian"===t.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"",r=(e.marker.height+5)/2,o=(e.marker.width+5)/2;if("Cartesian"===t.chartAreaType){var n=new Di(t.element.id+"_ChartErrorBarClipRect_"+e.index,"transparent",{width:1,color:"Gray"},1,{x:-o,y:-r,width:e.clipRect.width+2*o,height:e.clipRect.height+2*r});e.errorBarElement=t.renderer.createGroup({id:t.element.id+"ErrorBarGroup"+e.index,transform:i,"clip-path":"url(#"+t.element.id+"_ChartErrorBarClipRect_"+e.index+")"}),e.errorBarElement.appendChild(K(t.redraw,n,t.renderer))}},e.prototype.doErrorBarAnimation=function(e){var t=e.errorBarElement.childNodes;if(!t)return null;for(var i=e.animation.delay+e.animation.duration,r=1;r<t.length;){for(var o=0;o<e.points.length;o++)e.points[o].symbolLocations[0]&&(t[r].style.visibility="hidden",oe(t[r],i,350,e.chart.requireInvertedAxis?"SlideLeftIn":"SlideBottomIn",!1));r++}},e.prototype.getModuleName=function(){return"ErrorBar"},e.prototype.destroy=function(){},e}(),Rn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mn=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return Rn(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this),this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd))},r.prototype.mouseMove=function(e){this.chart.legendSettings.visible&&!this.chart.isTouch&&(this.move(e),this.chart.highlightModule&&"None"!==this.chart.highlightMode&&this.click(e))},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e,t){this.legendCollections=[];var i,r,o=[];e.length>1&&(this.legend.mode="Series");for(var n=0,a=e;n<a.length;n++){var s=a[n];if("Series"===this.legend.mode)"Indicator"!==s.category&&(i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=s.pointColorMapping&&s.points.length>0&&s.points[0].interior?s.points[0].interior:s.interior,this.legendCollections.push(new mr(s.name,r,s.legendShape,"TrendLine"===s.category?this.chart.series[s.sourceIndex].trendlines[s.index].visible:s.visible,i,s.legendImageUrl,s.marker.shape,s.marker.visible)));else if("Point"===this.legend.mode)for(var l=this,h=0,c=s.points;h<c.length;h++)!function(e){i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=e.interior?e.interior:s.interior,0===l.legendCollections.filter(function(t){return t.text===e.x.toString()}).length&&l.legendCollections.push(new mr(e.x.toString(),r,s.legendShape,"TrendLine"===s.category?l.chart.series[s.sourceIndex].trendlines[s.index].visible:e.visible,i,"",s.marker.shape,s.marker.visible))}(u=c[h]);else if("Range"===this.legend.mode)for(var d=0,p=s.points;d<p.length;d++){var u=p[d];i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=u.interior?u.interior:s.interior;var g="Others";if(o.indexOf(r)<0&&(o.push(r),t.rangeColorSettings.length>=1&&1===t.rangeColorSettings[0].colors.length)){for(var y=0,m=t.rangeColorSettings;y<m.length;y++){var v=m[y];v.colors[0]===r&&(g=v.label)}this.legendCollections.push(new mr(g,r,s.legendShape,"TrendLine"===s.category?this.chart.series[s.sourceIndex].trendlines[s.index].visible:u.visible,i,"",s.marker.shape,s.marker.visible))}}else if(0===this.legendCollections.length&&t.rangeColorSettings.length>0){var f=t.rangeColorSettings[0].start.toString(),b=t.rangeColorSettings[t.rangeColorSettings.length-1].end.toString();this.legendCollections.push(new mr(f,s.interior,"Rectangle",!0,i,"",s.marker.shape,s.marker.visible)),this.legendCollections.push(new mr(b,s.interior,"Rectangle",!0,i,"",s.marker.shape,s.marker.visible))}}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t),this.isTitle=!!r.title;var o=r.padding,n=r.titlePosition,a=0,s=0,l=this.arrowWidth,h=this.arrowHeight,c=this.isVertical&&!r.enablePages?h:0,d=this.isTitle&&"Top"===n?this.legendTitleSize.height+this.fivePixel:0;d=this.isTitle&&this.isVertical&&"Top"!==n?this.legendTitleSize.height+this.fivePixel:d,this.isVertical?s=r.width?0:e.width/100*5:a=r.height?0:e.height/100*5,t.height+=a,t.width+=s;var p,u=r.shapeWidth,g=r.shapePadding,y=0,m=0,v=0,f=0,b=0,x=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];si.test(P.text)&&(P.text=We(P.text,si)),li.test(P.text)&&(P.text=We(P.text,li)),p={fill:P.fill,text:P.text,shape:P.shape,markerShape:P.markerShape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",p),P.render=!p.cancel,P.text=p.text,P.fill=p.fill,P.shape=p.shape,P.markerShape=p.markerShape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&(w=!0,m+=v=u+g+P.textSize.width+o,r.enablePages||this.isVertical||(x=this.isTitle&&"Top"!==n?this.legendTitleSize.width+this.fivePixel:0,x+=l),(t.width<o+m+x||this.isVertical)&&(y=Math.max(y,m+o+x-(this.isVertical?0:v)),0===b&&v!==m&&(b=1),m=this.isVertical?0:v,f=++b*(this.maxItemHeight+o)+o+d+c))}f=Math.max(f,this.maxItemHeight+o+o+d),this.isPaging=t.height<f,this.isPaging&&!r.enablePages&&(f=this.isVertical?f:this.maxItemHeight+o+o+("Top"===n?d:0)),this.totalPages=b,this.isPaging||this.isVertical||(m+=this.isTitle&&"Top"!==n?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),w?this.setBounds(Math.max(m+o,y),f,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=this.legend.padding,l=r.location.x+i+r.textSize.width;l+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+s):(e.location.x=n===a?r.location.x:l,e.location.y=r.location.y);var h=this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.LegendClick=function(e,t){var i=this.chart,r="Series"===i.legendSettings.mode?e:0,o=i.visibleSeries[r],n=this.legendCollections[e];if("Series"===i.legendSettings.mode){s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:o.points,name:"legendClick",cancel:!1};this.chart.trigger("legendClick",s),o.legendShape=s.legendShape,null!==o.fill&&(i.visibleSeries[e].interior=o.fill),i.legendSettings.toggleVisibility?("TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible?i.series[o.sourceIndex].trendlines[o.index].visible=!1:i.series[o.sourceIndex].trendlines[o.index].visible=!0:(o.chart.isProtectedOnChange=!0,this.changeSeriesVisiblity(o,o.visible)),n.visible="TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible:o.visible,this.refreshLegendToggle(i,o)):i.selectionModule?i.selectionModule.legendSelection(i,e,t):i.highlightModule&&i.highlightModule.legendSelection(i,e,t),o.chart.isProtectedOnChange=!1}else if("Point"===i.legendSettings.mode){var a=o.points[e],s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:[a],name:"legendClick",cancel:!1};this.chart.trigger("legendClick",s),i.legendSettings.toggleVisibility&&(a.visible=!a.visible,(h=this.legendCollections[e]).visible=a.visible,this.refreshLegendToggle(i,o))}else if("Range"===i.legendSettings.mode){for(var l=[],h=this.legendCollections[e],c=0,d=o.points;c<d.length;c++){a=d[c];h.fill===(a.interior||o.interior)&&l.push(a)}s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:l,name:"legendClick",cancel:!1};if(this.chart.trigger("legendClick",s),i.legendSettings.toggleVisibility){h.visible=!h.visible;for(var p=0,u=l;p<u.length;p++)(a=u[p]).visible=!a.visible;this.refreshLegendToggle(i,o)}}},r.prototype.refreshLegendToggle=function(e,r){var o=[];if(e.selectionModule&&(o=t.extend([],e.selectionModule.selectedDataIndexes,null,!0)),e.svgObject.childNodes.length>0&&!e.enableAnimation&&!e.enableCanvas){for(;e.svgObject.lastChild;)e.svgObject.removeChild(e.svgObject.lastChild);t.remove(e.svgObject)}e.animateSeries=!1,e.redraw=e.enableAnimation,e.rotatedDataLabelCollections=[],m(i.getElement(e.element.id+"_Secondary_Element").querySelectorAll(".ejSVGTooltip")[0]),Ue(e),this.redrawSeriesElements(r,e),e.removeSvg(),e.refreshAxis(),r.refreshAxisLabel(),this.refreshSeries(e.visibleSeries),e.markerRender.removeHighlightedMarker(),e.refreshBound(),e.trigger("loaded",{chart:e}),o.length>0&&(e.selectionModule.selectedDataIndexes=o,e.selectionModule.redrawSelection(e,e.selectionMode)),e.highlightModule&&"None"!==e.highlightMode&&e.highlightModule.redrawSelection(e,e.highlightMode),e.redraw=!1},r.prototype.changeSeriesVisiblity=function(e,t){e.visible=!t,this.isSecondaryAxis(e.xAxis)&&(e.xAxis.internalVisibility=e.xAxis.series.some(function(e){return e.visible})),this.isSecondaryAxis(e.yAxis)&&(e.yAxis.internalVisibility=e.yAxis.series.some(function(e){return e.visible}))},r.prototype.isSecondaryAxis=function(e){return this.chart.axes.indexOf(e)>-1},r.prototype.redrawSeriesElements=function(e,t){if(!t.redraw)return null;m(t.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections")},r.prototype.refreshSeries=function(e){for(var t=0,i=e;t<i.length;t++)i[t].position=void 0},r.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i,r=this.chart.mouseX,o=this.chart.mouseY,n=[],a=e.target.id,s=0,l=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"];s<l.length;s++){var h=l[s];if(a.indexOf(h)>-1){i=parseInt(a.split(h)[1],10),this.LegendClick(i,e);break}}a.indexOf(this.legendID+"_pageup")>-1?this.changePage(e,!0):a.indexOf(this.legendID+"_pagedown")>-1&&this.changePage(e,!1),this.chart.enableCanvas&&this.pagingRegions.length&&this.checkWithinBounds(r,o),(n=this.legendRegions.filter(function(e){return j(r,o+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(null,1,2):0),e.rect)})).length&&this.chart.enableCanvas&&this.LegendClick(n[0].index,e)}},r.prototype.checkWithinBounds=function(e,t){var r=this.chart.renderer,o=this.legendBounds,n=this.chart.legendSettings.border.width,a=new i.Rect(o.x,o.y,o.width,o.height);return a.x=a.x-n/2,a.y=a.y-n/2,a.width=a.width+n,a.height=a.height+n,j(e,t,this.pagingRegions[0])?(--this.currentPageNumber>0?(this.legendRegions=[],r.clearRect(a),r.canvasClip(new Di("legendClipPath","transparent",{width:0,color:""},null,a)),this.renderLegend(this.chart,this.legend,o),r.canvasRestore()):++this.currentPageNumber,null):j(e,t,this.pagingRegions[1])?(++this.currentPageNumber>0&&this.currentPageNumber<=this.totalNoOfPages?(this.legendRegions=[],r.clearRect(a),r.canvasClip(new Di("legendClipPath","transpaent",{width:0,color:""},null,a)),this.renderLegend(this.chart,this.legend,o),r.canvasRestore()):--this.currentPageNumber,null):void 0},r.prototype.getModuleName=function(){return"Legend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),An=function(){function e(e){this.control=e}return e.prototype.render=function(e,i){return this.isChart="chart"===this.control.getModuleName(),this.annotation=e,ue(t.createElement("div",{id:this.control.element.id+"_Annotation_"+i,styles:"position: absolute; z-index: 1"}),i,e.content,this.control)},e.prototype.setAnnotationPixelValue=function(e){var t="Chart"===this.annotation.region?new i.Rect(0,0,this.control.availableSize.width,this.control.availableSize.height):this.isChart?this.control.chartAxisLayoutPanel.seriesClipRect:this.control.series[0].accumulationBound;return e.x=("string"!=typeof this.annotation.x?"number"==typeof this.annotation.x?this.annotation.x:0:Be(this.annotation.x,t.width))+t.x,e.y=("number"==typeof this.annotation.y?this.annotation.y:Be(this.annotation.y,t.height))+t.y,!0},e.prototype.setAnnotationPointValue=function(e){var t=new Vi(0,0);if(this.isChart){for(var i=this.control,o=this.annotation,n=o.xAxisName,a=o.yAxisName,s=i.requireInvertedAxis,l=this.control.stockChart,h=void 0,c=void 0,d=void 0,p=0,u=i.axisCollections;p<u.length;p++){var g=u[p];if(n===g.name||null==n&&"primaryXAxis"===g.name)if((h=g).valueType.indexOf("Category")>-1){var y="DateTimeCategory"===h.valueType?o.x.getTime().toString():o.x;if(h.labels.indexOf(y)<0)return!1;d=h.labels.indexOf(y)}else if("DateTime"===h.valueType){var m={skeleton:"full",type:"dateTime"};d="object"==typeof this.annotation.x||"object"==typeof new Date(this.annotation.x)?Date.parse(i.intl.getDateParser(m)(i.intl.getDateFormat(m)(new Date(r.DataUtil.parse.parseJson({val:o.x}).val)))):0}else d=+o.x;else(a===g.name||null==a&&"primaryYAxis"===g.name)&&(c=g)}return!!(h&&c&&x("Logarithmic"===h.valueType?v(d,h.logBase):d,h.visibleRange)&&x("Logarithmic"===c.valueType?v(+o.y,c.logBase):+o.y,c.visibleRange))&&(t=ve(d,+o.y,h,c,s),e.x=t.x+(s?c.rect.x:h.rect.x),e.y=t.y+(s?h.rect.y:c.rect.y)+(l&&l.enablePeriodSelector?l.toolbarHeight+l.titleSize.height:0),!0)}return this.setAccumulationPointValue(e)},e.prototype.processAnnotation=function(e,i,r){var o=this.control,n=new Vi(0,0),a=this.render(e,i),s=function(){a.style.transform="translate(-50%, -50%)"};s.bind(n,this),this["setAnnotation"+e.coordinateUnits+"Value"](n)?this.setElementStyle(n,a,r):this.control.redraw&&m(a.id),t.updateBlazorTemplate((this.control.element.id+"Annotation"+i).replace(/[^a-zA-Z0-9]/g,""),"ContentTemplate",o.stockChart?o.stockChart.annotations[i]:this.control.annotations[i],void 0,s)},e.prototype.setAccumulationPointValue=function(e){for(var t,i=0,r=this.control.visibleSeries[0].points;i<r.length;i++){var o=r[i];if("object"==typeof o.x){if(Date.parse(o.x)===Date.parse(this.annotation.x)&&o.y===this.annotation.y){t=o;break}}else if(o.x==this.annotation.x&&o.y==this.annotation.y){t=o;break}}return!(!t||!t.visible)&&(e.x=t.symbolLocation.x,e.y=t.symbolLocation.y,!0)},e.prototype.setElementStyle=function(e,t,i){var r=ye(t,this.control.redraw),o={cancel:!1,name:"annotationRender",content:t,location:e};this.control.trigger("annotationRender",o),o.cancel||(o.content.style.left=this.setAlignmentValue(this.annotation.horizontalAlignment,r.width,o.location.x)+"px",o.content.style.top=this.setAlignmentValue(this.annotation.verticalAlignment,r.height,o.location.y)+"px",o.content.setAttribute("aria-label",this.annotation.description||"Annotation"),fe(o.content,i,this.control.redraw,!0,"left","top"))},e.prototype.setAlignmentValue=function(e,t,i){switch(e){case"Top":case"Near":i-=t;break;case"Bottom":case"Far":i+=0;break;case"Middle":case"Center":i-=t/2}return i},e}(),kn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tn=function(e){function i(t,i){var r=e.call(this,t)||this;return r.chart=t,r.annotations=i,r}return kn(i,e),i.prototype.renderAnnotations=function(e){var i=this;this.annotations=this.chart.annotations,this.parentElement=Fe(this.chart.redraw,this.chart.element.id+"_Annotation_Collections")||t.createElement("div",{id:this.chart.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),fe(this.parentElement,e,this.chart.redraw)},i.prototype.destroy=function(){},i.prototype.getModuleName=function(){return"Annotation"},i}(An),_n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),On=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return _n(r,e),r.prototype.render=function(e,i,r,o){for(var n,a=this.getSideBySideInfo(e),s=0,l=e.points;s<l.length;s++){var h=l[s];h.symbolLocations=[],h.regions=[];var c=void 0;h.visible&&S(e.points[h.index-1],h,e.points[h.index+1],e)&&(this.findBoxPlotValues(h.y,h,e.boxPlotMode),this.updateTipRegion(e,h,a),c=this.getRectangle(h.xValue+a.start,h.upperQuartile,h.xValue+a.end,h.lowerQuartile,e),h.regions.push(c),(n=this.triggerEvent(e,h,e.interior,{color:t.isNullOrUndefined(e.border.color)||"transparent"===e.border.color?Oe(e.interior,-.6):e.border.color,width:e.border.width?e.border.width:1})).cancel||this.renderBoxAndWhisker(e,h,n,this.getPathString(h,e,ve(h.xValue,h.median,i,r,o),ve(h.xValue+a.median,h.average,i,r,o)),a.median))}e.marker.visible&&e.chart.markerRender.render(e)},r.prototype.updateTipRegion=function(e,t,i){var r=this.getRectangle(t.xValue+i.median,t.maximum,t.xValue+i.median,t.minimum,e);this.updateTipSize(e,t,r,e.chart.requireInvertedAxis)},r.prototype.updateTipSize=function(e,t,i,r){var o=e.border.width||1;r?(i.y-=o/2,i.height=i.height||o):(i.x-=o/2,i.width=i.width||o),t.regions.push(i)},r.prototype.getPathString=function(e,t,i,r){var o=e.regions[0],n=e.regions[1],a="",s=t.chart.requireInvertedAxis?o.y+o.height/2:o.x+o.width/2,l=n.x+n.width,h=n.y+n.height,c=o.x+o.width,d=o.y+o.height;return t.chart.requireInvertedAxis?(this.updateTipSize(t,e,{x:o.x,y:n.y,width:0,height:h-n.y},!1),this.updateTipSize(t,e,{x:c,y:n.y,width:0,height:h-n.y},!0),a+="M "+o.x+" "+n.y+" L "+o.x+" "+h,a+="M "+o.x+" "+s+" L "+n.x+" "+s,a+=" M "+n.x+" "+n.y+" L "+l+" "+n.y+" L "+l+" "+h+" L "+n.x+" "+h+" Z",a+=" M "+l+" "+s+" L "+c+" "+s,a+=" M "+c+" "+n.y+" L "+c+" "+h,a+=" M "+i.x+" "+n.y+" L "+i.x+" "+h,a+=t.showMean?"M "+(r.x+5)+" "+(r.y-5)+" L "+(r.x-5)+" "+(r.y+5)+"M "+(r.x-5)+" "+(r.y-5)+" L "+(r.x+5)+" "+(r.y+5):""):(this.updateTipSize(t,e,{x:n.x,y:o.y,width:l-n.x,height:0},!0),this.updateTipSize(t,e,{x:n.x,y:d,width:l-n.x,height:0},!0),a+="M "+n.x+" "+o.y+" L "+l+" "+o.y,a+=" M "+s+" "+o.y+" L "+s+" "+n.y,a+=" M "+n.x+" "+n.y+" L "+l+" "+n.y+" L "+l+" "+h+" L "+n.x+" "+h+" Z",a+=" M "+s+" "+h+" L "+s+" "+d,a+=" M "+n.x+" "+d+" L "+l+" "+d,a+=" M "+n.x+" "+i.y+" L "+l+" "+i.y,a+=t.showMean?" M "+(r.x-5)+" "+(r.y-5)+" L "+(r.x+5)+" "+(r.y+5)+" M "+(r.x+5)+" "+(r.y-5)+" L "+(r.x-5)+" "+(r.y+5):""),a},r.prototype.renderBoxAndWhisker=function(e,t,r,o,n){var a,s,l=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,h=e.chart.renderer.drawPath(new i.PathOption(l+"_BoxPath",r.fill,r.border.width,r.border.color,e.opacity,e.dashArray,o));h.setAttribute("aria-label",t.x.toString()+":"+t.maximum.toString()+":"+t.minimum.toString()+":"+t.lowerQuartile.toString()+":"+t.upperQuartile.toString());var c=e.chart.renderer.createGroup({id:l});c.appendChild(h);for(var d=0;d<t.outliers.length;d++)a=ve(t.xValue+n,t.outliers[d],e.xAxis,e.yAxis,e.chart.requireInvertedAxis),s=new i.Size(e.marker.width,e.marker.height),t.symbolLocations.push(a),this.updateTipSize(e,t,{x:a.x-s.width/2,y:a.y-s.height/2,width:s.width,height:s.height},!0);e.seriesElement.appendChild(c)},r.prototype.findBoxPlotValues=function(e,t,i){var r=e.length,o={average:C(e)/r,lowerQuartile:0,upperQuartile:0,maximum:0,minimum:0,median:0,outliers:[]};"Exclusive"===i?(o.lowerQuartile=this.getExclusiveQuartileValue(e,r,.25),o.upperQuartile=this.getExclusiveQuartileValue(e,r,.75),o.median=this.getExclusiveQuartileValue(e,r,.5)):"Inclusive"===i?(o.lowerQuartile=this.getInclusiveQuartileValue(e,r,.25),o.upperQuartile=this.getInclusiveQuartileValue(e,r,.75),o.median=this.getInclusiveQuartileValue(e,r,.5)):(o.median=Ee(e),this.getQuartileValues(e,r,o)),this.getMinMaxOutlier(e,r,o),t.minimum=o.minimum,t.maximum=o.maximum,t.lowerQuartile=o.lowerQuartile,t.upperQuartile=o.upperQuartile,t.median=o.median,t.outliers=o.outliers,t.average=o.average},r.prototype.getExclusiveQuartileValue=function(e,t,i){if(0===t)return 0;if(1===t)return e[0];var r=i*(t+1),o=Math.floor(Math.abs(r)),n=r-o;return 0===o?e[0]:o>t-1?e[t-1]:n*(e[o]-e[o-1])+e[o-1]},r.prototype.getInclusiveQuartileValue=function(e,t,i){if(0===t)return 0;if(1===t)return e[0];var r=i*(t-1),o=Math.floor(Math.abs(r));return(r-o)*(e[o+1]-e[o])+e[o]},r.prototype.getQuartileValues=function(e,t,i){if(1===t)return i.lowerQuartile=e[0],i.upperQuartile=e[0],null;var r=t%2==0,o=t/2,n=e.slice(0,o),a=e.slice(r?o:o+1,t);i.lowerQuartile=Ee(n),i.upperQuartile=Ee(a)},r.prototype.getMinMaxOutlier=function(e,t,i){for(var r=1.5*(i.upperQuartile-i.lowerQuartile),o=0;o<t;o++){if(!(e[o]<i.lowerQuartile-r)){i.minimum=e[o];break}i.outliers.push(e[o])}for(o=t-1;o>=0;o--){if(!(e[o]>i.upperQuartile+r)){i.maximum=e[o];break}i.outliers.push(e[o])}},r.prototype.doAnimation=function(e){this.animate(e)},r.prototype.getModuleName=function(){return"BoxAndWhiskerSeries"},r.prototype.destroy=function(){},r}(jr),En=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),In=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return En(r,e),r.prototype.render=function(e,i,r,o){var n,a,s,l,h=this,c=null,d="",p=Math.max(e.yAxis.visibleRange.min,0),u=[],g=this.sortSegments(e,e.segments);e.visiblePoints.map(function(t,y,m){t.symbolLocations=[],t.regions=[],l=!1,t.visible&&S(m[y-1],t,m[y+1],e)&&(d+=h.getAreaPathDirection(t.xValue,p,e,o,ve,c,"M"),c=c||new Vi(t.xValue,p),n=ve(t.xValue,t.yValue,i,r,o),s&&h.setPointColor(t,s,e,"X"===e.segmentAxis,g)?(l=!0,a=ve(c.x,p,i,r,o),d+="L "+n.x+" "+n.y+" ",d+="L "+n.x+" "+a.y+" ",h.generatePathOption(u,e,s,d,"_Point_"+s.index),d="M "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):(d+="L "+n.x+" "+n.y+" ",h.setPointColor(t,null,e,"X"===e.segmentAxis,g)),m[y+1]&&!m[y+1].visible&&"Drop"!==e.emptyPointSettings.mode&&(d+=h.getAreaEmptyDirection({x:t.xValue,y:p},c,e,o,ve),c=null),s=t,h.storePointLocation(t,e,o,ve))}),t.isNullOrUndefined(l)||l||(d=e.points.length>1?d+this.getAreaPathDirection(s.xValue,p,e,o,ve,null,"L"):"",this.generatePathOption(u,e,s,d,"")),this.applySegmentAxis(e,u,g),this.renderMarker(e)},r.prototype.generatePathOption=function(e,t,r,o,n){e.push(new i.PathOption(t.chart.element.id+"_Series_"+t.index+n,t.setPointColor(r,t.interior),t.border.width,t.border.color,t.opacity,t.dashArray,o))},r.prototype.destroy=function(){},r.prototype.getModuleName=function(){return"MultiColoredAreaSeries"},r.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)},r}(Gr),zn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zn(t,e),t.prototype.render=function(e,t,r,o){for(var n=null,a="M",s=this.enableComplexProperty(e),l=[],h="",c=this.sortSegments(e,e.segments),d=0,p=s;d<p.length;d++){var u=p[d];u.regions=[],u.visible&&S(s[u.index-1],u,s[u.index+1],e)?(h+=this.getLineDirection(n,u,e,o,ve,a),null!=n?this.setPointColor(u,n,e,"X"===e.segmentAxis,c)?(l.push(new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+n.index,"none",e.width,e.setPointColor(n,e.interior),e.opacity,e.dashArray,h)),a="M",h=""):a="L":this.setPointColor(u,null,e,"X"===e.segmentAxis,c),n=u,this.storePointLocation(u,e,o,ve)):(n="Drop"===e.emptyPointSettings.mode?n:null,a="Drop"===e.emptyPointSettings.mode?a:"M",u.symbolLocations=[])}""!==h&&l.push(new i.PathOption(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.setPointColor(s[s.length-1],e.interior),e.opacity,e.dashArray,h)),this.applySegmentAxis(e,l,c),this.renderMarker(e)},t.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)},t.prototype.getModuleName=function(){return"MultiColoredLineSeries"},t.prototype.destroy=function(){},t}(Gr),Bn=function(){function e(e){this.xAxisPrevHeight=[],this.xAxisMultiLabelHeight=[],this.yAxisPrevHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelLabelRectXRegion=[],this.xLabelCollection=[],this.chart=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.chart.isDestroyed||this.chart.on("click",this.click,this)},e.prototype.getMultilevelLabelsHeight=function(e){var t,r,o,n=0,a=[],s=[],l="Vertical"===e.orientation,h=l?e.rect.height:e.rect.width;e.multiLevelLabels.map(function(c,d){c.categories.map(function(n){""!==n.text&&null!==n.start&&null!==n.end&&(t=i.measureText(n.text,c.textStyle),r=l?t.width:t.height,r+=2*c.border.width+("CurlyBrace"===c.border.type?10:0),o=null!==n.maximumTextWidth?n.maximumTextWidth:I("string"==typeof n.end?Number(new Date(n.end)):n.end,e)*h-I("string"==typeof n.start?Number(new Date(n.start)):n.start,e)*h,t.width>o-10&&o>0&&"Wrap"===c.overflow&&!l&&(r*=Ge(n.text,o-10,c.textStyle).length),a[d]=a[d]?a[d]<r?r:a[d]:r)}),s[d]=n,n+=a[d]?a[d]+10:0}),e.multiLevelLabelHeight=n+(""!==e.title||this.chart.legendModule&&this.chart.legendSettings.visible?5:0),l?(this.yAxisMultiLabelHeight=a,this.yAxisPrevHeight=s):(this.xAxisMultiLabelHeight=a,this.xAxisPrevHeight=s)},e.prototype.renderXAxisMultiLevelLabels=function(e,r,o,n){var a,s,l,h,c,d,p,u,g,y,m,v=this,f=(e.labelPosition===e.tickPosition?e.majorTickLines.height:0)+e.maxLabelSize.height+10,b="",x="Outside"===e.labelPosition,w=e.isInversed,S=e.opposedPosition,C=e.scrollbarSettings.enable||x&&t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0,P=S&&!x||!S&&x?n.y+f-e.majorTickLines.width:n.y-f-e.multiLevelLabelHeight;this.createClipRect(n.x-e.majorTickLines.width,P+C,e.multiLevelLabelHeight+10,n.width+2*e.majorTickLines.width,this.chart.element.id+"_XAxis_Clippath_"+r,this.chart.element.id+"XAxisMultiLevelLabel"+r),e.multiLevelLabels.map(function(t,o){h=0,v.labelElement=v.chart.renderer.createGroup({id:v.chart.element.id+r+"_MultiLevelLabel"+o}),t.categories.map(function(P,L){if(b="",d="string"==typeof P.start?Number(new Date(P.start)):P.start,p="string"==typeof P.end?Number(new Date(P.end)):P.end,!(m=v.triggerMultiLabelRender(e,P.text,e.multiLevelLabels[o].textStyle,e.multiLevelLabels[o].alignment,P.customAttributes)).cancel){l=I(d,e)*n.width,c=I(p,e)*n.width,c=w?[l,l=c][0]:c,u=i.measureText(m.text,m.textStyle),g=(null===P.maximumTextWidth?c-l:P.maximumTextWidth)-10,a=l+n.x+10,s=(S&&!x||!S&&x?f+n.y+u.height/2+10+v.xAxisPrevHeight[o]:n.y-f+u.height/2-v.xAxisMultiLabelHeight[o]-v.xAxisPrevHeight[o])+C,"Center"===m.alignment?(a+=(c-l-10)/2,y="middle"):"Far"===m.alignment?(a=a+(c-l-10)-t.border.width/2,y="end"):(y="start",a+=t.border.width/2),s="CurlyBrace"===t.border.type?!S&&x||S&&!x?s+10:s-5:s;var R=new i.TextOption(v.chart.element.id+r+"_Axis_MultiLevelLabel_Level_"+o+"_Text_"+L,a,s,y,m.text);if("None"!==t.overflow&&(R.text="Wrap"===t.overflow?Ge(m.text,g,m.textStyle):ze(g,m.text,m.textStyle),R.x=R.x-5),Ve(v.chart.renderer,R,m.textStyle,m.textStyle.color||v.chart.themeStyle.axisLabel,v.labelElement,!1,v.chart.redraw,!0,null,null,null,null,null,v.chart.enableCanvas),v.chart.enableCanvas){var M=i.measureText(m.text,m.textStyle);v.multiLevelLabelRectXRegion.push(new i.Rect(R.x,R.y,M.width,M.height)),v.xLabelCollection.push(R)}t.border.width>0&&"WithoutBorder"!==t.border.type&&""!==(b=v.renderXAxisLabelBorder(o,c-l-10,e,l,f,u,R,n,m.alignment,b,x,S,h))&&(v.createBorderElement(o,r,e,b,h),h++),v.chart.enableCanvas||v.multiElements.appendChild(v.labelElement)}})}),this.chart.enableCanvas||o.appendChild(this.multiElements)},e.prototype.renderXAxisLabelBorder=function(e,t,i,r,o,n,a,s,l,h,c,d,p){var u,g,y,m,v=10,f=i.multiLevelLabels[e],b=f.categories[p].type,x=t+v,w=this.xAxisMultiLabelHeight[e]+v,S="Outside"===i.labelPosition?i.scrollBarHeight:0,C=r+s.x,P=!d&&c||d&&!c?o+s.y+this.xAxisPrevHeight[e]+S:s.y-o-this.xAxisPrevHeight[e]-S,L=b||f.border.type;switch(L){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":h+="M "+C+" "+P+" L "+C+" "+(P+(w=!d&&c||d&&!c?w:-w))+" M "+(C+x)+" "+P+" L "+(C+x)+" "+(P+w),h+="WithoutTopandBottomBorder"!==L?" L "+C+" "+(P+w)+" ":" ",h+="Rectangle"===L?"M "+C+" "+P+" L "+(C+x)+" "+P:" ";break;case"Brace":"Near"===l?(y=a.x,m=a.x+n.width+2):"Center"===l?(y=a.x-n.width/2-2,m=a.x+n.width/2+2):(y=a.x-n.width-2,m=a.x),h+="M "+C+" "+P+" L "+C+" "+(P+(w=!d&&c||d&&!c?w:-w)/2)+" M "+C+" "+(P+w/2)+" L "+(y-2)+" "+(P+w/2)+" M "+m+" "+(P+w/2)+" L "+(C+x)+" "+(P+w/2)+" M "+(C+x)+" "+(P+w/2)+" L "+(C+x)+" "+P;break;case"CurlyBrace":!d&&c||d&&!c?(v=10,u=15,g=5):(v=-10,u=-15,g=-5),h+="Center"===l?"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+x/2-5)+" "+(P+v)+" L "+(C+x/2)+" "+(P+u)+" L "+(C+x/2+5)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P:"Near"===l?"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+15)+" "+(P+u)+" L "+(C+20)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P:"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+x-20)+" "+(P+v)+" L "+(C+x-15)+" "+(P+u)+" L "+(C+x-10)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P}return h},e.prototype.renderYAxisMultiLevelLabels=function(e,r,o,n){var a,s,l,h,c,d,p,u,g,y,m=this,v="Outside"===e.labelPosition,f=(e.tickPosition===e.labelPosition?e.majorTickLines.height:0)+e.maxLabelSize.width+10,b="",x=e.isInversed,w=e.opposedPosition,S=v&&t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0;S*=w?1:-1;var C=w&&!v||!w&&v?n.x-e.multiLevelLabelHeight-f-10:n.x+f;this.createClipRect(C+S,n.y-e.majorTickLines.width,n.height+2*e.majorTickLines.width,e.multiLevelLabelHeight+10,this.chart.element.id+"_YAxis_Clippath_"+r,this.chart.element.id+"YAxisMultiLevelLabel"+r),e.multiLevelLabels.map(function(t,o){m.labelElement=m.chart.renderer.createGroup({id:m.chart.element.id+r+"_MultiLevelLabel"+o}),p=0,t.categories.map(function(C,P){if(b="",g="string"==typeof C.end?Number(new Date(C.end)):C.end,u="string"==typeof C.start?Number(new Date(C.start)):C.start,h=I(u,e)*n.height,c=I(g,e)*n.height,c=x?[h,h=c][0]:c,!(d=m.triggerMultiLabelRender(e,C.text,t.textStyle,t.alignment,C.customAttributes)).cancel){a=i.measureText(d.text,d.textStyle),y=c-h,s=n.x-f-m.yAxisPrevHeight[o]-m.yAxisMultiLabelHeight[o]/2-5,l=n.height+n.y-h-y/2,s=w?v?n.x+f+5+m.yAxisMultiLabelHeight[o]/2+m.yAxisPrevHeight[o]+S:n.x-f-m.yAxisMultiLabelHeight[o]/2-m.yAxisPrevHeight[o]-5:v?s+S:n.x+f+5+m.yAxisMultiLabelHeight[o]/2+m.yAxisPrevHeight[o],"Center"===d.alignment?l+=a.height/4:"Far"===d.alignment?l+=y/2-a.height/2:l=l-y/2+a.height,s="CurlyBrace"===t.border.type?!w&&v||w&&!v?s-10:s+10:s;var L=new i.TextOption(m.chart.element.id+r+"_Axis_MultiLevelLabel_Level_"+o+"_Text_"+P,s,l,"middle",d.text);L.text="Trim"===t.overflow?ze(null===C.maximumTextWidth?m.yAxisMultiLabelHeight[o]:C.maximumTextWidth,d.text,d.textStyle):L.text,Ve(m.chart.renderer,L,d.textStyle,d.textStyle.color||m.chart.themeStyle.axisLabel,m.labelElement,m.chart.redraw,!0,null,null,null,null,null,null,m.chart.enableCanvas),t.border.width>0&&"WithoutBorder"!==t.border.type&&""!==(b=m.renderYAxisLabelBorder(o,y,e,c,f,h,a,L,n,d.alignment,b,v,w,p))&&(m.createBorderElement(o,r,e,b,p),p++),m.chart.enableCanvas||m.multiElements.appendChild(m.labelElement)}})}),this.chart.enableCanvas||o.appendChild(this.multiElements)},e.prototype.renderYAxisLabelBorder=function(e,i,r,o,n,a,s,l,h,c,d,p,u,g){var y,m,v=o-a,f=10,b=r.multiLevelLabels[e],x=b.categories[g].type,w=h.y+h.height-o,S=p&&t.isNullOrUndefined(r.crossesAt)?r.scrollBarHeight:0;S*=u?1:-1;var C=this.yAxisMultiLabelHeight[e]+f,P=(!u&&p||u&&!p?h.x-n-this.yAxisPrevHeight[e]:h.x+n+this.yAxisPrevHeight[e])+S,L=x||b.border.type;switch(L){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":d+="M "+P+" "+w+" L "+(P+(C=!u&&p||u&&!p?-C:C))+" "+w+" M "+P+" "+(w+v)+" L "+(P+C)+" "+(w+v),d+="WithoutTopandBottomBorder"!==L?" L "+(P+C)+" "+w+" ":" ",d+="Rectangle"===L?"M "+P+" "+(w+v)+"L "+P+" "+w+" ":" ";break;case"Brace":d+="M "+P+" "+w+" L "+(P-(C=!u&&p||u&&!p?C:-C)/2)+" "+w+" L "+(P-C/2)+" "+(l.y-s.height/2-4)+" M "+(P-C/2)+" "+(l.y+s.height/4+2)+" L "+(P-C/2)+" "+(w+v)+" L "+P+" "+(w+v);break;case"CurlyBrace":!u&&p||u&&!p?(f=-10,y=-15,m=-5):(f=10,y=15,m=5),d+="Center"===c?"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+f)+" "+(w+(v-10)/2)+" L "+(P+y)+" "+(w+(v-10)/2+5)+" L "+(P+f)+" "+(w+(v-10)/2+10)+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+m)+" "+(w+v)+" "+P+" "+(w+v):"Far"===c?"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+f)+" "+(w+v-20)+" L "+(P+y)+" "+(w+(v-15))+" L "+(P+f)+" "+(w+(v-10))+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+f)+" "+(w+v)+" "+P+" "+(w+v):"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+y)+" "+(w+15)+" L "+(P+f)+" "+(w+20)+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+m)+" "+(w+v)+" "+P+" "+(w+v)}return d},e.prototype.createClipRect=function(e,t,i,r,o,n){this.multiElements=this.chart.renderer.createGroup({id:n,"clip-path":"url(#"+o+")"}),this.chart.enableCanvas||this.multiElements.appendChild(K(this.chart.redraw,{id:o,x:e,y:t,width:r,height:i,fill:"white","stroke-width":1,stroke:"Gray"},this.chart.renderer))},e.prototype.createBorderElement=function(e,t,r,o,n){var a=o,s=this.chart.renderer.drawPath(new i.PathOption(this.chart.element.id+t+"_Axis_MultiLevelLabel_Rect_"+e+"_"+n,"Transparent",r.multiLevelLabels[e].border.width,r.multiLevelLabels[e].border.color||this.chart.themeStyle.axisLine,1,"",o));s.setAttribute("style","pointer-events: none"),be(this.chart.enableCanvas,this.labelElement,s,this.chart.redraw,!0,"x","y",null,a)},e.prototype.triggerMultiLabelRender=function(e,t,i,r,o){var n={cancel:!1,name:"axisMultiLabelRender",axis:e,text:t,textStyle:i,alignment:r,customAttributes:o};return this.chart.trigger("axisMultiLabelRender",n),n},e.prototype.MultiLevelLabelClick=function(e,t){var i=parseInt(e.substr(0,1),10),r=parseInt(e.substr(7),10),o=this.chart.axisCollections[t],n=o.multiLevelLabels[i].categories,a=n[r].text,s=n[r].start,l=n[r].end,h={axis:o,level:i,text:a,customAttributes:n[r].customAttributes,start:s,end:l,name:"multiLevelLabelClick",cancel:!1};return this.chart.trigger("multiLevelLabelClick",h),h},e.prototype.click=function(e){var t,i,r,o=e.target.id,n="_Axis_MultiLevelLabel_Level_";if(this.chart.enableCanvas)for(var a=0;a<this.multiLevelLabelRectXRegion.length;a++)j(e.x,e.y,this.multiLevelLabelRectXRegion[a],this.multiLevelLabelRectXRegion[a].width,this.multiLevelLabelRectXRegion[a].height)&&(o=this.xLabelCollection[a].id);o.indexOf(n)>-1&&(t=o.split(n)[1],i=o.split(n)[0],r=parseInt(i.charAt(i.length-1),10),this.MultiLevelLabelClick(t,r))},e.prototype.getModuleName=function(){return"MultiLevelLabel"},e.prototype.destroy=function(){},e}(),Fn=function(){function e(e){this.chartId=e.element.id+"_"}return e.prototype.renderElements=function(e,t){var i=t.createGroup({id:this.chartId+"scrollBar_"+e.axis.name,transform:"translate("+(e.isVertical&&e.axis.isInversed?e.height:e.axis.isInversed?e.width:"0")+","+(e.isVertical&&e.axis.isInversed?"0":e.axis.isInversed?e.height:e.isVertical?e.width:"0")+") rotate("+(e.isVertical&&e.axis.isInversed?"90":e.isVertical?"270":e.axis.isInversed?"180":"0")+")"}),r=t.createGroup({id:this.chartId+"scrollBar_backRect_"+e.axis.name}),o=t.createGroup({id:this.chartId+"scrollBar_thumb_"+e.axis.name,transform:"translate(0,0)"});return this.backRect(e,t,r),this.thumb(e,t,o),this.renderCircle(e,t,o),this.arrows(e,t,o),this.thumbGrip(e,t,o),i.appendChild(r),i.appendChild(o),i},e.prototype.backRect=function(e,t,r){var o=e.scrollbarThemeStyle,n=t.drawRectangle(new Di(this.chartId+"scrollBarBackRect_"+e.axis.name,o.backRect,{width:1,color:o.backRect},1,new i.Rect(0,0,e.width,e.height),0,0));r.appendChild(n)},e.prototype.arrows=function(e,t,r){var o=e.scrollbarThemeStyle,n=new i.PathOption(this.chartId+"scrollBar_leftArrow_"+e.axis.name,o.arrow,1,o.arrow,1,"","");this.leftArrowEle=t.drawPath(n),n.id=this.chartId+"scrollBar_rightArrow_"+e.axis.name,this.rightArrowEle=t.drawPath(n),this.setArrowDirection(this.thumbRectX,this.thumbRectWidth,e.height),r.appendChild(this.leftArrowEle),r.appendChild(this.rightArrowEle)},e.prototype.setArrowDirection=function(e,t,i){var r="M "+(e-4+1)+" "+i/2+" L "+(e-4+6)+" 11 L "+(e-4+6)+" 5 Z",o="M "+(e+t+4-.5)+" "+i/2+" L "+(e+t+4-6)+" 11.5 L "+(e+t+4-6)+" 4.5 Z";this.leftArrowEle.setAttribute("d",r),this.rightArrowEle.setAttribute("d",o)},e.prototype.thumb=function(e,t,r){e.startX=this.thumbRectX;var o=e.scrollbarThemeStyle;this.slider=t.drawRectangle(new Di(this.chartId+"scrollBarThumb_"+e.axis.name,o.thumb,{width:1,color:""},1,new i.Rect(this.thumbRectX,0,this.thumbRectWidth,e.height))),r.appendChild(this.slider)},e.prototype.renderCircle=function(e,t,i){var r=e.scrollbarThemeStyle,o=new Fi(this.chartId+"scrollBar_leftCircle_"+e.axis.name,r.circle,{width:1,color:r.circle},1,this.thumbRectX,e.height/2,8),n=t.createDefs(),a=t.createGroup({id:this.chartId+e.axis.name+"_thumb_shadow"});n.innerHTML='<filter x="-25.0%" y="-20.0%" width="150.0%" height="150.0%" filterUnits="objectBoundingBox"id="scrollbar_shadow"><feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset><feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix></filter>',a.innerHTML='<use fill="black" fill-opacity="1" filter="url(#scrollbar_shadow)" xlink:href="#'+this.chartId+"scrollBar_leftCircle_"+e.axis.name+'"></use><use fill="black" fill-opacity="1" filter="url(#scrollbar_shadow)" xlink:href="#'+this.chartId+"scrollBar_rightCircle_"+e.axis.name+'"></use>',this.leftCircleEle=t.drawCircle(o),o.id=this.chartId+"scrollBar_rightCircle_"+e.axis.name,o.cx=this.thumbRectX+this.thumbRectWidth,this.rightCircleEle=t.drawCircle(o),i.appendChild(n),i.appendChild(this.leftCircleEle),i.appendChild(this.rightCircleEle),i.appendChild(a)},e.prototype.thumbGrip=function(e,t,i){var r=0,o=0,n=e.scrollbarThemeStyle,a=new Fi(this.chartId+"scrollBar_gripCircle0_"+e.axis.name,n.grip,{width:1,color:n.grip},1,0,0,1);this.gripCircle=t.createGroup({id:this.chartId+"scrollBar_gripCircle_"+e.axis.name,transform:"translate("+(this.thumbRectX+this.thumbRectWidth/2+5*(e.isVertical?1:-1))+","+(e.isVertical?"10":"5")+") rotate("+(e.isVertical?"180":"0")+")"});for(var s=1;s<=6;s++)a.id=this.chartId+"scrollBar_gripCircle"+s+"_"+e.axis.name,a.cx=r,a.cy=o,this.gripCircle.appendChild(t.drawCircle(a)),r=3===s?0:r+5,o=s>=3?5:0;i.appendChild(this.gripCircle)},e}(),Nn=function(){function e(e,i){this.scrollRange={max:null,min:null,interval:null,delta:null},this.component=e,this.elements=[],this.scrollElements=new Fn(e),this.axis=i,this.mouseMoveListener=this.scrollMouseMove.bind(this),this.mouseUpListener=this.scrollMouseUp.bind(this),this.animateDuration=500,this.isPointer=t.Browser.isPointer,this.browserName=t.Browser.info.name}return e.prototype.getMouseXY=function(e){var t,i,r;e.type.indexOf("touch")>-1?(t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(t=e.clientX,i=e.clientY);var o=he(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect();this.mouseX=t-Math.max(o.left,0),this.mouseY=i-Math.max(o.top,0)},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.scrollMouseDown,this),t.EventHandler.add(e,t.Browser.touchMoveEvent,this.scrollMouseMove,this),t.EventHandler.add(e,t.Browser.touchEndEvent,this.scrollMouseUp,this),t.EventHandler.add(e,"mousewheel",this.scrollMouseWheel,this),window.addEventListener("mousemove",this.mouseMoveListener,!1),window.addEventListener("mouseup",this.mouseUpListener,!1)},e.prototype.unWireEvents=function(e){t.EventHandler.remove(e,t.Browser.touchStartEvent,this.scrollMouseDown),t.EventHandler.remove(e,t.Browser.touchMoveEvent,this.scrollMouseMove),t.EventHandler.remove(e,t.Browser.touchEndEvent,this.scrollMouseUp),t.EventHandler.remove(e,"mousewheel",this.scrollMouseWheel),window.removeEventListener("mousemove",this.mouseMoveListener,!1),window.removeEventListener("mouseup",this.mouseUpListener,!1)},e.prototype.scrollMouseDown=function(e){var t=e.target.id,i=this.scrollElements;if(this.getMouseXY(e),this.isResizeLeft=this.isExist(t,"_leftCircle_")||this.isExist(t,"_leftArrow_"),this.isResizeRight=this.isExist(t,"_rightCircle_")||this.isExist(t,"_rightArrow_"),this.previousXY=this.isVertical&&this.axis.isInversed?this.mouseY:this.isVertical?this.width-this.mouseY:this.axis.isInversed?this.width-this.mouseX:this.mouseX,this.previousWidth=i.thumbRectWidth,this.previousRectX=i.thumbRectX,this.startZoomPosition=this.axis.zoomPosition,this.startZoomFactor=this.axis.zoomFactor,this.startRange=this.axis.visibleRange,this.scrollStarted=!0,this.component.trigger("scrollStart",this.getArgs("scrollStart")),this.isExist(t,"scrollBarThumb_")||this.isExist(t,"gripCircle"))this.isThumbDrag=!0,this.svgObject.style.cursor="-webkit-grabbing";else if(this.isExist(t,"scrollBarBackRect_")){var r=this.moveLength(this.previousXY,this.previousRectX);if(i.thumbRectX=this.isWithIn(r)?r:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.setZoomFactorPosition(i.thumbRectX,i.thumbRectWidth,!1),this.isLazyLoad){var o=i.thumbRectX>this.previousRectX?"RightMove":"LeftMove",n=this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,o);n&&this.component.trigger("scrollEnd",n)}}""===this.component.element.style.height&&(this.isCustomHeight=!0,this.component.element.style.height=this.component.availableSize.height+"px")},e.prototype.isExist=function(e,t){return e.indexOf(t)>-1},e.prototype.isWithIn=function(e){return e-8>=0&&e+this.scrollElements.thumbRectWidth+8<=this.width},e.prototype.moveLength=function(e,t,i){void 0===i&&(i=8);var r=.1*(this.width-2*i);return r=e<t?t-(t-r>i?r:i):t+(t+this.scrollElements.thumbRectWidth+r<this.width-i?r:i)},e.prototype.setZoomFactorPosition=function(e,t,i){void 0===i&&(i=!0),this.isScrollUI=!0;var r=this.axis,o=e+t+8+1;this.zoomPosition=(e-(e-8.5<=0?8.5:0))/(this.isVertical?r.rect.height:this.width),this.zoomFactor=(t+(o>=this.width?9:0))/(this.isVertical?r.rect.height:this.width),r.zoomPosition=this.zoomPosition<0?0:this.zoomPosition>.9?1:this.zoomPosition,r.zoomFactor=i?this.zoomFactor:r.zoomFactor},e.prototype.scrollMouseMove=function(e){var t=e.target,i=this.scrollElements;this.getMouseXY(e),this.setCursor(t),this.setTheme(t);var r,o=this.isVertical&&this.axis.isInversed?this.width-this.mouseY:this.isVertical?this.mouseY:this.mouseX,n=this.axis.visibleRange,a=this.zoomPosition,s=this.zoomFactor,l=this.previousRectX-i.thumbRectX<0?"RightMove":"LeftMove";this.isLazyLoad&&(this.isThumbDrag||this.isResizeLeft||this.isResizeRight)&&(r=this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,l));var h=r?r.currentRange:null;if(this.isThumbDrag){this.component.isScrolling=this.isThumbDrag,o=this.isVertical||this.axis.isInversed?this.width-o:o;var c=i.thumbRectX+(o-this.previousXY);o>=c+i.thumbRectWidth?this.setCursor(t):this.svgObject.style.cursor="-webkit-grabbing",o>=0&&o<=c+i.thumbRectWidth&&(i.thumbRectX=this.isWithIn(c)?c:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.previousXY=o,this.setZoomFactorPosition(c,i.thumbRectWidth,!1)),this.component.trigger("scrollChanged",this.getArgs("scrollChanged",n,a,s,h))}else(this.isResizeLeft||this.isResizeRight)&&(this.resizeThumb(),this.component.trigger("scrollChanged",this.getArgs("scrollChanged",n,a,s,h)))},e.prototype.scrollMouseWheel=function(e){var t=he(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect();this.mouseX=e.clientX-Math.max(t.left,0),this.mouseY=e.clientY-Math.max(t.top,0);var i,r=.5,o=this.scrollElements,n=this.axis,a="mozilla"!==this.browserName||this.isPointer?e.wheelDelta/120>0?1:-1:-e.detail/3>0?1:-1,s=Math.max(Math.max(1/le(n.zoomFactor,0,1),1)+.25*a,1),l=this.axis.visibleRange,h=this.zoomPosition,c=this.zoomFactor;s>=1&&(r=(r="Horizontal"===n.orientation?this.mouseX/n.rect.width:1-this.mouseY/n.rect.height)>1?1:r<0?0:r,this.zoomFactor=1===s?1:le(1/s,0,1),this.zoomPosition=1===s?0:n.zoomPosition+(n.zoomFactor-this.zoomFactor)*r),o.thumbRectX=this.isWithIn(this.zoomPosition*this.width)?this.zoomPosition*this.width:o.thumbRectX,this.isScrollUI=!0,this.positionThumb(o.thumbRectX,o.thumbRectWidth),this.isLazyLoad&&this.setZoomFactorPosition(o.thumbRectX,o.thumbRectWidth),n.zoomFactor=this.zoomFactor,n.zoomPosition=this.zoomPosition,this.isLazyLoad&&(i=this.calculateMouseWheelRange(o.thumbRectX,o.thumbRectWidth))&&i.currentRange.minimum!==i.previousAxisRange.minimum&&i.currentRange.maximum!==i.previousAxisRange.maximum&&(this.component.trigger("scrollEnd",i),this.isScrollEnd=!1),this.isLazyLoad||this.component.trigger("scrollChanged",this.getArgs("scrollChanged",l,h,c))},e.prototype.scrollMouseUp=function(){var e;this.startX=this.scrollElements.thumbRectX;var t=this.startX+this.scrollElements.thumbRectWidth+8+1;if(!this.isResizeLeft&&!this.isResizeRight||this.isLazyLoad||(this.axis.zoomFactor=t>=this.width-1&&this.startX-8.5<=0?1:this.zoomFactor),this.isLazyLoad){var i=this.previousRectX-this.startX;if((i>0||i<0)&&this.isThumbDrag){var r=i<0?"RightMove":"LeftMove";this.startX="RightMove"===r?this.startX+Math.abs(i)<this.width-8?this.startX:this.width-8-this.scrollElements.thumbRectWidth:this.startX+this.scrollElements.thumbRectWidth-Math.abs(i)>8?this.startX:8,(e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth,r))&&(this.component.trigger("scrollEnd",e),this.scrollStarted=!1)}(this.isResizeLeft||this.isResizeRight)&&(e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth))&&(this.component.trigger("scrollEnd",e),this.scrollStarted=!1)}this.isThumbDrag=!1,this.isResizeLeft=!1,this.isResizeRight=!1,this.isScrollEnd=!1,this.component.isScrolling=!1,this.scrollStarted&&!this.isLazyLoad&&(this.component.trigger("scrollEnd",this.getArgs("scrollChanged",this.startRange,this.startZoomPosition,this.startZoomFactor)),this.scrollStarted=!1),this.isCustomHeight&&(this.component.element.style.height=null)},e.prototype.calculateMouseWheelRange=function(e,t){var i,r,o,n=this.scrollRange,a=this.getStartEnd(this.previousStart,this.previousEnd,!1);e+t+8<=this.width&&(r=(e-8)/this.width,i=t/this.width);var s=n.min+r*n.delta,l=s+i*n.delta;return l&&(o={axis:this.axis,currentRange:this.getStartEnd(s,l,!0),previousAxisRange:a}),o},e.prototype.calculateLazyRange=function(e,t,i){var r,o,n,a,s,l=t,h=this.scrollRange,c=this.getStartEnd(this.previousStart,this.previousEnd,!1);return this.isResizeRight||"RightMove"===i?(r=((l=this.isResizeRight?l+16:l)+8)/this.width,o="RightMove"===i?(e+8)/this.width:this.axis.zoomPosition,a=(n="RightMove"===i?h.min+o*h.delta:this.previousStart)+r*h.delta):this.isResizeLeft||"LeftMove"===i?(o=(e-8)/this.width,r=l/this.width,n=(n=h.min+o*h.delta)>=h.min?n:h.min,a="LeftMove"===i?n+r*h.delta:this.previousEnd):this.isThumbDrag&&(o="RightMove"===i?(e+8)/this.width:(e-8)/this.width,r=this.scrollElements.thumbRectWidth/this.width,a=(n=(n=h.min+o*h.delta)>=h.min?n:h.min)+r*h.delta),a&&(s={axis:this.component.isBlazor?{}:this.axis,currentRange:this.getStartEnd(n,a,!0),previousAxisRange:c}),s},e.prototype.getStartEnd=function(e,t,i){var r=this.valueType;switch("DateTime"!==r&&"DateTimeCategory"!==r||!i?i&&(this.previousStart=Math.round(e),this.previousEnd=Math.ceil(t)):(this.previousStart=e,this.previousEnd=t),r){case"Double":case"Category":case"Logarithmic":e=Math.round(e),t=Math.ceil(t);break;case"DateTime":case"DateTimeCategory":e=new Date(e),t=new Date(t)}return{minimum:e,maximum:t}},e.prototype.render=function(e){return(this.component.zoomModule||e&&this.axis.scrollbarSettings.enable)&&this.getDefaults(),this.getTheme(),this.removeScrollSvg(),Je(this,this.component.svgRenderer),this.wireEvents(this.svgObject),this.svgObject.appendChild(this.scrollElements.renderElements(this,this.component.svgRenderer)),this.svgObject},e.prototype.getTheme=function(){this.scrollbarThemeStyle=d(this.component.theme)},e.prototype.removeScrollSvg=function(){document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name)&&t.remove(document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name))},e.prototype.setCursor=function(e){var t=e.id;this.svgObject.style.cursor=t.indexOf("scrollBarThumb_")>-1||t.indexOf("_gripCircle")>-1?"-webkit-grab":t.indexOf("Circle_")>-1||t.indexOf("Arrow_")>-1?this.isVertical?"ns-resize":"ew-resize":"auto"},e.prototype.setTheme=function(e){var t=e.id,i=t.indexOf("_leftCircle_")>-1||t.indexOf("_leftArrow_")>-1,r=t.indexOf("_rightCircle_")>-1||t.indexOf("_rightArrow_")>-1,o=this.scrollbarThemeStyle,n=this.scrollElements.leftArrowEle,a=this.scrollElements.rightArrowEle,s=this.scrollElements.leftCircleEle,l=this.scrollElements.rightCircleEle,h=this.isCurrentAxis(e,n);s.style.fill=i&&h?o.circleHover:o.circle,l.style.fill=r&&h?o.circleHover:o.circle,s.style.stroke=i&&h?o.circleHover:o.circle,l.style.stroke=r&&h?o.circleHover:o.circle,"HighContrastLight"===this.component.theme&&(n.style.fill=i&&h?o.arrowHover:o.arrow,n.style.stroke=i&&h?o.arrowHover:o.arrow,a.style.fill=r&&h?o.arrowHover:o.arrow,a.style.stroke=r&&h?o.arrowHover:o.arrow,s.style.stroke=i&&h?o.circleHover:o.circle,l.style.stroke=r&&h?o.circleHover:o.circle)},e.prototype.isCurrentAxis=function(e,t){return e.id.split("_")[2]===t.id.split("_")[2]},e.prototype.resizeThumb=function(){var e,t=this.previousRectX,i=this.isVertical&&this.axis.isInversed?this.mouseY:this.isVertical?this.width-this.mouseY:this.axis.isInversed?this.width-this.mouseX:this.mouseX,r=Math.abs(this.previousXY-i);if(this.isResizeLeft&&i>=0){var o=t+(i>this.previousXY?r:-r);e=o-8>=0?this.previousWidth+(i>this.previousXY?-r:r):this.previousWidth,o=o-8>=0?o:t,e>=40&&i<o+e&&(this.scrollElements.thumbRectX=this.previousRectX=o,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=i,this.positionThumb(o,e),this.setZoomFactorPosition(o,e))}else this.isResizeRight&&(e=i>=40+this.scrollElements.thumbRectX&&i<=this.width-8?i-this.scrollElements.thumbRectX:this.previousWidth,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=i,this.positionThumb(this.startX,e),this.setZoomFactorPosition(this.startX,e),this.isLazyLoad||this.setZoomFactorPosition(this.startX,e))},e.prototype.positionThumb=function(e,t){var i=this.scrollElements;i.slider.setAttribute("x",e.toString()),i.slider.setAttribute("width",t.toString()),i.leftCircleEle.setAttribute("cx",e.toString()),i.rightCircleEle.setAttribute("cx",(e+t).toString()),i.setArrowDirection(e,t,this.height),i.gripCircle.setAttribute("transform","translate("+(e+t/2+5*(this.isVertical?1:-1))+","+(this.isVertical?"10":"5")+") rotate("+(this.isVertical?"180":"0")+")")},e.prototype.getDefaults=function(){var e=this.axis;this.axis.scrollbarSettings.enable&&(this.isLazyLoad=!0,this.getLazyDefaults(e)),this.isVertical="Vertical"===e.orientation,this.zoomFactor=this.isLazyLoad?this.zoomFactor:e.zoomFactor,this.zoomPosition=this.isLazyLoad?this.zoomPosition:e.zoomPosition;var t=this.zoomFactor*(this.isVertical?e.rect.height:e.rect.width);t=t>40?t:40,this.scrollX=e.rect.x,this.scrollY=e.rect.y,this.width=this.isVertical?e.rect.height:e.rect.width,this.height=16;var i=this.zoomPosition*(this.isVertical?e.rect.height:this.width),r=this.width-40-8;this.scrollElements.thumbRectX=i>r?r:i<8?8:i,this.scrollElements.thumbRectWidth=t+this.scrollElements.thumbRectX<this.width-16?t:this.width-this.scrollElements.thumbRectX-8},e.prototype.getLazyDefaults=function(e){var t,i,r=e.valueType,o=e.scrollbarSettings,n=e.scrollbarSettings.range,a=e.visibleRange,s=e.scrollbarSettings.pointsLength;this.valueType=r=o.range.minimum&&o.range.maximum||!o.pointsLength?r:"Double";var l={skeleton:"full",type:"dateTime"},h=this.component.intl.getDateParser(l),c=this.component.intl.getDateFormat(l);switch(r){case"Double":case"Category":case"Logarithmic":t=n.minimum?n.minimum:s?0:a.min,i=n.maximum?n.maximum:s?s-1:a.max;break;case"DateTime":case"DateTimeCategory":t=n.minimum?Date.parse(h(c(n.minimum))):a.min,i=n.maximum?Date.parse(h(c(n.maximum))):a.max}t=Math.min(t,a.min),i=Math.max(i,a.max);var d=(a.max-a.min)/(i-t),p=(a.min-t)/(i-t);this.zoomFactor=n.minimum||n.maximum?d:this.axis.maxPointLength/e.scrollbarSettings.pointsLength,this.zoomPosition=n.minimum||n.maximum?p:e.zoomPosition,this.scrollRange.min=t,this.scrollRange.max=i,this.scrollRange.delta=i-t,this.previousStart=a.min,this.previousEnd=a.max},e.prototype.getLogRange=function(e){var t=e.scrollbarSettings.range,i=v(t.minimum,e.logBase),r=v(t.maximum,e.logBase);return i=isFinite(i)?i:t.minimum,r=isFinite(i)?r:t.maximum,{minimum:Math.floor(i/1),maximum:Math.ceil(r/1)}},e.prototype.injectTo=function(t,i){t.zoomingScrollBar=new e(i,t)},e.prototype.destroy=function(){var e=this;this.axes?this.axes.map(function(e){e.zoomingScrollBar.destroy()}):(this.elements.map(function(i){e.unWireEvents(i),t.remove(i.firstChild)}),this.elements=[])},e.prototype.getModuleName=function(){return"ScrollBar"},e.prototype.getArgs=function(e,t,i,r,o){return{axis:this.component.isBlazor?{}:this.axis,name:e,range:this.axis.visibleRange,zoomFactor:this.axis.zoomFactor,zoomPosition:this.axis.zoomPosition,previousRange:t,previousZoomFactor:r,previousZoomPosition:i,currentRange:o}},e}(),Vn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.paretoAxes=[],t}return Vn(t,e),t.prototype.initSeries=function(e,t){var i=new nr(t,"series",e.properties,!0);i.name="Pareto",i.yAxisName=e.yAxisName+"_CumulativeAxis",i.category="Pareto",e.category="Pareto",i.type="Line",i.interior=t.themeStyle.errorBar,t.visibleSeries.push(i),this.initAxis(e,i,t)},t.prototype.initAxis=function(e,t,i){if(!this.paretoAxes.some(function(e){return e.name===t.yAxisName})){var r=e.yAxisName?i.axes.filter(function(t){return t.name===e.yAxisName})[0]:i.primaryYAxis,o=new ki(i,"axis",{name:t.yAxisName,majorGridLines:{width:0},majorTickLines:r.majorTickLines,lineStyle:r.lineStyle,minimum:0,maximum:100,rowIndex:r.rowIndex,opposedPosition:!0,labelFormat:"{value}%"});this.paretoAxes.push(o)}},t.prototype.render=function(e){e.chart.columnSeriesModule.render(e)},t.prototype.performCumulativeCalculation=function(e,t){for(var i=e,r=0,o=0,n=i.length,a=0;a<n;a++)r+=i[a][t.yName];for(a=0;a<n;a++)o+=i[a][t.yName],i[a][t.yName]=Math.round(o/r*100);return i},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"ParetoSeries"},t.prototype.destroy=function(){},t}(jr),Hn=function(){function e(e){this.chart=e}return e.prototype.export=function(e,t,i,r,o,n,a,s,l){var h=new xr(this.chart);r=r||[this.chart];var c={cancel:!1,name:"beforeExport",width:o,height:n};this.chart.trigger("beforeExport",c),c.cancel||h.export(e,t,i,r,o=c.width,n=c.height,a,s,l)},e.prototype.getDataUrl=function(e){return new xr(e).getDataUrl(e)},e.prototype.getModuleName=function(){return"Export"},e.prototype.destroy=function(){},e}(),Xn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yn=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Gn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property(null)],i.prototype,"content",void 0),Yn([t.Property("0")],i.prototype,"x",void 0),Yn([t.Property("0")],i.prototype,"y",void 0),Yn([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),Yn([t.Property("Chart")],i.prototype,"region",void 0),Yn([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),Yn([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),Yn([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),Wn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property(!1)],i.prototype,"visible",void 0),Yn([t.Property(!0)],i.prototype,"showZero",void 0),Yn([t.Property(null)],i.prototype,"name",void 0),Yn([t.Property("transparent")],i.prototype,"fill",void 0),Yn([t.Property("Inside")],i.prototype,"position",void 0),Yn([t.Property(5)],i.prototype,"rx",void 0),Yn([t.Property(5)],i.prototype,"ry",void 0),Yn([t.Property(0)],i.prototype,"angle",void 0),Yn([t.Property(!1)],i.prototype,"enableRotation",void 0),Yn([t.Complex({width:null,color:null},Yt)],i.prototype,"border",void 0),Yn([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Xt)],i.prototype,"font",void 0),Yn([t.Complex({},Ht)],i.prototype,"connectorStyle",void 0),Yn([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),Un=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property("50%")],i.prototype,"x",void 0),Yn([t.Property("50%")],i.prototype,"y",void 0),i}(t.ChildProperty),Zn=function(){function e(){this.visible=!0,this.symbolLocation=null,this.region=null,this.labelRegion=null,this.labelVisible=!0,this.regions=null,this.isExplode=!1,this.isClubbed=!1,this.isSliced=!1,this.argsData=null,this.isLabelUpdated=null,this.initialLabelRegion=null}return e}(),qn=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.points=[],t.clubbedPoints=[],t.sumOfPoints=0,t.isRectSeries=!0,t.clipRect=new i.Rect(0,0,0,0),t.category="Series",t.rightSidePoints=[],t.leftSidePoints=[],t}return Xn(o,e),o.prototype.refreshDataManager=function(e,i){var o=this,n=this.dataSource||e.dataSource;if(!(n instanceof r.DataManager)&&t.isNullOrUndefined(this.query))return void this.dataManagerSuccess({result:n,count:n.length},e,i);this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(t){return o.dataManagerSuccess(t,e)})},o.prototype.dataManagerSuccess=function(e,t,i){void 0===i&&(i=!0);var r={name:"seriesRender",series:this,data:e.result};t.allowServerDataBinding=!1,t.trigger("seriesRender",r),this.resultData=""!==e.result?e.result:[],t.isBlazor||i||this.getPoints(this.resultData,t),(++t.seriesCounts===t.visibleSeries.length&&i||window.Blazor&&!i&&1===t.seriesCounts)&&(this.getPoints(this.resultData,t),t.refreshChart())},o.prototype.getPoints=function(e,i){var r=Object.keys(e).length;if(this.sumOfPoints=0,0===r)return null;this.findSumOfPoints(e),this.points=[],this.clubbedPoints=[],this.sumOfClub=0;for(var o,n=this.palettes.length?this.palettes:h(i.theme),a=Be(this.groupTo,this.sumOfPoints),s=0;s<r;s++){(o=this.setPoints(e,s,n,i)).y;this.isClub(o,a,s)?(o.index=this.clubbedPoints.length,o.isExplode=!0,this.clubbedPoints.push(o),o.isSliced=!0):(t.isNullOrUndefined(o.y)&&(o.visible=!1),this.pushPoints(o,n))}if(this.lastGroupTo=this.groupTo,this.sumOfClub>0){var l=this.generateClubPoint();this.pushPoints(l,n);var c=this.points.length-1;this.clubbedPoints.map(function(e){e.index+=c,e.color=l.color})}this.clubbedPoints.length&&this.explode&&"Pie"===this.type&&(this.explodeAll||this.points[this.points.length-1].index===this.explodeIndex)&&(this.points.splice(this.points.length-1,1),this.points=this.points.concat(this.clubbedPoints))},o.prototype.generateClubPoint=function(){var e=new Zn;return e.isClubbed=!0,e.x="Others",e.y=this.sumOfClub,e.text=e.originalText=e.x+": "+this.sumOfClub,e.sliceRadius="80%",e},o.prototype.pushPoints=function(e,t){e.index=this.points.length,e.isExplode=this.explodeAll||e.index===this.explodeIndex,e.color=e.color||t[e.index%t.length],this.points.push(e)},o.prototype.isClub=function(e,i,r){if(!t.isNullOrUndefined(i)){if("Value"===this.groupMode&&Math.abs(e.y)<=i)return this.sumOfClub+=Math.abs(e.y),!0;if("Point"===this.groupMode&&r>=i)return this.sumOfClub+=Math.abs(e.y),!0}return!1},o.prototype.findSumOfPoints=function(e){for(var i=Object.keys(e).length,r=0;r<i;r++)t.isNullOrUndefined(e[r])||t.isNullOrUndefined(e[r][this.yName])||isNaN(e[r][this.yName])||(this.sumOfPoints+=Math.abs(e[r][this.yName]))},o.prototype.setPoints=function(e,i,r,o){var n=new Zn;return n.x=t.getValue(this.xName,e[i]),n.y=t.getValue(this.yName,e[i]),n.percentage=+(n.y/this.sumOfPoints*100).toFixed(2),n.legendImageUrl=t.getValue(this.legendImageUrl,e[i]),n.color=t.getValue(this.pointColorMapping,e[i]),n.text=n.originalText=t.getValue(this.dataLabel.name||"",e[i]),n.tooltip=t.getValue(this.tooltipMappingName||"",e[i]),n.sliceRadius=t.getValue(this.radius,e[i]),n.sliceRadius=t.isNullOrUndefined(n.sliceRadius)?"80%":n.sliceRadius,n.separatorY=o.intl.formatNumber(n.y,{useGrouping:o.useGroupingSeparator}),this.setAccEmptyPoint(n,i,e,r),n},o.prototype.renderSeries=function(e,t){var i=t?he(e.element.id+"_Series_"+this.index):e.renderer.createGroup({id:e.element.id+"_Series_"+this.index});this.renderPoints(e,i,t);var r;e.accumulationDataLabelModule&&this.dataLabel.visible&&((r=e.renderer.createGroup({id:e.element.id+"_datalabel_Series_"+this.index})).style.visibility=this.animation.enable&&e.animateSeries&&"Pie"===this.type?"hidden":"visible",this.renderDataLabel(e,r,t)),"Pie"===this.type&&(this.findMaxBounds(this.labelBound,this.accumulationBound),e.pieSeriesModule.animateSeries(e,this.animation,this,i)),e.accumulationLegendModule&&(this.labelBound.x-=e.explodeDistance,this.labelBound.y-=e.explodeDistance,this.labelBound.height+=e.explodeDistance-this.labelBound.y,this.labelBound.width+=e.explodeDistance-this.labelBound.x)},o.prototype.renderPoints=function(e,t,r){for(var o,n=e.element.id+"_Series_"+this.index+"_Point_",a=0,s=this.points;a<s.length;a++){var l=s[a],h={cancel:!1,name:"pointRender",series:this,point:l,fill:l.color,border:this.isEmpty(l)?{width:this.emptyPointSettings.border.width,color:this.emptyPointSettings.border.color}:{width:this.border.width,color:this.border.color}};e.trigger("pointRender",h),l.color=h.fill,o=new i.PathOption(n+l.index,l.color,h.border.width||1,h.border.color||l.color,this.opacity,"",""),e[G(this.type)+"SeriesModule"].renderPoint(l,this,e,o,t,r)}be(!1,e.getSeriesElement(),t,r)},o.prototype.renderDataLabel=function(e,i,r){e.accumulationDataLabelModule.findAreaRect();var o=t.createElement("div",{id:e.element.id+"_Series_0_DataLabelCollections"});this.leftSidePoints=[],this.rightSidePoints=[];for(var n=[],a=[],s=0,l=this.points;s<l.length;s++){var h=l[s];h.visible&&(this.dataLabel.showZero||!this.dataLabel.showZero&&(0!==h.y||0===h.y&&"Zero"===this.emptyPointSettings.mode))&&e.accumulationDataLabelModule.renderDataLabel(h,this.dataLabel,i,this.points,this.index,o,r),h.midAngle>=90&&h.midAngle<=270?this.leftSidePoints.push(h):h.midAngle>=0&&h.midAngle<=90?a.push(h):n.push(h)}if(n.sort(function(e,t){return e.midAngle-t.midAngle}),a.sort(function(e,t){return e.midAngle-t.midAngle}),this.leftSidePoints.sort(function(e,t){return e.midAngle-t.midAngle}),this.rightSidePoints=n.concat(a),e.accumulationDataLabelModule.drawDataLabels(this,this.dataLabel,i,o,r),null!==this.dataLabel.template&&o.childElementCount){var c=e.accumulationDataLabelModule.drawDataLabels.bind(e.accumulationDataLabelModule,this,this.dataLabel,i,o,r);e.isReact&&e.renderReactTemplates(c),be(!1,he(e.element.id+"_Secondary_Element"),o,r)}be(!1,e.getSeriesElement(),i,r)},o.prototype.findMaxBounds=function(e,t){e.x=t.x<e.x?t.x:e.x,e.y=t.y<e.y?t.y:e.y,e.height=t.y+t.height>e.height?t.y+t.height:e.height,e.width=t.x+t.width>e.width?t.x+t.width:e.width},o.prototype.setAccEmptyPoint=function(e,i,r,o){if(!t.isNullOrUndefined(e.y)&&!isNaN(e.y))return null;switch(e.color=this.emptyPointSettings.fill||e.color,this.emptyPointSettings.mode){case"Zero":e.y=0,e.visible=!0;break;case"Average":var n=r[i-1]?r[i-1][this.yName]||0:0,a=r[i+1]?r[i+1][this.yName]||0:0;e.y=(Math.abs(n)+Math.abs(a))/2,this.sumOfPoints+=e.y,e.visible=!0;break;default:e.visible=!1}},o.prototype.isEmpty=function(e){return e.color===this.emptyPointSettings.fill},Yn([t.Property("")],o.prototype,"dataSource",void 0),Yn([t.Property()],o.prototype,"query",void 0),Yn([t.Property("")],o.prototype,"xName",void 0),Yn([t.Property("")],o.prototype,"name",void 0),Yn([t.Property("")],o.prototype,"tooltipMappingName",void 0),Yn([t.Property("")],o.prototype,"yName",void 0),Yn([t.Property(!0)],o.prototype,"visible",void 0),Yn([t.Complex({color:null,width:0},Yt)],o.prototype,"border",void 0),Yn([t.Complex(null,qt)],o.prototype,"animation",void 0),Yn([t.Property("SeriesType")],o.prototype,"legendShape",void 0),Yn([t.Property("")],o.prototype,"legendImageUrl",void 0),Yn([t.Property("")],o.prototype,"pointColorMapping",void 0),Yn([t.Property(null)],o.prototype,"selectionStyle",void 0),Yn([t.Property(null)],o.prototype,"groupTo",void 0),Yn([t.Property("Value")],o.prototype,"groupMode",void 0),Yn([t.Complex({},Wn)],o.prototype,"dataLabel",void 0),Yn([t.Property([])],o.prototype,"palettes",void 0),Yn([t.Property(0)],o.prototype,"startAngle",void 0),Yn([t.Property(null)],o.prototype,"endAngle",void 0),Yn([t.Property("80%")],o.prototype,"radius",void 0),Yn([t.Property("0")],o.prototype,"innerRadius",void 0),Yn([t.Property("Pie")],o.prototype,"type",void 0),Yn([t.Property(!0)],o.prototype,"enableTooltip",void 0),Yn([t.Property(!1)],o.prototype,"explode",void 0),Yn([t.Property("30%")],o.prototype,"explodeOffset",void 0),Yn([t.Property(!1)],o.prototype,"explodeAll",void 0),Yn([t.Property(null)],o.prototype,"explodeIndex",void 0),Yn([t.Complex({mode:"Drop"},Kt)],o.prototype,"emptyPointSettings",void 0),Yn([t.Property(0)],o.prototype,"gapRatio",void 0),Yn([t.Property("80%")],o.prototype,"width",void 0),Yn([t.Property("80%")],o.prototype,"height",void 0),Yn([t.Property("20%")],o.prototype,"neckWidth",void 0),Yn([t.Property("20%")],o.prototype,"neckHeight",void 0),Yn([t.Property("Linear")],o.prototype,"pyramidMode",void 0),Yn([t.Property(1)],o.prototype,"opacity",void 0),o}(t.ChildProperty),Qn=function(){function e(e){this.accumulation=e}return Object.defineProperty(e.prototype,"center",{get:function(){return this.pieCenter||("Pie"===this.accumulation.visibleSeries[0].type?this.accumulation.pieSeriesModule.pieBaseCenter:null)},set:function(e){this.pieCenter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return void 0!==this.pieRadius?this.pieRadius:this.accumulation.pieSeriesModule.pieBaseRadius},set:function(e){this.pieRadius=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labelRadius",{get:function(){return void 0!==this.pieLabelRadius?this.pieLabelRadius:this.accumulation.pieSeriesModule.pieBaseLabelRadius},set:function(e){this.pieLabelRadius=e},enumerable:!0,configurable:!0}),e.prototype.isCircular=function(){return"Pie"===this.accumulation.type},e.prototype.isVariousRadius=function(){return this.accumulation.pieSeriesModule.isRadiusMapped},e.prototype.processExplode=function(e){if(e.target.id.indexOf("_Series_")>-1||e.target.id.indexOf("_datalabel_")>-1){var t=D(e.target.id).point;if(isNaN(t)||e.target.id.indexOf("_datalabel_")>-1&&"Outside"===this.accumulation.visibleSeries[0].points[t].labelPosition)return null;this.explodePoints(t,this.accumulation),this.deExplodeAll(t,this.accumulation.enableAnimation?300:0)}},e.prototype.invokeExplode=function(){for(var e=this.accumulation.visibleSeries[0],t=this.accumulation.enableAnimation?300:0,i=0,r=e.points;i<r.length;i++){var o=r[i];o.isExplode&&this.pointExplode(o.index,o,t)}if(this.accumulation.accumulationSelectionModule&&"None"!==this.accumulation.selectionMode&&this.accumulation.accumulationSelectionModule.selectedDataIndexes.length)for(var n=0,a=this.accumulation.accumulationSelectionModule.selectedDataIndexes;n<a.length;n++){var s=a[n];this.explodePoints(s.point,this.accumulation,!0),this.deExplodeAll(s.point,t)}},e.prototype.deExplodeAll=function(e,t){for(var i=this.accumulation.element.id+"_Series_0_Point_",r=0,o=this.accumulation.visibleSeries[0].points;r<o.length;r++){var n=o[r];(e!==n.index&&!n.isSliced||n.isClubbed)&&(n.isExplode=!1,this.deExplodeSlice(n.index,i,t))}},e.prototype.explodePoints=function(e,i,r){void 0===r&&(r=!1);var o=i.visibleSeries[0],n=o.points,a=et(e,n),s=!0,l=this.accumulation.enableAnimation?300:0;if(t.isNullOrUndefined(a))return null;var h=!r&&(a.isSliced||o.clubbedPoints.length&&n[n.length-1].index===o.clubbedPoints[o.clubbedPoints.length-1].index);"Pie"===o.type&&(h||a.isClubbed)&&(s=this.clubPointExplode(e,a,o,n,i,l,h)),s&&this.pointExplode(e,a,l,r)},e.prototype.getSum=function(e){var t=0;return e.map(function(e){t+=e.visible?e.y:0}),t},e.prototype.clubPointExplode=function(e,t,i,r,o,n,a){if(void 0===a&&(a=!1),t.isClubbed)return o.animateSeries=!1,r.splice(r.length-1,1),i.clubbedPoints.map(function(e){e.visible=!0,e.isExplode=!0}),o.visibleSeries[0].points=r.concat(i.clubbedPoints),this.deExplodeAll(e,n),i.sumOfPoints=this.getSum(o.visibleSeries[0].points),o.refreshChart(),!1;if(a||t.isSliced){o.animateSeries=!1,r.splice(r.length-i.clubbedPoints.length,i.clubbedPoints.length);var s=i.generateClubPoint();if(s.index=r.length,s.color=i.clubbedPoints[0].color,r.push(s),i.sumOfPoints=this.getSum(r),this.deExplodeAll(e,n),s.isExplode=!1,o.visibleSeries[0].points=r,o.refreshChart(),this.pointExplode(s.index,r[s.index],0,!0),s.isExplode=!1,this.deExplodeSlice(s.index,o.element.id+"_Series_0_Point_",n),t.isSliced)return!1}return!0},e.prototype.pointExplode=function(e,t,i,r){var o,n=this.accumulation.element.id+"_Series_0_Point_",a=this.accumulation;o=this.isCircular()?M(t.midAngle,a.explodeDistance,this.center):{x:t.labelRegion&&t.labelRegion.x<t.region.x?-a.explodeDistance:a.explodeDistance,y:0},this.isExplode(n+e)||r?(t.isExplode=!0,this.explodeSlice(e,o,n,this.center||{x:0,y:0},i)):(t.isExplode=!1,this.deExplodeSlice(e,n,i))},e.prototype.isExplode=function(e){var t=he(e),i=t?t.getAttribute("transform"):null;return t&&("translate(0, 0)"===i||null===i||"translate(0)"===i)},e.prototype.deExplodeSlice=function(e,t,i){var r=he(t+e);r&&r.parentNode.lastChild.hasAttribute("transform")&&r.parentNode.lastChild.removeAttribute("transform");var o=r?r.getAttribute("transform"):null;if(this.accumulation.enableAnimation&&r&&o&&"translate(0, 0)"!==o&&"translate(0)"!==o){var n=/translate\((-?\d+\.?\d*),?\s*(-?\d+[.]?\d*)?\)/.exec(o);this.performAnimation(e,t,0,0,+n[1],+n[2]||0,i,!0)}else this.performAnimation(e,t,0,0,0,0,i,!0)},e.prototype.setTranslate=function(e,t,i,r){this.setElementTransform(t+e,i),this.accumulation.visibleSeries[0].dataLabel.visible&&(t=this.accumulation.element.id+"_datalabel_Series_0_",this.setElementTransform(t+"shape_"+e,i),this.setElementTransform(t+"text_"+e,i+r),this.setElementTransform(t+"connector_"+e,i))},e.prototype.setElementTransform=function(e,t){var i=he(e);i&&i.setAttribute("transform",t)},e.prototype.explodeSlice=function(e,t,i,r,o){this.performAnimation(e,i,0,0,t.x-r.x,t.y-r.y,o)},e.prototype.performAnimation=function(e,i,r,o,n,a,s,l){var h=this,c=this.accumulation,d=i.split("_"),p=parseInt(i.split("_")[d.length-3],10),u=c.visibleSeries[p].points[e];if(s<=0)return this.setTranslate(e,i,"translate("+n+", "+a+")",u.transform),null;var g,y;new t.Animation({}).animate(t.createElement("div"),{duration:s,progress:function(t){g=q(t.timeStamp,r,n,t.duration),y=q(t.timeStamp,o,a,t.duration),h.setTranslate(e,i,"translate("+(l?n-g:g)+", "+(l?a-y:y)+")",u.transform)},end:function(){h.setTranslate(e,i,"translate("+(l?r:n)+", "+(l?r:a)+")",u.transform)}})},e}(),$n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return $n(r,e),r.prototype.initProperties=function(e,t){this.accumulation=e,this.size=Math.min(e.initialClipRect.width,e.initialClipRect.height),this.initAngles(t);var i=parseInt(t.radius,10);if(-1===t.radius.indexOf("%")&&"number"!=typeof i||isNaN(i)){var r=[];this.isRadiusMapped=!0;for(var o=0;o<Object.keys(t.points).length;o++)-1!==t.points[o].sliceRadius.indexOf("%")?r[o]=Be(t.points[o].sliceRadius,this.size/2):r[o]=parseInt(t.points[o].sliceRadius,10);var n=Math.min.apply(null,r),a=Math.max.apply(null,r);this.pieBaseRadius=this.seriesRadius=a,this.innerRadius=Be(t.innerRadius,this.seriesRadius),this.innerRadius=this.innerRadius>n?this.innerRadius/2:this.innerRadius}else this.isRadiusMapped=!1,this.pieBaseRadius=Be(t.radius,this.size/2),this.innerRadius=Be(t.innerRadius,this.pieBaseRadius),this.pieBaseLabelRadius="Inside"===t.dataLabel.position?(this.pieBaseRadius-this.innerRadius)/2+this.innerRadius:this.pieBaseRadius+Be(t.dataLabel.connectorStyle.length||"4%",this.size/2);this.radius=this.pieBaseRadius,this.labelRadius=this.pieBaseLabelRadius,e.explodeDistance=t.explode?Be(t.explodeOffset,this.pieBaseRadius):0,this.findCenter(e,t),this.center=this.pieBaseCenter,this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position),this.totalAngle-=.001},r.prototype.getLabelRadius=function(e,t){return"Inside"===e.dataLabel.position?(Be(t.sliceRadius,this.pieBaseRadius)-this.innerRadius)/2+this.innerRadius:Be(t.sliceRadius,this.seriesRadius)+Be(e.dataLabel.connectorStyle.length||"4%",this.size/2)},r.prototype.findCenter=function(e,t){this.accumulation=e,this.pieBaseCenter={x:Be(e.center.x,e.initialClipRect.width)+e.initialClipRect.x,y:Be(e.center.y,e.initialClipRect.height)+e.initialClipRect.y};var i=this.getSeriesBound(t),r=new Vi(i.x+i.width/2,i.y+i.height/2);this.pieBaseCenter.x+=this.pieBaseCenter.x-r.x,this.pieBaseCenter.y+=this.pieBaseCenter.y-r.y,this.accumulation.origin=this.pieBaseCenter},r.prototype.initAngles=function(e){var i=t.isNullOrUndefined(e.endAngle)?e.startAngle:e.endAngle;this.totalAngle=(i-e.startAngle)%360,this.startAngle=e.startAngle-90,this.totalAngle=this.totalAngle<=0?360+this.totalAngle:this.totalAngle,this.startAngle=(this.startAngle<0?this.startAngle+360:this.startAngle)%360},r.prototype.defaultLabelBound=function(e,t,r){var o=this.getSeriesBound(e);e.accumulationBound=o,e.labelBound=new i.Rect(o.x,o.y,o.width+o.x,o.height+o.y),t&&"Outside"===r&&(e.labelBound=new i.Rect(1/0,1/0,-1/0,-1/0))},r.prototype.getSeriesBound=function(e){var t=new i.Rect(1/0,1/0,-1/0,-1/0);this.initAngles(e);var r=this.startAngle,o=this.totalAngle,n=(this.startAngle+o)%360;n=0===n?360:n,e.findMaxBounds(t,this.getRectFromAngle(r)),e.findMaxBounds(t,this.getRectFromAngle(n)),e.findMaxBounds(t,new i.Rect(this.pieBaseCenter.x,this.pieBaseCenter.y,0,0));var a=(90*Math.floor(r/90)+90)%360,s=90*Math.floor(n/90)%360;s=0===s?360:s,(o>=90||s===a)&&(e.findMaxBounds(t,this.getRectFromAngle(a)),e.findMaxBounds(t,this.getRectFromAngle(s))),(0===r||r+o>=360)&&e.findMaxBounds(t,this.getRectFromAngle(0));for(var l=a===s?0:Math.floor(o/90),h=1;h<l;h++)((a+=90)<s||n<r||360===o)&&e.findMaxBounds(t,this.getRectFromAngle(a));return t.width-=t.x,t.height-=t.y,t},r.prototype.getRectFromAngle=function(e){var t=M(e,this.pieBaseRadius,this.pieBaseCenter);return new i.Rect(t.x,t.y,0,0)},r.prototype.getPathArc=function(e,t,i,r,o){var n=i-t,a=(n=n<0?n+360:n)<180?0:1;return o||0!==o?this.getDoughnutPath(e,M(t,r,e),M(i,r,e),r,M(t,o,e),M(i,o,e),o,a):this.getPiePath(e,M(t,r,e),M(i,r,e),r,a)},r.prototype.getPiePath=function(e,t,i,r,o){return"M "+e.x+" "+e.y+" L "+t.x+" "+t.y+" A "+r+" "+r+" 0 "+o+" 1 "+i.x+" "+i.y+" Z"},r.prototype.getDoughnutPath=function(e,t,i,r,o,n,a,s){return"M "+t.x+" "+t.y+" A "+r+" "+r+" 0 "+s+" 1 "+i.x+" "+i.y+" L "+n.x+" "+n.y+" A "+a+" "+a+" 0 "+s+",0 "+o.x+" "+o.y+" Z"},r.prototype.doAnimation=function(e,i){var r,o=this,n=i.startAngle-90,a=this.accumulation.duration?this.accumulation.duration:i.animation.duration;this.pieBaseCenter.x+=1;var s=.75*Math.max(this.accumulation.availableSize.height,this.accumulation.availableSize.width);s+=.414*s;var l=Z("Linear");new t.Animation({}).animate(e,{duration:a,delay:i.animation.delay,progress:function(t){r=l(t.timeStamp,n,o.totalAngle,t.duration),e.setAttribute("d",o.getPathArc(o.pieBaseCenter,n,r,s,0))},end:function(){o.pieBaseCenter.x-=1,e.setAttribute("d",o.getPathArc(o.pieBaseCenter,0,359.99999,s,0)),o.accumulation.trigger("animationComplete",o.accumulation.isBlazor?{}:{series:i,accumulation:o.accumulation,chart:o.accumulation}),he(o.accumulation.element.id+"_datalabel_Series_"+i.index).style.visibility=o.accumulation.isDestroyed?"hidden":"visible"}})},r}(Qn),Kn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ea=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Kn(r,e),r.prototype.renderPoint=function(e,t,i,r,o,n){var a=t.sumOfPoints;e.startAngle=this.startAngle;var s=e.visible?e.y:0,l=a?Math.abs(s)/a*this.totalAngle:null,h=Math.PI/180*(90-(360-this.startAngle)-90);this.radius=this.isRadiusMapped?Be(e.sliceRadius,this.seriesRadius):this.radius,r.d=this.getPathOption(e,l,this.startAngle%360),e.midAngle=(this.startAngle-l/2)%360,e.endAngle=this.startAngle%360,e.symbolLocation=M(e.midAngle,(this.radius+this.innerRadius)/2,this.center),n?(o.appendChild(i.renderer.drawPath(r)),this.refresh(e,l,h,i,r)):(o.appendChild(i.renderer.drawPath(r)),e.degree=l,e.start=h)},r.prototype.findSeries=function(e){var t=0===this.innerRadius?this.radius+3:this.innerRadius-3,i=0===this.innerRadius?t+2:t-2;this.toggleInnerPoint(e,t,i)},r.prototype.toggleInnerPoint=function(e,r,o){var n,a=D(e.target.id,!0),s=e.target.id.substring(0,e.target.id.indexOf("Series")-1),l=document.getElementById(this.accumulation.element.id+"PointHover_Border"),h=a.series,c=a.point,d=he(s+"_Series_"+h+"_Point_"+c);if(!isNaN(a.series)&&d){if(!(t.isNullOrUndefined(h)||isNaN(h)||t.isNullOrUndefined(c)||isNaN(c))){var p=this.accumulation.visibleSeries[0].points[c],u=d.getAttribute("class")===s+"_ej2_deselected"?this.accumulation.tooltip.enable?.5:.3:this.accumulation.tooltip.enable?.5:1,g=this.getPathArc(this.accumulation.pieSeriesModule.center,p.startAngle%360,(p.startAngle+p.degree)%360,r,o);l&&s===this.accumulation.element.id&&(l.getAttribute("d")!==g||p.isExplode)&&(l.parentNode.removeChild(l),l=null);var y=he(s+"_Series_"+h);if(!l&&(!p.isExplode||p.isExplode&&"click"!==e.type)){var m=new i.PathOption(s+"PointHover_Border",p.color,1,p.color,u,"",g);if((n=this.accumulation.renderer.drawPath(m)).removeAttribute("transform"),"None"!==this.accumulation.selectionMode&&e.target.hasAttribute("class")&&this.accumulation.accumulationSelectionModule.addSvgClass(n,e.target.getAttribute("class")),y.appendChild(n),p.isExplode&&n){var v=d.getAttribute("transform");n.setAttribute("transform",v)}}}}else l&&(this.removeBorder(l,1e3),l=null)},r.prototype.removeBorder=function(e,t){e&&setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},t)},r.prototype.refresh=function(e,i,r,o,n){var a=this,s=he(n.id),l=o.duration?o.duration:300;new t.Animation({}).animate(t.createElement("div"),{duration:l,delay:0,progress:function(t){var n=q(t.timeStamp,e.degree,i-e.degree,t.duration),l=q(t.timeStamp,e.start,r-e.start,t.duration);l=(l/(Math.PI/180)+360)%360,s.setAttribute("d",a.getPathOption(e,n,l)),e.isExplode&&o.accBaseModule.explodePoints(e.index,o,!0),s.style.visibility="visible"},end:function(){s.style.visibility=e.visible?"visible":"hidden",s.setAttribute("d",n.d),e.degree=i,e.start=r}})},r.prototype.getPathOption=function(e,t,i){if(!t)return"";var r=this.getPathArc(this.center,i%360,(i+t)%360,this.isRadiusMapped?Be(e.sliceRadius,this.seriesRadius):this.radius,this.innerRadius);return this.startAngle+=t,r},r.prototype.animateSeries=function(e,t,r,o){var n=e.element.id+"SeriesGroup"+r.index;if(r.animation.enable&&e.animateSeries){var a=e.renderer.createClipPath({id:n+"_clipPath"}),s=new i.PathOption(n+"_slice","transparent",1,"transparent",1,"",""),l=e.renderer.drawPath(s);a.appendChild(l),e.svgObject.appendChild(a),o.setAttribute("style","clip-path:url(#"+a.id+"); -webkit-clip-path:url(#"+a.id+");"),this.doAnimation(l,r)}},r.prototype.getModuleName=function(){return"PieSeries"},r.prototype.destroy=function(){},r}(Jn),ta=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ia=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ra=function(r){function o(e,t){var i=r.call(this,e,t)||this;return i.animateselected=!1,i.explodeDistance=0,i.chartid=57724,i}return ta(o,r),o.prototype.animate=function(e){this.duration=e||700,this.animateselected=!0,this.animateSeries=!1;var t=0,i=[],r=[],o=[],n=this.visibleSeries[0],a=[];if(a=n.dataSource,n.sumOfPoints=0,n.points.length<Object.keys(n.dataSource).length)this.refresh();else if(n.points.length>Object.keys(n.dataSource).length){var s=this.visibleSeries[0];s.points=s.points.filter(function(e){return e.visible=!1,r.push(e.index),i.push(e.color),a.some(function(i){var r=i;return e.x===r.x&&(e.visible=!0,o.push(e.index),e.index=t,t++),e.x===r.x})});for(var l=r.filter(function(e){return o.indexOf(e)<0}),h=r.length-l.length,c=r.length-1;c>=h;c--)m("container_Series_0_Point_"+r[c]);for(c=0;c<s.points.length;c++)s.points[c].y=s.dataSource[c].y,s.points[c].color=i[c],s.sumOfPoints+=s.dataSource[c].y;this.redraw=this.enableAnimation,this.animateSeries=!1,this.calculateBounds(),this.renderElements()}else{for(c=0;c<n.points.length;c++)n.points[c].y=n.dataSource[c][n.yName],n.points[c].color=null!=n.dataSource[c][n.pointColorMapping]?n.dataSource[c][n.pointColorMapping]:n.points[c].color,n.sumOfPoints+=n.dataSource[c][n.yName];this.redraw=this.enableAnimation,this.animateSeries=!1,this.removeSvg(),this.refreshPoints(n.points),this.renderElements()}},Object.defineProperty(o.prototype,"type",{get:function(){return this.series&&this.series.length?this.series[0].type:"Pie"},enumerable:!0,configurable:!0}),o.prototype.preRender=function(){if(this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.setCulture(),this.animateSeries=!0,""===this.element.id){var e=document.getElementsByClassName("e-accumulationchart").length;this.element.id="acc_chart_"+this.chartid+"_"+e}je(this),this.wireEvents()},o.prototype.setTheme=function(){this.themeStyle=c(this.theme)},o.prototype.render=function(){var e=this;-1===this.element.className.indexOf("e-accumulationchart")&&this.element.classList.add("e-accumulationchart");var t={chart:this.isBlazor?{}:this,accumulation:this.isBlazor?{}:this,theme:this.theme,name:"load",cancel:!1};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.accBaseModule=new Qn(e),e.pieSeriesModule=new ea(e),e.calculateVisibleSeries(),e.processData(),e.renderComplete(),e.allowServerDataBinding=!0})},o.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,r=t.Browser.touchMoveEvent,o=t.Browser.touchEndEvent,n=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,r,this.accumulationMouseMove),t.EventHandler.remove(this.element,o,this.accumulationMouseEnd),t.EventHandler.remove(this.element,i,this.accumulationMouseStart),t.EventHandler.remove(this.element,"click",this.accumulationOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.accumulationRightClick),t.EventHandler.remove(this.element,n,this.accumulationMouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResize)},o.prototype.wireEvents=function(){if(this.element){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,r=t.Browser.touchEndEvent,o=t.Browser.touchMoveEvent,n=e?"pointerleave":"mouseleave";t.EventHandler.add(this.element,o,this.accumulationMouseMove,this),t.EventHandler.add(this.element,r,this.accumulationMouseEnd,this),t.EventHandler.add(this.element,i,this.accumulationMouseStart,this),t.EventHandler.add(this.element,"click",this.accumulationOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.accumulationRightClick,this),t.EventHandler.add(this.element,n,this.accumulationMouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResize.bind(this)),new t.Touch(this.element),this.setStyle(this.element)}},o.prototype.setMouseXY=function(e){var t,i,r=he(this.element.id+"_svg");if(r&&this.element){var o=r.getBoundingClientRect(),n=this.element.getBoundingClientRect();if(e.type.indexOf("touch")>-1){this.isTouch=!0;var a=e;i=a.changedTouches[0].clientY,t=a.changedTouches[0].clientX}else this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,i=e.clientY;this.mouseY=i-n.top-Math.max(o.top-n.top,0),this.mouseX=t-n.left-Math.max(o.left-n.left,0)}},o.prototype.accumulationMouseEnd=function(e){return this.setMouseXY(e),this.trigger("chartMouseUp",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.isTouch&&(this.titleTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.accumulationDataLabelModule&&this.visibleSeries[0].dataLabel.visible&&this.accumulationDataLabelModule.move(e,this.mouseX,this.mouseY,this.isTouch),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.move(e)),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.accumulationMouseStart=function(e){return this.setMouseXY(e),this.trigger("chartMouseDown",{target:e.target.id,x:this.mouseX,y:this.mouseY}),!1},o.prototype.accumulationResize=function(){var e=this;this.animateSeries=!1;var t={accumulation:this.isBlazor?{}:this,previousSize:new i.Size(this.availableSize.width,this.availableSize.height),name:"resized",currentSize:new i.Size(0,0),chart:this.isBlazor?{}:this},r={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger("beforeResize",r),r.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);je(e),t.currentSize=e.availableSize,e.trigger("resized",t),e.refreshSeries(),e.refreshChart()},500)),!1},o.prototype.print=function(e){var t=document.getElementById(this.element.id+"_Series_0").style.clipPath;document.getElementById(this.element.id+"_Series_0").style.clipPath="",new xr(this).print(e),document.getElementById(this.element.id+"_Series_0").style.clipPath=t},o.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport&&this.exportModule.getDataUrl(this))},o.prototype.setStyle=function(e){e.style.touchAction="element",e.style.msTouchAction="element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},o.prototype.setAnnotationValue=function(e,t){var i,r=this.annotations[e],o=he(this.element.id+"_Annotation_Collections");t&&(r.content=t,o?(i=this.createElement("div"),m(this.element.id+"_Annotation_"+e),this.annotationModule.processAnnotation(r,e,i),o.appendChild(i.children[0])):this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element")))},o.prototype.accumulationMouseMove=function(e){return!!he(this.element.id+"_svg")&&(this.setMouseXY(e),this.trigger("chartMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent("pointMove",e.target,e),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.move(e),this.accumulationDataLabelModule&&this.visibleSeries[0]&&this.visibleSeries[0].dataLabel.visible&&this.accumulationDataLabelModule.move(e,this.mouseX,this.mouseY),this.isTouch||this.titleTooltip(e,this.mouseX,this.mouseY),this.enableBorderOnMouseMove&&"Pie"===this.type&&this.pieSeriesModule&&j(this.mouseX,this.mouseY,this.initialClipRect)&&this.pieSeriesModule.findSeries(e),this.notify(t.Browser.touchMoveEvent,e),!1)},o.prototype.titleTooltip=function(e,t,i,r){var o=e.target.id,n=o===this.element.id+"_title"||o===this.element.id+"_subTitle"||o===this.element.id+"_chart_legend_title";e.target.textContent.indexOf("...")>-1&&n?f(o===this.element.id+"_title"?this.title:o===this.element.id+"_subTitle"?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",he(this.element.id+"_Secondary_Element"),r):m(this.element.id+"_EJ2_Title_Tooltip")},o.prototype.accumulationOnMouseClick=function(e){return this.setMouseXY(e),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.click(e),"None"!==this.selectionMode&&this.accumulationSelectionModule&&this.accumulationSelectionModule.calculateSelectedElements(this,e),this.visibleSeries[0].explode&&this.accBaseModule.processExplode(e),this.enableBorderOnMouseMove&&this.pieSeriesModule&&"Pie"===this.type&&this.pieSeriesModule.findSeries(e),this.trigger("chartMouseClick",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointClick&&this.triggerPointEvent("pointClick",e.target,e),!1},o.prototype.triggerPointEvent=function(e,t,i){var r=i,o=D(t.id,!0);o.series>=0&&o.point>=0&&this.trigger(e,{series:this.isBlazor?{}:this.series[o.series],point:this.series[o.series].points[o.point],seriesIndex:o.series,pointIndex:o.point,x:this.mouseX,y:this.mouseY,pageX:r.pageX,pageY:r.pageY})},o.prototype.accumulationRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.accumulationMouseLeave=function(e){this.setMouseXY(e),this.trigger("chartMouseLeave",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.notify(t.Browser.isPointer?"pointerleave":"mouseleave",e);var i=document.getElementById(this.element.id+"PointHover_Border");return i&&(this.pieSeriesModule.removeBorder(i,1e3),i=null),!1},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.createPieSvg=function(){this.removeSvg(),He(this)},o.prototype.removeSvg=function(){if(this.redraw)return null;if(Ue(this),m(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}m("EJ2_legend_tooltip"),m("EJ2_datalabel_tooltip"),m(this.element.id+"PointHover_Border")},o.prototype.createSecondaryElement=function(){var e=Fe(this.redraw,this.element.id+"_Secondary_Element")||this.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: relative"});be(!1,this.element,e,this.redraw)},o.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e=0,t=this.series.length;e<t;e++)if(this.series[e].index=e,this.series[e].type===this.type&&0===this.visibleSeries.length){this.visibleSeries.push(this.series[e]);break}},o.prototype.processData=function(e){void 0===e&&(e=!0),this.seriesCounts=0;for(var t=0,i=this.visibleSeries;t<i.length;t++){var r=i[t];r.dataModule=new ar(r.dataSource||this.dataSource,r.query),r.refreshDataManager(this,e)}},o.prototype.refreshChart=function(){this.doGrouppingProcess(),this.createPieSvg(),this.calculateBounds(),this.renderElements(),m("chartmeasuretext")},o.prototype.doGrouppingProcess=function(){var e=this.visibleSeries[0];t.isNullOrUndefined(e.resultData)||t.isNullOrUndefined(e.lastGroupTo)||e.lastGroupTo===e.groupTo||e.getPoints(e.resultData,this)},o.prototype.calculateBounds=function(){this.initialClipRect=new i.Rect(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height),this.titleCollection=[],this.subTitleCollection=[];var e=0,t=0,r=0,o=0;if(this.titleCollection=Xe(this.title,this.titleStyle,this.initialClipRect.width),e=this.title?i.measureText(this.title,this.titleStyle).height*this.titleCollection.length:e,this.subTitle){for(var n=0,a=this.titleCollection;n<a.length;n++){var s=a[n];r=(o=i.measureText(s,this.titleStyle).width)>r?o:r}this.subTitleCollection=Xe(this.subTitle,this.subTitleStyle,r),t=i.measureText(this.subTitle,this.subTitleStyle).height*this.subTitleCollection.length}R(this.initialClipRect,new i.Rect(0,t+e,this.margin.right+this.margin.left,this.margin.bottom+this.margin.top)),this.calculateLegendBounds()},o.prototype.calculateLegendBounds=function(){if(!this.accumulationLegendModule||!this.legendSettings.visible)return null;this.accumulationLegendModule.getLegendOptions(this,this.visibleSeries),this.accumulationLegendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null)},o.prototype.renderElements=function(){this.renderBorder(),this.createSecondaryElement(),this.renderSeries(),this.renderTitle(),this.renderLegend(),be(!1,this.element,this.svgObject,this.redraw),this.processSelection(),this.processExplode(),this.renderAnnotation(),this.setSecondaryElementPosition(),t.updateBlazorTemplate(this.element.id+"_DataLabel","Template",this.series[0].dataLabel),this.trigger("loaded",{accumulation:this.isBlazor?{}:this,chart:this.isBlazor?{}:this}),this.animateSeries=!1},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},o.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element"))},o.prototype.processExplode=function(){return this.redraw?null:this.visibleSeries[0].explode?void this.accBaseModule.invokeExplode():null},o.prototype.renderSeries=function(){this.redraw||this.svgObject.appendChild(this.renderer.createGroup({id:this.element.id+"_SeriesCollection"}));for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];i.visible&&this[G(i.type)+"SeriesModule"]&&(this[G(i.type)+"SeriesModule"].initProperties(this,i),i.renderSeries(this,this.redraw))}},o.prototype.renderBorder=function(){var e=this.border.width;be(!1,this.svgObject,this.renderer.drawRectangle(new Di(this.element.id+"_border",this.background||this.themeStyle.background,this.border,1,new i.Rect(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e))),this.redraw);var t=this.backgroundImage;if(t){var r=new Bi(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"_background","visible","none");be(!1,this.svgObject,this.renderer.drawImage(r),this.redraw)}},o.prototype.renderLegend=function(){if(!this.accumulationLegendModule||!this.legendSettings.visible)return null;this.accumulationLegendModule.legendCollections.length&&("Pie"===this.visibleSeries[0].type&&this.accumulationLegendModule.getSmartLegendLocation(this.visibleSeries[0].labelBound,this.accumulationLegendModule.legendBounds,this.margin),this.accumulationLegendModule.renderLegend(this,this.legendSettings,this.accumulationLegendModule.legendBounds,this.redraw))},o.prototype.processSelection=function(){if(!this.accumulationSelectionModule||"None"===this.selectionMode)return null;var e=t.extend([],this.accumulationSelectionModule.selectedDataIndexes,null,!0);this.accumulationSelectionModule.invokeSelection(this),e.length>0&&(this.accumulationSelectionModule.selectedDataIndexes=e,this.accumulationSelectionModule.redrawSelection(this))},o.prototype.renderTitle=function(){var e=this.margin;if(!this.title)return null;var t=this.titleStyle.textAlignment,r="Near"===t?"start":"Far"===t?"end":"middle",o=i.measureText(this.title,this.titleStyle),n=new i.Rect(e.left,0,this.availableSize.width-e.left-e.right,0),a=new i.TextOption(this.element.id+"_title",Ye(n,this.titleStyle),this.margin.top+3*o.height/4,r,this.titleCollection,"","auto"),s=Ve(this.renderer,a,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitle,this.svgObject,!1,this.redraw);s&&s.setAttribute("aria-label",this.title),this.subTitle&&this.renderSubTitle(a)},o.prototype.renderSubTitle=function(e){for(var t=0,r=0,o=this.titleStyle.textAlignment,n=i.measureText(this.subTitle,this.subTitleStyle),a=0,s=this.titleCollection;a<s.length;a++){var l=s[a];t=(r=i.measureText(l,this.titleStyle).width)>t?r:t}var h=new i.Rect("Center"===o?e.x-t/2:"Far"===o?e.x-t:e.x,0,t,0),c=new i.TextOption(this.element.id+"_subTitle",Ye(h,this.subTitleStyle),e.y*e.text.length+3*n.height/4+10,function(e){return"Near"===e?"start":"Far"===e?"end":"middle"}(this.subTitleStyle.textAlignment),this.subTitleCollection,"","auto");Ve(this.renderer,c,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartTitle,this.svgObject,!1,this.redraw)},o.prototype.getSeriesElement=function(){return this.svgObject.getElementsByTagName("g")[0]},o.prototype.refreshSeries=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];this.refreshPoints(i.points)}},o.prototype.refreshPoints=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r.labelPosition=null,r.labelRegion=null,r.labelVisible=!0}},o.prototype.getModuleName=function(){return"accumulationchart"},o.prototype.destroy=function(){this.element&&(this.unWireEvents(),r.prototype.destroy.call(this),this.element.classList.remove("e-accumulationchart"),this.removeSvg(),this.svgObject=null)},o.prototype.requiredModules=function(){var e=[];return e.push({member:this.type+"Series",args:[this]}),this.legendSettings.visible&&e.push({member:"AccumulationLegend",args:[this]}),this.findDatalabelVisibility()&&e.push({member:"AccumulationDataLabel",args:[this]}),this.tooltip.enable&&e.push({member:"AccumulationTooltip",args:[this]}),"None"!==this.selectionMode&&e.push({member:"AccumulationSelection",args:[this]}),(this.enableExport||this.allowExport)&&e.push({member:"Export",args:[this]}),this.annotations.some(function(e){return null!==e.content})&&e.push({member:"Annotation",args:[this]}),e},o.prototype.findDatalabelVisibility=function(){for(var e=0,t=this.series;e<t.length;e++)if(t[e].dataLabel.visible)return!0;return!1},o.prototype.changeVisibleSeries=function(e,t){for(var i=0,r=e;i<r.length;i++){var o=r[i];if(t===o.index)return o}return null},o.prototype.getPersistData=function(){return""},o.prototype.onPropertyChanged=function(e,i){for(var o={refreshElements:!1,refreshBounds:!1},n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"theme":this.animateSeries=!0;break;case"title":case"subTitle":case"height":case"width":case"margin":o.refreshBounds=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?o.refreshBounds=!0:o.refreshElements=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?o.refreshBounds=!0:o.refreshElements=!0;break;case"legendSettings":o.refreshBounds=!0,o.refreshElements=!0;break;case"dataSource":this.processData(!1),o.refreshBounds=!0;break;case"series":if(!this.animateselected){for(var s=this.series.length,l=!1,h=void 0,c=void 0,d=0;d<s;d++)h=e.series[d],this.isBlazor&&(h.startAngle||h.endAngle||h.explodeOffset||h.neckHeight||h.neckWidth||h.radius||h.innerRadius||h.groupMode||h.emptyPointSettings)&&(c=!0),e.series[d]&&(e.series[d].dataSource||e.series[d].yName||e.series[d].xName||e.series[d].dataLabel||c)&&(t.extend(this.changeVisibleSeries(this.visibleSeries,d),h,null,!0),l=!0),e.series[d]&&e.series[d].explodeIndex&&e.series[d].explodeIndex!==i.series[d].explodeIndex&&(this.accBaseModule.explodePoints(e.series[d].explodeIndex,this),this.accBaseModule.deExplodeAll(e.series[d].explodeIndex,this.enableAnimation?300:0));l&&(this.processData(!1),o.refreshBounds=!0)}this.animateselected=!1,this.redraw=!1;break;case"locale":case"currencyCode":r.prototype.refresh.call(this);break;case"background":case"border":case"annotations":case"enableSmartLabels":o.refreshElements=!0;break;case"isMultiSelect":case"selectedDataIndexes":case"selectionMode":this.accumulationSelectionModule&&(t.isNullOrUndefined(this.accumulationSelectionModule.selectedDataIndexes)?this.accumulationSelectionModule.invokeSelection(this):this.accumulationSelectionModule.redrawSelection(this))}!o.refreshBounds&&o.refreshElements?(this.createPieSvg(),this.renderElements()):o.refreshBounds&&(this.refreshSeries(),this.createPieSvg(),this.calculateBounds(),this.renderElements())},ia([t.Property(null)],o.prototype,"width",void 0),ia([t.Property(null)],o.prototype,"height",void 0),ia([t.Property(null)],o.prototype,"title",void 0),ia([t.Property(null)],o.prototype,"backgroundImage",void 0),ia([t.Complex({},Un)],o.prototype,"center",void 0),ia([t.Property("")],o.prototype,"dataSource",void 0),ia([t.Complex(e.Theme.chartTitleFont,Xt)],o.prototype,"titleStyle",void 0),ia([t.Property(null)],o.prototype,"subTitle",void 0),ia([t.Complex(e.Theme.chartSubTitleFont,Xt)],o.prototype,"subTitleStyle",void 0),ia([t.Complex({},gr)],o.prototype,"legendSettings",void 0),ia([t.Complex({},ti)],o.prototype,"tooltip",void 0),ia([t.Property("None")],o.prototype,"selectionMode",void 0),ia([t.Property("None")],o.prototype,"highLightMode",void 0),ia([t.Property("None")],o.prototype,"selectionPattern",void 0),ia([t.Property("None")],o.prototype,"highlightPattern",void 0),ia([t.Property(!0)],o.prototype,"enableBorderOnMouseMove",void 0),ia([t.Property(!1)],o.prototype,"isMultiSelect",void 0),ia([t.Property(!0)],o.prototype,"enableAnimation",void 0),ia([t.Collection([],Qt)],o.prototype,"selectedDataIndexes",void 0),ia([t.Complex({},Ut)],o.prototype,"margin",void 0),ia([t.Property(!0)],o.prototype,"enableSmartLabels",void 0),ia([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),ia([t.Property(null)],o.prototype,"background",void 0),ia([t.Collection([{}],qn)],o.prototype,"series",void 0),ia([t.Collection([{}],Gn)],o.prototype,"annotations",void 0),ia([t.Property("Material")],o.prototype,"theme",void 0),ia([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),ia([t.Property(!0)],o.prototype,"enableExport",void 0),ia([t.Property(!1)],o.prototype,"allowExport",void 0),ia([t.Event()],o.prototype,"loaded",void 0),ia([t.Event()],o.prototype,"load",void 0),ia([t.Event()],o.prototype,"seriesRender",void 0),ia([t.Event()],o.prototype,"legendRender",void 0),ia([t.Event()],o.prototype,"textRender",void 0),ia([t.Event()],o.prototype,"tooltipRender",void 0),ia([t.Event()],o.prototype,"pointRender",void 0),ia([t.Event()],o.prototype,"annotationRender",void 0),ia([t.Event()],o.prototype,"beforePrint",void 0),ia([t.Event()],o.prototype,"chartMouseMove",void 0),ia([t.Event()],o.prototype,"chartMouseClick",void 0),ia([t.Event()],o.prototype,"pointClick",void 0),ia([t.Event()],o.prototype,"pointMove",void 0),ia([t.Event()],o.prototype,"animationComplete",void 0),ia([t.Event()],o.prototype,"chartMouseDown",void 0),ia([t.Event()],o.prototype,"chartMouseLeave",void 0),ia([t.Event()],o.prototype,"chartMouseUp",void 0),ia([t.Event()],o.prototype,"beforeResize",void 0),ia([t.Event()],o.prototype,"resized",void 0),ia([t.Event()],o.prototype,"afterExport",void 0),ia([t.Property("USD")],o.prototype,"currencyCode",void 0),o=ia([t.NotifyPropertyChanges],o)}(t.Component),oa=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),na=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oa(t,e),t.prototype.initProperties=function(e,t){var r=e.initialClipRect;t.triangleSize=new i.Size(Be(t.width,r.width),Be(t.height,r.height)),t.neckSize=new i.Size(Be(t.neckWidth,r.width),Be(t.neckHeight,r.height)),this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position,e),"30%"===t.explodeOffset&&(t.explodeOffset="25px"),e.explodeDistance=Be(t.explodeOffset,r.width);var o=t.points;this.initializeSizeRatio(o,t)},t.prototype.initializeSizeRatio=function(e,t,i){void 0===i&&(i=!1);for(var r=t.sumOfPoints,o=Math.min(Math.max(t.gapRatio,0),1),n=1/(r*(1+o/(1-o))),a=o/(e.length-1),s=0,l=e.length-1;l>=0;l--){var h=i?e.length-1-l:l;if(e[h].visible){var c=n*e[h].y;e[h].yRatio=s,e[h].heightRatio=c,s+=c+a}}},t.prototype.setLabelLocation=function(e,t,r){var o=r.length-1,n="Funnel"===e.type?r.length-2:r.length-1,a=(r[0].x+r[n].x)/2,s=(r[1].x+r[n-1].x)/2;t.region=new i.Rect(a,r[0].y,s-a,r[n].y-r[0].y),t.symbolLocation={x:t.region.x+t.region.width/2,y:t.region.y+t.region.height/2},t.labelOffset={x:t.symbolLocation.x-(r[0].x+r[o].x)/2,y:t.symbolLocation.y-(r[0].y+r[o].y)/2}},t.prototype.findPath=function(e){for(var t="M",i=0;i<e.length;i++)t+=e[i].x+" "+e[i].y,i!==e.length-1&&(t+=" L");return t},t.prototype.defaultLabelBound=function(e,t,r,o){var n=(o.initialClipRect.width-e.triangleSize.width)/2,a=(o.initialClipRect.height-e.triangleSize.height)/2,s=new i.Rect(n,a,e.triangleSize.width,e.triangleSize.height);e.labelBound=new i.Rect(s.x,s.y,s.width+s.x,s.height+s.y),e.accumulationBound=s,t&&"Outside"===r&&(e.labelBound=new i.Rect(1/0,1/0,-1/0,-1/0))},t}(Qn),aa=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),t.prototype.getSegmentData=function(e,t,i){var r,o,n,a,s,l,h,c,d=t.triangleSize,p=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,u=i.initialClipRect.y+(i.initialClipRect.height-d.height)/2,g=e.yRatio*d.height,y=g+e.heightRatio*d.height,m=t.neckSize;r=m.width+(d.width-m.width)*((d.height-m.height-g)/(d.height-m.height)),a=(o=d.width/2-r/2)+r,r=y>d.height-m.height||d.height===m.height?m.width:m.width+(d.width-m.width)*((d.height-m.height-y)/(d.height-m.height)),s=(n=d.width/2-r/2)+r,g>=d.height-m.height?(o=n=l=d.width/2-m.width/2,a=s=h=d.width/2+m.width/2):y>d.height-m.height&&(h=s=(l=n=d.width/2-r/2)+r,c=d.height-m.height);var v={x:p+0+o,y:g+=u},f={x:p+0+a,y:g},b={x:p+0+s,y:y+=u},x={x:p+0+n,y:y},w={x:p+0+s,y:y},S={x:p+0+n,y:y};(c+=u)&&(w={x:p+0+h,y:c},S={x:p+0+l,y:c});var C=[v,f,w,b,x,S];return this.setLabelLocation(t,e,C),this.findPath(C)},t.prototype.renderPoint=function(e,t,i,r,o,n){if(!e.visible)return m(r.id),null;var a=this.getSegmentData(e,t,i);e.midAngle=0,r.d=a,be(!1,o,i.renderer.drawPath(r),n),e.isExplode&&i.accBaseModule.explodePoints(e.index,i,!0)},t.prototype.getModuleName=function(){return"FunnelSeries"},t.prototype.destroy=function(){},t}(na),la=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ha=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return la(t,e),t.prototype.getSegmentData=function(e,t,i){var r=t.triangleSize,o=i.initialClipRect.y+(i.initialClipRect.height-r.height)/2,n=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,a=e.yRatio,s=e.yRatio+e.heightRatio,l=.5*(1-e.yRatio),h=.5*(1-s);a+=o/r.height,s+=o/r.height;var c=[{x:n+0+l*r.width,y:a*r.height},{x:n+0+(1-l)*r.width,y:a*r.height},{x:n+0+(1-h)*r.width,y:s*r.height},{x:n+0+h*r.width,y:s*r.height}];return this.setLabelLocation(t,e,c),this.findPath(c)},t.prototype.initializeSizeRatio=function(t,i){"Linear"===i.pyramidMode?e.prototype.initializeSizeRatio.call(this,t,i,!0):this.calculateSurfaceSegments(i)},t.prototype.calculateSurfaceSegments=function(e){for(var t=e.points.length,i=e.sumOfPoints,r=[],o=[],n=Math.min(0,Math.max(e.gapRatio,1))/(t-1),a=this.getSurfaceHeight(0,i),s=0,l=0;l<t;l++)e.points[l].visible&&(r[l]=s,o[l]=this.getSurfaceHeight(s,Math.abs(e.points[l].y)),s+=o[l]+n*a);for(var h=1/(s-n*a),l=0;l<t;l++)e.points[l].visible&&(e.points[l].yRatio=h*r[l],e.points[l].heightRatio=h*o[l])},t.prototype.getSurfaceHeight=function(e,t){return this.solveQuadraticEquation(1,2*e,-t)},t.prototype.solveQuadraticEquation=function(e,t,i){var r,o,n=t*t-4*e*i;if(n>=0){var a=Math.sqrt(n);return r=(-t-a)/(2*e),o=(-t+a)/(2*e),Math.max(r,o)}return 0},t.prototype.renderPoint=function(e,t,r,o,n,a){if(!e.visible)return i.removeElement(o.id),null;o.d=this.getSegmentData(e,t,r),e.midAngle=0,be(!1,n,r.renderer.drawPath(o),a),e.isExplode&&r.accBaseModule.explodePoints(e.index,r,!0)},t.prototype.getModuleName=function(){return"PyramidSeries"},t.prototype.destroy=function(){},t}(na),ca=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),da=function(e){function r(t){var r=e.call(this,t)||this;return r.library=r,r.titleRect=new i.Rect(0,t.margin.top,0,0),r}return ca(r,e),r.prototype.getLegendOptions=function(e,i){this.legendCollections=[];for(var r=0;r<1;r++){var o=i[r].type;"Pie"!==o&&"Doughnut"!==o||(o="0"!==i[r].innerRadius&&"0%"!==i[r].innerRadius?"Doughnut":"Pie");for(var n=0,a=i[r].points;n<a.length;n++){var s=a[n];t.isNullOrUndefined(s.x)||t.isNullOrUndefined(s.y)||this.legendCollections.push(new mr(s.x.toString(),s.color,i[r].legendShape,s.visible,o,s.legendImageUrl,null,null,s.index,i[r].index))}}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t),this.isTitle=!!r.title;var o=0,n=0,a=r.padding,s=r.titlePosition,l=0,h=this.arrowWidth,c=r.enablePages?0:this.arrowHeight;this.isVertical?o=r.width?0:e.width/100*5:n=r.height?0:e.height/100*5,t.width+=o,t.height+=n;var d=r.shapePadding,p=0,u=r.shapeWidth,g=0,y=0,m=[],v=0,f=0,b=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var x,w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];x={fill:P.fill,text:P.text,shape:P.shape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",x),P.render=!x.cancel,P.text=x.text.indexOf("&")>-1?this.convertHtmlEntities(x.text):x.text,P.fill=x.fill,P.shape=x.shape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&""!==P.text&&(w=!0,f=u+d+P.textSize.width+a,this.isVertical?(v=++y*(this.maxItemHeight+a)+a+this.legendTitleSize.height+c,y*(this.maxItemHeight+a)+a+c>t.height&&(v=Math.max(v,y*(this.maxItemHeight+a)+a+c),g+=p,m.push(p),this.totalPages=Math.max(y,this.totalPages||1),p=0,y=1),p=Math.max(f,p)):(r.enablePages||(l=this.isTitle&&"Top"!==s?this.legendTitleSize.width+this.fivePixel:0,l+=h),g+=f,t.width<a+g+l&&(p=Math.max(p,g+a+l-f),0===y&&f!==g&&(y=1),g=f,v=++y*(this.maxItemHeight+a)+a+this.legendTitleSize.height)))}b="Top"===s?this.legendTitleSize.height:0,this.isVertical?(g+=p,this.isPaging=t.width<g+a,v=Math.max(v,(this.totalPages||1)*(this.maxItemHeight+a)+a+c),this.isPaging=this.isPaging&&this.totalPages>1,m[m.length-1]!==p&&m.push(p)):(this.isPaging=t.height<v,v=!r.enablePages&&this.isPaging?this.maxItemHeight+a+a+b:v,this.totalPages=this.totalRowCount=y,v=Math.max(v,this.maxItemHeight+a+a+b),this.isPaging||(g+=this.isTitle&&"Top"!==s?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0)),this.maxColumns=0;var L=this.isVertical?this.getMaxColumn(m,t.width,a,g+a):Math.max(g+a,p);w?this.setBounds(L,v,r,t):this.setBounds(0,0,r,t)},r.prototype.convertHtmlEntities=function(e){var t=e.replace("&","&").replace("<","<").replace(">",">").replace(""",'"').replace(" "," ").replace("¢","¢").replace("£","£").replace("¥","¥").replace("€","€").replace("©","©").replace("®","®");return t=t.replace("&","&").replace("<","<").replace(">",">").replace(""",'"').replace(" "," ").replace("¢","¢").replace("£","£").replace("¥","¥").replace("€","€").replace("©","©").replace("®","®")},r.prototype.getMaxColumn=function(e,t,i,r){var o=i;this.maxColumnWidth=Math.max.apply(null,e);for(var n=0,a=e;n<a.length;n++){a[n];if(o+=this.maxColumnWidth,this.maxColumns++,o+i>t){o-=this.maxColumnWidth,this.maxColumns--;break}}return this.isPaging=o<r&&this.totalPages>1,o===i&&(o=t),this.maxColumns=Math.max(1,this.maxColumns),this.maxWidth=o,o},r.prototype.getAvailWidth=function(e,t){return this.isVertical&&(t=this.maxWidth),t-(2*this.legend.padding+this.legend.shapeWidth+this.legend.shapePadding)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=this.legend.padding;if(this.isVertical)n===a||r.location.y+1.5*this.maxItemHeight+2*s>o.y+o.height?(e.location.x=r.location.x+(n===a?0:this.maxColumnWidth),e.location.y=t.y,this.pageXCollections.push(e.location.x-this.legend.shapeWidth/2-s),this.totalPages++):(e.location.x=r.location.x,e.location.y=r.location.y+this.maxItemHeight+s);else{var l=r.location.x+i+r.textSize.width;l+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2?(e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+s,e.location.x=t.x):(e.location.y=r.location.y,e.location.x=n===a?r.location.x:l),this.totalPages=this.totalRowCount}var h=this.getAvailWidth(e.location.x,this.legendBounds.width);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.getSmartLegendLocation=function(e,t,i){var r;switch(this.position){case"Left":r=(e.x-t.width-i.left)/2,t.x=e.x-t.width<i.left?t.x:e.x-t.width-r;break;case"Right":r=(this.chart.availableSize.width-i.right-(e.x+e.width+t.width))/2,t.x=e.x+e.width+t.width>this.chart.availableSize.width-i.right?t.x:e.x+e.width+r;break;case"Top":this.getTitleRect(this.chart),r=(e.y-t.height-(this.titleRect.y+this.titleRect.height))/2,t.y=e.y-t.height<i.top?t.y:e.y-t.height-r;break;case"Bottom":r=(this.chart.availableSize.height-i.bottom-(e.y+e.height+t.height))/2,t.y=e.y+e.height+t.height>this.chart.availableSize.height-i.bottom?t.y:e.y+e.height+r}},r.prototype.getTitleRect=function(e){if(!e.title)return null;var t=i.measureText(e.title,e.titleStyle);this.titleRect=new i.Rect(e.availableSize.width/2-t.width/2,e.margin.top,t.width,t.height)},r.prototype.legendByIndex=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(o.pointIndex===e)return o}return null},r.prototype.click=function(e){var i=e.target.id,r=this.chart,o=[this.legendID+"_text_",this.legendID+"_shape_",this.legendID+"_shape_marker_"];if(this.chart.accumulationSelectionModule)t.extend([],this.chart.accumulationSelectionModule.selectedDataIndexes,null,!0);this.chart.animateSeries=!1;for(var n=0,a=o;n<a.length;n++){var s=a[n];if(i.indexOf(s)>-1){var l=parseInt(i.split(s)[1],10);if(this.chart.legendSettings.toggleVisibility&&!isNaN(l)){var h=this.chart.visibleSeries[0],c=et(l,h.points),d=this.legendByIndex(l,this.legendCollections);c.visible=!c.visible,d.visible=c.visible,h.sumOfPoints+=c.visible?c.y:-c.y,r.redraw=r.enableAnimation,this.sliceVisibility(l,c.visible),r.removeSvg(),Ue(r),this.chart.refreshPoints(h.points),this.chart.renderElements()}else this.chart.accumulationSelectionModule&&!isNaN(l)&&this.chart.accumulationSelectionModule.legendSelection(this.chart,0,l)}}i.indexOf(this.legendID+"_pageup")>-1?this.changePage(e,!0):i.indexOf(this.legendID+"_pagedown")>-1&&this.changePage(e,!1),r.redraw=!1},r.prototype.sliceVisibility=function(e,t){var i=this.chart.element.id+"_Series_0_Point_";this.chart.visibleSeries[0].dataLabel.visible&&(i=this.chart.element.id+"_datalabel_Series_0_",this.sliceAnimate(he(i+"g_"+e),t))},r.prototype.sliceAnimate=function(e,i){if(!e)return null;new t.Animation({}).animate(e,{duration:300,delay:0,name:i?"FadeIn":"FadeOut",end:function(e){e.element.style.visibility=i?"visible":"hidden"}})},r.prototype.getModuleName=function(){return"AccumulationLegend"},r.prototype.destroy=function(){},r}(yr),pa=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ua=function(e){function r(t){var r=e.call(this,t)||this;if(r.rightSideRenderingPoints=[],r.leftSideRenderingPoints=[],r.id=t.element.id+"_datalabel_Series_",t.title){var o=i.measureText(t.title,t.titleStyle);r.titleRect=new i.Rect(t.availableSize.width/2-o.width/2,t.margin.top,o.width,o.height)}return r}return pa(r,e),r.prototype.getDataLabelPosition=function(e,t,i,r){var o=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e):this.accumulation.pieSeriesModule.labelRadius:this.getLabelDistance(e,t);this.getLabelRegion(e,t.position,i,o,this.marginValue),e.labelAngle=e.midAngle,e.labelPosition=t.position,this.accumulation.enableSmartLabels&&this.getSmartLabel(e,t,i,r)},r.prototype.getLabelRegion=function(e,t,r,o,n,a){void 0===a&&(a=0);var s=a||e.midAngle,l=M(s,o,this.isCircular()?this.center:this.getLabelLocation(e,t));l.y="Inside"===t?l.y-r.height/2:l.y,l.x="Inside"===t?l.x-r.width/2:l.x,e.labelRegion=new i.Rect(l.x,l.y,r.width+2*n,r.height+2*n),"Outside"===t&&(e.labelRegion.y-=e.labelRegion.height/2,s>=90&&s<=270?e.labelRegion.x-=e.labelRegion.width+10:e.labelRegion.x+=10)},r.prototype.getSmartLabel=function(e,t,r,o){var n=this.isCircular(),a=n?this.radius:this.getLabelDistance(e,t);a+=Be(n?t.connectorStyle.length||"4%":"0px",a);var s=this.findPreviousPoint(o,e.index,e.labelPosition);if("Inside"===t.position?(s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o))||!n&&!Re(e.region,e.labelRegion))&&(e.labelPosition="Outside",n||(a=this.getLabelDistance(e,t)),this.getLabelRegion(e,e.labelPosition,r,a,this.marginValue),(s=this.findPreviousPoint(o,e.index,e.labelPosition))&&(Le(e.labelRegion,s.labelRegion)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,a,r,this.marginValue)):s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,a,r,this.marginValue),this.isOverlapping(e,o)&&("Pyramid"===this.accumulation.type||"Funnel"===this.accumulation.type)){var l=e.midAngle||0,h=n?this.radius:this.getLabelDistance(e,t),c=M(l,-h,this.isCircular()?this.center:this.getLabelLocation(e,"OutsideLeft"));e.labelRegion=new i.Rect(c.x,c.y,r.width+2*this.marginValue,r.height+2*this.marginValue),e.labelRegion.y-=e.labelRegion.height/2,e.labelRegion.x=e.labelRegion.x-10-e.labelRegion.width,s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,h,r,this.marginValue)}},r.prototype.move=function(e,t,i,r){var o=this;if(e.target.textContent.indexOf("...")>-1){var n=e.target.id.split(this.id);if(2===n.length){var a=parseInt(n[1].split("_text_")[0],10),s=parseInt(n[1].split("_text_")[1],10);if(!isNaN(a)&&!isNaN(s)){r&&m(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip");var l=Ke(a,this.accumulation.visibleSeries).points[s];f(l.text||l.y.toString(),t,i,this.areaRect.width,this.accumulation.element.id+"_EJ2_Datalabel_Tooltip",he(this.accumulation.element.id+"_Secondary_Element"))}}}else m(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip");r&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){m(o.accumulation.element.id+"_EJ2_Datalabel_Tooltip")},1e3))},r.prototype.findPreviousPoint=function(e,t,i){for(var r=e[0],o=t-1;o>=0;o--)if((r=e[o]).visible&&r.labelVisible&&r.labelRegion&&r.labelPosition===i)return r;return null},r.prototype.isOverlapping=function(e,t){for(var i=e.index-1;i>=0;i--)if(t[i].visible&&t[i].labelVisible&&t[i].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[i].labelRegion))return!0;return!1},r.prototype.textTrimming=function(e,t,i,r){if(Le(e.labelRegion,t)){var o=e.labelRegion.width;"Right"===r?o=t.x-e.labelRegion.x:"Left"===r?(o=e.labelRegion.x-(t.x+t.width))<0&&(o+=e.labelRegion.width,e.labelRegion.x=t.x+t.width):"InsideRight"===r?o=t.x+t.width-e.labelRegion.x:"InsideLeft"===r?(o=e.labelRegion.x+e.labelRegion.width-t.x)<e.labelRegion.width&&(e.labelRegion.x=t.x):this.setPointVisibileFalse(e),e.labelVisible&&e.labelRegion&&(o<e.labelRegion.width&&(e.label=ze(o-2*this.marginValue,e.label,i),e.labelRegion.width=o),3===e.label.length&&e.label.indexOf("...")>-1&&this.setPointVisibileFalse(e))}},r.prototype.setPointVisibileFalse=function(e){e.labelVisible=!1,e.labelRegion=null},r.prototype.setPointVisibleTrue=function(e){e.labelVisible=!0},r.prototype.setOuterSmartLabel=function(e,t,i,r,o,n){if(this.isCircular()){var a=this.getOverlappedAngle(e.labelRegion,t.labelRegion,t.midAngle,2*i);for(this.getLabelRegion(t,"Outside",o,r,n,a),a>t.endAngle&&(a=t.midAngle),t.labelAngle=a;t.labelVisible&&(Le(e.labelRegion,t.labelRegion)||a<=e.labelAngle||this.isConnectorLineOverlapping(t,e))&&!(a>t.endAngle);)t.labelAngle=a,this.getLabelRegion(t,"Outside",o,r,n,a),a+=.1}else this.setSmartLabelForSegments(t,e)},r.prototype.setSmartLabelForSegments=function(e,t){var i=e.labelRegion,r="Funnel"===this.accumulation.type?t.labelRegion.y-(i.y+i.height):e.labelRegion.y-(t.labelRegion.y+t.labelRegion.height);r<0&&(e.labelRegion.y+="Funnel"===this.accumulation.type?r:-r)},r.prototype.isConnectorLineOverlapping=function(e,t){var i;!this.isCircular()&&e.labelRegion.x<e.region.x&&(i="outsideLeft");var r=this.getLabelLocation(e,i),o=new Vi(0,0);this.getEdgeOfLabel(e.labelRegion,e.labelAngle,o,0,e);var n=this.getLabelLocation(t),a=new Vi(0,0);return this.getEdgeOfLabel(t.labelRegion,t.labelAngle,a,0,e),this.isLineRectangleIntersect(r,o,e.labelRegion)||this.isLineRectangleIntersect(r,o,t.labelRegion)||this.isLineRectangleIntersect(n,a,e.labelRegion)},r.prototype.isLineRectangleIntersect=function(e,t,i){var r=[new Vi(Math.round(i.x),Math.round(i.y)),new Vi(Math.round(i.x+i.width),Math.round(i.y)),new Vi(Math.round(i.x+i.width),Math.round(i.y+i.height)),new Vi(Math.round(i.x),Math.round(i.y+i.height))];e.x=Math.round(e.x),e.y=Math.round(e.y),t.x=Math.round(t.x),t.y=Math.round(t.y);for(var o=0;o<r.length;o++)if(this.isLinesIntersect(e,t,r[o],r[(o+1)%r.length]))return!0;return!1},r.prototype.isLinesIntersect=function(e,t,i,r){var o=t.y-e.y,n=e.x-t.x,a=o*e.x+n*e.y,s=r.y-i.y,l=i.x-r.x,h=s*i.x+l*i.y,c=o*l-s*n;if(0!==c){var d=(l*a-n*h)/c,p=(o*h-s*a)/c,u=Math.min(e.x,t.x)<=d&&d<=Math.max(e.x,t.x);return u=u&&Math.min(e.y,t.y)<=p&&p<=Math.max(e.y,t.y),u=u&&Math.min(i.x,r.x)<=d&&d<=Math.max(i.x,r.x),u=u&&Math.min(i.y,r.y)<=p&&p<=Math.max(i.y,r.y)}return!1},r.prototype.getOverlappedAngle=function(e,t,i,r){var o=e.x;return i>=90&&i<=270?(t.y=e.y-(r+t.height/2),o=e.x+e.width):t.y=e.y+e.height+r,O(this.center,new Vi(o,t.y))},r.prototype.getConnectorPath=function(e,t,i,r){void 0===r&&(r=0);var o=i.connectorStyle,n=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],t):this.labelRadius:this.getLabelDistance(t,i),a=this.getConnectorStartPoint(t,o),s=this.accumulation.enableSmartLabels?t.midAngle:r||t.midAngle,l=new Vi(0,0),h=this.getEdgeOfLabel(e,s,l,o.width,t);if("Curve"===o.type){if(this.isCircular()){var c=n-(this.isVariousRadius()?Be(t.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius);return t.isLabelUpdated?l=this.getPerpendicularDistance(a,t):(l=M(s,n-c/2,this.center),"Outside"===t.labelPosition&&"Inside"===i.position&&(l=M(s,n-1.25*c,this.center))),"M "+a.x+" "+a.y+" Q "+l.x+" "+l.y+" "+h.x+" "+h.y}return this.getPolyLinePath(a,h)}return"M "+a.x+" "+a.y+" L "+l.x+" "+l.y+" L "+h.x+" "+h.y},r.prototype.getPolyLinePath=function(e,t){var i=[e,t];if(e.y===t.y)return"M "+e.x+" "+e.y+" L "+t.x+" "+t.y;for(var r="M",o=0;o<=16;o++){var n=o/16,a=this.getBezierPoint(n,i,0,2);r+=a.x+","+a.y,16!==o&&(r+=" L")}return r},r.prototype.getBezierPoint=function(e,t,i,r){if(1===r)return t[i];var o=this.getBezierPoint(e,t,i,r-1),n=this.getBezierPoint(e,t,i+1,r-1),a=(o.x,o.x),s=(o.y,o.y),l=(1-e)*a+e*(n.x,n.x),h=(1-e)*s+e*(n.y,n.y);return o.x,{x:l,y:h}},r.prototype.getEdgeOfLabel=function(e,t,i,r,o){void 0===r&&(r=1);var n=new Vi(e.x,e.y);return t>=90&&t<=270?(n.x+=e.width+r/2,n.y+=e.height/2,i.x=n.x+10,i.y=n.y):o&&o.region&&o.region.x>o.labelRegion.x?(n.x+=2*r+e.width,n.y+=e.height/2,i.x=n.x+10,i.y=n.y):(n.x-=r/2,n.y+=e.height/2,i.x=n.x-10,i.y=n.y),n},r.prototype.getLabelDistance=function(e,t){if(e.labelPosition&&t.position!==e.labelPosition||t.connectorStyle.length){var i=Be(t.connectorStyle.length||"70px",this.accumulation.initialClipRect.width);if(i<this.accumulation.initialClipRect.width)return i}var r,o=e.labelPosition||t.position,n=this.accumulation.visibleSeries[0],a=(this.accumulation.initialClipRect.width-n.triangleSize.width)/2;switch(o){case"Inside":return 0;case"Outside":return r=e.symbolLocation.x+e.labelOffset.x,this.accumulation.initialClipRect.width-r-a}},r.prototype.getLabelLocation=function(e,t){if(void 0===t&&(t="Outside"),"Pie"!==this.accumulation.type){t="OutsideLeft"===t?"OutsideLeft":e.labelPosition||t;var i={x:e.symbolLocation.x,y:e.symbolLocation.y-e.labelOffset.y};switch(t){case"Inside":i.y=e.region.y+e.region.height/2;break;case"Outside":i.x+=e.labelOffset.x;break;case"OutsideLeft":i.x-=e.labelOffset.x}return i}return M(e.midAngle,this.isVariousRadius()?Be(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius,this.center)},r.prototype.getConnectorStartPoint=function(e,t){var i;return!this.isCircular()&&e.region.x>e.labelRegion.x&&(i="OutsideLeft"),this.isCircular()?M(e.midAngle,(this.isVariousRadius()?Be(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius)-t.width,this.center):this.getLabelLocation(e,i)},r.prototype.findAreaRect=function(){this.areaRect=new i.Rect(0,0,this.accumulation.availableSize.width,this.accumulation.availableSize.height);var e=this.accumulation.margin;L(this.areaRect,new Hi(e.left,e.right,e.top,e.bottom))},r.prototype.renderDataLabel=function(e,i,r,o,n,a,s){var l=this.accumulation.element.id+"_datalabel_Series_"+n+"_",h=this.accumulation.renderer.createGroup({id:l+"g_"+e.index});e.label=e.originalText||e.y.toString();var c={width:i.border.width,color:i.border.color},d=t.extend({},t.getValue("properties",i.font),null,!0),p={cancel:!1,name:"textRender",series:this.accumulation.visibleSeries[0],point:e,text:e.label,border:c,color:i.fill,template:i.template,font:d};this.accumulation.trigger("textRender",p),e.argsData=p;var u=null!==p.template;e.labelVisible=!p.cancel,e.text=e.label=p.text,Number(e.label)&&(e.label=this.accumulation.intl.formatNumber(+e.label,{useGrouping:this.accumulation.useGroupingSeparator})),this.marginValue=p.border.width?5+p.border.width:1;var g=t.createElement("div",{id:this.accumulation.element.id+"_Series_0_DataLabel_"+e.index,styles:"position: absolute;background-color:"+p.color+";"+ge(i.font)+";border:"+p.border.width+"px solid "+p.border.color+";"});this.calculateLabelSize(u,g,e,o,p,h,l,i,s)},r.prototype.calculateLabelSize=function(e,t,r,o,n,a,s,l,h,c,d){var p=e?d?{width:c.width,height:c.height}:this.getTemplateSize(t,r,n,h,e,o,a,s,l):i.measureText(r.label,l.font);p.height+=4,p.width+=4,r.textSize=p,r.templateElement=t,this.getDataLabelPosition(r,l,p,o),r.labelRegion&&this.correctLabelRegion(r.labelRegion,r.textSize)},r.prototype.drawDataLabels=function(e,r,o,n,a){var s,l,h=e.leftSidePoints.concat(e.rightSidePoints);h.sort(function(e,t){return e.index-t.index}),"Pie"===e.type&&this.accumulation.enableSmartLabels&&this.extendedLabelsCalculation();for(var c=0,d=h;c<d.length;c++){var p=d[c];if(!t.isNullOrUndefined(p.argsData)&&!t.isNullOrUndefined(p.y)){this.finalizeDatalabels(p,h,r);var u=this.accumulation.element.id+"_datalabel_Series_0_",g=this.accumulation.renderer.createGroup({id:u+"g_"+p.index}),y=void 0,m=void 0;if(p.visible&&p.labelVisible){if(s=l=r.angle,p.argsData.template)this.setTemplateStyle(p.templateElement,p,n,r.font.color,p.color,a);else{y=new Vi(p.labelRegion.x+this.marginValue,p.labelRegion.y+3*p.textSize.height/4+this.marginValue);var v=(m=he(u+"shape_"+p.index))?new Vi(+m.getAttribute("x"),+m.getAttribute("y")):null;be(!1,g,this.accumulation.renderer.drawRectangle(new Di(u+"shape_"+p.index,p.argsData.color,p.argsData.border,1,p.labelRegion,r.rx,r.ry)),a,!0,"x","y",v,null,!1,!1,null,this.accumulation.duration);var f=p.textSize.width,b=p.textSize.height,x=void 0;x=0!==s&&r.enableRotation?"rotate("+(l="Outside"===p.labelPosition?0:p.midAngle>=90&&p.midAngle<=270?p.midAngle+180:p.midAngle)+","+(y.x+f/2)+","+(y.y-b/4)+")":"rotate("+(l=s?s>360?s-360:s<-360?s+360:s:0)+","+(y.x+f/2)+","+y.y+")",p.transform=x,Ve(this.accumulation.renderer,new i.TextOption(u+"text_"+p.index,y.x,y.y,"start",p.label,x,"auto",l),p.argsData.font,p.argsData.font.color||this.getSaturatedColor(p,p.argsData.color),g,!1,a,!0,!1,this.accumulation.duration),m=null}if(this.accumulation.accumulationLegendModule&&("Outside"===r.position||this.accumulation.enableSmartLabels)&&this.accumulation.visibleSeries[0].findMaxBounds(this.accumulation.visibleSeries[0].labelBound,p.labelRegion),"Outside"===p.labelPosition){var w=he(u+"connector_"+p.index),S=w?w.getAttribute("d"):"";be(!1,g,this.accumulation.renderer.drawPath(new i.PathOption(u+"connector_"+p.index,"transparent",r.connectorStyle.width,r.connectorStyle.color||p.color,1,r.connectorStyle.dashArray,this.getConnectorPath(t.extend({},p.labelRegion,null,!0),p,r,p.labelAngle))),a,!0,null,null,null,S,!1,!1,null,this.accumulation.duration)}be(!1,o,g,a)}}}},r.prototype.finalizeDatalabels=function(e,t,r){if((this.isOverlapping(e,t)||this.titleRect&&e.labelRegion&&Le(e.labelRegion,this.titleRect))&&this.isCircular()&&"Outside"===e.labelPosition&&this.setPointVisibileFalse(e),this.accumulation.accumulationLegendModule&&e.labelVisible&&e.labelRegion){var o=this.accumulation.accumulationLegendModule.legendBounds,n=this.accumulation.legendSettings.border.width/2;this.textTrimming(e,new i.Rect(o.x-n,o.y-n,o.width+2*n,o.height+2*n),r.font,this.accumulation.accumulationLegendModule.position)}if(e.labelVisible&&e.labelRegion){var a=this.isCircular()?e.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":e.labelRegion.x>=e.region.x?"InsideRight":"InsideLeft";this.textTrimming(e,this.areaRect,r.font,a)}e.labelVisible&&e.labelRegion&&(e.labelRegion.y+e.labelRegion.height>this.areaRect.y+this.areaRect.height||e.labelRegion.y<this.areaRect.y||e.labelRegion.x<this.areaRect.x||e.labelRegion.x+e.labelRegion.width>this.areaRect.x+this.areaRect.width)&&this.setPointVisibileFalse(e)},r.prototype.getTemplateSize=function(e,t,i,r,o,n,a,s,l){var h=ye(e=ue(e,t.index,i.template,this.accumulation,t,this.accumulation.visibleSeries[0],this.accumulation.element.id+"_DataLabel",0,i,o,n,a,s,l,r),r);return{width:h.width,height:h.height}},r.prototype.setTemplateStyle=function(e,t,i,r,o,n){if(e.style.left=t.labelRegion.x+"px",e.style.top=t.labelRegion.y+"px",e.style.color=r||this.getSaturatedColor(t,o),this.accumulation.isBlazor){var a=this.isCircular()?t.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":t.labelRegion.x>=t.region.x?"InsideRight":"InsideLeft";e.style.transform="InsideRight"===a?"translate(0%, -50%)":"translate(-100%, -50%)"}e.childElementCount&&(be(!1,i,e,n,!0,"left","top"),this.doTemplateAnimation(this.accumulation,e))},r.prototype.getSaturatedColor=function(e,t){var i,r=Te(_e(i="transparent"===(i=this.marginValue>=1?"transparent"===t?this.getLabelBackground(e):t:this.getLabelBackground(e))?window.getComputedStyle(document.body,null).backgroundColor:i));return Math.round((299*r.r+587*r.g+114*r.b)/1e3)>=128?"black":"white"},r.prototype.doTemplateAnimation=function(e,t){var i=e.visibleSeries[0],r=i.animation.delay+i.animation.duration;i.animation.enable&&e.animateSeries&&(t.style.visibility="hidden",oe(t,r,200,"ZoomIn"))},r.prototype.getLabelBackground=function(e){return"Outside"===e.labelPosition?this.accumulation.background||this.accumulation.themeStyle.background:e.color},r.prototype.correctLabelRegion=function(e,t,i){void 0===i&&(i=4),e.height-=i,e.width-=i,e.x+=i/2,e.y+=i/2,t.height-=i,t.width-=i},r.prototype.getModuleName=function(){return"AccumulationDataLabel"},r.prototype.destroy=function(){},r.prototype.extendedLabelsCalculation=function(){var e=this,t=this.accumulation.series[0];t.rightSidePoints.forEach(function(t,i,r){t.initialLabelRegion=t.labelRegion,t.isLabelUpdated=0,e.skipPoints(t,r,i)}),t.leftSidePoints.forEach(function(t,i,r){t.initialLabelRegion=t.labelRegion,t.isLabelUpdated=0,e.skipPoints(t,r,i)}),this.arrangeLeftSidePoints(t),this.isIncreaseAngle=!1,this.arrangeRightSidePoints(t)},r.prototype.arrangeRightSidePoints=function(e){var t,i,r=e.rightSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition});this.rightSideRenderingPoints=r;var o,n,a,s=r[r.length-1];s&&s.labelAngle>90&&s.labelAngle<270&&(this.isIncreaseAngle=!0,this.changeLabelAngle(s,89));for(var l=r.length-1;l>=0;l--)if(n=r[l],a=r[l+1],this.isOverlapWithNext(n,r,l)&&n.labelVisible||!(n.labelAngle<=90||n.labelAngle>=270))if(o=s.labelAngle+10,i=!0,t?this.isIncreaseAngle=!1:o>90&&o<270&&a.isLabelUpdated&&(this.isIncreaseAngle=!0),this.isIncreaseAngle)for(h=l+1;h>0;h--)this.decreaseAngle(r[h],r[h-1],e,!0);else for(var h=l+1;h<r.length;h++)this.increaseAngle(r[h-1],r[h],e,!0);else i&&a&&!a.isLabelUpdated&&(t=!0)},r.prototype.arrangeLeftSidePoints=function(e){var t=this,i=e.leftSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition});this.leftSideRenderingPoints=i;for(var r,o,n,a,s=0;s<i.length;s++)if(o=i[s],r=i[s-1],this.isOverlapWithPrevious(o,i,s)&&o.labelVisible||!(o.labelAngle<270))if(n=!0,a&&(this.isIncreaseAngle=!1),this.isIncreaseAngle)for(l=s;l<i.length;l++)this.increaseAngle(i[l-1],i[l],e,!1);else for(var l=s;l>0;l--)this.decreaseAngle(i[l],i[l-1],e,!1),i.filter(function(e,r){e.isLabelUpdated&&i[r].labelAngle-10<100&&(t.isIncreaseAngle=!0)});else n&&r&&r.isLabelUpdated&&(a=!0)},r.prototype.decreaseAngle=function(e,i,r,o){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;var n=1;if(o)for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&!(i.labelRegion.height+i.labelRegion.y<e.labelRegion.y);){if((a=i.midAngle-n)<0&&(a=360+a),a<=270&&a>=90){a=270,this.isIncreaseAngle=!0;break}this.changeLabelAngle(i,a),n++}else for(e.labelAngle>270&&(this.changeLabelAngle(e,270),i.labelAngle=270);Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y+e.labelRegion.height>i.labelRegion.y;){var a=i.midAngle-n;if(!(a<=270&&a>=90)){a=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(i,a),Le(e.labelRegion,i.labelRegion)&&!r.leftSidePoints.indexOf(i)&&a-1<90&&a-1>270){this.changeLabelAngle(e,e.labelAngle+1),this.arrangeLeftSidePoints(r);break}n++}},r.prototype.increaseAngle=function(e,i,r,o){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;var n=1;if(o)for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&!(e.labelRegion.y+e.labelRegion.height<i.labelRegion.y);){if((a=i.midAngle+n)<270&&a>90){a=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(i,a),Le(e.labelRegion,i.labelRegion)&&a+1>90&&a+1<270&&this.rightSideRenderingPoints.indexOf(i)===this.rightSideRenderingPoints.length-1){this.changeLabelAngle(e,e.labelAngle-1),i.labelRegion=i.initialLabelRegion,this.arrangeRightSidePoints(r);break}n++}else for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y<i.labelRegion.y+i.labelRegion.height;){var a=i.midAngle+n;if(!(a<270&&a>90)){a=270,this.isIncreaseAngle=!1;break}this.changeLabelAngle(i,a),n++}},r.prototype.changeLabelAngle=function(e,t){var i,r=this.accumulation.series[0].dataLabel;this.isVariousRadius()&&(i=this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e));var o="Outside"===e.labelPosition&&this.accumulation.enableSmartLabels&&"Inside"===r.position?this.radius+Be(r.connectorStyle.length||"4%",this.accumulation.pieSeriesModule.size/2):this.isVariousRadius()?i:this.accumulation.pieSeriesModule.labelRadius+10,n=this.isVariousRadius()?i:o;this.getLabelRegion(e,"Outside",e.textSize,n,this.marginValue,t),e.isLabelUpdated=1,e.labelAngle=t},r.prototype.isOverlapWithPrevious=function(e,t,i){for(var r=0;r<i;r++)if(r!==t.indexOf(e)&&t[r].visible&&t[r].labelVisible&&t[r].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[r].labelRegion))return!0;return!1},r.prototype.isOverlapWithNext=function(e,t,i){for(var r=i;r<t.length;r++)if(r!==t.indexOf(e)&&t[r].visible&&t[r].labelVisible&&t[r].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[r].labelRegion))return!0;return!1},r.prototype.skipPoints=function(e,t,i){if(i>0&&(e.midAngle<285&&e.midAngle>255||e.midAngle<105&&e.midAngle>75)){var r=t[i-1],o=e.endAngle%360-e.startAngle%360;(s=r.endAngle%360-r.startAngle%360)<=o&&o<5&&r.labelVisible&&this.setPointVisibleTrue(e)}else if(i>1&&(e.midAngle<300&&e.midAngle>240||e.midAngle<120&&e.midAngle>60)){var n=t[i-1],a=t[i-2],o=e.endAngle%360-e.startAngle%360,s=n.endAngle%360-n.startAngle%360,l=a.endAngle%360-a.startAngle%360;o<3&&s<3&&l<3&&n.labelVisible&&e.labelVisible&&this.setPointVisibleTrue(e)}},r.prototype.getPerpendicularDistance=function(e,t){var i=10+10*Math.sin(t.midAngle*Math.PI/360);return t.midAngle>270&&t.midAngle<360?new Vi(e.x+i*Math.cos((360-t.midAngle)*Math.PI/180),e.y-i*Math.sin((360-t.midAngle)*Math.PI/180)):t.midAngle>0&&t.midAngle<90?new Vi(e.x+i*Math.cos(t.midAngle*Math.PI/180),e.y+i*Math.sin(t.midAngle*Math.PI/180)):t.midAngle>0&&t.midAngle<90?new Vi(e.x-i*Math.cos((t.midAngle-90)*Math.PI/180),e.y+i*Math.sin((t.midAngle-90)*Math.PI/180)):new Vi(e.x-i*Math.cos((t.midAngle-180)*Math.PI/180),e.y-i*Math.sin((t.midAngle-180)*Math.PI/180))},r}(Qn),ga=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ya=function(e){function i(t){var i=e.call(this,t)||this;return i.accumulation=t,i.addEventListener(),i}return ga(i,e),i.prototype.addEventListener=function(){this.accumulation.isDestroyed||(this.accumulation.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.accumulation.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.accumulation.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},i.prototype.mouseLeaveHandler=function(e){this.removeTooltip(this.accumulation.tooltip.fadeOutDuration)},i.prototype.mouseUpHandler=function(e){var t=this.accumulation;t.tooltip.enable&&t.isTouch&&j(t.mouseX,t.mouseY,t.initialClipRect)&&(this.tooltip(e),this.removeTooltip(2e3))},i.prototype.mouseMoveHandler=function(e){var t=this.accumulation;t.tooltip.enable&&j(t.mouseX,t.mouseY,t.initialClipRect)&&this.tooltip(e)},i.prototype.tooltip=function(e){var t=this.getElement(this.element.id+"_tooltip_svg"),i=t&&parseInt(t.getAttribute("opacity"),10)>0,r=this.getTooltipElement(i);this.renderSeriesTooltip(e,this.accumulation,!i,r)},i.prototype.renderSeriesTooltip=function(e,t,i,r){var o=this.getPieData(e,t,t.mouseX,t.mouseY);t.initialClipRect;if(this.currentPoints=[],!o.point||this.previousPoints[0]&&this.previousPoints[0].point===o.point)!o.point&&this.isRemove&&(this.removeTooltip(this.accumulation.tooltip.fadeOutDuration),this.isRemove=!1);else{if(this.previousPoints[0]&&o.point.index===this.previousPoints[0].point.index&&o.series.index===this.previousPoints[0].series.index)return null;this.pushData(o,i,r,!1)&&this.triggerTooltipRender(o,i,this.getTooltipText(o,t.tooltip),this.findHeader(o))}},i.prototype.triggerTooltipRender=function(e,i,r,o,n){var a=this;void 0===n&&(n=!0);var s={cancel:!1,name:"tooltipRender",text:r,point:e.point,textStyle:this.textStyle,series:this.accumulation.isBlazor?{}:e.series,headerText:o,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,pointIndex:e.point.index,pointText:e.point.text,seriesName:e.series.name}},l=function(r){r.cancel?(a.removeHighlight(),t.remove(a.getElement(a.element.id+"_tooltip"))):(a.formattedText=a.formattedText.concat(r.text),a.text=a.formattedText,a.headerText=r.headerText,a.createTooltip(a.chart,i,e.point.symbolLocation,e.series.clipRect,e.point,["Circle"],0,a.chart.initialClipRect,null,e.point,a.accumulation.tooltip.template?r.template:"")),a.isRemove=!0};l.bind(this,e),this.chart.trigger("tooltipRender",s,l)},i.prototype.getPieData=function(e,i,r,o){var n=D(e.target.id,!0);if(!isNaN(n.series)){var a=n.series,s=n.point;if(!(t.isNullOrUndefined(a)||isNaN(a)||t.isNullOrUndefined(s)||isNaN(s))){var l=this.getSeriesFromIndex(a,i.visibleSeries);if(l.enableTooltip)return new Gi(l.points[s],l)}}return new Gi(null,null)},i.prototype.getSeriesFromIndex=function(e,t){return t[0]},i.prototype.getTooltipText=function(e,t){var i=e.series,r=this.accumulation.useGroupingSeparator?"${point.x} : <b>${point.separatorY}</b>":"${point.x} : <b>${point.y}</b>";return r=t.format?t.format:r,this.parseTemplate(e.point,i,r)},i.prototype.findHeader=function(e){return""===this.header?"":(this.header=this.parseTemplate(e.point,e.series,this.header),""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()?this.header:"")},i.prototype.parseTemplate=function(e,t,i){for(var r,o,n=0,a=Object.keys(e);n<a.length;n++){h=a[n];r=new RegExp("${point."+h+"}","gm"),i=i.replace(r.source,e[h])}for(var s=0,l=Object.keys(Object.getPrototypeOf(t));s<l.length;s++){var h=l[s];r=new RegExp("${series."+h+"}","gm"),o=t[h],i=i.replace(r.source,o)}return i},i.prototype.getModuleName=function(){return"AccumulationTooltip"},i.prototype.destroy=function(e){},i}(un),ma=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),va=function(e){function i(t){var i=e.call(this,t)||this;return i.renderer=t.renderer,i}return ma(i,e),i.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.rectPoints=null},i.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.selectDataIndex(this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes),e)},i.prototype.generateStyle=function(e){return e.selectionStyle||this.styleId+"_series_"+e.index},i.prototype.findElements=function(e,t,i){return[this.getElementByIndex(i)]},i.prototype.getElementByIndex=function(e){var t=this.control.element.id+"_Series_"+e.series+"_Point_"+e.point;return document.getElementById(t)},i.prototype.calculateSelectedElements=function(e,t){-1!==t.target.id.indexOf(e.element.id+"_")&&(t.target.id.indexOf("_Series_")>-1||t.target.id.indexOf("_datalabel_")>-1)&&this.performSelection(D(t.target.id),e,t.target)},i.prototype.performSelection=function(e,t,i){switch(i=i.id.indexOf("datalabel")>-1?t.getSeriesElement().childNodes[e.series].childNodes[e.point]:i,t.selectionMode){case"Point":isNaN(e.point)||(this.selection(t,e,[i]),this.blurEffect(t.element.id,t.visibleSeries))}},i.prototype.selection=function(e,i,r){e.isMultiSelect||this.removeMultiSelectEelments(e,this.selectedDataIndexes,i,e.series);var o=r[0]&&(r[0].getAttribute("class")||"");if(r[0]&&o.indexOf(this.getSelectionClass(r[0].id))>-1){if(this.removeStyles(r,i),this.addOrRemoveIndex(this.selectedDataIndexes,i),e.enableBorderOnMouseMove){n=document.getElementById(r[0].id.split("_")[0]+"PointHover_Border");t.isNullOrUndefined(n)||this.removeSvgClass(n,n.getAttribute("class"))}}else{if(this.applyStyles(r,i),e.enableBorderOnMouseMove){var n=document.getElementById(r[0].id.split("_")[0]+"PointHover_Border");t.isNullOrUndefined(n)||this.addSvgClass(n,r[0].getAttribute("class"))}this.addOrRemoveIndex(this.selectedDataIndexes,i,!0)}},i.prototype.redrawSelection=function(e){var i=t.extend([],this.selectedDataIndexes,null,!0);this.removeSelectedElements(e,this.selectedDataIndexes),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(i,e)},i.prototype.removeSelectedElements=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];this.removeStyles([this.getElementByIndex(o)],o)}},i.prototype.legendSelection=function(e,t,i){var r=e.getSeriesElement().childNodes[t].childNodes[i];this.selection(e,new Jt(t,i),[r]),this.blurEffect(e.element.id,e.visibleSeries)},i.prototype.selectDataIndex=function(e,t){for(var i,r=0,o=e;r<o.length;r++){var n=o[r];(i=this.getElementByIndex(n))&&this.performSelection(n,t,i)}},i.prototype.removeMultiSelectEelments=function(e,t,i,r){for(var o,n=0;n<t.length;n++)o=r[t[n].series],this.checkEquals(t[n],i)||(this.removeStyles(this.findElements(e,o,t[n]),t[n]),t.splice(n,1),n--)},i.prototype.blurEffect=function(e,t){for(var i=this.checkPointVisibility(this.selectedDataIndexes),r=0,o=t;r<o.length;r++){var n=o[r];n.visible&&this.checkSelectionElements(document.getElementById(e+"_SeriesCollection"),this.generateStyle(n),i)}},i.prototype.checkSelectionElements=function(e,t,i){for(var r,o,n,a=e.childNodes[0].childNodes,s=0;s<a.length;s++)o=a[s].getAttribute("class")||"",n=a[s].parentNode.getAttribute("class")||"",-1===o.indexOf(t)&&-1===n.indexOf(t)&&i?this.addSvgClass(a[s],this.unselected):this.removeSvgClass(a[s],this.unselected),this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(r=document.getElementById(this.control.element.id+"_chart_legend_shape_"+s))&&(-1===o.indexOf(t)&&-1===n.indexOf(t)&&i?this.addSvgClass(r,this.unselected):this.removeSvgClass(r,this.unselected))},i.prototype.applyStyles=function(e,t){for(var i=this.control.accumulationTooltipModule,r=0,o=e;r<o.length;r++){var n=o[r],a=void 0;if(n){this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(a=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(a,this.unselected),this.addSvgClass(a,this.getSelectionClass(a.id))),this.removeSvgClass(n.parentNode,this.unselected),this.removeSvgClass(n,this.unselected);var s=i&&i.previousPoints.length>0&&i.previousPoints[0].point.index!==t.point?i.svgTooltip.opacity:this.series[t.series].opacity;n.setAttribute("opacity",s.toString()),this.addSvgClass(n,this.getSelectionClass(n.id))}}},i.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.series[D(e).series])},i.prototype.removeStyles=function(e,t){for(var i,r=this.control.accumulationTooltipModule,o=0,n=e;o<n.length;o++){var a=n[o];if(a){this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(i=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(i,this.getSelectionClass(i.id)));var s=r&&r.previousPoints[0].point.index===t.point?r.svgTooltip.opacity:this.series[t.series].opacity;a.setAttribute("opacity",s.toString()),this.removeSvgClass(a,this.getSelectionClass(a.id))}}},i.prototype.addOrRemoveIndex=function(e,t,i){for(var r=0;r<e.length;r++)this.checkEquals(e[r],t)&&(e.splice(r,1),r--);i&&e.push(t)},i.prototype.checkEquals=function(e,t){return e.point===t.point&&e.series===t.series},i.prototype.checkPointVisibility=function(e){for(var t=!1,i=0,r=e;i<r.length;i++)if(et(r[i].point,this.control.visibleSeries[0].points).visible){t=!0;break}return t},i.prototype.getModuleName=function(){return"AccumulationSelection"},i.prototype.destroy=function(){},i}(fn),fa=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ba=function(e){function i(t){var i=e.call(this,t)||this;return i.pie=t,i}return fa(i,e),i.prototype.renderAnnotations=function(e){var i=this;this.annotations=this.pie.annotations;var r=this.pie.redraw;this.parentElement=Fe(r,this.pie.element.id+"_Annotation_Collections")||t.createElement("div",{id:this.pie.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),fe(this.parentElement,e,r)},i.prototype.getModuleName=function(){return"Annotation"},i.prototype.destroy=function(){},i}(An),xa=function(){function e(e,t,i,r,o){void 0===o&&(o=!0),this.x=e,this.y=t,this.xValue=i,this.visible=o}return e}(),wa=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sa=function(e){function o(t){var i=e.call(this)||this;return i.dataSource=t.dataSource,i.xName=t.xName,i.yName=t.yName,i.query=t.query,i.xMin=1/0,i.xMax=-1/0,i.yMin=1/0,i.yMax=-1/0,i}return wa(o,e),o.prototype.renderChart=function(e){var t,i,r=this;this.seriesLength=0,e.rangeSlider.points=[],e.series.length?e.series.map(function(o){t=o.dataSource||e.dataSource,i=o.query||e.query,o.points=[],r.processDataSource(t,i,e,o)}):this.processDataSource(e.dataSource,e.query,e)},o.prototype.processDataSource=function(e,i,o,n){var a=this;if(!(e instanceof r.DataManager)&&!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i))return void this.dataManagerSuccess({result:e,count:e.length},o,n);o.dataModule=new ar(e,i),o.dataModule.getData(o.dataModule.generateQuery().requiresCount()).then(function(e){return a.dataManagerSuccess(e,o,n)})},o.prototype.dataManagerSuccess=function(e,t,i){var r=e.count?e.result:[];t.allowServerDataBinding=!1,this.processJsonData(r,t,Object.keys(r).length,i),this.seriesLength+=i?1:this.seriesLength,i&&this.seriesLength!==t.series.length||(this.processXAxis(t),this.calculateGroupingBounds(t),this.processYAxis(t),t.renderChart())},o.prototype.processJsonData=function(e,i,o,n){for(var a,s=0,l=n&&n.xName||i.xName,h=n&&n.yName||i.yName;s<o;){if(a=new xa(t.getValue(l,e[s]),t.getValue(h,e[s])),a.yValue=i.isBlazor&&t.isNullOrUndefined(a.y)?0:+a.y,"DateTime"===i.valueType){var c=i.intl.getDateParser({skeleton:"full",type:"dateTime"}),d=i.intl.getDateFormat({skeleton:"full",type:"dateTime"});a.x=new Date(r.DataUtil.parse.parseJson({val:a.x}).val),a.xValue=i.isBlazor?Date.parse(a.x.toString()):Date.parse(c(d(a.x)))}else a.xValue=i.isBlazor&&t.isNullOrUndefined(a.x)?0:+a.x;n&&n.points.push(a),this.xMin=Math.min(this.xMin,a.xValue),this.yMin=Math.min(this.yMin,a.yValue),this.xMax=Math.max(this.xMax,a.xValue),this.yMax=Math.max(this.yMax,a.yValue),i.rangeSlider.points.push(a),s++}},o.prototype.processXAxis=function(e){var t={minimum:e.minimum,maximum:e.maximum,interval:e.interval,valueType:e.valueType,isInversed:e.enableRtl,labelFormat:e.labelFormat,logBase:e.logBase,skeleton:e.skeleton,skeletonType:e.skeletonType};this.xAxis=t,this.xAxis.intervalType=e.intervalType,this.xAxis.maximumLabels=3,this.xAxis.skeleton=e.skeleton,this.xAxis.intervalDivs=[10,5,2,1],this.xAxis.rect=e.bounds,this.xAxis.visibleLabels=[],this.xAxis.orientation="Horizontal";var i=e[G(e.valueType)+"Module"];i.min=this.xMin,i.max=this.xMax,i.getActualRange(this.xAxis,e.bounds),"Double"!==this.xAxis.valueType&&"DateTime"!==this.xAxis.valueType||i.updateActualRange(this.xAxis,this.xAxis.actualRange.min,this.xAxis.actualRange.max,this.xAxis.actualRange.interval),this.xAxis.actualRange.delta=this.xAxis.actualRange.max-this.xAxis.actualRange.min,this.xAxis.visibleRange=this.xAxis.actualRange,i.calculateVisibleLabels(this.xAxis,e)},o.prototype.processYAxis=function(e){var t={majorGridLines:{width:0},rangePadding:"None",majorTickLines:{width:0},labelStyle:{size:"0"},visible:!1,valueType:"Double",minimum:null,maximum:null,interval:null};this.yAxis=t,this.yAxis.rect=e.bounds,this.yAxis.maximumLabels=3,this.yAxis.intervalDivs=[10,5,2,1],this.yAxis.orientation="Vertical",e.doubleModule.min=this.yMin,e.doubleModule.max=this.yMax,e.doubleModule.getActualRange(this.yAxis,e.bounds),e.doubleModule.updateActualRange(this.yAxis,this.yAxis.actualRange.min,this.yAxis.actualRange.max,this.yAxis.actualRange.interval),this.yAxis.actualRange.delta=this.yAxis.actualRange.max-this.yAxis.actualRange.min,this.yAxis.visibleRange=this.yAxis.actualRange},o.prototype.renderSeries=function(e){var t=this;this.chartGroup=e.renderer.createGroup({id:e.element.id+"_chart"});var i=h(e.theme);e.series.map(function(r,o){(!e.stockChart||e.stockChart.series[o].visible)&&(r.xAxis=t.xAxis,r.yAxis=t.yAxis,r.chart=e,r.index=o,r.xAxis.isInversed=e.enableRtl,r.interior=r.fill||i[o%i.length],t.createSeriesElement(e,r,o),e[G(r.type)+"SeriesModule"]?e[G(r.type)+"SeriesModule"].render(r,t.xAxis,t.yAxis,!1):e.lineSeriesModule.render(r,t.xAxis,t.yAxis,!1),t.chartGroup.appendChild(r.seriesElement),r.animation.enable&&e.animateSeries&&e[G(r.type)+"SeriesModule"]&&e[G(r.type)+"SeriesModule"].doAnimation(r))})},o.prototype.appendSeriesElements=function(e){e.svgObject.appendChild(this.chartGroup),e.series.length&&this.drawSeriesBorder(e)},o.prototype.createSeriesElement=function(e,t,r){var o=e.element.id;t.clipRect=new i.Rect(this.xAxis.rect.x,this.yAxis.rect.y,this.xAxis.rect.width,this.yAxis.rect.height),t.clipRectElement=e.renderer.drawClipPath(new Di(o+"_RangeSeriesClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:t.clipRect.width,height:t.clipRect.height})),t.seriesElement=e.renderer.createGroup({id:o+"SeriesGroup"+r,transform:"translate("+t.clipRect.x+","+t.clipRect.y+")","clip-path":"url(#"+o+"_RangeSeriesClipRect_"+r+")"}),t.seriesElement.appendChild(t.clipRectElement)},o.prototype.calculateGroupingBounds=function(e){var t=e.margin.bottom,r=i.measureText("string",e.labelStyle).height;this.calculateDateTimeNiceInterval(this.xAxis,new i.Size(e.bounds.width,e.bounds.height),this.xMin,this.xMax,!1),!e.enableGrouping||"DateTime"!==e.valueType||"Years"===this.xAxis.actualIntervalType&&e.series.length||(e.bounds.height-="Outside"===e.labelPosition||0===e.series.length?t+r:r+2*t),e.series.length||(e.bounds.y+=e.bounds.height/4,e.bounds.height=e.bounds.height/2)},o.prototype.drawSeriesBorder=function(e){var t=e.stockChart?"M":"L",r=e.stockChart?"":"Z",o=new i.PathOption(e.element.id+"_SeriesBorder","transparent",e.navigatorBorder.width,e.navigatorBorder.color,1,"","M "+e.bounds.x+" "+e.bounds.y+" L "+(e.bounds.x+e.bounds.width)+" "+e.bounds.y+t+(e.bounds.x+e.bounds.width)+" "+(e.bounds.y+e.bounds.height)+" L "+e.bounds.x+" "+(e.bounds.y+e.bounds.height)+r),n=e.renderer.drawPath(o);e.svgObject.appendChild(n)},o}(Ar),Ca=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pa=function(e){function t(t){var i=e.call(this)||this;return i.firstLevelLabels=[],i.secondLevelLabels=[],i.rangeNavigator=t,i}return Ca(t,e),t.prototype.renderGridLines=function(){var e=0,t=this.rangeNavigator,r=t.majorGridLines,o=t.majorTickLines,n="",a="",s=t.bounds,l=t.chartSeries.xAxis,h=t.disableRangeSelector?"transparent":null;this.gridLines=t.renderer.createGroup({id:t.element.id+"_GridLines"});var c="Outside"===t.tickPosition||0===t.series.length?s.y+s.height+o.height:s.y+s.height-o.height;this.firstLevelLabels=[],l.labelStyle=t.labelStyle,l.skeleton=t.skeleton,l.skeletonType=t.skeletonType,l.isChart=!1,"DateTime"===t.valueType&&(this.calculateDateTimeNiceInterval(l,s,l.doubleRange.start,l.doubleRange.end,l.isChart),this.actualIntervalType=l.actualIntervalType,this.findAxisLabels(l)),this.firstLevelLabels=l.visibleLabels,this.lowerValues=[];for(var d=l.visibleLabels.length,p=0;p<d;p++)this.lowerValues.push(this.firstLevelLabels[p].value),(e=I(this.firstLevelLabels[p].value,l)*s.width+s.x)>=s.x&&s.x+s.width>=e&&(n=n.concat("M "+e+" "+(t.bounds.y+t.bounds.height)+" L "+e+" "+t.bounds.y+" "),a=a.concat("M "+e+" "+(s.y+s.height)+" L "+e+" "+c+" "));var u=new i.PathOption(t.element.id+"_MajorGridLine","transparent",r.width,t.series.length?h||r.color||t.themeStyle.gridLineColor:"transparent",1,r.dashArray,n);this.gridLines.appendChild(t.renderer.drawPath(u)),u=new i.PathOption(t.element.id+"_MajorTickLine","transparent",o.width,h||o.color||t.themeStyle.gridLineColor,1,r.dashArray,a),this.gridLines.appendChild(t.renderer.drawPath(u))},t.prototype.renderAxisLabels=function(){var e,t=this.rangeNavigator.chartSeries.xAxis,r=this.rangeNavigator,o=r.renderer.createGroup({id:r.element.id+"_AxisLabels"}),n=r.renderer.createGroup({id:r.element.id+"_FirstLevelAxisLabels"}),a=r.renderer.createGroup({id:r.element.id+"_SecondLevelAxisLabels"}),s=t;if(e=this.findLabelY(r,!1),this.placeAxisLabels(t,e,"_AxisLabel_",r,n),s.intervalType=s.actualIntervalType=r.groupBy||this.getSecondaryLabelType(t.actualIntervalType),s.labelFormat="",r.enableGrouping&&"DateTime"===r.valueType&&"Years"!==this.actualIntervalType){s.visibleRange.interval=1,s.visibleLabels=[],this.findAxisLabels(s),this.secondLevelLabels=s.visibleLabels,e=this.findLabelY(r,!0);var l=this.placeAxisLabels(s,e,"_SecondaryLabel_",r,a),h=new i.PathOption(r.element.id+"_SecondaryMajorLines","transparent",r.majorTickLines.width,r.majorTickLines.color||r.themeStyle.gridLineColor,1,r.majorGridLines.dashArray,l);this.gridLines.appendChild(r.renderer.drawPath(h))}r.chartSeries.xAxis.visibleLabels=r.chartSeries.xAxis.visibleLabels.concat(s.visibleLabels),o.appendChild(n),o.appendChild(a),r.svgObject.appendChild(this.gridLines),r.svgObject.appendChild(o)},t.prototype.getSecondaryLabelType=function(e){var t=["Years","Quarter","Months","Weeks","Days","Hours","Minutes","Seconds"];return"Years"===e?"Years":t[t.indexOf(e)-1]},t.prototype.findAxisLabels=function(e){e.visibleLabels=[];var t,i,r=new Date(e.visibleRange.min),o=this.rangeNavigator.interval?this.rangeNavigator.interval:1;switch(e.actualIntervalType){case"Years":r=new Date(r.getFullYear(),0,1);break;case"Quarter":r=r.getMonth()<=2?new Date(r.getFullYear(),0,1):r.getMonth()<=5?new Date(r.getFullYear(),3,1):r.getMonth()<=8?new Date(r.getFullYear(),6,1):new Date(r.getFullYear(),9,1);break;case"Months":r=new Date(r.getFullYear(),r.getMonth());break;case"Weeks":r=new Date(r.getFullYear(),r.getMonth(),r.getDate()-r.getDay());break;case"Days":r=new Date(r.getFullYear(),r.getMonth(),r.getDate());break;case"Hours":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours());break;case"Minutes":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes());break;case"Seconds":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds())}for(t=r.getTime(),this.rangeNavigator.format=this.rangeNavigator.intl.getDateFormat({format:e.labelFormat||this.blazorFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,null,null,this.rangeNavigator.isBlazor)});t<=e.visibleRange.max;)i=this.dateFormats(this.rangeNavigator.format(new Date(t)),e,e.visibleLabels.length),e.visibleLabels.push(new Ti(i,t,this.rangeNavigator.labelStyle,i)),t=this.increaseDateTimeInterval(e,t,o).getTime()},t.prototype.blazorFormat=function(e){return this.rangeNavigator.isBlazor&&"Years"===e.actualIntervalType?"yyyy":""},t.prototype.dateFormats=function(e,t,i){var r=e,o=this.rangeNavigator.isBlazor,n=this.rangeNavigator.enableGrouping&&0===this.firstLevelLabels.length;switch(t.actualIntervalType){case"Quarter":e.indexOf("Jan")>-1?r=n?"Quarter1":e.replace(o?"January":"Jan","Quarter1"):e.indexOf("Apr")>-1?r=n?"Quarter2":e.replace(o?"April":"Apr","Quarter2"):e.indexOf("Jul")>-1?r=n?"Quarter3":e.replace(o?"July":"Jul","Quarter3"):e.indexOf("Oct")>-1&&(r=n?"Quarter4":e.replace(o?"October":"Oct","Quarter4"));break;case"Weeks":r="Week"+ ++i;break;default:r=e}return r},t.prototype.findLabelY=function(e,t){var r,o=e.bounds.y+e.bounds.height,n=e.majorTickLines.height,a=i.measureText("Quarter1 2011",e.labelStyle).height,s=8;return r="Outside"===e.labelPosition&&"Outside"===e.tickPosition||0===e.series.length?o+n+s+.75*a:"Inside"===e.labelPosition&&"Inside"===e.tickPosition?o-n-s:"Inside"===e.labelPosition&&"Outside"===e.tickPosition?o-s:o+s+.75*a,t&&(s=15,"Outside"===e.labelPosition||0===e.series.length?r+=s+.75*a:r="Outside"===e.tickPosition||0===e.series.length?o+n+s+.75*a:o+s+.75*a),r},t.prototype.placeAxisLabels=function(e,t,r,o,n){var a,s,l,h,c=e.visibleLabels.length,d=o.bounds,p="",u=o.disableRangeSelector?"transparent":null,g=o.enableRtl?d.x+d.width:d.x,y=e.actualIntervalType,m="DateTime"===o.valueType?c>1?e.visibleLabels[1].value-e.visibleLabels[0].value:(e.visibleRange.max-e.visibleLabels[0].value)/2:0;"DateTime"!==o.valueType||"Quarter"!==y&&"Weeks"!==y||this.findSuitableFormat(e,o);for(var v=0,f=c;v<f;v++)if(a=e.visibleLabels[v],a.size=i.measureText(a.text,e.labelStyle),"Middle"===o.secondaryLabelAlignment?l=I(a.value+m/2,e)*d.width+d.x:r.indexOf("Secondary")>-1&&(l=this.findAlignment(e,v)),h=I(a.value,e)*d.width+d.x,(0===v||v===e.visibleLabels.length-1&&o.enableRtl)&&l<d.x&&(l=d.x+a.size.width/2),(v===e.visibleLabels.length-1||0===v&&o.enableRtl)&&l+a.size.width>d.x+d.width&&(l=d.x+d.width-a.size.width/2),r.indexOf("_SecondaryLabel_")>-1&&l>=d.x&&d.x+d.width>=l&&(p=p.concat("M "+h+" "+t+" L "+h+" "+(t-a.size.height))),"Hide"!==o.labelIntersectAction||0===v||!this.isIntersect(e,l,a.size.width,g,s.size.width)){"Middle"===o.secondaryLabelAlignment&&1===e.visibleLabels.length&&(l=I(a.value,e)+(d.x+d.width/2));var b=o.labelStyle,x={size:b.size,color:u||b.color||o.themeStyle.labelFontColor,fontFamily:b.fontFamily,fontStyle:b.fontStyle||o.labelStyle.fontStyle,fontWeight:b.fontWeight||o.labelStyle.fontWeight,opacity:b.opacity||o.labelStyle.opacity,textAlignment:b.textAlignment||o.labelStyle.textAlignment,textOverflow:b.textOverflow||o.labelStyle.textOverflow},w={cancel:!1,name:"labelRender",text:a.text,value:a.value,labelStyle:x,region:new i.Rect(l,t,a.size.width,a.size.height)};o.trigger("labelRender",w),w.cancel||(o.labels.push(w),Ve(this.rangeNavigator.renderer,new i.TextOption(this.rangeNavigator.element.id+r+v,l,t,"middle",w.text),w.labelStyle,w.labelStyle.color||o.themeStyle.labelFontColor,n).style.cursor="DateTime"===e.valueType?"cursor: pointer":"cursor: default",g=l,s=a)}return p},t.prototype.isIntersect=function(e,t,i,r,o){return e.isInversed?t+i/2>r-o/2:t-i/2<r+o/2},t.prototype.findSuitableFormat=function(e,t){for(var r,o,n=e.visibleLabels,a=n.length,s=t.bounds,l="DateTime"===t.valueType?a>1?n[1].value-n[0].value:e.visibleRange.interval:0,h=0;h<a;h++)o=I(n[h].value+l/2,e)*s.width+s.x,n[h].size=i.measureText(n[h].text,e.labelStyle),0===h&&o<s.x&&(o=s.x+n[h].size.width/2),"Quarter"===e.actualIntervalType?0!==h&&(n[h].text.indexOf("Quarter")>-1&&this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)?(n.every(function(e){return e.text=e.text.toString().replace("Quarter","QTR"),!0}),e.visibleLabels=n,this.findSuitableFormat(e,t)):this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)&&(n.every(function(e){return e.text=e.text.toString().replace("QTR","Q"),!0}),e.visibleLabels=n)):"Weeks"===e.actualIntervalType&&0!==h&&n[h].text.indexOf("Week")>-1&&this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)&&(n.every(function(e){return e.text=e.text.toString().replace("Week","W"),!0}),e.visibleLabels=n),r=o},t.prototype.findAlignment=function(e,t){var i=e.visibleLabels[t],r=e.visibleLabels[t+1],o=this.rangeNavigator.bounds;return"Near"===this.rangeNavigator.secondaryLabelAlignment?I(i.value,e)*o.width+o.x+i.size.width/2:I(r?r.value:e.visibleRange.max,e)*o.width+o.x-i.size.width},t}(Tr);!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.tooltipLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"}}(e.RangeNavigatorTheme||(e.RangeNavigatorTheme={}));var La=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ra=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ma=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return La(r,e),Ra([t.Property(null)],r.prototype,"dataSource",void 0),Ra([t.Property(null)],r.prototype,"xName",void 0),Ra([t.Property(null)],r.prototype,"yName",void 0),Ra([t.Property()],r.prototype,"query",void 0),Ra([t.Property("Line")],r.prototype,"type",void 0),Ra([t.Complex({enable:!1},qt)],r.prototype,"animation",void 0),Ra([t.Complex({color:"transparent",width:2},Yt)],r.prototype,"border",void 0),Ra([t.Property(null)],r.prototype,"fill",void 0),Ra([t.Property(1)],r.prototype,"width",void 0),Ra([t.Property(1)],r.prototype,"opacity",void 0),Ra([t.Property("0")],r.prototype,"dashArray",void 0),r}(t.ChildProperty),Aa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return La(i,e),Ra([t.Property(null)],i.prototype,"width",void 0),Ra([t.Property(null)],i.prototype,"height",void 0),Ra([t.Complex({width:1,color:null},Yt)],i.prototype,"border",void 0),Ra([t.Property(null)],i.prototype,"fill",void 0),Ra([t.Property("Circle")],i.prototype,"type",void 0),i}(t.ChildProperty),ka=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return La(i,e),Ra([t.Complex({},Aa)],i.prototype,"thumb",void 0),Ra([t.Property(null)],i.prototype,"selectedRegionColor",void 0),Ra([t.Property(null)],i.prototype,"unselectedRegionColor",void 0),i}(t.ChildProperty),Ta=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return La(r,i),Ra([t.Property(!1)],r.prototype,"enable",void 0),Ra([t.Property(.85)],r.prototype,"opacity",void 0),Ra([t.Property(null)],r.prototype,"fill",void 0),Ra([t.Property(null)],r.prototype,"format",void 0),Ra([t.Complex(e.RangeNavigatorTheme.tooltipLabelFont,Xt)],r.prototype,"textStyle",void 0),Ra([t.Property(null)],r.prototype,"template",void 0),Ra([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),Ra([t.Property("OnDemand")],r.prototype,"displayMode",void 0),r}(t.ChildProperty),_a=function(){function e(e){this.control=e,this.points=[],this.isIOS=t.Browser.isIos||t.Browser.isIos7;var i=e.navigatorStyleSettings.thumb;this.thumbVisible=0!==e.themeStyle.thumbWidth&&0!==e.themeStyle.thumbHeight,this.elementId=e.element.id,this.thumpPadding=e.themeStyle.thumbWidth/2,this.addEventListener(),this.thumbColor=e.disableRangeSelector?"transparent":i.fill||e.themeStyle.thumbBackground}return e.prototype.render=function(e){var t=e.renderer,i=e.navigatorStyleSettings,r=e.disableRangeSelector?"transparent":null,o=t.createGroup({id:this.elementId+"_sliders",style:e.disableRangeSelector?"pointer-events:none;":""}),n=new Di(this.elementId+"_leftUnSelectedArea",r||i.unselectedRegionColor||e.themeStyle.unselectedRectColor,{width:0},1,{x:e.bounds.x,y:e.bounds.y,width:e.bounds.width/3,height:e.bounds.height});this.leftUnSelectedElement=t.drawRectangle(n),n.id=this.elementId+"_rightUnSelectedArea",this.rightUnSelectedElement=t.drawRectangle(n),n.id=this.elementId+"_SelectedArea",n.fill=r||i.selectedRegionColor||e.themeStyle.selectedRegionColor,this.selectedElement=t.drawRectangle(n),this.selectedElement.setAttribute("style","cursor: -webkit-grab"),this.leftSlider=t.createGroup({id:this.elementId+"_LeftSlider",style:"cursor: ew-resize"}),this.rightSlider=t.createGroup({id:this.elementId+"_RightSlider",style:"cursor: ew-resize"}),this.createThump(t,e.bounds,this.leftSlider,this.elementId+"_LeftSlider",o),this.createThump(t,e.bounds,this.rightSlider,this.elementId+"_RightSlider"),o.appendChild(this.leftUnSelectedElement),o.appendChild(this.rightUnSelectedElement),o.appendChild(this.selectedElement),o.appendChild(this.leftSlider),o.appendChild(this.rightSlider),e.svgObject.appendChild(o)},e.prototype.createThump=function(e,t,r,o,n){var a,s=this.control,l=s.navigatorStyleSettings.thumb,h=s.themeStyle,c=t.y+t.height/2,d=this.thumpPadding,p=s.themeStyle.thumbHeight/2-5,u=s.disableRangeSelector?"transparent":null,g=u||l.border.color||h.thumpLineColor;r.appendChild(e.drawPath(new i.PathOption(o+"_ThumpLine","transparent",l.border.width,s.series.length?g:"transparent",1,null,"M "+d+" "+t.y+" L "+d+" "+(t.y+t.height)+" "))),this.thumpY=c-s.themeStyle.thumbHeight/2,this.sliderY=t.y>this.thumpY?this.thumpY:t.y,n&&!s.disableRangeSelector&&((a=e.createDefs()).innerHTML='<rect xmlns="http://www.w3.org/2000/svg" id="'+this.control.element.id+'_shadow" x="0" y="'+this.thumpY+'" width="'+s.themeStyle.thumbWidth+'" height="'+s.themeStyle.thumbHeight+'" rx="'+("Circle"===l.type?"50%":"0%")+'"/><filter xmlns="http://www.w3.org/2000/svg" x="-25.0%" y="-20.0%" width="150.0%" height="150.0%" filterUnits="objectBoundingBox" id="ej2-range-shadow"><feOffset dx="0" dy="1" in="SourceAlpha"result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0" type="matrix" in="shadowBlurOuter1"/></filter>',n.appendChild(a)),r.innerHTML+='<use xmlns="http://www.w3.org/2000/svg" fill="black" fill-opacity="1" filter="url(#ej2-range-shadow)" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#path-1"/>',"Circle"===l.type?r.appendChild(ne({x:d,y:c},"Circle",{width:s.themeStyle.thumbWidth,height:s.themeStyle.thumbHeight},"",new i.PathOption(o+"_ThumpSymbol",u||this.thumbColor,l.border.width,g,1,null),"Thumb")):r.appendChild(e.drawRectangle(new Di(o+"_ThumpSymbol",u||this.thumbColor,{width:l.border.width,color:g},1,{x:d-s.themeStyle.thumbWidth/2,y:c-s.themeStyle.thumbHeight/2,width:s.themeStyle.thumbWidth,height:s.themeStyle.thumbHeight},2,2))),this.thumbVisible&&r.appendChild(e.drawPath(new i.PathOption(o+"_ThumpGrip","transparent",1,u||s.themeStyle.gripColor,1,null,"M "+(d+2)+" "+(c+p)+" L "+(d+2)+" "+(c-p)+" M "+d+" "+(c+p)+" L "+d+" "+(c-p)+" M "+(d-2)+" "+(c+p)+" L "+(d-2)+" "+(c-p)+" ")))},e.prototype.setSlider=function(e,t,i,r){var o=this.control,n=o.bounds.x,a=o.chartSeries.xAxis.actualRange,s=0===o.series.length;isNaN(e)&&isNaN(t)&&(e=0,t=o.bounds.width),t>=e||(e=[t,t=e][0]),e=t>=e?e:[t,t=e][0],e=Math.max(e,a.min),t=Math.min(t,a.max),this.startX=n+it(e,a,o.bounds.width,o.enableRtl),this.endX=n+it(t,a,o.bounds.width,o.enableRtl);var l=o.enableRtl?this.endX:this.startX,h=o.enableRtl?this.startX:this.endX;this.sliderWidth=Math.abs(this.endX-this.startX),this.selectedElement.setAttribute("x",l+""),this.selectedElement.setAttribute("width",this.sliderWidth+""),this.leftUnSelectedElement.setAttribute("width",l-n+""),this.rightUnSelectedElement.setAttribute("x",h+""),this.rightUnSelectedElement.setAttribute("width",o.bounds.width-(h-n)+""),this.leftSlider.setAttribute("transform","translate("+(this.startX-this.thumpPadding)+", 0)"),this.rightSlider.setAttribute("transform","translate("+(this.endX-this.thumpPadding)+", 0)");var c=this.control.svgObject.getBoundingClientRect().left-this.control.element.getBoundingClientRect().left,d=this.control.enableRtl?this.endX:this.startX,p=this.control.enableRtl?this.startX:this.endX;this.leftRect={x:s?c+n:n,y:s?0:o.bounds.y,width:s?d-n:d,height:s?this.thumpY:o.bounds.height},this.rightRect={x:s?c+p:p,y:s?0:o.bounds.y,width:o.bounds.width-(h-n),height:s?this.thumpY:o.bounds.height},this.midRect={x:s?d+c:0,y:s?0:o.bounds.y,width:s?Math.abs(this.endX-this.startX):p,height:s?this.thumpY:o.bounds.height},this.currentStart=e,this.currentEnd=t,r&&(this.control.rangeTooltipModule.renderLeftTooltip(this),this.control.rangeTooltipModule.renderRightTooltip(this)),i&&this.triggerEvent(a)},e.prototype.triggerEvent=function(e){var t=this.control.chartSeries.xAxis,i=t.valueType,r={cancel:!1,start:"DateTime"===i?new Date(this.currentStart):"Logarithmic"===i?Math.pow(t.logBase,this.currentStart):this.currentStart,end:"DateTime"===i?new Date(this.currentEnd):"Logarithmic"===i?Math.pow(t.logBase,this.currentEnd):this.currentEnd,name:"changed",selectedData:ot(this.points,this.currentStart,this.currentEnd),zoomPosition:(this.control.enableRtl?e.max-this.currentEnd:this.currentStart-e.min)/e.delta,zoomFactor:(this.currentEnd-this.currentStart)/e.delta};this.control.trigger("changed",r)},e.prototype.addEventListener=function(){this.control.isDestroyed||(this.control.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.control.on(t.Browser.touchStartEvent,this.mouseDownHandler,this),this.control.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.control.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler,this))},e.prototype.removeEventListener=function(){this.control.isDestroyed||(this.control.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.control.off(t.Browser.touchStartEvent,this.mouseDownHandler),this.control.off(t.Browser.touchEndEvent,this.mouseUpHandler),this.control.off(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler))},e.prototype.mouseMoveHandler=function(e){var t,i,r=this.control,o=r.chartSeries.xAxis.actualRange,n=r.bounds;if(this.getCurrentSlider(e.target.id),this.isDrag&&r.mouseX>=n.x){switch(this.currentSlider){case"Left":r.startValue=this.getRangeValue(Math.abs(r.mouseX-n.x));break;case"Right":r.endValue=this.getRangeValue(Math.abs(r.mouseX-n.x));break;case"Middle":t=Math.max(this.getRangeValue(Math.abs(this.startX-(this.previousMoveX-r.mouseX)-n.x)),o.min),i=Math.min(this.getRangeValue(Math.abs(this.endX-(this.previousMoveX-r.mouseX)-n.x)),o.max),Math.floor(Math.abs(it(i,o,r.bounds.width,r.enableRtl)-it(t,o,r.bounds.width,r.enableRtl)))===Math.floor(this.sliderWidth)&&(r.startValue=t,r.endValue=i)}e.preventDefault&&this.isIOS&&e.preventDefault(),this.setSlider(r.startValue,r.endValue,!r.enableDeferredUpdate,r.rangeTooltipModule&&r.tooltip.enable),this.previousMoveX=r.mouseX}},e.prototype.getRangeValue=function(e){var t=this.control,i=t.chartSeries.xAxis.actualRange;return rt(e,t.bounds.width,i,t.enableRtl)},e.prototype.mouseDownHandler=function(e){this.currentSlider=this.getCurrentSlider(e.target.id),this.selectedElement.setAttribute("style","cursor: -webkit-grabbing"),this.isDrag=!("UnSelectedArea"===this.currentSlider||!this.currentSlider),this.previousMoveX=this.control.mouseDownX},e.prototype.getCurrentSlider=function(e){var t=this.control.themeStyle.thumbHoverColor;return e.indexOf(this.elementId+"_LeftSlider")>-1?(this.leftSlider.childNodes[2].setAttribute("fill",t),"Left"):e.indexOf(this.elementId+"_RightSlider")>-1?(this.rightSlider.childNodes[2].setAttribute("fill",t),"Right"):e.indexOf(this.elementId+"_SelectedArea")>-1?"Middle":e.indexOf("UnSelectedArea")>-1?(this.leftSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.rightSlider.childNodes[2].setAttribute("fill",this.thumbColor),"UnSelectedArea"):e.indexOf(this.elementId+"_AxisLabel_")>-1&&"DateTime"===this.control.valueType?(this.labelIndex=+e.substring(e.lastIndexOf("_")+1,e.length),"firstLevelLabels"):e.indexOf(this.elementId+"_SecondaryLabel")>-1&&"DateTime"===this.control.valueType?(this.labelIndex=+e.substring(e.lastIndexOf("_")+1,e.length),"secondLevelLabels"):(this.leftSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.rightSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.control.periodSelectorModule&&(this.control.periodSelectorModule.triggerChange=!0),null)},e.prototype.mouseUpHandler=function(){var e=this.control,t=e.chartSeries.xAxis.actualRange,i=e.enableDeferredUpdate,r=e.tooltip.enable;if(e.stockChart&&(e.stockChart.zoomChange=!1),"UnSelectedArea"===this.currentSlider){var o=void 0,n=void 0,a=void 0,s=e.enableRtl,l=e.endValue-e.startValue;e.mouseDownX<this.startX?(o=Math.max(this.getRangeValue(e.mouseDownX-this.sliderWidth/2-e.bounds.x),t.min),a=s?o:o+l,n=s?o-l:o):(o=Math.min(this.getRangeValue(e.mouseDownX+this.sliderWidth/2-e.bounds.x),t.max),n=s?o:o-l,a=s?o+l:o),this.performAnimation(n,a,e),i=!1}else if("firstLevelLabels"===this.currentSlider||"secondLevelLabels"===this.currentSlider){var h=e.rangeAxis[this.currentSlider][this.labelIndex+1];this.performAnimation(e.rangeAxis[this.currentSlider][this.labelIndex].value,h?e.allowIntervalData?h.value-1:h.value:t.max,e),i=!1}this.isDrag&&e.allowSnapping&&(this.setAllowSnapping(e,this.currentStart,this.currentEnd,i,r),i=!1),i&&this.setSlider(this.currentStart,this.currentEnd,!0,r),null!==this.currentSlider&&this.control.periodSelectorSettings.periods.length>0&&(this.control.periodSelectorModule.triggerChange=!1,this.control.periodSelectorModule.datePicker.startDate=new Date(this.currentStart),this.control.periodSelectorModule.datePicker.endDate=new Date(this.currentEnd)),this.selectedElement.setAttribute("style","cursor: -webkit-grab"),e.startValue=this.currentStart,e.endValue=this.currentEnd,this.isDrag=!1,this.labelIndex=null,this.currentSlider=null},e.prototype.setAllowSnapping=function(e,t,i,r,o){var n=e.rangeAxis.lowerValues;n.push(e.chartSeries.xAxis.actualRange.max),this.setSlider(nt(n,t),nt(n,i),r,o),e.startValue=this.currentStart,e.endValue=this.currentEnd},e.prototype.performAnimation=function(e,i,r,o){var n=this,a=this.currentStart,s=this.currentEnd,l=r.enableDeferredUpdate,h=r.tooltip.enable;new t.Animation({}).animate(t.createElement("div"),{duration:t.isNullOrUndefined(o)?this.control.animationDuration:o,progress:function(t){n.setSlider(q(t.timeStamp,0,e-a,t.duration)+a,q(t.timeStamp,0,i-s,t.duration)+s,!l,h)},end:function(){r.allowSnapping?n.setAllowSnapping(r,e,i,!0,h):n.setSlider(e,i,!0,h),n.control.startValue=n.currentStart,n.control.endValue=n.currentEnd,n.control.periodSelectorSettings.periods.length>0&&(n.control.periodSelectorModule.triggerChange=!1,n.control.periodSelectorModule.datePicker.startDate=new Date(n.currentStart),n.control.periodSelectorModule.datePicker.endDate=new Date(n.currentEnd))}})},e.prototype.mouseCancelHandler=function(){this.isDrag&&this.control.allowSnapping&&this.setAllowSnapping(this.control,this.currentStart,this.currentEnd,!1,this.control.tooltip.enable),this.isDrag=!1,this.currentSlider=null,this.control.startValue=this.currentStart,this.control.endValue=this.currentEnd},e.prototype.destroy=function(){this.removeEventListener()},e}(),Oa=function(){function e(e){this.control={},this.rootControl=e}return e.prototype.setControlValues=function(e){"rangeNavigator"===e.getModuleName()?(this.control.periods=this.rootControl.periodSelectorSettings.periods,this.control.seriesXMax=e.chartSeries.xMax,this.control.seriesXMin=e.chartSeries.xMin,this.control.rangeSlider=e.rangeSlider,this.control.rangeNavigatorControl=e,this.control.endValue=e.endValue,this.control.startValue=e.startValue):(this.control.periods=this.rootControl.periods,this.control.endValue=this.control.seriesXMax=e.seriesXMax,this.control.startValue=this.control.seriesXMin=e.seriesXMin,this.control.rangeNavigatorControl=this.rootControl.rangeNavigator,this.control.rangeNavigatorControl&&(this.control.rangeSlider=this.rootControl.rangeNavigator.rangeSlider)),this.control.element=e.element,this.control.disableRangeSelector=e.disableRangeSelector},e.prototype.appendSelector=function(e,t){void 0===t&&(t=0),this.renderSelectorElement(null,e,t),this.renderSelector()},e.prototype.renderSelectorElement=function(e,r,o){this.periodSelectorSize=e?this.periodSelectorSize:new i.Rect(o,this.rootControl.titleSize.height,r.width,r.height);var n,a;e?(n=e.themeStyle.thumbWidth,a=e.element):(n=r.thumbSize,a=r.element),he(a.id+"_Secondary_Element")&&t.remove(he(a.id+"_Secondary_Element")),this.periodSelectorDiv=t.createElement("div",{id:a.id+"_Secondary_Element",styles:"width: "+(this.periodSelectorSize.width-n)+"px;height: "+this.periodSelectorSize.height+"px;top:"+this.periodSelectorSize.y+"px;left:"+(this.periodSelectorSize.x+n/2)+"px; position: absolute"}),a.appendChild(this.periodSelectorDiv)},e.prototype.renderSelector=function(){var e=this;this.setControlValues(this.rootControl);var i=!0,r=this.control.element.id,o=t.createElement("div",{id:r+"_selector"}),s=this.control.periods,l=this.updateCustomElement(),h="text-transform: none; text-overflow: unset",c=r+"customRange";this.periodSelectorDiv.appendChild(o);for(var d=0;d<s.length;d++)l.push({align:"Left",text:s[d].text});"stockChart"===this.rootControl.getModuleName()&&(i=this.rootControl.enableCustomRange),i&&(this.calendarId=r+"_calendar",l.push({template:"<button id="+this.calendarId+"></button>",align:"Right"}));var p={selector:l,name:"RangeSelector",cancel:!1,enableCustomFormat:!0,content:"Date Range"};"stockChart"===this.rootControl.getModuleName()&&(l.push({template:t.createElement("button",{id:r+"_reset",innerHTML:"Reset",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"}),this.rootControl.exportType.indexOf("Print")>-1&&l.push({template:t.createElement("button",{id:r+"_print",innerHTML:"Print",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"}),this.rootControl.exportType.length&&l.push({template:t.createElement("button",{id:r+"_export",innerHTML:"Export",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"})),this.rootControl.trigger("selectorRender",p),this.toolbar=new n.Toolbar({items:p.selector,height:this.periodSelectorSize.height,clicked:function(t){e.buttonClick(t,e.control)},created:function(){e.nodes=e.toolbar.element.querySelectorAll(".e-toolbar-left")[0],t.isNullOrUndefined(e.selectedIndex)&&s.map(function(t,i){t.selected&&(e.control.startValue=e.changedRange(t.intervalType,e.control.endValue,t.interval).getTime(),e.selectedIndex=e.nodes.childNodes.length-s.length+i)}),e.setSelectedStyle(e.selectedIndex)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(o),this.triggerChange=!0,i&&(this.datePicker=new a.DateRangePicker({min:new Date(this.control.seriesXMin),max:new Date(this.control.seriesXMax),format:"dd'/'MM'/'yyyy",placeholder:"Select a range",showClearButton:!1,startDate:new Date(this.control.startValue),endDate:new Date(this.control.endValue),created:function(){if(p.enableCustomFormat){for(var i=document.getElementsByClassName("e-date-range-wrapper"),o=void 0,n=0;n<i.length;n++)-1!==i[n].children[0].id.indexOf(r)&&(o=i[n]);o.style.display="none",o.insertAdjacentElement("afterend",t.createElement("div",{id:c,innerHTML:p.content,className:"e-btn e-dropdown-btn",styles:'font-family: "Segoe UI"; font-size: 14px; font-weight: 500; text-transform: none '})),he(c).insertAdjacentElement("afterbegin",t.createElement("span",{id:r+"dateIcon",className:"e-input-group-icon e-range-icon e-btn-icon e-icons",styles:"font-size: 16px; min-height: 0px; margin: -3px 0 0 0; outline: none; min-width: 30px"})),document.getElementById(c).onclick=function(){e.datePicker.show(he(c))}}},change:function(t){if(e.triggerChange&&(e.control.rangeSlider&&t.event?e.control.rangeSlider.performAnimation(t.startDate.getTime(),t.endDate.getTime(),e.control.rangeNavigatorControl):t.event&&e.rootControl.rangeChanged(t.startDate.getTime(),t.endDate.getTime()),e.nodes=e.toolbar.element.querySelectorAll(".e-toolbar-left")[0],!e.rootControl.resizeTo&&e.control.rangeSlider&&e.control.rangeSlider.isDrag))for(var i=0,r=e.nodes.childNodes.length;i<r;i++)e.nodes.childNodes[i].childNodes[0].classList.remove("e-active"),e.nodes.childNodes[i].childNodes[0].classList.remove("e-active")}}),this.datePicker.appendTo("#"+this.calendarId))},e.prototype.updateCustomElement=function(){var e=[],i=this.rootControl.element.id,r="text-transform: none; text-overflow: unset";return"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.seriesType.length&&e.push({template:t.createElement("button",{id:i+"_seriesType",innerHTML:"Series",styles:r}),align:"Left"}),this.rootControl.indicatorType.length&&e.push({template:t.createElement("button",{id:i+"_indicatorType",innerHTML:"Indicators",styles:r}),align:"Left"}),this.rootControl.trendlineType.length&&e.push({template:t.createElement("button",{id:i+"_trendType",innerHTML:"Trendline",styles:r}),align:"Left"})),e},e.prototype.setSelectedStyle=function(e){if(this.control.disableRangeSelector||"stockChart"===this.rootControl.getModuleName()){for(var t=0,i=this.nodes.childNodes.length;t<i;t++)this.nodes.childNodes[t].childNodes[0].classList.remove("e-active"),this.nodes.childNodes[t].childNodes[0].classList.remove("e-active");this.nodes.childNodes[e].childNodes[0].classList.add("e-flat"),this.nodes.childNodes[e].childNodes[0].classList.add("e-active")}},e.prototype.buttonClick=function(e,i){var r,o,n=this,a=e.item,s=this.control.rangeSlider,l=this.control.periods,h=l.filter(function(e){return e.text===a.text});l.map(function(t,i){t.text===e.item.text&&(n.selectedIndex=n.nodes.childNodes.length-l.length+i)}),""!==e.item.text&&this.setSelectedStyle(this.selectedIndex),"all"===a.text.toLowerCase()?(r=i.seriesXMin,o=i.seriesXMax,s?s.performAnimation(r,o,this.control.rangeNavigatorControl):this.rootControl.rangeChanged(r,o)):"ytd"===a.text.toLowerCase()?s?(r=new Date(new Date(s.currentEnd).getFullYear().toString()).getTime(),o=s.currentEnd,s.performAnimation(r,o,this.control.rangeNavigatorControl)):(r=new Date(new Date(this.rootControl.currentEnd).getFullYear().toString()).getTime(),o=this.rootControl.currentEnd,this.rootControl.rangeChanged(r,o)):""!==a.text.toLowerCase()&&(s?(r=this.changedRange(h[0].intervalType,s.currentEnd,h[0].interval).getTime(),o=s.currentEnd,s.performAnimation(r,o,this.control.rangeNavigatorControl)):(r=this.changedRange(h[0].intervalType,this.rootControl.currentEnd,h[0].interval).getTime(),o=this.rootControl.currentEnd,this.rootControl.rangeChanged(r,o))),"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.zoomChange=!1),he(this.calendarId+"_popup")&&!t.Browser.isDevice&&(he(this.calendarId+"_popup").querySelectorAll(".e-range-header")[0].style.display="none")},e.prototype.changedRange=function(e,t,i){var r=new Date(t);switch(e){case"Quarter":r.setMonth(r.getMonth()-3*i);break;case"Months":r.setMonth(r.getMonth()-i);break;case"Weeks":r.setDate(r.getDate()-7*i);break;case"Days":r.setDate(r.getDate()-i);break;case"Hours":r.setHours(r.getHours()-i);break;case"Minutes":r.setMinutes(r.getMinutes()-i);break;case"Seconds":r.setSeconds(r.getSeconds()-i);break;default:r.setFullYear(r.getFullYear()-i)}return r},e.prototype.getModuleName=function(){return"PeriodSelector"},e.prototype.destroy=function(){},e}(),Ea=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ia=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},za=function(r){function o(e,t){var i=r.call(this,e,t)||this;return i.animateSeries=!0,i.chartid=57725,i}return Ea(o,r),o.prototype.preRender=function(){if(this.isBlazor=window.Blazor,this.unWireEvents(),this.setCulture(),this.allowServerDataBinding=!1,""===this.element.id){var e=document.getElementsByClassName("e-rangenavigator").length;this.element.id="rangenavigator_"+this.chartid+"_"+e}this.wireEvents()},o.prototype.initPrivateVariables=function(){this.doubleModule=new ni,this.labels=[],this.rangeSlider=new _a(this),this.chartSeries=new Sa(this),this.lineSeriesModule=new Vr,this.rangeAxis=new Pa(this)},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.setSliderValue=function(){var e="DateTime"===this.valueType,t=this.chartSeries.xAxis.actualRange;this.startValue=this.startValue?this.startValue:this.value[0]?e?new Date(this.value[0].toString()).getTime():+this.value[0]:t.min,this.endValue=this.endValue?this.endValue:this.value[1]?e?new Date(this.value[1].toString()).getTime():+this.value[1]:t.max},o.prototype.render=function(){var e=this,t={name:"load",rangeNavigator:this.isBlazor?{}:this,theme:this.theme};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.initPrivateVariables(),e.createRangeSvg(),e.calculateBounds(),e.chartSeries.renderChart(e),m("chartmeasuretext"),e.renderComplete(),e.allowServerDataBinding=!0})},o.prototype.setTheme=function(){this.themeStyle=at(this.theme,this)},o.prototype.createRangeSvg=function(){this.removeSvg(),He(this),this.renderChartBackground()},o.prototype.calculateBounds=function(){var e=this.enableGrouping?15:8,t=this.navigatorStyleSettings.thumb,r=i.measureText("tempString",this.labelStyle).height,o=this.margin,n=!this.series.length,a=!this.disableRangeSelector&&n&&this.tooltip.enable?35:0;this.isBlazor&&!this.periodSelectorModule&&this.periodSelectorSettings.periods.length&&!this.stockChart&&(this.periodSelectorModule=new Oa(this));var s=this.periodSelectorModule;this.periodSelectorModule&&this.periodSelectorSettings.periods.length>0&&(s.periodSelectorSize={x:0,y:0,height:0,width:0},s.periodSelectorSize.width=this.availableSize.width,s.periodSelectorSize.height=this.periodSelectorSettings.height,s.periodSelectorSize.y="Bottom"===this.periodSelectorSettings.position?this.availableSize.height-s.periodSelectorSize.height:0);var l="Top"===this.periodSelectorSettings.position&&s?s.periodSelectorSize.y+s.periodSelectorSize.height:0,h=0,c=0;this.stockChart&&this.stockChart.stockLegendModule&&this.stockChart.legendSettings.visible&&("Left"===this.stockChart.legendSettings.position?h+=this.stockChart.stockLegendModule.legendBounds.width:"Top"===this.stockChart.legendSettings.position&&(c+=this.stockChart.stockLegendModule.legendBounds.height)),this.bounds=new i.Rect(this.themeStyle.thumbWidth/2+t.border.width+o.left+h,o.top+a+l+c,this.availableSize.width-this.themeStyle.thumbWidth-2*t.border.width-o.left-o.right,this.availableSize.height-o.top-o.bottom-a-(s?s.periodSelectorSize.height:0));var d=("Outside"===this.labelPosition||n?r+e:0)+("Outside"===this.tickPosition||n?this.majorTickLines.height:0);if(this.bounds.height-=d,n){var p=this.enableGrouping?this.bounds.height-(r+e):this.bounds.height;this.bounds.y+=this.themeStyle.thumbHeight>p?(this.themeStyle.thumbHeight-p)/2:0}this.disableRangeSelector&&(this.bounds.y=0,this.bounds.height=this.periodSelectorSettings.periods.length>0?this.periodSelectorSettings.height:0)},o.prototype.renderChart=function(){this.chartSeries.renderSeries(this),this.rangeAxis.renderGridLines(),this.rangeAxis.renderAxisLabels(),this.chartSeries.appendSeriesElements(this),this.createSecondaryElement(),this.setSliderValue(),this.renderPeriodSelector(),this.renderSlider(),this.stockChart||this.element.appendChild(this.svgObject),this.trigger("loaded",{rangeNavigator:this.isBlazor?{}:this}),this.rangeSlider.setSlider(this.startValue,this.endValue,!1,this.tooltip.enable&&"Always"===this.tooltip.displayMode)},o.prototype.renderPeriodSelector=function(){this.periodSelectorModule&&(this.periodSelectorModule.renderSelectorElement(this),this.periodSelectorModule.renderSelector())},o.prototype.createSecondaryElement=function(){if(this.tooltip.enable){var e=this.createElement("div");e.id=this.element.id+"_Secondary_Element",e.setAttribute("style","position: relative"),this.element.appendChild(e)}},o.prototype.renderSlider=function(){this.rangeSlider.render(this),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode)},o.prototype.removeSvg=function(){he(this.element.id+"_Secondary_Element")&&(t.remove(he(this.element.id+"_Secondary_Element")),this.isReact&&this.clearTemplate());if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);this.svgObject.hasChildNodes()||!this.svgObject.parentNode||this.stockChart||t.remove(this.svgObject)}},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.rangeOnMouseDown),t.EventHandler.remove(this.element,i,this.mouseMove),t.EventHandler.remove(this.element,r,this.mouseEnd),t.EventHandler.remove(this.element,"click",this.rangeOnMouseClick),t.EventHandler.remove(this.element,o,this.mouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.rangeOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),t.EventHandler.add(this.element,"click",this.rangeOnMouseClick,this),t.EventHandler.add(this.element,e,this.mouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize.bind(this));var i=this.element;i.style.touchAction="none",i.style.msTouchAction="none",i.style.msContentZooming="none",i.style.msUserSelect="none",i.style.webkitUserSelect="none",i.style.position="relative",i.style.display="block"},o.prototype.rangeResize=function(){var e=this;if(!document.getElementById(this.element.id))return!1;this.animateSeries=!1,this.removeAllTooltip(),this.resizeTo&&clearTimeout(this.resizeTo);var t={rangeNavigator:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)};return this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);e.createRangeSvg(),t.currentSize=e.availableSize,e.trigger("resized",t),e.calculateBounds(),e.chartSeries.processXAxis(e),e.chartSeries.calculateGroupingBounds(e),e.chartSeries.processYAxis(e),e.renderChart()},500),!1},o.prototype.removeAllTooltip=function(){this.tooltip.enable&&"Always"===this.tooltip.displayMode&&(he(this.element.id+"_leftTooltip")&&t.remove(he(this.element.id+"_leftTooltip")),he(this.element.id+"_rightTooltip")&&t.remove(he(this.element.id+"_rightTooltip")))},o.prototype.mouseMove=function(e){return he(this.stockChart?this.element.id:this.element.id+"_svg")&&(this.mouseX=this.setMouseX(e),this.notify(t.Browser.touchMoveEvent,e)),!1},o.prototype.mouseLeave=function(e){var i=this.rangeSlider;if(i.isDrag){var r=i.control.tooltip.enable;i.control.allowSnapping&&(i.isDrag=!1,i.setAllowSnapping(i.control,i.currentStart,i.currentEnd,!1,r)),i.triggerEvent(this.chartSeries.xAxis.actualRange)}var o=t.Browser.isPointer?"pointerleave":"mouseleave";return this.mouseX=this.setMouseX(e),this.notify(o,e),!1},o.prototype.rangeOnMouseClick=function(e){return this.notify("click",e),!1},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.export=function(e,t,i,r,o,n,a){r=r||[this],new xr(this).export(e,t,i,r,o,n,a)},o.prototype.renderChartBackground=function(){if(!this.stockChart){var e=new Di(this.element.id+"_ChartBorder",this.background||this.themeStyle.background,{width:0,color:"transparent"},1,new i.Rect(0,0,this.availableSize.width,this.availableSize.height));this.svgObject.appendChild(this.renderer.drawRectangle(e))}},o.prototype.rangeOnMouseDown=function(e){return this.mouseDownX=this.setMouseX(e),this.notify(t.Browser.touchStartEvent,e),!1},o.prototype.mouseEnd=function(e){return this.mouseX=this.setMouseX(e),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.setMouseX=function(e){var t=e.type.indexOf("touch")>-1?e.changedTouches[0].clientX:e.clientX,i=this.element.getBoundingClientRect(),r=this.stockChart?he(this.element.id).getBoundingClientRect():he(this.element.id+"_svg").getBoundingClientRect();return t-i.left-Math.max(r.left-i.left,0)},o.prototype.getPersistData=function(){var e=["loaded"];return this.addOnPersist(e)},o.prototype.onPropertyChanged=function(e,t){var i=!1,o=!1,n=!1;this.animateSeries=!1;for(var a=0,s=Object.keys(e);a<s.length;a++)switch(s[a]){case"width":case"height":case"navigatorBorder":case"enableGrouping":case"labelPosition":case"tickPosition":case"labelStyle":o=!0;break;case"enableRtl":case"xName":case"yName":case"query":case"minimum":case"maximum":case"interval":case"intervalType":case"logBase":case"valueType":case"majorGridLines":case"minorGridLines":case"navigatorStyleSettings":case"labelFormat":case"skeleton":case"skeletonType":case"secondaryLabelAlignment":case"background":i=!0;break;case"dataSource":case"series":i=!0,o=!0;break;case"theme":this.animateSeries=!0;break;case"locale":r.prototype.refresh.call(this);break;case"value":this.startValue=null,this.endValue=null,n=!0}!o&&i&&(this.removeSvg(),this.chartSeries.xMin=1/0,this.chartSeries.xMax=-1/0,this.chartSeries.renderChart(this)),o&&i&&(this.removeSvg(),this.chartSeries.xMin=this.chartSeries.yMin=1/0,this.chartSeries.xMax=this.chartSeries.yMax=-1/0,this.calculateBounds(),this.chartSeries.renderChart(this)),o&&!i&&(this.removeSvg(),this.calculateBounds(),this.chartSeries.renderChart(this)),o||i||!n||(this.setSliderValue(),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode))},o.prototype.requiredModules=function(){var e=this,t=[];return this.series.map(function(i){t.push({member:i.type+"Series",args:[e]})}),this.periodSelectorSettings.periods.length>0&&t.push({member:"PeriodSelector",args:[this]}),"Double"!==this.valueType&&t.push({member:this.valueType,args:[this]}),this.tooltip.enable&&t.push({member:"RangeTooltip",args:[this]}),t},o.prototype.getModuleName=function(){return"rangeNavigator"},o.prototype.destroy=function(){this.unWireEvents(),this.isReact&&this.clearTemplate(),this.rangeSlider.destroy(),r.prototype.destroy.call(this),this.element.innerHTML="",this.element.classList.remove("e-rangenavigator")},Ia([t.Property(null)],o.prototype,"width",void 0),Ia([t.Property(null)],o.prototype,"height",void 0),Ia([t.Property(null)],o.prototype,"dataSource",void 0),Ia([t.Property(null)],o.prototype,"xName",void 0),Ia([t.Property(null)],o.prototype,"yName",void 0),Ia([t.Property()],o.prototype,"query",void 0),Ia([t.Collection([],Ma)],o.prototype,"series",void 0),Ia([t.Complex({},Ta)],o.prototype,"tooltip",void 0),Ia([t.Property(null)],o.prototype,"minimum",void 0),Ia([t.Property(null)],o.prototype,"maximum",void 0),Ia([t.Property(null)],o.prototype,"interval",void 0),Ia([t.Property("Auto")],o.prototype,"intervalType",void 0),Ia([t.Property("Hide")],o.prototype,"labelIntersectAction",void 0),Ia([t.Property(10)],o.prototype,"logBase",void 0),Ia([t.Property("Double")],o.prototype,"valueType",void 0),Ia([t.Property("Outside")],o.prototype,"labelPosition",void 0),Ia([t.Property(500)],o.prototype,"animationDuration",void 0),Ia([t.Property(!1)],o.prototype,"enableGrouping",void 0),Ia([t.Property(!1)],o.prototype,"enableDeferredUpdate",void 0),Ia([t.Property(!1)],o.prototype,"disableRangeSelector",void 0),Ia([t.Property(!1)],o.prototype,"allowSnapping",void 0),Ia([t.Property(!1)],o.prototype,"allowIntervalData",void 0),Ia([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Ia([t.Property()],o.prototype,"groupBy",void 0),Ia([t.Property("Outside")],o.prototype,"tickPosition",void 0),Ia([t.Complex(e.RangeNavigatorTheme.axisLabelFont,Xt)],o.prototype,"labelStyle",void 0),Ia([t.Complex({},Ci)],o.prototype,"majorGridLines",void 0),Ia([t.Complex({},Ri)],o.prototype,"majorTickLines",void 0),Ia([t.Complex({},ka)],o.prototype,"navigatorStyleSettings",void 0),Ia([t.Complex({},ri)],o.prototype,"periodSelectorSettings",void 0),Ia([t.Complex({color:"#DDDDDD",width:1},Yt)],o.prototype,"navigatorBorder",void 0),Ia([t.Property("Material")],o.prototype,"theme",void 0),Ia([t.Property([])],o.prototype,"value",void 0),Ia([t.Property(null)],o.prototype,"background",void 0),Ia([t.Property("")],o.prototype,"labelFormat",void 0),Ia([t.Property("")],o.prototype,"skeleton",void 0),Ia([t.Property("DateTime")],o.prototype,"skeletonType",void 0),Ia([t.Property("Middle")],o.prototype,"secondaryLabelAlignment",void 0),Ia([t.Complex({top:5,bottom:5,right:5,left:5},Ut)],o.prototype,"margin",void 0),Ia([t.Event()],o.prototype,"load",void 0),Ia([t.Event()],o.prototype,"loaded",void 0),Ia([t.Event()],o.prototype,"resized",void 0),Ia([t.Event()],o.prototype,"labelRender",void 0),Ia([t.Event()],o.prototype,"changed",void 0),Ia([t.Event()],o.prototype,"tooltipRender",void 0),Ia([t.Event()],o.prototype,"selectorRender",void 0),Ia([t.Event()],o.prototype,"beforePrint",void 0),o=Ia([t.NotifyPropertyChanges],o)}(t.Component),Da=function(){function e(e){this.stockChart=e}return e.prototype.initializeChart=function(e){var i=this,r=this.stockChart;if(r.isProtectedOnChange=!0,r.chartObject){for(var o=document.getElementById(r.chartObject.id);o.firstChild;)o.removeChild(o.firstChild);he(r.chartObject+"_tooltip")&&t.remove(he(r.chartObject+"_tooltip"))}else r.chartObject=r.renderer.createGroup({id:r.element.id+"_stockChart_chart"}),r.mainObject.appendChild(r.chartObject);if(this.cartesianChartSize=this.calculateChartSize(),r.chart=new Rr({chartArea:r.chartArea,margin:this.findMargin(r),primaryXAxis:this.copyObject(r.primaryXAxis),primaryYAxis:this.copyObject(r.primaryYAxis),rows:r.rows,indicators:r.indicators,axes:r.axes,tooltipRender:function(e){i.stockChart.trigger("tooltipRender",e)},axisLabelRender:function(e){i.stockChart.trigger("axisLabelRender",e)},seriesRender:function(t){t.data&&i.stockChart.startValue&&i.stockChart.endValue&&(t.data=t.data.filter(function(e){return new Date(Date.parse(e[t.series.xName])).getTime()>=i.stockChart.startValue&&new Date(Date.parse(e[t.series.xName])).getTime()<=i.stockChart.endValue})),t.data=e||t.data,i.stockChart.trigger("seriesRender",t)},onZooming:function(e){i.stockChart.trigger(hi,e)},pointClick:function(e){i.stockChart.trigger("pointClick",e)},pointMove:function(e){i.stockChart.trigger("pointMove",e)},dataSource:r.dataSource,series:this.findSeriesCollection(r.series),zoomSettings:this.copyObject(r.zoomSettings),tooltip:r.tooltip,crosshair:r.crosshair,height:this.cartesianChartSize.height.toString(),selectedDataIndexes:r.selectedDataIndexes,selectionMode:r.selectionMode,isMultiSelect:r.isMultiSelect,annotations:r.annotations,theme:r.theme,legendSettings:{visible:!1},zoomComplete:function(e){if("DateTime"===e.axis.valueType&&r.rangeNavigator){i.stockChart.zoomChange=!0;var t=i.calculateUpdatedRange(e.currentZoomFactor,e.currentZoomPosition,e.axis);r.rangeSelector.sliderChange(t.start,t.end)}}}),0!==r.indicators.length){if(r.isSelect)for(var n=0;n<r.indicators.length;n++)r.chart.indicators[n].animation.enable=!1,r.chart.indicators[n].dataSource=t.extend([],r.chart.series[0].dataSource,null,!0);r.isSelect=!0}r.chart.stockChart=r,r.chart.appendTo(r.chartObject),r.isProtectedOnChange=!1},e.prototype.findMargin=function(e){var t={};return t.top=e.stockLegendModule&&e.legendSettings.visible&&"Top"===e.legendSettings.position?e.margin.top:2*e.margin.top,t.left=e.margin.left,t.right=e.margin.right,t.bottom=e.margin.bottom,t},e.prototype.findSeriesCollection=function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]),t[i].high=e[i].high,t[i].low=e[i].low,t[i].open=e[i].open,t[i].close=e[i].close,t[i].xName=e[i].xName,t[i].volume=e[i].volume,t[i].animation=e[i].animation,e[i].localData&&(t[i].dataSource=e[i].localData),t[i].yName=""===e[i].yName?e[i].close:e[i].yName;return t},e.prototype.calculateChartSize=function(){var e=this.stockChart;return new i.Size(e.availableSize.width,e.enablePeriodSelector&&e.enableSelector?e.availableSize.height-e.toolbarHeight-80:e.enableSelector&&!e.enablePeriodSelector?e.availableSize.height-80:e.enablePeriodSelector&&!e.enableSelector?e.availableSize.height-e.toolbarHeight:e.availableSize.height)},e.prototype.calculateUpdatedRange=function(e,t,i){var r,o,n=i.actualRange;return o=(r=n.min+t*n.delta)+e*n.delta,{start:r,end:o}},e.prototype.cartesianChartRefresh=function(e,t){e.cartesianChart.initializeChart(t)},e.prototype.copyObject=function(e){return t.extend({},e,{},!0)},e}(),Ba=function(){function e(e){this.stockChart=e}return e.prototype.initializeRangeNavigator=function(){var e=this,i=this.stockChart;if(i.selectorObject){for(var r=document.getElementById(i.selectorObject.id);r.firstChild;)r.removeChild(r.firstChild);he(i.selectorObject.id+"_leftTooltip")&&t.remove(he(i.selectorObject.id+"_leftTooltip")),he(i.selectorObject.id+"_rightTooltip")&&t.remove(he(i.selectorObject.id+"_rightTooltip"))}else i.selectorObject=i.renderer.createGroup({id:i.element.id+"_stockChart_rangeSelector",transform:"translate(0,"+i.cartesianChart.cartesianChartSize.height+")"}),i.mainObject.appendChild(i.selectorObject);i.rangeNavigator=new za({locale:"en",valueType:i.primaryXAxis.valueType,theme:this.stockChart.theme,series:this.findSeriesCollection(i.series),height:this.calculateChartSize().height.toString(),value:[new Date(i.startValue),new Date(i.endValue)],margin:this.findMargin(),tooltip:{enable:i.tooltip.enable,displayMode:"Always"},dataSource:i.dataSource,changed:function(t){var r={name:"rangeChange",end:t.end,selectedData:t.selectedData,start:t.start,zoomFactor:t.zoomFactor,zoomPosition:t.zoomPosition,data:void 0};e.stockChart.trigger("rangeChange",r),e.stockChart.startValue=t.start,e.stockChart.endValue=t.end,e.stockChart.zoomChange||e.stockChart.cartesianChart.cartesianChartRefresh(e.stockChart,r.data),i.periodSelector&&i.periodSelector.datePicker&&(i.periodSelector.datePicker.startDate=new Date(t.start),i.periodSelector.datePicker.endDate=new Date(t.end),i.periodSelector.datePicker.dataBind())}}),i.rangeNavigator.stockChart=i,i.rangeNavigator.appendTo(i.selectorObject)},e.prototype.findMargin=function(){var e={};return e.top=5,e.left=0,e.right=0,e.bottom=0,e},e.prototype.findSeriesCollection=function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]),t[i].xName=e[i].xName,t[i].yName=""===e[i].yName?e[i].close:e[i].yName;return t},e.prototype.calculateChartSize=function(){var e=this.stockChart;return new i.Size(e.availableSize.width,e.enableSelector?80:0)},e.prototype.sliderChange=function(e,t){this.stockChart.rangeNavigator.rangeSlider.performAnimation(e,t,this.stockChart.rangeNavigator,0)},e}(),Fa=function(){function e(e){this.selectedSeries="",this.selectedIndicator="",this.selectedTrendLine="",this.indicators=[],this.secondayIndicators=[],this.stockChart=e,this.selectedSeries=this.stockChart.series[0].type}return e.prototype.initializePeriodSelector=function(){var e=this.stockChart.tempPeriods;this.stockChart.periods=e,this.stockChart.periodSelector.rootControl=this.stockChart;var t=this.stockChart.chart.chartAxisLayoutPanel.seriesClipRect,i=he(this.stockChart.element.id+"_Secondary_Element"),r=this.stockChart.toolbarHeight;this.stockChart.periodSelector.appendSelector({thumbSize:0,element:i,width:t.width,height:r},t.x),this.initializeSeriesSelector(),this.initializeIndicatorSelector(),this.initializeTrendlineSelector(),this.exportButton(),this.printButton(),this.resetButton()},e.prototype.getDropDownItems=function(e){var t=[];if(e===this.stockChart.seriesType){for(o=0;o<e.length;o++)t.push({text:" "+e[o].toString()});for(o=0;o<this.stockChart.series.length;o++)for(var i=0;i<t.length;i++){var r=t[i].text.replace(" ","");(r="OHLC"===r?"HiloOpenClose":r)===this.stockChart.series[o].type&&(t[i].text=t[i].text.replace(" ","✔ "))}}else if(e===this.stockChart.exportType)for(o=0;o<e.length;o++)t.push({text:e[o].toString()});else for(var o=0;o<e.length;o++)"Print"!==e[o].toString()&&t.push({text:" "+e[o].toString()});return t},e.prototype.addedSeries=function(e){for(var t=this.stockChart.series,i=0;i<t.length;i++)if("volume"!==t[i].yName){t[i].type=e.indexOf("Candle")>-1?"Candle":e.indexOf("OHLC")>-1?"HiloOpenClose":e,t[i].enableSolidCandles="Candle"===e;for(var r=0;r<t[i].trendlines.length;r++){var o=t[i].trendlines[r];o.animation.enable=!1,o.enableTooltip=!1}}},e.prototype.initializeSeriesSelector=function(){var e=this;new s.DropDownButton({items:this.getDropDownItems(this.stockChart.seriesType),select:function(t){e.selectedSeries=t.item.text;var i=e.tickMark(t);if(e.addedSeries(i),e.stockChart.cartesianChart.initializeChart(),e.stockChart.stockLegendModule&&e.stockChart.stockLegendModule.legendCollections.length&&e.stockChart.legendSettings.visible){var r=e.stockChart.stockLegendModule.legendBounds;e.stockChart.stockLegendModule.renderLegend(e.stockChart,e.stockChart.legendSettings,r)}}}).appendTo("#"+this.stockChart.element.id+"_seriesType")},e.prototype.resetButton=function(){var e=this;this.stockChart.isProtectedOnChange=!0,(new l.Button).appendTo("#"+this.stockChart.element.id+"_reset"),document.getElementById(this.stockChart.element.id+"_reset").onclick=function(){for(var t=e.indicators.length;t;)e.stockChart.indicators.pop(),t--;e.indicators=[],e.secondayIndicators=[],e.stockChart.isSingleAxis?e.stockChart.rows=[{}]:(e.stockChart.rows.length>2&&e.stockChart.rows.splice(2,e.stockChart.rows.length-1),e.stockChart.axes.length>2&&(e.stockChart.axes.splice(1,e.stockChart.axes.length-1),e.stockChart.axes[0].rowIndex=1));for(var i=0;i<e.stockChart.series.length;i++)"volume"!==e.stockChart.series[i].yName&&(e.stockChart.series[i].type=e.stockChart.tempSeriesType[i],0!==e.stockChart.series[i].trendlines.length&&(e.stockChart.series[i].trendlines[0].width=0));e.stockChart.indicatorElements=null,e.stockChart.resizeTo=null,e.stockChart.zoomChange=!1,e.stockChart.refresh(),e.stockChart.isProtectedOnChange=!0}},e.prototype.initializeTrendlineSelector=function(){var e=this;this.trendlineDropDown=new s.DropDownButton({items:this.stockChart.resizeTo?this.trendlineDropDown.items:this.getDropDownItems(this.stockChart.trendlineType),select:function(t){var i=e.tickMark(t),r=i=(i=i.split(" ")[0].toLocaleLowerCase()+(i.split(" ")[1]?i.split(" ")[1]:"")).substr(0,1).toUpperCase()+i.substr(1);if(e.selectedTrendLine=""===e.selectedTrendLine?r:e.selectedTrendLine+","+r,e.trendline!==r){e.trendline=r;for(var o=0;o<e.stockChart.series.length;o++)if("volume"!==e.stockChart.series[o].yName)if(0===e.stockChart.series[0].trendlines.length){var n=void 0;e.stockChart.trendlinetriggered&&(n=[{type:r,width:1,enableTooltip:!1}],e.stockChart.trendlinetriggered=!1),e.stockChart.series[0].trendlines=n}else e.stockChart.series[0].trendlines[0].width=1,e.stockChart.series[0].trendlines[0].type=r,e.stockChart.series[0].trendlines[0].animation.enable=!!e.stockChart.trendlinetriggered;e.stockChart.cartesianChart.initializeChart()}else t.item.text=" "+t.item.text.replace("✔ ",""),e.stockChart.series[0].trendlines[0].width=0,e.trendline=null,e.stockChart.cartesianChart.initializeChart()}}),this.trendlineDropDown.appendTo("#"+this.stockChart.element.id+"_trendType")},e.prototype.initializeIndicatorSelector=function(){var e=this;this.indicatorDropDown=new s.DropDownButton({items:this.stockChart.resizeTo?this.indicatorDropDown.items:this.getDropDownItems(this.stockChart.indicatorType),select:function(t){for(var i=0;i<e.stockChart.series.length;i++)0!==e.stockChart.series[i].trendlines.length&&(e.stockChart.series[i].trendlines[0].animation.enable=!1);t.item.text=t.item.text.indexOf("✔ ")>=0?t.item.text.substr(t.item.text.indexOf(";")+1):t.item.text;var r=t.item.text.replace(" ",""),o=r=(r=r.split(" ")[0].toLocaleLowerCase()+(r.split(" ")[1]?r.split(" ")[1]:"")).substr(0,1).toUpperCase()+r.substr(1);if(e.selectedIndicator=-1===e.selectedIndicator.indexOf(o)?e.selectedIndicator+" "+o:e.selectedIndicator.replace(o,""),"Tma"===o||"BollingerBands"===o||"Sma"===o||"Ema"===o)if(-1===e.indicators.indexOf(o)){t.item.text="✔ "+t.item.text.replace(" ","");var n=e.getIndicator(o,e.stockChart.series[0].yAxisName);e.indicators.push(o),e.stockChart.indicators=e.stockChart.indicators.concat(n),e.stockChart.cartesianChart.initializeChart()}else{t.item.text=" "+t.item.text;for(var a=0;a<e.stockChart.indicators.length;a++)e.stockChart.indicators[a].type===o&&e.stockChart.indicators.splice(a,1);e.indicators.splice(e.indicators.indexOf(o),1),e.stockChart.cartesianChart.initializeChart()}else e.createIndicatorAxes(o,t)}}),this.indicatorDropDown.appendTo("#"+this.stockChart.element.id+"_indicatorType")},e.prototype.getIndicator=function(e,t){var i=this.stockChart.series[0];return[{type:e,period:3,yAxisName:t,dataSource:i.localData,xName:i.xName,open:i.open,close:i.close,high:i.high,low:i.low,volume:i.volume,fill:"Sma"===e?"#32CD32":"#6063ff",animation:{enable:!1},upperLine:{color:"#FFE200",width:1},periodLine:{width:2},lowerLine:{color:"#FAA512",width:1},fastPeriod:8,slowPeriod:5,macdType:"Both",width:1,macdPositiveColor:"#6EC992",macdNegativeColor:"#FF817F",bandColor:"rgba(245, 203, 35, 0.12)"}]},e.prototype.createIndicatorAxes=function(e,t){if(-1===this.indicators.indexOf(e)){t.item.text="✔ "+t.item.text.replace(" ",""),this.indicators.push(e);var i=this.stockChart.rows.length;this.stockChart.rows[this.stockChart.rows.length-1].height="15%";var r=[{height:100-15*i+"px"}];if(1===this.stockChart.rows.length&&(this.stockChart.isSingleAxis=!0),this.stockChart.rows=this.stockChart.rows.concat(r),this.stockChart.isSingleAxis)for(a=0;a<this.stockChart.axes.length;a++)this.stockChart.axes[a].rowIndex+=1;else this.stockChart.axes[0].rowIndex+=1;var o=[{plotOffset:10,opposedPosition:!0,rowIndex:this.stockChart.isSingleAxis?0:this.stockChart.axes.length,desiredIntervals:1,labelFormat:"n2",majorGridLines:this.stockChart.primaryYAxis.majorGridLines,lineStyle:this.stockChart.primaryYAxis.lineStyle,labelPosition:this.stockChart.primaryYAxis.labelPosition,majorTickLines:this.stockChart.primaryYAxis.majorTickLines,rangePadding:"None",name:e.toString()}];this.stockChart.axes=this.stockChart.axes.concat(o),this.stockChart.primaryYAxis.rowIndex=this.stockChart.isSingleAxis?i+1:0;var n=this.getIndicator(e,e.toString());this.stockChart.indicators=this.stockChart.indicators.concat(n),this.stockChart.cartesianChart.initializeChart()}else{t.item.text=" "+t.item.text;for(var a=0;a<this.stockChart.indicators.length;a++)this.stockChart.indicators[a].type===e&&this.stockChart.indicators.splice(a,1);this.indicators.splice(this.indicators.indexOf(e),1);for(var s=0,l=0;l<this.stockChart.axes.length;l++)this.stockChart.axes[l].name===e&&(s=this.stockChart.axes[l].rowIndex,this.stockChart.rows.splice(l,1),this.stockChart.axes.splice(l,1));for(l=0;l<this.stockChart.axes.length;l++)0!==this.stockChart.axes[l].rowIndex&&this.stockChart.axes[l].rowIndex>s&&(this.stockChart.axes[l].rowIndex=this.stockChart.axes[l].rowIndex-1);this.stockChart.cartesianChart.initializeChart()}},e.prototype.tickMark=function(e){for(var t,i=e.item.parentObj.items,r=0;r<i.length;r++)i[r].text=i[r].text.indexOf("✔ ")>=0?i[r].text.substr(i[r].text.indexOf(";")+1):i[r].text,i[r].text.indexOf(" ")>=0||(i[r].text=" "+i[r].text);return e.item.text.indexOf(" ")>=0?(t=e.item.text.replace(" ",""),e.item.text=e.item.text.replace(" ","✔ ")):t=e.item.text.replace("✔ ",""),t},e.prototype.printButton=function(){var e=this;this.stockChart.exportType.indexOf("Print")>-1&&((new l.Button).appendTo("#"+this.stockChart.element.id+"_print"),document.getElementById(this.stockChart.element.id+"_print").onclick=function(){e.stockChart.chart.print(e.stockChart.element.id)})},e.prototype.exportButton=function(){var e=this;new s.DropDownButton({items:this.getDropDownItems(this.stockChart.exportType),select:function(i){var r,o=i.item.text,n=e.stockChart,a=n.element.id+"_stockChart_",s=n.svgObject.getBoundingClientRect();n.chart.exportModule&&(e.stockChart.svgObject.insertAdjacentElement("afterbegin",e.addExportSettings()),r=n.svgObject.firstElementChild.getBoundingClientRect(),e.stockChart.svgObject.setAttribute("height",(s.height+r.height).toString()),he(a+"chart").style.transform="translateY("+r.height+"px)",n.enableSelector&&he(a+"rangeSelector").setAttribute("transform","translate(0,"+(n.cartesianChart.cartesianChartSize.height+r.height)+")"),n.chart.exportModule.export(o,"StockChart",null,[n],null,n.svgObject.clientHeight),t.remove(he(e.stockChart.element.id+"_additionalExport")),he(a+"chart").style.transform="translateY(0px)",n.enableSelector&&he(a+"rangeSelector").setAttribute("transform","translate(0,"+n.cartesianChart.cartesianChartSize.height+")"),e.stockChart.svgObject.setAttribute("height",s.height.toString()))}}).appendTo("#"+this.stockChart.element.id+"_export")},e.prototype.calculateAutoPeriods=function(){var e=[];return(e=this.findRange(this.stockChart.seriesXMin,this.stockChart.seriesXMax)).push({text:"YTD",selected:!0},{text:"All"}),e},e.prototype.findRange=function(e,t){var i=[];return(t-e)/3154e7>=1?i.push({text:"1M",interval:1,intervalType:"Months"},{text:"3M",interval:3,intervalType:"Months"},{text:"6M",interval:6,intervalType:"Months"},{text:"1Y",interval:1,intervalType:"Years"}):(t-e)/1577e7>=1?i.push({text:"1M",interval:1,intervalType:"Months"},{text:"3M",interval:3,intervalType:"Months"},{text:"6M",interval:6,intervalType:"Months"}):(t-e)/2628e6>=1?i.push({text:"1D",interval:1,intervalType:"Days"},{text:"3W",interval:3,intervalType:"Weeks"},{text:"1M",interval:1,intervalType:"Months"}):(t-e)/864e5>=1&&i.push({text:"1H",interval:1,intervalType:"Hours"},{text:"12H",interval:12,intervalType:"Hours"},{text:"1D",interval:1,intervalType:"Days"}),i},e.prototype.addExportSettings=function(){var e=this.stockChart.renderer.createGroup({id:this.stockChart.element.id+"_additionalExport",width:this.stockChart.availableSize.width}),t=i.measureText(this.stockChart.title,this.stockChart.titleStyle).height,r=new i.TextOption(e.id+"_Title",Ye(new i.Rect(0,0,this.stockChart.availableSize.width,0),this.stockChart.titleStyle),0,"middle",this.stockChart.title,"","text-before-edge");Ve(this.stockChart.renderer,r,this.stockChart.titleStyle,this.stockChart.titleStyle.color,e);var o={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},n=i.measureText("Series: "+this.selectedSeries,o).width/2,a=t;return this.textElementSpan(new i.TextOption(e.id+"_Series",n,a,"start",["Series : ",this.selectedSeries],"","text-before-edge"),o,"black",e),n+=i.measureText("Series: "+this.selectedSeries+" Z",o).width,""!==this.selectedIndicator&&(this.textElementSpan(new i.TextOption(e.id+"_Indicator",n,a,"start",["Indicator :",this.selectedIndicator],"","text-before-edge"),o,"black",e),n+=i.measureText("Indicator: "+this.selectedIndicator+" Z",o).width),""!==this.selectedTrendLine&&this.textElementSpan(new i.TextOption(e.id+"_TrendLine",n,a,"start",["Trendline :",this.selectedTrendLine],"","text-before-edge"),o,"black",e),e},e.prototype.textElementSpan=function(e,t,r,o,n,a,s,l,h){void 0===n&&(n=!1),void 0===l&&(l=!1);var c,d=new i.SvgRenderer(""),p={};p={id:e.id,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,x:e.x,y:e.y,fill:r,"font-size":t.size,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine};var u="string"==typeof e.text?e.text:n?e.text[e.text.length-1]:e.text[0],g=d.createText(p,u);if("string"!=typeof e.text&&e.text.length>1)for(var y=1,m=e.text.length;y<m;y++)e.text[y]=" "+e.text[y],c=d.createTSpan({x:e.x+i.measureText(u,t).width+5,id:e.id,y:e.y,opacity:.5},e.text[y]),g.appendChild(c);return be(!1,o,g,a,s,"x","y",null,null,l,!1,null,h),g},e}(),Na=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Va=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ja=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("")],i.prototype,"color",void 0),Va([t.Property("16px")],i.prototype,"size",void 0),Va([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),Va([t.Property("Normal")],i.prototype,"fontStyle",void 0),Va([t.Property("Normal")],i.prototype,"fontWeight",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),Va([t.Property("Trim")],i.prototype,"textOverflow",void 0),Va([t.Property("Center")],i.prototype,"textAlignment",void 0),i}(t.ChildProperty),Ha=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("")],i.prototype,"color",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Xa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Complex({},Ha)],i.prototype,"border",void 0),Va([t.Property("transparent")],i.prototype,"background",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Ya=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(10)],i.prototype,"left",void 0),Va([t.Property(10)],i.prototype,"right",void 0),Va([t.Property(10)],i.prototype,"top",void 0),Va([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Ga=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Property(!1)],r.prototype,"startFromAxis",void 0),Va([t.Property(!0)],r.prototype,"visible",void 0),Va([t.Property(null)],r.prototype,"start",void 0),Va([t.Property("#808080")],r.prototype,"color",void 0),Va([t.Property(null)],r.prototype,"end",void 0),Va([t.Property(null)],r.prototype,"size",void 0),Va([t.Property("Auto")],r.prototype,"sizeType",void 0),Va([t.Property(null)],r.prototype,"dashArray",void 0),Va([t.Property(!1)],r.prototype,"isRepeat",void 0),Va([t.Property(null)],r.prototype,"repeatEvery",void 0),Va([t.Property(!1)],r.prototype,"isSegmented",void 0),Va([t.Property(null)],r.prototype,"repeatUntil",void 0),Va([t.Property(null)],r.prototype,"segmentStart",void 0),Va([t.Property(null)],r.prototype,"segmentAxisName",void 0),Va([t.Property(null)],r.prototype,"segmentEnd",void 0),Va([t.Property(1)],r.prototype,"opacity",void 0),Va([t.Property("")],r.prototype,"text",void 0),Va([t.Complex({color:"transparent",width:1},Ha)],r.prototype,"border",void 0),Va([t.Property(null)],r.prototype,"rotation",void 0),Va([t.Property("Behind")],r.prototype,"zIndex",void 0),Va([t.Property("Middle")],r.prototype,"horizontalAlignment",void 0),Va([t.Property("Middle")],r.prototype,"verticalAlignment",void 0),Va([t.Complex(e.Theme.stripLineLabelFont,ja)],r.prototype,"textStyle",void 0),r}(t.ChildProperty),Wa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(0)],i.prototype,"delay",void 0),Va([t.Property(!1)],i.prototype,"enable",void 0),Va([t.Property(1e3)],i.prototype,"duration",void 0),i}(t.ChildProperty),Ua=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("Gap")],i.prototype,"mode",void 0),Va([t.Complex({color:"transparent",width:0},Ha)],i.prototype,"border",void 0),i}(t.ChildProperty),Za=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("Line")],i.prototype,"type",void 0),Va([t.Property(null)],i.prototype,"length",void 0),Va([t.Property(null)],i.prototype,"color",void 0),Va([t.Property("")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),qa=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.localData=void 0,t}return Na(i,e),Va([t.Property("date")],i.prototype,"xName",void 0),Va([t.Property("close")],i.prototype,"yName",void 0),Va([t.Property("open")],i.prototype,"open",void 0),Va([t.Property("close")],i.prototype,"close",void 0),Va([t.Property("high")],i.prototype,"high",void 0),Va([t.Property("low")],i.prototype,"low",void 0),Va([t.Property("volume")],i.prototype,"volume",void 0),Va([t.Property("")],i.prototype,"pointColorMapping",void 0),Va([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Va([t.Property("")],i.prototype,"legendImageUrl",void 0),Va([t.Complex(null,Wa)],i.prototype,"animation",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("0")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),Va([t.Property("")],i.prototype,"name",void 0),Va([t.Property("")],i.prototype,"dataSource",void 0),Va([t.Property()],i.prototype,"query",void 0),Va([t.Property("#e74c3d")],i.prototype,"bullFillColor",void 0),Va([t.Property("#2ecd71")],i.prototype,"bearFillColor",void 0),Va([t.Property(!1)],i.prototype,"enableSolidCandles",void 0),Va([t.Property(!0)],i.prototype,"visible",void 0),Va([t.Complex({color:"transparent",width:0},Ha)],i.prototype,"border",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),Va([t.Property("Candle")],i.prototype,"type",void 0),Va([t.Complex(null,Ji)],i.prototype,"marker",void 0),Va([t.Collection([],er)],i.prototype,"trendlines",void 0),Va([t.Property(!0)],i.prototype,"enableTooltip",void 0),Va([t.Property("")],i.prototype,"tooltipMappingName",void 0),Va([t.Property(null)],i.prototype,"selectionStyle",void 0),Va([t.Property(.5)],i.prototype,"cardinalSplineTension",void 0),Va([t.Complex(null,$t)],i.prototype,"cornerRadius",void 0),Va([t.Complex(null,Ua)],i.prototype,"emptyPointSettings",void 0),Va([t.Property(null)],i.prototype,"columnWidth",void 0),Va([t.Property(0)],i.prototype,"columnSpacing",void 0),i}(t.ChildProperty),Qa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("Sma")],i.prototype,"type",void 0),Va([t.Property(14)],i.prototype,"period",void 0),Va([t.Property(3)],i.prototype,"dPeriod",void 0),Va([t.Property(14)],i.prototype,"kPeriod",void 0),Va([t.Property(80)],i.prototype,"overBought",void 0),Va([t.Property(20)],i.prototype,"overSold",void 0),Va([t.Property("Close")],i.prototype,"field",void 0),Va([t.Property(2)],i.prototype,"standardDeviation",void 0),Va([t.Property(12)],i.prototype,"slowPeriod",void 0),Va([t.Property(!0)],i.prototype,"showZones",void 0),Va([t.Property(26)],i.prototype,"fastPeriod",void 0),Va([t.Complex({color:"#ff9933",width:2},Za)],i.prototype,"macdLine",void 0),Va([t.Property("Both")],i.prototype,"macdType",void 0),Va([t.Property("#e74c3d")],i.prototype,"macdNegativeColor",void 0),Va([t.Property("#2ecd71")],i.prototype,"macdPositiveColor",void 0),Va([t.Property("rgba(211,211,211,0.25)")],i.prototype,"bandColor",void 0),Va([t.Complex({color:"#ffb735",width:1},Za)],i.prototype,"upperLine",void 0),Va([t.Property("")],i.prototype,"seriesName",void 0),Va([t.Complex({color:"#f2ec2f",width:1},Za)],i.prototype,"periodLine",void 0),Va([t.Complex({color:"#f2ec2f",width:1},Za)],i.prototype,"lowerLine",void 0),Va([t.Property("")],i.prototype,"high",void 0),Va([t.Property("")],i.prototype,"open",void 0),Va([t.Property("")],i.prototype,"low",void 0),Va([t.Property("")],i.prototype,"xName",void 0),Va([t.Property("")],i.prototype,"close",void 0),Va([t.Property("")],i.prototype,"pointColorMapping",void 0),Va([t.Property("")],i.prototype,"volume",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Complex(null,Wa)],i.prototype,"animation",void 0),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("0")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),Va([t.Property()],i.prototype,"query",void 0),Va([t.Property("")],i.prototype,"dataSource",void 0),i}(t.ChildProperty),$a=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Complex({},Ai)],r.prototype,"crosshairTooltip",void 0),Va([t.Complex(e.Theme.axisLabelFont,ja)],r.prototype,"labelStyle",void 0),Va([t.Property("")],r.prototype,"title",void 0),Va([t.Complex(e.Theme.axisTitleFont,ja)],r.prototype,"titleStyle",void 0),Va([t.Property("")],r.prototype,"labelFormat",void 0),Va([t.Property("DateTime")],r.prototype,"skeletonType",void 0),Va([t.Property("")],r.prototype,"skeleton",void 0),Va([t.Property(0)],r.prototype,"plotOffset",void 0),Va([t.Property(10)],r.prototype,"logBase",void 0),Va([t.Property(0)],r.prototype,"rowIndex",void 0),Va([t.Property(1)],r.prototype,"span",void 0),Va([t.Property(3)],r.prototype,"maximumLabels",void 0),Va([t.Property(null)],r.prototype,"desiredIntervals",void 0),Va([t.Property(1)],r.prototype,"zoomFactor",void 0),Va([t.Property(0)],r.prototype,"zoomPosition",void 0),Va([t.Property(!1)],r.prototype,"opposedPosition",void 0),Va([t.Property(!0)],r.prototype,"enableAutoIntervalOnZooming",void 0),Va([t.Property("Double")],r.prototype,"valueType",void 0),Va([t.Property("Auto")],r.prototype,"rangePadding",void 0),Va([t.Property("None")],r.prototype,"edgeLabelPlacement",void 0),Va([t.Property("BetweenTicks")],r.prototype,"labelPlacement",void 0),Va([t.Property("Auto")],r.prototype,"intervalType",void 0),Va([t.Property("Outside")],r.prototype,"tickPosition",void 0),Va([t.Property("")],r.prototype,"name",void 0),Va([t.Property("Outside")],r.prototype,"labelPosition",void 0),Va([t.Property(!0)],r.prototype,"visible",void 0),Va([t.Property(0)],r.prototype,"labelRotation",void 0),Va([t.Property(0)],r.prototype,"minorTicksPerInterval",void 0),Va([t.Property(null)],r.prototype,"crossesAt",void 0),Va([t.Property(null)],r.prototype,"crossesInAxis",void 0),Va([t.Property(!0)],r.prototype,"placeNextToAxisLine",void 0),Va([t.Property(null)],r.prototype,"minimum",void 0),Va([t.Property(null)],r.prototype,"interval",void 0),Va([t.Property(null)],r.prototype,"maximum",void 0),Va([t.Property(34)],r.prototype,"maximumLabelWidth",void 0),Va([t.Complex({},Ri)],r.prototype,"majorTickLines",void 0),Va([t.Property(!1)],r.prototype,"enableTrim",void 0),Va([t.Complex({},Mi)],r.prototype,"minorTickLines",void 0),Va([t.Complex({},Pi)],r.prototype,"minorGridLines",void 0),Va([t.Complex({},Ci)],r.prototype,"majorGridLines",void 0),Va([t.Complex({},Li)],r.prototype,"lineStyle",void 0),Va([t.Property(!1)],r.prototype,"isInversed",void 0),Va([t.Property("Trim")],r.prototype,"labelIntersectAction",void 0),Va([t.Property(100)],r.prototype,"coefficient",void 0),Va([t.Property(0)],r.prototype,"startAngle",void 0),Va([t.Property(2)],r.prototype,"tabIndex",void 0),Va([t.Collection([],Ga)],r.prototype,"stripLines",void 0),Va([t.Property(null)],r.prototype,"description",void 0),r}(t.ChildProperty),Ja=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("100%")],i.prototype,"height",void 0),Va([t.Complex({},Ha)],i.prototype,"border",void 0),i}(t.ChildProperty),Ka=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(2)],i.prototype,"period",void 0),Va([t.Property("")],i.prototype,"name",void 0),Va([t.Property("Linear")],i.prototype,"type",void 0),Va([t.Property(2)],i.prototype,"polynomialOrder",void 0),Va([t.Property(0)],i.prototype,"forwardForecast",void 0),Va([t.Property(0)],i.prototype,"backwardForecast",void 0),Va([t.Complex({},Wa)],i.prototype,"animation",void 0),Va([t.Property(!0)],i.prototype,"enableTooltip",void 0),Va([t.Complex({},Ji)],i.prototype,"marker",void 0),Va([t.Property(null)],i.prototype,"intercept",void 0),Va([t.Property("")],i.prototype,"fill",void 0),Va([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),es=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("0")],i.prototype,"y",void 0),Va([t.Property("0")],i.prototype,"x",void 0),Va([t.Property(null)],i.prototype,"content",void 0),Va([t.Property("Chart")],i.prototype,"region",void 0),Va([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),Va([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),Va([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Property(null)],i.prototype,"description",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),i}(t.ChildProperty),ts=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(0)],i.prototype,"point",void 0),Va([t.Property(0)],i.prototype,"series",void 0),i}(t.ChildProperty),is=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Property("Circle")],r.prototype,"type",void 0),Va([t.Property("")],r.prototype,"text",void 0),Va([t.Property("")],r.prototype,"description",void 0),Va([t.Property()],r.prototype,"date",void 0),Va([t.Complex({color:"black",width:1},Ha)],r.prototype,"border",void 0),Va([t.Property("transparent")],r.prototype,"background",void 0),Va([t.Property(!0)],r.prototype,"showOnSeries",void 0),Va([t.Property("close")],r.prototype,"placeAt",void 0),Va([t.Complex(e.Theme.stockEventFont,ja)],r.prototype,"textStyle",void 0),Va([t.Property([])],r.prototype,"seriesIndexes",void 0),r}(t.ChildProperty),rs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),os=function(e){function o(t){var i=e.call(this,t.chart)||this;return i.symbolLocations=[],i.stockChart=t,i.chartId=i.stockChart.element.id,i}return rs(o,e),o.prototype.renderStockEvents=function(){var e,t,r,o=this.stockChart,n=o.renderer.createGroup({id:this.chartId+"_StockEvents"});this.symbolLocations=st(o.series.length,o.stockEvents.length,new Vi(0,0));for(var a=0;a<o.stockEvents.length;a++){e=this.stockChart.stockEvents[a];for(var s=0,l=o.chart.series;s<l.length;s++){var h=l[s],c={name:"stockEventRender",stockChart:o,text:e.text,type:e.type,cancel:!1,series:h};if(o.trigger("stockEventRender",c),e.text=c.text,e.type=c.type,r=i.measureText(e.text+"W",e.textStyle),!c.cancel&&(t=o.renderer.createGroup({id:this.chartId+"_Series_"+h.index+"_StockEvents_"+a}),x(this.stockChart.isBlazor?Date.parse(e.date.toString()):this.dateParse(e.date).getTime(),h.xAxis.visibleRange)))if(e.seriesIndexes.length>0)for(var d=0;d<e.seriesIndexes.length;d++)e.seriesIndexes[d]===h.index&&n.appendChild(this.creatEventGroup(t,h,e,a,r));else n.appendChild(this.creatEventGroup(t,h,e,a,r))}}return n},o.prototype.creatEventGroup=function(e,t,i,r,o){var n=this.findClosePoint(t,i);return i.showOnSeries||(n.y=t.yAxis.rect.y+t.yAxis.rect.height),this.symbolLocations[t.index][r]=n,this.createStockElements(e,i,t,r,n,o),e},o.prototype.findClosePoint=function(e,t){for(var i,r,o,n=this.stockChart.isBlazor?Date.parse(t.date.toString()):this.dateParse(t.date).getTime(),a=this.getClosest(e,n),s=0;s<e.points.length;s++)a===(r=e.points[s]).xValue&&r.visible?i=new Yi(r,e):0!==s&&s!==e.points.length&&a>e.points[s-1].xValue&&a<e.points[s+1].xValue&&(i=new Yi(r,e));var l=e.xAxis.rect.x+I(i.point.xValue,e.xAxis)*e.xAxis.rect.width;return o=I(i.point[t.placeAt],e.yAxis)*e.yAxis.rect.height,o=-1*o+(e.yAxis.rect.y+e.yAxis.rect.height),new Vi(l,o)},o.prototype.createStockElements=function(e,t,r,o,n,a){var s,l,h=new i.Size(a.width>20?a.width:20,a.height>20?a.height:20),c=n.x,d=n.y,p=this.chartId+"_Series_"+r.index+"_StockEvents_"+o,u=t.border;switch(t.type){case"Flag":case"Circle":case"Square":e.appendChild(ne(new Vi(c,d),"Circle",new i.Size(2,2),"",new i.PathOption(p+"_Circle","transparent",u.width,u.color),this.dateParse(t.date).toISOString())),e.appendChild(ne(new Vi(c,d-5),"VerticalLine",new i.Size(9,9),"",new i.PathOption(p+"_Path",u.color,u.width,u.color),this.dateParse(t.date).toISOString())),e.appendChild(ne(new Vi("Flag"!==t.type?c:c+h.width/2,d-h.height),t.type,h,"",new i.PathOption(p+"_Shape",t.background,u.width,u.color),this.dateParse(t.date).toISOString())),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text","Flag"!==t.type?n.x:n.x+h.width/2,n.y-h.height,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"ArrowUp":case"ArrowDown":case"ArrowRight":case"ArrowLeft":s="M "+c+" "+d+" "+this.findArrowpaths(t.type),l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l));break;case"Triangle":case"InvertedTriangle":h.height=3*a.height,h.width=a.width+1.5*a.width,e.appendChild(ne(new Vi(n.x,n.y),t.type,new i.Size(20,20),"",new i.PathOption(p+"_Shape",t.background,u.width,u.color),this.dateParse(t.date).toISOString())),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",n.x,n.y,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"Text":a.height+=8,s="M "+c+" "+d+" L "+(c-5)+" "+(d-5)+" L "+(c-a.width/2)+" "+(d-5)+" L "+(c-a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-5)+" L "+(c+5)+" "+(d-5)+" Z",l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l)),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",c,d-a.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;default:s="M "+c+" "+d+" L "+(c-a.width/2)+" "+(d-a.height/3)+" L "+(c-a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height/3)+" Z",l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l)),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",c,d-a.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e)}},o.prototype.renderStockEventTooltip=function(e){var r=parseInt(e.split("_StockEvents_")[0].split(this.chartId+"_Series_")[1],10),o=parseInt(e.split("_StockEvents_")[1].replace(/\D+/g,""),10),n=this.symbolLocations[r][o],a=new Vi(n.x,n.y+this.stockChart.toolbarHeight+this.stockChart.titleSize.height);this.applyHighLights(o,r);var s=this.getElement(this.chartId+"_StockEvents_Tooltip_svg");if(s&&parseInt(s.getAttribute("opacity"),10)>0)this.stockEventTooltip.content=[this.stockChart.stockEvents[o].description],this.stockEventTooltip.location=a,this.stockEventTooltip.dataBind();else{he(this.chartId+"_StockEvents_Tooltip_svg")&&t.remove(he(this.chartId+"_StockEvents_Tooltip"));var l=t.createElement("div",{id:this.chartId+"_StockEvents_Tooltip",className:"ejSVGTooltip",attrs:{style:"pointer-events:none; position:absolute;z-index: 1"}});he(this.chartId+"_Secondary_Element").appendChild(l),this.stockEventTooltip=new i.Tooltip({opacity:1,header:"",content:[this.stockChart.stockEvents[o].description],enableAnimation:!0,location:a,theme:this.stockChart.theme,inverted:!0,areaBounds:this.stockChart.chart.chartAxisLayoutPanel.seriesClipRect}),this.stockEventTooltip.areaBounds.y+=this.stockChart.toolbarHeight+this.stockChart.titleSize.height,this.stockEventTooltip.appendTo("#"+l.id)}},o.prototype.removeStockEventTooltip=function(e){var t=this,i=this.getElement(this.chartId+"_StockEvents_Tooltip");this.stopAnimation(),i&&this.stockEventTooltip&&(this.toolTipInterval=+setTimeout(function(){t.stockEventTooltip.fadeOut(),t.removeHighLights()},e))},o.prototype.findArrowpaths=function(e){var t="";switch(e){case"ArrowUp":t="l -10 10 l 5 0 l 0 10 l 10 0 l 0 -10 l 5 0 z";break;case"ArrowDown":t="l -10 -10 l 5 0 l 0 -10 l 10 0 l 0 10 l 5 0 z";break;case"ArrowLeft":t="l -10 -10 l 0 5 l -10 0 l 0 10 l 10 0 l 0 5 z";break;case"ArrowRight":t="l 10 -10 l 0 5 l 10 0 l 0 10 l -10 0 l 0 5 z"}return t},o.prototype.applyHighLights=function(e,t){this.pointIndex===e&&this.seriesIndex===t||this.removeHighLights(),this.pointIndex=e,this.seriesIndex=t;var i=this.chartId+"_Series_"+t+"_StockEvents_"+e;this.setOpacity(i+"_Shape",.5),this.setOpacity(i+"_Text",.5)},o.prototype.removeHighLights=function(){var e=this.chartId+"_Series_"+this.seriesIndex+"_StockEvents_"+this.pointIndex;this.setOpacity(e+"_Shape",1),this.setOpacity(e+"_Text",1)},o.prototype.setOpacity=function(e,t){he(e)&&he(e).setAttribute("opacity",t.toString())},o.prototype.dateParse=function(e){var t=this.chart.intl.getDateParser({skeleton:"full",type:"dateTime"}),i=this.chart.intl.getDateFormat({skeleton:"full",type:"dateTime"});return new Date(Date.parse(t(i(new Date(r.DataUtil.parse.parseJson({val:e}).val)))))},o}(un),ns=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),as=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ss=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ns(r,i),as([t.Property(!1)],r.prototype,"visible",void 0),as([t.Property(null)],r.prototype,"height",void 0),as([t.Property(null)],r.prototype,"width",void 0),as([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),as([t.Property("Auto")],r.prototype,"position",void 0),as([t.Property("Series")],r.prototype,"mode",void 0),as([t.Property(8)],r.prototype,"padding",void 0),as([t.Property("Center")],r.prototype,"alignment",void 0),as([t.Complex(e.Theme.legendLabelFont,ja)],r.prototype,"textStyle",void 0),as([t.Property(10)],r.prototype,"shapeHeight",void 0),as([t.Property(10)],r.prototype,"shapeWidth",void 0),as([t.Complex({},Ha)],r.prototype,"border",void 0),as([t.Complex({left:0,right:0,top:0,bottom:0},Ya)],r.prototype,"margin",void 0),as([t.Complex({left:0,right:0,top:0,bottom:0},Zt)],r.prototype,"containerPadding",void 0),as([t.Property(5)],r.prototype,"shapePadding",void 0),as([t.Property("transparent")],r.prototype,"background",void 0),as([t.Property(1)],r.prototype,"opacity",void 0),as([t.Property(!0)],r.prototype,"toggleVisibility",void 0),as([t.Property(null)],r.prototype,"description",void 0),as([t.Property(3)],r.prototype,"tabIndex",void 0),as([t.Property(null)],r.prototype,"title",void 0),as([t.Complex(e.Theme.legendTitleFont,ja)],r.prototype,"titleStyle",void 0),as([t.Property("Top")],r.prototype,"titlePosition",void 0),as([t.Property(100)],r.prototype,"maximumTitleWidth",void 0),as([t.Property(!0)],r.prototype,"enablePages",void 0),as([t.Property(!1)],r.prototype,"isInversed",void 0),r}(t.ChildProperty),ls=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return ns(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd),this.chart.off(t.Browser.touchMoveEvent,this.mouseMove))},r.prototype.mouseMove=function(e){this.chart.legendSettings.visible&&!this.chart.isTouch&&this.move(e)},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e,t){this.legendCollections=[];var i,r;e.length>1&&(this.legend.mode="Series");for(var o=0,n=e;o<n.length;o++){var a=n[o];"Series"===this.legend.mode&&"Indicator"!==a.category&&(i=a.type,r=a.pointColorMapping&&a.points.length>0&&a.points[0].interior?a.points[0].interior:a.interior,this.legendCollections.push(new mr(a.name,r,a.legendShape,"TrendLine"===a.category?this.chart.series[a.sourceIndex].trendlines[a.index].visible:a.visible,i,a.legendImageUrl,a.marker.shape,a.marker.visible)))}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t);var o=r.padding;this.isTitle=!!r.title;var n=r.titlePosition,a=0,s=0,l=this.arrowHeight,h=this.arrowWidth,c=this.isVertical&&!r.enablePages?l:0,d=this.isTitle&&"Top"===n?this.fivePixel+this.legendTitleSize.height:0;d=this.isTitle&&this.isVertical&&"Top"!==n?this.fivePixel+this.legendTitleSize.height:d,this.isVertical?a=r.width?0:e.width/100*5:s=r.height?0:e.height/100*5,t.height+=s,t.width+=a;var p,u=r.shapePadding,g=r.shapeWidth,y=0,m=0,v=0,f=0,b=0,x=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];li.test(P.text)&&(P.text=We(P.text,li)),si.test(P.text)&&(P.text=We(P.text,si)),p={fill:P.fill,text:P.text,shape:P.shape,markerShape:P.markerShape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",p),P.text=p.text,P.render=!p.cancel,P.shape=p.shape,P.fill=p.fill,P.markerShape=p.markerShape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&(w=!0,m+=v=u+g+P.textSize.width+o,r.enablePages||this.isVertical||(x=this.isTitle&&"Top"!==n?this.legendTitleSize.width+this.fivePixel:0,x+=h),(t.width<o+m+x||this.isVertical)&&(y=Math.max(y,m+o+x-(this.isVertical?0:v)),0===b&&v!==m&&(b=1),m=this.isVertical?0:v,f=++b*(this.maxItemHeight+o)+o+d+c))}f=Math.max(f,this.maxItemHeight+o+o+d),this.isPaging=t.height<f,this.isPaging&&!r.enablePages&&(f=this.isVertical?f:this.maxItemHeight+o+o+("Top"===n?d:0)),this.totalPages=b,this.isPaging||this.isVertical||(m+=this.isTitle&&"Top"!==n?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),w?this.setBounds(Math.max(m+o,y),f,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=r.location.x+i+r.textSize.width,l=this.legend.padding;s+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+l):(e.location.x=n===a?r.location.x:s,e.location.y=r.location.y);var h=this.legendBounds.width+this.legendBounds.x-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.legendClick=function(e,t){var i=this.chart,r="Series"===i.legendSettings.mode?e:0,o=i.visibleSeries[r],n=this.legendCollections[e],a={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,name:"legendClick",cancel:!1};this.chart.trigger("legendClick",a),o.legendShape=a.legendShape,null!==o.fill&&(i.visibleSeries[e].interior=o.fill),i.legendSettings.toggleVisibility&&(this.changeSeriesVisiblity(o,o.visible),n.visible="TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible:o.visible,this.refreshLegendToggle(i,o))},r.prototype.refreshLegendToggle=function(e,t){var i=e.stockLegendModule.legendBounds;e.stockLegendModule.renderLegend(e,e.legendSettings,i),e.cartesianChart.cartesianChartRefresh(e)},r.prototype.changeSeriesVisiblity=function(e,t){e.visible=!t,this.SecondaryAxis(e.yAxis)&&(e.yAxis.internalVisibility=e.yAxis.series.some(function(e){return e.visible})),this.SecondaryAxis(e.xAxis)&&(e.xAxis.internalVisibility=e.xAxis.series.some(function(e){return e.visible}))},r.prototype.SecondaryAxis=function(e){return this.chart.axes.indexOf(e)>-1},r.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i,r=this.chart.mouseY,o=this.chart.mouseX,n=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"],a=e.target.id,s=0,l=n;s<l.length;s++){var h=l[s];if(a.indexOf(h)>-1){i=parseInt(a.split(h)[1],10),this.legendClick(i,e);break}}a.indexOf(this.legendID+"_pagedown")>-1?this.changePage(e,!1):a.indexOf(this.legendID+"_pageup")>-1&&this.changePage(e,!0),this.legendRegions.filter(function(e){return j(o,r+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(null,1,2):0),e.rect)})}},r.prototype.getModuleName=function(){return"StockLegend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),hs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ds=function(e){function o(i,r){var o=e.call(this,i,r)||this;return o.isSingleAxis=!1,o.chartid=57723,o.tempSeriesType=[],o.zoomChange=!1,o.allowPan=!1,o.onPanning=!1,o.trendlinetriggered=!0,o.initialRender=!0,o.rangeFound=!1,o.tempPeriods=[],o.toolbarHeight=o.enablePeriodSelector?t.Browser.isDevice?56:42:0,o}return hs(o,e),o.prototype.onPropertyChanged=function(e,t){for(var i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"series":this.render()}},o.prototype.rangeChanged=function(e,t){var i=document.getElementById(this.chartObject.id);if(i)for(;i.firstChild;)i.removeChild(i.firstChild);this.startValue=e,this.endValue=t,this.cartesianChart.initializeChart(),this.periodSelector.datePicker.startDate=new Date(e),this.periodSelector.datePicker.endDate=new Date(t),this.periodSelector.datePicker.dataBind()},o.prototype.preRender=function(){this.isBlazor=window.Blazor,this.unWireEvents(),this.initPrivateVariable(),this.allowServerDataBinding=!1,this.isProtectedOnChange=!0,this.setCulture(),this.wireEvents()},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.stockChartOnMouseDown),t.EventHandler.remove(this.element,i,this.stockChartOnMouseMove),t.EventHandler.remove(this.element,r,this.stockChartMouseEnd),t.EventHandler.remove(this.element,"click",this.stockChartOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.stockChartRightClick),t.EventHandler.remove(this.element,o,this.stockChartOnMouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.stockChartOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.stockChartOnMouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.stockChartMouseEnd,this),t.EventHandler.add(this.element,"click",this.stockChartOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.stockChartRightClick,this),t.EventHandler.add(this.element,e,this.stockChartOnMouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize.bind(this)),this.setStyle(this.element)},o.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-stockChart").length;this.element.id="stockChart_"+this.chartid+"_"+e}this.seriesXMax=null,this.seriesXMin=null,this.startValue=null,this.endValue=null,this.currentEnd=null},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.storeDataSource=function(){for(var e=0;e<this.series.length;e++){var t=this.series[e];this.tempSeriesType.push(t.type),t.localData=void 0}0===this.series.length&&this.series.push({}),this.initialRender=!0,this.rangeFound=!1,this.resizeTo=null,this.startValue=null,this.endValue=null},o.prototype.render=function(){var e=this,t={name:"load",stockChart:this.isBlazor?{}:this,theme:this.theme};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.themeStyle=c(e.theme),e.storeDataSource(),e.drawSVG(),e.renderTitle(),e.renderLegend(),e.chartModuleInjection(),e.chartRender(),e.dataSource instanceof r.DataManager&&e.series[0].dataSource instanceof r.DataManager||(e.stockChartDataManagerSuccess(),e.initialRender=!1),e.renderComplete(),e.allowServerDataBinding=!0,e.isProtectedOnChange=!1})},o.prototype.stockChartDataManagerSuccess=function(){this.findRange(),this.renderRangeSelector(),this.renderPeriodSelector(),this.trigger("loaded",{stockChart:this.isBlazor?{}:this})},o.prototype.setStyle=function(e){var t=this.zoomSettings,i=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||this.crosshair.enable;e.style.msTouchAction=i?"none":"element",e.style.touchAction=i?"none":"element",e.style.msUserSelect="none",e.style.msContentZooming="none",e.style.position="relative",e.style.display="block",e.style.webkitUserSelect="none"},o.prototype.drawSVG=function(){this.removeSvg(),je(this),this.renderer=new i.SvgRenderer(this.element.id),this.renderBorder(),this.createSecondaryElements(),this.calculateVisibleSeries(),this.calculateLegendBounds(),this.mainObject=this.renderer.createSvg({id:this.element.id+"_stockChart_svg",width:this.availableSize.width,height:this.availableSize.height-(this.enablePeriodSelector?this.toolbarHeight:0)-this.titleSize.height}),this.svgObject=this.mainObject,this.element.appendChild(this.mainObject)},o.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e,t=h(this.theme),i=t.length,r=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,n=r.length;o<n;o++)(e=r[o]).category="Series",e.index=o,e.interior=e.fill||t[o%i],this.visibleSeries.push(e),r[o]=e},o.prototype.createSecondaryElements=function(){var e=Fe(!1,this.element.id+"_Secondary_Element")||this.createElement("div");e.id=this.element.id+"_Secondary_Element",this.title?(this.titleSize=i.measureText(this.title,this.titleStyle),this.titleSize.height+=15):this.titleSize={height:null,width:null};var t=(this.enablePeriodSelector?this.toolbarHeight:0)+this.titleSize.height;e.setAttribute("style","position: relative; height:"+t+"px"),be(!1,this.element,e,!1)},o.prototype.requiredModules=function(){var e=[];return this.legendSettings.visible&&e.push({member:"StockLegend",args:[this]}),e},o.prototype.findCurrentData=function(e,t){var i,r=this;return e&&this.startValue&&this.endValue&&(i=e.filter(function(e){return new Date(Date.parse(e[t])).getTime()>=r.startValue&&new Date(Date.parse(e[t])).getTime()<=r.endValue})),i},o.prototype.renderPeriodSelector=function(){this.enablePeriodSelector&&(this.toolbarSelector.initializePeriodSelector(),this.periodSelector.toolbar.refreshOverflow(),this.enableSelector||this.cartesianChart.cartesianChartRefresh(this))},o.prototype.chartRender=function(){this.cartesianChart=new Da(this),this.cartesianChart.initializeChart()},o.prototype.renderRangeSelector=function(){this.enableSelector&&(this.rangeSelector=new Ba(this),this.rangeSelector.initializeRangeNavigator())},o.prototype.getModuleName=function(){return"stockChart"},o.prototype.getPersistData=function(){return""},o.prototype.removeSvg=function(){document.getElementById(this.element.id+"_Secondary_Element")&&t.remove(document.getElementById(this.element.id+"_Secondary_Element"));if(this.mainObject){for(;this.mainObject.childNodes.length>0;)this.mainObject.removeChild(this.mainObject.firstChild);!this.mainObject.hasChildNodes()&&this.mainObject.parentNode&&(t.remove(this.mainObject),this.mainObject=null,this.selectorObject=null,this.chartObject=null)}},o.prototype.chartModuleInjection=function(){for(var e,t=0,i=this.getInjectedModules();t<i.length;t++){var r=i[t];-1===(e=r.prototype.getModuleName().toLowerCase()).indexOf("rangetooltip")?Rr.Inject(r):za.Inject(r),"datetime"!==e&&"areaseries"!==e&&"steplineseries"!==e||za.Inject(r)}},o.prototype.findRange=function(){var e=this;this.seriesXMin=1/0,this.seriesXMax=-1/0;for(var t=0,i=this.chart.series;t<i.length;t++){var r=i[t];r.visible&&(this.seriesXMin=Math.min(this.seriesXMin,r.xMin),this.seriesXMax=Math.max(this.seriesXMax,r.xMax))}this.endValue=this.currentEnd=this.seriesXMax,this.enablePeriodSelector?(this.toolbarSelector=new Fa(this),this.periodSelector=new Oa(this),this.tempPeriods=this.periods.length?this.periods:this.toolbarSelector.calculateAutoPeriods(),this.tempPeriods.map(function(t){t.selected&&"ytd"===t.text.toLowerCase()?e.startValue=new Date(new Date(e.currentEnd).getFullYear().toString()).getTime():t.selected&&"all"===t.text.toLowerCase()?e.startValue=e.seriesXMin:t.selected&&(e.startValue=e.periodSelector.changedRange(t.intervalType,e.endValue,t.interval).getTime())})):this.startValue=this.seriesXMin,this.rangeFound=!0},o.prototype.stockChartResize=function(){var e=this;return!!document.getElementById(this.element.id)&&(this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){je(e),e.renderBorder(),e.calculateLegendBounds(),e.renderTitle(),e.renderLegend(),e.cartesianChart.cartesianChartRefresh(e),e.mainObject.setAttribute("width",e.availableSize.width.toString()),e.enablePeriodSelector&&e.renderPeriodSelector()},500),!1)},o.prototype.stockChartOnMouseDown=function(e){var i,r,o,n,a=this.chart.element.getBoundingClientRect(),s=e.target;if(this.trigger("stockChartMouseDown",{target:s.id,x:this.mouseX,y:this.mouseY}),"touchstart"===e.type?(this.isTouch=!0,i=(n=e).changedTouches[0].clientX,o=n.target,r=n.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType,i=e.clientX,r=e.clientY,o=e.target),o.id.indexOf(this.element.id+"_stockChart_chart")>-1){var l=he(this.element.id+"_stockChart_chart").getBoundingClientRect();this.mouseDownY=this.previousMouseMoveY=r-a.top-Math.max(l.top-a.top,0),this.mouseDownX=this.previousMouseMoveX=i-a.left-Math.max(l.left-a.left,0),this.setMouseXY(this.mouseDownX,this.mouseDownY),this.referenceXAxis=this.chart.primaryXAxis,he(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.mouseDownXPoint=rt(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.referenceXAxis.visibleRange,this.referenceXAxis.isInversed),this.allowPan=!0,this.notify(t.Browser.touchStartEvent,e)}return!1},o.prototype.stockChartMouseEnd=function(e){var t,i,r;return"touchend"===e.type?(i=(r=e).changedTouches[0].clientX,t=r.changedTouches[0].clientY,this.isTouch=!0):(t=e.clientY,i=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),he(this.element.id+"_stockChart_chart").setAttribute("cursor","auto"),this.onPanning=!1,this.setMouseXY(i,t),this.stockChartOnMouseUp(e),!1},o.prototype.stockChartOnMouseUp=function(e){var i=e.target;return this.trigger("stockChartMouseUp",{target:i.id,x:this.mouseX,y:this.mouseY}),this.isChartDrag=!1,this.allowPan=!1,this.isTouch&&(this.threshold=(new Date).getTime()+300),this.notify(t.Browser.touchEndEvent,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(0),!1},o.prototype.setMouseXY=function(e,t){var i=he(this.element.id+"_stockChart_chart");if(this.element&&i){var r=this.element.getBoundingClientRect(),o=i.getBoundingClientRect();this.mouseX=e-r.left-Math.max(o.left-r.left,0),this.mouseY=t-r.top-Math.max(o.top-r.top,0)}},o.prototype.stockChartOnMouseMove=function(e){var t,i,r;return"touchmove"===e.type?(this.isTouch=!0,r=(i=e).changedTouches[0].clientY,t=i.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,r=e.clientY),this.trigger("stockChartMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),he(this.element.id+"_stockChart_chart")&&(this.setMouseXY(t,r),this.chartOnMouseMove(e)),!1},o.prototype.chartOnMouseMove=function(e){if(this.allowPan&&this.mouseDownXPoint&&this.mouseX!==this.previousMouseMoveX&&this.zoomSettings.enablePan){this.onPanning=!0,he(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.mouseUpXPoint=rt(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.referenceXAxis.visibleRange,this.referenceXAxis.isInversed);var i=Math.abs(this.mouseUpXPoint-this.mouseDownXPoint);this.mouseDownXPoint<this.mouseUpXPoint?this.seriesXMin<=this.referenceXAxis.visibleRange.min-i&&(this.startValue=this.referenceXAxis.visibleRange.min-i,this.endValue=this.referenceXAxis.visibleRange.max-i,this.cartesianChart.cartesianChartRefresh(this),this.rangeSelector.sliderChange(this.referenceXAxis.visibleRange.min-i,this.referenceXAxis.visibleRange.max-i)):this.seriesXMax>=this.referenceXAxis.visibleRange.max+i&&(this.startValue=this.referenceXAxis.visibleRange.min+i,this.endValue=this.referenceXAxis.visibleRange.max+i,this.cartesianChart.cartesianChartRefresh(this),this.rangeSelector.sliderChange(this.referenceXAxis.visibleRange.min+i,this.referenceXAxis.visibleRange.max+i))}if(this.notify(t.Browser.touchMoveEvent,e),""===e.target.id){var r=void 0;(this.chart.tooltip.enable||this.crosshair.enable)&&(r=document.getElementById(this.element.id+"_stockChart_chart_tooltip"))&&t.remove(r),he(this.element.id+"_StockEvents_Tooltip")&&this.stockEvent.removeStockEventTooltip(0)}return-1!==e.target.id.indexOf("StockEvents")?(clearInterval(this.stockEvent.toolTipInterval),this.stockEvent.renderStockEventTooltip(e.target.id)):this.stockEvent&&this.stockEvent.removeStockEventTooltip(1e3),this.isTouch=!1,!1},o.prototype.stockChartOnMouseClick=function(e){var t=e.target;return this.trigger("stockChartMouseClick",{target:t.id,x:this.mouseX,y:this.mouseY}),this.notify("click",e),!1},o.prototype.stockChartRightClick=function(e){return!this.crosshair.enable||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.stockChartOnMouseLeave=function(e){var t,i,r;return"touchleave"===e.type?(this.isTouch=!0,i=(t=e).changedTouches[0].clientX,r=t.changedTouches[0].clientY):(i=e.clientX,r=e.clientY,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(i,r),this.allowPan=!1,this.stockChartOnMouseLeaveEvent(e),!1},o.prototype.stockChartOnMouseLeaveEvent=function(e){var i=t.Browser.isPointer?"pointerleave":"mouseleave";return this.isChartDrag=!1,this.notify(i,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(1e3),!1},o.prototype.destroy=function(){},o.prototype.renderBorder=function(){if(this.border.width){var e=this.createElement("div");e.id=this.element.id+"_stock_border",e.style.width=this.availableSize.width+"px",e.style.height=this.availableSize.height+"px",e.style.position="absolute",e.style.border=this.border.width+"px solid "+this.border.color,e.style.pointerEvents="none",be(!1,he(this.element.id),e)}},o.prototype.renderTitle=function(){var e;if(this.title){be(!1,he(this.element.id+"_Secondary_Element"),this.renderer.createSvg({id:this.element.id+"_stockChart_Title",width:this.availableSize.width,height:this.titleSize.height,fill:this.background||this.themeStyle.background}),!1);var t=this.titleStyle.textAlignment,r="Near"===t?"start":"Far"===t?"end":"middle";e=new i.Rect(0,0,this.availableSize.width,0);var o=new i.TextOption(this.element.id+"_ChartTitle",Ye(e,this.titleStyle),this.titleSize.height-10,r,this.title,"","auto");Ve(this.renderer,o,this.titleStyle,this.titleStyle.color||this.findTitleColor(),he(this.element.id+"_stockChart_Title"),!1,!1),this.availableSize.height-=this.titleSize.height+5}},o.prototype.calculateLegendBounds=function(){this.stockLegendModule&&this.legendSettings.visible&&this.stockLegendModule.getLegendOptions(this.visibleSeries,this);var e=this.titleSize.height,t=this.border.width,r=this.availableSize.width-this.border.width-t,o=.5*this.chartArea.border.width+this.border.width,n=this.availableSize.height-o-this.border.width-(this.enablePeriodSelector?this.toolbarHeight:0)-e;this.initialClipRect=new i.Rect(t,o,r,n),this.tempAvailableSize=new i.Size(this.availableSize.width,this.availableSize.height-(this.enablePeriodSelector?this.toolbarHeight:0)-e),this.stockLegendModule&&this.legendSettings.visible&&this.stockLegendModule.calculateLegendBounds(this.initialClipRect,this.tempAvailableSize,null)},o.prototype.renderLegend=function(){if(this.stockLegendModule&&this.stockLegendModule.legendCollections.length&&this.legendSettings.visible){this.stockLegendModule.calTotalPage=!0;var e=this.stockLegendModule.legendBounds;this.stockLegendModule.renderLegend(this,this.legendSettings,e),"Auto"===this.legendSettings.position||"Bottom"===this.legendSettings.position||"Top"===this.legendSettings.position?this.availableSize.height-=this.stockLegendModule.legendBounds.height:"Left"!==this.legendSettings.position&&"Right"!==this.legendSettings.position||(this.availableSize.width-=this.stockLegendModule.legendBounds.width)}},o.prototype.findTitleColor=function(){return this.theme.toLocaleLowerCase().indexOf("highcontrast")>-1||this.theme.indexOf("Dark")>-1?"#ffffff":"#424242"},o.prototype.calculateStockEvents=function(){this.stockEvents.length&&(this.stockEvent=new os(this),be(!1,this.chartObject,this.stockEvent.renderStockEvents()))},cs([t.Property(null)],o.prototype,"width",void 0),cs([t.Property(null)],o.prototype,"height",void 0),cs([t.Property("")],o.prototype,"dataSource",void 0),cs([t.Complex({},Ya)],o.prototype,"margin",void 0),cs([t.Complex({color:"#DDDDDD",width:1},Ha)],o.prototype,"border",void 0),cs([t.Property(null)],o.prototype,"background",void 0),cs([t.Property("Material")],o.prototype,"theme",void 0),cs([t.Complex({name:"primaryXAxis",valueType:"DateTime"},$a)],o.prototype,"primaryXAxis",void 0),cs([t.Complex({border:{color:null,width:.5},background:"transparent"},Xa)],o.prototype,"chartArea",void 0),cs([t.Complex({name:"primaryYAxis",opposedPosition:!0,labelPosition:"Inside"},$a)],o.prototype,"primaryYAxis",void 0),cs([t.Collection([{}],Ja)],o.prototype,"rows",void 0),cs([t.Collection([{opposedPosition:!0}],$a)],o.prototype,"axes",void 0),cs([t.Collection([],qa)],o.prototype,"series",void 0),cs([t.Collection([],is)],o.prototype,"stockEvents",void 0),cs([t.Property(!1)],o.prototype,"isTransposed",void 0),cs([t.Property("")],o.prototype,"title",void 0),cs([t.Complex({size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ja)],o.prototype,"titleStyle",void 0),cs([t.Collection([],Qa)],o.prototype,"indicators",void 0),cs([t.Complex({shared:!0,enableMarker:!1},ti)],o.prototype,"tooltip",void 0),cs([t.Complex({dashArray:"5"},Pr)],o.prototype,"crosshair",void 0),cs([t.Complex({},ss)],o.prototype,"legendSettings",void 0),cs([t.Complex({},Lr)],o.prototype,"zoomSettings",void 0),cs([t.Property(!0)],o.prototype,"enablePeriodSelector",void 0),cs([t.Property(!0)],o.prototype,"enableCustomRange",void 0),cs([t.Property(!1)],o.prototype,"isSelect",void 0),cs([t.Property(!0)],o.prototype,"enableSelector",void 0),cs([t.Collection([],ii)],o.prototype,"periods",void 0),cs([t.Collection([{}],es)],o.prototype,"annotations",void 0),cs([t.Event()],o.prototype,"selectorRender",void 0),cs([t.Event()],o.prototype,"stockChartMouseMove",void 0),cs([t.Event()],o.prototype,"stockChartMouseLeave",void 0),cs([t.Event()],o.prototype,"stockChartMouseDown",void 0),cs([t.Event()],o.prototype,"stockChartMouseUp",void 0),cs([t.Event()],o.prototype,"stockChartMouseClick",void 0),cs([t.Event()],o.prototype,"pointClick",void 0),cs([t.Event()],o.prototype,"pointMove",void 0),cs([t.Event()],o.prototype,"onZooming",void 0),cs([t.Event()],o.prototype,"legendRender",void 0),cs([t.Event()],o.prototype,"legendClick",void 0),cs([t.Property("None")],o.prototype,"selectionMode",void 0),cs([t.Property(!1)],o.prototype,"isMultiSelect",void 0),cs([t.Event()],o.prototype,"load",void 0),cs([t.Event()],o.prototype,"loaded",void 0),cs([t.Event()],o.prototype,"rangeChange",void 0),cs([t.Event()],o.prototype,"axisLabelRender",void 0),cs([t.Event()],o.prototype,"tooltipRender",void 0),cs([t.Event()],o.prototype,"seriesRender",void 0),cs([t.Event()],o.prototype,"stockEventRender",void 0),cs([t.Collection([],ts)],o.prototype,"selectedDataIndexes",void 0),cs([t.Property(["Line","Hilo","OHLC","Hollow Candle","Spline","Candle"])],o.prototype,"seriesType",void 0),cs([t.Property(["EMA","TMA","SMA","Momentum","ATR","Accumulation Distribution","Bollinger Bands","MACD","Stochastic","RSI"])],o.prototype,"indicatorType",void 0),cs([t.Property(["PNG","JPEG","SVG","PDF","Print"])],o.prototype,"exportType",void 0),cs([t.Property(["Linear","Exponential","Polynomial","Logarithmic","Moving Average"])],o.prototype,"trendlineType",void 0),o=cs([t.NotifyPropertyChanges],o)}(t.Component),ps=function(){function e(e){this.control=e,this.elementId=e.element.id}return e.prototype.renderLeftTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentStart),i=this.getContentSize(t),r=this.control.enableRtl?e.rightRect:e.leftRect;i>r.width&&(r=e.midRect),this.leftTooltip=this.renderTooltip(r,this.createElement("_leftTooltip"),e.startX,t)},e.prototype.getContentSize=function(e){var r=this.control.tooltip.textStyle;return this.control.tooltip.template?ue(t.createElement("div",{id:"measureElement",styles:"position: absolute;"}),0,this.control.tooltip.template,this.control).getBoundingClientRect().width:i.measureText(e[0],r).width+20},e.prototype.renderRightTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentEnd),i=this.getContentSize(t),r=this.control.enableRtl?e.leftRect:e.rightRect;i>r.width&&((r=e.midRect).x=this.control.series.length?0:r.x),this.rightTooltip=this.renderTooltip(r,this.createElement("_rightTooltip"),e.endX,t)},e.prototype.createElement=function(e){if(he(this.elementId+e))return he(this.elementId+e);var t=document.createElement("div");if(t.id=this.elementId+e,t.className="ejSVGTooltip",t.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),this.control.stockChart){var i=this.control.stockChart;he(i.element.id+"_Secondary_Element").appendChild(t),t.style.transform="translateY("+(i.availableSize.height-i.toolbarHeight-80+i.toolbarHeight+i.titleSize.height)+"px)"}else he(this.elementId+"_Secondary_Element").appendChild(t);return t},e.prototype.renderTooltip=function(e,t,r,o){var n=this.control,a=n.tooltip,s={cancel:!1,name:"tooltipRender",text:o,textStyle:a.textStyle};this.control.trigger("tooltipRender",s);var l=n.svgObject.getBoundingClientRect().left-n.element.getBoundingClientRect().left;return s.cancel?null:new i.Tooltip({location:{x:r,y:n.rangeSlider.sliderY},content:s.text,marginX:2,enableShadow:!1,marginY:2,arrowPadding:8,rx:0,ry:0,inverted:n.series.length>0,areaBounds:e,fill:a.fill?a.fill:this.control.themeStyle.tooltipBackground,theme:this.control.theme,clipBounds:{x:l},border:a.border,opacity:a.opacity,template:a.template,textStyle:s.textStyle,availableSize:n.availableSize,data:{start:this.getTooltipContent(this.control.startValue)[0],end:this.getTooltipContent(this.control.endValue)[0],value:o[0]}},t)},e.prototype.getTooltipContent=function(e){var t,i=this.control,r=i.tooltip,o=i.chartSeries.xAxis,n=r.format||o.labelFormat,a=null!==n.match("{value}"),s=o.valueType;return"DateTime"===s?t=i.intl.getDateFormat({format:n||"MM/dd/yyyy",type:G(i.skeletonType),skeleton:i.dateTimeModule.getSkeleton(o,null,null,i.isBlazor)})(new Date(e)):(o.format=i.intl.getNumberFormat({format:a?"":n,useGrouping:i.useGroupingSeparator}),t=i.doubleModule.formatValue(o,a,n,"Logarithmic"===s?Math.pow(o.logBase,e):e)),[t]},e.prototype.fadeOutTooltip=function(){var e=this;"OnDemand"===this.control.tooltip.displayMode&&(Ce(this.toolTipInterval),this.rightTooltip&&(this.toolTipInterval=+setTimeout(function(){e.leftTooltip.fadeOut(),e.rightTooltip.fadeOut()},1e3)))},e.prototype.getModuleName=function(){return"RangeTooltip"},e.prototype.destroy=function(){},e}(),us=function(){function e(e){this.bulletChart=e,this.isVertical="Vertical"===e.orientation,this.isLabelsInside="Inside"===e.labelPosition,this.isHorizontal="Horizontal"===e.orientation,this.isLeft="Left"===e.titlePosition,this.isRight="Right"===e.titlePosition,this.isTop="Top"===e.titlePosition,this.majorTickSize=e.majorTickLines.height,this.location=10,this.labelOffset=15,this.labelSize=parseFloat(e.labelStyle.size),this.isLabelBelow=!this.bulletChart.opposedPosition}return e.prototype.renderMajorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMajorTickLines(e,t):this.renderYMajorTickLines(e,t)},e.prototype.renderMinorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMinorTickLines(e,t):this.renderYMinorTickLines(e,t)},e.prototype.renderAxisLabels=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXAxisLabels(e,t):this.renderYAxisLabels(e,t)},e.prototype.renderXMajorTickLines=function(e,t){for(var i,r,o=this.bulletChart,n=o.renderer.createGroup({id:o.svgObject.id+"_majorTickGroup"}),a=o.minimum,s=o.maximum,l=o.interval,h=o.enableRtl,c=o.initialClipRect.y+(o.opposedPosition?0:o.initialClipRect.height),d=c+(o.opposedPosition?"Inside"!==o.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==o.tickPosition?this.majorTickSize:-this.majorTickSize),p=o.majorTickLines,u=p.color||o.themeStyle.majorTickLineColor,g=o.initialClipRect.x+(o.enableRtl?o.initialClipRect.width:0),y=o.initialClipRect.x+p.width/2+(h?o.initialClipRect.width:0),m=a;m<=s;m+=l){(r=o.enableRtl?m===a:m===s)&&(y-=p.width/2),r=o.enableRtl?m===a:m===s,o.majorTickLines.useRangeColor&&(u=this.bindingRangeStrokes(y-(r?this.bulletChart.majorTickLines.width/2:0),g,this.bulletChart.orientation,o.enableRtl)),i=this.majorTicks(y,y,c,d,u,m);var v=o.renderer.drawLine(i);y+=h?-e:e,n.appendChild(v),t.appendChild(n)}},e.prototype.renderYMajorTickLines=function(e,t){for(var i,r,o=this.bulletChart,n=o.renderer.createGroup({id:o.svgObject.id+"_majorTickGroup"}),a=o.minimum,s=o.maximum,l=o.interval,h=o.enableRtl,c=o.initialClipRect,d=c.x+(o.opposedPosition?c.width:0),p=d-(o.opposedPosition?"Inside"!==o.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==o.tickPosition?this.majorTickSize:-this.majorTickSize),u=o.majorTickLines,g=u.color||o.themeStyle.majorTickLineColor,y=c.y+(o.enableRtl?0:c.height),m=c.y+u.width/2+(h?0:c.height),v=a;v<=s;v+=l){(i=o.enableRtl?v===s:v===a)&&(m-=u.width/2),i=o.enableRtl?v===a:v===s,o.majorTickLines.useRangeColor&&(g=this.bindingRangeStrokes(m-(i?this.bulletChart.majorTickLines.width/2:0),y,this.bulletChart.orientation,o.enableRtl)),r=this.majorTicks(d,p,m,m,g,v);var f=o.renderer.drawLine(r);m+=h?e:-e,n.appendChild(f),t.appendChild(n)}},e.prototype.majorTicks=function(e,t,i,r,o,n){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+n,x1:e,y1:i,x2:t,y2:r,"stroke-width":this.bulletChart.majorTickLines.width,stroke:this.bulletChart.majorTickLines.useRangeColor&&o?o:this.bulletChart.majorTickLines.color||o}},e.prototype.bindingRangeStrokes=function(e,t,i,r){return"Vertical"===i&&!r||r&&"Horizontal"===i?this.backwardStrokeBinding(e,t):this.forwardStrokeBinding(e,t)},e.prototype.renderXMinorTickLines=function(e,t){for(var i,r,o,n,a=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),s=this.bulletChart,l=s.maximum,h=s.minimum,c=s.interval,d=s.minorTickLines.height,p=this.bulletChart.minorTicksPerInterval,u=s.initialClipRect.x,g=s.initialClipRect.y+(s.opposedPosition?0:s.initialClipRect.height),y=g+(s.opposedPosition?"Inside"!==s.tickPosition?-d:d:"Inside"!==s.tickPosition?d:-d),m=s.minorTickLines.color||s.themeStyle.minorTickLineColor,v=s.initialClipRect.x+(s.enableRtl?s.initialClipRect.width:0),f=h;f<l;f+=c){i=e/p;for(var b=1;b<=p;b++)r=u+i-i/(p+1),s.minorTickLines.useRangeColor&&(m=this.bindingRangeStrokes(r,v,this.bulletChart.orientation,s.enableRtl)),o=this.minorXTicks(r,r,g,y,m,f.toString()+b.toString()),n=this.bulletChart.renderer.drawLine(o),a.appendChild(n),t.appendChild(a),i=e/p*(b+1);u+=e}},e.prototype.renderYMinorTickLines=function(e,t){for(var i,r,o,n,a=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),s=this.bulletChart,l=s.maximum,h=s.minimum,c=s.interval,d=s.minorTickLines.height,p=this.bulletChart.minorTicksPerInterval,u=s.initialClipRect.y+(s.enableRtl?0:s.initialClipRect.height),g=s.initialClipRect.x+(s.opposedPosition?s.initialClipRect.width:0),y=g-(s.opposedPosition?"Inside"!==s.tickPosition?-d:d:"Inside"!==s.tickPosition?d:-d),m=s.minorTickLines.color||s.themeStyle.minorTickLineColor,v=s.initialClipRect.y+(s.enableRtl?0:s.initialClipRect.height),f=h;f<l;f+=c){i=e/p;for(var b=1;b<=p;b++)r=this.bulletChart.enableRtl?u+i-i/(p+1):u-i+i/(p+1),s.minorTickLines.useRangeColor&&(m=this.bindingRangeStrokes(r,v,this.bulletChart.orientation,s.enableRtl)),o=this.minorXTicks(g,y,r,r,m,f.toString()+b.toString()),n=this.bulletChart.renderer.drawLine(o),a.appendChild(n),t.appendChild(a),i=e/p*(b+1);u-=this.bulletChart.enableRtl?-e:e}},e.prototype.minorXTicks=function(e,t,i,r,o,n){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+n,x1:e,x2:t,y1:i,y2:r,"stroke-width":this.bulletChart.minorTickLines.width,stroke:this.bulletChart.minorTickLines.useRangeColor&&o?o:this.bulletChart.minorTickLines.color||o}},e.prototype.forwardStrokeBinding=function(e,t){for(var i=this.bulletChart,r=t,o=0;o<=i.rangeCollection.length-1;o++)if(r+=o?i.rangeCollection[o-1]:0,e>=r&&e<r+i.rangeCollection[o])return i.ranges[o].color;return null},e.prototype.backwardStrokeBinding=function(e,t){for(var i=this.bulletChart,r=t,o=0;o<=i.rangeCollection.length-1;o++)if(r-=o?i.rangeCollection[o-1]:0,Math.round(e)>=Math.round(r-i.rangeCollection[o])&&e<=r)return i.ranges[o].color;return null},e.prototype.renderXAxisLabels=function(e,t){var r,o,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),a=this.bulletChart,s=this.bulletChart.locale,l=a.enableRtl,h=(a.tickPosition===a.labelPosition?a.majorTickLines.height:0)+10,c=a.initialClipRect.y+(a.opposedPosition?"Inside"===a.labelPosition?h:-h:a.initialClipRect.height+("Inside"===a.labelPosition?-h:h)),d=a.initialClipRect.x+(l?a.initialClipRect.width:0),p=a.minimum,u=a.maximum,g=a.interval,y=s&&this.bulletChart.enableGroupSeparator,m=this.getFormat(this.bulletChart),v=a.labelStyle.color||a.themeStyle.labelFontColor,f=null!==m.match("{value}");this.format=this.bulletChart.intl.getNumberFormat({format:f?"":m,useGrouping:this.bulletChart.enableGroupSeparator});var b=a.initialClipRect.x+(a.enableRtl?a.initialClipRect.width:0);c+=i.measureText(this.formatValue(this,f,m,this.bulletChart.maximum),a.labelStyle).height/3;for(var x=p;x<=u;x+=g){o=a.enableRtl?x===p:x===u,a.labelStyle.useRangeColor&&(v=this.bindingRangeStrokes(d-(o?this.bulletChart.majorTickLines.width/2:0),b,this.bulletChart.orientation,a.enableRtl)),r=y?x.toLocaleString(s):this.formatValue(this,f,m,x);var w=this.labelXOptions(d,c,r,x),S=i.textElement(w,this.bulletChart.labelStyle,v,t);n.appendChild(S),d+=l?-e:e}t.appendChild(n)},e.prototype.labelXOptions=function(e,t,i,r){return{id:this.bulletChart.svgObject.id+"_AxisLabel_"+r,anchor:"middle",text:i,transform:"",x:e,y:t,baseLine:"",labelRotation:0}},e.prototype.renderYAxisLabels=function(e,t){var r,o,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),a=this.bulletChart,s=a.locale,l=a.enableRtl,h=(a.tickPosition===a.labelPosition?a.majorTickLines.height:0)+10,c=a.initialClipRect.y+(l?0:a.initialClipRect.height),d=a.initialClipRect.x+(a.opposedPosition?a.initialClipRect.width+("Inside"===a.labelPosition?-(h+10):h):"Inside"===a.labelPosition?h+10:-h),p=a.minimum,u=a.maximum,g=a.interval,y=s&&this.bulletChart.enableGroupSeparator,m=a.labelStyle.color||a.themeStyle.labelFontColor,v=this.getFormat(this.bulletChart),f=null!==v.match("{value}");this.format=this.bulletChart.intl.getNumberFormat({format:f?"":v,useGrouping:this.bulletChart.enableGroupSeparator});var b=a.initialClipRect.y+(a.enableRtl?0:a.initialClipRect.height),x=i.measureText(this.formatValue(this,f,v,this.bulletChart.maximum),a.labelStyle).width/2,w=i.measureText(this.formatValue(this,f,v,this.bulletChart.maximum),a.labelStyle).height/3;c+=w;for(var S=p;S<=u;S+=g){o=a.enableRtl?S===u:S===p,a.labelStyle.useRangeColor&&(m=this.bindingRangeStrokes(c-w-(o?this.bulletChart.majorTickLines.width/2:0),b,this.bulletChart.orientation,a.enableRtl)),r=y?S.toLocaleString(s):this.formatValue(this,f,v,S);var C=this.labelXOptions(d-(this.bulletChart.opposedPosition?-x:x),c,r,S),P=i.textElement(C,this.bulletChart.labelStyle,m,t);n.appendChild(P),c+=l?e:-e}t.appendChild(n)},e.prototype.getFormat=function(e){return e.labelFormat?e.labelFormat:""},e.prototype.formatValue=function(e,t,i,r){return t?i.replace("{value}",e.format(r)):e.format(r)},e}();!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"},e.tooltipLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.dataLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.titleFont={size:"15px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"},e.subTitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"}}(e.BulletChartTheme||(e.BulletChartTheme={}));var gs,ys=function(){function e(e){this.comparative=[],this.dataSource=e.dataSource,this.isVertical="Vertical"===e.orientation,this.isTicksInside="Inside"===e.tickPosition,this.isLabelsInside="Inside"===e.labelPosition,this.isHorizontal="Horizontal"===e.orientation,this.isLeft="Left"===e.titlePosition,this.isRight="Right"===e.titlePosition,this.isTop="Top"===e.titlePosition,this.location=10,this.featureBarBounds=[],this.majorTickSize=e.majorTickLines.height,this.labelOffset=15,this.labelSize=12,this.bulletChart=e,this.isLabelBelow=!this.bulletChart.opposedPosition,this.scaleOrientation=this.bulletChart.orientation,this.rangeColor=[]}return e.prototype.drawScaleGroup=function(e){var t=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_rangeGroup"}),r=this.bulletChart.maximum,o=this.bulletChart.ranges;this.scaleSettingsGroup=e;var n,a=this.bulletChart,s=a.enableRtl,l=a.initialClipRect,h=l.x+(s&&"Horizontal"===a.orientation?l.width:0),c=l.y+(s||"Vertical"!==a.orientation?0:l.height),d=0;a.rangeCollection=[];for(var p=0,u="Horizontal"===a.orientation?l.width:l.height,g="Horizontal"===a.orientation?l.height:l.width,y=0;y<o.length;y++){d=u*((o[y].end-p)/r),"Horizontal"===a.orientation?h-=s?d:0:c-=s?0:d,n=new Di(a.svgObject.id+"_range_"+y,o[y].color||this.bulletChart.themeStyle.rangeStrokes[y].color,{width:1},o[y].opacity,new i.Rect(h,c,"Horizontal"===a.orientation?d:g,"Horizontal"===a.orientation?g:d));var m=a.renderer.drawRectangle(n);t.appendChild(m),e.appendChild(t),"Horizontal"===a.orientation?h+=s?0:d:c+=s?d:0,a.rangeCollection.push(d),p=o[y].end}return this.bulletChart.rangeCollection},e.prototype.sortRangeCollection=function(e,t){return e-t},e.prototype.renderFeatureBar=function(e){0!==e&&this.renderCommonFeatureBar(e,this.isHorizontal)},e.prototype.renderCommonFeatureBar=function(e,r){for(var o,n,a,s,l=this.bulletChart,h=r?l.initialClipRect.y+l.initialClipRect.height:l.initialClipRect.x,c=l.renderer.createGroup({id:l.svgObject.id+"_featureGroup"}),d=(r?l.initialClipRect.height:l.initialClipRect.width)/e,p=0;p<e;p++){if(a=l.dataSource[p],o=a[l.categoryField],n=r?h-d*p-(d+l.valueHeight)/2:h+d*p+d/2-l.valueHeight/2,s=this.calculateFeatureMeasureBounds(a[l.valueField],o,r),a&&"Dot"===l.type){var u=a[l.valueField];s.pointX=r?s.pointX+(u>0&&!l.enableRtl||u<0&&l.enableRtl?s.width:0)-3:s.pointX+(u>0&&l.enableRtl||u<0&&!l.enableRtl?s.width:0)-3,s.width=6}if(s){var g=r?this.featureBar(s.pointX,n,s.width,p):this.verticalFeatureBar(n,s.pointX,s.width,p);if(c.appendChild(g),this.feature=g,this.scaleSettingsGroup.appendChild(c),this.featureBarBounds[p]={x:s.pointX,y:n,width:s.width,height:l.valueHeight},!t.isNullOrUndefined(o)){var y=i.measureText(o,l.categoryLabelStyle),m=r?y.width:y.height,v=l.initialClipRect,f=void 0,b=void 0;r?(f=l.enableRtl?v.x+v.width+5+m/2:v.x-5-m/2,b=this.drawcategory(f,n,o)):(f=l.enableRtl?v.y-5-m/2:v.y+v.height+5+m/2,b=this.drawcategory(n+l.valueHeight/2,f,o)),i.textElement(b,l.categoryLabelStyle,l.categoryLabelStyle.color||l.themeStyle.categoryFontColor,this.scaleSettingsGroup)}}l.animation.enable&&this.doValueBarAnimation()}},e.prototype.featureBar=function(e,t,r,o){var n=new Di(this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new i.Rect(e,t,r,this.bulletChart.valueHeight)),a=this.bulletChart.renderer.drawRectangle(n);return a.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),a.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,a},e.prototype.verticalFeatureBar=function(e,t,r,o){var n=new Di(this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new i.Rect(e,t,this.bulletChart.valueHeight,r)),a=this.bulletChart.renderer.drawRectangle(n);return a.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),a.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,a},e.prototype.drawcategory=function(e,t,i){return{id:"",anchor:"middle",x:e,y:t+this.bulletChart.valueHeight,transform:"",text:i,baseLine:"",labelRotation:0}},e.prototype.renderComparativeSymbol=function(e){0!==e&&this.renderCommonComparativeSymbol(e,this.isHorizontal)},e.prototype.renderCommonComparativeSymbol=function(e,t){for(var i,r,o,n,a,s,l=this.bulletChart,h=l.initialClipRect,c=t?h.width:h.height,d=t?h.y+h.height:h.x,p=l.renderer.createGroup({id:l.svgObject.id+"_comparativeGroup"}),u=l.minimum,g=l.maximum,y=g-u,m=l.targetWidth,v=t?h.x-m/2:h.y+h.height,f=[],b=l.targetTypes,x="Rect",w=b.length,S=(t?h.height:h.width)/e,C=0;C<e;C++){i=l.dataSource[C][l.targetField],f=f.concat(i);for(var P=0;P<f.length;P++)x=b[P%w],f[P]>=u&&f[P]<=g&&(r=(a=t?d-S*C-S/2:d+S*C+S/2)-1.5*m,o=a+1.5*m,a=c/(y/(y-(g-f[P]))),n=t?v+(l.enableRtl?c-a:a):v-(l.enableRtl?c-a:a),s=this.getTargetElement(x,t,n,r,o,f[P],C),this.comparative.push(s),p.appendChild(s),r=0,o=0),this.scaleSettingsGroup.appendChild(p);f=[],l.animation.enable&&this.doTargetBarAnimation(0)}},e.prototype.getTargetElement=function(e,t,r,o,n,a,s){var l,h,c=this.bulletChart,d="Cross"===e?c.targetWidth-1:1,p="Circle"===e?c.targetWidth-1:c.targetWidth,u=t?r+p/2:o+(n-o)/2,g=t?o+(n-o)/2:r,y=c.svgObject.id+"_ComparativeMeasure_"+s,m=c.svgObject.id+"_ComparativeMeasure";if("Rect"===e)l=t?this.compareMeasure(r,o,n,s,a):this.compareVMeasure(o,n,r,s),h=c.renderer.drawLine(l);else if("Circle"===e)l=new Fi(y,c.targetColor,{width:1,color:c.targetColor||"black"},1,u,g,p),h=c.renderer.drawCircle(l);else{var v="M "+(u-p)+" "+(g-p)+" L "+(u+p)+" "+(g+p)+" M "+(u-p)+" "+(g+p)+" L "+(u+p)+" "+(g-p);l=new i.PathOption(y,"transparent",d,c.targetColor,1,"",v),h=c.renderer.drawPath(l)}return h.setAttribute("class",m),h},e.prototype.compareMeasure=function(e,t,i,r,o){var n=this.bulletChart;return{class:n.svgObject.id+"_ComparativeMeasure",id:n.svgObject.id+"_ComparativeMeasure_"+r,x1:o===n.maximum?e-n.targetWidth/2:o===n.minimum?e+n.targetWidth/2:e,y1:t,x2:o===n.maximum?e-n.targetWidth/2:o===n.minimum?e+n.targetWidth/2:e,y2:i,"stroke-width":n.targetWidth,stroke:n.targetColor||"black"}},e.prototype.compareVMeasure=function(e,t,i,r){var o=this.bulletChart;return{class:o.svgObject.id+"_ComparativeMeasure",id:o.svgObject.id+"_ComparativeMeasure_"+r,x1:e,y1:i,x2:t,y2:i,"stroke-width":o.targetWidth,stroke:o.targetColor||"black"}},e.prototype.calculateFeatureMeasureBounds=function(e,r,o){var n=this.bulletChart,a=n.minimum;if((e=e<a&&a<=0?a:e)>=a){var s=void 0,l=void 0,h=void 0,c=o?n.initialClipRect.x:n.initialClipRect.y,d=o?n.initialClipRect.width:n.initialClipRect.height,p=n.maximum-n.minimum,u=n.maximum-e,g=(n.enableRtl?"backward":"forward")+this.scaleOrientation.toLowerCase();r=t.isNullOrUndefined(r)?"":r;var y=i.measureText(r.toString(),n.labelStyle).width;switch(g){case"forwardhorizontal":case"backwardvertical":s=c+(a>0?0:d/p*Math.abs(a)),h=d/(p/(a>0?p-u:e)),e<0&&(s-=h=Math.abs(h)),h=s+h<c+d?h:c+d-s,l=c-("forwardhorizontal"===g?y/2+5:this.labelOffset);break;default:s=c+(d-d/(p/(p-u))),h=a>0?d/(p/(p-u)):d/(p/e),e<0&&(s-=h=Math.abs(h)),s<c&&(h=s+h-c,s=c),l=c+d+("backwardhorizontal"===g?y/2+5:5)}return{pointX:s,width:h,lastPointX:l}}return null},e.prototype.doValueBarAnimation=function(){var e=this.feature;if(!e)return null;var i,r,o,n,a,s=this.bulletChart.animation,l=this.bulletChart.animateSeries?this.bulletChart.animation.duration:s.duration,h=Z("Linear"),c=this.bulletChart.dataSource<0,d=e.getBoundingClientRect().height,p=e.getBoundingClientRect().width;"Horizontal"===this.bulletChart.orientation&&e&&(r=parseInt(e.getAttribute("height"),10),i=parseInt(e.getAttribute("x"),10),n=c?r:r+d,o=i),e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:l,delay:s.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",p=p||1,a=h(t.timeStamp-t.delay,0,p,t.duration),e.setAttribute("transform","translate("+o+" "+n+") scale("+a/p+", 1) translate("+-o+" "+-n+")"))},end:function(){e.setAttribute("transform","translate(0,0)"),e.style.visibility="visible"}})},e.prototype.doTargetBarAnimation=function(e){var t,i,r=this.comparative[e];if(!r)return null;"Horizontal"===this.bulletChart.orientation&&r&&(i=parseFloat(r.getAttribute("y1"))+parseFloat(r.getAttribute("y2")),t=parseFloat(r.getAttribute("x1"))),r.style.visibility="hidden",this.animateRect(r,t,i,e+1)},e.prototype.animateRect=function(e,i,r,o){var n,a=this,s=Z("Linear"),l=this.bulletChart.animation,h=this.comparative.length,c=this.bulletChart.animateSeries?this.bulletChart.animation.duration:l.duration;new t.Animation({}).animate(e,{duration:c,delay:l.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",n=s(t.timeStamp-t.delay,0,1,t.duration),e.setAttribute("transform","translate("+i+" "+r/2+") scale(1,"+n+") translate("+-i+" "+-r/2+")"))},end:function(){e.setAttribute("transform","translate(0,0)"),o<h&&a.doTargetBarAnimation(o+1)}})},e}(),ms=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},fs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(null)],i.prototype,"end",void 0),vs([t.Property(1)],i.prototype,"opacity",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(null)],i.prototype,"index",void 0),vs([t.Property(null)],i.prototype,"name",void 0),vs([t.Property("Rectangle")],i.prototype,"shape",void 0),vs([t.Property("")],i.prototype,"legendImageUrl",void 0),i}(t.ChildProperty),bs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(12)],i.prototype,"height",void 0),vs([t.Property(1)],i.prototype,"width",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),xs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(8)],i.prototype,"height",void 0),vs([t.Property(1)],i.prototype,"width",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),ws=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property("Normal")],i.prototype,"fontStyle",void 0),vs([t.Property("16px")],i.prototype,"size",void 0),vs([t.Property("")],i.prototype,"color",void 0),vs([t.Property("Normal")],i.prototype,"fontWeight",void 0),vs([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),vs([t.Property("Center")],i.prototype,"textAlignment",void 0),vs([t.Property("None")],i.prototype,"textOverflow",void 0),vs([t.Property(1)],i.prototype,"opacity",void 0),vs([t.Property(!0)],i.prototype,"enableTrim",void 0),vs([t.Property(null)],i.prototype,"maximumTitleWidth",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),Ss=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"enable",void 0),vs([t.Property(null)],r.prototype,"fill",void 0),vs([t.Complex(e.BulletChartTheme.tooltipLabelFont,ws)],r.prototype,"textStyle",void 0),vs([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),vs([t.Property(null)],r.prototype,"template",void 0),r}(t.ChildProperty),Cs=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"enable",void 0),vs([t.Complex(e.BulletChartTheme.dataLabelFont,ws)],r.prototype,"labelStyle",void 0),r}(t.ChildProperty),Ps=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"visible",void 0),vs([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),vs([t.Property(8)],r.prototype,"padding",void 0),vs([t.Property("Center")],r.prototype,"alignment",void 0),vs([t.Property(10)],r.prototype,"shapeHeight",void 0),vs([t.Property(10)],r.prototype,"shapeWidth",void 0),vs([t.Complex(e.BulletChartTheme.legendLabelFont,ws)],r.prototype,"textStyle",void 0),vs([t.Property("Auto")],r.prototype,"position",void 0),vs([t.Complex({left:0,right:0,top:0,bottom:0},Ut)],r.prototype,"margin",void 0),vs([t.Complex({},Yt)],r.prototype,"border",void 0),vs([t.Property(5)],r.prototype,"shapePadding",void 0),vs([t.Property("transparent")],r.prototype,"background",void 0),vs([t.Property(1)],r.prototype,"opacity",void 0),vs([t.Property(3)],r.prototype,"tabIndex",void 0),r}(t.ChildProperty),Ls=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ms=function(r){function o(e,t){var o=r.call(this,e,t)||this;return o.bulletid=57726,o.animateSeries=!0,o.padding=5,o.leftSize=0,o.rightSize=0,o.topSize=0,o.bottomSize=0,o.maxLabelSize=new i.Size(0,0),o.maxTitleSize=new i.Size(0,0),o.intervalDivs=[10,5,2,1],o}return Ls(o,r),o.prototype.preRender=function(){this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateValues(),this.setCulture(),this.wireEvents()},o.prototype.initPrivateValues=function(){if(this.delayRedraw=!1,this.scale=new ys(this),this.bulletAxis=new us(this),""===this.element.id){var e=document.getElementsByClassName("e-BulletChart").length;this.element.id="BulletChart_"+this.bulletid+"_"+e}},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.render=function(){var e=this,t={bulletChart:this.isBlazor?{}:this,theme:this.theme,name:"load"};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.createSvg(e),e.findRange(),e.bulletChartLegendModule&&e.legendSettings.visible&&(e.calculateVisibleElements(),e.bulletChartLegendModule.getLegendOptions(e.visibleRanges)),e.calculatePosition(),e.renderBulletElements();e.trigger("loaded",{bulletChart:window.Blazor?{}:e}),e.allowServerDataBinding=!0,e.renderComplete()})},o.prototype.setTheme=function(){this.themeStyle=lt(this.theme)},o.prototype.findRange=function(){if(this.minimum||(this.minimum=0),!this.maximum){this.maximum=0;for(e=0;e<this.ranges.length;e++)this.maximum=this.maximum>this.ranges[e].end?this.maximum:this.ranges[e].end}if(null===this.maximum)if(t.isNullOrUndefined(this.dataSource))this.maximum=10;else for(var e=0;e<Object.keys(this.dataSource).length;e++)this.dataSource[e][this.targetField]>this.dataSource[e][this.valueField]?this.maximum=this.maximum>this.dataSource[e][this.targetField]?this.maximum+this.interval:this.dataSource[e][this.targetField]+this.interval:this.maximum=this.maximum>this.dataSource[e][this.valueField]?this.maximum+this.interval:this.dataSource[e][this.valueField]+this.interval;this.interval||(this.interval=this.calculateNumericNiceInterval(this.maximum-this.minimum))},o.prototype.getActualDesiredIntervalsCount=function(e){var t="Horizontal"===this.orientation?e.width:e.height,i=3*("Horizontal"===this.orientation?.533:1);return i=Math.max(t*(i/100),1)},o.prototype.calculateNumericNiceInterval=function(e){for(var t=this.getActualDesiredIntervalsCount(this.availableSize),i=e/t,r=Math.pow(10,Math.floor(v(i,10))),o=0,n=this.intervalDivs;o<n.length;o++){var a=r*n[o];if(t<e/a)break;i=a}return i},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px",e.style.position="relative"}},o.prototype.createSvg=function(e){this.removeSvg(),e.renderer=new i.SvgRenderer(e.element.id),this.calculateAvailableSize(this),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height}),this.renderChartBackground()},o.prototype.renderChartBackground=function(){var e=new Di(this.element.id+"_ChartBorder",this.themeStyle.background,{width:this.border.width||0,color:this.border.color||"transparent"},1,new i.Rect(0,0,this.availableSize.width,this.availableSize.height));this.svgObject.appendChild(this.renderer.drawRectangle(e))},o.prototype.renderBulletElements=function(){var e=this.renderer.createGroup({id:this.svgObject.id+"_scaleGroup"});this.svgObject.appendChild(e),this.renderBulletChartTitle(),this.rangeCollection=this.scale.drawScaleGroup(e);var t=("Horizontal"===this.orientation?this.initialClipRect.width:this.initialClipRect.height)/((this.maximum-this.minimum)/this.interval);this.bulletAxis.renderMajorTickLines(t,e),this.bulletAxis.renderMinorTickLines(t,e),this.bulletAxis.renderAxisLabels(t,e),this.bulletChartRect.x="Left"===this.titlePosition||"Right"===this.titlePosition||"Vertical"===this.orientation?this.bulletChartRect.x:0;var i=this.element.id;if("g"!==this.element.tagName){var r=Fe(this.redraw,i+"_Secondary_Element")||this.createElement("div");r.id=i+"_Secondary_Element",be(!1,this.element,r,this.redraw)}this.tooltip.enable&&be(!1,this.svgObject,this.renderer.createGroup({id:i+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.bindData(),this.renderDataLabel(),this.renderBulletLegend(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},o.prototype.renderBulletLegend=function(){if(this.bulletChartLegendModule&&this.bulletChartLegendModule.legendCollections.length){this.bulletChartLegendModule.calTotalPage=!0;var e=this.bulletChartLegendModule.legendBounds;this.bulletChartLegendModule.renderLegend(this,this.legendSettings,e)}},o.prototype.bulletResize=function(){var e=this;this.animateSeries=!1;var t={chart:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)};return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);e.createSvg(e),t.currentSize=e.availableSize,e.trigger("resized",t),e.calculatePosition(),e.renderBulletElements()},500),!1},o.prototype.bindData=function(){null!=this.dataSource&&(this.dataCount=this.dataSource.length,this.drawMeasures(this.dataCount))},o.prototype.drawMeasures=function(e){this.scale.renderFeatureBar(e),this.scale.renderComparativeSymbol(e)},o.prototype.calculatePosition=function(){var e=this.margin,t=0,r=0,o=new i.Size(0,0);this.titleCollections=[],this.subTitleCollections=[];var n=0,a=0,s=5;if(this.title){this.titleCollections=Xe(this.title,this.titleStyle,this.titleStyle.maximumTitleWidth),t=i.measureText(this.title,this.titleStyle).height*this.titleCollections.length+5;for(var l=0,h=this.titleCollections;l<h.length;l++){var c=h[l];n=(o=i.measureText(c,this.titleStyle)).width>n?o.width:n,a=o.height>a?o.height:a}if(s+=a,this.subTitleCollections=Xe(this.subtitle,this.subtitleStyle,this.titleStyle.maximumTitleWidth),this.subtitle){for(var d=0,p=this.subTitleCollections;d<p.length;d++){var u=p[d];n=(o=i.measureText(u,this.subtitleStyle)).width>n?o.width:n,a=o.height>a?o.height:a}r=i.measureText(this.subtitle,this.subtitleStyle).height*this.subTitleCollections.length+5,s+=a}}this.maxTitleSize=new i.Size(n,"Vertical"===this.orientation?s:a),this.maxLabelSize=this.getMaxLabelWidth(),this.initialClipRect=this.getBulletBounds("Vertical"===this.orientation?s:n,t,r,e),this.bulletChartRect=new i.Rect(this.initialClipRect.x,this.initialClipRect.y,this.initialClipRect.width,this.initialClipRect.height),this.bulletChartLegendModule&&this.bulletChartLegendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,this.maxLabelSize)},o.prototype.getBulletBounds=function(e,t,r,o){var n=new i.Rect(0,0,0,0),a=this.enableRtl,s=this.labelPosition===this.tickPosition?5:0,l="Inside"===this.tickPosition?0:this.majorTickLines.height,h="Inside"===this.labelPosition?0:5+("Outside"===this.tickPosition?0:i.measureText(this.maximum.toString(),this.labelStyle).height),c=0,d=0,p=0,u=0,g=0,y=0,m=0,v=0,f=e,b=this.bulletAxis.getFormat(this),x=null!==b.match("{value}");this.bulletAxis.format=this.intl.getNumberFormat({format:x?"":b,useGrouping:this.enableGroupSeparator});var w,S=i.measureText(this.bulletAxis.formatValue(this.bulletAxis,x,b,this.maximum),this.labelStyle).width;switch("Horizontal"===this.orientation?(w=this.maxLabelSize.width,c=this.opposedPosition?l+h+s:0,d=this.opposedPosition?0:l+h+s,m=w&&!a?w:0,m+=f&&"Left"===this.titlePosition?15:0,v=w&&a?w:0,v+=f&&"Right"===this.titlePosition?5:0):(w=this.maxLabelSize.height,u=this.opposedPosition?l+s:0,u+=this.opposedPosition&&"Inside"!==this.labelPosition?S:0,p=this.opposedPosition?0:l+s,p+=this.opposedPosition||"Inside"===this.labelPosition?0:S,g=w&&a?w+5:0,y=w&&!a?w+5:0),this.titlePosition){case"Left":n.x=o.left+f+m+p,n.width=this.availableSize.width-o.right-n.x-v-u,n.y=o.top+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Right":n.x=o.left+m+p,n.width=this.availableSize.width-u-o.right-n.x-(f+5)-v,n.y=o.top+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Top":n.x=o.left+p+m,n.width=this.availableSize.width-o.right-n.x-v-u,n.y=o.top+(t+r)+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Bottom":n.x=o.left+p+m,n.y=o.top+c+g,n.width=this.availableSize.width-o.right-n.x-v-u,n.height=this.availableSize.height-n.y-y-o.bottom-d-(t+r)}return n},o.prototype.getMaxLabelWidth=function(){if(this.maxLabelSize=new i.Size(0,0),!this.categoryField)return this.maxLabelSize;for(var e,t=0,r=Object.keys(this.dataSource).length;t<r;t++)(e=i.measureText(this.dataSource[t][this.categoryField]||"",this.categoryLabelStyle)).width>this.maxLabelSize.width&&(this.maxLabelSize.width=e.width),e.height>this.maxLabelSize.height&&(this.maxLabelSize.height=e.height);return this.maxLabelSize},o.prototype.calculateVisibleElements=function(){var e,t=this.ranges;this.visibleRanges=[];for(var i=0,r=t.length;i<r;i++)(e=t[i]).index=i,e.color=e.color,this.visibleRanges.push(e),t[i]=e},o.prototype.renderBulletChartTitle=function(){var e=this.margin,t=0,r=0,o="middle",n="",a=this.titleStyle.textAlignment,s=i.measureText(this.title,this.titleStyle),l=this.subtitle?i.measureText(this.subtitle,this.subtitleStyle):new i.Size(0,0);if(this.title){if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=this.findHorizontalAlignment(e),o="Far"===a?"end":"Near"===a?"start":"middle",r=e.top+s.height/2+5;break;case"Bottom":t=this.findHorizontalAlignment(e),o="Far"===a?"end":"Near"===a?"start":"middle",r=this.availableSize.height-e.bottom-s.height/3+10-(l.height?l.height+5:0);break;case"Left":o="end",t=e.left+this.maxTitleSize.width,r=this.margin.top+this.availableSize.height/2-s.height/3-(l.height?l.height:0);break;case"Right":o="start",t=this.availableSize.width-e.right-this.maxTitleSize.width+5,r=this.margin.top+this.availableSize.height/2-s.height/3-(l.height?l.height:0)}else{switch(this.titlePosition){case"Top":t=this.availableSize.width/2+10,r=this.margin.top+s.height/2+5;break;case"Bottom":t=this.availableSize.width/2,r=this.availableSize.height-this.margin.bottom-s.height/3+10-(l.height?l.height+5:0);break;case"Left":r=this.findVerticalAlignment(e),o="Far"===a?"start":"Near"===a?"end":"middle",t=e.left;break;case"Right":t=this.availableSize.width-e.right-s.height/3,o="Far"===a?"start":"Near"===a?"end":"middle",r=this.findVerticalAlignment(e)}n="Left"===this.titlePosition?"rotate(-90,"+t+","+r+")":"Right"===this.titlePosition?"rotate(90,"+t+","+r+")":""}var h=new i.TextOption(this.element.id+"_BulletChartTitle",t,r,o,this.titleCollections,n,"auto"),c=Ve(this.renderer,h,this.titleStyle,this.titleStyle.color||this.themeStyle.titleFontColor,this.svgObject);c&&(c.setAttribute("aria-label",this.title),c.setAttribute("tabindex",this.tabIndex.toString())),this.subtitle&&this.renderBulletChartSubTitle(t,r,o)}},o.prototype.renderDataLabel=function(){var e,t,r,o=0,n=0,a=this.enableRtl,s=this.labelFormat?this.labelFormat:"",l=null!==s.match("{value}");if(this.dataLabel.enable)for(var h=0,c=Object.keys(this.dataSource).length;h<c;h++){t=this.dataSource[h],r=this.scale.featureBarBounds[h];var d=t[this.valueField].toString();this.format=this.intl.getNumberFormat({format:l?"":s,useGrouping:this.enableGroupSeparator}),d=l?s.replace("{value}",this.format(d)):d;var p=i.measureText(d,this.dataLabel.labelStyle),u=p.width,g=p.height;"Horizontal"===this.orientation?(e="Rect"===this.type?"end":a?"end":"start",o=r.x+(a?"Rect"===this.type?u+10:-10:r.width)+("Rect"===this.type?-5:5),n=r.y+r.height/2):(e="middle",o=r.y+r.height/2,n=r.x+(a?r.width+("Rect"===this.type?-g:g):0)+("Rect"===this.type?10:-10));var y=new i.TextOption(this.element.id+"_DataLabel_"+h,o,n,e,d,"","middle");Ve(this.renderer,y,this.dataLabel.labelStyle,this.dataLabel.labelStyle.color||this.themeStyle.dataLabelFontColor,this.svgObject)}},o.prototype.findHorizontalAlignment=function(e){var t=0;switch(this.titleStyle.textAlignment){case"Center":t=(this.availableSize.width-e.left-e.right)/2;break;case"Near":t=e.left;break;case"Far":t=this.availableSize.width-e.right}return t},o.prototype.findVerticalAlignment=function(e){var t=0;switch(this.titleStyle.textAlignment){case"Center":t=(this.availableSize.height-e.top-e.bottom)/2;break;case"Near":t=e.top;break;case"Far":t=this.availableSize.height-e.bottom}return t},o.prototype.renderBulletChartSubTitle=function(e,t,r){var o=this.margin,n="",a=i.measureText(this.subtitle,this.subtitleStyle);if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=t+a.height+2.5;break;case"Bottom":t=this.availableSize.height-o.bottom-a.height/3+5;break;case"Left":case"Right":t=t+a.height+2.5}else{switch(this.titlePosition){case"Top":t=t+a.height+2.5;break;case"Bottom":t=this.availableSize.height-o.bottom-a.height/3+5;break;case"Left":e+=a.height+2.5;break;case"Right":e-=a.height+2.5}n="Left"===this.titlePosition?"rotate(-90,"+e+","+t+")":"Right"===this.titlePosition?"rotate(90,"+e+","+t+")":""}var s=new i.TextOption(this.element.id+"_BulletChartSubTitle",e,t,r,this.subTitleCollections,n,"auto"),l=Ve(this.renderer,s,this.subtitleStyle,this.subtitleStyle.color||this.themeStyle.subTitleFontColor,this.svgObject);l&&(l.setAttribute("aria-label",this.title),l.setAttribute("tabindex",this.tabIndex.toString()))},o.prototype.calculateAvailableSize=function(e){var t=this.element.clientWidth||this.element.offsetWidth||200,r="Vertical"===this.orientation?450:"Left"===this.titlePosition||"Right"===this.titlePosition?83:126,o=this.element.clientHeight||r;e.availableSize=new i.Size(Be(e.width,t)||t,Be(e.height,o)||o)},o.prototype.removeSvg=function(){var e=document.getElementById(this.element.id+"_svg");e&&t.remove(e)},o.prototype.getPersistData=function(){var e=["loaded"];return this.addOnPersist(e)},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.bulletMouseDown),t.EventHandler.remove(this.element,i,this.bulletMouseMove),t.EventHandler.remove(this.element,r,this.bulletMouseLeave),t.EventHandler.remove(this.element,"click",this.bulletChartOnMouseClick),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.bulletMouseMove,this),t.EventHandler.add(this.element,e,this.bulletMouseLeave,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.bulletMouseDown,this),t.EventHandler.add(this.element,"click",this.bulletChartOnMouseClick,this),this.resizeBound=this.bulletResize.bind(this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.setStyle(this.element)},o.prototype.setStyle=function(e){e.style.position="relative",e.style.display="block"},o.prototype.bulletMouseMove=function(e){var i=e.clientX,r=e.clientY;this.setPointMouseXY(i,r);var o=e.target.id,n=e.target.className.baseVal;if(!(n===this.svgObject.id+"_FeatureMeasure"&&(this.svgObject.id,0)||t.isNullOrUndefined(this.dataSource)))for(var a=0;a<Object.keys(this.dataSource).length;a++)document.getElementById(this.svgObject.id+"_FeatureMeasure_"+a).setAttribute("opacity","1"),document.getElementById(this.svgObject.id+"_ComparativeMeasure_"+a).setAttribute("opacity","1");if(!this.isTouchEvent(e)){var s="tooltipDiv"+this.element.id,l=document.getElementById(s);l&&(this.isReact&&this.clearTemplate(),t.remove(l)),this.bulletTooltipModule&&(this.bulletTooltipModule._elementTooltip(e,n,o,this.mouseX),this.bulletTooltipModule._displayTooltip(e,n,o,this.mouseX,this.mouseY))}},o.prototype.setPointMouseXY=function(e,t){var i=he(this.svgObject.id).getBoundingClientRect(),r=this.element.getBoundingClientRect();this.mouseX=e-r.left-Math.max(i.left-r.left,0),this.mouseY=t-r.top-Math.max(i.top-r.top,0)},o.prototype.bulletMouseLeave=function(e){if(!this.isTouchEvent(e)){var i=document.getElementById(".tooltipDiv"+this.element.id);i&&(this.isReact&&this.clearTemplate(),t.remove(i))}},o.prototype.isTouchEvent=function(e){return"touch"===e.pointerType||e.type.indexOf("touch")>-1},o.prototype.bulletMouseDown=function(e){if(this.isTouchEvent(e)){this.isReact&&this.clearTemplate(),t.remove(document.getElementById("tooltipDiv"+this.element.id));var i=e.target.id,r=e.target.className.baseVal;this.bulletTooltipModule&&(this.bulletTooltipModule._elementTooltip(e,r,i,this.mouseX),this.bulletTooltipModule._displayTooltip(e,r,i,this.mouseX,this.mouseY))}},o.prototype.bulletChartOnMouseClick=function(e){var t=e.target;return this.trigger("bulletChartMouseClick",{target:t.id,x:this.mouseX,y:this.mouseY}),this.notify("click",e),!1},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.export=function(e,t,i,r,o,n,a){r=r||[this],new xr(this).export(e,t,i,r,o,n,a)},o.prototype.onPropertyChanged=function(e,t){var i=!1,o=!1;if(this.animateSeries=!1,!this.delayRedraw){for(var n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"height":case"width":this.createSvg(this),o=!0;break;case"subtitle":case"title":o=!0;break;case"tickPosition":case"labelPosition":case"titlePosition":i=!0;break;case"minimum":case"maximum":case"interval":o=!0;break;case"majorTickLines":case"minorTickLines":case"type":case"ranges":case"valueFill":case"targetColor":o=!0;break;case"titleStyle":e.titleStyle?o=!0:i=!0;break;case"subtitleStyle":e.subtitleStyle&&(e.subtitleStyle.size||e.subtitleStyle.textOverflow)?o=!0:i=!0;break;case"border":case"opposedPosition":i=!0;break;case"dataSource":this.bindData(),o=!0;break;case"theme":this.animateSeries=!0;break;case"locale":case"currencyCode":r.prototype.refresh.call(this)}if(!o&&i){this.removeSvg(),this.renderBulletElements();s="Blazor";this.trigger("loaded",{bulletChart:window[s]?{}:this})}if(o){this.render();var s="Blazor";this.trigger("loaded",{bulletChart:window[s]?{}:this}),this.redraw=!1}}},o.prototype.requiredModules=function(){for(var e,t=[],i=0;i<this.ranges.length;i++)null!==this.ranges[i].name&&(e=!0);return this.isLegend=this.legendSettings.visible&&(e||!!this.isLegend||""!==this.targetField||""!==this.valueField),this.tooltip.enable&&t.push({member:"BulletTooltip",args:[this]}),this.isLegend&&t.push({member:"BulletChartLegend",args:[this]}),t},o.prototype.getModuleName=function(){return"bulletChart"},o.prototype.destroy=function(){this.unWireEvents(),r.prototype.destroy.call(this),this.removeSvg(),this.svgObject=null,this.element.classList.remove("e-BulletChart"),this.element.innerHTML=""},Rs([t.Property(null)],o.prototype,"width",void 0),Rs([t.Property(null)],o.prototype,"height",void 0),Rs([t.Property(null)],o.prototype,"locale",void 0),Rs([t.Complex({},bs)],o.prototype,"majorTickLines",void 0),Rs([t.Complex({},xs)],o.prototype,"minorTickLines",void 0),Rs([t.Property(null)],o.prototype,"minimum",void 0),Rs([t.Property(null)],o.prototype,"maximum",void 0),Rs([t.Property(null)],o.prototype,"interval",void 0),Rs([t.Property(4)],o.prototype,"minorTicksPerInterval",void 0),Rs([t.Complex(e.BulletChartTheme.axisLabelFont,ws)],o.prototype,"labelStyle",void 0),Rs([t.Complex(e.BulletChartTheme.axisLabelFont,ws)],o.prototype,"categoryLabelStyle",void 0),Rs([t.Property("")],o.prototype,"labelFormat",void 0),Rs([t.Property("")],o.prototype,"title",void 0),Rs([t.Complex(e.BulletChartTheme.titleFont,ws)],o.prototype,"titleStyle",void 0),Rs([t.Property("")],o.prototype,"subtitle",void 0),Rs([t.Complex(e.BulletChartTheme.subTitleFont,ws)],o.prototype,"subtitleStyle",void 0),Rs([t.Property("Horizontal")],o.prototype,"orientation",void 0),Rs([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),Rs([t.Complex({},Ss)],o.prototype,"tooltip",void 0),Rs([t.Collection([{end:null,opacity:1,color:""},{end:null,opacity:1,color:""},{end:null,opacity:1,color:""}],fs)],o.prototype,"ranges",void 0),Rs([t.Property("Outside")],o.prototype,"labelPosition",void 0),Rs([t.Property("Outside")],o.prototype,"tickPosition",void 0),Rs([t.Property("Top")],o.prototype,"titlePosition",void 0),Rs([t.Property(!1)],o.prototype,"opposedPosition",void 0),Rs([t.Property("Material")],o.prototype,"theme",void 0),Rs([t.Complex({},qt)],o.prototype,"animation",void 0),Rs([t.Complex({},Cs)],o.prototype,"dataLabel",void 0),Rs([t.Complex({},Ps)],o.prototype,"legendSettings",void 0),Rs([t.Property(!1)],o.prototype,"enableGroupSeparator",void 0),Rs([t.Complex({top:15,bottom:10,left:15,right:15},Ut)],o.prototype,"margin",void 0),Rs([t.Property(5)],o.prototype,"targetWidth",void 0),Rs([t.Property("#191919")],o.prototype,"targetColor",void 0),Rs([t.Property(6)],o.prototype,"valueHeight",void 0),Rs([t.Property(null)],o.prototype,"valueFill",void 0),Rs([t.Complex({color:"transparent",width:0},Yt)],o.prototype,"valueBorder",void 0),Rs([t.Property(null)],o.prototype,"dataSource",void 0),Rs([t.Property(null)],o.prototype,"query",void 0),Rs([t.Property(null)],o.prototype,"categoryField",void 0),Rs([t.Property("Rect")],o.prototype,"type",void 0),Rs([t.Property("")],o.prototype,"valueField",void 0),Rs([t.Property("")],o.prototype,"targetField",void 0),Rs([t.Property(["Rect","Cross","Circle"])],o.prototype,"targetTypes",void 0),Rs([t.Property(1)],o.prototype,"tabIndex",void 0),Rs([t.Event()],o.prototype,"tooltipRender",void 0),Rs([t.Event()],o.prototype,"load",void 0),Rs([t.Event()],o.prototype,"loaded",void 0),Rs([t.Event()],o.prototype,"bulletChartMouseClick",void 0),Rs([t.Event()],o.prototype,"legendRender",void 0),Rs([t.Event()],o.prototype,"beforePrint",void 0),o=Rs([t.NotifyPropertyChanges],o)}(t.Component),As=function(){function i(e){this.control=e,this.elementId=e.element.id,this.bulletAxis=new us(this.control)}return i.prototype._elementTooltip=function(t,i,r,o){var n=this.control.createElement("div");n.id="tooltip",n.className="tooltipDiv";var a=t.target,s=o+20,l=t.clientY,h="",c=this.control.tooltip.textStyle.fontStyle?this.control.tooltip.textStyle.fontStyle:e.BulletChartTheme.tooltipLabelFont.fontStyle,d=this.control.tooltip.fill?this.control.tooltip.fill:this.control.themeStyle.tooltipFill,p="left:"+s+"px;top:"+l+'px;display: block; position: absolute; "z-index": "13000",cursor: default;font-family: Segoe UI;color:'+(e.BulletChartTheme.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel)+"; font-size: 13px; background-color:"+d+"; border: 1px solid #707070;font-style:"+c+";";n.setAttribute("style",p),i===this.control.svgObject.id+"_Caption"?h=a.textContent===this.control.title?"":this.control.title:i===this.control.svgObject.id+"_SubTitle"&&(h=a.textContent===this.control.subtitle?"":this.control.subtitle),""!==h&&(n.innerHTML=" "+h+" ",document.body.insertAdjacentElement("afterbegin",n))},i.prototype._displayTooltip=function(i,r,o,n,a){if("undefined"!==r&&this.control.tooltip.enable&&(r===this.control.svgObject.id+"_FeatureMeasure"||r===this.control.svgObject.id+"_ComparativeMeasure")){var s=void 0,l=void 0,h=void 0,c=void 0,d=[],p=void 0,u=void 0,g=this.bulletAxis.getFormat(this.control),y=null!==g.match("{value}");h=o.substring(o.lastIndexOf("_")+1);var m=[];this.bulletAxis.format=this.bulletAxis.bulletChart.intl.getNumberFormat({format:y?"":g,useGrouping:this.bulletAxis.bulletChart.enableGroupSeparator}),c=this.control.dataSource[h][this.control.valueField],d=d.concat(this.control.dataSource[h][this.control.targetField]),p=this.control.dataSource[h][this.control.categoryField];var v=c?c.toString():"",f=d?d.toString():"",b=p?p.toString():"";v=this.bulletAxis.formatValue(this.bulletAxis,y,g,+c);for(L=0;L<d.length;L++)m=m.concat(this.bulletAxis.formatValue(this.bulletAxis,y,g,+d[L]));s={value:v,target:m,category:b=this.bulletAxis.formatValue(this.bulletAxis,y,g,+p)},l={value:v,target:f,category:b};var x="position: absolute; z-index: 13000; display: block;";0===document.getElementsByClassName("tooltipDiv"+this.control.element.id).length&&((u=this.control.createElement("div")).id="tooltipDiv"+this.control.element.id,u.setAttribute("style",x),document.getElementById(this.control.element.id+"_Secondary_Element").appendChild(u));var w={value:s.value,target:s.target,name:"tooltipRender"};if(""!==this.control.tooltip.template&&null!=this.control.tooltip.template){this.updateTemplateFn();for(var S=this.control.createElement("div",{id:this.control.element.id+"parent_template"}),C=this.templateFn(l,this.control,"template",S.id+"_blazorTemplate","",null,S);C&&C.length>0;)t.isBlazor()||1===C.length?(S.appendChild(C[0]),C=null):S.appendChild(C[0]);w.template=S.innerHTML,this.control.trigger("tooltipRender",w),S.innerHTML=w.template,u.appendChild(S)}else{for(var P="Value : "+w.value,L=0;L<w.target.length;L++)P+="<br/> Target"+(0===L?"":"_"+L)+" : "+w.target[L];w.text=P,this.control.trigger("tooltipRender",w),u.innerHTML=w.text,u.style.font=this.control.tooltip.textStyle.fontStyle?this.control.tooltip.textStyle.fontStyle:e.BulletChartTheme.tooltipLabelFont.fontStyle,u.style.color=e.BulletChartTheme.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel,u.style.fontSize=e.BulletChartTheme.titleFont.size}var R=this.control.tooltip.fill?this.control.tooltip.fill:this.control.themeStyle.tooltipFill,M=this.control.tooltip.border.width?this.control.tooltip.border.width:1,A=this.control.tooltip.border.color?this.control.tooltip.border.color:"Black",k=n,T=a;if(k=k+Be(u.getAttribute("width"),this.control.containerWidth)<window.innerWidth?k:Be(u.getAttribute("width"),this.control.containerWidth),T=T+Be(u.getAttribute("height"),this.control.containerHeight)<window.innerHeight?T:Be(u.getAttribute("height"),this.control.containerHeight),void 0!==k&&null!==k||(k=n),void 0!==T&&null!==T||(T=i.clientY),""!==this.control.tooltip.template&&null!=this.control.tooltip.template)u.setAttribute("style","position: absolute;left:"+(k+20)+"px;top:"+(T+20)+"px;"),t.isBlazor()&&t.updateBlazorTemplate(this.control.element.id+"parent_template_blazorTemplate","Template",this.control.tooltip);else{var _=x+"left:"+(k+20)+"px;top:"+(T+20)+"px;-webkit-border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px;-o-border-radius: 5px 5px 5px 5px;border-radius: 5px 5px 5px 5px;background-color:"+R+";color:"+u.style.color+"; border:"+M+"px Solid "+A+";padding-bottom: 7px;font-style:"+e.BulletChartTheme.tooltipLabelFont.fontStyle+"; padding-left: 10px; font-family: Segoe UI; padding-right: 10px; padding-top: 7px";u.setAttribute("style",_),r!==this.control.svgObject.id+"_FeatureMeasure"&&r!==this.control.svgObject.id+"_ComparativeMeasure"||document.getElementById(o).setAttribute("opacity","0.6")}this.control.isReact&&this.control.renderReactTemplates()}},i.prototype.updateTemplateFn=function(){if(this.control.tooltip.template)try{document.querySelectorAll(this.control.tooltip.template).length&&(this.templateFn=t.compile(document.querySelector(this.control.tooltip.template).innerHTML.trim()))}catch(e){this.templateFn=t.compile(this.control.tooltip.template)}},i.prototype.getModuleName=function(){return"BulletTooltip"},i.prototype.destroy=function(){},i}(),ks=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ts=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return ks(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this),this.chart.on(t.Browser.touchMoveEvent,this.bulletMouseMove,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd),this.chart.off(t.Browser.touchMoveEvent,this.bulletMouseMove))},r.prototype.bulletMouseMove=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e){this.legendCollections=[];for(var i,r=0,o=this.chart,n=0,a=e;n<a.length;n++){var s=a[n];null!==s.name&&(i=s.color?s.color:o.themeStyle.rangeStrokes[s.index].color,this.legendCollections.push(new mr(s.name,i,s.shape,this.chart.legendSettings.visible,null,s.legendImageUrl,null,!1,s.index,null)),r++)}if(null!==o.dataSource&&""!==o.valueField){i=o.valueFill||"black";l="Vertical"===o.orientation?"TargetRect":"ActualRect";this.legendCollections.push(new mr("Actual",i,l,this.chart.legendSettings.visible,null,"",null,!1,r++,null))}if(null!==o.dataSource&&""!==o.targetField){i=o.targetColor||"black";for(var l="Vertical"===o.orientation?"ActualRect":"TargetRect",h=0;h<Object.keys(o.dataSource).length;h++)if(t.isNullOrUndefined(o.dataSource[h][o.targetField].length)||1===o.dataSource[h][o.targetField].length)for(;0===h;){this.legendCollections.push(new mr("Target",i,l,this.chart.legendSettings.visible,null,"",null,!1,r++,null));break}else for(var c=o.targetTypes,d=[],p=c.length;0===h;){for(var u=0;u<p;u++)d[u]=c[u%p],d[u]="Rect"===d[u]?"Vertical"===o.orientation?"ActualRect":"TargetRect":d[u],d[u]="Cross"===d[u]?"Multiply":d[u],this.legendCollections.push(new mr("Target_"+u,i,d[u],this.chart.legendSettings.visible,null,"",null,!1,r++,null));break}}},r.prototype.getLegendBounds=function(e,t,r){var o=0,n=r.padding,a=0;this.isVertical?o=r.width?0:e.width/100*5:a=r.height?0:e.height/100*5,t.height+=a,t.width+=o;var s,l=0,h=0,c=0,d=0,p=0,u=r.shapeWidth,g=r.shapePadding;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var y=!1,m=0,v=this.legendCollections;m<v.length;m++){var f=v[m];s={fill:f.fill,text:f.text,shape:f.shape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",s),f.render=!s.cancel,f.text=s.text,f.fill=s.fill,f.shape=s.shape,f.textSize=i.measureText(f.text,r.textStyle),f.render&&""!==f.text&&(y=!0,h+=d=u+g+f.textSize.width+n,(t.width<n+h||this.isVertical)&&(l=Math.max(l,h+n-(this.isVertical?0:d)),0===c&&d!==h&&(c=1),h=this.isVertical?0:d,p=++c*(this.maxItemHeight+n)+n))}p=Math.max(p,this.maxItemHeight+n+n),this.isPaging=t.height<p,this.totalPages=c,y?this.setBounds(Math.max(h+n,l),p,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=r.location.x+i+r.textSize.width,l=this.legend.padding;s+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+l):(e.location.x=n===a?r.location.x:s,e.location.y=r.location.y);var h=this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.click=function(e){var t=e.target.id;t.indexOf(this.legendID+"_pagedown")>-1?this.changePage(e,!1):t.indexOf(this.legendID+"_pageup")>-1&&this.changePage(e,!0)},r.prototype.getModuleName=function(){return"BulletChartLegend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),_s=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Os=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Es=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),Os([t.Property("Normal")],i.prototype,"fontStyle",void 0),Os([t.Property("Regular")],i.prototype,"fontWeight",void 0),Os([t.Property("")],i.prototype,"color",void 0),Os([t.Property("12px")],i.prototype,"size",void 0),Os([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Is=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property(10)],i.prototype,"top",void 0),Os([t.Property(10)],i.prototype,"bottom",void 0),Os([t.Property(10)],i.prototype,"right",void 0),Os([t.Property(10)],i.prototype,"left",void 0),i}(t.ChildProperty),zs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property(0)],i.prototype,"width",void 0),Os([t.Property(1)],i.prototype,"opacity",void 0),Os([t.Property("transparent")],i.prototype,"color",void 0),i}(t.ChildProperty),Ds=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),Bs=function(){function e(){}return e}(),Fs=function(){function e(){}return e}(),Ns=function(){function e(){}return e}(),Vs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _s(t,e),t}(Bs),js=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _s(t,e),t}(Vs),Hs=function(){function e(){}return e}(),Xs=function(){function e(){}return e}(),Ys=function(){function e(){}return e}(),Gs=function(){function e(){}return e}(),Ws=function(){function e(e,t,i,r,o){this.id=e,this.fill=t,this.borderColor=i,this.borderWidth=r,this.opacity=o}return e}(),Us=function(){function e(){}return e}(),Zs=function(){function e(){this.counterclockwise=0,this.clockwise=1}return e}(),qs=function(){function e(){}return e}(),Qs=function(){function e(){}return e}(),$s=function(){function e(e,t){this.width=e,this.height=t}return e}(),Js=function(){function e(){}return e}(),Ks=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),el=function(){function e(e,t,i,r,o,n,a){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=a}return e}(),tl=function(e){function t(t,i,r,o,n){var a=e.call(this,t,i,r.width,r.color,o)||this;return a.y=n.y,a.x=n.x,a.height=n.height,a.width=n.width,a}return Ks(t,e),t}(el),il=function(e){function t(t,i,r,o,n,a,s,l){var h=e.call(this,t,i,r.width,r.color,o)||this;return h.cy=a,h.cx=n,h.r=s,h["stroke-dasharray"]=l,h}return Ks(t,e),t}(el),rl=function(){function e(e,t,i,r,o){this.id=e,this.x=t,this.y=i,this.anchor=r,this.text=o}return e}();!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.smithchartTitleFont={size:"15px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.smithchartSubtitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.dataLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"}}(gs||(gs={}));var ol=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},al=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(!0)],i.prototype,"visible",void 0),nl([t.Property("")],i.prototype,"text",void 0),nl([t.Property("")],i.prototype,"description",void 0),nl([t.Property("Center")],i.prototype,"textAlignment",void 0),nl([t.Complex(gs.legendLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),sl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(0)],i.prototype,"x",void 0),nl([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),ll=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(1)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),hl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(10)],i.prototype,"width",void 0),nl([t.Property(10)],i.prototype,"height",void 0),nl([t.Complex({},ll)],i.prototype,"border",void 0),i}(t.ChildProperty),cl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(1)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),dl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(!1)],i.prototype,"visible",void 0),nl([t.Property("bottom")],i.prototype,"position",void 0),nl([t.Property("Center")],i.prototype,"alignment",void 0),nl([t.Property(null)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"height",void 0),nl([t.Property("circle")],i.prototype,"shape",void 0),nl([t.Property(null)],i.prototype,"rowCount",void 0),nl([t.Property(null)],i.prototype,"columnCount",void 0),nl([t.Property(8)],i.prototype,"itemPadding",void 0),nl([t.Property(5)],i.prototype,"shapePadding",void 0),nl([t.Property("")],i.prototype,"description",void 0),nl([t.Property(!0)],i.prototype,"toggleVisibility",void 0),nl([t.Complex({},al)],i.prototype,"title",void 0),nl([t.Complex({},sl)],i.prototype,"location",void 0),nl([t.Complex({},hl)],i.prototype,"itemStyle",void 0),nl([t.Complex({},cl)],i.prototype,"border",void 0),nl([t.Complex(gs.legendLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),pl=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ul=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},gl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),yl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),ul([t.Property(!1)],i.prototype,"visible",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property(8)],i.prototype,"count",void 0),i}(t.ChildProperty),ml=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),vl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property("Outside")],i.prototype,"labelPosition",void 0),ul([t.Property("Hide")],i.prototype,"labelIntersectAction",void 0),ul([t.Complex({},gl)],i.prototype,"majorGridLines",void 0),ul([t.Complex({},yl)],i.prototype,"minorGridLines",void 0),ul([t.Complex({},ml)],i.prototype,"axisLine",void 0),ul([t.Complex(gs.axisLabelFont,Es)],i.prototype,"labelStyle",void 0),i}(t.ChildProperty),fl=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},xl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fl(i,e),bl([t.Property(!0)],i.prototype,"visible",void 0),bl([t.Property("")],i.prototype,"text",void 0),bl([t.Property("")],i.prototype,"description",void 0),bl([t.Property("Far")],i.prototype,"textAlignment",void 0),bl([t.Property(!0)],i.prototype,"enableTrim",void 0),bl([t.Property(null)],i.prototype,"maximumWidth",void 0),bl([t.Complex(gs.smithchartSubtitleFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),wl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fl(i,e),bl([t.Property(!0)],i.prototype,"visible",void 0),bl([t.Property("")],i.prototype,"text",void 0),bl([t.Property("")],i.prototype,"description",void 0),bl([t.Property("Center")],i.prototype,"textAlignment",void 0),bl([t.Property(!0)],i.prototype,"enableTrim",void 0),bl([t.Property(null)],i.prototype,"maximumWidth",void 0),bl([t.Complex({},xl)],i.prototype,"subtitle",void 0),bl([t.Complex(gs.smithchartTitleFont,Es)],i.prototype,"font",void 0),bl([t.Complex(gs.smithchartTitleFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Sl=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Pl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ll=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(.95)],i.prototype,"opacity",void 0),Cl([t.Property("")],i.prototype,"template",void 0),Cl([t.Complex({},Pl)],i.prototype,"border",void 0),i}(t.ChildProperty),Rl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(3)],i.prototype,"width",void 0),Cl([t.Property("white")],i.prototype,"color",void 0),i}(t.ChildProperty),Ml=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(.1)],i.prototype,"width",void 0),Cl([t.Property("white")],i.prototype,"color",void 0),i}(t.ChildProperty),Al=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),kl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property("")],i.prototype,"template",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Ml)],i.prototype,"border",void 0),Cl([t.Complex({},Al)],i.prototype,"connectorLine",void 0),Cl([t.Complex(gs.dataLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Tl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property("circle")],i.prototype,"shape",void 0),Cl([t.Property(6)],i.prototype,"width",void 0),Cl([t.Property(6)],i.prototype,"height",void 0),Cl([t.Property("")],i.prototype,"imageUrl",void 0),Cl([t.Property("")],i.prototype,"fill",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Rl)],i.prototype,"border",void 0),Cl([t.Complex({},kl)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),_l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property("visible")],i.prototype,"visibility",void 0),Cl([t.Property([])],i.prototype,"points",void 0),Cl([t.Property("")],i.prototype,"resistance",void 0),Cl([t.Property("")],i.prototype,"reactance",void 0),Cl([t.Property("")],i.prototype,"tooltipMappingName",void 0),Cl([t.Property(null)],i.prototype,"dataSource",void 0),Cl([t.Property("")],i.prototype,"name",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(!1)],i.prototype,"enableAnimation",void 0),Cl([t.Property("2000ms")],i.prototype,"animationDuration",void 0),Cl([t.Property(!1)],i.prototype,"enableSmartLabels",void 0),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Tl)],i.prototype,"marker",void 0),Cl([t.Complex({},Ll)],i.prototype,"tooltip",void 0),i}(t.ChildProperty),Ol=function(){function e(){}return e.prototype.calculateAreaBounds=function(e,t,i){var r=e.margin,o=e.border,n=this.getLegendSpace(e,i),a=n.leftLegendWidth+r.left+o.width,s=n.rightLegendWidth+r.left+r.right+2*o.width,l=e.availableSize.width-(a+s);return{x:a,y:r.top+2*e.elementSpacing+n.modelTitleHeight+n.modelsubTitleHeight+n.topLegendHeight+o.width,width:l,height:e.availableSize.height-(n.modelTitleHeight+2*e.elementSpacing+n.modelsubTitleHeight+r.top+n.topLegendHeight+n.bottomLegendHeight)}},e.prototype.getLegendSpace=function(e,t){var i,r=e.title,o=e.legendSettings,n=o.position.toLowerCase(),a=0,s=0,l=e.font,h=0,c=o.border.width,d=0,p=0,u=0,g=0,y=0;return o.visible&&(i=t.width+5+e.elementSpacing+2*c,d="left"===n?i:0,p="right"===n?i:0,y=o.title.visible?ft(o.title.text,l).height:0,u="top"===n?e.elementSpacing+t.height+y:0,g="bottom"===n?e.elementSpacing+t.height+y:0),a=ft(r.subtitle.text,l).height,""!==r.text&&r.visible,h=0,s=""!==r.subtitle.text&&r.subtitle.visible?a:0,{leftLegendWidth:d,rightLegendWidth:p,topLegendHeight:u,bottomLegendHeight:g,modelTitleHeight:h,modelsubTitleHeight:s}},e}(),El=function(){function e(){this.radialLabels=[-50,-20,-10,-5,-4,-3,-2,-1.5,-1,-.8,-.6,-.4,-.2,0,.2,.4,.6,.8,1,1.5,2,3,4,5,10,20,50],this.radialLabelCollections=[],this.horizontalLabelCollections=[],this.labelCollections=[],this.direction=new Zs}return e.prototype.renderArea=function(e,t){this.calculateChartArea(e,t),this.calculateCircleMargin(e,t),this.calculateXAxisRange(e),this.calculateRAxisRange(e),this.measureHorizontalAxis(e),this.measureRadialAxis(e),e.horizontalAxis.visible&&this.updateHAxis(e),e.radialAxis.visible&&this.updateRAxis(e),e.horizontalAxis.visible&&this.drawHAxisLabels(e),e.radialAxis.visible&&this.drawRAxisLabels(e)},e.prototype.updateHAxis=function(e){var t=e.horizontalAxis.majorGridLines,i=e.horizontalAxis.minorGridLines,r=e.horizontalAxis.axisLine;t.visible&&this.updateHMajorGridLines(e),i.visible&&this.updateHMinorGridLines(e),r.visible&&this.updateHAxisLine(e)},e.prototype.updateRAxis=function(e){var t=e.radialAxis.majorGridLines,i=e.radialAxis.minorGridLines,r=e.radialAxis.axisLine;t.visible&&this.updateRMajorGridLines(e),i.visible&&this.updateRMinorGridLines(e),r.visible&&this.updateRAxisLine(e)},e.prototype.measureHorizontalAxis=function(e){var t=e.horizontalAxis.minorGridLines;this.measureHMajorGridLines(e),t.visible&&this.measureHMinorGridLines(e)},e.prototype.measureRadialAxis=function(e){var t=e.radialAxis.minorGridLines;this.measureRMajorGridLines(e),t.visible&&this.measureRMinorGridLines(e)},e.prototype.calculateChartArea=function(e,t){var i=e.availableSize.width,r=e.availableSize.height;i=t.width,r=t.height;var o=Math.min(i,r),n=Math.min(i,r),a=t.x+(t.width/2-o/2),s=t.y+((r-n)/2>0?(r-n)/2:0);e.chartArea={x:a,y:s,width:o,height:n}},e.prototype.calculateCircleMargin=function(e,t){var i=0,r=e.chartArea.width,o=e.radius;i=this.maximumLabelLength(e);var n="Outside"===e.radialAxis.labelPosition?i+10:10,a=(r-2*n>0?r-2*n:0)/2,s=o>1?1:o<.1?.1:o;this.areaRadius=a*s,this.circleLeftX=e.chartArea.x+n+a*(1-s),this.circleTopY=e.chartArea.y+n+a*(1-s),this.circleCenterX=this.circleLeftX+this.areaRadius,this.circleCenterY=t.y+t.height/2},e.prototype.maximumLabelLength=function(e){for(var t,i=0,r=e.horizontalAxis.labelStyle,o=0;o<this.radialLabels.length;o++)i<(t=ft(this.radialLabels[o].toString(),r)).width&&(i=t.width);return i},e.prototype.calculateAxisLabels=function(){for(var e=0,t=0,i=[],r=2*this.areaRadius,o=0;o<2;o+=.1){var n=!1,a=!1,s=r*(1/((o=Math.round(10*o)/10)+1))/2*2;0!==e&&1!==o?(o<1&&(n=this.isOverlap(1,r,s,30)),o>1&&(a=this.isOverlap(2,r,s,30)),n||a||e-s>=30&&(i[t]=o,t++,e=s)):(e=s,i[t]=o,t++)}for(var l=[2,3,4,5,10,20,50],h=0;h<l.length;h++)i[t]=l[h],t++;return i},e.prototype.isOverlap=function(e,t,i,r){return i-t*(1/(e+1))/2*2<r},e.prototype.calculateXAxisRange=function(e){for(var t,i,r,o=2*this.areaRadius,n=this.calculateAxisLabels(),a=this.circleCenterY,s=this.circleLeftX,l=this.circleLeftX,h=0;h<n.length;h++)i=o*(1/((t=n[h])+1))/2,"Impedance"===e.renderType&&(l=s+o-2*i),r=l+i,this.horizontalLabelCollections.push({centerX:r,centerY:a,radius:i,value:t,region:null})},e.prototype.calculateRAxisRange=function(e){var t,i,r,o=2*this.areaRadius,n=new Ys;"Impedance"===e.renderType?(n.x=this.circleLeftX+o,n.y=this.circleTopY+this.areaRadius):(n.x=this.circleLeftX,n.y=this.circleTopY+this.areaRadius);for(var a=0;a<this.radialLabels.length;a++)r=this.radialLabels[a],i=Math.abs(1/r*o/2),t="Impedance"===e.renderType?r>0?n.y-i:n.y+i:r<0?n.y-i:n.y+i,this.radialLabelCollections.push({centerX:n.x,centerY:t,radius:i,value:r})},e.prototype.measureHMajorGridLines=function(e){var t,i,r,o,n,a=[];this.majorHGridArcPoints=[];for(var s=0;s<this.horizontalLabelCollections.length;s++){var l=new Vs;l=this.horizontalLabelCollections[s],a=this.calculateHMajorArcStartEndPoints(l.value),"Impedance"===e.renderType?(r=a[0],o=a[1]):(r=a[1],o=a[0]),n={width:l.radius,height:l.radius},0!==l.value&&50!==l.value?(t=this.intersectingCirclePoints(r[0].centerX,r[0].centerY,r[0].radius,l.centerX,l.centerY,l.radius,e.renderType),i=this.intersectingCirclePoints(o[0].centerX,o[0].centerY,o[0].radius,l.centerX,l.centerY,l.radius,e.renderType),this.majorHGridArcPoints.push({startPoint:t,endPoint:i,rotationAngle:2*Math.PI,sweepDirection:"Impedance"===e.renderType?this.direction.counterclockwise:this.direction.clockwise,isLargeArc:!0,size:n})):(t={x:l.centerX+l.radius,y:l.centerY},i={x:l.centerX+l.radius,y:l.centerY-.05},this.majorHGridArcPoints.push({startPoint:t,endPoint:i,rotationAngle:2*Math.PI,sweepDirection:this.direction.clockwise,isLargeArc:!0,size:n}))}},e.prototype.measureRMajorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c=[];this.majorRGridArcPoints=[],this.labelCollections=[];for(var d=gt(),p=0;p<this.radialLabelCollections.length;p++)(t=this.radialLabelCollections[p]).radius<=d||(i=t.value,r=(c=this.calculateMajorArcStartEndPoints(t,Math.abs(i),e))[0],o=c[1],n=this.circleXYRadianValue(this.circleCenterX,this.circleCenterY,o.x,o.y)*(180/Math.PI),0!==i?(a={x:r.x,y:r.y},s={x:o.x,y:o.y},l={width:t.radius,height:t.radius},h=i>0?this.direction.clockwise:this.direction.counterclockwise,this.majorRGridArcPoints.push({startPoint:a,endPoint:s,size:l,rotationAngle:2*Math.PI,isLargeArc:!1,sweepDirection:h}),this.labelCollections.push({centerX:o.x,centerY:o.y,angle:n,value:i,radius:this.areaRadius,region:null})):(a={x:this.circleLeftX,y:this.circleCenterY},s={x:this.circleCenterX+this.areaRadius,y:this.circleCenterY},this.majorRGridArcPoints.push({startPoint:a,endPoint:s,size:null,rotationAngle:null,isLargeArc:null,sweepDirection:null}),this.labelCollections.push({centerX:"Impedance"===e.renderType?this.circleCenterX-this.areaRadius:this.circleCenterX+this.areaRadius,centerY:this.circleCenterY,angle:"Impedance"===e.renderType?180:360,value:i,radius:this.areaRadius,region:null})))},e.prototype.circleXYRadianValue=function(e,t,i,r){var o;return o=Math.atan2(r-t,i-e),o=o<0?o+360*Math.PI/180:o},e.prototype.calculateMajorArcStartEndPoints=function(e,t,i){var r=[],o=[],n=this.circleCenterX,a=this.circleCenterY;return t>=10?r[0]="Impedance"===i.renderType?{x:n+this.areaRadius,y:a}:{x:n-this.areaRadius,y:a}:o=t>=3?this.horizontalLabelCollections.filter(function(e){return 10===e.value}):t>=1?this.horizontalLabelCollections.filter(function(e){return 5===e.value}):this.horizontalLabelCollections.filter(function(e){return 3===e.value}),o.length>0&&(r[0]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,o[0].centerX,o[0].centerY,o[0].radius,i.renderType)),r[1]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,n,a,this.areaRadius,i.renderType),r},e.prototype.calculateHMajorArcStartEndPoints=function(e){var t,i,r=[];return e<=.3?(t=2,i=-2):e<=1?(t=3,i=-3):e<=2?(t=5,i=-5):e<=5?(t=10,i=-10):(t=50,i=-50),r[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),r[1]=this.radialLabelCollections.filter(function(e){return e.value===i}),r},e.prototype.calculateMinorArcStartEndPoints=function(e){var t,i,r=[];return e<=.1?(t=1,i=-1):e<=.2?(t=.8,i=-.8):e<=.3?(t=.4,i=-.4):e<=.6?(t=1,i=-1):e<=1?(t=1.5,i=-1.5):e<=1.5?(t=2,i=-2):e<=2?(t=1,i=-1):e<=5?(t=3,i=-3):(t=10,i=-10),r[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),r[1]=this.radialLabelCollections.filter(function(e){return e.value===i}),r},e.prototype.intersectingCirclePoints=function(e,t,i,r,o,n,a){var s={x:0,y:0},l=e-r,h=t-o,c=Math.sqrt(l*l+h*h),d=c*c,p=(i*i-n*n)/(2*d),u=i*i-n*n,g=Math.sqrt(2*(i*i+n*n)/d-u*u/(d*d)-1),y=(e+r)/2+p*(r-e),m=g*(o-t)/2,v=y+m,f=y-m,b=(t+o)/2+p*(o-t),x=g*(e-r)/2,w=b+x,S=b-x;return"Impedance"===a?f<v?(s.x=f,s.y=S):(s.x=v,s.y=w):v>f?(s.x=v,s.y=w):(s.x=f,s.y=S),{x:s.x,y:s.y}},e.prototype.updateHMajorGridLines=function(e){var t=e.horizontalAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMajorGridLines"}),r=this.calculateGridLinesPath(this.majorHGridArcPoints),o=new el(e.element.id+"_horizontalAxisMajorGridLines","none",t.width,t.color?t.color:e.themeStyle.majorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateRMajorGridLines=function(e){var t=e.radialAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMajorGridLines"}),r=this.calculateGridLinesPath(this.majorRGridArcPoints),o=new el(e.element.id+"_radialAxisMajorGridLines","none",t.width,t.color?t.color:e.themeStyle.majorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateHAxisLine=function(e){var t=this.areaRadius,i=e.horizontalAxis.axisLine,r=e.renderer.createGroup({id:e.element.id+"_svg_hAxisLine"}),o={x:this.circleCenterX+t,y:this.circleCenterY},n={x:this.circleCenterX+t,y:this.circleCenterY-.05},a={width:t,height:t},s=this.direction.clockwise,l=2*Math.PI,h="M"+o.x+" "+o.y+" A "+a.width+" "+a.height+" "+l+" 1 "+s+" "+n.x+" "+n.y,c=new el(e.element.id+"_horizontalAxisLine","none",i.width,i.color?i.color:e.themeStyle.axisLine,1,i.dashArray,h),d=e.renderer.drawPath(c);r.appendChild(d),e.svgObject.appendChild(r)},e.prototype.updateRAxisLine=function(e){var t=this.areaRadius,i=e.radialAxis.axisLine,r={x:this.circleCenterX-t,y:this.circleCenterY},o={x:this.circleCenterX+t,y:this.circleCenterY},n={width:0,height:0},a=this.direction.counterclockwise,s="M "+r.x+" "+r.y+" A "+n.width+" "+n.height+" 0 0 "+a+" "+o.x+" "+o.y,l=new el(e.element.id+"_radialAxisLine","none",i.width,i.color?i.color:e.themeStyle.axisLine,1,i.dashArray,s),h=e.renderer.createGroup({id:e.element.id+"_svg_rAxisLine"}),c=e.renderer.drawPath(l);h.appendChild(c),e.svgObject.appendChild(h)},e.prototype.drawHAxisLabels=function(e){var t=e.horizontalAxis;e.radialAxis.labelStyle.fontFamily=e.themeStyle.fontFamily||e.radialAxis.labelStyle.fontFamily;for(var i,r,o,n,a,s,l,h,c,d,p,u,g,y=e.horizontalAxis.labelStyle,m=e.renderer.createGroup({id:e.element.id+"_HAxisLabels"}),v=this,f=0;f<this.horizontalLabelCollections.length;f++)!function(f){if(i=v.horizontalLabelCollections[f],r=v.horizontalLabelCollections[f].value.toString(),0!==i.value){if(o="Impedance"===e.renderType?i.centerX-i.radius:i.centerX+i.radius,n=i.centerY,a=ft(r,y),o="Impedance"===e.renderType?o-a.width:o,"Outside"===t.labelPosition?n-=a.height/4:n+=a.height,v.horizontalLabelCollections[f].region=v.calculateRegion(r,a,o,n),"Hide"===t.labelIntersectAction){s=v.horizontalLabelCollections[f],l=s.region.bounds,h=l.width,c=l.x;for(var b=1;b<f;b++)d=v.horizontalLabelCollections[b],p=d.region.bounds,u=p.width,g=p.x,"Impedance"===e.renderType&&g+u>c&&(r=""),"Admittance"===e.renderType&&g<c+h&&(r="")}var x={text:r.toString(),x:o,y:n,name:"axisLabelRender",cancel:!1},w=function(t){if(!t.cancel){var i=new rl(e.element.id+"_HLabel_"+f,x.x,x.y,"none",x.text),r=y.color?y.color:e.themeStyle.axisLabel;y.fontFamily=y.fontFamily||e.themeStyle.labelFontFamily;var o=Ct(i,y,r,m);m.appendChild(o)}};w.bind(v),e.trigger("axisLabelRender",x,w)}}(f);e.svgObject.appendChild(m)},e.prototype.drawRAxisLabels=function(e){e.radialAxis.labelStyle.fontFamily=e.themeStyle.fontFamily||e.radialAxis.labelStyle.fontFamily;for(var t,i,r,o,n,a,s,l,h,c,d,p,u,g,y,m,v,f=e.radialAxis.labelStyle,b=new js,x=e.radialAxis,w=e.renderer.createGroup({id:e.element.id+"_RAxisLabels"}),S=this,C=0;C<this.labelCollections.length;C++)!function(C){if(b=S.labelCollections[C],t=b.value.toString(),i=ft(t,f),r=Math.round(100*b.angle)/100,"Outside"===x.labelPosition?(o=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius+2),n=S.setLabelsOutsidePosition(r,o.x,o.y,i)):(o=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius-2),n=S.setLabelsInsidePosition(r,o.x,o.y,i)),S.labelCollections[C].region=S.calculateRegion(t,i,n.x,n.y),"Hide"===x.labelIntersectAction){c=S.labelCollections[C],d=c.region.bounds,l=d.width,h=d.height,a=d.x,s=d.y;for(var P=0;P<C;P++)m=S.labelCollections[P],v=m.region.bounds,g=v.width,y=v.height,p=v.x,u=v.y,p<=a+l&&a<=p+g&&u<=s+h&&s<=u+y&&(t=" ")}var L={text:t.toString(),x:n.x,y:n.y,name:"axisLabelRender",cancel:!1},R=function(t){if(!t.cancel){var i=new rl(e.element.id+"_RLabel_"+C,L.x,L.y,"none",L.text),r=f.color?f.color:e.themeStyle.axisLabel;f.fontFamily=e.themeStyle.labelFontFamily?e.themeStyle.labelFontFamily:f.fontFamily;var o=Ct(i,f,r,w);w.appendChild(o)}};R.bind(S),e.trigger("axisLabelRender",L,R)}(C);e.svgObject.appendChild(w)},e.prototype.calculateRegion=function(e,t,i,r){new Ns;return{bounds:{x:i,y:r,width:t.width,height:t.height},labelText:e}},e.prototype.updateHMinorGridLines=function(e){var t=e.horizontalAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMinorGridLines"}),r=this.calculateGridLinesPath(this.minorHGridArcPoints),o=new el(e.element.id+"_horizontalAxisMinorGridLines","none",t.width,t.color?t.color:e.themeStyle.minorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateRMinorGridLines=function(e){var t=e.radialAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMinorGridLines"}),r=this.calculateGridLinesPath(this.minorGridArcPoints),o=new el(e.element.id+"_radialAxisMinorGridLines","none",t.width,t.color?t.color:e.themeStyle.minorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.calculateGridLinesPath=function(e){for(var t,i,r,o,n=new Js,a="",s=0;s<e.length;s++)t=(n=e[s]).startPoint.x,i=n.startPoint.y,r=n.endPoint.x,o=n.endPoint.y,a=a+"M "+t+" "+i+" A "+(n.size?n.size.width:0)+" "+(n.size?n.size.height:0)+" "+(n.rotationAngle?n.rotationAngle:0)+" "+(n.isLargeArc?1:0)+" "+(n.sweepDirection?n.sweepDirection:0)+" "+r+" "+o+" ";return a.toString()},e.prototype.measureHMinorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c,d,p,u,g=[],y=e.horizontalAxis.minorGridLines.count;this.minorHGridArcPoints=[];for(var m=2*this.areaRadius,v=0;v<this.horizontalLabelCollections.length-3;v++){l=this.horizontalLabelCollections[v],h=this.horizontalLabelCollections[v+1],p=(c=2*(l.radius-h.radius))/(d=Math.floor(y/100*c));for(var f=0;f<d;f++)u=h.radius+f*p/2,s=("Impedance"===e.renderType?this.circleLeftX+m-2*u:this.circleLeftX)+u,r=h.value>5,g=this.calculateMinorArcStartEndPoints(h.value),"Impedance"===e.renderType?(t=g[0],i=g[1]):(t=g[1],i=g[0]),o=this.intersectingCirclePoints(t[0].centerX,t[0].centerY,t[0].radius,s,l.centerY,u,e.renderType),n=this.intersectingCirclePoints(i[0].centerX,i[0].centerY,i[0].radius,s,l.centerY,u,e.renderType),a={width:u,height:u},this.minorHGridArcPoints.push({startPoint:o,endPoint:n,rotationAngle:2*Math.PI,sweepDirection:"Impedance"===e.renderType?this.direction.counterclockwise:this.direction.clockwise,isLargeArc:r,size:a})}},e.prototype.measureRMinorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c,d,p=e.radialAxis.minorGridLines.count,u=Math.PI*(2*this.areaRadius),g=t="Impedance"===e.renderType?this.circleCenterX+this.areaRadius:this.circleCenterX-this.areaRadius,y=this.circleCenterY;this.minorGridArcPoints=[];for(var m={x:g,y:y},v=2;v<this.labelCollections.length-3;v++){n=this.labelCollections[v],a=this.labelCollections[v+1],"Impedance"===e.renderType?(i=360===a.angle?0:a.angle,r=Math.abs(i-n.angle)):(i=360===n.angle?0:n.angle,r=Math.abs(i-a.angle)),l=u/360*r,c=r/(h=Math.floor(p/100*l)),d=a.value>0?a.value:n.value,o=this.minorGridLineArcIntersectCircle(Math.abs(d));for(var f=1;f<h;f++){var b=c*f+(360===n.angle?i:n.angle),x=this.circlePointPosition(this.circleCenterX,this.circleCenterY,b,this.areaRadius),w=this.arcRadius(m,x,b),S=b>180?this.circleCenterY-w:this.circleCenterY+w,C=this.intersectingCirclePoints(t,S,w,o[0].centerX,o[0].centerY,o[0].radius,e.renderType),P={x:C.x,y:C.y},L={x:x.x,y:x.y};s={width:w,height:w};var R=n.value>=0?this.direction.clockwise:this.direction.counterclockwise;this.minorGridArcPoints.push({startPoint:P,endPoint:L,rotationAngle:2*Math.PI,sweepDirection:R,isLargeArc:!1,size:s})}}},e.prototype.minorGridLineArcIntersectCircle=function(e){var t;return t=e>=3?20:e>=1.5?10:e>=.6?3:2,this.horizontalLabelCollections.filter(function(e){return e.value===t})},e.prototype.circlePointPosition=function(e,t,i,r){var o=i*(Math.PI/180);return{x:e+r*Math.cos(o),y:t+r*Math.sin(o)}},e.prototype.setLabelsInsidePosition=function(e,t,i,r){var o=t,n=i;return 0===e||360===e?(o-=r.width,n-=r.height/2):90===e?(o-=r.width,n+=r.height/8):180===e?n+=r.height:270===e?n+=r.height/2:e>0&&e<=20?o-=r.width:e>20&&e<=60?(o-=r.width+r.width/2,n+=r.height/2):e>60&&e<90?(o-=r.width+r.width/4,n+=r.height/4):e>90&&e<=135?(o-=r.width/2,n+=r.height/16):e>135&&e<=150?(o+=r.width/2,n+=r.height/2):e>150&&e<180?(o+=r.width/2,n+=r.height):e>180&&e<=210?(o+=r.width/6,n+=r.height/6):e>210&&e<240?n+=r.height/4:e>225&&e<270?n+=r.height/3:e>270&&e<=300?(o-=r.width+r.width/4,n+=r.height/4):e>300&&e<=330?(o-=r.width+r.width/3,n+=r.height/4):e>330&&e<=340?(o-=r.width+r.width/2,n+=r.height/4):e>340&&(o-=r.width,n+=r.height/8),{x:o,y:n}},e.prototype.setLabelsOutsidePosition=function(e,t,i,r){var o=t,n=i;return 90===e?(o-=r.width/2,n+=r.height):180===e?(o-=r.width+5,n-=r.height/4):270===e?(o-=r.width/2,n-=r.height/4):360===e?(o+=5,n-=r.height/2):e>0&&e<=30?(o+=r.width/4,n+=r.height/8):e>30&&e<=60?(o+=r.width/2,n+=r.height/4):e>60&&e<=90?(o-=r.width/2,n+=r.height):e>90&&e<=135?(o-=r.width,n+=r.height):e>135&&e<=180?(o-=r.width+r.width/4,n+=r.height/4):e>180&&e<=210?(o-=r.width+r.width/4,n-=r.height/4):e>210&&e<=270?(o-=r.width,n-=r.height/4):e>270&&e<=340?n-=r.height/4:e>340&&(n+=r.height/4,o+=r.width/6),{x:o,y:n}},e.prototype.arcRadius=function(e,t,i){var r=i>180?90*Math.PI/180:270*Math.PI/180,o=(t.x-e.x)/2,n=(t.y-e.y)/2,a=(n-o*((Math.cos(r)*n-Math.sin(r)*o)/(Math.cos(r)*o+Math.sin(r)*n)))/Math.sin(r),s=e.y+Math.sin(r)*a;return Math.abs(e.y-s)},e}(),Il=function(){function e(){}return e.prototype.drawMarker=function(e,t,i,r){if(e.series[t].marker.visible){var o=e.series[t].marker,n=e.series[t].points.length-1,a=o.width,s=o.height,l=o.shape,h=e.renderer.createGroup({id:e.element.id+"_svg_series"+t+"_Marker"});i.appendChild(h);for(var c=o.border.width,d=o.border.color,p=o.opacity,u=o.fill?o.fill:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],g=0;g<n+1;g++){var y=r[g].point,m=g,v=new Ws(e.element.id+"_Series"+t+"_Points"+m+"_Marker"+m,u,d,c,p);h.appendChild(this.drawSymbol(l,o.imageUrl,y,new $s(a,s),v,e))}}},e.prototype.drawSymbol=function(e,t,i,r,o,n){var a,s,l,h,c=e.toLowerCase(),d={color:o.borderColor,width:o.borderWidth},p=o.opacity,u=i.x,g=i.y,y=Math.sqrt(r.height*r.height+r.width*r.width)/2;switch(c){case"circle":s=new il(o.id,o.fill,d,p,i.x,i.y,y,null),a=n.renderer.drawCircle(s);break;case"rectangle":h="M "+(u+-r.width/2)+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+-r.height/2)+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"triangle":h="M "+(u+-r.width/2)+" "+(g+r.height/2)+" L "+u+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+r.height/2)+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"diamond":h="M "+(u+-r.width/2)+" "+g+" L "+u+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+g+" L "+u+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+g+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"pentagon":for(var m=0;m<=5;m++){var v=y*Math.cos(Math.PI/180*(72*m)),f=y*Math.sin(Math.PI/180*(72*m));h=0===m?"M "+(u+v)+" "+(g+f)+" ":h.concat("L "+(u+v)+" "+(g+f)+" ")}h=h.concat("Z"),l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l)}return a},e}(),zl=function(){function e(){this.textOptions=[],this.labelOptions=[],this.allPoints=[]}return e.prototype.drawDataLabel=function(e,t,i,r,o){this.textOptions=[],this.allPoints=[];for(var n,a,s,l,h,c=e.margin,d=e.series[t].marker,p=d.dataLabel,u=p.textStyle,g=r.length,y=0;y<g;y++){h=ft(l=e.series[t].points[y].reactance.toString(),u);var m=(a=r[y].point).x-h.width/2,v=a.y-(h.height+d.height+c.top),f=h.width+c.left/2+c.right/2,b=h.height+c.top/2+c.bottom/2;n=y,s=new Us,s={textX:m+c.left/2,textY:v+b/2+c.top/2,x:m,y:v},this.textOptions[y]={id:e.element.id+"_Series"+t+"_Points"+n+"_dataLabel_displayText"+y,x:s.textX,y:s.textY,fill:"black",text:l,font:u,xPosition:m,yPosition:v,width:f,height:b,location:a,labelOptions:s,visible:!0,connectorFlag:null}}var x=new Qs;x.textOptions=this.textOptions,this.labelOptions.push(x),this.drawDatalabelSymbol(e,t,p,i,o,r)},e.prototype.calculateSmartLabels=function(e,t){for(var i=e.textOptions.length,r=0;r<i;r++)this.allPoints[this.allPoints.length]=e.textOptions[r],this.connectorFlag=!1,this.compareDataLabels(r,e,0,t),this.labelOptions[t].textOptions[r]=e.textOptions[r],this.labelOptions[t].textOptions[r].connectorFlag=this.connectorFlag},e.prototype.compareDataLabels=function(e,t,i,r){for(var o,n,a=this.allPoints.length,s=0;s<a;s++)if(n=this.allPoints[s],o=this.allPoints[a-1],this.isCollide(n,o))switch(this.connectorFlag=!0,i){case 0:this.resetValues(o),this.prevLabel=n,o.xPosition=this.prevLabel.xPosition+(this.prevLabel.width/2+o.width/2+10),o.x=o.xPosition+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 1:this.resetValues(o),o.xPosition=this.prevLabel.xPosition+this.prevLabel.width/2+o.width/2+10,o.x=o.xPosition+5,o.yPosition=o.location.y+o.height/2+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 2:this.resetValues(o),o.yPosition=o.location.y+o.height/2+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 3:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,o.yPosition=o.height/2+o.location.y+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 4:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 5:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,o.yPosition=this.prevLabel.yPosition-o.height-10,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 6:this.resetValues(o),o.yPosition=this.prevLabel.yPosition-(o.height+10),o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 7:this.resetValues(o),o.xPosition=this.prevLabel.xPosition+this.prevLabel.width/2+o.width/2+10,o.x=o.xPosition+5,o.yPosition=this.prevLabel.yPosition-o.height-10,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 8:i=0,this.compareDataLabels(e,t,i,r)}},e.prototype.isCollide=function(e,t){var i=!1;return e!==t&&(i=!(e.y+e.height<t.y||e.y>t.y+t.height||e.x+e.width/2<t.x-t.width/2||e.x-e.width/2>t.x+t.width/2)),i},e.prototype.resetValues=function(e){e.xPosition=e.labelOptions.x,e.yPosition=e.labelOptions.y,e.x=e.labelOptions.textX,e.y=e.labelOptions.textY},e.prototype.drawConnectorLines=function(e,t,i,r,o){var n,a=r.location;n=a.y>r.y?r.y:r.y-r.height/2;var s="M "+a.x+" "+a.y+" L "+r.x+" "+n,l=e.series[t].marker.dataLabel.connectorLine,h=l.color?l.color:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],c=new el(e.element.id+"_dataLabelConnectorLine_series"+t+"_point"+i,"none",l.width,h,1,"none",s),d=e.renderer.drawPath(c);o.appendChild(d)},e.prototype.drawDatalabelSymbol=function(e,i,r,o,n,a){for(var s=0;s<e.series[i].points.length;s++)if(r.template){var l=t.createElement("div",{id:e.element.id+"_seriesIndex_"+i+"_Label_Template_Group",className:"template",styles:"position: absolute;"});document.getElementById(e.element.id+"_Secondary_Element").appendChild(l);var h=r.template+"_seriesIndex"+i+"_pointIndex"+s+e.element.id,c={point:e.series[i].points[s].reactance},d=ut(pt(r.template)(e),h,c);l.appendChild(d),d.style.left=a[s].point.x-d.offsetWidth/2+"px",d.style.top=a[s].point.y-d.offsetHeight-e.series[i].marker.height/2+"px";var p="_seriesIndex"+i+"_pointIndex"+s+e.element.id;t.updateBlazorTemplate(p+"Template","Template");var u=parseInt(d.style.left,10),g=parseInt(d.style.top,10),y=d.offsetWidth,m=d.offsetHeight,v=a[s].point,f={textX:u,textY:g,x:u,y:g};this.labelOptions[i].textOptions[s]={id:h,x:u,y:g,fill:"black",text:"",font:r.textStyle,xPosition:u,yPosition:g,width:y,height:m,location:v,labelOptions:f,visible:!0,connectorFlag:null}}},e}(),Dl=function(){function e(){this.xValues=[],this.yValues=[],this.pointsRegion=[],this.lineSegments=[],this.location=[],this.dataLabel=new zl}return e.prototype.processData=function(e){var t=e.dataSource,i=e.resistance,r=e.reactance,o=e.tooltipMappingName;e.points=[];for(var n=0;n<t.length;n++)e.points.push({resistance:t[n][i],reactance:t[n][r],tooltip:t[n][o]})},e.prototype.draw=function(e,t,i){for(var r,o,n,a,s=e.renderer.createGroup({id:e.element.id+"_svg_seriesCollections"}),l=e.series,h=l.length,c=t.areaRadius,d=0;d<h;d++){var p=d;l[d].dataSource&&l[d].resistance&&l[d].reactance&&this.processData(l[d]),this.pointsRegion[d]=[],this.location[d]=[];for(M=0;M<l[d].points.length;M++)this.xValues[M]=l[d].points[M].resistance,this.yValues[M]=l[d].points[M].reactance;for(var u=t.circleCenterX,g=t.circleCenterY,y=2*t.areaRadius,m=g,v={x:u+("Impedance"===e.renderType?c:-c),y:g}.x,f=0;f<l[d].points.length;f++){var b=this.xValues[f],x=y*(1/(b+1))/2,w=this.yValues[f],S=Math.abs(1/w*y/2);"Impedance"===e.renderType?(o=w>0?g-S:g+S,r=t.circleLeftX+y-x):(o=w<0?g-S:g+S,r=t.circleLeftX+x),n=t.intersectingCirclePoints(v,o,S,r,m,x,e.renderType);var C=gt();Math.abs(w)<C&&(n.x="Impedance"===e.renderType?r-x:r+x,n.y=g),this.pointsRegion[d][f]=new Xs,this.pointsRegion[d][f]={point:n,x:b,y:w},this.location[d][f]={x:n.x,y:n.y}}for(A=0;A<l[d].points.length-1;A++)a=A+1,this.lineSegments[A]=new Hs,this.lineSegments[A]={x1:this.xValues[A],y1:this.yValues[A],x2:this.xValues[a],y2:this.yValues[a]};e.svgObject.appendChild(s),this.drawSeries(e,p,s,i)}for(M=0;M<e.series.length;M++)if(e.series[M].enableSmartLabels&&e.series[M].marker.dataLabel.visible){var P=e.renderer.createGroup({id:e.element.id+"_svg_series"+M+"_Datalabel_connectorLines"});(k=document.getElementById(e.element.id+"_svg_seriesCollection"+M))&&k.appendChild(P),this.dataLabel.calculateSmartLabels(this.dataLabel.labelOptions[M],M);for(f=0;f<e.series[M].points.length;f++){var L=this.dataLabel.labelOptions[M].textOptions[f];(L.xPosition+L.width>e.chartArea.x+e.chartArea.width||L.xPosition<e.chartArea.x||L.yPosition<e.chartArea.y||L.yPosition+L.height>e.chartArea.y+e.chartArea.height)&&(this.dataLabel.labelOptions[M].textOptions[f].connectorFlag=!1,this.dataLabel.labelOptions[M].textOptions[f].visible=!1),L.connectorFlag&&this.dataLabel.drawConnectorLines(e,M,f,L,P)}}for(var R=this,M=0;M<e.series.length;M++)!function(t){var i=e.series[t].marker.dataLabel;if(e.series[t].marker.dataLabel.visible){var r=document.getElementById(e.element.id+"_svg_seriesCollection"+t),o=e.renderer.createGroup({id:e.element.id+"_svg_series"+t+"_Datalabel"});r&&r.appendChild(o);for(var n=0;n<e.series[t].points.length;n++)!function(r){var n=R.dataLabel.labelOptions[t].textOptions[r];if(!i.template&&n.visible){var a=new qs;a=R.dataLabel.labelOptions[t].textOptions[r];var s=i.textStyle,l=a.xPosition,h=a.yPosition,c=e.element.id+"_Series"+t+"_Points"+r+"_dataLabel_symbol"+r,d=i.fill?i.fill:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],p=e.series[t].marker.dataLabel.border,u=new tl(c,d,p,a.opacity,new Ds(l,h,a.width,a.height)),g=e.renderer.drawRectangle(u);o.appendChild(g);var y={text:a.text,x:a.x,y:a.y,seriesIndex:t,pointIndex:r,name:"textRender",cancel:!1},m=function(t){if(!t.cancel){var i=new rl(a.id,t.x,t.y,"start",t.text),r=s.color?s.color:e.themeStyle.dataLabel,n=Ct(i,s,r,o);o.appendChild(n)}};m.bind(R),e.trigger("textRender",y,m)}else if(i.template){var v=document.getElementById(i.template+"_seriesIndex"+t+"_pointIndex"+r+e.element.id);v.style.left=R.dataLabel.labelOptions[t].textOptions[r].xPosition+"px",v.style.top=R.dataLabel.labelOptions[t].textOptions[r].yPosition+"px"}}(n)}}(M);for(var A=0;A<e.series.length;A++)if(e.series[A].enableAnimation&&e.animateSeries){e.series[A].marker.dataLabel.template&&this.animateDataLabelTemplate(A,e);var k=document.getElementById(e.element.id+"_svg_seriesCollection"+A);this.performAnimation(e,k,A)}},e.prototype.drawSeries=function(e,t,i,r){var o=this,n=e.renderer.createGroup({id:e.element.id+"_svg_seriesCollection"+t,"clip-path":"url(#"+e.element.id+"_ChartSeriesClipRect_"+t+")"});n.setAttribute("visibility",e.series[t].visibility),i.appendChild(n);for(var a,s,l="",h=(e.series[t].marker,e.series[t].points.length-1),c=0;c<h;c++){var d=this.pointsRegion[t][c].point,p=this.pointsRegion[t][c+1].point;l=l+"M "+d.x+" "+d.y+" L "+p.x+" "+p.y+" "}a=l.toString();var u=e.series[t].fill||e.seriesColors[t%e.seriesColors.length],g={text:e.series[t].name,fill:u,name:"seriesRender",cancel:!1},y=function(i){if(!i.cancel){var l=new el(e.element.id+"_series"+t+"_points","none",e.series[t].width,g.fill,e.series[t].opacity,"none",a);o.clipRectElement=e.renderer.drawClipPath(new tl(e.element.id+"_ChartSeriesClipRect_"+t,"transparent",{width:1,color:"Gray"},1,{x:r.x,y:r.y,width:e.availableSize.width,height:e.availableSize.height})),n.appendChild(o.clipRectElement);var h=e.renderer.createGroup({id:e.element.id+"_svg"+t});s=e.renderer.drawPath(l),h.appendChild(s),n.appendChild(h)}};y.bind(this),e.trigger("seriesRender",g,y),(new Il).drawMarker(e,t,n,this.pointsRegion[t]),this.dataLabel.drawDataLabel(e,t,n,this.pointsRegion[t],r)},e.prototype.animateDataLabelTemplate=function(e,t){for(var i=t.series[e].points.length,r=parseFloat(t.series[e].animationDuration),o=0;o<i;o++){var n=document.getElementById(t.series[e].marker.dataLabel.template+"_seriesIndex"+e+"_pointIndex"+o+t.element.id);n.style.visibility="hidden",mt(t,n,0,r,"FadeIn")}},e.prototype.performAnimation=function(e,i,r){var o,n=new t.Animation({}),a=(document.getElementById("container_svg_seriesCollections"),i.childNodes[0].childNodes[0].childNodes[0]),s=St("Linear"),l=St("Reverse"),h=+a.getAttribute("width"),c=+a.getAttribute("x");n.animate(a,{duration:parseFloat(e.series[r].animationDuration),progress:function(t){"Impedance"===e.renderType?(o=s(t.timeStamp-t.delay,0,h,t.duration),a.setAttribute("width",o.toString())):(o=l(t.timeStamp-t.delay,h,0,t.duration),a.setAttribute("x",o.toString()))},end:function(t){"Impedance"===e.renderType?a.setAttribute("width",h.toString()):a.setAttribute("x",c.toString());var i={cancel:!1,name:"animationComplete",smithchart:e.isBlazor?null:e};e.trigger("animationComplete",i)}})},e.prototype.getLocation=function(e,t){var i,r;return i=this.location[e][t].x,r=this.location[e][t].y,{x:i,y:r}},e}(),Bl=function(){function e(e){this.control=e}return e.prototype.print=function(e){this.smithchartPrint=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.smithchartPrint.moveTo(0,0),this.smithchartPrint.resizeTo(screen.availWidth,screen.availHeight);var i={cancel:!1,htmlContent:this.getHTMLContent(e),name:"beforePrint"};this.control.trigger("beforePrint",i),i.cancel||t.print(i.htmlContent,this.smithchartPrint)},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");return e?e instanceof Array?e.forEach(function(e){i.appendChild(ct(e).cloneNode(!0))}):e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(ct(e).cloneNode(!0)):i.appendChild(this.control.element.cloneNode(!0)),i},e.prototype.export=function(e,i,r){var n=this,a=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:this.control.availableSize.width.toString(),height:this.control.availableSize.height.toString()}}),s=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var l='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+this.control.svgObject.outerHTML+"</svg>",h=window.URL.createObjectURL(new Blob("SVG"===e?[l]:[(new XMLSerializer).serializeToString(this.control.svgObject)],{type:"image/svg+xml"}));if("SVG"===e)this.triggerDownload(i,e,h,s);else{var c=new Image,d=a.getContext("2d");c.onload=function(){if(d.drawImage(c,0,0),window.URL.revokeObjectURL(h),"PDF"===e){var t=new o.PdfDocument,l=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=r,l=l.slice(l.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(l),0,0,n.control.availableSize.width-60,n.control.availableSize.height),s&&(t.save(i+".pdf"),t.destroy())}else n.triggerDownload(i,e,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s)},c.src=h}},e.prototype.triggerDownload=function(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},e}(),Fl=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Vl=function(e){function i(t,i){return e.call(this,t,i)||this}return Fl(i,e),i.prototype.getModuleName=function(){return"smithchart"},i.prototype.getPersistData=function(){return""},i.prototype.createChartSvg=function(){this.removeSvg(),ht(this)},i.prototype.renderTitle=function(e,i,r){var o,n=this,a=e.font?e.font:e.textStyle,s=ft(e.text,a),l=e.textAlignment,h=e.text,c=t.isNullOrUndefined(e.maximumWidth)?Math.abs(this.margin.left+this.margin.right-this.availableSize.width):e.maximumWidth,d=s.width>c;o=s.width>this.availableSize.width?this.margin.left+this.border.width:"Center"===l?this.availableSize.width/2-s.width/2:"Near"===l?this.margin.left+this.elementSpacing+this.border.width:this.availableSize.width-s.width-(this.margin.right+this.elementSpacing+this.border.width);var p=this.margin.top+s.height/2+this.elementSpacing;e.enableTrim&&d&&(h=dt(c,e.text,a),s=ft(h,a)),r=this.renderer.createGroup({id:this.element.id+"_Title_Group"});var u,g={text:h,x:o,y:p,name:"titleRender",cancel:!1},y=function(t){if(!t.cancel){u=new rl(n.element.id+"_Smithchart_"+i,t.x,t.y,"start",t.text),a.fontFamily=n.themeStyle.fontFamily||e.textStyle.fontFamily,a.size=n.themeStyle.fontSize||e.textStyle.size,Ct(u,a,n.themeStyle.chartTitle,r).setAttribute("aria-label",e.description||t.text);var o={x:t.x,y:t.y,textSize:s};n.svgObject.appendChild(r),""!==e.subtitle.text&&e.subtitle.visible&&n.renderSubtitle(e,i,s,n.availableSize,o,r)}};y.bind(this),this.trigger("titleRender",g,y)},i.prototype.renderSubtitle=function(e,i,r,o,n,a){var s=this,l=e.subtitle.textStyle,h=e.subtitle,c=ft(h.text,l),d=h.text,p=t.isNullOrUndefined(h.maximumWidth)?.75*this.bounds.width:h.maximumWidth;h.enableTrim&&c.width>p&&(d=dt(p,h.text,l));var u="Far"===e.subtitle.textAlignment?n.x+n.textSize.width:"Near"===e.subtitle.textAlignment?n.x:n.x+n.textSize.width/2,g=n.y+2*this.elementSpacing,y="Far"===e.subtitle.textAlignment?"end":"Near"===e.subtitle.textAlignment?"start":"middle",m={text:d,x:u,y:g,name:"subtitleRender",cancel:!1},v=function(e){if(!e.cancel){var t=Ct(new rl(s.element.id+"_Smithchart_"+i,e.x,e.y,y,e.text),l,s.themeStyle.chartTitle,a);t.setAttribute("aria-label",h.description||e.text),a.appendChild(t)}};v.bind(this),this.trigger("subtitleRender",m,v)},i.prototype.renderBorder=function(){var e=this.border;this.background=this.background?this.background:this.themeStyle.background;var t=new tl(this.element.id+"_SmithchartBorder",this.background,e,1,new Ds(e.width/2,e.width/2,this.availableSize.width-e.width,this.availableSize.height-e.width));this.svgObject.appendChild(this.renderer.drawRectangle(t))},i.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"background":case"border":case"series":case"legendSettings":case"radius":i=!0;break;case"size":this.createChartSvg(),i=!0;break;case"theme":case"renderType":this.animateSeries=!0,i=!0}i&&this.render()},i.prototype.preRender=function(){this.isBlazor=t.isBlazor(),this.allowServerDataBinding=!1,this.trigger("load",{smithchart:this.isBlazor?null:this}),this.unWireEVents(),this.initPrivateVariable(),this.wireEVents()},i.prototype.initPrivateVariable=function(){this.animateSeries=!0},i.prototype.setTheme=function(){this.themeStyle=Lt(this.theme),this.seriesColors=Pt(this.theme)},i.prototype.render=function(){this.createChartSvg(),this.element.appendChild(this.svgObject),this.setTheme(),this.createSecondaryElement(),this.renderBorder(),this.smithchartLegendModule&&this.legendSettings.visible&&(this.legendBounds=this.smithchartLegendModule.renderLegend(this)),this.legendBounds=this.legendBounds?this.legendBounds:{x:0,y:0,width:0,height:0};var e=new Ol;this.bounds=e.calculateAreaBounds(this,this.title,this.legendBounds),""!==this.title.text&&this.title.visible&&this.renderTitle(this.title,"title",null);var t=new El;t.renderArea(this,this.bounds),this.seriesrender=new Dl,this.seriesrender.draw(this,t,this.bounds),this.renderComplete(),this.allowServerDataBinding=!0,this.trigger("loaded",{smithchart:this.isBlazor?null:this})},i.prototype.createSecondaryElement=function(){if(t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var e=t.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"z-index:1;"});this.element.appendChild(e);var i=this.element.getBoundingClientRect(),r=document.getElementById(this.element.id+"_svg");if(r){var o=r.getBoundingClientRect();e.style.left=Math.max(o.left-i.left,0)+"px",e.style.top=Math.max(o.top-i.top,0)+"px"}}else bt(this.element.id+"_Secondary_Element")},i.prototype.destroy=function(){this.element&&(this.unWireEVents(),e.prototype.destroy.call(this),this.element.classList.remove("e-smithchart"),this.removeSvg(),this.svgObject=null)},i.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.smithchartOnClick,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize.bind(this))},i.prototype.mouseMove=function(e){"touchmove"===e.type?this.isTouch=!0:this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,this.tooltipRenderModule&&!this.isTouch&&this.tooltipRenderModule.smithchartMouseMove(this,e)},i.prototype.mouseEnd=function(e){if("touchend"===e.type?this.isTouch=!0:this.isTouch="touch"===e.pointerType||"2"===e.pointerType,this.tooltipRenderModule&&this.isTouch){var t=this.tooltipRenderModule.smithchartMouseMove(this,e);t&&(this.fadeoutTo=+setTimeout(function(){t.fadeOut()},2e3))}},i.prototype.smithchartOnClick=function(e){var t=e.target.id,i=document.getElementById(t).parentElement;if("containerlegendItem_Group"===document.getElementById(i.id).parentElement.id&&this.legendSettings.toggleVisibility){for(var r=i.childNodes[1],o=i.childNodes[0],n=r.textContent,a=void 0,s=void 0,l=0;l<this.smithchartLegendModule.legendSeries.length;l++)n===this.smithchartLegendModule.legendSeries[l].text&&(a=this.smithchartLegendModule.legendSeries[l].seriesIndex,s=this.smithchartLegendModule.legendSeries[l].fill);var h=document.getElementById(this.element.id+"_svg_seriesCollection"+a);"visible"===h.getAttribute("visibility")?(o.setAttribute("fill","gray"),h.setAttribute("visibility","hidden"),this.series[a].visibility="hidden"):(o.setAttribute("fill",s),h.setAttribute("visibility","visible"),this.series[a].visibility="visible")}},i.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.smithchartOnClick),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMove),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEnd),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize)},i.prototype.print=function(e){new Bl(this).print(e)},i.prototype.export=function(e,t,i){new Bl(this).export(e,t,i)},i.prototype.smithchartOnResize=function(){var e=this;return this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.render()},500),!1},i.prototype.requiredModules=function(){var e=[];this.legendSettings.visible&&e.push({member:"SmithchartLegend",args:[this]});for(var t=0;t<this.series.length;t++)if(this.series[t].tooltip.visible){e.push({member:"TooltipRender",args:[this]});break}return e},i.prototype.removeSvg=function(){bt(this.element.id+"_Secondary_Element");if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},Nl([t.Property("Impedance")],i.prototype,"renderType",void 0),Nl([t.Property("")],i.prototype,"width",void 0),Nl([t.Property("")],i.prototype,"height",void 0),Nl([t.Property("Material")],i.prototype,"theme",void 0),Nl([t.Complex({},Is)],i.prototype,"margin",void 0),Nl([t.Complex({},Es)],i.prototype,"font",void 0),Nl([t.Complex({},zs)],i.prototype,"border",void 0),Nl([t.Complex({},wl)],i.prototype,"title",void 0),Nl([t.Collection([{}],_l)],i.prototype,"series",void 0),Nl([t.Complex({},dl)],i.prototype,"legendSettings",void 0),Nl([t.Complex({},vl)],i.prototype,"horizontalAxis",void 0),Nl([t.Complex({},vl)],i.prototype,"radialAxis",void 0),Nl([t.Property(null)],i.prototype,"background",void 0),Nl([t.Property(10)],i.prototype,"elementSpacing",void 0),Nl([t.Property(1)],i.prototype,"radius",void 0),Nl([t.Event()],i.prototype,"beforePrint",void 0),Nl([t.Event()],i.prototype,"animationComplete",void 0),Nl([t.Event()],i.prototype,"load",void 0),Nl([t.Event()],i.prototype,"loaded",void 0),Nl([t.Event()],i.prototype,"legendRender",void 0),Nl([t.Event()],i.prototype,"titleRender",void 0),Nl([t.Event()],i.prototype,"subtitleRender",void 0),Nl([t.Event()],i.prototype,"textRender",void 0),Nl([t.Event()],i.prototype,"axisLabelRender",void 0),Nl([t.Event()],i.prototype,"seriesRender",void 0),Nl([t.Event()],i.prototype,"tooltipRender",void 0),i=Nl([t.NotifyPropertyChanges],i)}(t.Component),jl=function(){function e(){}return e.prototype.smithchartMouseMove=function(e,t){var i,r,o;"touchend"===t.type||"touchmove"===t.type?(r=(i=t).changedTouches[0].clientX,o=i.changedTouches[0].clientY,this.tooltipElement=void 0):(o=t.clientY,r=t.clientX),this.setMouseXY(e,r,o);for(var n=0;n<e.series.length;n++){var a=e.series[n],s=n,l=new Gs;if((l=this.closestPointXY(e,this.mouseX,this.mouseY,a,s)).location&&a.tooltip.visible&&"visible"===a.visibility){this.createTooltip(e,t,l.index,s,a);break}this.tooltipElement&&(this.tooltipElement.enable&&!a.tooltip.template&&(this.tooltipElement.enable=!1),this.tooltipElement.fadeOut())}return this.tooltipElement},e.prototype.setMouseXY=function(e,t,i){var r=document.getElementById(e.element.id+"_svg");if(e.element&&r){var o=e.element.getBoundingClientRect(),n=r.getBoundingClientRect();this.mouseX=t-o.left-Math.max(n.left-o.left,0),this.mouseY=i-o.top-Math.max(n.top-o.top,0)}},e.prototype.createTooltip=function(e,r,o,n,a){var s=this,l=a.points[o],h=[l.resistance+" : <b>"+l.reactance+"</b>"],c={cancel:!1,name:"tooltipRender",text:(l.tooltip?[l.tooltip]:null)||h,headerText:"<b>"+a.name+"</b>",template:a.tooltip.template,point:l},d=function(r){var o=e.series[n].marker.height/2,h=document.getElementById(e.element.id+"_smithchart_tooltip_div");t.isNullOrUndefined(h)&&(h=t.createElement("div",{id:e.element.id+"_smithchart_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),document.getElementById(e.element.id+"_Secondary_Element").appendChild(h)),s.tooltipElement=new i.Tooltip({enable:!0,header:r.headerText,content:r.text,border:a.tooltip.border,fill:a.tooltip.fill||e.themeStyle.tooltipFill,opacity:a.tooltip.opacity,data:l,template:r.template,location:{x:s.locationX+e.element.offsetLeft,y:s.locationY-o+e.element.offsetTop},shared:!1,areaBounds:new Ds(e.bounds.x,e.bounds.y,e.bounds.width,e.bounds.height),palette:[a.fill||e.seriesColors[n%e.seriesColors.length]],shapes:["Circle"],availableSize:e.availableSize,theme:e.theme,blazorTemplate:{name:"TooltipTemplate",parent:e.series[n].tooltip}}),s.tooltipElement.opacity=e.themeStyle.tooltipFillOpacity||s.tooltipElement.opacity,s.tooltipElement.textStyle.fontFamily=e.themeStyle.fontFamily||"Roboto, Segoe UI, Noto, Sans-serif",s.tooltipElement.textStyle.opacity=e.themeStyle.tooltipTextOpacity||s.tooltipElement.textStyle.opacity,s.tooltipElement.textStyle.color=e.themeStyle.tooltipBoldLabel||s.tooltipElement.textStyle.color,s.tooltipElement.appendTo(h)};d.bind(this,e),e.trigger("tooltipRender",c,d)},e.prototype.closestPointXY=function(e,t,i,r,o){for(var n,a,s,l=0;l<r.points.length;l++){a=e.seriesrender.getLocation(o,l),this.locationX=a.x,this.locationY=a.y,n=l;var h=t-a.x,c=i-a.y;if(Math.abs(Math.sqrt(h*h+c*c))<r.marker.width){s=a,n=l;break}}return{location:s,index:n}},e.prototype.getModuleName=function(){return"TooltipRender"},e.prototype.destroy=function(){},e}(),Hl=function(){function e(){this.legendSeries=[]}return e.prototype.renderLegend=function(e){return this.calculateLegendBounds(e),this._drawLegend(e),this.legendActualBounds},e.prototype.calculateLegendBounds=function(e){this.legendSeries=[];var t,i,r=e.legendSettings,o=r.height,n=r.width,a=r.itemPadding>0?r.itemPadding:0,s=r.position.toLowerCase(),l=r.title.textStyle,h=0,c=0,d=0,p=e.availableSize.width-(4*e.elementSpacing-2*r.border.width+2*e.border.width),u=r.rowCount,g=r.columnCount,y=ft(e.legendSettings.title.text,l),m=0,v=0,f=0,b=0,x=0,w=e.series.length;if(e.legendSettings.visible&&0!==w){"bottom"===s||"top"===s||"custom"===s?(u&&g&&u<=g?u=w/g:null==u&&null!=g?u=w/g:null==u&&null==g&&(u=1),u&&(t=Math.ceil(w/u))):(u&&g&&u<=g?g=w/u:null!=u&&null==g?g=w/u:null==u&&null==g&&(g=1),g&&(t=g));for(var S=0;S<w;S++){this.legendSeries.push({text:e.series[S].name?e.series[S].name:"series"+S,seriesIndex:S,shape:e.legendSettings.shape,fill:e.series[S].fill||e.seriesColors[S%e.seriesColors.length],bounds:null});var C=this._getLegendSize(e,this.legendSeries[S]);h=Math.max(C.width,h),c=Math.max(C.height,c),this.legendSeries[S].bounds={width:h,height:c},x+=1,f=f+h+a,b=Math.max(c,b),"top"!==s&&"bottom"!==s&&"custom"!==s||f>p&&(f-=C.width+a,m=Math.max(m,f),f=C.width+a,v=v+b+a),x!==t&&S!==w-1||(m=Math.max(m,f),d=v=v+b+a,x=0,b=0,f=0)}i={x:0,y:0,width:y.width>m-a?y.width+20+a:m+20-2*e.border.width,height:d+e.elementSpacing}}this.legendActualBounds=i,null!=n&&(this.legendActualBounds.width=n),null!=o&&(this.legendActualBounds.height=o)},e.prototype._getLegendSize=function(e,t){var i=e.legendSettings,r=i.itemStyle.width,o=i.itemStyle.height,n=ft(t.text,i.textStyle);return{width:r+n.width+i.shapePadding,height:Math.max(o,n.height)}},e.prototype._drawLegend=function(e){var t,i,r=e.legendSettings,o=r.position.toLowerCase(),n=r.alignment,a=this.legendActualBounds,s=0,l=e.title.font?e.title.font:e.title.textStyle,h=ft(e.title.text,l).height,c=ft(e.title.subtitle.text,e.title.subtitle.textStyle).height,d=e.elementSpacing,p=h+c+d+e.margin.top,u=r.itemPadding>0?r.itemPadding:0,g=e.availableSize.width,y=e.availableSize.height,m=r.border.width,v=0,f=ft(r.title.text,r.title.textStyle).height,b=e.border.width,x=g-2*b,w=y-2*b;if(a.height+=f,"custom"!==o){switch(o){case"bottom":a.y=w-(a.height+m+d);break;case"top":a.y=b+p;break;case"right":a.x=x-a.width-2*d;break;case"left":a.x=b+2*d}if("left"===o||"right"===o)switch(n){case"Center":a.y=w/2-(a.height+2*m)/2+d/2;break;case"Near":a.y=b+2*d+p;break;case"Far":a.y=w-(a.height+m)-2*d}else switch(n){case"Center":a.x=x/2-(a.width+2*m)/2+d/2;break;case"Near":a.x=b+2*d;break;case"Far":a.x=x-(a.width+m)-2*d}}else a.y=r.location.y<w?r.location.y:0,a.x=r.location.x<x?r.location.x:0;if("bottom"===o||"top"===o)for(var S=0;S<this.legendSeries.length;S++)if((v+=this.legendSeries[S].bounds.width+u)>x){a.x=x/2-(a.width+2*m)/2+d/2;break}var C=e.renderer.createGroup({id:e.element.id+"_legend_group"});e.svgObject.appendChild(C),this.legendItemGroup=e.renderer.createGroup({id:e.element.id+"legendItem_Group"});var P=t=d,L=i=d;""!==r.title.text&&r.title.visible&&(C.appendChild(this.drawLegendTitle(e,r,a,C)),L=i=d+f);for(var R=0;R<this.legendSeries.length;R++)!(r.rowCount<r.columnCount||r.rowCount===r.columnCount)||"top"!==o&&"bottom"!==o&&"custom"!==o?(L+this.legendSeries[R].bounds.height+u+f+b>a.height+i&&(L=i,P+=s+u),this.legendGroup=this.drawLegendItem(e,r,this.legendSeries[R],R,P,L,a),C.appendChild(this.legendGroup),L+=this.legendSeries[R].bounds.height+u,s=Math.max(s,this.legendSeries[R].bounds.width)):(P+this.legendSeries[R].bounds.width>a.width+t&&(P=d,L+=this.legendSeries[R].bounds.height+u),this.legendGroup=this.drawLegendItem(e,r,this.legendSeries[R],R,P,L,a),C.appendChild(this.legendGroup),P+=this.legendSeries[R].bounds.width+u);C.setAttribute("transform","translate("+a.x.toString()+","+a.y.toString()+")"),this.drawLegendBorder(C,e,r,a)},e.prototype.drawLegendBorder=function(e,t,i,r){var o=new tl(t.element.id+"_svg_legendRect","none",i.border,1,new Ds(0,0,r.width,r.height));e.appendChild(t.renderer.drawRectangle(o))},e.prototype.drawLegendTitle=function(e,t,i,r){var o=e.elementSpacing,n=ft(t.title.text,t.title.textStyle),a=n.width,s=n.height,l=t.title.textAlignment,h=0,c=i.width,d=o+s/2;switch(l){case"Far":h=c-a-h;break;case"Center":h=c/2-a/2}h<0&&(h=0,c=a),c<a+h&&(c=a+h);var p=Ct(new rl(e.element.id+"_LegendTitleText",h,d,"start",t.title.text),t.title.textStyle,e.themeStyle.legendLabel,r);return p.setAttribute("aria-label",t.title.description||t.title.text),p},e.prototype.drawLegendItem=function(e,t,i,r,o,n,a){var s,l,h=this,c=t.itemStyle;t.itemPadding;Math.sqrt(c.width*c.width+c.height*c.height),l=ft(i.text,t.textStyle).height,s={x:o+c.width/2,y:n+(l>c.height?l:c.height)/2};var d=e.renderer.createGroup({id:e.element.id+"_svg_Legend"+r.toString()});d.style.cursor=t.toggleVisibility?"pointer":"default";var p={text:i.text,fill:i.fill,shape:i.shape,name:"legendRender",cancel:!1},u=function(o){if(!o.cancel){var n=h.drawLegendShape(e,i,s.x,s.y,r,t,o);d.appendChild(n);var a=new rl(e.element.id+"_LegendItemText"+r.toString(),s.x+c.width/2+t.shapePadding,s.y+l/4,"start",o.text);t.textStyle.fontFamily=e.themeStyle.fontFamily||t.textStyle.fontFamily,t.textStyle.size=e.themeStyle.fontSize||t.textStyle.size;var p=Ct(a,t.textStyle,e.themeStyle.legendLabel,d);p.setAttribute("aria-label",t.description||"Click to show or hide the "+a.text+" series"),d.appendChild(p),h.legendItemGroup.appendChild(d)}};return u.bind(this),e.trigger("legendRender",p,u),this.legendItemGroup},e.prototype.drawLegendShape=function(e,t,i,r,o,n,a){var s,l,h,c,d=n.itemStyle,p=d.width,u=d.height,g=i+-p/2,y={color:d.border.color,width:d.border.width},m="visible"===e.series[o].visibility?a.fill:"grey",v=a.shape.toLowerCase(),f=Math.sqrt(u*u+p*p)/2;switch(v){case"circle":l=new il(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y,1,i,r,f,null),s=e.renderer.drawCircle(l);break;case"rectangle":c="M "+g+" "+(r+-u/2)+" L "+(p/2+i)+" "+(r+-u/2)+" L "+(i+p/2)+" "+(r+u/2)+" L "+g+" "+(r+u/2)+" L "+g+" "+(r+-u/2)+" z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"diamond":c="M "+g+" "+r+" L "+i+" "+(r+-u/2)+" L "+(p/2+i)+" "+r+" L "+i+" "+(r+u/2)+" L "+g+" "+r+" z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"pentagon":for(var b=0;b<=5;b++){var x=f*Math.cos(Math.PI/180*(72*b)),w=f*Math.sin(Math.PI/180*(72*b));c=0===b?"M "+(x+i)+" "+(r+w)+" ":c.concat("L "+(i+x)+" "+(r+w)+" ")}c=c.concat("Z"),h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"triangle":c="M "+g+" "+(u/2+r)+" L "+i+" "+(r+-u/2)+" L "+(i+p/2)+" "+(r+u/2)+" L "+g+" "+(r+u/2)+" Z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h)}return s},e.prototype.getModuleName=function(){return"SmithchartLegend"},e.prototype.destroy=function(e){},e}(),Xl=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Gl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property("")],i.prototype,"color",void 0),Yl([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Wl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"size",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property("Roboto, Segoe UI, Noto, Sans-serif")],i.prototype,"fontFamily",void 0),Yl([t.Property(null)],i.prototype,"fontWeight",void 0),Yl([t.Property(null)],i.prototype,"fontStyle",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Ul=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Zl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property("")],i.prototype,"fill",void 0),Yl([t.Property("")],i.prototype,"template",void 0),Yl([t.Property("")],i.prototype,"format",void 0),Yl([t.Complex({color:"#cccccc",width:.5},Gl)],i.prototype,"border",void 0),Yl([t.Complex({size:"13px",fontWeight:"Normal",fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},Wl)],i.prototype,"textStyle",void 0),Yl([t.Complex({},Ul)],i.prototype,"trackLineSettings",void 0),i}(t.ChildProperty),ql=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property("transparent")],i.prototype,"background",void 0),Yl([t.Complex({},Gl)],i.prototype,"border",void 0),i}(t.ChildProperty),Ql=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property("")],i.prototype,"dashArray",void 0),Yl([t.Property(1)],i.prototype,"width",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),$l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"startRange",void 0),Yl([t.Property(null)],i.prototype,"endRange",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Jl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"minX",void 0),Yl([t.Property(null)],i.prototype,"maxX",void 0),Yl([t.Property(null)],i.prototype,"minY",void 0),Yl([t.Property(null)],i.prototype,"maxY",void 0),Yl([t.Property(0)],i.prototype,"value",void 0),Yl([t.Complex({},Ql)],i.prototype,"lineSettings",void 0),i}(t.ChildProperty),Kl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(5)],i.prototype,"left",void 0),Yl([t.Property(5)],i.prototype,"right",void 0),Yl([t.Property(5)],i.prototype,"bottom",void 0),Yl([t.Property(5)],i.prototype,"top",void 0),i}(t.ChildProperty),eh=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property([])],i.prototype,"visible",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),Yl([t.Property(5)],i.prototype,"size",void 0),Yl([t.Property("#00bdae")],i.prototype,"fill",void 0),Yl([t.Complex({width:1},Gl)],i.prototype,"border",void 0),i}(t.ChildProperty),th=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(0)],i.prototype,"x",void 0),Yl([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),ih=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property([])],i.prototype,"visible",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),Yl([t.Property("transparent")],i.prototype,"fill",void 0),Yl([t.Property("")],i.prototype,"format",void 0),Yl([t.Complex({color:"transparent",width:0},Gl)],i.prototype,"border",void 0),Yl([t.Complex({size:"14px",fontWeight:"Medium",fontStyle:"Medium",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},Wl)],i.prototype,"textStyle",void 0),Yl([t.Complex({},th)],i.prototype,"offset",void 0),Yl([t.Property("None")],i.prototype,"edgeLabelMode",void 0),i}(t.ChildProperty),rh=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oh=function(){function e(e,t){this.width=e,this.height=t}return e}(),nh=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),ah=function(){function e(e,t,i,r,o,n,a){this.id=e,this.fill=t,this.opacity=o,this["stroke-width"]=i,this.stroke=r,this.d=a,this["stroke-dasharray"]=n}return e}(),sh=function(e){function t(t,i,r,o,n,a,s,l,h){void 0===a&&(a=0),void 0===s&&(s=0),void 0===l&&(l=0),void 0===h&&(h=0);var c=e.call(this,t,i,r.width,r.color,o)||this;return c.rect=n,c.topLeft=a,c.topRight=s,c.bottomLeft=l,c.bottomRight=h,c}return rh(t,e),t}(ah),lh=function(e){function t(t,i,r,o,n,a,s,l){var h=e.call(this,t,i,r.width,r.color,o)||this;return h.cy=a,h.cx=n,h.r=s,h["stroke-dasharray"]=l,h}return rh(t,e),t}(ah),hh=function(){function e(e,t,i,r,o,n,a){void 0===a&&(a=""),this.transform="",this.baseLine="auto",this.id=e,this.x=t,this.y=i,this.anchor=r,this.text=o,this.transform=a,this.baseLine=n}return e}(),ch=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]]);return i},dh=function(){function e(e){this.sparkline=e}return e.prototype.processData=function(){var e=this.sparkline.dataSource;!t.isNullOrUndefined(e)&&e.length&&(isNaN(this.sparkline.dataSource[0])&&"Numeric"!==this.sparkline.valueType?this["process"+this.sparkline.valueType]():(e=this.sparkline.enableRtl?e.reverse():e,this.sparkline.sparklineData=e),this.axisCalculation())},e.prototype.processDataManager=function(){var e,t,i=this;this.sparkline.dataSource instanceof r.DataManager?(e=this.sparkline.dataSource,t=this.sparkline.query instanceof r.Query?this.sparkline.query:new r.Query,e.executeQuery(t).then(function(e){i.sparkline.setProperties({dataSource:e.result},!0),i.sparkline.sparklineData=i.sparkline.dataSource,i.sparkline.processSparklineData()})):this.sparkline.processSparklineData()},e.prototype.processCategory=function(e,t,i){var r=this;void 0===e&&(e=this.sparkline.dataSource),void 0===t&&(t=this.sparkline.xName),void 0===i&&(i=this.sparkline.yName);var o=[],n=[];e.forEach(function(e){-1===n.indexOf(e[t])&&n.push(e[t]);var a={};a[r.sparkline.xName]=n.indexOf(e[t]),a[r.sparkline.yName]=e[i],o.push(a)}),this.sparkline.sparklineData=o},e.prototype.processDateTime=function(e,t,i){void 0===e&&(e=this.sparkline.dataSource),void 0===t&&(t=this.sparkline.xName),void 0===i&&(i=this.sparkline.yName);var r=[];e.forEach(function(e){var o={};o[t]=e[t].getTime(),o[i]=e[i],r.push(o)}),this.sparkline.sparklineData=r},e.prototype.renderSeries=function(){var e=this,t=this.sparkline;this.clipId=t.element.id+"_sparkline_clip_path",this.drawAxis();var i={name:"seriesRendering",cancel:!1,lineWidth:t.lineWidth,border:t.border,fill:t.fill,sparkline:this.sparkline.isBlazor?null:t},r=function(i){if(e.visiblePoints&&!i.cancel){if("Pie"!==t.type&&"WinLoss"!==t.type&&t.rangeBandSettings.length){for(var r=e.sparkline.renderer.createGroup({id:e.sparkline.element.id+"_sparkline_rangeband_g"}),o=0;o<t.rangeBandSettings.length;o++)(t.axisSettings.minY<=t.rangeBandSettings[o].startRange||t.axisSettings.maxY>=t.rangeBandSettings[o].endRange)&&e.rangeBand(t.rangeBandSettings[o],r,o);e.sparkline.svgObject.appendChild(r)}e["render"+t.type](e.visiblePoints,i),e.renderMarker(e.visiblePoints),e.renderLabel(e.visiblePoints)}};r.bind(this),t.trigger("seriesRendering",i,r)},e.prototype.rangeBand=function(e,t,i){var r=this.sparkline,o=r.availableSize.height-2*r.padding.top,n=r.availableSize.width-2*r.padding.left,a=e.startRange,s=e.endRange,l=o-o/this.unitY*(a-this.min)+r.padding.top,h=o-o/this.unitY*(s-this.min)+r.padding.top,c=e.color||this.sparkline.sparkTheme.rangeBandColor;h>o+r.padding.top?h=o+r.padding.top:h<0+r.padding.top&&(h=0+r.padding.top),l>o+r.padding.top?l=o+r.padding.top:l<0+r.padding.top&&(l=0+r.padding.top);var d="M "+r.padding.left+" "+l+" L "+(n+r.padding.left)+" "+l+" L "+(n+r.padding.left)+" "+h+" L "+r.padding.left+" "+h+" Z ",p={id:r.element.id+"_rangeBand_"+i,fill:c,opacity:e.opacity,stroke:"transparent","stroke-width":r.lineWidth,d:d,"stroke-dasharray":""};It(this.sparkline,p,t)},e.prototype.renderLine=function(e,t){var i=this.sparkline,r=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=this.sparkline.fill;o="#00bdae"===this.sparkline.fill&&"Bootstrap4"===this.sparkline.theme?this.sparkline.sparkTheme.axisLineColor:o;for(var n=new ah(i.element.id+"_sparkline_line","transparent",t.lineWidth,o,i.opacity),a="",s=0,l=e.length;s<l;s++)0===s&&(a="M "+e[0].x+" "+e[s].y+" "),a+="L "+e[s].x+" "+e[s].y+" ";n.d=a,It(this.sparkline,n,r),this.sparkline.svgObject.appendChild(r)},e.prototype.renderPie=function(e,i){var r,o,n,a,s=this.sparkline,l=s.availableSize.height-(s.padding.top+s.padding.bottom),h=s.availableSize.width-(s.padding.left+s.padding.right),c=l<=h?l/2:h/2,d=s.availableSize.width/2,p=s.availableSize.height/2,u=0,g=i.border.color,y=s.opacity,m=i.border.width,v=s.palette.length?s.palette:["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"],f=this.sparkline.renderer.createGroup({id:s.element.id+"_sparkline_g"}),b=t.extend([],[],e);if(s.highPointColor||s.lowPointColor){var x=b.map(function(e){return e.yVal});n=Math.min.apply(null,x),a=Math.max.apply(null,x)}this.negativePointIndexes=[];for(var w=0,S=90,C=void 0,P=void 0;w<e.length;w++){C=(S+=u)+(u=e[w].degree),r=(S-90)*Math.PI/180,o=(C-90)*Math.PI/180,e[w].stAng=r,e[w].endAng=o,P=u<180?"0":"1";var L=e[w].coordinates={sX:d+c*Math.cos(r),sY:p+c*Math.sin(r),eX:d+c*Math.cos(o),eY:p+c*Math.sin(o)},R="M "+d+" "+p+" L "+L.eX+" "+L.eY+" A "+c+" "+c+" 0 "+P+",0 "+L.sX+" "+L.sY+" Z",M={id:s.element.id+"_sparkline_pie_"+w,opacity:y,fill:v[w%v.length],stroke:g,"stroke-width":m,d:R,"stroke-dasharray":""};this.getPieSpecialPoint(e[w],s,M,w,a,n,e.length);var A=this.triggerPointRender("pointRendering",w,M.fill,{color:g,width:m});M.fill=A.fill,M.stroke=A.border.color,M["stroke-width"]=A.border.width,A.cancel||It(this.sparkline,M,f).setAttribute("aria-label",s.dataSource[w][s.xName]+" : "+e[w].yVal);var k=o-r,T={x:d+c/2*Math.cos(r+k/2),y:p+c/2*Math.sin(r+k/2)};e[w].location.x=T.x,e[w].location.y=T.y}this.sparkline.svgObject.appendChild(f)},e.prototype.getPieSpecialPoint=function(e,t,i,r,o,n,a){e.yVal<0&&t.negativePointColor&&(i.fill=t.negativePointColor,this.negativePointIndexes.push(r)),0===r&&t.startPointColor?(i.fill=t.startPointColor,this.startPointIndex=r):r===a-1&&t.endPointColor&&(i.fill=t.endPointColor,this.endPointIndex=r),e.yVal===o&&t.highPointColor?(i.fill=t.highPointColor,this.highPointIndex=r):e.yVal===n&&t.lowPointColor&&(i.fill=t.lowPointColor,this.lowPointIndex=r)},e.prototype.renderArea=function(e,t){for(var i=this.sparkline,r=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=new ah(i.element.id+"_sparkline_area",t.fill,0,"transparent",i.opacity),n="",a="",s=0,l=e.length;s<l;s++)0!==s?a+="L "+e[s].x+" "+e[s].y+" ":(n="M "+e[s].x+" "+this.axisHeight+" ",a="M "+e[s].x+" "+e[s].y+" "),n+="L "+e[s].x+" "+e[s].y+" ",s===l-1&&(n+="L "+e[s].x+" "+this.axisHeight+" Z");o.d=n,It(this.sparkline,o,r),o=new ah(i.element.id+"_sparkline_area_str","transparent",t.border.width,t.border.color,i.opacity,"",a),It(this.sparkline,o,r),this.sparkline.svgObject.appendChild(r)},e.prototype.renderColumn=function(e,i){var r,o,n=this,a=this.sparkline,s=t.extend([],[],e),l=this.sparkline.renderer.createGroup({id:a.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"});if(this.sparkline.highPointColor||this.sparkline.lowPointColor){var h=s.map(function(e){return e.markerPosition});o=Math.min.apply(null,h),r=Math.max.apply(null,h)}var c,d=a.element.id+"_sparkline_column_",p=new sh(d,"",i.border,a.opacity,null),u=a.palette.length,g=e.length;this.negativePointIndexes=[];for(var y=this,m=0;m<g;m++)!function(t){c=e[t],p.id=d+t,p.fill=u?a.palette[t%u]:i.fill,p.rect=new nh(c.x,c.y,c.width,c.height),y.getSpecialPoint(!0,c,a,p,t,o,r,g),c.location.y=c.markerPosition<=y.axisHeight?c.y:c.y+c.height,c.location.x=c.x+c.width/2,p.stroke=i.border.color?i.border.color:p.fill;var s={name:"pointRendering",cancel:!1,pointIndex:t,fill:p.fill,border:{color:p.stroke,width:i.border.width}};if(y.sparkline.isBlazor){var h=ch(s,[]);s=h}y.sparkline.trigger("pointRendering",s,function(){if(c=e[t],p.id=d+t,p.rect=new nh(c.x,c.y,c.width,c.height),n.getSpecialPoint(!0,c,a,p,t,o,r,g),p.fill=s.fill,p.stroke=s.border.color,c.location.y=c.markerPosition<=n.axisHeight?c.y:c.y+c.height,p["stroke-width"]=s.border.width,c.location.x=c.x+c.width/2,!s.cancel){var i=Et(a,p,l);i.setAttribute("aria-label",a.dataSource[t][a.xName]+" : "+e[t].yVal),l.appendChild(i)}})}(m);this.sparkline.svgObject.appendChild(l)},e.prototype.renderWinLoss=function(e,t){for(var i,r=this.sparkline,o=this.sparkline.renderer.createGroup({id:r.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),n=r.element.id+"_sparkline_winloss_",a=new sh(n,"",t.border,r.opacity,null),s=e.length,l=r.palette.length,h=0;h<s;h++){i=e[h],a.id=n+h,a.fill=l?r.palette[h%l]:i.yVal===this.axisValue?this.sparkline.tiePointColor||"#a216f3":i.yVal>this.axisValue?t.fill:r.negativePointColor||"#e20f07",a.stroke=t.border.color?t.border.color:a.fill,a.rect=new nh(i.x,i.y,i.width,i.height),i.location.x=i.x+i.width/2,i.location.y=i.yVal>=this.axisValue?i.y:i.y+i.height;var c=this.triggerPointRender("pointRendering",h,a.fill,{color:a.stroke,width:t.border.width});a.fill=c.fill,a.stroke=c.border.color,a["stroke-width"]=c.border.width,c.cancel||Et(r,a,o).setAttribute("aria-label",r.dataSource[h][r.xName]+" : "+e[h].yVal)}this.sparkline.svgObject.appendChild(o)},e.prototype.renderMarker=function(e){var i=this.sparkline,r=i.markerSettings;if("Pie"!==i.type&&"WinLoss"!==i.type&&r.visible.length){var o,n,a,s=t.extend([],[],e),l=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_marker_g","clip-path":"url(#"+this.clipId+")"}),h=i.element.id+"_sparkline_marker_",c=new lh("",r.fill,r.border,r.opacity,0,0,r.size/2,""),d=r.visible.join();if(d.toLowerCase().indexOf("high")>-1||d.toLowerCase().indexOf("low")>-1){var p=s.map(function(e){return e.markerPosition});n=Math.min.apply(null,p),a=Math.max.apply(null,p)}this.negativePointIndexes=[];for(var u=this,g=0,y=e.length;g<y;g++)!function(t,s){o=e[t],c.id=h+t,c.cx=o.location.x,c.cy=o.location.y,c.fill=r.fill;var p=d.toLowerCase().indexOf("all")>-1;p=u.getSpecialPoint(p,o,i,c,t,n,a,s,d.toLowerCase()),c.stroke=r.border.color||c.fill;var g={name:"markerRendering",cancel:!1,border:{color:c.stroke,width:r.border.width},fill:c.fill,pointIndex:t,sparkline:u.sparkline.isBlazor?null:u.sparkline,x:c.cx,y:c.cy,size:r.size};if(u.sparkline.isBlazor){var y=ch(g,[]);g=y}u.sparkline.trigger("markerRendering",g,function(){if(p&&!g.cancel){c.id=h+t,c.cx=g.x,c.cy=g.y,c.fill=g.fill,c.stroke=g.border.color,c["stroke-width"]=g.border.width,c.r=g.size/2;var r=_t(i,c,l);r.setAttribute("aria-label",i.dataSource[t][i.xName]+" : "+e[t].yVal),l.appendChild(r)}})}(g,y);this.sparkline.svgObject.appendChild(l)}},e.prototype.getSpecialPoint=function(e,t,i,r,o,n,a,s,l){return void 0===l&&(l=""),t.markerPosition>this.axisHeight&&(r.fill=i.negativePointColor||r.fill,this.negativePointIndexes.push(o),e=e||l.indexOf("negative")>-1),0===o?(r.fill=i.startPointColor||r.fill,this.startPointIndex=o,e=e||l.indexOf("start")>-1):o===s-1&&(r.fill=i.endPointColor||r.fill,this.endPointIndex=o,e=e||l.indexOf("end")>-1),t.markerPosition===n?(r.fill=i.highPointColor||r.fill,this.highPointIndex=o,e=e||l.indexOf("high")>-1):t.markerPosition===a&&(r.fill=i.lowPointColor||r.fill,this.lowPointIndex=o,e=e||l.indexOf("low")>-1),l.indexOf("none")>-1&&(e=!1),e},e.prototype.renderLabel=function(e){var i=this,r=this.sparkline,o=r.dataLabelSettings,n=o.textStyle.color||r.sparkTheme.dataLabelColor;if("WinLoss"!==r.type&&o.visible.length){var a,s,l,h=t.extend([],[],e),c=r.element.id+"_sparkline_label_",d=this.sparkline.renderer.createGroup({id:r.element.id+"_sparkline_label_g",style:"pointer-events: none;"}),p=c+"text_",u=c+"rect_",g=new hh("",0,0,"middle","","middle"),y=o.textStyle,m=h.map(function(e){return e.markerPosition}),v=Math.min.apply(null,m),f=Math.max.apply(null,m),b="transparent"!==o.fill||o.border.width?2:0,x=zt("sparkline_measure_text",y),w=new sh("",o.fill,o.border,o.opacity,null);y.fontFamily=r.sparkTheme.labelFontFamily||y.fontFamily;for(var S=this,C=0,P=e.length;C<P;C++)!function(t,h){s=e[t],g.id=p+t,g.x=s.location.x+o.offset.x,g.y=("Pie"===r.type?s.location.y:s.markerPosition>S.axisHeight?s.location.y+x.height/2+1+2+b:s.location.y-x.height/2-1-b)+o.offset.y,g.text=""!==o.format?S.formatter(o.format,S.sparkline.dataSource[t]):s.yVal.toString();var m={name:"dataLabelRendering",cancel:!1,border:o.border,fill:o.fill,pointIndex:t,sparkline:S.sparkline.isBlazor?null:S.sparkline,x:g.x,y:g.y,text:g.text,color:n};if(S.sparkline.isBlazor){var C=ch(m,[]);m=C}S.sparkline.trigger("dataLabelRendering",m,function(){x=zt(m.text,y),g.text=m.text;var e=o.visible.join().toLowerCase().indexOf("all")>-1;e=i.getLabelVisible(e,s,t,o,h,v,f),l=i.arrangeLabelPosition(o.edgeLabelMode,e,m.x,t,h,x,b),e&&!m.cancel&&l.render&&(w.id=u+t,w.fill=m.fill,w.stroke=m.border.color,w["stroke-width"]=m.border.width,g.y=m.y,g.x=l.x,w.rect=new nh(g.x-(x.width/2+b),g.y-b-x.height/1.75,x.width+2*b,x.height+2*b),a=i.sparkline.renderer.createGroup({id:c+"g"+t}),Et(r,w,a),Dt(g,y,m.color,a),d.appendChild(a))})}(C,P);this.sparkline.svgObject.appendChild(d)}},e.prototype.arrangeLabelPosition=function(e,t,i,r,o,n,a){return"None"===e?{x:i,render:t}:(0===r&&i-n.width/2-a<=0?"Hide"===e?t=!1:i=this.sparkline.padding.left+a+n.width/2:r===o-1&&i+n.width/2+a>=this.sparkline.availableSize.width&&("Hide"===e?t=!1:i-=n.width/2+a),{x:i,render:t})},e.prototype.getLabelVisible=function(e,t,i,r,o,n,a){var s=r.visible.join().toLowerCase();return t.markerPosition>this.axisHeight&&(e=e||s.indexOf("negative")>-1),0===i?e=e||s.indexOf("start")>-1:i===o-1&&(e=e||s.indexOf("end")>-1),t.markerPosition===n?e=e||s.indexOf("high")>-1:t.markerPosition===a&&(e=e||s.indexOf("low")>-1),r.visible.join().toLowerCase().indexOf("none")>-1&&(e=!1),e},e.prototype.formatter=function(e,i){if(t.isNullOrUndefined(e))return null;for(var r=0,o=Object.keys(i);r<o.length;r++){var n=o[r];e=e.split("${"+n+"}").join(i[n])}return e},e.prototype.axisCalculation=function(){this.findRanges(this.sparkline.sparklineData)},e.prototype.getInterval=function(e,i){var r=1,o=e[0][i],n=t.isNullOrUndefined(e[1])?void 0:e[1][i];if(!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(n)){var a=[];t.extend([],e).forEach(function(e){t.isNullOrUndefined(e[i])||a.push(e)}),a.sort(function(e,r){return t.isNullOrUndefined(e[i])||t.isNullOrUndefined(r[i])?0:e[i]-r[i]}),r=(a=this.sparkline.enableRtl?a.reverse():a)[1][i]-a[0][i]}return r},e.prototype.getPaddingInterval=function(e,t,i,r){for(var o=this.sparkline.availableSize.height,n=1*e.length,a=r/(n=Math.max(o*(n/100),1)),s=0,l=this.sparkline.intervalDivs;s<l.length;s++){var h=1*l[s];if(n<r/h)break;a=h}return a},e.prototype.findRanges=function(e){var i,r,o,n,a,s=this.sparkline,l=e.length,h=0,c=Array.isArray(e)&&"object"!=typeof e[0];if(c)if("Pie"===s.type)for(_=0;_<l;_++)h+=Math.abs(e[_]);else i=Math.max.apply(null,e),r=Math.min.apply(null,e),o=0,n=l-1;else if("Pie"===s.type)for(_=0;_<l;_++)h+=Math.abs(e[_][s.yName]);else{if(t.isNullOrUndefined(e[0][s.xName])){var d=e.map(function(e){return e[s.yName]});i=Math.max.apply(null,d),r=Math.min.apply(null,d)}else i=(a=(a=t.extend([],e)).sort(function(e,t){return e[s.yName]-t[s.yName]}))[a.length-1][s.yName],r=a[0][s.yName];t.isNullOrUndefined(e[0][s.xName])?(o=0,n=l-1):(a=a.sort(function(e,t){return e[s.xName]-t[s.xName]}),n=(a=this.sparkline.enableRtl?a.reverse():a)[a.length-1][s.xName],o=a[0][s.xName])}var p,u,g,y,m,v=0,f=s.padding,b=s.axisSettings,x=b.value;if("Pie"!==s.type){this.maxLength=l,u=s.availableSize.height-(f.bottom+f.top),g=s.availableSize.width-(f.left+f.right),n=t.isNullOrUndefined(b.maxX)?n:b.maxX,o=t.isNullOrUndefined(b.minX)?o:b.minX,i=t.isNullOrUndefined(b.maxY)?i:b.maxY,r=t.isNullOrUndefined(b.minY)?r:b.minY;var w=b.lineSettings.color||this.sparkline.sparkTheme.axisLineColor,S={name:"axisRendering",cancel:!1,sparkline:this.sparkline.isBlazor?null:s,maxX:n,minX:o,maxY:i,minY:r,value:b.value,lineColor:w,lineWidth:b.lineSettings.width};if(s.trigger("axisRendering",S),S.cancel)return void(this.visiblePoints=[]);n=S.maxX,o=S.minX,i=S.maxY,r=S.minY,x=this.axisValue=S.value,this.axisColor=S.lineColor,this.axisWidth=S.lineWidth}var C=n-o,P=i-r;C=0===C?1:C,P=0===P?1:P,this.unitX=C,this.unitY=P,this.min=r,v=0,y=u-u/P*-r,y=r<0&&i<=0?0:r<0&&i>0?y:u,x>=r&&x<=i&&(y=u-Math.round(u*((x-r)/this.unitY))),this.axisHeight=y+f.top;for(var L,R,M=[],A=i-r,k=this.getInterval(e,s.xName),T=this.getPaddingInterval(e,s.xName,s.valueType,A),_=0;_<l;_++)if(t.isNullOrUndefined(e[_][s.xName])&&t.isNullOrUndefined(e[_][s.yName])&&0!==e[_][s.yName]&&c?(L=_,R=e[_]):t.isNullOrUndefined(e[_][s.xName])?(L=_,R=e[_][s.yName]):(L=e[_][s.xName],R=e[_][s.yName]),!t.isNullOrUndefined(L)&&!t.isNullOrUndefined(R)){if("Line"===s.type||"Area"===s.type)p=r!==i&&1!==l?u-Math.round(u*((R-r)/this.unitY)):f.top,m={x:o!==n?Math.round(g*((L-o)/this.unitX)):g/2,y:p,markerPosition:p};else if("Column"===s.type||"WinLoss"===s.type){var O=g/((n-o)/k+1);if(O-=1,v=(L-o)/k*(O+1)+.5,"WinLoss"===s.type){m={x:v,y:p=R>x?u/4:R<x?.5*u:.5*u-u/40,height:R!==x?u/4:u/20,width:O,markerPosition:p>y?y+Math.abs(p-y):p}}else{0===_&&"None"!==s.rangePadding&&(r-="Additional"===s.rangePadding?T+f.top:T,P=(i+="Additional"===s.rangePadding?T+f.top:T)-r,C=0===(C=n-o)?1:C,P=0===P?1:P,this.unitX=C,this.unitY=P,this.min=r);var E=u/this.unitY*(R-r),I=R===r&&R>x?1!==l&&1!==this.unitY?u/this.unitY*(r/2):1|E:R===i&&R<x&&1!==l&&1!==this.unitY?u/this.unitY*(-i/2):E;m={x:v,y:(p=Math.abs(u-I))>y?y:p,height:Math.abs(p-y),width:O,markerPosition:p>y?y+Math.abs(p-y):p}}}else"Pie"===s.type&&(m={percent:Math.abs(R)/h*100,degree:Math.abs(R)/h*360});"Pie"!==s.type&&(m.x+=f.left,m.y+=f.top),"WinLoss"!==s.type&&(m.markerPosition+=f.top),m.location={x:m.x,y:m.y},m.xVal=L,m.yVal=R,M.push(m)}M.sort(function(e,t){return e.x-t.x}),this.visiblePoints=M},e.prototype.drawAxis=function(){var e=this.sparkline,t=this.axisHeight;if("WinLoss"!==e.type&&"Pie"!==e.type&&e.axisSettings.lineSettings.visible){var i={id:e.element.id+"_Sparkline_XAxis",x1:e.padding.left,y1:t,x2:e.availableSize.width-e.padding.right,y2:t,stroke:this.axisColor,opacity:e.axisSettings.lineSettings.opacity,"stroke-dasharray":e.axisSettings.lineSettings.dashArray,"stroke-width":this.axisWidth,"clip-path":"url(#"+this.clipId+")"};e.svgObject.appendChild(e.renderer.drawLine(i))}},e.prototype.triggerPointRender=function(e,t,i,r){var o={name:e,cancel:!1,border:r,fill:i,sparkline:this.sparkline.isBlazor?null:this.sparkline,pointIndex:t};return this.sparkline.trigger(e,o),o},e}(),ph=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uh=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},gh=function(e){function i(i,r){var o=e.call(this,i,r)||this;return o.isDevice=t.Browser.isDevice,o.intervalDivs=[10,5,2,1],o}return ph(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor(),this.allowServerDataBinding=!1,this.unWireEvents(),this.trigger("load",{sparkline:this.isBlazor?null:this}),this.sparkTheme=Rt(this.theme),this.sparklineRenderer=new dh(this),this.createSVG(),this.wireEvents(),this.setCulture()},i.prototype.render=function(){this.sparklineRenderer.processDataManager(),this.renderComplete(),this.allowServerDataBinding=!0},i.prototype.processSparklineData=function(){this.sparklineRenderer.processData(),this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition(),this.trigger("loaded",{sparkline:this.isBlazor?null:this})},i.prototype.renderSparkline=function(){this.renderBorder(),this.createDiv(),this.sparklineRenderer.renderSeries()},i.prototype.createDiv=function(){var e=document.createElement("div");e.id=this.element.id+"_Secondary_Element",e.setAttribute("style","position: relative"),this.element.appendChild(e),this.element.style.display="block",this.element.style.position="relative"},i.prototype.setSecondaryElementPosition=function(){var e=Ft(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=Ft(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},i.prototype.renderBorder=function(){var e,t=this.containerArea.border.width;(t>0||"transparent"!==this.containerArea.background)&&(e=new sh(this.element.id+"_SparklineBorder",this.sparkTheme.background,this.containerArea.border,1,new nh(t/2,t/2,this.availableSize.width-t,this.availableSize.height-t)),this.svgObject.appendChild(Et(this,e)));var i=this.padding;this.markerSettings.visible.length&&(i.left=0,i.right=0,i.bottom=0,i.top=0),e=new sh(this.element.id+"_sparkline_clip_rect","transparent",{color:"transparent",width:0},1,new nh(i.left,i.top,this.availableSize.width-(i.left+i.right),this.availableSize.height-(i.top+i.bottom)));var r=this.renderer.createClipPath({id:this.element.id+"_sparkline_clip_path"});Et(this,e,r),this.svgObject.appendChild(r)},i.prototype.createSVG=function(){this.removeSvg(),kt(this)},i.prototype.removeSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}Bt(this.element.id+"_Secondary_Element"),this.sparklineTooltipModule&&this.sparklineTooltipModule.removeTooltipElements()},i.prototype.setCulture=function(){this.intl=new t.Internationalization,this.localeObject=new t.L10n(this.getModuleName(),this.defaultLocalConstants,this.locale)},i.prototype.requiredModules=function(){var e=[];return(this.tooltipSettings.visible||this.tooltipSettings.trackLineSettings.visible)&&e.push({member:"SparklineTooltip",args:[this]}),e},i.prototype.unWireEvents=function(){t.Browser.touchMoveEvent;var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.sparklineMove),t.EventHandler.remove(this.element,e,this.sparklineMouseLeave),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.sparklineMouseEnd),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize)},i.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.sparklineMove,this),t.EventHandler.add(this.element,"click",this.sparklineClick,this),t.EventHandler.add(this.element,e,this.sparklineMouseLeave,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.sparklineMouseEnd,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize.bind(this)),new t.Touch(this.element)},i.prototype.sparklineResize=function(e){var t=this,i={name:"resize",previousSize:this.availableSize,sparkline:this.isBlazor?null:this,currentSize:new oh(0,0)};return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){if(t.isDestroyed)return void clearTimeout(t.resizeTo);t.unWireEvents(),t.createSVG(),t.refreshing=!0,t.wireEvents(),i.currentSize=t.availableSize,t.trigger("resize",i),t.render()},500),!1},i.prototype.sparklineMove=function(e){this.setSparklineMouseXY(e),this.notify(t.Browser.touchMoveEvent,e);var i={name:"sparklineMouseMove",cancel:!1,sparkline:this.isBlazor?null:this,event:e};this.trigger(i.name,i);var r=this.isPointRegion(e);if(r.isPointRegion){var o={name:"pointRegionMouseMove",cancel:!1,event:e,sparkline:this.isBlazor?null:this,pointIndex:r.pointIndex};this.trigger(o.name,o)}return!1},i.prototype.sparklineClick=function(e){this.setSparklineMouseXY(e);var t={name:"sparklineMouseClick",cancel:!1,sparkline:this.isBlazor?null:this,event:e};this.trigger(t.name,t);var i=this.isPointRegion(e);if(i.isPointRegion){var r={name:"pointRegionMouseClick",cancel:!1,event:e,sparkline:this.isBlazor?null:this,pointIndex:i.pointIndex};this.trigger(r.name,r)}return!1},i.prototype.isPointRegion=function(e){var i=this,r=this.element.id+"_",o=e.target.id.replace(r,"").split("_");if(o[1]===this.type.toLowerCase()){var n=parseInt(o[2],10);return!t.isNullOrUndefined(n)&&!isNaN(n)||"Line"!==this.type&&"Area"!==this.type||this.sparklineRenderer.visiblePoints.forEach(function(e,t){if(Nt(i.mouseX,i.mouseY,new nh(e.x-5,e.y-5,10,10)))return void(n=t)}),{isPointRegion:!0,pointIndex:n}}return{isPointRegion:!1,pointIndex:null}},i.prototype.sparklineMouseEnd=function(e){return this.setSparklineMouseXY(e),this.notify(t.Browser.touchEndEvent,e),!1},i.prototype.sparklineMouseLeave=function(e){return this.setSparklineMouseXY(e),this.notify(t.Browser.isPointer?"pointerleave":"mouseleave",e),!1},i.prototype.setSparklineMouseXY=function(e){var t,i;if(e.type.indexOf("touch")>-1){this.isTouch=!0;var r=e;i=r.changedTouches[0].clientX,t=r.changedTouches[0].clientY}else this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientY,i=e.clientX;var o=this.element.getBoundingClientRect(),n=Ft(this.element.id+"_svg").getBoundingClientRect();this.mouseY=t-o.top-Math.max(n.top-o.top,0),this.mouseX=i-o.left-Math.max(n.left-o.left,0)},i.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=!1,o=0,n=Object.keys(e);o<n.length;o++)switch(n[o]){case"xName":case"yName":case"axisSettings":case"rangeBandSettings":case"type":case"valueType":case"enableRtl":r=!0;break;case"dataSource":if(this.isBlazor){this.sparklineRenderer.processDataManager(),this.createSVG();break}r=!0;break;case"border":case"markerSettings":case"dataLabelSettings":case"tooltipSettings":case"startPointColor":case"highPointColor":case"lowPointColor":case"endPointColor":case"negativePointColor":case"theme":i=!0}r?(this.createSVG(),this.sparklineRenderer.processData(),this.refreshSparkline()):i&&(this.createSVG(),this.refreshSparkline())},i.prototype.refreshSparkline=function(){this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},i.prototype.getModuleName=function(){return"sparkline"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.getPersistData=function(){return""},uh([t.Property(null)],i.prototype,"width",void 0),uh([t.Property(null)],i.prototype,"height",void 0),uh([t.Complex({},Gl)],i.prototype,"border",void 0),uh([t.Property("Line")],i.prototype,"type",void 0),uh([t.Property("None")],i.prototype,"rangePadding",void 0),uh([t.Property(null)],i.prototype,"dataSource",void 0),uh([t.Property(null)],i.prototype,"query",void 0),uh([t.Property("Numeric")],i.prototype,"valueType",void 0),uh([t.Property(null)],i.prototype,"xName",void 0),uh([t.Property(null)],i.prototype,"yName",void 0),uh([t.Property("#00bdae")],i.prototype,"fill",void 0),uh([t.Property("")],i.prototype,"highPointColor",void 0),uh([t.Property("")],i.prototype,"lowPointColor",void 0),uh([t.Property("")],i.prototype,"startPointColor",void 0),uh([t.Property("")],i.prototype,"endPointColor",void 0),uh([t.Property("")],i.prototype,"negativePointColor",void 0),uh([t.Property("")],i.prototype,"tiePointColor",void 0),uh([t.Property([])],i.prototype,"palette",void 0),uh([t.Property(1)],i.prototype,"lineWidth",void 0),uh([t.Property(1)],i.prototype,"opacity",void 0),uh([t.Property(null)],i.prototype,"format",void 0),uh([t.Property(!1)],i.prototype,"useGroupingSeparator",void 0),uh([t.Complex({},Zl)],i.prototype,"tooltipSettings",void 0),uh([t.Complex({},ql)],i.prototype,"containerArea",void 0),uh([t.Collection([],$l)],i.prototype,"rangeBandSettings",void 0),uh([t.Complex({},Jl)],i.prototype,"axisSettings",void 0),uh([t.Complex({},eh)],i.prototype,"markerSettings",void 0),uh([t.Complex({},ih)],i.prototype,"dataLabelSettings",void 0),uh([t.Complex({},Kl)],i.prototype,"padding",void 0),uh([t.Property("Material")],i.prototype,"theme",void 0),uh([t.Event()],i.prototype,"loaded",void 0),uh([t.Event()],i.prototype,"load",void 0),uh([t.Event()],i.prototype,"tooltipInitialize",void 0),uh([t.Event()],i.prototype,"seriesRendering",void 0),uh([t.Event()],i.prototype,"axisRendering",void 0),uh([t.Event()],i.prototype,"pointRendering",void 0),uh([t.Event()],i.prototype,"pointRegionMouseMove",void 0),uh([t.Event()],i.prototype,"pointRegionMouseClick",void 0),uh([t.Event()],i.prototype,"sparklineMouseMove",void 0),uh([t.Event()],i.prototype,"sparklineMouseClick",void 0),uh([t.Event()],i.prototype,"dataLabelRendering",void 0),uh([t.Event()],i.prototype,"markerRendering",void 0),uh([t.Event()],i.prototype,"resize",void 0),i=uh([t.NotifyPropertyChanges],i)}(t.Component),yh=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]]);return i},mh=function(){function e(e){this.sparkline=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.sparkline.isDestroyed||(this.sparkline.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.sparkline.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.sparkline.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.mouseLeaveHandler=function(){this.removeTooltipElements()},e.prototype.mouseUpHandler=function(e){this.sparkline.isTouch&&(this.processTooltip(e),this.fadeOut())},e.prototype.fadeOut=function(){clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(this.removeTooltipElements.bind(this),5e3)},e.prototype.removeTooltipElements=function(){this.removeTooltip(),this.removeTracker()},e.prototype.mouseMoveHandler=function(e){this.processTooltip(e)},e.prototype.processTooltip=function(e){var i,r=this.sparkline,o=r.sparklineRenderer.visiblePoints,n=r.mouseX,a=r.mouseY;if("Pie"!==r.type)for(var s=t.extend([],[],o).map(function(e){return e.location.x}),l=1/0,h=0,c=void 0,d=s.length;h<d;h++)l>(c=Math.abs(n-s[h]))&&(l=c,i=h);else{var p=e.target.id;i=parseInt(p.split("_pie_")[1],10)}if(isNaN(i)||!Nt(n,a,new nh(0,0,r.availableSize.width,r.availableSize.height)))return this.removeTracker(),void this.removeTooltip();this.pointIndex!==i&&(this.pointIndex=i,this.renderTrackerLine(o[i]),this.renderTooltip(o[i]))},e.prototype.renderTrackerLine=function(e){var i=this.sparkline,r=(i.theme.toLowerCase(),i.tooltipSettings.trackLineSettings),o=i.sparkTheme.trackerLineColor?i.sparkTheme.trackerLineColor:r.color;if(r.visible&&"Pie"!==i.type){var n=Ft(i.element.id+"_sparkline_tracker_g");t.isNullOrUndefined(n)&&(n=i.renderer.createGroup({id:i.element.id+"_sparkline_tracker_g"}),i.svgObject.appendChild(n));var a=Ft(i.element.id+"_sparkline_tracker"),s="M "+e.location.x+" "+i.padding.top+" L "+e.location.x+" "+(i.availableSize.height-i.padding.bottom);if(t.isNullOrUndefined(a)){var l=new ah(i.element.id+"_sparkline_tracker","transparent",r.width,o,1);l.d=s,It(i,l,n)}else a.setAttribute("d",s),a.setAttribute("stroke-width",r.width.toString()),a.setAttribute("stroke",o)}},e.prototype.renderTooltip=function(e){var i=this,r=this.sparkline,o=r.tooltipSettings;if(o.visible){var n=Ft(r.element.id+"_sparkline_tooltip_div");t.isNullOrUndefined(n)&&(n=t.createElement("div",{id:r.element.id+"_sparkline_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),Ft(r.element.id+"_Secondary_Element").appendChild(n));var a=e.xVal.toString();"Category"===r.valueType?a=r.dataSource[e.xVal][r.xName]:"DateTime"===r.valueType&&(a=new Date(e.xVal).toDateString());var s=this.getFormat(r.tooltipSettings.format,r,a,this.formatValue(e.yVal,r).toString()),l={x:e.location.x,y:e.location.y};l="Pie"===r.type?{x:e.location.x,y:e.location.y}:l;var h=o.textStyle.color||r.sparkTheme.tooltipFontColor,c=""===o.fill?r.sparkTheme.tooltipFill:o.fill,d={name:"tooltipInitialize",cancel:!1,text:s,textStyle:{size:o.textStyle.size,opacity:r.sparkTheme.tooltipTextOpacity||o.textStyle.opacity,fontWeight:o.textStyle.fontWeight,fontStyle:o.textStyle.fontStyle,fontFamily:r.sparkTheme.fontFamily||o.textStyle.fontFamily,color:h}};if(r.isBlazor){var p=yh(d,[]);d=p}r.trigger("tooltipInitialize",d,function(){i.addTooltip(d,r,c,o,l,n)})}},e.prototype.addTooltip=function(e,r,o,n,a,s,l){var h;if(t.isNullOrUndefined(e))l.cancel,h=l;else{var c=e.cancel;yh(e,["cancel"]);c,h=e}if(!e.cancel){var d=new i.Tooltip({content:h.text,border:n.border,template:n.template,data:r.dataSource[this.pointIndex],fill:o,textStyle:h.textStyle,enableAnimation:!1,location:{x:a.x,y:a.y},shared:!1,availableSize:this.sparkline.availableSize,areaBounds:new nh(0,0,r.availableSize.width,r.availableSize.height),theme:r.theme,blazorTemplate:{name:"TooltipTemplate",parent:r.tooltipSettings}});d.opacity=r.sparkTheme.tooltipFillOpacity||d.opacity,d.appendTo(s)}},e.prototype.getFormat=function(e,i,r,o){if(t.isNullOrUndefined(e)||""===e)return[o];var n=e;return n=n.split("${"+i.xName+"}").join(r).split("${"+i.yName+"}").join(o),[n]},e.prototype.formatValue=function(e,t){return t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(e):e},e.prototype.removeTracker=function(){var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tracker_g");return e?t.remove(e):null},e.prototype.removeTooltip=function(){this.pointIndex=null;var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tooltip_div");return e?t.remove(e):null},e.prototype.getModuleName=function(){return"SparklineTooltip"},e.prototype.destroy=function(e){},e}();return Rr.Inject(Vr,bo,Xr,Do,Vo,Br,Ur,Nn,ho,po,so,fo,go,mo,qr,ro,wo,Io,yn,dn,Or,Tr,Ir,Mn,vn,Pn,xn,Tn,Lo,Mo,Co,ko,Eo,no,Kr,to,Yo,Zo,Wo,Qo,hn,Jo,rn,en,nn,sn,On,Fo,Ln,cn,Dr,Dn,In,Bn,jn,Hn,wn,Cn),ra.Inject(ea,sa,ha,ya,da,va,ua,ba,Hn),za.Inject(ps,Oa,Ur,ho,Tr,Ir,Hn),gh.Inject(mh),Vl.Inject(Hl,jl),ds.Inject(Vr,Xr,Do,Vo,Br,Ur,yn,dn,Tr,vn,Pn,xn,Tn,Lo,Mo,no,Yo,Zo,Wo,Qo,hn,Jo,rn,en,nn,sn,cn,ps,Hn,ls),Ms.Inject(As,Ts),e.RangeColorSetting=Cr,e.CrosshairSettings=Pr,e.ZoomSettings=Lr,e.Chart=Rr,e.Row=wi,e.Column=Si,e.MajorGridLines=Ci,e.MinorGridLines=Pi,e.AxisLine=Li,e.MajorTickLines=Ri,e.MinorTickLines=Mi,e.CrosshairTooltip=Ai,e.Axis=ki,e.VisibleLabels=Ti,e.Double=ni,e.DateTime=Tr,e.Category=Or,e.Logarithmic=Ir,e.DateTimeCategory=Dr,e.NiceInterval=Ar,e.StripLine=Br,e.Connector=Ht,e.Font=Xt,e.Border=Yt,e.Offset=Gt,e.ChartArea=Wt,e.Margin=Ut,e.ContainerPadding=Zt,e.Animation=qt,e.Indexes=Qt,e.CornerRadius=$t,e.Index=Jt,e.EmptyPointSettings=Kt,e.DragSettings=ei,e.TooltipSettings=ti,e.Periods=ii,e.PeriodSelectorSettings=ri,e.LineSeries=Vr,e.ColumnSeries=Xr,e.AreaSeries=Ur,e.BarSeries=qr,e.PolarSeries=Kr,e.RadarSeries=to,e.StackingBarSeries=ro,e.CandleSeries=no,e.StackingColumnSeries=so,e.StepLineSeries=ho,e.StepAreaSeries=po,e.StackingAreaSeries=go,e.StackingStepAreaSeries=mo,e.StackingLineSeries=fo,e.ScatterSeries=bo,e.RangeColumnSeries=wo,e.WaterfallSeries=Co,e.HiloSeries=Lo,e.HiloOpenCloseSeries=Mo,e.RangeAreaSeries=ko,e.SplineRangeAreaSeries=Eo,e.BubbleSeries=Io,e.SplineSeries=Do,e.HistogramSeries=Fo,e.SplineAreaSeries=Vo,e.TechnicalIndicator=br,e.SmaIndicator=Yo,e.EmaIndicator=Wo,e.TmaIndicator=Zo,e.AccumulationDistributionIndicator=Qo,e.AtrIndicator=Jo,e.MomentumIndicator=en,e.RsiIndicator=rn,e.StochasticIndicator=nn,e.BollingerBands=sn,e.MacdIndicator=hn,e.Trendlines=cn,e.sort=p,e.isBreakLabel=u,e.getVisiblePoints=g,e.rotateTextSize=y,e.removeElement=m,e.logBase=v,e.showTooltip=f,e.inside=b,e.withIn=x,e.logWithIn=w,e.withInRange=S,e.sum=C,e.subArraySum=P,e.subtractThickness=L,e.subtractRect=R,e.degreeToLocation=M,e.degreeToRadian=A,e.getRotatedRectangleCoordinates=k,e.isRotatedRectIntersect=T,e.getAngle=O,e.subArray=E,e.valueToCoefficient=I,e.TransformToVisible=z,e.indexFinder=D,e.CoefficientToVector=B,e.valueToPolarCoefficient=F,e.Mean=Oi,e.PolarArc=Ei,e.createTooltip=N,e.createZoomingLabels=V,e.withInBounds=j,e.getValueXByPoint=H,e.getValueYByPoint=X,e.findClipRect=Y,e.firstToLowerCase=G,e.getTransform=W,e.getMinPointsDelta=U,e.getAnimationFunction=Z,e.linear=q,e.markerAnimate=Q,e.animateRectElement=$,e.pathAnimation=J,e.appendClipElement=K,e.triggerLabelRender=ee,e.setRange=te,e.isZoomSet=ie,e.getActualDesiredIntervalsCount=re,e.templateAnimate=oe,e.drawSymbol=ne,e.calculateShapes=ae,e.getRectLocation=se,e.minMax=le,e.getElement=he,e.getTemplateFunction=ce,e.accReactTemplate=de,e.chartReactTemplate=pe,e.createTemplate=ue,e.getFontStyle=ge,e.measureElementRect=ye,e.findlElement=me,e.getPoint=ve,e.appendElement=fe,e.appendChildElement=be,e.getDraggedRectLocation=xe,e.checkBounds=we,e.getLabelText=Se,e.stopTimer=Ce,e.isCollide=Pe,e.isOverlap=Le,e.containsRect=Re,e.calculateRect=Me,e.convertToHexCode=Ae,e.componentToHex=ke,e.convertHexToColor=Te,e.colorNameToHex=_e,e.getSaturationColor=Oe,e.getMedian=Ee,e.calculateLegendShapes=Ie,e.textTrim=ze,e.lineBreakLabelTrim=De,e.stringToNumber=Be,e.redrawElement=Fe,e.animateRedrawElement=Ne,e.textElement=Ve,e.calculateSize=je,e.createSvg=He,e.getTitle=Xe,e.titlePositionX=Ye,e.textWrap=Ge,e.getUnicodeText=We,e.blazorTemplatesReset=Ue,e.CustomizeOption=Ii,e.StackValues=zi,e.RectOption=Di,e.ImageOption=Bi,e.CircleOption=Fi,e.PolygonOption=Ni,e.ChartLocation=Vi,e.LabelLocation=ji,e.Thickness=Hi,e.ColorValue=Xi,e.PointData=Yi,e.AccPointData=Gi,e.ControlPoints=Wi,e.getColorByValue=Ze,e.getGradientColor=qe,e.getPercentageColor=Qe,e.getPercentage=$e,e.Crosshair=dn,e.Tooltip=yn,e.Zoom=vn,e.Selection=xn,e.DataEditing=wn,e.Highlight=Cn,e.DataLabel=Pn,e.ErrorBar=Ln,e.DataLabelSettings=$i,e.MarkerSettings=Ji,e.Points=Ki,e.Trendline=er,e.ErrorBarCapSettings=tr,e.ChartSegment=ir,e.ErrorBarSettings=rr,e.SeriesBase=or,e.Series=nr,e.Legend=Mn,e.ChartAnnotation=Tn,e.ChartAnnotationSettings=pi,e.LabelBorder=ui,e.MultiLevelCategories=gi,e.StripLineSettings=yi,e.MultiLevelLabels=mi,e.ScrollbarSettingsRange=vi,e.ScrollbarSettings=fi,e.BoxAndWhiskerSeries=On,e.MultiColoredAreaSeries=In,e.MultiColoredLineSeries=Dn,e.MultiColoredSeries=Gr,e.MultiLevelLabel=Bn,e.ScrollBar=Nn,e.ParetoSeries=jn,e.Export=Hn,e.AccumulationChart=ra,e.AccumulationAnnotationSettings=Gn,e.AccumulationDataLabelSettings=Wn,e.PieCenter=Un,e.AccPoints=Zn,e.AccumulationSeries=qn,e.getSeriesFromIndex=Ke,e.pointByIndex=et,e.PieSeries=ea,e.FunnelSeries=sa,e.PyramidSeries=ha,e.AccumulationLegend=da,e.AccumulationDataLabel=ua,e.AccumulationTooltip=ya,e.AccumulationSelection=va,e.AccumulationAnnotation=ba,e.StockChart=ds,e.StockChartFont=ja,e.StockChartBorder=Ha,e.StockChartArea=Xa,e.StockMargin=Ya,e.StockChartStripLineSettings=Ga,e.StockEmptyPointSettings=Ua,e.StockChartConnector=Za,e.StockSeries=qa,e.StockChartIndicator=Qa,e.StockChartAxis=$a,e.StockChartRow=Ja,e.StockChartTrendline=Ka,e.StockChartAnnotationSettings=es,e.StockChartIndexes=ts,e.StockEventsSettings=is,e.StockChartLegendSettings=ss,e.StockLegend=ls,e.loaded="loaded",e.legendClick="legendClick",e.load="load",e.animationComplete="animationComplete",e.legendRender="legendRender",e.textRender="textRender",e.pointRender="pointRender",e.sharedTooltipRender="sharedTooltipRender",e.seriesRender="seriesRender",e.axisLabelRender=ai,e.axisLabelClick="axisLabelClick",e.axisRangeCalculated="axisRangeCalculated",e.axisMultiLabelRender="axisMultiLabelRender",e.tooltipRender="tooltipRender",e.chartMouseMove="chartMouseMove",e.chartMouseClick="chartMouseClick",e.pointClick="pointClick",e.pointDoubleClick="pointDoubleClick",e.pointMove="pointMove",e.chartMouseLeave="chartMouseLeave",e.chartMouseDown="chartMouseDown",e.chartMouseUp="chartMouseUp",e.zoomComplete="zoomComplete",e.dragComplete="dragComplete",e.selectionComplete="selectionComplete",e.resized="resized",e.beforeResize="beforeResize",e.beforePrint="beforePrint",e.annotationRender="annotationRender",e.scrollStart="scrollStart",e.scrollEnd="scrollEnd",e.scrollChanged="scrollChanged",e.stockEventRender="stockEventRender",e.multiLevelLabelClick="multiLevelLabelClick",e.dragStart="dragStart",e.drag="drag",e.dragEnd="dragEnd",e.regSub=si,e.regSup=li,e.beforeExport="beforeExport",e.afterExport="afterExport",e.bulletChartMouseClick="bulletChartMouseClick",e.onZooming=hi,e.getSeriesColor=h,e.getThemeColor=c,e.getScrollbarThemeColor=d,e.PeriodSelector=Oa,e.RangeNavigator=za,e.rangeValueToCoefficient=tt,e.getXLocation=it,e.getRangeValueXByPoint=rt,e.getExactData=ot,e.getNearestValue=nt,e.DataPoint=xa,e.getRangeThemeColor=at,e.RangeNavigatorAxis=Pa,e.RangeSeries=Sa,e.RangeSlider=_a,e.RangeNavigatorSeries=Ma,e.ThumbSettings=Aa,e.StyleSettings=ka,e.RangeTooltipSettings=Ta,e.RangeTooltip=ps,e.BulletChart=Ms,e.Range=fs,e.MajorTickLinesSettings=bs,e.MinorTickLinesSettings=xs,e.BulletLabelStyle=ws,e.BulletTooltipSettings=Ss,e.BulletDataLabel=Cs,e.BulletChartLegendSettings=Ps,e.getBulletThemeColor=lt,e.BulletTooltip=As,e.BulletChartLegend=Ts,e.Smithchart=Vl,e.SmithchartMajorGridLines=gl,e.SmithchartMinorGridLines=yl,e.SmithchartAxisLine=ml,e.SmithchartAxis=vl,e.LegendTitle=al,e.LegendLocation=sl,e.LegendItemStyleBorder=ll,e.LegendItemStyle=hl,e.LegendBorder=cl,e.SmithchartLegendSettings=dl,e.SeriesTooltipBorder=Pl,e.SeriesTooltip=Ll,e.SeriesMarkerBorder=Rl,e.SeriesMarkerDataLabelBorder=Ml,e.SeriesMarkerDataLabelConnectorLine=Al,e.SeriesMarkerDataLabel=kl,e.SeriesMarker=Tl,e.SmithchartSeries=_l,e.TooltipRender=jl,e.Subtitle=xl,e.Title=wl,e.SmithchartFont=Es,e.SmithchartMargin=Is,e.SmithchartBorder=zs,e.SmithchartRect=Ds,e.LabelCollection=Bs,e.LegendSeries=Fs,e.LabelRegion=Ns,e.HorizontalLabelCollection=Vs,e.RadialLabelCollections=js,e.LineSegment=Hs,e.PointRegion=Xs,e.Point=Ys,e.ClosestPoint=Gs,e.MarkerOptions=Ws,e.SmithchartLabelPosition=Us,e.Direction=Zs,e.DataLabelTextOptions=qs,e.LabelOption=Qs,e.SmithchartSize=$s,e.GridArcPoints=Js,e.smithchartBeforePrint="beforePrint",e.SmithchartLegend=Hl,e.Sparkline=gh,e.SparklineTooltip=mh,e.SparklineBorder=Gl,e.SparklineFont=Wl,e.TrackLineSettings=Ul,e.SparklineTooltipSettings=Zl,e.ContainerArea=ql,e.LineSettings=Ql,e.RangeBandSettings=$l,e.AxisSettings=Jl,e.Padding=Kl,e.SparklineMarkerSettings=eh,e.LabelOffset=th,e.SparklineDataLabelSettings=ih,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport,ej.navigations,ej.calendars,ej.splitbuttons,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-calendars.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.calendars=function(e,t,i,s,a,n){"use strict";var r=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)}}(),l=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},o="e-other-month",h="e-calendar",u="e-disabled",d="e-overlay",p="e-selected",c="e-focused-date",m=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(i,e),l([t.Property("day")],i.prototype,"day",void 0),l([t.Property("month")],i.prototype,"month",void 0),l([t.Property("year")],i.prototype,"year",void 0),l([t.Property("hour")],i.prototype,"hour",void 0),l([t.Property("minute")],i.prototype,"minute",void 0),l([t.Property("second")],i.prototype,"second",void 0),l([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),i}(t.ChildProperty),v=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.isAngular=!1,s}return r(i,e),i.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new t.Internationalization(this.locale),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(h),this.enableRtl&&this.element.classList.add("e-rtl"),t.Browser.isDevice&&this.element.classList.add("e-device"),t.attributes(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(h),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.Browser.isDevice&&this.calendarElement.classList.add("e-device"),t.attributes(this.calendarElement,{role:"calendar"})),this.createHeader(),this.createContent(),this.wireEvents()},i.prototype.rangeValidation=function(e,i){t.isNullOrUndefined(e)&&this.setProperties({min:new Date(1900,0,1)},!0),t.isNullOrUndefined(i)&&this.setProperties({max:new Date(2099,11,31)},!0)},i.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},i.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!t.isNullOrUndefined(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},i.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},i.prototype.minMaxUpdate=function(e){+this.min<=+this.max?t.removeClass([this.element],d):(this.setProperties({min:this.min},!0),t.addClass([this.element],d)),this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},i.prototype.createHeader=function(){var e={"aria-disabled":"false","aria-label":"previous month"},i={"aria-disabled":"false","aria-label":"next month"},s={"aria-atomic":"true","aria-live":"assertive","aria-label":"title"};this.headerElement=this.createElement("div",{className:"e-header"});var a=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),t.rippleEffect(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),t.attributes(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),t.rippleEffect(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.attributes(this.nextIcon,i),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),t.attributes(this.headerTitleElement,s),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev e-icons"})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next e-icons"})),a.appendChild(this.previousIcon),a.appendChild(this.nextIcon),this.headerElement.appendChild(a),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},i.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{tabIndex:"0",role:"grid","aria-activedescendant":""}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},i.prototype.getCultureValues=function(){var e,i=[],s=(t.isBlazor()?"days.":"days.stand-alone.")+this.dayHeaderFormat.toLowerCase();e="en"===this.locale||"en-US"===this.locale?t.getValue(s,t.getDefaultDateObject()):this.getCultureObjects(t.cldrData,""+this.locale);for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];i.push(t.getValue(r,e))}return i},i.prototype.toCapitalize=function(e){return!t.isNullOrUndefined(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},i.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.element.querySelectorAll(".e-content .e-week-header")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number"></th>',"calendar"===this.getModuleName()?t.addClass([this.element],"e-week-number"):t.addClass([this.calendarElement],"e-week-number"));for(var i=this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek),s=0;s<=6;s++)e+='<th class="">'+this.toCapitalize(i[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},i.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content tbody")[0])||t.detach(this.element.querySelectorAll(".e-content tbody")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content tbody")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},i.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today"))},i.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),i=new Date(+this.max),s={today:"Today"};this.globalize=new t.Internationalization(this.locale),this.l10=new t.L10n(this.getModuleName(),s,this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),t.rippleEffect(this.todayElement),this.updateFooter(),t.addClass([this.todayElement],["e-btn","e-today","e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(i.setHours(0,0,0,0))&&!this.todayDisabled||t.addClass([this.todayElement],u),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(u)||t.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},i.prototype.wireEvents=function(e,i,s,a){t.isBlazor()&&i?(this.element=document.getElementById(e),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.blazorRef=i,this.serverModuleName=a):(t.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs)),"calendar"===this.getModuleName()?this.keyboardModule=new t.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new t.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},i.prototype.dateWireEvents=function(e,i,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.blazorRef=i,this.serverModuleName=a},i.prototype.todayButtonClick=function(e,t,i){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),i):this.navigateTo("Month",new Date(this.checkValue(t)),i))},i.prototype.resetCalendar=function(){this.calendarElement&&t.detach(this.calendarElement),this.tableBodyElement&&t.detach(this.tableBodyElement),this.table&&t.detach(this.table),this.tableHeadElement&&t.detach(this.tableHeadElement),this.nextIcon&&t.detach(this.nextIcon),this.previousIcon&&t.detach(this.previousIcon),this.footer&&t.detach(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},i.prototype.checkDeviceMode=function(e){t.Browser.isDevice&&t.isBlazor()&&e&&e.invokeMethodAsync("OnDevice",!0)},i.prototype.keyActionHandle=function(e,i,s){t.isBlazor()&&this.blazorRef&&(e.preventDefault(),this.tableBodyElement||(this.element=t.closest(e.target,".e-calendar"),this.tableBodyElement=this.element.querySelector("tbody")),s=!1);var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");if(a=s?t.isNullOrUndefined(n)||+i!==parseInt(n.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):n:this.tableBodyElement.querySelector("tr td.e-selected"),t.isBlazor()&&this.blazorRef){this.tableBodyElement.focus();var r=e.target,l={Action:e.action,Key:e.key,Events:e,SelectDate:a?a.id:null,FocusedDate:n?n.id:null,classList:a?a.classList.toString():n?n.classList.toString():"e-cell",Id:n?n.id:a?a.id:null,TargetClassList:r.classList.toString()};this.blazorRef.invokeMethodAsync("OnCalendarKeyboardEvent",l),r.classList.contains("e-today")&&(r.blur(),this.tableBodyElement.focus()),"sf.calendars.Calendar"===this.serverModuleName&&(this.tableBodyElement=null)}else{var o=this.getViewNumber(this.currentView()),h=this.getViewNumber(this.depth),d=o===h&&this.getViewNumber(this.start)>=h;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,o,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,o,e,this.max,this.min),e.preventDefault();break;case"moveUp":0===o?this.keyboardNavigate(-7,o,e,this.max,this.min):this.keyboardNavigate(-4,o,e,this.max,this.min),e.preventDefault();break;case"moveDown":0===o?this.keyboardNavigate(7,o,e,this.max,this.min):this.keyboardNavigate(4,o,e,this.max,this.min),e.preventDefault();break;case"select":if(e.target===this.todayElement)this.todayButtonClick(e,i);else{var p=t.isNullOrUndefined(n)?a:n;if(!t.isNullOrUndefined(p)&&!p.classList.contains(u))if(d){var c=new Date(parseInt(""+p.id,0));this.selectDate(e,c,p)}else this.contentClick(null,--o,p,i)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":t.isNullOrUndefined(n)&&(t.isNullOrUndefined(a)||d)||this.contentClick(null,--o,n||a,i),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),t.detach(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,o),t.detach(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault()}"calendar"===this.getModuleName()&&this.table.focus()}},i.prototype.keyboardNavigate=function(e,i,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(i){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},i.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},i.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),i=new Date(new Date(+this.min).setHours(0,0,0,0)),s=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+i&&+t!=+s||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},i.prototype.renderMonths=function(e,t,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,"e-month",e,t):this.islamicModule.islamicRenderTemplate(s,a,"e-month",e,t)},i.prototype.renderDays=function(e,i,s,a,n){var r,l=[],h=n?new Date(+e):this.getDate(new Date,this.timezone),c=new Date(this.checkValue(e)),m=c.getMonth();this.titleUpdate(e,"days");var v=c;for(c=new Date(v.getFullYear(),v.getMonth(),0,v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds());c.getDay()!==this.firstDayOfWeek;)this.setStartDate(c,-864e5);for(var f=0;f<42;++f){var y=this.createElement("td",{className:"e-cell"}),g=this.createElement("span");if(f%7==0&&this.weekNumber){var b="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,D=new Date(c.getFullYear(),c.getMonth(),c.getDate()+b);g.textContent=""+this.getWeek(D),y.appendChild(g),t.addClass([y],"e-week-number"),l.push(y)}r=new Date(+c),c=this.minMaxDate(c);var E={type:"dateTime",skeleton:t.isBlazor()?"D":"full"},C=this.globalize.parseDate(this.globalize.formatDate(c,E),E),k=this.dayCell(c),M=this.globalize.formatDate(c,{type:"date",skeleton:t.isBlazor()?"D":"full"}),w=this.createElement("span");w.textContent=this.globalize.formatDate(c,{format:"d",type:"date",skeleton:t.isBlazor()?"d":"yMd"});var V=this.min>c||this.max<c;V?(t.addClass([k],u),t.addClass([k],d)):w.setAttribute("title",""+M),m!==c.getMonth()&&t.addClass([k],o),0!==c.getDay()&&6!==c.getDay()||t.addClass([k],"e-weekend"),k.appendChild(w),this.renderDayCellArgs={date:c,isDisabled:!1,element:k,isOutOfRange:V};var O=this.renderDayCellArgs;if(this.renderDayCellEvent(O),O.isDisabled){var N=new Date(this.checkValue(i)),I=new Date(this.checkValue(O.date));if(s){if(!t.isNullOrUndefined(a)&&a.length>0)for(var S=0;S<a.length;S++)(H=+new Date(this.globalize.formatDate(O.date,{type:"date",skeleton:t.isBlazor()?"d":"yMd"})))===(B=+new Date(this.globalize.formatDate(a[S],{type:"date",skeleton:t.isBlazor()?"d":"yMd"})))&&(a.splice(S,1),S=-1)}else N&&+N==+I&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!k.classList.contains(p)&&(t.addClass([k],u),t.addClass([k],d),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var A=k.classList.contains(o),x=k.classList.contains(u);if(x||t.EventHandler.add(k,"click",this.clickHandler,this),!s||t.isNullOrUndefined(a)||x)!x&&this.getDateVal(c,i)&&t.addClass([k],p);else{for(var T=0;T<a.length;T++){var P="Gregorian"===this.calendarMode?"gregorian":"islamic",U={format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:P},H=this.globalize.formatDate(c,U),B=this.globalize.formatDate(a[T],U);H===B&&this.getDateVal(c,a[T])||this.getDateVal(c,i)?t.addClass([k],p):this.updateFocus(A,x,c,k,e)}a.length<=0&&this.updateFocus(A,x,c,k,e)}this.updateFocus(A,x,c,k,e),C.getFullYear()===h.getFullYear()&&C.getMonth()===h.getMonth()&&C.getDate()===h.getDate()&&t.addClass([k],"e-today"),l.push(this.renderDayCellArgs.element),c=new Date(+r),this.addDay(c,1,null,this.max,this.min)}return l},i.prototype.updateFocus=function(e,i,s,a,n){n.getDate()!==s.getDate()||e||i?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!i&&t.addClass([a],c),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!i&&t.addClass([a],c)):t.addClass([a],c)},i.prototype.renderYears=function(e,i){this.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),d=new Date(this.checkValue(this.min)).getFullYear(),m=new Date(this.checkValue(this.min)).getMonth(),v=new Date(this.checkValue(this.max)).getFullYear(),f=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var y=0;y<12;++y){var g=this.dayCell(o),b=this.createElement("span"),D=i&&i.getMonth()===o.getMonth(),E=i&&i.getFullYear()===l&&D;b.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:t.isBlazor()?"MMM":null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<d||y<m&&h===d)||this.max&&(h>v||y>f&&h>=v)?t.addClass([g],u):!a&&E?t.addClass([g],p):o.getMonth()===r&&this.currentDate.getMonth()===r&&t.addClass([g],c),o.setDate(1),o.setMonth(o.getMonth()+1),g.classList.contains(u)||t.EventHandler.add(g,"click",this.clickHandler,this),g.appendChild(b),s.push(g)}this.renderTemplate(s,4,"e-year",e,i)},i.prototype.renderDecades=function(e,i){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),r=new Date(a.setFullYear(n-n%10)),l=new Date(a.setFullYear(n-n%10+9)),o=r.getFullYear(),h=l.getFullYear(),d=this.globalize.formatDate(r,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"}),m=this.globalize.formatDate(l,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+m;for(var v=new Date(n-n%10-1,0,1).getFullYear(),f=0;f<12;++f){var y=v+f;a.setFullYear(y);var g=this.dayCell(a);t.attributes(g,{role:"gridcell"});var b=this.createElement("span");b.textContent=this.globalize.formatDate(a,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"}),y<o||y>h?(t.addClass([g],"e-other-year"),t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()||t.addClass([g],p),(y<new Date(this.checkValue(this.min)).getFullYear()||y>new Date(this.checkValue(this.max)).getFullYear())&&t.addClass([g],u)):y<new Date(this.checkValue(this.min)).getFullYear()||y>new Date(this.checkValue(this.max)).getFullYear()?t.addClass([g],u):t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||g.classList.contains(u)||t.addClass([g],c):t.addClass([g],p),g.classList.contains(u)||t.EventHandler.add(g,"click",this.clickHandler,this),g.appendChild(b),s.push(g)}this.renderTemplate(s,4,"e-decade",e,i)},i.prototype.dayCell=function(e){var i="Gregorian"===this.calendarMode?"gregorian":"islamic",s={skeleton:t.isBlazor()?"F":"full",type:"dateTime",calendar:i},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.createElement("td",n)},i.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+o):this.tableBodyElement.querySelectorAll("td:not(.e-other-year");if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(u)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},i.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},i.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(.e-other-year"):this.tableBodyElement.querySelectorAll("td:not(."+o);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(u)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement)},i.prototype.renderTemplate=function(e,i,s,a,n){var r,l=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),t.removeClass([this.contentElement,this.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.contentElement,this.headerElement],[s]);for(var h=i,u=0,d=0;d<e.length/i;++d){for(r=this.createElement("tr",{attrs:{role:"row"}}),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||t.isNullOrUndefined(e[u].children[0])||(t.addClass([e[u].children[0]],["e-day"]),t.rippleEffect(e[u].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(o)&&t.addClass([r],"e-month-hide"),!this.weekNumber&&6===u&&e[6].classList.contains(o)&&t.addClass([r],"e-month-hide"),this.weekNumber?41===u&&e[41].classList.contains(o)&&t.addClass([r],"e-month-hide"):35===u&&e[35].classList.contains(o)&&t.addClass([r],"e-month-hide");h+=i,u+=0,this.tableBodyElement.appendChild(r)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(l!==this.getViewNumber(this.currentView())||0===l&&l!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},i.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(o)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.contentClick(e,1,null,t):2===s?this.contentClick(e,1,null,t):i.classList.contains(o)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.clickEventEmitter=function(e){e.preventDefault()},i.prototype.contentClick=function(e,i,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(i){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(t.detach(this.tableBodyElement),this.currentDate=r,this.effect="e-zoomin",this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(r.getMonth()),r.getMonth()>0&&this.currentDate.getMonth()!==r.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(r.getFullYear())):this.currentDate=r,this.effect="e-zoomin",t.detach(this.tableBodyElement),this.renderMonths(e));break;case 1:if(n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,r,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(r.getFullYear());else{var l=this.islamicModule.getIslamicDate(r);this.currentDate=this.islamicModule.toGregorian(l.year,l.month,1)}this.effect="e-zoomin",t.detach(this.tableBodyElement),this.renderYears(e)}}},i.prototype.switchView=function(e,i,s,a){switch(e){case 0:t.detach(this.tableBodyElement),this.renderMonths(i,null,a),s&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+c)[0])&&this.tableBodyElement.querySelectorAll("."+c)[0].classList.remove(c);break;case 1:t.detach(this.tableBodyElement),this.renderYears(i);break;case 2:t.detach(this.tableBodyElement),this.renderDecades(i)}},i.prototype.getModuleName=function(){return"calendar"},i.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},i.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i,s,a){this.effect="";for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),"datepicker"!==this.getModuleName()?this.createContentHeader():this.calendarElement&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===l?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&t.detach(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(t.removeClass([this.todayElement],u),t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new t.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():t.isNullOrUndefined(this.todayElement)||t.isNullOrUndefined(this.footer)||(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},i.prototype.validateValues=function(e,i){if(e&&!t.isNullOrUndefined(i)&&i.length>0){for(var s=this.copyValues(i),a=0;a<s.length;a++){var n=s[a],r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=void 0;l="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{type:"date",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(n,{type:"dateTime",skeleton:"full",calendar:"islamic"});var o={type:"date",skeleton:t.isBlazor()?"d":"yMd",calendar:r},h=this.globalize.formatDate(this.min,o),u={type:"date",skeleton:t.isBlazor()?"d":"yMd",calendar:r},d=this.globalize.formatDate(this.max,u);(+new Date(l)<+new Date(h)||+new Date(l)>+new Date(d))&&(s.splice(a,1),a=-1)}this.setProperties({values:s},!0)}},i.prototype.setValueUpdate=function(){t.isNullOrUndefined(this.tableBodyElement)||(t.detach(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},i.prototype.copyValues=function(e){var i=[];if(!t.isNullOrUndefined(e)&&e.length>0)for(var s=0;s<e.length;s++)i.push(new Date(+e[s]));return i},i.prototype.titleUpdate=function(e,i){var s,a,n=new t.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(s=n.formatDate(e,{type:"dateTime",skeleton:t.isBlazor()?"y":"yMMMM",calendar:r}),a=n.formatDate(e,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y",calendar:r})):(s=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),i){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},i.prototype.setActiveDescendant=function(){var e,i,s=this.tableBodyElement.querySelector("tr td.e-focused-date"),a=this.tableBodyElement.querySelector("tr td.e-selected"),n="Gregorian"===this.calendarMode?"gregorian":"islamic",r=this.currentView();return i="Month"===r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:t.isBlazor()?"D":"full",calendar:n}):"Year"===r?"islamic"!==n?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:t.isBlazor()?"y":"yMMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{format:t.isBlazor()?"yyyy":null,type:"date",skeleton:"y",calendar:n}),(a||s)&&(t.isNullOrUndefined(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",i),e=(s||a).getAttribute("id")),e},i.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},i.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?t.removeClass([this.element],[h]):this.calendarElement&&this.element&&t.removeClass([this.element],[h]),"calendar"===this.getModuleName()&&this.element&&(t.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&t.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),t.isNullOrUndefined(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),e.prototype.destroy.call(this)},i.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect="e-zoomin",this.switchView(++t,e)},i.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},i.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},i.prototype.navigatePrevious=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},i.prototype.navigateNext=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.navigateTo=function(e,t,i){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,i)},i.prototype.currentView=function(){return this.contentElement.classList.contains("e-year")?"Year":this.contentElement.classList.contains("e-decade")?"Decade":"Month"},i.prototype.getDateVal=function(e,i){return!t.isNullOrUndefined(i)&&e.getDate()===i.getDate()&&e.getMonth()===i.getMonth()&&e.getFullYear()===i.getFullYear()},i.prototype.getCultureObjects=function(e,i){var s=(t.isBlazor()?".dates.days.":".dates.calendars.gregorian.days.format.")+this.dayHeaderFormat.toLowerCase(),a=(t.isBlazor()?".dates.days.":".dates.calendars.islamic.days.format.")+this.dayHeaderFormat.toLowerCase(),n=t.isBlazor()?"":"main.";return"Gregorian"===this.calendarMode?t.getValue(n+""+this.locale+s,e):t.getValue("main."+this.locale+a,e)},i.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+864e5)/864e5/7)},i.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},i.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},i.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},i.prototype.getIdValue=function(e,i){var s;s=e?e.currentTarget:i;var a="Gregorian"===this.calendarMode?"gregorian":"islamic",n={type:"dateTime",skeleton:t.isBlazor()?"F":"full",calendar:a},r=this.globalize.formatDate(new Date(parseInt(""+s.getAttribute("id"),0)),n),l=this.globalize.parseDate(r,n),o=l.valueOf()-l.valueOf()%1e3;return new Date(o)},i.prototype.adjustLongHeaderSize=function(){t.removeClass([this.element],"e-calendar-day-header-lg"),"Wide"===this.dayHeaderFormat&&t.addClass(["calendar"===this.getModuleName()?this.element:this.calendarElement],"e-calendar-day-header-lg")},i.prototype.selectDate=function(e,i,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,i.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,i);else{if(a&&!this.checkPresentDate(i,n)){o=this.copyValues(n);!t.isNullOrUndefined(n)&&o.length>0?(o.push(new Date(this.checkValue(i))),this.setProperties({values:o},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(i))]},!0)}else this.setProperties({value:new Date(this.checkValue(i))},!0);this.currentDate=new Date(this.checkValue(i))}var l=t.closest(r,"."+h);if(t.isNullOrUndefined(l)&&(l=this.tableBodyElement),a||t.isNullOrUndefined(l.querySelector("."+p))||t.removeClass([l.querySelector("."+p)],p),a||t.isNullOrUndefined(l.querySelector("."+c))||t.removeClass([l.querySelector("."+c)],c),a){for(var o=this.copyValues(n),u=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<u.length;d++){var m=l.querySelectorAll("td."+c)[0],v=l.querySelectorAll("td."+p)[0];u[d]===m&&t.removeClass([u[d]],c),u[d]!==v||this.checkPresentDate(new Date(parseInt(v.getAttribute("id").split("_")[0],10)),n)||t.removeClass([u[d]],p)}if(r.classList.contains(p)){t.removeClass([r],p);for(var f=0;f<o.length;f++){var y="Gregorian"===this.calendarMode?"gregorian":"islamic",g={format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:y};if(this.globalize.formatDate(i,g)===this.globalize.formatDate(o[f],g)){d=o.indexOf(o[f]);o.splice(d,1),t.addClass([r],c)}}this.setProperties({values:o},!0)}else t.addClass([r],p)}else t.addClass([r],p);this.isDateSelected=!0},i.prototype.getFromatStringValue=function(){return t.isBlazor()?"M"+t.getDefaultDateObject().dateSeperator+"d"+t.getDefaultDateObject().dateSeperator+"yy":null},i.prototype.checkPresentDate=function(e,i){var s=!1;if(!t.isNullOrUndefined(i))for(var a=0;a<i.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(i[a],{format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},i.prototype.setAriaActiveDescendant=function(){t.attributes(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},i.prototype.previousIconHandler=function(e){e?(t.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),t.addClass([this.previousIcon],""+u),t.addClass([this.previousIcon],""+d),this.previousIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),t.removeClass([this.previousIcon],""+u),t.removeClass([this.previousIcon],""+d),this.previousIcon.setAttribute("aria-disabled","false"))},i.prototype.renderDayCellEvent=function(e){t.extend(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},i.prototype.navigatedEvent=function(e){t.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},i.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},i.prototype.nextIconHandler=function(e){e?(t.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),t.addClass([this.nextIcon],u),t.addClass([this.nextIcon],d),this.nextIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),t.removeClass([this.nextIcon],u),t.removeClass([this.nextIcon],d),this.nextIcon.setAttribute("aria-disabled","false"))},i.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(s=(n-=n%i)-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},i.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},i.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},i.prototype.compareYear=function(e,t){return this.compare(e,t,0)},i.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},i.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},i.prototype.addDay=function(e,i,s,a,n){var r=i,l=new Date(+e);if(!t.isNullOrUndefined(this.tableBodyElement)&&!t.isNullOrUndefined(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=i;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===i?i-i:i:r}e.setDate(e.getDate()+r)},i.prototype.findNextTD=function(e,i,s,a){var n=new Date(e.setDate(e.getDate()+i)),r=[],l=!1;if((!t.isNullOrUndefined(n)&&n.getMonth())===(!t.isNullOrUndefined(this.currentDate)&&this.currentDate.getMonth())){r=("Gregorian"===this.calendarMode?this.renderDays(n):this.islamicModule.islamicRenderDays(this.currentDate,n)).filter(function(e){return e.classList.contains(u)})}else r=this.tableBodyElement.querySelectorAll("td."+u);if(+n<=+s&&+n>=+a&&r.length)for(var o=0;o<r.length&&!(l=+n==+new Date(parseInt(r[o].id,0)));o++);return l},i.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-1},i.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},i.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},i.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},i.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},l([t.Property(new Date(1900,0,1))],i.prototype,"min",void 0),l([t.Property(!0)],i.prototype,"enabled",void 0),l([t.Property(null)],i.prototype,"cssClass",void 0),l([t.Property(new Date(2099,11,31))],i.prototype,"max",void 0),l([t.Property(null)],i.prototype,"firstDayOfWeek",void 0),l([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),l([t.Property("Month")],i.prototype,"start",void 0),l([t.Property("Month")],i.prototype,"depth",void 0),l([t.Property(!1)],i.prototype,"weekNumber",void 0),l([t.Property("FirstDay")],i.prototype,"weekRule",void 0),l([t.Property(!0)],i.prototype,"showTodayButton",void 0),l([t.Property("Short")],i.prototype,"dayHeaderFormat",void 0),l([t.Property(!1)],i.prototype,"enablePersistence",void 0),l([t.Property(null)],i.prototype,"keyConfigs",void 0),l([t.Property(null)],i.prototype,"serverTimezoneOffset",void 0),l([t.Event()],i.prototype,"created",void 0),l([t.Event()],i.prototype,"destroyed",void 0),l([t.Event()],i.prototype,"navigated",void 0),l([t.Event()],i.prototype,"renderDayCell",void 0),i=l([t.NotifyPropertyChanges],i)}(t.Component),f=function(e){function i(t,i){return e.call(this,t,i)||this}return r(i,e),i.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&t.throwError("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!t.isNullOrUndefined(this.values)&&this.values.length>0){for(var i=[],s=[],a=0;a<this.values.length;a++)-1===i.indexOf(+this.values[a])&&(i.push(+this.values[a]),s.push(this.values[a]));this.setProperties({values:s},!0);for(var n=0;n<this.values.length;n++)if(!this.checkDateValue(this.values[n]))if("string"==typeof this.values[n]&&this.checkDateValue(new Date(this.checkValue(this.values[n])))){var r=new Date(this.checkValue(this.values[n]));this.values.splice(n,1),this.values.splice(n,0,r)}else this.values.splice(n,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),this.setEnable(this.enabled),"calendar"===this.getModuleName()&&this.setClass(this.cssClass),e.prototype.render.call(this),"calendar"===this.getModuleName()){var l=t.closest(this.element,"form");l&&t.EventHandler.add(l,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},i.prototype.setEnable=function(e){e?t.removeClass([this.element],u):t.addClass([this.element],u)},i.prototype.setClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(i)||""===i||t.removeClass([this.element],i.split(" ")),t.isNullOrUndefined(e)||t.addClass([this.element],e.split(" "))},i.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},i.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},i.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},i.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!t.isNullOrUndefined(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},i.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!t.isNullOrUndefined(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||t.isNullOrUndefined(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},i.prototype.generateTodayVal=function(i){var s=new Date;return t.isNullOrUndefined(this.timezone)||(s=e.prototype.getDate.call(this,s,this.timezone)),i&&t.isNullOrUndefined(this.timezone)?(s.setHours(i.getHours()),s.setMinutes(i.getMinutes()),s.setSeconds(i.getSeconds()),s.setMilliseconds(i.getMilliseconds())):s=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0),s},i.prototype.todayButtonClick=function(t){if(this.showTodayButton){var i=this.generateTodayVal(this.value);if(this.setProperties({value:i},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var s=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,i,this.values)||(s.push(i),this.setProperties({values:s}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},i.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},i.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},i.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},i.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},i.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},i.prototype.renderDays=function(t,i,s,a,n){var r=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,n);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),r},i.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},i.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},i.prototype.renderTemplate=function(t,i,s,a){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,i,s,a,this.value):this.islamicModule.islamicRenderTemplate(t,i,s,a,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},i.prototype.clickHandler=function(i){var s=i.currentTarget;if(this.isPopupClicked=!0,s.classList.contains(o))if(this.isMultiSelection){var a=this.copyValues(this.values);a.push(this.getIdValue(i,null)),this.setProperties({values:a},!0),this.setProperties({value:this.values[this.values.length-1]},!0)}else this.setProperties({value:this.getIdValue(i,null)},!0);var n=this.currentView();e.prototype.clickHandler.call(this,i,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+c)[0])&&"Year"===n&&this.tableBodyElement.querySelectorAll("."+c)[0].classList.remove(c)},i.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},i.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},i.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);var t=["value","values"];return this.addOnPersist(t)},i.prototype.onPropertyChanged=function(t,i){this.effect="",this.rangeValidation(this.min,this.max);for(var s=0,a=Object.keys(t);s<a.length;s++)switch(a[s]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:i.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var n=this.copyValues(this.values),r=0;r<n.length;r++){var l=n[r];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,n)&&n.push(l)}this.setProperties({values:n},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,i.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,i,this.isMultiSelection,this.values)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var i=t.closest(this.element,"form");i&&t.EventHandler.remove(i,"reset",this.formResetHandler.bind(this))}},i.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},i.prototype.currentView=function(){return e.prototype.currentView.call(this)},i.prototype.addDate=function(i){if("string"!=typeof i&&"number"!=typeof i){var s=this.copyValues(this.values);if("object"==typeof i&&i.length>0)for(var a=i,n=0;n<a.length;n++)this.checkDateValue(a[n])&&!e.prototype.checkPresentDate.call(this,a[n],s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(a[n]):s=[new Date(+a[n])]);else this.checkDateValue(i)&&!e.prototype.checkPresentDate.call(this,i,s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(i):s=[new Date(+i)]);this.setProperties({values:s},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,s),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},i.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!t.isNullOrUndefined(this.values)&&this.values.length>0){var i=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var s=e,a=0;a<s.length;a++)for(n=0;n<i.length;n++)+i[n]==+s[a]&&i.splice(n,1);else for(var n=0;n<i.length;n++)+i[n]==+e&&i.splice(n,1);this.setProperties({values:i},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},i.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},i.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},i.prototype.selectDate=function(i,s,a){e.prototype.selectDate.call(this,i,s,a,this.isMultiSelection,this.values),this.isMultiSelection&&!t.isNullOrUndefined(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(i)},i.prototype.changeEvent=function(e){((this.value&&this.value.valueOf())!==(this.previousDate&&+this.previousDate.valueOf())||this.isMultiSelection)&&(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},i.prototype.triggerChange=function(e){!t.isNullOrUndefined(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),t.isNullOrUndefined(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||+this.value==+this.previousDate&&(null!=this.previousDate||isNaN(+this.value))?t.isNullOrUndefined(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},l([t.Property(null)],i.prototype,"value",void 0),l([t.Property(null)],i.prototype,"values",void 0),l([t.Property(!1)],i.prototype,"isMultiSelection",void 0),l([t.Event()],i.prototype,"change",void 0),i=l([t.NotifyPropertyChanges],i)}(v),y=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,i){var s=new t.Internationalization(this.calendarInstance.locale);switch(i){case"days":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},e.prototype.islamicRenderDays=function(e,i,s,a){var n,r=[],l=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var o=this.getIslamicDate(l),h=this.toGregorian(o.year,o.month,1),u=o.month;for(l=h;l.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(l,-864e5);for(var d=0;d<42;++d){var p=this.calendarInstance.createElement("td",{className:"e-cell"}),c=this.calendarInstance.createElement("span");d%7==0&&this.calendarInstance.weekNumber&&(c.textContent=""+this.calendarInstance.getWeek(l),p.appendChild(c),t.addClass([p],"e-week-number"),r.push(p)),n=new Date(+l),l=this.calendarInstance.minMaxDate(l);var m={type:"dateTime",skeleton:"full",calendar:"islamic"},v=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(l,m),m),f=this.islamicDayCell(l),y=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"full",calendar:"islamic"}),g=this.calendarInstance.createElement("span");g.textContent=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"d",calendar:"islamic"});var b=this.calendarInstance.min>l||this.calendarInstance.max<l;b?(t.addClass([f],"e-disabled"),t.addClass([f],"e-overlay")):g.setAttribute("title",""+y),u!==this.getIslamicDate(l).month&&t.addClass([f],"e-other-month"),0!==l.getDay()&&6!==l.getDay()||t.addClass([f],"e-weekend"),f.appendChild(g),this.calendarInstance.renderDayCellArgs={date:l,isDisabled:!1,element:f,isOutOfRange:b};var D=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(D),D.isDisabled)if(this.calendarInstance.isMultiSelection){if(!t.isNullOrUndefined(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var E=0;E<a.length;E++)(w=+new Date(this.calendarInstance.globalize.formatDate(D.date,{type:"date",skeleton:"yMd",calendar:"islamic"})))===(V=+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[E],{type:"date",skeleton:"yMd",calendar:"islamic"})))&&(this.calendarInstance.values.splice(E,1),E=-1)}else i&&+i==+D.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!f.classList.contains("e-selected")&&(t.addClass([f],"e-disabled"),t.addClass([f],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=f.classList.contains("e-other-month"),k=f.classList.contains("e-disabled");if(k||t.EventHandler.add(f,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||t.isNullOrUndefined(this.calendarInstance.values)||C||k)C||k||!this.calendarInstance.getDateVal(l,i)?this.calendarInstance.updateFocus(C,k,l,f,e):t.addClass([f],"e-selected");else{for(var M=0;M<this.calendarInstance.values.length;M++){var w=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"short",calendar:"islamic"}),V=this.calendarInstance.globalize.formatDate(this.calendarInstance.values[M],{type:"date",skeleton:"short",calendar:"islamic"});w===V&&this.calendarInstance.getDateVal(l,this.calendarInstance.values[M])?t.addClass([f],"e-selected"):this.calendarInstance.updateFocus(C,k,l,f,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(C,k,l,f,e)}v.getDate()===(new Date).getDate()&&v.getMonth()===(new Date).getMonth()&&v.getFullYear()===(new Date).getFullYear()&&t.addClass([f],"e-today"),l=new Date(+n),r.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(l,1,null,this.calendarInstance.max,this.calendarInstance.min)}return r},e.prototype.islamicIconHandler=function(){new Date(this.islamicInValue(this.calendarInstance.currentDate)).setDate(1);var e=new Date(this.islamicInValue(this.calendarInstance.currentDate));switch(this.calendarInstance.currentView()){case"Month":var t=this.islamicCompareMonth(e,this.calendarInstance.min)<1,i=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":var s=this.hijriCompareYear(e,this.calendarInstance.min)<1,a=this.hijriCompareYear(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(s),this.calendarInstance.nextIconHandler(a);break;case"Decade":var n=this.hijriCompareDecade(e,this.calendarInstance.min)<1,r=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(n),this.calendarInstance.nextIconHandler(r)}},e.prototype.islamicNext=function(){this.calendarInstance.effect="";var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year+1,t.month,1),this.calendarInstance.switchView(e);break;case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month+1,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.currentDate=this.toGregorian(t.year+10,t.month,1),this.calendarInstance.switchView(e)}},e.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.effect="";var t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month-1,1),this.calendarInstance.switchView(e);break;case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year-1,t.month,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.currentDate=this.toGregorian(t.year-10,t.month-1,1),this.calendarInstance.switchView(e)}},e.prototype.islamicRenderYears=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(n);n=t.HijriParser.toGregorian(r.year,1,1);var l=r.month,o=r.year,h=r.year,u=this.getIslamicDate(this.calendarInstance.min).year,d=this.getIslamicDate(this.calendarInstance.min).month,p=this.getIslamicDate(this.calendarInstance.max).year,c=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var m=1;m<=12;++m){var v=this.getIslamicDate(n);n=t.HijriParser.toGregorian(v.year,m,1);var f=this.islamicDayCell(n),y=this.calendarInstance.createElement("span"),g=i&&this.getIslamicDate(i).month===this.getIslamicDate(n).month,b=i&&this.getIslamicDate(i).year===o&&g;y.textContent=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(h<u||m<d&&h===u)||this.calendarInstance.max&&(h>p||m>c&&h>=p)?t.addClass([f],"e-disabled"):!a&&b?t.addClass([f],"e-selected"):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&t.addClass([f],"e-focused-date"),f.classList.contains("e-disabled")||t.EventHandler.add(f,"click",this.calendarInstance.clickHandler,this.calendarInstance),f.appendChild(y),s.push(f)}this.islamicRenderTemplate(s,4,"e-year",e,i)},e.prototype.islamicRenderDecade=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=t.HijriParser.toGregorian(n.year,1,1)).getFullYear(),l=new Date(this.islamicInValue(r-r%10)),o=new Date(this.islamicInValue(r-r%10+9)),h=l.getFullYear(),u=o.getFullYear(),d=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),p=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(r-r%10-2,0,1).getFullYear(),m=1;m<=12;++m){var v=c+m;a.setFullYear(v),a.setDate(1),a.setMonth(0);var f=this.getIslamicDate(a);a=t.HijriParser.toGregorian(f.year,1,1);var y=this.islamicDayCell(a);t.attributes(y,{role:"gridcell"});var g=this.calendarInstance.createElement("span");g.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"y",calendar:"islamic"}),v<h||v>u?t.addClass([y],"e-other-month"):v<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||v>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?t.addClass([y],"e-disabled"):t.isNullOrUndefined(i)||this.getIslamicDate(a).year!==this.getIslamicDate(i).year?a.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||y.classList.contains("e-disabled")||t.addClass([y],"e-focused-date"):t.addClass([y],"e-selected"),y.classList.contains("e-disabled")||t.EventHandler.add(y,"click",this.calendarInstance.clickHandler,this.calendarInstance),y.appendChild(g),s.push(y)}this.islamicRenderTemplate(s,4,"e-decade",e,i)},e.prototype.islamicDayCell=function(e){var i={skeleton:"full",type:"dateTime",calendar:"islamic"},s=this.calendarInstance.globalize.formatDate(e,i),a=this.calendarInstance.globalize.parseDate(s,i).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",n)},e.prototype.islamicRenderTemplate=function(e,i,s,a,n){var r,l=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),t.removeClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[s]);for(var o=i,h=0,u=0;u<e.length/i;++u){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),h=0+h;h<o;h++)e[h].classList.contains("e-week-number")||t.isNullOrUndefined(e[h].children[0])||(t.addClass([e[h].children[0]],["e-day"]),t.rippleEffect(e[h].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[h]),this.calendarInstance.weekNumber&&7===h&&e[7].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"):35===h&&e[35].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide");o+=i,h+=0,this.calendarInstance.tableBodyElement.appendChild(r)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===l&&l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(a),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},e.prototype.islamicCompareMonth=function(e,t){var i=this.getIslamicDate(e),s=this.getIslamicDate(t);return i.year>s.year?1:i.year<s.year?-1:i.month===s.month?0:i.month>s.month?1:-1},e.prototype.islamicCompare=function(e,t,i){var s,a,n=this.getIslamicDate(e),r=this.getIslamicDate(t).year;return s=r,a=0,i&&(s=(r-=r%i)-r%i+i-1),n.year>s?a=1:"Decade"===this.calendarInstance.currentView()&&n.year<r&&!(e.getFullYear()>=2060&&e.getFullYear()<=2069)?a=-1:n.year<r&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return t.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,i,s){return t.HijriParser.toGregorian(e,i,s)},e.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},e.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},e.prototype.destroy=function(){this.calendarInstance=null},e.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},e}(),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)}}(),b=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},D="e-datepicker",E=["title","class","style"],C=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.previousElementValue="",s.isDateIconClicked=!1,s.isAltKeyPressed=!1,s.isInteracted=!0,s.isBlazorServer=!1,s.invalidValueString=null,s.checkPreviousValue=null,s.maskedDateValue="",s.isAngular=!1,s.preventChange=!1,s.isIconClicked=!1,s.isDynamicValueChanged=!1,s.moduleName=s.getModuleName(),s.datepickerOptions=t,s}return g(a,e),a.prototype.render=function(){this.initialize(),this.bindEvents(),this.renderComplete(),this.isBlazorServer||this.setTimeZone(this.serverTimezoneOffset)},a.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3),this.updateInput()}},a.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},a.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateIconState()},a.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},a.prototype.initialize=function(){if(this.isBlazorServer){var e=this.element.parentElement;this.inputWrapper={container:e,clearButton:e.querySelector(".e-clear-icon"),buttons:[e.querySelector(".e-date-icon")]},s.Input.bindInitialEvent({element:this.inputElement,floatLabelType:this.floatLabelType}),this.showClearButton&&this.inputWrapper.clearButton&&s.Input.wireClearBtnEvents(this.inputElement,this.inputWrapper.clearButton,this.inputWrapper.container),this.setAllowEdit()}else this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.checkInvalidValue(this.value),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setAllowEdit(),this.updateInput(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||this.updateInputValue(this.maskedDateValue);this.previousElementValue=this.inputElement.value,this.previousDate=t.isNullOrUndefined(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},a.prototype.createInput=function(){var e={"aria-live":"assertive","aria-atomic":"true","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"};if("datepicker"===this.getModuleName()){var i={placeholder:this.placeholder};this.globalize=new t.Internationalization(this.locale),this.l10n=new t.L10n("datepicker",i,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}var a=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var n=!this.enableMask;this.inputWrapper=s.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:n,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:a,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-date-icon e-icons"]},this.createElement),this.setWidth(this.width),""!==this.inputElement.name?this.inputElement.setAttribute("name",""+this.inputElement.getAttribute("name")):this.inputElement.setAttribute("name",""+this.element.id),t.attributes(this.inputElement,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),s.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),t.addClass([this.inputWrapper.container],"e-date-wrapper")},a.prototype.updateInput=function(i){void 0===i&&(i=!1);var s;if(!this.value||this.isCalendar()||i||this.isBlazorServer||this.disabledDates(),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(e.prototype.validateDate.call(this),this.minMaxUpdates(),e.prototype.minMaxUpdate.call(this)),!t.isNullOrUndefined(this.value)){var a=this.value,n=void 0,r=t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?n="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:r,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(this.value,{format:r,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=this.globalize.formatDate(this.value,s)),+a<=+this.max&&+a>=+this.min)this.updateInputValue(n);else{var l=+a>=+this.max||!+this.value||!+this.value||+a<=+this.min;!this.strictMode&&l&&this.updateInputValue(n)}}t.isNullOrUndefined(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},a.prototype.minMaxUpdates=function(){!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},a.prototype.checkStringValue=function(e){var i=null,s=null,a=null;if("datetimepicker"===this.getModuleName()){var n=new t.Internationalization(this.locale);"Gregorian"===this.calendarMode?(s={format:this.dateTimeFormat,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"},a={format:n.getDatePattern({skeleton:t.isBlazor()?"d":"yMd"}),type:"dateTime"}):(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a={format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};return i=this.checkDateValue(this.globalize.parseDate(e,s)),t.isNullOrUndefined(i)&&"datetimepicker"===this.getModuleName()&&(i=this.checkDateValue(this.globalize.parseDate(e,a))),i},a.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||t.isNullOrUndefined(e))){var i=null,s=e;"number"==typeof e&&(s=e.toString());if("datetimepicker"===this.getModuleName()){var a=new t.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"},{format:a.getDatePattern({skeleton:t.isBlazor()?"d":"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:a.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var n=!1;if("string"!=typeof s)s=null,n=!0;else if("string"==typeof s&&(s=s.trim()),!(i=this.checkStringValue(s))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(s)||isNaN(+new Date(this.checkValue(s)))?n=!0:i=new Date(s)}n?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0)):this.setProperties({value:i},!0)}},a.prototype.bindInputEvent=function(){t.isNullOrUndefined(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?t.EventHandler.add(this.inputElement,"input",this.inputHandler,this):t.EventHandler.remove(this.inputElement,"input",this.inputHandler))},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.dateIconHandler,this),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&(this.inputWrapper.clearButton||this.isBlazorServer)&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},a.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},a.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.dateIconHandler),t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.enableMask&&t.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&(this.inputWrapper.clearButton||this.isBlazorServer)&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.prototype.resetFormHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value");"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(e="",this.inputValueCopy=null,this.inputElement.setAttribute("value","")),this.isBlazorServer||(this.setProperties({value:this.inputValueCopy},!0),this.restoreValue(),this.inputElement&&(this.updateInputValue(e),this.errorClass()))}},a.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"})},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},a.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},a.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.isBlazorServer||this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var t={event:e};this.trigger("cleared",t),this.invalidValueString="",this.isBlazorServer||(this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"})),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnValueCleared")},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&(this.inputElement.setAttribute("readonly",""),this.inputElement.blur()),this.isBlazorServer||e.preventDefault(),this.readonly||(this.isCalendar()&&!this.isBlazorServer?this.hide(e):(!this.isBlazorServer||this.isBlazorServer&&this.inputWrapper.container.nextElementSibling)&&(this.isDateIconClicked=!0,this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus(),this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]),t.addClass(this.inputWrapper.buttons,"e-active"))),this.isIconClicked=!1)},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(!t.isNullOrUndefined(this.htmlAttributes[s])&&E.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);t.isNullOrUndefined(n)?n=this.htmlAttributes[s]:";"===n.charAt(n.length-1)?n+=this.htmlAttributes[s]:n=n+";"+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];E.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.calendarKeyActionHandle=function(e){switch(e.action){case"escape":this.isCalendar()?this.hide(e):this.inputWrapper.container.children[this.index].blur();break;case"enter":this.isCalendar()?+this.value==+this.currentDate||this.isCalendar()||this.inputWrapper.container.children[this.index].focus():this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus();break;case"tab":this.hide(e)}},a.prototype.inputFocusHandler=function(){if(this.enabled){this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length));var e={model:t.isBlazor()&&this.isServerRendered?null:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},a.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),""===this.inputElement.value&&t.isNullOrUndefined(this.value)&&(this.invalidValueString=null,this.updateInputValue("")),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!=this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||this.updateInputValue("")),this.errorClass()),this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e),"datepicker"===this.getModuleName()){var i={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",i)}this.isCalendar()&&(this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new t.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},a.prototype.documentHandler=function(i){!t.isNullOrUndefined(this.popupObj)&&(this.inputWrapper.container.contains(i.target)||this.popupObj.element&&this.popupObj.element.contains(i.target))&&"touchstart"!==i.type&&i.preventDefault();var s=i.target;t.closest(s,".e-datepicker.e-popup-wrapper")||t.closest(s,".e-input-group")===this.inputWrapper.container||s.classList.contains("e-day")?t.closest(s,".e-datepicker.e-popup-wrapper")&&(s.classList.contains("e-day")&&!t.isNullOrUndefined(i.target.parentElement)&&i.target.parentElement.classList.contains("e-selected")&&t.closest(s,".e-content")&&t.closest(s,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(i):t.closest(s,".e-footer-container")&&s.classList.contains("e-today")&&s.classList.contains("e-btn")&&+new Date(+this.value)==+e.prototype.generateTodayVal.call(this,this.value)&&!this.isBlazorServer&&this.hide(i)):(this.hide(i),this.focusOut())},a.prototype.inputKeyActionHandle=function(e){var t=this.currentView();switch(e.action){case"altUpArrow":this.isAltKeyPressed=!1,this.hide(e),this.inputElement.focus();break;case"altDownArrow":this.isAltKeyPressed=!0,this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.changeTrigger(e)),"datepicker"===this.getModuleName()&&(this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnPopupHide",!0):this.show(null,e));break;case"escape":this.hide(e);break;case"enter":this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.isCalendar()||document.activeElement!==this.inputElement||this.hide(e),this.isCalendar()&&(e.preventDefault(),e.stopPropagation());break;case"tab":case"shiftTab":var i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var a=this.inputElement.value.length;(0==i&&s==a||s!==a&&"tab"==e.action||0!==i&&"shiftTab"==e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}),i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd}this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.enableMask&&(this.inputElement.selectionStart=i,this.inputElement.selectionEnd=s),this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},a.prototype.defaultAction=function(i){this.previousDate=!t.isNullOrUndefined(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,i),!this.isBlazorServer&&this.isCalendar()&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},a.prototype.popupUpdate=function(){if((t.isNullOrUndefined(this.value)&&!t.isNullOrUndefined(this.previousDate)||+this.value!=+this.previousDate)&&(this.popupObj&&this.popupObj.element.querySelectorAll(".e-selected").length>0&&t.removeClass(this.popupObj.element.querySelectorAll(".e-selected"),["e-selected"]),!t.isNullOrUndefined(this.value)&&!this.isBlazorServer&&+this.value>=+this.min&&+this.value<=+this.max)){var i=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",i)}},a.prototype.strictModeUpdate=function(){var e,i;e="datetimepicker"===this.getModuleName()?t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString:t.isNullOrUndefined(this.formatString)?this.formatString:this.formatString.replace("dd","d"),t.isNullOrUndefined(e)||e.split("M").length-1<3&&(e=e.replace("MM","M"));var s;s="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var a;"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.inputElement.value,s))?a=this.globalize.parseDate(this.inputElement.value,s):(i="Gregorian"===this.calendarMode?{type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.inputElement.value,i)):(a=this.globalize.parseDate(this.inputElement.value,s),a=!t.isNullOrUndefined(a)&&isNaN(+a)?null:a,!t.isNullOrUndefined(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&a.setFullYear(this.value.getFullYear())),"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&a&&a.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&a?(this.updateInputValue(this.globalize.formatDate(a,s)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0),this.strictMode&&!a&&""===this.inputElement.value&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),t.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},a.prototype.createCalendar=function(){var e=this;this.isBlazorServer?(this.popupWrapper=this.inputWrapper.container.nextElementSibling,this.calendarElement=this.popupWrapper.firstElementChild,this.tableBodyElement=t.select("tbody",this.calendarElement),this.contentElement=t.select(".e-content",this.calendarElement)):(this.popupWrapper=this.createElement("div",{className:D+" e-popup-wrapper"}),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass)),t.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=D+" e-date-modal",document.body.className+=" e-date-overflow",this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new i.Popup(this.popupWrapper,{content:this.isBlazorServer?null:this.calendarElement,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},offsetY:4,targetType:"container",enableRtl:this.enableRtl,zIndex:this.zIndex,collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},open:function(){"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=t.extend(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new t.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new t.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}))},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&!e.isBlazorServer&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),t.detach(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.isBlazorServer||(this.popupObj.element.className+=" "+this.cssClass),this.setAriaAttributes()},a.prototype.setAriaDisabled=function(){this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1)},a.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),s=this.createElement("div"),a=this.createElement("span",{className:"e-model-day"}),n=this.createElement("span",{className:"e-model-month"});e="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"},i.textContent=""+this.globalize.formatDate(this.value||new Date,e),e="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},a.textContent=this.globalize.formatDate(this.value||new Date,e)+", ",e="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},n.textContent=""+this.globalize.formatDate(this.value||new Date,e),t.appendChild(i),s.appendChild(a),s.appendChild(n),t.appendChild(s),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},a.prototype.changeTrigger=function(e){this.inputElement.value!==this.previousElementValue&&(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.isDynamicValueChanged&&this.isCalendar()&&this.popupUpdate(),this.changedArgs.value=this.value,this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousElementValue=this.inputElement.value,this.previousDate=isNaN(+new Date(this.checkValue(this.value)))?null:new Date(this.checkValue(this.value)),this.isInteracted=!0)},a.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},a.prototype.changeEvent=function(e){(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.selectCalendar(e),this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=this.isInteracted,this.isDynamicValueChanged||this.trigger("change",this.changedArgs),this.previousDate=this.value&&new Date(+this.value),this.isDynamicValueChanged||this.hide(e),this.previousElementValue=this.inputElement.value,this.errorClass())},a.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.selectCalendar=function(e){var i,s,a;s="datetimepicker"===this.getModuleName()&&t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(a="Gregorian"===this.calendarMode?{format:s,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:s,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=this.globalize.formatDate(this.changedArgs.value,a)):(a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=this.globalize.formatDate(this.changedArgs.value,a)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),t.isNullOrUndefined(i)||(this.updateInputValue(i),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-popup-wrapper"))},a.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?t.formatUnit(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:t.formatUnit(this.width):"100%"},a.prototype.show=function(i,s){var a=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var n=!0,r=void 0;t.isNullOrUndefined(this.value)||+this.value>=+this.min&&+this.value<=+this.max?r=this.value||null:(r=new Date(this.checkValue(this.value)),this.isBlazorServer||this.setProperties({value:null},!0)),this.isCalendar()||(this.isBlazorServer||(e.prototype.render.call(this),this.setProperties({value:r||null},!0)),this.previousDate=r,this.createCalendar()),t.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){n=!1},popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,event:s||null,cancel:!1,appendTo:t.Browser.isDevice?this.mobilePopupWrapper:document.body};var l=this.preventArgs;this.trigger("open",l,function(i){if(a.preventArgs=i,n&&!a.preventArgs.cancel){a.isBlazorServer&&(a.popupWrapper.style.visibility="",a.popupWrapper.style.width="auto",a.popupWrapper.style.height="auto"),t.addClass(a.inputWrapper.buttons,"e-active"),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:t.Browser.isDevice?0:300};1e3===a.zIndex?a.popupObj.show(new t.Animation(s),a.element):a.popupObj.show(new t.Animation(s),null),a.isBlazorServer||e.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,t.Browser.isDevice),a.setAriaAttributes()}else a.popupObj.destroy(),a.isBlazorServer&&a.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),a.popupWrapper=a.popupObj=null;t.isNullOrUndefined(a.inputElement)||""!==a.inputElement.value||!t.isNullOrUndefined(a.tableBodyElement)&&a.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(t.addClass([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),t.removeClass(a.tableBodyElement.querySelectorAll("td.e-selected"),"e-selected")),t.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)})}},a.prototype.hide=function(e){var i=this;if(t.isNullOrUndefined(this.popupWrapper))t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var s=!0;this.preventArgs={preventDefault:function(){s=!1},popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,event:e||null,cancel:!1},t.removeClass(this.inputWrapper.buttons,"e-active"),t.removeClass([document.body],"e-date-overflow");var a=this.preventArgs;this.isCalendar()?this.trigger("close",a,function(e){i.closeEventCallback(s,e)}):this.closeEventCallback(s,a)}},a.prototype.closeEventCallback=function(e,i){this.preventArgs=i,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.isBlazorServer?(this.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),this.isAltKeyPressed=!1,this.popupWrapper=this.popupObj=null):(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy()),t.removeClass(this.inputWrapper.buttons,"e-active")),this.setAriaAttributes(),t.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(this.mobilePopupWrapper)||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),t.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},a.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]))},a.prototype.focusOut=function(){document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],["e-input-focus"]),this.inputElement.blur())},a.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},a.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},a.prototype.destroy=function(){this.unBindEvents(),this.isBlazorServer||(e.prototype.destroy.call(this),this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this));var i={"aria-live":"assertive","aria-atomic":"true","aria-disabled":"true","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"};this.inputElement&&(s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.isBlazorServer||this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),t.removeClass([this.inputElement],["e-input"])),t.removeClass([this.element],[D]),t.detach(this.inputWrapper.container)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.inputElementCopy.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.inputElementCopy.getAttribute(e[i])))},a.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),t.removeClass([this.inputElementCopy],[D,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=t.closest(this.inputElement,"form"),this.index=this.showClearButton?2:1,this.isBlazorServer=!(!t.isBlazor()||!this.isServerRendered||"datepicker"!==this.getModuleName()),this.isBlazorServer||(this.ngTag=null,"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(this.ngTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.element.getAttribute("id")?null!==this.ngTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):"datetimepicker"===this.getModuleName()?(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=t.getUniqueID("ej2-datepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),null!==this.ngTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement()),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.checkHtmlAttributes(!1),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.isBlazorServer||(this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this))},a.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={altUpArrow:"alt+uparrow",altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",shiftTab:"shift+tab",tab:"tab"},this.defaultKeyConfigs},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.checkFormat=function(){var e=new t.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=t.isBlazor()?this.format.replace(/tt/,"a"):this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var i=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:i,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:i,type:"date"})}else this.formatString=null},a.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView();var i,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};for(var a=0,n=s;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e)&&!this.isBlazorServer){var l="disabled"!==this.inputElement.getAttribute(r)&&""!==this.inputElement.getAttribute(r)&&"true"!==this.inputElement.getAttribute(r);this.setProperties({enabled:l},!e)}break;case"readonly":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e)&&!this.isBlazorServer){var o="readonly"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":!t.isNullOrUndefined(this.datepickerOptions)&&void 0!==this.datepickerOptions.placeholder&&!e||this.isBlazorServer||this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"style":this.isBlazorServer||this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"name":this.isBlazorServer||this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"value":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.value||e)&&!this.isBlazorServer){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(h,i),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var u=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(u),{}),!e)}break;case"max":if(+this.max==+new Date(2099,11,31)||e){var d=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(d),{}),!e)}break;case"type":"text"===this.inputElement.getAttribute(r)||this.isBlazorServer||this.inputElement.setAttribute("type","text")}}},a.prototype.getModuleName=function(){return"datepicker"},a.prototype.disabledDates=function(){var i,s=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),a=this.previousDate;this.minMaxUpdates(),this.isBlazorServer||e.prototype.render.call(this),this.previousDate=a;var n=s&&+s,r='*[id^="/id"]'.replace("/id",""+n);this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+s)&&this.setProperties({value:s},!0),t.isNullOrUndefined(this.calendarElement.querySelectorAll(r)[0])||this.calendarElement.querySelectorAll(r)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var l;"datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(s,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(s,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(i="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(s,i)),this.popupObj||(this.updateInputValue(l),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})))},a.prototype.setAriaAttributes=function(){if(this.isBlazorServer)if(this.isCalendar()){var e=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected"),a=e||i?(e||i).getAttribute("id"):"null";t.attributes(this.inputElement,{"aria-activedescendant":""+a})}else t.attributes(this.inputElement,{"aria-activedescendant":"null"});else this.isCalendar()?(s.Input.addAttributes({"aria-expanded":"true"},this.inputElement),t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(s.Input.addAttributes({"aria-expanded":"false"},this.inputElement),t.attributes(this.inputElement,{"aria-activedescendant":"null"}))},a.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),i=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!t.isNullOrUndefined(this.value)&&!(+new Date(+this.value).setMilliseconds(0)>=+this.min&&+new Date(+this.value).setMilliseconds(0)<=+this.max)||!this.strictMode&&""!==this.inputElement.value&&this.inputElement.value!==this.maskedDateValue&&t.isNullOrUndefined(this.value)||i?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},a.prototype.onPropertyChanged=function(i,a){for(var n=0,r=Object.keys(i);n<r.length;n++){switch(r[n]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.isBlazorServer||this.checkInvalidValue(i.value),i.value=this.value,this.previousElementValue=this.inputElement.value,this.isBlazorServer||(t.isNullOrUndefined(this.value)&&(this.updateInputValue(""),this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.updateInput(!0),+this.previousDate!=+this.value&&this.changeTrigger(null)),this.isInteracted=!0,this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"format":this.checkFormat(),this.bindInputEvent(),this.isBlazorServer||(this.updateInput(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||this.updateInputValue(this.maskedDateValue)));break;case"allowEdit":this.setAllowEdit();break;case"placeholder":s.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.isBlazorServer||(this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&!this.isBlazorServer&&e.prototype.onPropertyChanged.call(this,i,a);break;case"zIndex":this.setProperties({zIndex:i.zIndex},!0);break;case"cssClass":this.updateCssClass(i.cssClass,a.cssClass);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent(),this.index=this.showClearButton?2:1;break;case"strictMode":this.invalidValueString=null,this.isBlazorServer||this.updateInput();break;case"width":this.setWidth(i.width);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue),this.bindInputEvent()):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("");break;default:this.calendarElement&&!this.isBlazorServer&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,i,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},b([t.Property(null)],a.prototype,"width",void 0),b([t.Property(null)],a.prototype,"value",void 0),b([t.Property(null)],a.prototype,"cssClass",void 0),b([t.Property(!1)],a.prototype,"strictMode",void 0),b([t.Property(null)],a.prototype,"format",void 0),b([t.Property(!0)],a.prototype,"enabled",void 0),b([t.Property({})],a.prototype,"htmlAttributes",void 0),b([t.Property(null)],a.prototype,"values",void 0),b([t.Property(!1)],a.prototype,"isMultiSelection",void 0),b([t.Property(!0)],a.prototype,"showClearButton",void 0),b([t.Property(!0)],a.prototype,"allowEdit",void 0),b([t.Property(null)],a.prototype,"keyConfigs",void 0),b([t.Property(!1)],a.prototype,"enablePersistence",void 0),b([t.Property(1e3)],a.prototype,"zIndex",void 0),b([t.Property(!1)],a.prototype,"readonly",void 0),b([t.Property(null)],a.prototype,"placeholder",void 0),b([t.Property("Never")],a.prototype,"floatLabelType",void 0),b([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),b([t.Property(!1)],a.prototype,"openOnFocus",void 0),b([t.Property(!1)],a.prototype,"enableMask",void 0),b([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),b([t.Event()],a.prototype,"open",void 0),b([t.Event()],a.prototype,"cleared",void 0),b([t.Event()],a.prototype,"close",void 0),b([t.Event()],a.prototype,"blur",void 0),b([t.Event()],a.prototype,"focus",void 0),b([t.Event()],a.prototype,"created",void 0),b([t.Event()],a.prototype,"destroyed",void 0),a=b([t.NotifyPropertyChanges],a)}(f),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)}}(),M=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},w="e-left-calendar",V="e-right-calendar",O="e-daterangepicker",N="e-active",I="e-start-date",S="e-end-date",A="e-range-hover",x="e-disabled",T="e-calendar",P="e-focused-date",U="e-day-span",H="e-date-disabled",B="e-icon-disabled",W="e-overlay",z="e-list-item",L="e-hover",F=["title","class","style"],j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),M([t.Property()],i.prototype,"label",void 0),M([t.Property()],i.prototype,"start",void 0),M([t.Property()],i.prototype,"end",void 0),i}(t.ChildProperty),R=function(e){function r(t,i){var s=e.call(this,t,i)||this;return s.isCustomRange=!1,s.isCustomWindow=!1,s.presetsItem=[],s.liCollections=[],s.previousEleValue="",s.isKeyPopup=!1,s.dateDisabled=!1,s.isRangeIconClicked=!1,s.isMaxDaysClicked=!1,s.disabledDays=[],s.preventBlur=!1,s.preventFocus=!1,s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.dateRangeOptions=t,s}return k(r,e),r.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},r.prototype.preRender=function(){if(this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],[O,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var i=this.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=t.closest(this.element,"form")},r.prototype.updateValue=function(){this.value&&this.value.length>0?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"==typeof this.value[0]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))):(this.startValue=null,this.setValue()),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):"string"==typeof this.value[1]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):"string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end)),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):t.isNullOrUndefined(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},r.prototype.initProperty=function(){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView(),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},r.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},r.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),t.merge(this.defaultKeyConfigs,{shiftTab:"shift+tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new t.L10n("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},r.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,a=Object.keys(t);s<a.length;s++){var n=a[s];0===n.indexOf("data")&&(this.firstHiddenChild.setAttribute(n,t[n]),this.secondHiddenChild.setAttribute(n,t[n]))}},r.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateClearIconState()},r.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},r.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},r.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(F.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[s]:n+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},r.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];F.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},r.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},r.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var i=0,s=this.presets;i<s.length;i++){var a=s[i],n=a.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof a.end?this.presetsItem.push({id:n,text:a.label,end:new Date(this.checkValue(a.end)),start:new Date(this.checkValue(a.start))}):this.presetsItem.push({id:n,text:a.label,start:a.start,end:a.end})}var r=t.isNullOrUndefined(this.startValue)?null:new Date(+this.startValue),l=t.isNullOrUndefined(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:l}),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},r.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},r.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||t.isNullOrUndefined(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},r.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={type:"datetime",skeleton:t.isBlazor()?"d":"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.endDate,e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change")}},r.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},r.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},r.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e)}},r.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},r.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var i=this.inputElement.getAttribute("value");t.isNullOrUndefined(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),i="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(s.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},r.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&this.value.length>0&&this.setProperties({value:null},!0),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),t.isNullOrUndefined(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},r.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||t.isNullOrUndefined(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),t.addClass([this.inputWrapper.container],["e-input-focus"])))},r.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale);for(var i=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],s={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},a=0,n=i;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var l="disabled"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({enabled:!l},!e)}break;case"readonly":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var o="readonly"===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"value":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,h,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"min":if(t.isNullOrUndefined(this.min)||+this.min==+new Date(1900,0,1)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"max":if(t.isNullOrUndefined(this.max)||+this.max==+new Date(2099,11,31)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"startDate":if(t.isNullOrUndefined(this.startDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.startValue=u,this.setValue()}break;case"endDate":if(t.isNullOrUndefined(this.endDate)){var u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.endValue=u,this.setValue()}break;case"minDays":t.isNullOrUndefined(this.minDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"maxDays":t.isNullOrUndefined(this.maxDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},r.prototype.createPopup=function(){for(e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(var e=0;e<=this.presetsItem.length-2;e++){var i=this.presetsItem[e].start,s=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(i.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(s.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=t.createElement("div",{id:this.element.id+"_popup",className:O+" e-popup"}),this.adjustLongHeaderWidth();var a=!this.isCustomRange||this.isMobile;!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&a?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},r.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.disabledDateRender(),this.updateHeader()},r.prototype.clearCalendarEvents=function(){t.EventHandler.clearEvents(this.leftCalPrevIcon),t.EventHandler.clearEvents(this.leftCalNextIcon),t.EventHandler.clearEvents(this.rightCalPrevIcon),t.EventHandler.clearEvents(this.rightCalNextIcon)},r.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},r.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(x)&&t.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(x)&&t.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(x)&&t.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(x)&&t.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},r.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),t.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),t.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector(".e-right-calendar .e-header .e-title"),this.headerTitleElement=this.popupObj.element.querySelector(".e-left-calendar .e-header .e-title"),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new t.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new t.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.calendarIconRipple=function(){t.rippleEffect(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},r.prototype.deviceCalendarEvent=function(){t.EventHandler.clearEvents(this.nextIcon),t.EventHandler.clearEvents(this.previousIcon),t.rippleEffect(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(x)&&t.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(x)&&t.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},r.prototype.deviceNavNext=function(e){var i=t.closest(e.target,"."+T);this.updateDeviceCalendar(i),this.navigateNext(e),this.deviceNavigation()},r.prototype.deviceNavPrevious=function(e){var i=t.closest(e.target,"."+T);this.updateDeviceCalendar(i),this.navigatePrevious(e),this.deviceNavigation()},r.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector(".e-content"),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector(".e-content").getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header .e-title"),this.headerElement=e.querySelector(".e-header"))},r.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!t.isNullOrUndefined(this.startValue)){this.endButton.element.classList.remove(N),this.startButton.element.classList.add(N);i=this.popupObj.element.querySelector("."+T);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector(".e-start-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){this.startButton.element.classList.remove(N),this.endButton.element.classList.add(N);var i=this.popupObj.element.querySelector("."+T);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector(".e-end-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)),this.selectableDates()}},r.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:t.isBlazor()&&this.isServerRendered?null:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.updateHiddenInput(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},r.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var i=this.inputElement.value;if(t.isNullOrUndefined(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!t.isNullOrUndefined(i)&&""!==i.trim()){var a=i.split(" "+this.separator+" ");if(a.length>1){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},r=this.globalize.parseDate(a[0].trim(),n),l=this.globalize.parseDate(a[1].trim(),n);if(!(t.isNullOrUndefined(r)||isNaN(+r)||t.isNullOrUndefined(l)||isNaN(+l))){var o=this.startValue;this.startValue=r;var h=this.endValue;if(this.endValue=l,this.setValue(),this.refreshControl(),i!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;u={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",u)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=o,this.endValue=h))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(t.isNullOrUndefined(i)||""!==i.trim()||(this.startValue=null,this.endValue=null),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(t.isNullOrUndefined(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var u={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",u)}}this.updateHiddenInput()}},r.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},r.prototype.errorClass=function(){var e=this.inputElement.value.trim();(t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)&&""!==e||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},r.prototype.keyCalendarUpdate=function(e,t){return this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},r.prototype.navInCalendar=function(e,i,s,a,n){var r,l,o=this.getViewNumber(this.currentView()),h=this.min;switch(l=t.isNullOrUndefined(this.maxDays)||!this.isMaxDaysClicked||t.isNullOrUndefined(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":r=new Date(+this.currentDate),this.addDay(r,1,e,l,h),i&&+r==+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(1,o,e,l,h),this.keyNavigation(n,e);break;case"moveLeft":r=new Date(+this.currentDate),this.addDay(r,-1,e,l,h),i||+r==+s&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-1,o,e,l,h),this.keyNavigation(n,e);break;case"moveUp":0===o?(r=new Date(+this.currentDate),this.addDay(r,-7,e,l,h),+r<=+s&&!i&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-7,o,e,l,h)):this.keyboardNavigate(-4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"moveDown":0===o?(r=new Date(+this.currentDate),this.addDay(r,7,e,l,h),i&&+r>=+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(7,o,e,l,h)):this.keyboardNavigate(4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),t.remove(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,o),t.remove(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e)}},r.prototype.keyInputHandler=function(i,s){var a,n=this.getViewNumber(this.currentView()),r=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),l=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),o=t.closest(i.target,"."+V),h=(o=t.isNullOrUndefined(o)?this.leftCalendar:o).classList.contains(w);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+P),p=o.querySelector("tr td."+I),c=o.querySelector("tr td."+S),m=this.getViewNumber(this.depth),v=n===m&&this.getViewNumber(this.start)>=m,f=t.closest(i.target,"."+w),y=t.closest(i.target,"."+V),g=t.closest(i.target,".e-presets");switch(t.isNullOrUndefined(d)?t.isNullOrUndefined(c)||this.dateDisabled?t.isNullOrUndefined(p)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",i.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(i),this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]));break;case"select":if(v){var b=t.isNullOrUndefined(d)?p:d;t.isNullOrUndefined(b)||b.classList.contains(x)||this.selectRange(null,b)}else(t.isNullOrUndefined(u)||v)&&t.isNullOrUndefined(d)||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(w)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,d||u,s));i.preventDefault();break;case"controlHome":D=new Date(this.currentDate.getFullYear(),0,1);!h&&+D<+l&&(o=this.keyCalendarUpdate(!0,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(o,i);break;case"altRightArrow":t.isNullOrUndefined(f)?t.isNullOrUndefined(y)?t.isNullOrUndefined(g)||this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),i.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(f)?t.isNullOrUndefined(y)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),i.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(w),this.calendarNavigation(i,this.calendarElement),i.preventDefault();break;case"controlDown":t.isNullOrUndefined(u)&&t.isNullOrUndefined(d)||v||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(w)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,u||d,s)),i.preventDefault();break;case"controlEnd":var D=new Date(this.currentDate.getFullYear(),11,31);h&&+D>+r&&(o=this.keyCalendarUpdate(!1,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(o,i);break;case"pageUp":a=new Date(+this.currentDate),this.addMonths(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"pageDown":a=new Date(+this.currentDate),this.addMonths(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftPageUp":a=new Date(+this.currentDate),this.addYears(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftPageDown":a=new Date(+this.currentDate),this.addYears(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftTab":t.isNullOrUndefined(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),i.preventDefault();break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(i);break;default:this.navInCalendar(i,h,l,r,o),this.checkMinMaxDays()}this.presetHeight()},r.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(w)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},r.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||t.isNullOrUndefined(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},r.prototype.bindCalendarCellEvents=function(e){for(var i,s=0,a=i=e?e.querySelectorAll(".e-calendar td"):this.popupObj.element.querySelectorAll(".e-calendar td");s<a.length;s++){var n=a[s];t.EventHandler.clearEvents(n),n.classList.contains(x)||n.classList.contains(H)||n.classList.contains("e-week-number")||(this.isMobile||t.EventHandler.add(n,"mouseover",this.hoverSelection,this),t.EventHandler.add(n,"mousedown",this.selectRange,this))}},r.prototype.removeFocusedDate=function(){for(var e=!t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.endValue),i=0,s=this.popupObj.element.querySelectorAll(".e-calendar ."+P);i<s.length;i++){var a=s[i],n=new Date,r=this.getIdValue(null,a);("Month"===this.depth&&"Month"===this.currentView()&&(!a.classList.contains("e-today")||a.classList.contains("e-today")&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(n,r)&&!this.isSameYear(n,r)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(n,r)||e))&&(a.classList.remove(P),a.classList.contains(I)||a.classList.contains(S)||a.removeAttribute("aria-label"))}},r.prototype.hoverSelection=function(e,i){var s=i||e.currentTarget,a=this.getIdValue(null,s);if(!t.isNullOrUndefined(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)))for(var n=0,r=this.popupObj.element.querySelectorAll(".e-calendar td");n<r.length;n++){var l=r[n],o=!l.classList.contains(x)||l.classList.contains(H);if(!l.classList.contains("e-week-number")&&o){var h=this.getIdValue(null,l),u=new Date(+this.startValue);new Date(+h).setHours(0,0,0,0)>=u.setHours(0,0,0,0)&&+h<=+a?t.addClass([l],A):t.removeClass([l],[A])}}},r.prototype.isSameStartEnd=function(e,t){var i=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(i=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(i=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(i=!0),i},r.prototype.updateRange=function(e){if(!t.isNullOrUndefined(this.startValue))for(var i=0,s=e;i<s.length;i++)for(var a=0,n=s[i].querySelectorAll(".e-calendar td");a<n.length;a++){var r=n[a];if(!r.classList.contains("e-week-number")&&!r.classList.contains(x)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if(t.isNullOrUndefined(this.endValue)?t.removeClass([r],[A]):this.currentView()===this.depth&&+o.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+o.setHours(0,0,0,0)<=+new Date(+this.endValue).setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&t.addClass([r],A),r.classList.contains("e-selected")&&r.classList.contains(S)&&+o!=+this.endValue&&(t.removeClass([r],["e-selected"]),t.removeClass([r],[S])),r.classList.contains(A)&&+o>+this.endValue&&t.removeClass([r],[A]),!r.classList.contains("e-other-month")){var h=new Date(+this.startValue),u=new Date(+l);this.currentView()===this.depth&&+u.setHours(0,0,0,0)==+h.setHours(0,0,0,0)&&+u.setHours(0,0,0,0)>=+h.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(t.addClass([r],[I,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!0));var d=new Date(+this.endValue);"Year"===this.currentView()?u=new Date(u.getFullYear(),u.getMonth()+1,0):"Decade"===this.currentView()&&(u=new Date(u.getFullYear(),11,31)),this.currentView()===this.depth&&!t.isNullOrUndefined(this.endValue)&&+u.setHours(0,0,0,0)==+d.setHours(0,0,0,0)&&+u.setHours(0,0,0,0)<=+d.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(t.addClass([r],[S,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!1)),+l!=+this.startValue||t.isNullOrUndefined(this.endValue)||+l!=+this.endValue||this.addSelectedAttributes(r,this.endValue,!1,!0)}}}},r.prototype.checkMinMaxDays=function(){(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+w)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+V))))},r.prototype.rangeArgs=function(e){var i,s,a=t.isNullOrUndefined(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"}),n=t.isNullOrUndefined(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"});return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?(i="",s=0):(i=a+" "+this.separator+" "+n,s=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:s,event:e||null,element:this.element,isInteracted:!t.isNullOrUndefined(e),text:i}},r.prototype.otherMonthSelect=function(e,i,s){var a=+this.getIdValue(null,e),n='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+a),r=this.popupObj&&this.popupObj.element.querySelector(n);t.isNullOrUndefined(r)||(i?(t.addClass([r],[I,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!0)):(t.addClass([r],[S,"e-selected"]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},r.prototype.selectRange=function(e,i){var s,a;e&&e.preventDefault();var n=t.isNullOrUndefined(e)?this.getIdValue(null,i):this.getIdValue(e,null),r=n.getFullYear(),l=n.getMonth(),o=new Date(r,l,1),h=new Date(r,l+1,0),u=new Date(r,0,1),d=new Date(r,11,31);t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(N)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(N))&&this.removeSelection();var p=i||e.currentTarget;if(t.isNullOrUndefined(this.startValue))t.isNullOrUndefined(this.previousStartValue)||(n.setHours(this.previousStartValue.getHours()),n.setMinutes(this.previousStartValue.getMinutes()),n.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.endValue=null,this.setValue(),t.addClass([p],I),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains("e-other-month")&&this.otherMonthSelect(p,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(N),this.startButton.element.classList.remove(N),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+n==+this.startValue||+n>+this.startValue){if(+n==+this.startValue&&!t.isNullOrUndefined(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||i)&&this.hoverSelection(e,i),t.isNullOrUndefined(this.previousEndValue)||(n.setHours(this.previousEndValue.getHours()),n.setMinutes(this.previousEndValue.getMinutes()),n.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?h:d,this.setValue();var c=this.popupObj.element.querySelectorAll("."+S);if(this.isMobile){this.startButton.element.classList.remove(N),this.endButton.element.classList.add(N);for(var m=0,v=c;m<v.length;m++){var f=v[m];f.removeAttribute("aria-label"),f.classList.contains(I)?(this.addSelectedAttributes(f,this.startValue,!0),t.removeClass([f],[S])):(f.setAttribute("aria-selected","false"),t.removeClass([f],[S,"e-selected"]))}}t.addClass([p],S),+this.endValue==+this.startValue?this.addSelectedAttributes(p,this.endValue,!1,!0):this.addSelectedAttributes(p,this.endValue,!1),p.classList.contains("e-other-month")&&(+this.endValue==+this.startValue?this.otherMonthSelect(p,!1,!0):this.otherMonthSelect(p,!1));for(var y=0,g=c=this.popupObj.element.querySelectorAll("."+S);y<g.length;y++){var b=g[y];b.classList.contains(I)&&t.removeClass([b],[A])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+n<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.setValue(),this.removeSelectedAttributes(),t.removeClass(this.popupObj.element.querySelectorAll("."+I),[I,"e-selected"]),t.addClass([p],I),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains("e-other-month")&&this.otherMonthSelect(p,!0),this.checkMinMaxDays());e&&(s=t.closest(e.target,"."+w)),t.isNullOrUndefined(s)?(e&&(a=e&&t.closest(e.target,"."+V)),t.isNullOrUndefined(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),t.addClass([p],"e-selected"),this.updateHeader(),this.removeFocusedDate()},r.prototype.selectableDates=function(){if(!t.isNullOrUndefined(this.startValue)){var e=this.calendarElement.querySelectorAll(".e-calendar td"),i=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(I)&&!l.classList.contains("e-week-number")&&!l.classList.contains(x)){if(+this.getIdValue(null,l)<+this.startValue){t.addClass([l],[H,x,W]),t.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(I)&&!l.classList.contains("e-other-month")){i=!0;break}}i&&(this.previousIcon.classList.contains(x)||t.addClass([this.previousIcon],[B,x,W]))}else{for(var n=0,r=e;n<r.length;n++){var l=r[n],o=this.startValue.getMonth(),h=this.startValue.getFullYear(),u=this.getIdValue(null,l);if(this.startButton.element.classList.contains(N)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;t.addClass([l],[x])}e[0].classList.contains(x)?this.previousIconHandler(!0):e[e.length-1].classList.contains(x)&&this.nextIconHandler(!0)}}},r.prototype.updateMinMaxDays=function(e){if(!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(N)){if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0){var i=this.removeTimeValueFromDate(this.startValue),s=new Date(new Date(+i).setDate(i.getDate()+(this.minDays-1))),a=new Date(new Date(+i).setDate(i.getDate()+(this.maxDays-1)));s=!t.isNullOrUndefined(this.minDays)&&this.minDays>0?s:null,a=!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0?a:null,"Year"===this.currentView()?(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear(),s.getMonth(),0),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),a.getMonth(),1)):"Decade"===this.currentView()&&(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear()-1,11,1),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),0,1));for(var n=void 0,r=0,l=e.querySelectorAll(".e-calendar td");r<l.length;r++){var o=l[r];if(!o.classList.contains(I)&&!o.classList.contains("e-week-number")){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!t.isNullOrUndefined(s)&&+h==+s&&o.classList.contains(x)&&s.setDate(s.getDate()+1),!o.classList.contains(x)){if(+h<=+i)continue;!t.isNullOrUndefined(s)&&+h<+s&&(t.addClass([o],[H,x,W]),t.EventHandler.clearEvents(o)),!t.isNullOrUndefined(a)&&+h>+a&&(t.addClass([o],[H,x,W]),this.isMaxDaysClicked=!0,t.EventHandler.clearEvents(o),t.isNullOrUndefined(n)&&!o.classList.contains("e-other-month")&&(n=o))}}}if(!t.isNullOrUndefined(n))if(this.isMobile)this.nextIcon.classList.contains(x)||t.addClass([this.nextIcon],[B,x,W]);else{var u=t.closest(n,"."+V);(u=t.isNullOrUndefined(u)?this.leftCalendar:u).classList.contains(w)?(this.rightCalNextIcon.classList.contains(x)||t.addClass([this.rightCalNextIcon],[B,x,W]),this.leftCalNextIcon.classList.contains(x)||t.addClass([this.leftCalNextIcon],[B,x,W]),this.rightCalPrevIcon.classList.contains(x)||t.addClass([this.rightCalPrevIcon],[B,x,W])):this.rightCalNextIcon.classList.contains(x)||t.addClass([this.rightCalNextIcon],[B,x,W])}}}else this.isMaxDaysClicked=!1},r.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},r.prototype.removeClassDisabled=function(){for(var e=0,i=this.popupObj.element.querySelectorAll(".e-calendar td."+H);e<i.length;e++){var s=i[e];s.classList.contains(H)&&(t.removeClass([s],[H,x,W]),t.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||t.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(B)&&t.removeClass([this.nextIcon],[B,x,W]),this.previousIcon.classList.contains(B)&&t.removeClass([this.previousIcon],[B,x,W])):(this.rightCalNextIcon.classList.contains(B)&&t.removeClass([this.rightCalNextIcon],[B,x,W]),this.rightCalPrevIcon.classList.contains(B)&&t.removeClass([this.rightCalPrevIcon],[B,x,W]),this.leftCalNextIcon.classList.contains(B)&&t.removeClass([this.leftCalNextIcon],[B,x,W]))},r.prototype.updateHeader=function(){var e={type:"date",skeleton:t.isBlazor()?"D":"yMMMd"};if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue))this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays");else{var i=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;t.isNullOrUndefined(this.disabledDayCnt)||(i-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+U).textContent=i.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(t.isNullOrUndefined(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector(".e-end-label").textContent=this.globalize.formatDate(this.endValue,e),t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector(".e-start-label").textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},r.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll(".e-selected").length>0&&t.removeClass(this.popupObj.element.querySelectorAll(".e-selected"),[I,S,"e-selected"]),this.popupObj.element.querySelectorAll("."+P).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+P),P),this.popupObj.element.querySelectorAll("."+A).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+A),[A]))},r.prototype.addSelectedAttributes=function(e,i,s,a){if(e){var n=this.globalize.formatDate(i,{type:"date",skeleton:t.isBlazor()?"D":"full"});!t.isNullOrUndefined(a)&&a?e.setAttribute("aria-label","The current start and end date is "+n):e.setAttribute("aria-label","The current "+(s?"start":"end")+" date is "+n),e.setAttribute("aria-selected","true")}},r.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+I);e<t.length;e++)(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label");for(var i=0,s=this.popupObj.element.querySelectorAll("."+S);i<s.length;i++){var a=s[i];a.setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}}},r.prototype.updateCalendarElement=function(e){e.classList.contains(w)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector(".e-content"),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector(".e-content").getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header .e-title"),this.headerElement=e.querySelector(".e-header")},r.prototype.navPrevMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+w);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+V):i,this.updateCalendarElement(i),this.navigatePrevious(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+T)]),this.endButton.element.classList.contains(N)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)),this.endButton.element.classList.contains(N)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.updateControl=function(e){e.classList.contains(V)?this.rightCalCurrentDate=new Date(+this.currentDate):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},r.prototype.navNextMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+w);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+V):i,this.updateCalendarElement(i),this.navigateNext(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.isPopupOpen=function(){return!(t.isNullOrUndefined(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},r.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var i=this.createElement("button",{className:"e-end-btn"}),s=this.createElement("button",{className:"e-start-btn"});this.startButton=new a.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new a.Button({content:this.l10n.getConstant("endLabel")},i),e.appendChild(s),e.appendChild(i)}else{var n=this.createElement("a",{className:"e-start-label"}),r=this.createElement("a",{className:"e-end-label"}),l=this.createElement("span",{className:"e-change-icon e-icons"});t.attributes(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),t.attributes(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(l),e.appendChild(r),n.textContent=this.l10n.getConstant("startLabel"),r.textContent=this.l10n.getConstant("endLabel")}return e},r.prototype.disableInput=function(){this.strictMode?t.isNullOrUndefined(this.previousStartValue)||t.isNullOrUndefined(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},r.prototype.validateMinMax=function(){if(this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,!(this.min<=this.max))return void this.disableInput();t.isNullOrUndefined(this.minDays)||t.isNullOrUndefined(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!t.isNullOrUndefined(this.minDays)&&this.minDays<0&&(this.minDays=null),!t.isNullOrUndefined(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)},r.prototype.validateRangeStrict=function(){t.isNullOrUndefined(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),t.isNullOrUndefined(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},r.prototype.validateRange=function(){this.validateMinMaxDays()},r.prototype.validateMinMaxDays=function(){if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var i=new Date(+this.startValue);i.setDate(i.getDate()+(this.minDays-1)),+i>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=i,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();t.isNullOrUndefined(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},r.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(T),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.attributes(this.calendarElement,{role:"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},r.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},r.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},r.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},r.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},r.prototype.selectNextMonth=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},r.prototype.selectNextYear=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1))},r.prototype.selectNextDecade=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10))},r.prototype.selectStartMonth=function(){t.isNullOrUndefined(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!t.isNullOrUndefined(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},r.prototype.createCalendar=function(){var i=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){t.isNullOrUndefined(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var s=this.calendarElement.querySelector(".e-calendar .e-prev"),a=this.calendarElement.querySelector(".e-calendar .e-next");t.remove(this.calendarElement.querySelector(".e-calendar .e-icon-container")),this.calendarElement.querySelector(".e-calendar .e-header").appendChild(a),this.calendarElement.querySelector(".e-calendar .e-header").appendChild(s),t.prepend([s],this.calendarElement.querySelector(".e-calendar .e-header")),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header .e-title")}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(w),this.leftCalPrevIcon=this.calendarElement.querySelector(".e-left-calendar .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector(".e-left-calendar .e-next"),this.leftTitle=this.calendarElement.querySelector(".e-left-calendar .e-title"),t.remove(this.calendarElement.querySelector(".e-left-calendar .e-icon-container")),this.calendarElement.querySelector(".e-left-calendar .e-header").appendChild(this.leftCalNextIcon),this.calendarElement.querySelector(".e-left-calendar .e-header").appendChild(this.leftCalPrevIcon),t.prepend([this.leftCalPrevIcon],this.calendarElement.querySelector(".e-left-calendar .e-header")),this.leftCalendar=this.calendarElement;var n=this.createElement("div",{className:"e-left-container"}),r=this.createElement("div",{className:"e-right-container"});n.appendChild(this.leftCalendar),i.appendChild(n),this.isMobile||t.EventHandler.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),t.addClass([this.calendarElement],V),this.rightCalendar=this.calendarElement,t.removeClass([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),t.removeClass([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector(".e-right-calendar .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector(".e-right-calendar .e-next"),this.rightTitle=this.calendarElement.querySelector(".e-right-calendar .e-title"),t.remove(this.calendarElement.querySelector(".e-right-calendar .e-icon-container")),this.calendarElement.querySelector("table").setAttribute("tabindex","-1"),this.calendarElement.querySelector(".e-right-calendar .e-header").appendChild(this.rightCalNextIcon),this.calendarElement.querySelector(".e-right-calendar .e-header").appendChild(this.rightCalPrevIcon),t.prepend([this.rightCalPrevIcon],this.calendarElement.querySelector(".e-right-calendar .e-header")),r.appendChild(this.rightCalendar),i.appendChild(r),this.isMobile||t.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return i},r.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.calendarNavigation=function(t,i){this.table=i.querySelector("table"),this.headerTitleElement=i.querySelector(".e-title"),this.tableBodyElement=i.querySelector("tbody"),this.tableHeadElement=i.querySelector("thead"),this.contentElement=i.querySelector(".e-content"),this.updateCalendarElement(i),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},r.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.clickEventEmitter=function(e){this.isMobile||(t.closest(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},r.prototype.currentView=function(){return e.prototype.currentView.call(this)},r.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},r.prototype.navigatedEvent=function(i){if(this.trigger("navigated",this.navigatedArgs),!t.isNullOrUndefined(this.popupObj)){var s=this.getCalendarView(this.currentView());this.isMobile?s===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates():this.isMobile||s!==this.depth?(this.updateNavIcons(),this.calendarIconEvent()):((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!i||i.currentTarget.children[0].classList.contains("e-icons"))&&t.isNullOrUndefined(this.controlDown)?(i&&!i.currentTarget.children[0].classList.contains("e-icons")||!t.isNullOrUndefined(this.controlDown))&&(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&t.isNullOrUndefined(this.endValue)?"Month"===s&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):"Year"===s&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):e.prototype.navigateTo.call(this,s,this.leftCalCurrentDate):e.prototype.navigateTo.call(this,s,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null):(this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,s,this.rightCalCurrentDate),this.updateControl(this.rightCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null),this.checkMinMaxDays())}},r.prototype.createControl=function(){var e=this.createElement("div",{className:"e-date-range-container"}),i=this.createElement("div",{className:"e-range-header"}),s=this.createRangeHeader();i.appendChild(s);var n=this.createElement("div",{className:U});t.attributes(n,{"aria-label":"Selected Days"}),n.textContent=this.l10n.getConstant("selectedDays"),i.appendChild(n);var r=this.createElement("div",{className:"e-separator"}),l=this.createCalendar();e.appendChild(i),e.appendChild(r),e.appendChild(l);var o=this.createElement("div",{className:"e-footer"}),h=this.createElement("button",{className:"e-cancel e-flat e-css"}),u=this.createElement("button");t.addClass([u],["e-apply","e-flat","e-primary","e-css"]),o.appendChild(u),o.appendChild(h);var d=!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue);this.cancelButton=new a.Button({content:this.l10n.getConstant("cancelText")},h),this.applyButton=new a.Button({content:this.l10n.getConstant("applyText"),disabled:!d},u),t.EventHandler.add(u,"click",this.applyFunction,this),t.EventHandler.add(h,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile||t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),t.addClass([e],"e-range-border"),t.addClass([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector(".e-presets").style.height=this.popupWrapper.querySelector(".e-date-range-container").getBoundingClientRect().height+"px"),this.popupWrapper.appendChild(o),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},r.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},r.prototype.deviceHeaderUpdate=function(){t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(N)):t.isNullOrUndefined(this.startValue)||this.startButton.element.classList.add(N)},r.prototype.applyFunction=function(e){var i=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,s.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(i=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),i=!0),t.closest(e.target,".e-input-group")||i||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},r.prototype.onMouseClick=function(e,i){if("touchstart"!==e.type){var s=i||e.target,a=t.closest(s,"."+z),n=a&&a.classList.contains(N);a&&a.classList.contains(z)&&this.setListSelection(a,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,a&&a.classList.contains(z)&&"custom_range"===a.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():n||"keydown"!==e.type||this.inputElement.focus())}},r.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+z);i&&i.classList.contains(z)&&!i.classList.contains(L)&&t.addClass([i],L)},r.prototype.onMouseLeave=function(e){var i=t.closest(e.target,"."+L);t.isNullOrUndefined(i)||t.removeClass([i],L)},r.prototype.setListSelection=function(e,i){if(e&&(!e.classList.contains(N)||this.isMobile&&e.classList.contains(N))){if(this.isMobile&&e.classList.contains(N)){if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id)return void this.renderCustomPopup();return}this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),t.addClass([e],N),e.setAttribute("aria-selected","true");var s=this.presetsItem[this.activeIndex];"custom_range"===s.id?this.renderCustomPopup():this.applyPresetRange(s,i)}},r.prototype.removeListSelection=function(){var e=this.presetElement.querySelector(".e-active");t.isNullOrUndefined(e)||(t.removeClass([e],N),e.removeAttribute("aria-selected"))},r.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},r.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},r.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},r.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:O+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},r.prototype.listRippleEffect=function(){for(var e=0,i=this.liCollections;e<i.length;e++){var s=i[e];t.rippleEffect(s)}},r.prototype.createPresets=function(){if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:"e-presets",attrs:{tabindex:"0"}});var e=n.ListBase.createList(this.createElement,this.presetsItem,null,!0);t.attributes(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var i=this.presetElement.querySelector("#custom_range");t.isNullOrUndefined(i)||(i.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+z),this.wireListEvents(),this.isMobile&&(this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!t.isNullOrUndefined(this.activeIndex)&&this.activeIndex>-1&&t.addClass([this.liCollections[this.activeIndex]],N)}},r.prototype.wireListEvents=function(){t.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(t.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},r.prototype.unWireListEvents=function(){t.isNullOrUndefined(this.presetElement)||(t.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(t.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),t.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},r.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var s=this.popupWrapper.getBoundingClientRect().width;t.isNullOrUndefined(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new i.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:t.isNullOrUndefined(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-s,offsetY:4,collision:this.isMobile?t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){t.attributes(e.inputElement,{"aria-expanded":"true"}),t.addClass([e.inputWrapper.buttons[0]],N),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new t.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new t.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),t.isNullOrUndefined(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),t.isNullOrUndefined(e.presetElement)||(e.keyInputConfigs=t.extend(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.isNullOrUndefined(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){t.attributes(e.inputElement,{"aria-expanded":"false"}),t.removeClass([e.inputWrapper.buttons[0]],N),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),t.isUndefined(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),t.isNullOrUndefined(e.popupObj)||(t.isNullOrUndefined(e.popupObj.element.parentElement)||t.detach(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add("e-device"),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(t.addClass([this.modal],["e-device",O,"e-range-modal"]),document.body.className+=" e-range-overflow",this.modal.style.display="block"),t.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},r.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},r.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+I);if(e){var i=t.closest(e,"."+V);i=t.isNullOrUndefined(i)?this.leftCalendar:i,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,i.children[1].firstElementChild.focus()),t.addClass([e],P)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},r.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector(".e-presets"),i=this.popupObj&&this.popupObj.element.querySelector(".e-date-range-container");t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(e.style.height=i.getBoundingClientRect().height+"px")},r.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var i=this.getHoverLI(),s=this.getActiveLI();if(!t.isNullOrUndefined(this.leftCalendar)&&!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(i)||!t.isNullOrUndefined(s)&&s===i)&&(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(s),"custom_range"===this.presetsItem[this.activeIndex].id))return this.calendarFocus(),s.classList.remove(L),void e.preventDefault();t.isNullOrUndefined(i)&&t.isNullOrUndefined(s)||this.onMouseClick(e,i||s),e.preventDefault();break;case"tab":if(this.leftCalendar){var a=this.getHoverLI();t.isNullOrUndefined(a)||a.classList.remove(L)}else this.hide(e),e.preventDefault()}},r.prototype.listMoveDown=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i))if(t.isNullOrUndefined(s))t.addClass([this.liCollections[0]],L);else{a=s.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&t.addClass([a],L)}else{var a=i.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&(t.removeClass([i],L),t.addClass([a],L))}},r.prototype.listMoveUp=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i)){if(!t.isNullOrUndefined(s)){a=s.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&t.addClass([a],L)}}else{var a=i.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&(t.removeClass([i],L),t.addClass([a],L))}},r.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+L)},r.prototype.getActiveLI=function(){return this.presetElement.querySelector(".e-active")},r.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new t.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},r.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,i=this.presetElement.querySelector("."+L),s=this.presetElement.querySelector(".e-active"),a=t.isNullOrUndefined(i)?s:i;if(!t.isNullOrUndefined(a)){var n=a.nextElementSibling,r=n?n.offsetTop:a.offsetTop,l=a.getBoundingClientRect().height;r+a.offsetTop>e?this.presetElement.scrollTop=n?r-(e/2+l/2):r:this.presetElement.scrollTop=0}},r.prototype.popupKeyActionHandle=function(e){var i=t.closest(e.target,".e-presets");switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":t.isNullOrUndefined(i)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(i)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},r.prototype.documentHandler=function(e){if(!t.isNullOrUndefined(this.popupObj)){var i=e.target;this.inputWrapper.container.contains(i)&&(t.isNullOrUndefined(this.popupObj)||t.closest(i,'[id="'+this.popupWrapper.id+'"]'))||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!t.isNullOrUndefined(this.targetElement)&&(t.isNullOrUndefined(this.targetElement)||i===this.targetElement)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||t.closest(i,".e-input-group")===this.inputWrapper.container||t.closest(i,".e-daterangepicker.e-popup")&&!i.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},r.prototype.createInput=function(){var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),t.attributes(this.inputElement,{"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),s.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),t.isNullOrUndefined(this.placeholder)||""===this.placeholder.trim()||s.Input.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),t.addClass([this.inputWrapper.container],"e-date-range-wrapper"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},r.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?t.formatUnit(this.width):"100%"},r.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&t.addClass([this.popupWrapper],"e-daterange-day-header-lg")},r.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||e||this.disabledDateRender(),this.errorClass(),this.previousStartValue=t.isNullOrUndefined(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=t.isNullOrUndefined(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},r.prototype.updateInput=function(){if(!t.isNullOrUndefined(this.endValue)&&!t.isNullOrUndefined(this.startValue)){var e={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},i=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);s.Input.setValue(i+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&s.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},r.prototype.checkInvalidRange=function(e){if(!t.isNullOrUndefined(e)){var i=!1,s=void 0,a=void 0,n=null,r=null,l=null,o=!1,h=!1,u=!1;if("string"==typeof e){var d=e.split(" "+this.separator+" ");2===d.length?(n=d[0],r=d[1]):(i=!0,l=e)}else e.length>0?(s=e[0],a=e[1]):(s=e.start,a=e.end),s instanceof Date||"object"==typeof s?s instanceof Date?o=!0:t.isNullOrUndefined(s)||(u=!0):n=this.getstringvalue(s),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:t.isNullOrUndefined(a)||(u=!0):r=this.getstringvalue(a);(t.isNullOrUndefined(n)&&!o&&!t.isNullOrUndefined(r)||!t.isNullOrUndefined(n)&&!h&&t.isNullOrUndefined(r))&&(i=!0),u&&(n=r=l=null,i=!0),n&&(i=i||this.checkInvalidValue(n)),r&&(i=i||this.checkInvalidValue(r)),i&&(o&&!u&&(n=s.toLocaleDateString()),h&&!u&&(r=a.toLocaleDateString()),t.isNullOrUndefined(n)||t.isNullOrUndefined(r)?t.isNullOrUndefined(n)?t.isNullOrUndefined(r)||(l=r):l=n:l=n+" "+this.separator+" "+r,this.invalidValueString=l,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},r.prototype.getstringvalue=function(e){var i=null;return t.isNullOrUndefined(e)||"number"!=typeof e?t.isNullOrUndefined(e)||"string"!=typeof e||(i=""+e):i=e.toString(),i},r.prototype.checkInvalidValue=function(e){var i=e,s=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},"string"!=typeof i)s=!0;else{var n=new t.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(i,a))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(i)&&!r.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i))))&&(s=!0)}}return s},r.prototype.isDateDisabled=function(e){if(t.isNullOrUndefined(e))return!1;var i=new Date(+e);if(+i<+this.min||+i>+this.max)return!0;this.virtualRenderCellArgs={date:i,isDisabled:!1};var s=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(s),!!s.isDisabled},r.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var i=this.virtualRenderCellArgs;this.virtualRenderCellEvent(i),i.isDisabled&&(this.disabledDays.push(new Date(+i.date)),+e>+this.startValue&&+e<+this.endValue&&t++),this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},r.prototype.virtualRenderCellEvent=function(e){t.extend(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},r.prototype.disabledDates=function(){var e=!1,i=!1;return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||(e=this.isDateDisabled(this.startValue),i=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||i},r.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&this.value.length>0||this.valueType&&this.valueType.length>0?(+this.startDate==+this.value[0]&&+this.endDate==+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},r.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},r.prototype.changeTrigger=function(e){+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},r.prototype.navigateTo=function(t,i){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,i):(i<this.min?i=new Date(+this.min):i>=this.max&&(i=new Date(+this.max)),"Month"===t&&this.isSameMonth(i,this.max)?i=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(i,this.max)?i=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(i,this.max)&&(i=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=i,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),i="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=i,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},r.prototype.navigate=function(t,i,s){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,s,i)},r.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(t.addClass([this.inputWrapper.container],["e-input-focus"]),this.inputElement.focus())},r.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],["e-input-focus"]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},r.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var i={"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(t.removeClass([this.inputElement],[O]),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.detach(this.inputWrapper.container))),t.isNullOrUndefined(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),t.isNullOrUndefined(this.firstHiddenChild)||t.isNullOrUndefined(this.secondHiddenChild)||(t.detach(this.firstHiddenChild),t.detach(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name"))},r.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])))},r.prototype.getModuleName=function(){return"daterangepicker"},r.prototype.getPersistData=function(){var e=["startDate","endDate","value"];return this.addOnPersist(e)},r.prototype.getSelectedRange=function(){var e;return t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,this.disabledDateRender(),t.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},r.prototype.show=function(i,s){var a=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){i&&(this.targetElement=i),this.createPopup(),(this.isMobile||t.Browser.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:t.isBlazor()&&this.isServerRendered?null:this,event:s||null,appendTo:this.isMobile||t.Browser.isDevice?this.mobileRangePopupWrap:document.body};var n=this.openEventArgs;this.trigger("open",n,function(n){if(a.openEventArgs=n,!a.openEventArgs.cancel){a.openEventArgs.appendTo.appendChild(a.popupWrapper),a.showPopup(i,s);var r=!a.isCustomRange||a.isMobile&&a.isCustomRange;!t.isUndefined(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&a.setScrollPosition(),a.checkMinMaxDays(),a.isMobile&&!t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(a.endDate)&&(a.endButton.element.classList.add(N),a.startButton.element.classList.remove(N),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||t.Browser.isDevice)}})}},r.prototype.hide=function(e){var i=this;if(this.popupObj){if(t.isNullOrUndefined(this.previousEndValue)&&t.isNullOrUndefined(this.previousStartValue)?this.clearRange():(t.isNullOrUndefined(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),t.isNullOrUndefined(this.previousEndValue)?(this.endValue=null,this.setValue()):(this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue())),this.isPopupOpen()){this.closeEventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,date:this.inputElement.value,model:t.isBlazor()&&this.isServerRendered?null:this,event:e||null};var s=this.closeEventArgs;this.trigger("close",s,function(e){i.closeEventArgs=e,i.closeEventArgs.cancel?t.removeClass([i.inputWrapper.buttons[0]],N):(i.isMobile&&(t.isNullOrUndefined(i.startButton)||t.isNullOrUndefined(i.endButton)||(t.EventHandler.remove(i.startButton.element,"click touchstart",i.deviceHeaderClick),t.EventHandler.remove(i.endButton.element,"click touchstart",i.deviceHeaderClick))),i.popupObj&&(i.popupObj.hide(),i.preventBlur&&(i.inputElement.focus(),t.addClass([i.inputWrapper.container],["e-input-focus"]))),i.isMobile||(t.isNullOrUndefined(i.leftKeyboardModule)||t.isNullOrUndefined(i.rightKeyboardModule)||(i.leftKeyboardModule.destroy(),i.rightKeyboardModule.destroy()),t.isNullOrUndefined(i.presetElement)||i.presetKeyboardModule.destroy(),t.isNullOrUndefined(i.cancelButton)||i.btnKeyboardModule.destroy()),i.targetElement=null,t.removeClass([document.body],"e-range-overflow"),t.EventHandler.remove(document,"mousedown touchstart",i.documentHandler),i.isMobile&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),(i.isMobile||t.Browser.isDevice)&&(t.isNullOrUndefined(i.mobileRangePopupWrap)||(i.mobileRangePopupWrap.remove(),i.mobileRangePopupWrap=null)),i.isKeyPopup=i.dateDisabled=!1),i.updateClearIconState(),i.updateHiddenInput(),i.isMobile&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},r.prototype.setLocale=function(){this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},r.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},r.prototype.setDate=function(){s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},r.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},r.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):t.value&&t.value.start?this.setProperties({value:{start:null,end:null}},!0):t.value&&!t.value.start&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},r.prototype.createHiddenInput=function(){t.isNullOrUndefined(this.firstHiddenChild)&&t.isNullOrUndefined(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),t.isNullOrUndefined(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),t.attributes(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"}),t.attributes(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"});var e={type:"datetime",skeleton:t.isBlazor()?"d":"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},r.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},r.prototype.onPropertyChanged=function(e,i){for(var a={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(["maxDays","minDays","value"].indexOf(l)<0&&this.hide(null),l){case"width":this.setEleWidth(this.width);break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement),this.inputElement.setAttribute("aria-readonly",""+this.readonly),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,a)),+this.initStartDate!=+e.startDate&&(this.startValue=this.checkDateValue(new Date(this.checkValue(e.startDate))),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(e.endDate,a)),+this.initEndDate!=+e.endDate&&(this.endValue=this.checkDateValue(new Date(this.checkValue(e.endDate))),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,i);else{var o=e.value.split(" "+this.separator+" ");this.value=[new Date(o[0]),new Date(o[1])],this.updateValue(),this.setDate()}else!t.isNullOrUndefined(e.value)&&e.value.length>0||!t.isNullOrUndefined(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1===e.value.length||e.value.start?this.clearModelvalue(e,i):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,i):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||(1===e.value.length?this.modelValue=e.value:e.value.start&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(t.isNullOrUndefined(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,i));if(this.isPopupOpen()){if(t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}}},M([t.Property(null)],r.prototype,"value",void 0),M([t.Property(!1)],r.prototype,"enablePersistence",void 0),M([t.Property(new Date(1900,0,1))],r.prototype,"min",void 0),M([t.Property(new Date(2099,11,31))],r.prototype,"max",void 0),M([t.Property(null)],r.prototype,"locale",void 0),M([t.Property(null)],r.prototype,"firstDayOfWeek",void 0),M([t.Property(!1)],r.prototype,"weekNumber",void 0),M([t.Property("Gregorian")],r.prototype,"calendarMode",void 0),M([t.Property(!1)],r.prototype,"openOnFocus",void 0),M([t.Event()],r.prototype,"created",void 0),M([t.Event()],r.prototype,"destroyed",void 0),M([t.Event()],r.prototype,"change",void 0),M([t.Event()],r.prototype,"cleared",void 0),M([t.Event()],r.prototype,"navigated",void 0),M([t.Event()],r.prototype,"renderDayCell",void 0),M([t.Property(null)],r.prototype,"startDate",void 0),M([t.Property(null)],r.prototype,"endDate",void 0),M([t.Collection([{}],j)],r.prototype,"presets",void 0),M([t.Property("")],r.prototype,"width",void 0),M([t.Property(1e3)],r.prototype,"zIndex",void 0),M([t.Property(!0)],r.prototype,"showClearButton",void 0),M([t.Property(!0)],r.prototype,"showTodayButton",void 0),M([t.Property("Month")],r.prototype,"start",void 0),M([t.Property("Month")],r.prototype,"depth",void 0),M([t.Property("")],r.prototype,"cssClass",void 0),M([t.Property("-")],r.prototype,"separator",void 0),M([t.Property(null)],r.prototype,"minDays",void 0),M([t.Property(null)],r.prototype,"maxDays",void 0),M([t.Property(!1)],r.prototype,"strictMode",void 0),M([t.Property(null)],r.prototype,"keyConfigs",void 0),M([t.Property(null)],r.prototype,"format",void 0),M([t.Property(!0)],r.prototype,"enabled",void 0),M([t.Property(!1)],r.prototype,"readonly",void 0),M([t.Property(!0)],r.prototype,"allowEdit",void 0),M([t.Property("Never")],r.prototype,"floatLabelType",void 0),M([t.Property(null)],r.prototype,"placeholder",void 0),M([t.Property({})],r.prototype,"htmlAttributes",void 0),M([t.Event()],r.prototype,"open",void 0),M([t.Event()],r.prototype,"close",void 0),M([t.Event()],r.prototype,"select",void 0),M([t.Event()],r.prototype,"focus",void 0),M([t.Event()],r.prototype,"blur",void 0),r=M([t.NotifyPropertyChanges],r)}(v),Y=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 a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},K=(new Date).getDate(),_=(new Date).getMonth(),G=(new Date).getFullYear(),X="e-timepicker",Z="e-input-focus",J=["title","class","style"];!function(e){function t(e,t,i,s,a,r){this.calendarMode;var l,o=6e4*r,h=[],u=[];l=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=l;)u.push(l),h.push(s.formatDate(new Date(l),{format:a,type:"time"})),l+=o;return{collection:u,list:n.ListBase.createList(e,h,null,!0)}}e.createListItems=t}(e.TimePickerBase||(e.TimePickerBase={}));var $=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Y(i,e),q([t.Property("day")],i.prototype,"day",void 0),q([t.Property("month")],i.prototype,"month",void 0),q([t.Property("year")],i.prototype,"year",void 0),q([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),q([t.Property("hour")],i.prototype,"hour",void 0),q([t.Property("minute")],i.prototype,"minute",void 0),q([t.Property("second")],i.prototype,"second",void 0),i}(t.ChildProperty),Q=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.liCollections=[],s.timeCollections=[],s.blazorTimeCollections=[],s.disableItemCollection=[],s.invalidValueString=null,s.isBlazorServer=!1,s.isAngular=!1,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return Y(a,e),a.prototype.preRender=function(){this.keyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],[X,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=t.closest(this.element,"form"),this.isBlazorServer=!(!t.isBlazor()||!this.isServerRendered||"timepicker"!==this.getModuleName()),this.isBlazorServer||("EJS-TIMEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.openPopupEventArgs={appendTo:document.body})},a.prototype.render=function(){if(this.isBlazorServer){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.Internationalization("en"),this.checkTimeFormat();var e=this.element.parentElement;this.inputWrapper={container:e,clearButton:e.querySelector(".e-clear-icon"),buttons:[e.querySelector(".e-time-icon")]},s.Input.bindInitialEvent({element:this.inputElement,floatLabelType:this.floatLabelType}),this.showClearButton&&this.inputWrapper.clearButton&&s.Input.wireClearBtnEvents(this.inputElement,this.inputWrapper.clearButton,this.inputWrapper.container)}else this.initialize(),this.createInputElement(),this.updateHtmlAttributeToWrapper(),this.setTimeAllowEdit(),this.setEnable(),this.validateInterval();this.bindEvents(),this.isBlazorServer||(this.validateDisable(),this.setValue(this.getFormattedValue(this.value)),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue))),this.anchor=this.inputElement,this.inputElement.setAttribute("value",this.inputElement.value),this.isBlazorServer||(this.inputEleValue=this.getDateObject(this.inputElement.value)),this.renderComplete()},a.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.clearIconState()},a.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},a.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),this.popupCreation(),this.popupObj.destroy(),this.popupWrapper=this.popupObj=null,isNaN(+this.value)||null===this.value||this.valueIsDisable(this.value)||(this.strictMode&&this.resetState(),this.initValue=null,this.initMax=this.getDateObject(this.initMax),this.initMin=this.getDateObject(this.initMin),this.timeCollections=this.liCollections=[],this.setMinMax(this.initMin,this.initMax))},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.initialize=function(){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.Internationalization("en"),this.checkTimeFormat(),this.checkInvalidValue(this.value),this.setProperties({value:this.checkDateValue(new Date(this.checkInValue(this.value)))},!0),this.setProperties({min:this.checkDateValue(new Date(this.checkInValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkInValue(this.max)))},!0),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(this.scrollTo)))},!0),null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.initValue=this.checkDateValue(this.value),this.initMin=this.checkDateValue(this.min),this.initMax=this.checkDateValue(this.max),this.isNavigate=this.isPreventBlur=this.isTextSelected=!1,this.activeIndex=this.valueWithMinutes=this.prevDate=null,t.isNullOrUndefined(this.element.getAttribute("id"))?(this.element.id=t.getUniqueID("ej2_timepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(t.isNullOrUndefined(this.format.skeleton)||""===this.format.skeleton)this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"});else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})}else this.formatString=null},a.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},a.prototype.createInputElement=function(){var e=this.cssClass,i=!this.enableMask;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({element:this.inputElement,bindClearAction:i,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:[" e-input-group-icon e-time-icon e-icons"]},this.createElement),this.inputWrapper.container.style.width=this.setWidth(this.width),t.attributes(this.inputElement,{"aria-haspopup":"true","aria-autocomplete":"list",tabindex:"0","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"false","aria-invalid":"false"}),this.isNullOrEmpty(this.inputStyle)||s.Input.addAttributes({style:this.inputStyle},this.inputElement),t.addClass([this.inputWrapper.container],"e-time-wrapper")},a.prototype.getCldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:t.isBlazor()?"d":"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString},a.prototype.checkInvalidValue=function(e){var i=!1;if("object"!=typeof e&&!t.isNullOrUndefined(e)){var s=e;"string"==typeof s&&(s=s.trim());var a=null,n=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(a=this.setCurrentDate(this.getDateObject(e)),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"})))))),n=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),a=!t.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)?n:null,t.isNullOrUndefined(a)&&s.replace(/\s/g,"").length){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+s))?i=!0:a=new Date(""+s)}i?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:a},!0),this.initValue=this.value)}},a.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("t"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},a.prototype.destroy=function(){if(this.isBlazorServer)this.unBindEvents();else{this.hide(),this.unBindEvents();var i={"aria-haspopup":"true","aria-autocomplete":"list",tabindex:"0","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"true","aria-invalid":"false"};this.inputElement&&(s.Input.removeAttributes(i,this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.enableElement([this.inputElement]),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.cloneElement.getAttribute("disabled"))&&s.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&t.detach(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn(),e.prototype.destroy.call(this),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)}},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?(this.inputElement.removeAttribute(e[i]),"value"===e[i].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])),"value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])))},a.prototype.popupCreation=function(){this.isBlazorServer?(this.popupWrapper=this.inputWrapper.container.nextElementSibling,this.generateList()):(this.popupWrapper=this.createElement("div",{className:X+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.generateList(),t.append([this.listWrapper],this.popupWrapper)),this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper)),this.addSelection(),this.renderPopup(),t.detach(this.popupWrapper)},a.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},a.prototype.generateList=function(){this.isBlazorServer?this.listWrapper=this.popupWrapper.querySelector(".e-content"):this.createListItems(),this.wireListEvents();var e={duration:300,selector:".e-list-item"};if(this.rippleFn=t.rippleEffect(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll(".e-list-item"),this.isBlazorServer){this.blazorTimeCollections=[];for(var i=0;i<this.liCollections.length;i++)this.blazorTimeCollections.push(this.liCollections[i].getAttribute("data-value"))}},a.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new i.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",t.addClass([e.inputWrapper.buttons[0]],"e-active")},close:function(){t.removeClass([e.inputWrapper.buttons[0]],"e-active"),e.unWireListEvents(),e.inputElement.setAttribute("aria-activedescendant","null"),e.isBlazorServer||(t.remove(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML=""),e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),this.popupObj.element.style.maxHeight="240px"},a.prototype.getFormattedValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:t.isBlazor()?"t":"medium",type:"time"})},a.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),i=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(t)){var s=i?this.initValue.getDate():K,a=i?this.initValue.getMonth():_,n=i?this.initValue.getFullYear():G;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(J.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[s]:n+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];J.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.removeErrorClass=function(){t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"})},a.prototype.checkErrorState=function(e){var i=this.getDateObject(e);this.validateState(i)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"}))},a.prototype.validateInterval=function(){!t.isNullOrUndefined(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},a.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},a.prototype.disableElement=function(e){t.addClass(e,"e-disabled")},a.prototype.enableElement=function(e){t.removeClass(e,"e-disabled")},a.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},a.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},a.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=t.getValue(t.isBlazor()?"dayPeriods.wide":"dayPeriods.format.wide",t.getDefaultDateObject());else{var i=t.isBlazor()?".dates.dayPeriods.abbreviated":".dates.calendars.gregorian.dayPeriods.format.abbreviated",s=t.isBlazor()?"":"main.";e=t.getValue(s+""+this.locale+i,t.cldrData)}return e},a.prototype.getCursorSelection=function(){var e=this.inputElement,t=0,i=0;return isNaN(e.selectionStart)||(t=e.selectionStart,i=e.selectionEnd),{start:Math.abs(t),end:Math.abs(i)}},a.prototype.getActiveElement=function(){return t.isNullOrUndefined(this.popupWrapper)?null:this.popupWrapper.querySelectorAll(".e-active")},a.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},a.prototype.setWidth=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},a.prototype.setPopupWidth=function(e){return(e=this.setWidth(e)).indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"),e},a.prototype.setScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},a.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},a.prototype.setScrollTo=function(){var e;if(t.isNullOrUndefined(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var i=this.popupWrapper.querySelectorAll(".e-list-item");if(i.length){var s=this.isBlazorServer?new Date((new Date).toDateString()+" "+this.blazorTimeCollections[0]).setMilliseconds(0):this.timeCollections[0],a=this.isBlazorServer?new Date((new Date).toDateString()+" "+this.scrollTo.toLocaleTimeString()).setMilliseconds(0):this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}}t.isNullOrUndefined(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},a.prototype.getText=function(){return t.isNullOrUndefined(this.checkDateValue(this.value))?"":this.getValue(this.value)},a.prototype.getValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("d",t.getValue(this.locale,t.blazorCultureFormats)):t.getValue("dateFormats.short",t.getDefaultDateObject()):this.getCultureDateObject(t.cldrData,""+this.locale)},a.prototype.getBlazorCultureFormat=function(e){return t.getValue(e,t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a")},a.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("t"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.formatString},a.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("T"):t.getValue("timeFormats.medium",t.getDefaultDateObject()):t.isBlazor()?this.getBlazorCultureFormat("T"):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",t.cldrData)},a.prototype.getExactDateTime=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},a.prototype.setValue=function(e){var t=this.checkValue(e);this.strictMode||this.validateState(t)?this.isNullOrEmpty(t)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(t):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},a.prototype.compareFormatChange=function(e){return t.isNullOrUndefined(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},a.prototype.updatePlaceHolder=function(){s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},a.prototype.updateBlazorTimeCollections=function(e){this.blazorTimeCollections=e},a.prototype.popupHandler=function(e){this.enabled&&(t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),this.isBlazorServer||e.preventDefault(),this.isPopupOpen()&&!this.isBlazorServer?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},a.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},a.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var i=this.getCursorSelection();0===i.start&&i.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},a.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split("");t.push(" ");var i=this.getCursorSelection(),s=0,a=0,n=!1;if(this.isTextSelected)s=i.start,a=i.end,this.isTextSelected=!1;else for(var r=0;r<t.length;r++)if(e.test(t[r])||(a=r,n=!0),n){if(i.start>=s&&i.end<=a){a=a,this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},a.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"home":case"end":case"up":case"down":!this.enableMask||this.readonly||this.isPopupOpen()||(e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})),this.enableMask&&!this.isPopupOpen()||this.keyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):(this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.updateValue(this.valueWithMinutes,e))):this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictMode",this.inputElement.value):this.updateValue(this.inputElement.value,e),this.hide(),this.isNavigate=!1,this.isPopupOpen()&&e.stopPropagation();break;case"open":this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnPopupHide",!0):this.show(e);break;case"escape":this.isBlazorServer||(this.updateInputValue(this.objToString(this.value)),this.enableMask&&(this.value||this.updateInputValue(this.maskedDateValue),this.createMask()),this.previousState(this.value)),this.hide();break;case"close":this.hide();break;case"right":case"left":case"tab":case"shiftTab":this.isPopupOpen()||!this.enableMask||this.readonly||((0==this.inputElement.selectionStart&&this.inputElement.selectionEnd==this.inputElement.value.length||this.inputElement.selectionEnd!==length&&"tab"==e.action||0!==this.inputElement.selectionStart&&"shiftTab"==e.action||"left"==e.action||"right"==e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}));break;default:this.isNavigate=!1}},a.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,".e-list-item");this.setSelection(s,e),s&&s.classList.contains("e-list-item")&&this.hide()},a.prototype.closePopup=function(e,i){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var a={popup:this.isBlazorServer?null:this.popupObj,event:i||null,cancel:!1,name:"open"};t.removeClass([document.body],"e-time-overflow"),this.trigger("close",a,function(i){if(!i.cancel){var a={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new t.Animation(a)),t.removeClass([s.inputWrapper.container],["e-icon-anim"]),t.attributes(s.inputElement,{"aria-expanded":"false"}),t.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler),s.isBlazorServer&&(s.disposeServerPopup(),s.inputWrapper.container.parentElement.insertBefore(s.popupWrapper,s.inputWrapper.container.nextElementSibling),s.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),s.popupWrapper=s.popupObj=null)}t.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),t.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},a.prototype.disposeServerPopup=function(){this.popupWrapper&&(this.popupWrapper.style.visibility="hidden",this.popupWrapper.style.top="-9999px",this.popupWrapper.style.left="-9999px",this.popupWrapper.style.width="0px",this.popupWrapper.style.height="0px")},a.prototype.checkValueChange=function(e,i){if(this.strictMode||this.validateState(this.valueWithMinutes))if(i){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||t.isNullOrUndefined(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));else null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.setProperties({value:this.compareFormatChange(this.inputElement.value)},!0),this.initValue=this.valueWithMinutes=this.compareFormatChange(this.inputElement.value),this.prevValue=this.inputElement.value,+this.prevDate!=+this.value&&this.changeEvent(e)},a.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");this.setHover(i,"e-hover")},a.prototype.setHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeHover(i),t.addClass([e],i),"e-navigation"===i&&e.setAttribute("aria-selected","true"))},a.prototype.setSelection=function(e,i){this.isValidLI(e)&&!e.classList.contains("e-active")&&(this.isBlazorServer?(this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.inputElement.setAttribute("value",e.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!1),this.addSelection()):(this.checkValue(e.getAttribute("data-value")),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}),this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(i,!0)))},a.prototype.onMouseLeave=function(){this.removeHover("e-hover")},a.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&t.Browser.isDevice||this.hide()},a.prototype.setMinMax=function(e,i){t.isNullOrUndefined(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),t.isNullOrUndefined(this.checkDateValue(i))&&(this.initMax=this.getDateObject("11:59:59 PM"))},a.prototype.validateMinMax=function(e,i,s){var a=e instanceof Date?e:this.getDateObject(e);return t.isNullOrUndefined(this.checkDateValue(a))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,a),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},a.prototype.valueIsDisable=function(e){if(this.disableItemCollection.length>0){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,i=0;i<this.disableItemCollection.length;i++)if(t===this.disableItemCollection[i])return!1}return!0},a.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var i=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),a=this.setCurrentDate(this.getDateObject(this.initMin));if(t.isNullOrUndefined(this.checkDateValue(i))){if(+s<+a||""!==this.inputElement.value)return!1}else if(+i>+s||+i<+a)return!1}return!0},a.prototype.strictOperation=function(e,t,i,s){var a=this.createDateObj(this.getFormattedValue(t)),n=this.createDateObj(this.getFormattedValue(e)),r=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+n>+a)return this.disableTimeIcon(),this.initValue=this.getDateObject(a),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n>=+r)return this.getDateObject(n);if(+r>=+a||+n==+a)return this.getDateObject(a)}else if(+n>+a&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))))return i;return i},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.isBlazorServer?this.preventEventBubbling:this.popupHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),t.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),t.Browser.isDevice||(this.keyConfigure=t.extend(this.keyConfigure,this.keyConfigs),this.inputEvent=new t.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&t.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},a.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},a.prototype.formResetHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value"),t=this.isBlazorServer?this.inputEleValue:this.checkDateValue(this.inputEleValue);"EJS-TIMEPICKER"===this.element.tagName&&(t=null,e="",this.inputElement.setAttribute("value","")),this.isBlazorServer||(this.setProperties({value:t},!0),this.prevDate=this.value,this.valueWithMinutes=this.value,this.initValue=this.value),this.inputElement&&(this.updateInputValue(e),this.enableMask&&(e||this.updateInputValue(this.maskedDateValue),this.createMask()),this.isBlazorServer||this.checkErrorState(e),this.prevValue=this.inputElement.value)}},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.unBindEvents=function(){this.inputWrapper&&t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.popupHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),t.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),this.showClearButton&&!t.isNullOrUndefined(this.inputWrapper.clearButton)&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},a.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},a.prototype.clearHandler=function(e){this.enabled&&(e.preventDefault(),t.isNullOrUndefined(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnValueCleared"),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.isBlazorServer||this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.isBlazorServer||this.changeEvent(e)},a.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},a.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"];s<a.length;s++){var n=a[s];if(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.enabled||e){var r="disabled"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n);this.setProperties({enabled:r},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(n);break;case"readonly":if(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.readonly||e){var l="readonly"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"placeholder":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({min:i},!e));break;case"max":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({max:i},!e));break;case"value":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||(this.initValue=i,this.updateInput(!1,this.initValue),this.setProperties({value:i},!e)))}}},a.prototype.setCurrentDate=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:new Date(G,_,K,e.getHours(),e.getMinutes(),e.getSeconds())},a.prototype.getTextFormat=function(){var e=0;if("a"===this.cldrTimeFormat().split(" ")[0]||0===this.cldrTimeFormat().indexOf("a"))e=1;else if(this.cldrTimeFormat().indexOf("a")<0)for(var t=this.cldrTimeFormat().split(" "),i=0;i<t.length;i++)if(t[i].toLowerCase().indexOf("h")>=0){e=i;break}return e},a.prototype.updateValue=function(e,t){var i;if(this.isNullOrEmpty(e))this.resetState();else if(i=this.checkValue(e),this.strictMode){var s=null===i&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(s),this.enableMask&&(s||this.updateInputValue(this.maskedDateValue),this.createMask())}this.checkValueChange(t,"string"!=typeof e)},a.prototype.previousState=function(e){for(var t=this.getDateObject(e),i=0;i<this.timeCollections.length;i++)if(+t===this.timeCollections[i]){this.activeIndex=i,this.selectedElement=this.liCollections[i],this.valueWithMinutes=new Date(this.timeCollections[i]);break}return this.prevValue},a.prototype.resetState=function(){this.removeSelection(),s.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.isBlazorServer||this.checkErrorState(null)},a.prototype.objToString=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.checkValue=function(e){if(!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.validateValue(t,e)}return this.resetState(),this.valueWithMinutes=null},a.prototype.validateValue=function(e,i){var s,a=this.validateMinMax(i,this.min,this.max),n=this.createDateObj(a);if(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=t.isNullOrUndefined(n)?null:n,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=n),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&t.isNullOrUndefined(s)){var r=a.trim().length>0?a:"";this.updateInputValue(r),this.enableMask&&(r||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""==s&&this.updateInputValue(this.maskedDateValue),this.createMask());return s},a.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.findNextElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)||this.isBlazorServer?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length,r=this.isBlazorServer?t.isNullOrUndefined(this.blazorTimeCollections)?[]:this.blazorTimeCollections:this.timeCollections;if(t.isNullOrUndefined(this.checkDateValue(s))&&t.isNullOrUndefined(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){o=this.validLiElement(0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o}else if("end"===e.action){o=this.validLiElement(r.length-1,!0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o}else if("down"===e.action)for(l=0;l<n;l++){if(this.isBlazorServer?+s<+this.createDateObj(this.blazorTimeCollections[l]):+s<this.timeCollections[l]){o=this.validLiElement(l);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}if(l===n-1){o=this.validLiElement(0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}}else for(var l=n-1;l>=0;l--){if(this.isBlazorServer?+s>+this.createDateObj(this.blazorTimeCollections[l]):+s>this.timeCollections[l]){o=this.validLiElement(l,!0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}if(0===l){var o=this.validLiElement(n-1);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}}this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):this.elementValue(t.isNullOrUndefined(a)?null:new Date(a))}},a.prototype.selectNextItem=function(e){var t=this.validLiElement(0,"down"!==e.action);this.activeIndex=t,this.selectedElement=this.liCollections[t],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",t,!0)):this.elementValue(new Date(this.timeCollections[t]))},a.prototype.findNextInBlazor=function(e){var i=t.isNullOrUndefined(this.blazorTimeCollections)?0:this.blazorTimeCollections.length,s=0,a=this.createDateObj(this.inputElement.value);switch(e.action){case"home":this.activeIndex=s;break;case"end":s=i-1,this.activeIndex=s;break;case"down":for(l=0;l<i;l++){if(this.isBlazorServer?+a<+this.createDateObj(this.blazorTimeCollections[l]):+a<this.timeCollections[l]){var n=this.validLiElement(l);this.activeIndex=n;break}if(l===i-1){var r=this.validLiElement(0);this.activeIndex=r;break}}break;case"up":for(var l=i-1;l>=0;l--){if(this.isBlazorServer?+a>+this.createDateObj(this.blazorTimeCollections[l]):+a>this.timeCollections[l]){var o=this.validLiElement(l,!0);this.activeIndex=o;break}if(0===l){var h=this.validLiElement(i-1);this.activeIndex=h;break}}}this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)},a.prototype.elementValue=function(e){t.isNullOrUndefined(this.checkDateValue(e))||this.checkValue(e)},a.prototype.validLiElement=function(e,i){var s=null;if(this.isBlazorServer&&t.isNullOrUndefined(this.popupWrapper)){if((a=this.blazorTimeCollections).length)if(i)for(r=e;r>=0;r--){s=r;break}else for(r=e;r<=a.length-1;r++){s=r;break}}else{var a=t.isNullOrUndefined(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll(".e-list-item"),n=!0;if(a.length)if(i)for(r=e;r>=0;r--){if(!a[r].classList.contains("e-disabled")){s=r;break}0===r&&n&&(e=r=a.length,n=!1)}else for(var r=e;r<=a.length-1;r++){if(!a[r].classList.contains("e-disabled")){s=r;break}r===a.length-1&&n&&(e=r=-1,n=!1)}}return s},a.prototype.keyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0||this.inputWrapper.buttons[0].classList.contains("e-disabled"))){var i=this.isBlazorServer?t.isNullOrUndefined(this.blazorTimeCollections)?0:this.blazorTimeCollections.length:this.timeCollections.length;if(t.isNullOrUndefined(this.getActiveElement())||0===this.getActiveElement().length)if(t.isNullOrUndefined(this.popupObj)&&this.isBlazorServer)if(t.isNullOrUndefined(this.activeIndex)){a=this.validLiElement(0,"down"!==e.action);this.activeIndex=a,this.interopAdaptor.invokeMethodAsync("OnListItemClick",a,!0)}else this.findNextInBlazor(e);else this.liCollections.length>0&&(this.isBlazorServer?t.isNullOrUndefined(this.activeIndex):t.isNullOrUndefined(this.value)&&t.isNullOrUndefined(this.activeIndex))?this.selectNextItem(e):this.findNextElement(e);else{var s=void 0;if(e.keyCode>=37&&e.keyCode<=40){a=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,this.activeIndex=a=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),this.isBlazorServer||(s=t.isNullOrUndefined(this.timeCollections[a])?this.timeCollections[0]:this.timeCollections[a])}else if("home"===e.action){a=this.validLiElement(0);this.activeIndex=a,this.isBlazorServer||(s=this.timeCollections[a])}else if("end"===e.action){var a=this.validLiElement(i-1,!0);this.activeIndex=a,this.isBlazorServer||(s=this.timeCollections[a])}this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):this.elementValue(new Date(s))}this.isNavigate=!0,this.setHover(this.selectedElement,"e-navigation"),this.setActiveDescendant(),this.isBlazorServer||this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},a.prototype.getCultureTimeObject=function(e,i){return t.isBlazor()?t.getValue("t",t.getValue(i,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("main."+i+".dates.calendars.gregorian.timeFormats.short",e)},a.prototype.getCultureDateObject=function(e,i){return t.isBlazor()?t.getValue("d",t.getValue(i,t.blazorCultureFormats)):t.getValue("main."+i+".dates.calendars.gregorian.dateFormats.short",e)},a.prototype.wireListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},a.prototype.unWireListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.Browser.isDevice||(t.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),t.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},a.prototype.valueProcess=function(e,i){var s=t.isNullOrUndefined(this.checkDateValue(i))?null:i;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},a.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var i={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!t.isNullOrUndefined(e),element:this.element};i.value=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.prevDate=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i),this.invalidValueString=null,this.checkErrorState(this.value)},a.prototype.updateInput=function(e,i){e&&(this.prevValue=this.getValue(i)),this.prevDate=this.valueWithMinutes=i,"number"==typeof i&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+i||(this.setProperties({value:i},!0),this.enableMask&&this.createMask()),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},a.prototype.setActiveDescendant=function(){t.isNullOrUndefined(this.selectedElement)?t.attributes(this.inputElement,{"aria-activedescendant":"null"}):t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")})},a.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-active");e.length&&(t.removeClass(e,"e-active"),e[0].removeAttribute("aria-selected"))}},a.prototype.removeHover=function(e){var i=this.getHoverItem(e);i&&i.length&&(t.removeClass(i,e),"e-navigation"===e&&i[0].removeAttribute("aria-selected"))},a.prototype.getHoverItem=function(e){var i;return t.isNullOrUndefined(this.popupWrapper)||(i=this.popupWrapper.querySelectorAll("."+e)),i},a.prototype.setActiveClass=function(){if(!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-list-item");if(e.length)for(var i=0;i<e.length;i++)if(!this.isBlazorServer&&this.timeCollections[i]===+this.getDateObject(this.valueWithMinutes)||this.isBlazorServer&&this.blazorTimeCollections[i]===this.blazorTimeCollections[this.activeIndex]){e[i].setAttribute("aria-selected","true"),this.selectedElement=e[i],this.activeIndex=i;break}}},a.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},a.prototype.isValidLI=function(e){return e&&e.classList.contains("e-list-item")&&!e.classList.contains("e-disabled")},a.prototype.createDateObj=function(e){var i=t.isBlazor()?"M"+t.getDefaultDateObject().dateSeperator+"d"+t.getDefaultDateObject().dateSeperator+"yy":null,s=this.globalize.formatDate(new Date,{format:i,skeleton:"short",type:"date"}),a=null;return"string"==typeof e?e.toUpperCase().indexOf("AM")>-1||e.toUpperCase().indexOf("PM")>-1?(s=this.defaultCulture.formatDate(new Date,{format:i,skeleton:"short",type:"date"}),a=isNaN(+new Date(s+" "+e))?null:new Date(new Date(s+" "+e).setMilliseconds(0)),t.isNullOrUndefined(a)&&(a=this.timeParse(s,e))):a=this.timeParse(s,e):e instanceof Date&&(a=e),a},a.prototype.timeParse=function(e,i){var s;return s=this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=t.isNullOrUndefined(s)?this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=t.isNullOrUndefined(s)?s:new Date(s.setMilliseconds(0))},a.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var i,s=6e4*this.step,a=[];this.timeCollections=[],this.disableItemCollection=[],i=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=i;)this.timeCollections.push(i),a.push(this.globalize.formatDate(new Date(i),{format:this.cldrTimeFormat(),type:"time"})),i+=s;var l={itemCreated:function(t){var i={element:t.item,text:t.text,value:e.getDateObject(t.text),isDisabled:!1};e.trigger("itemRender",i,function(t){t.isDisabled&&t.element.classList.add("e-disabled"),t.element.classList.contains("e-disabled")&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=n.ListBase.createList(this.createElement,a,l,!0),t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([this.listTag],this.listWrapper)},a.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&(this.inputWrapper.container.contains(i)||this.popupObj.element&&this.popupObj.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+this.popupObj.element.id+'"]')||i===this.inputElement||i===(this.inputWrapper&&this.inputWrapper.buttons[0])||i===(this.inputWrapper&&this.inputWrapper.clearButton)||i===(this.inputWrapper&&this.inputWrapper.container)?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement&&i===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},a.prototype.setEnableRtl=function(){s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},a.prototype.setEnable=function(){s.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(t.removeClass([this.inputWrapper.container],"e-disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),t.addClass([this.inputWrapper.container],"e-disabled"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},a.prototype.getProperty=function(e,t){"min"===t?(this.initMin=this.checkDateValue(new Date(this.checkInValue(e.min))),this.setProperties({min:this.initMin},!0)):(this.initMax=this.checkDateValue(new Date(this.checkInValue(e.max))),this.setProperties({max:this.initMax},!0)),""===this.inputElement.value?this.validateMinMax(this.value,this.min,this.max):this.checkValue(this.inputElement.value),this.checkValueChange(null,!1)},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isPreventBlur&&this.isPopupOpen())return void this.inputElement.focus();this.closePopup(0,e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!=this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||this.updateInputValue("")),t.removeClass([this.inputWrapper.container],[Z]);var i={model:this.isBlazorServer?null:this};this.trigger("blur",i),this.isBlazorServer||this.getText()===this.inputElement.value?0===this.inputElement.value.trim().length&&this.resetState():this.updateValue(this.inputElement.value,e),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnStrictMode",this.inputElement.value),this.cursorDetails=null,this.isNavigate=!1,""===this.inputElement.value&&(this.invalidValueString=null)}},a.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Z]);var e={model:this.isBlazorServer?null:this};this.trigger("blur",e)}},a.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+X))},a.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this.isBlazorServer?null:this};this.readonly||t.Browser.isDevice||this.enableMask||this.selectInputText(),this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length)),this.trigger("focus",e),this.clearIconState(),this.openOnFocus&&this.show()}},a.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},a.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},a.prototype.show=function(e){var i=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),t.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=X+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),t.Browser.isDevice&&(this.mobileTimePopupWrap=this.createElement("div",{className:"e-timepicker-mob-popup-wrap"}),document.body.appendChild(this.mobileTimePopupWrap)),this.openPopupEventArgs={popup:this.isBlazorServer?null:this.popupObj||null,cancel:!1,event:e||null,name:"open",appendTo:t.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;this.trigger("open",s,function(e){if(t.isBlazor()&&i.isServerRendered&&(e.popup=i.popupObj||null),i.openPopupEventArgs=e,i.openPopupEventArgs.cancel||i.inputWrapper.buttons[0].classList.contains("e-disabled"))i.popupObj.destroy(),i.isBlazorServer&&(i.disposeServerPopup(),i.inputWrapper.container.parentElement.insertBefore(i.popupWrapper,i.inputWrapper.container.nextElementSibling),i.interopAdaptor.invokeMethodAsync("OnPopupHide",!1)),i.popupWrapper=i.listTag=void 0,i.liCollections=i.timeCollections=i.disableItemCollection=[],i.popupObj=null;else{i.isBlazorServer&&(i.popupWrapper.style.visibility="",i.popupWrapper.style.width=i.inputWrapper.container.offsetWidth+"px",i.popupWrapper.style.height="auto"),i.isBlazorServer&&(i.openPopupEventArgs.popup=i.popupObj),i.openPopupEventArgs.appendTo.appendChild(i.popupWrapper),i.popupAlignment(i.openPopupEventArgs),i.setScrollPosition(),t.Browser.isDevice||i.inputElement.focus();var s={name:"FadeIn",duration:50};i.popupObj.refreshPosition(i.anchor),1e3===i.zIndex?i.popupObj.show(new t.Animation(s),i.element):i.popupObj.show(new t.Animation(s),null),i.setActiveDescendant(),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.addClass([i.inputWrapper.container],Z),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i),i.setOverlayIndex(i.mobileTimePopupWrap,i.popupObj.element,i.modal,t.Browser.isDevice)}})}},a.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},a.prototype.formatValues=function(e){var i;return"number"==typeof e?i=t.formatUnit(e):"string"==typeof e&&(i=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:t.formatUnit(e)),i},a.prototype.popupAlignment=function(e){if(e.popup.position.X=this.formatValues(e.popup.position.X),e.popup.position.Y=this.formatValues(e.popup.position.Y),isNaN(parseFloat(e.popup.position.X))&&isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.targetType="container"),isNaN(parseFloat(e.popup.position.X))||(this.popupObj.offsetX=parseFloat(e.popup.position.X)),isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.offsetY=parseFloat(e.popup.position.Y)),t.Browser.isDevice)"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.offsetY=0,this.popupObj.targetType="container",this.popupObj.collision={X:"fit",Y:"fit"});else{switch(e.popup.position.X){case"left":break;case"right":e.popup.offsetX=this.containerStyle.width;break;case"center":e.popup.offsetX=-this.containerStyle.width/2}switch(e.popup.position.Y){case"top":case"bottom":break;case"center":e.popup.offsetY=-this.containerStyle.height/2}"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.inputWrapper.container,this.anchor=this.inputElement,this.popupObj.targetType="relative")}},a.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},a.prototype.getModuleName=function(){return"timepicker"},a.prototype.onPropertyChanged=function(e,i){for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(r){case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.inputElement.setAttribute("aria-placeholder",e.placeholder);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement,this.floatLabelType),this.readonly&&this.hide(),this.setTimeAllowEdit();break;case"enabled":this.setProperties({enabled:e.enabled},!0),this.setEnable();break;case"allowEdit":this.setTimeAllowEdit();break;case"enableRtl":this.isBlazorServer||(this.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl());break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"min":case"max":this.isBlazorServer||this.getProperty(e,r);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.updatePlaceHolder(),this.isBlazorServer||(this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"width":t.setStyleAttribute(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect();break;case"format":this.setProperties({format:e.format},!0),this.checkTimeFormat(),this.isBlazorServer||(this.setValue(this.value),this.enableMask&&(this.createMask(),this.value||this.updateInputValue(this.maskedDateValue)));break;case"value":this.isBlazorServer||(this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.invalidValueString?(this.updateInputValue(this.invalidValueString),this.checkErrorState(this.invalidValueString)):("string"==typeof e.value?(this.setProperties({value:this.checkDateValue(new Date(e.value))},!0),e.value=this.value):(e.value&&+new Date(+e.value).setMilliseconds(0))!==+this.value&&(e.value=this.checkDateValue(new Date(""+e.value))),this.initValue=e.value,e.value=this.compareFormatChange(this.checkValue(e.value))),this.checkValueChange(null,!1),this.isPopupOpen()&&this.setScrollPosition(),this.isAngular&&this.preventChange&&(this.preventChange=!1),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"strictMode":this.isBlazorServer||(this.invalidValueString=null,e.strictMode&&this.checkErrorState(null),this.setProperties({strictMode:e.strictMode},!0),this.checkValue(this.inputElement.value),this.checkValueChange(null,!1));break;case"scrollTo":this.isBlazorServer?this.popupWrapper&&this.setScrollTo():this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))?(this.popupWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue)):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("")}}},a.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},q([t.Property(null)],a.prototype,"width",void 0),q([t.Property(null)],a.prototype,"cssClass",void 0),q([t.Property(!1)],a.prototype,"strictMode",void 0),q([t.Property(null)],a.prototype,"keyConfigs",void 0),q([t.Property(null)],a.prototype,"format",void 0),q([t.Property(!0)],a.prototype,"enabled",void 0),q([t.Property(!1)],a.prototype,"readonly",void 0),q([t.Property({})],a.prototype,"htmlAttributes",void 0),q([t.Property("Never")],a.prototype,"floatLabelType",void 0),q([t.Property(null)],a.prototype,"placeholder",void 0),q([t.Property(1e3)],a.prototype,"zIndex",void 0),q([t.Property(!1)],a.prototype,"enablePersistence",void 0),q([t.Property(!0)],a.prototype,"showClearButton",void 0),q([t.Property(30)],a.prototype,"step",void 0),q([t.Property(null)],a.prototype,"scrollTo",void 0),q([t.Property(null)],a.prototype,"value",void 0),q([t.Property(null)],a.prototype,"min",void 0),q([t.Property(null)],a.prototype,"max",void 0),q([t.Property(!0)],a.prototype,"allowEdit",void 0),q([t.Property(!1)],a.prototype,"openOnFocus",void 0),q([t.Property(!1)],a.prototype,"enableMask",void 0),q([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),q([t.Event()],a.prototype,"change",void 0),q([t.Event()],a.prototype,"created",void 0),q([t.Event()],a.prototype,"destroyed",void 0),q([t.Event()],a.prototype,"open",void 0),q([t.Event()],a.prototype,"itemRender",void 0),q([t.Event()],a.prototype,"close",void 0),q([t.Event()],a.prototype,"cleared",void 0),q([t.Event()],a.prototype,"blur",void 0),q([t.Event()],a.prototype,"focus",void 0),a=q([t.NotifyPropertyChanges],a)}(t.Component),ee=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)}}(),te=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ie=(new Date).getDate(),se=(new Date).getMonth(),ae=(new Date).getFullYear(),ne=(new Date).getHours(),re=(new Date).getMinutes(),le=(new Date).getSeconds(),oe=(new Date).getMilliseconds(),he="e-datetimepicker",ue=function(a){function n(e,t){var i=a.call(this,e,t)||this;return i.valueWithMinutes=null,i.scrollInvoked=!1,i.moduleName=i.getModuleName(),i.dateTimeOptions=e,i}return ee(n,a),n.prototype.focusHandler=function(){this.enabled&&t.addClass([this.inputWrapper.container],"e-input-focus")},n.prototype.focusIn=function(){a.prototype.focusIn.call(this)},n.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),t.removeClass([this.inputWrapper.container],["e-input-focus"]))},n.prototype.blurHandler=function(e){if(this.enabled){if(this.isTimePopupOpen()&&this.isPreventBlur)return void this.inputElement.focus();t.removeClass([this.inputWrapper.container],"e-input-focus");var i={model:t.isBlazor()&&this.isServerRendered?null:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",i)}},n.prototype.destroy=function(){this.popupObject&&this.popupObject.element.classList.contains("e-popup")&&(this.popupObject.destroy(),t.detach(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn());var e={"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false","aria-haspopup":"true","aria-activedescendant":"null",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off"};this.inputElement&&(s.Input.removeAttributes(e,this.inputElement),this.inputElement.removeAttribute("aria-placeholder")),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObject=this.popupWrapper=null,this.keyboardHandler.destroy()),this.unBindInputEvents(),a.prototype.destroy.call(this)},n.prototype.render=function(){this.timekeyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.valueWithMinutes=null,this.previousDateTime=null,this.isPreventBlur=!1,this.cloneElement=this.element.cloneNode(!0),this.dateTimeFormat=this.cldrDateTimeFormat(),this.initValue=this.value,a.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),a.prototype.render.call(this),this.createInputElement(),a.prototype.updateHtmlAttributeToWrapper.call(this),this.bindInputEvents(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.setValue(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(this.scrollTo)))},!0),this.previousDateTime=this.value&&new Date(+this.value),"EJS-DATETIMEPICKER"===this.element.tagName&&(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.enabled||(this.inputElement.tabIndex=-1)),this.renderComplete()},n.prototype.setValue=function(){if(this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var e=this.validateMinMaxRange(this.initValue);s.Input.setValue(this.getFormattedValue(e),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:e},!0)}else t.isNullOrUndefined(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,a.prototype.updateInput.call(this)},n.prototype.validateMinMaxRange=function(e){var t=e;return this.isDateObject(e)?t=this.validateValue(e):+this.min>+this.max&&this.disablePopupButton(!0),this.checkValidState(t),t},n.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},n.prototype.checkErrorState=function(){this.isValidState?t.removeClass([this.inputWrapper.container],"e-error"):t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},n.prototype.validateValue=function(e){var t=e;return this.strictMode?+this.min>+this.max?(this.disablePopupButton(!0),t=this.max):+e<+this.min?t=this.min:+e>+this.max&&(t=this.max):+this.min>+this.max&&(this.disablePopupButton(!0),t=e),t},n.prototype.disablePopupButton=function(e){e?(t.addClass([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled"),this.hide()):t.removeClass([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled")},n.prototype.getFormattedValue=function(e){var i;return t.isNullOrUndefined(e)?null:(i="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,i))},n.prototype.isDateObject=function(e){return!t.isNullOrUndefined(e)&&!isNaN(+e)},n.prototype.createInputElement=function(){t.removeClass([this.inputElement],"e-datepicker"),t.removeClass([this.inputWrapper.container],"e-date-wrapper"),t.addClass([this.inputWrapper.container],"e-datetime-wrapper"),t.addClass([this.inputElement],he),this.renderTimeIcon()},n.prototype.renderTimeIcon=function(){this.timeIcon=s.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},n.prototype.bindInputEvents=function(){t.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),t.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},n.prototype.unBindInputEvents=function(){t.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(t.EventHandler.remove(this.inputElement,"blur",this.blurHandler),t.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},n.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.timeFormat},n.prototype.cldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:t.isBlazor()?"d":"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString},n.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},n.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},n.prototype.getCultureTimeObject=function(e,i){return"Gregorian"===this.calendarMode?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):t.getValue("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},n.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&a.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),t.addClass([this.inputWrapper.container],["e-input-focus"]))),this.isIconClicked=!1)},n.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),t.isNullOrUndefined(this.popupWrapper)||this.popupCreation("date",e)))},n.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),a.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},n.prototype.toggle=function(e){this.isDatePopupOpen()?(a.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),a.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},n.prototype.listCreation=function(){var i;i="Gregorian"===this.calendarMode?this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime"}):this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var s=t.isNullOrUndefined(this.value)?""!==this.inputElement.value?i:new Date:this.value;this.valueWithMinutes=s,this.listWrapper=t.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(s),n=this.endTime(s),r=e.TimePickerBase.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([r.list],this.listWrapper),this.wireTimeListEvents();var l={duration:300,selector:".e-list-item"};this.rippleFn=t.rippleEffect(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll(".e-list-item")},n.prototype.popupCreation=function(e,i){t.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(t.addClass([this.popupWrapper],"e-datetimepopup-wrapper"),t.attributes(this.popupWrapper,{id:this.element.id+"_datepopup"})):this.readonly||(this.dateTimeWrapper=t.createElement("div",{className:he+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),t.isNullOrUndefined(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.listCreation(),t.append([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(i),this.popupObject.refreshPosition(this.inputElement))},n.prototype.openPopup=function(e){var i=this;this.preventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObject,event:e||null};var s=this.preventArgs;this.trigger("open",s,function(e){if(i.preventArgs=e,!i.preventArgs.cancel&&!i.readonly){var s={name:"FadeIn",duration:100};1e3===i.zIndex?i.popupObject.show(new t.Animation(s),i.element):i.popupObject.show(new t.Animation(s),null),t.addClass([i.inputWrapper.container],["e-icon-anim"]),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i)}})},n.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObject)&&(this.inputWrapper.container.contains(i)||this.popupObject.element&&this.popupObject.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||i===this.inputElement||i===this.timeIcon||i===this.inputWrapper.container?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(t.Browser.isIE||"edge"===t.Browser.info.name)&&i===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},n.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+he))},n.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-datetimepopup-wrapper"))},n.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),t.Browser.isDevice&&(this.timeModal=t.createElement("div"),this.timeModal.className=he+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));this.popupObject=new i.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",t.addClass([e.timeIcon],"e-active"),t.Browser.isDevice||(e.timekeyConfigure=t.extend(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new t.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){t.removeClass([e.timeIcon],"e-active"),e.unWireTimeListEvents(),e.inputElement.setAttribute("aria-activedescendant","null"),t.remove(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.popupObject.element.style.maxHeight="250px"},n.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e:"100%"},n.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);return e.indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"),e},n.prototype.wireTimeListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},n.prototype.unWireTimeListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},n.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");this.setTimeHover(i,"e-hover")},n.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},n.prototype.setTimeHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeTimeHover(i),t.addClass([e],i))},n.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return t>e?e:t},n.prototype.changeEvent=function(e){(this.value&&this.value.valueOf())!==(this.previousDateTime&&+this.previousDateTime.valueOf())&&(a.prototype.changeEvent.call(this,e),this.valueWithMinutes=this.value,this.setInputValue("date"),this.previousDateTime=this.value&&new Date(+this.value))},n.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!t.isNullOrUndefined(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.value)},n.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},n.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.dateTimeWrapper.scrollTop=i?s-(t/2+a/2):s:this.dateTimeWrapper.scrollTop=0},n.prototype.setScrollTo=function(){var e,i=this.dateTimeWrapper.querySelectorAll(".e-list-item");if(i.length>=0){this.scrollInvoked=!0;var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;t.isNullOrUndefined(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},n.prototype.setInputValue=function(e){if("date"===e)this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0);else{var t=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));s.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.previousElementValue=this.inputElement.value,this.setProperties({value:new Date(this.timeCollections[this.activeIndex])},!0),this.enableMask&&this.createMask()}this.updateIconState()},n.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},n.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},n.prototype.combineDateTime=function(e){if(this.isDateObject(e)){var t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return new Date(s,i,t,a,n,r)}return this.previousDate},n.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,".e-list-item");s&&s.classList.contains("e-list-item")&&(this.timeValue=s.getAttribute("data-value"),this.hide(e)),this.setSelection(s,e)},n.prototype.setSelection=function(e,i){if(this.isValidLI(e)&&!e.classList.contains("e-active")){this.selectedElement=e;var s=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=s,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(i)}},n.prototype.setTimeActiveClass=function(){var e=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!t.isNullOrUndefined(e)){var i=e.querySelectorAll(".e-list-item");if(i.length)for(var s=0;s<i.length;s++)if(this.timeCollections[s]===+this.valueWithMinutes){i[s].setAttribute("aria-selected","true"),this.selectedElement=i[s],this.activeIndex=s,this.setTimeActiveDescendant();break}}},n.prototype.setTimeActiveDescendant=function(){t.isNullOrUndefined(this.selectedElement)?t.attributes(this.inputElement,{"aria-activedescendant":"null"}):t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")})},n.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},n.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!t.isNullOrUndefined(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll(".e-active");e.length&&(t.removeClass(e,"e-active"),e[0].removeAttribute("aria-selected"))}},n.prototype.removeTimeHover=function(e){var i=this.getTimeHoverItem(e);i&&i.length&&t.removeClass(i,e)},n.prototype.getTimeHoverItem=function(e){var i,s=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t.isNullOrUndefined(s)||(i=s.querySelectorAll("."+e)),i},n.prototype.isValidLI=function(e){return e&&e.classList.contains("e-list-item")&&!e.classList.contains("e-disabled")},n.prototype.calculateStartEnd=function(e,t,i){var s=e.getDate(),a=e.getMonth(),n=e.getFullYear(),r=e.getHours(),l=e.getMinutes(),o=e.getSeconds(),h=e.getMilliseconds();return t?"starttime"===i?new Date(n,a,s,0,0,0):new Date(n,a,s,23,59,59):new Date(n,a,s,r,l,o,h)},n.prototype.startTime=function(e){var t,i,s=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),this.calculateStartEnd(t,i,"starttime")},n.prototype.endTime=function(e){var t,i,s=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},n.prototype.hide=function(e){var i=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj||this.popupObject,event:e||null};var s=this.preventArgs;t.isNullOrUndefined(this.popupObj)?this.trigger("close",s,function(t){i.dateTimeCloseEventCallback(e,t)}):this.dateTimeCloseEventCallback(e,s)}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.dateTimeCloseEventCallback=function(e,i){this.preventArgs=i,this.preventArgs.cancel||(this.isDatePopupOpen()?a.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),t.removeClass([document.body],"e-time-overflow"),t.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var i={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new t.Animation(i)),this.inputWrapper.container.classList.remove("e-icon-anim"),t.attributes(this.inputElement,{"aria-expanded":"false"}),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},n.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.preRender.call(this),t.removeClass([this.inputElementCopy],[he])},n.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},n.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"];s<a.length;s++){var n=a[s];if(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"readonly":if(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var r="disabled"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({min:i},!e));break;case"disabled":if(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var l="disabled"!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n);this.setProperties({enabled:l},!e)}break;case"value":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({value:i},!e));break;case"max":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({max:i},!e))}}},n.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},n.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},n.prototype.getTimeActiveElement=function(){return t.isNullOrUndefined(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll(".e-active")},n.prototype.createDateObj=function(e){return e instanceof Date?e:null},n.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var i=this.createDateObj(e),s=this.valueWithMinutes,a=!t.isNullOrUndefined(s);if(this.checkDateValue(i)){var n=a?s.getDate():ie,r=a?s.getMonth():se,l=a?s.getFullYear():ae,o=a?s.getHours():ne,h=a?s.getMinutes():re,u=a?s.getSeconds():le,d=a?s.getMilliseconds():oe;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(l,r,n,i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())):new Date(l,r,n,o,h,u,d)}}return null},n.prototype.findNextTimeElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length;if(!t.isNullOrUndefined(this.activeIndex)||!t.isNullOrUndefined(this.checkDateValue(s))){if("home"===e.action)a=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)a=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(r=0;r<n;r++)if(+s<this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}else for(var r=n-1;r>=0;r--)if(+s>this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(t.isNullOrUndefined(a)?null:new Date(a))}},n.prototype.setTimeValue=function(e,i){var a,n,r=this.validateMinMaxRange(i),l=this.createDateObj(r);return this.getFormattedValue(l)!==(t.isNullOrUndefined(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=t.isNullOrUndefined(l)?null:l,n=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=l),this.valueWithMinutes=this.checkDateValue(e),n=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&t.isNullOrUndefined(n),s.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),n},n.prototype.timeElementValue=function(e){if(!t.isNullOrUndefined(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var i=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(i,e)}return null},n.prototype.timeKeyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0)){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(t.isNullOrUndefined(this.value)&&t.isNullOrUndefined(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var s=void 0;if(e.keyCode>=37&&e.keyCode<=40){var a=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,s=t.isNullOrUndefined(this.timeCollections[a])?this.timeCollections[0]:this.timeCollections[a]}else"home"===e.action?(this.activeIndex=0,s=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=i-1,s=this.timeCollections[i-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(s))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},n.prototype.timeKeyActionHandle=function(e){if(this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"up":case"down":case"home":case"end":this.timeKeyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs.value=this.value,this.addTimeSelection(),this.previousDateTime=this.value)):this.updateValue(e),this.hide(e),t.addClass([this.inputWrapper.container],"e-input-focus"),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},n.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},n.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),s.Input.setValue(this.getFormattedValue(e.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=e.value,this.setProperties({value:e.value},!0),this.popupObj&&this.popupUpdate(),this.previousDateTime=new Date(this.inputElement.value),this.updateInput(),this.changeTrigger(null),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.value&&this.notify("createMask",{module:"MaskedDateTime"});break;case"min":case"max":this.getProperty(e,l),this.updateInput();break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":t.isNullOrUndefined(i.cssClass)||(i.cssClass=i.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),s.Input.setCssClass(e.cssClass,[this.inputWrapper.container],i.cssClass),this.dateTimeWrapper&&s.Input.setCssClass(e.cssClass,[this.dateTimeWrapper],i.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.inputElement.setAttribute("aria-placeholder",e.placeholder);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.enabled||(this.inputElement.tabIndex=-1);break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"scrollTo":this.checkDateValue(new Date(this.checkValue(e.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:a.prototype.onPropertyChanged.call(this,e,i)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},n.prototype.getModuleName=function(){return"datetimepicker"},n.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value?this.value:new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},te([t.Property(null)],n.prototype,"timeFormat",void 0),te([t.Property(30)],n.prototype,"step",void 0),te([t.Property(null)],n.prototype,"scrollTo",void 0),te([t.Property(1e3)],n.prototype,"zIndex",void 0),te([t.Property(null)],n.prototype,"value",void 0),te([t.Property(null)],n.prototype,"keyConfigs",void 0),te([t.Property({})],n.prototype,"htmlAttributes",void 0),te([t.Property(!1)],n.prototype,"enablePersistence",void 0),te([t.Property(!0)],n.prototype,"allowEdit",void 0),te([t.Property(!1)],n.prototype,"isMultiSelection",void 0),te([t.Property(null)],n.prototype,"values",void 0),te([t.Property(!0)],n.prototype,"showClearButton",void 0),te([t.Property(null)],n.prototype,"placeholder",void 0),te([t.Property(!1)],n.prototype,"strictMode",void 0),te([t.Property(null)],n.prototype,"serverTimezoneOffset",void 0),te([t.Property(new Date(1900,0,1))],n.prototype,"min",void 0),te([t.Property(new Date(2099,11,31))],n.prototype,"max",void 0),te([t.Property(null)],n.prototype,"firstDayOfWeek",void 0),te([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),te([t.Property("Month")],n.prototype,"start",void 0),te([t.Property("Month")],n.prototype,"depth",void 0),te([t.Property(!1)],n.prototype,"weekNumber",void 0),te([t.Property(!0)],n.prototype,"showTodayButton",void 0),te([t.Property("Short")],n.prototype,"dayHeaderFormat",void 0),te([t.Property(!1)],n.prototype,"openOnFocus",void 0),te([t.Property(!1)],n.prototype,"enableMask",void 0),te([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],n.prototype,"maskPlaceholder",void 0),te([t.Event()],n.prototype,"open",void 0),te([t.Event()],n.prototype,"close",void 0),te([t.Event()],n.prototype,"cleared",void 0),te([t.Event()],n.prototype,"blur",void 0),te([t.Event()],n.prototype,"focus",void 0),te([t.Event()],n.prototype,"created",void 0),te([t.Event()],n.prototype,"destroyed",void 0),n=te([t.NotifyPropertyChanges],n)}(C),de=function(){function e(e){this.mask="",this.defaultConstant={day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"},this.hiddenMask="",this.validCharacters="dMyhmHfasz",this.isDayPart=!1,this.isMonthPart=!1,this.isYearPart=!1,this.isHourPart=!1,this.isMinutePart=!1,this.isSecondsPart=!1,this.isMilliSecondsPart=!1,this.monthCharacter="",this.periodCharacter="",this.isHiddenMask=!1,this.isComplete=!1,this.isNavigate=!1,this.formatRegex=/EEEEE|EEEE|EEE|EE|E|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|HH|H|hh|h|mm|m|fff|ff|f|aa|a|ss|s|zzzz|zzz|zz|z|'[^']*'|'[^']*'/g,this.isDeletion=!1,this.isShortYear=!1,this.isDeleteKey=!1,this.parent=e,this.dateformat=this.getCulturedFormat(),this.value=null!=this.parent.value?this.parent.value:new Date,this.value.setMonth(0),this.value.setHours(0),this.value.setMinutes(0),this.value.setSeconds(0),this.previousDate=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds()),this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"MaskedDateTime"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("createMask",this.createMask,this),this.parent.on("setMaskSelection",this.validCharacterCheck,this),this.parent.on("inputHandler",this.maskInputHandler,this),this.parent.on("keyDownHandler",this.maskKeydownHandler,this),this.parent.on("clearHandler",this.clearHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("createMask",this.createMask),this.parent.off("setMaskSelection",this.validCharacterCheck),this.parent.off("inputHandler",this.maskInputHandler),this.parent.off("keyDownHandler",this.maskKeydownHandler),this.parent.off("clearHandler",this.clearHandler))},e.prototype.createMask=function(e){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.dateformat=this.getCulturedFormat(),this.parent.maskPlaceholder.day&&(this.defaultConstant.day=this.parent.maskPlaceholder.day),this.parent.maskPlaceholder.month&&(this.defaultConstant.month=this.parent.maskPlaceholder.month),this.parent.maskPlaceholder.year&&(this.defaultConstant.year=this.parent.maskPlaceholder.year),this.parent.maskPlaceholder.hour&&(this.defaultConstant.hour=this.parent.maskPlaceholder.hour),this.parent.maskPlaceholder.minute&&(this.defaultConstant.minute=this.parent.maskPlaceholder.minute),this.parent.maskPlaceholder.second&&(this.defaultConstant.second=this.parent.maskPlaceholder.second),this.parent.maskPlaceholder.dayOfTheWeek&&(this.defaultConstant.dayOfTheWeek=this.parent.maskPlaceholder.dayOfTheWeek.toString()),this.getCUltureMaskFormat();var t=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.mask=this.previousValue=t,this.parent.maskedDateValue=this.mask,this.parent.value&&this.setDynamicValue()},e.prototype.getCUltureMaskFormat=function(){this.l10n=new t.L10n(this.parent.moduleName,this.defaultConstant,this.parent.locale),this.objectString=Object.keys(this.defaultConstant);for(var e=0;e<this.objectString.length;e++)this.defaultConstant[this.objectString[e].toString()]=this.l10n.getConstant(this.objectString[e].toString())},e.prototype.validCharacterCheck=function(){for(var e=this.parent.inputElement.selectionStart,t=e,i=e-1;t<this.hiddenMask.length||i>=0;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(i>=0&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},e.prototype.setDynamicValue=function(){this.value=this.parent.value,this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue()},e.prototype.setSelection=function(e){for(var t=-1,i=0,s=0;s<this.hiddenMask.length;s++)this.hiddenMask[s]===e&&(i=s+1,-1===t&&(t=s));t<0&&(t=0),this.parent.inputElement.setSelectionRange(t,i)},e.prototype.maskKeydownHandler=function(e){if("Delete"===e.e.key)return void(this.isDeleteKey=!0);if(!(e.e.altKey||e.e.ctrlKey||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&"shiftTab"!==e.e.key&&"Tab"!==e.e.key&&"shiftTab"!==e.e.action&&"End"!==e.e.key&&"Home"!==e.e.key)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0==t&&i==s&&("Tab"===e.e.key||"shiftTab"===e.e.action)){var a="shiftTab"===e.e.action?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if("End"===e.e.key||"Home"===e.e.key){var n="End"===e.e.key?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection("ArrowLeft"===e.e.key||"shiftTab"===e.e.action||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){t=this.parent.inputElement.selectionStart;this.dateAlteration("ArrowDown"===e.e.key);var r=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=r,this.parent.inputElement.value=r,this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}},e.prototype.differenceCheck=function(){var e=this.parent.inputElement.selectionStart,t=this.parent.inputElement.value,i=this.previousValue.substring(0,e+this.previousValue.length-t.length),s=t.substring(0,e),a=this.value,n=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();if(0===i.indexOf(s)&&(0===s.length||this.previousHiddenMask[s.length-1]!==this.previousHiddenMask[s.length])){for(u=s.length;u<i.length;u++)""!==this.previousHiddenMask[u]&&this.validCharacters.indexOf(this.previousHiddenMask[u])>=0&&(this.isDeletion=this.handleDeletion(this.previousHiddenMask[u],!1));if(this.isDeletion)return}switch(this.previousHiddenMask[e-1]){case"d":var r=(this.isDayPart&&a.getDate().toString().length<2?10*a.getDate():0)+parseInt(s[e-1],10);if(isNaN(r))return;for(u=0;r>n;u++)r=parseInt(r.toString().slice(1),10);if(r>=1){if(a.setDate(r),this.isNavigate=2===r.toString().length,this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),a.getMonth()!==this.value.getMonth())return;this.isDayPart=!0}else this.isDayPart=!1;break;case"M":var l=void 0;if(l=a.getMonth().toString().length<2?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10),isNaN(l)){var o=this.getCulturedValue("months[stand-alone].wide"),h=Object.keys(o);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){for(var u=1,d=0,p=h;d<p.length;d++){p[d];if(0===o[u].toLowerCase().indexOf(this.monthCharacter))return a.setMonth(u-1),this.isMonthPart=!0,void(this.value=a);u++}this.monthCharacter=this.monthCharacter.substring(1,this.monthCharacter.length)}}else{for(;l>12;)l=parseInt(l.toString().slice(1),10);if(l>=1){if(a.setMonth(l-1),this.isNavigate=2===l.toString().length,a.getMonth()!==l-1&&(a.setDate(1),a.setMonth(l-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()==c&&m<=c&&a.setDate(m)}this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0}else a.setMonth(0),this.isMonthPart=!1}break;case"y":var v=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10);if(this.isShortYear=!1,isNaN(v))return;for(;v>9999;)v=parseInt(v.toString().slice(1),10);v<1?this.isYearPart=!1:(a.setFullYear(v),4===v.toString().length&&(this.isNavigate=!0),this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isYearPart=!0);break;case"h":if(this.hour=(this.isHourPart&&(a.getHours()%12||12).toString().length<2?10*(a.getHours()%12||12):0)+parseInt(s[e-1],10),isNaN(this.hour))return;for(;this.hour>12;)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(12*Math.floor(a.getHours()/12)+this.hour%12),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0;break;case"H":if(this.hour=(this.isHourPart&&a.getHours().toString().length<2?10*a.getHours():0)+parseInt(s[e-1],10),isNaN(this.hour))return;for(u=0;this.hour>23;u++)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(this.hour),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0;break;case"m":var f=(this.isMinutePart&&a.getMinutes().toString().length<2?10*a.getMinutes():0)+parseInt(s[e-1],10);if(isNaN(f))return;for(u=0;f>59;u++)f=parseInt(f.toString().slice(1),10);a.setMinutes(f),this.isNavigate=2===f.toString().length,this.isMinutePart=!0;break;case"s":var y=(this.isSecondsPart&&a.getSeconds().toString().length<2?10*a.getSeconds():0)+parseInt(s[e-1],10);if(isNaN(y))return;for(u=0;y>59;u++)y=parseInt(y.toString().slice(1),10);a.setSeconds(y),this.isNavigate=2===y.toString().length,this.isSecondsPart=!0;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var g=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(g),u=0;this.periodCharacter.length>0;u++)(0===g[b[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===g[b[1]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()<12)&&(a.setHours((a.getHours()+12)%24),this.value=a),this.periodCharacter=this.periodCharacter.substring(1,this.periodCharacter.length)}this.value=a},e.prototype.formatCheck=function(){function e(e){var i,s,a,n=t.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=t.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=t.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=t.getCulturedValue("months[stand-alone].abbreviated"),p=t.getCulturedValue("months[stand-alone].wide"),c=t.getCulturedValue("dayPeriods.format.wide"),m=Object.keys(c);switch(e){case"ddd":case"dddd":case"d":i=t.isDayPart?t.value.getDate().toString():t.defaultConstant.day.toString();break;case"dd":i=t.isDayPart?t.roundOff(t.value.getDate(),2):t.defaultConstant.day.toString();break;case"E":case"EE":case"EEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?n[r[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?l[o[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?h[u[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"M":i=t.isMonthPart?(t.value.getMonth()+1).toString():t.defaultConstant.month.toString();break;case"MM":i=t.isMonthPart?t.roundOff(t.value.getMonth()+1,2):t.defaultConstant.month.toString();break;case"MMM":i=t.isMonthPart?d[t.value.getMonth()+1]:t.defaultConstant.month.toString();break;case"MMMM":i=t.isMonthPart?p[t.value.getMonth()+1]:t.defaultConstant.month.toString();break;case"yy":i=t.isYearPart?t.roundOff(t.value.getFullYear()%100,2):t.defaultConstant.year.toString(),t.isYearPart&&(t.isNavigate=t.isShortYear=2===(t.value.getFullYear()%100).toString().length);break;case"y":case"yyyy":i=t.isYearPart?t.roundOff(t.value.getFullYear(),4):t.defaultConstant.year.toString();break;case"h":i=t.isHourPart?(t.value.getHours()%12||12).toString():t.defaultConstant.hour.toString();break;case"hh":i=t.isHourPart?t.roundOff(t.value.getHours()%12||12,2):t.defaultConstant.hour.toString();break;case"H":i=t.isHourPart?t.value.getHours().toString():t.defaultConstant.hour.toString();break;case"HH":i=t.isHourPart?t.roundOff(t.value.getHours(),2):t.defaultConstant.hour.toString();break;case"m":i=t.isMinutePart?t.value.getMinutes().toString():t.defaultConstant.minute.toString();break;case"mm":i=t.isMinutePart?t.roundOff(t.value.getMinutes(),2):t.defaultConstant.minute.toString();break;case"s":i=t.isSecondsPart?t.value.getSeconds().toString():t.defaultConstant.second.toString();break;case"ss":i=t.isSecondsPart?t.roundOff(t.value.getSeconds(),2):t.defaultConstant.second.toString();break;case"f":i=Math.floor(t.value.getMilliseconds()/100).toString();break;case"ff":s=t.value.getMilliseconds(),t.value.getMilliseconds()>99&&(s=Math.floor(t.value.getMilliseconds()/10)),i=t.roundOff(s,2);break;case"fff":i=t.roundOff(t.value.getMilliseconds(),3);break;case"a":case"aa":i=t.value.getHours()<12?c[m[0]]:c[m[1]];break;case"z":case"zz":case"zzz":case"zzzz":a={format:e,type:"dateTime",skeleton:"yMd",calendar:t.parent.calendarMode},i=t.parent.globalize.formatDate(t.value,a)}if(i=void 0!==i?i:e.slice(1,e.length-1),t.isHiddenMask){for(var v="",f=0;f<i.length;f++)v+=e[0];return v}return i}var t=this;return e},e.prototype.maskInputHandler=function(){var e,t=this.parent.inputElement.selectionStart;this.previousHiddenMask[t-1];if(this.differenceCheck(),e=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.inputElement.value=e,this.parent.inputElement.selectionStart=t,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var i=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(i)}this.isDeleteKey=!1},e.prototype.navigateSelection=function(e){for(var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=e?t-1:i+1;s<this.hiddenMask.length&&s>=0;){if(this.validCharacters.indexOf(this.hiddenMask[s])>=0){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},e.prototype.roundOff=function(e,t){for(var i=e.toString(),s=t-i.length,a="",n=0;n<s;n++)a+="0";return a+i},e.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":this.isMonthPart=t,t||(this.value.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":this.isHourPart=t,t||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},e.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){i=this.hiddenMask[t];var s=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds());this.previousDate=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds());var a=e?-1:1;switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n=s.getMonth()+a;if(s.setDate(1),s.setMonth(n),this.isDayPart){var r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),l=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();this.previousDate.getDate()==r&&l<=r?s.setDate(l):s.setDate(this.previousDate.getDate())}else s.setDate(this.previousDate.getDate());this.previousDate=new Date(s.getFullYear(),s.getMonth(),s.getDate());break;case"y":s.setFullYear(s.getFullYear()+a);break;case"H":case"h":s.setHours(s.getHours()+a);break;case"m":s.setMinutes(s.getMinutes()+a);break;case"s":s.setSeconds(s.getSeconds()+a);break;case"a":s.setHours((s.getHours()+12)%24)}this.value=s.getFullYear()>0?s:this.value,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},e.prototype.getCulturedValue=function(e){var i=this.parent.locale;return"en"===i||"en-US"===i?t.getValue(e,t.getDefaultDateObject()):t.getValue("main."+i+".dates.calendars.gregorian."+e,t.cldrData)},e.prototype.getCulturedFormat=function(){var e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString();return"datepicker"==this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.format&&this.parent.formatString&&(e=this.parent.formatString)),"datetimepicker"==this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.dateTimeFormat&&(e=this.parent.dateTimeFormat)),"timepicker"==this.parent.moduleName&&(e=this.parent.cldrTimeFormat()),e},e.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue()},e.prototype.updateValue=function(){this.monthCharacter=this.periodCharacter="";var e=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.updateInputValue(e)},e.prototype.destroy=function(){this.removeEventListener()},e}();return f.Inject(y),C.Inject(y,de),Q.Inject(de),ue.Inject(y,de),e.MaskPlaceholder=m,e.CalendarBase=v,e.Calendar=f,e.Islamic=y,e.DatePicker=C,e.Presets=j,e.DateRangePicker=R,e.TimeMaskPlaceholder=$,e.TimePicker=Q,e.DateTimePicker=ue,e.MaskedDateTime=de,e}({},ej.base,ej.popups,ej.inputs,ej.buttons,ej.lists),this.ejs=ej;
- /*!
- * filename: ej2-compression.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.compression=function(t,e){"use strict";var i=new Int16Array(286),r=new Uint8Array(286),n=new Int16Array(30),s=new Uint8Array(30),h=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new o(this,286,257,15),this.treeDistances=new o(this,30,1,15),this.treeCodeLengths=new o(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,i,r){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new e.Encoding(!1);s.type="Utf8",n=i+(t=new Uint8Array(s.getBytes(t,0,t.length))).length}for(this.inputBuffer=t,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=a.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,--this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(t=0;t<this.hashSize;++t){e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(var t=0;t<this.windowSize;t++){var e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,h=Math.max(this.matchLength,2),o=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],d=this.dataWindow;h>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(d[t+h]===u&&d[t+h-1]===f&&d[t]===d[n]&&d[t+1]===d[n+1]){for(e=t+2,n+=2;d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(h=n-this.stringStart)>=r)break;f=d[s-1],u=d[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>o&&0!=--i);return this.matchLength=Math.min(h,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,h,a){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var f=4,u=18;u>f;u--)this.treeCodeLengths.codeLengths[o.huffCodeLengthOrders[u]]>0&&(f=u+1);for(var d=14+3*f+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,c=this.extraBits,u=0;u<286;u++)c+=this.treeLiteral.codeFrequencies[u]*r[u];for(u=0;u<30;u++)c+=this.treeDistances.codeFrequencies[u]*s[u];d>=c&&(d=c),e>=0&&h+4<d>>3?this.huffmanFlushStoredBlock(t,e,h,a):d==c?(this.pendingBufferWriteBits(2+(a?1:0),3),this.treeLiteral.setStaticCodes(i,r),this.treeDistances.setStaticCodes(n,s),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(a?1:0),3),this.huffmanSendAllTrees(f),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[o.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)i[t]=o.bitReverse(48+t<<8),r[t++]=8;for(;t<256;)i[t]=o.bitReverse(256+t<<7),r[t++]=9;for(;t<280;)i[t]=o.bitReverse(-256+t<<9),r[t++]=7;for(;t<286;)i[t]=o.bitReverse(-88+t<<8),r[t++]=8;for(t=0;t<30;t++)n[t]=o.bitReverse(t<<11),s[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),o=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var h=this.codeLength[s];for(0===h?(e=138,i=3):(e=6,i=3,n!==h&&(t.codeFrequency[h]++,r=0)),n=h,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var h=this.codeLength[s];for(0===h?(e=138,i=3):(e=6,i=3,n!==h&&(t.writeCodeToStream(h),r=0)),n=h,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var h=i++,o=0;h>0&&this.codeFrequency[e[o=Math.floor((h-1)/2)]]>s;)e[h]=e[o],h=o;e[h]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),d=0;d<i;d++){var c=e[d],p=2*d;f[p]=c,f[p+1]=-1,u[d]=this.codeFrequency[c]<<8,e[d]=d}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],h=t[--e],o=i[h],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>o;)t[f]=t[a];t[f]=h;var u=t[0];n[2*(h=r++)]=s,n[2*h+1]=u;var d=Math.min(255&i[s],255&i[u]);for(i[h]=o=i[s]+i[u]-d+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>o;)t[f]=t[a];t[f]=h}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var h=2*t[r++];-1===t[h+1]&&(this.codeLength[t[h]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s])(h=r[n]+1)>this.maxLength&&(h=this.maxLength,e++),r[t[s-1]]=r[t[s]]=h;else{var h=r[n];this.lengthCount[h-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),a=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var h=s[0],o=s[0]=65535&h,a=s[0]=h>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=o+=s[0]=255&i[r++];o%=t.checksumBase,a%=t.checksumBase}return h=a<<t.checkSumBitOffset|o},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),f=[],u=function(){function t(){0===f.length&&t.initCrc32Table(),this.files=[],this.level="Normal",e.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof d&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var h=[],o=0,a=0;a<r.files.length;a++)i.getCompressedData(i.files[a]).then(function(i){if(o=r.constructZippedObject(h,i,o,i.isDirectory),h.length===r.files.length){var s=r.writeZippedContent(t,h,o,e);n(s)}})})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof d&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,r){if(t instanceof d){var n=new FileReader;n.onload=function(){var r=new Uint8Array(n.result),s={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:r.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(r,s,f);for(var h=0,o=0;o<s.compressedData.length;o++)h+=s.compressedData[o].length;s.compressedSize=h,s.compressionType="\b\0"}else s.compressedSize=r.length,s.crc32Value=e.calculateCrc32Value(0,r,f),s.compressionType="\0\0",s.compressedData.push(r);i(s)},n.readAsArrayBuffer(t.data)}else i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},t.prototype.compressData=function(t,e,i){var r=new h(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var h=this.writeHeader(e,s),o="PK"+h+e.fileName,a=this.writeCentralDirectory(e,h,i,n);return t.push({localHeader:o,centralDir:a,compressedData:e}),i+o.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,i,r,n){for(var s=0,h=[],o=0;o<i.length;o++){var a=i[o];for(s+=a.centralDir.length,h.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)h.push(a.compressedData.compressedData.shift().buffer)}for(o=0;o<i.length;o++)h.push(this.getArrayBuffer(i[o].centralDir));h.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(h,{type:"application/zip"});return n||e.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;f[e]=t}},t}(),d=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}();return t.ZipArchive=u,t.ZipArchiveItem=d,t.CompressedStreamWriter=h,t.CompressorHuffmanTree=o,t.ChecksumCalculator=a,t}({},ej.fileutils),this.ejs=ej;
- /*!
- * filename: ej2-file-utils.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.fileutils=function(t){"use strict";function e(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: "+e+" cannot be null or undefined")}var n=function(){function t(){}return t.save=function(t,e){if(null===t||void 0===t||""===t)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var n=t.substring(t.lastIndexOf(".")+1,t.length),i=this.getMimeType(n);if(""!==i&&(e=new Blob([e],{type:i})),this.isMicrosoftBrowser)navigator.msSaveBlob(e,t);else{var r=document.createElementNS("http://www.w3.org/1999/xhtml","a");this.saveInternal(t,n,e,r,"download"in r)}},t.saveInternal=function(t,e,n,i,r){if(r){i.download=t;var o=window.URL.createObjectURL(n);i.href=o;var s=document.createEvent("MouseEvent");s.initEvent("click",!0,!0),i.dispatchEvent(s),setTimeout(function(){window.URL.revokeObjectURL(o),o=void 0})}else if("docx"!==e&&"xlsx"!==e){var a=window.URL.createObjectURL(n);window.open(a,"_blank")||(window.location.href=a)}else{var h=new FileReader;h.onloadend=function(){window.open(h.result,"_blank")||(window.location.href=h.result)},h.readAsDataURL(n)}},t.getMimeType=function(t){var e="";switch(t){case"html":e="text/html";break;case"pdf":e="application/pdf";break;case"docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":e="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":e="text/plain"}return e},t}(),i=function(){function t(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new r),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new r),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new r),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new o),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),t.prototype.writeProcessingInstruction=function(t,e){if(void 0===t||null===t||0===t.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(t),void 0!==e&&null!==e||(e=""),3===t.length&&"xml"===t&&"Initial"!==this.currentState)throw new Error("InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it");if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.writeStartDocument(),this.writeProcessingInstructionInternal(t,e)},t.prototype.writeStartDocument=function(t){if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.currentState="StartDocument",this.rawText('<?xml version="1.0" encoding="utf-8'),null!==t&&void 0!==t&&(this.rawText('" standalone="'),this.rawText(t?"yes":"no")),this.rawText('"?>')},t.prototype.writeEndDocument=function(){for(;this.elementStack.length-1>0;)this.writeEndElement();this.currentState="EndDocument",this.flush()},t.prototype.writeStartElement=function(t,e,n){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(void 0===e||null===e||0===e.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(e),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",void 0===t||null===t)void 0!==n&&null!==n&&(t=this.lookupPrefix(n)),void 0!==t&&null!==t||(t="");else if(t.length>0&&(void 0!==n&&null!==n||(n=this.lookupNamespace(t)),void 0===n||null===n||void 0!==n&&0===n.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");void 0!==n&&null!==n||(n=this.lookupNamespace(t)),this.writeStartElementInternal(t,e,n)},t.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var t=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[t].prefix,this.elementStack[t].localName),this.namespaceStack.splice(this.elementStack[t].previousTop+1),this.elementStack.splice(t),this.bufferText.length>10240&&this.flush()},t.prototype.writeElementString=function(t,e,n,i){this.writeStartElement(t,e,n),void 0!==i&&null!==i&&0!==i.length&&this.writeString(i),this.writeEndElement()},t.prototype.writeAttributeString=function(t,e,n,i){this.writeStartAttribute(t,e,n,i),this.writeStringInternal(i,!0),this.writeEndAttribute()},t.prototype.writeString=function(t){this.writeInternal(t,!1)},t.prototype.writeRaw=function(t){this.writeInternal(t,!0)},t.prototype.writeInternal=function(t,e){if(void 0!==t&&null!==t){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",e?this.rawText(t):this.writeStringInternal(t,!1)}},t.prototype.save=function(t){for(;this.elementStack.length-1>0;)this.writeEndElement();""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.destroy=function(){this.bufferBlob=void 0;for(t=0;t<this.namespaceStack.length;t++)this.namespaceStack[t].destroy();this.namespaceStack=[];for(var t=0;t<this.elementStack.length;t++)this.elementStack[t].destroy();this.elementStack=[],this.bufferText="",this.contentPos=0},t.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},t.prototype.writeProcessingInstructionInternal=function(t,e){this.bufferText+="<?",this.rawText(t),e.length>0&&(this.bufferText+=" ",e=e.replace(/\?\>/g,"? >"),this.bufferText+=e),this.bufferText+="?",this.bufferText+=">"},t.prototype.writeStartAttribute=function(t,e,n,i){if(void 0===e||null===e||0===e.length){if("xmlns"!==t)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",t=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(e),this.writeStartAttributePrefixAndNameSpace(t,e,n,i)},t.prototype.writeStartAttributePrefixAndNameSpace=function(t,e,n,i){void 0!==t&&null!==t||(void 0!==n&&null!==n&&("xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n||(t=this.lookupPrefix(n))),void 0!==t&&null!==t||(t="")),void 0!==n&&null!==n||(void 0!==t&&null!==t&&t.length>0&&(n=this.lookupNamespace(t)),void 0!==n&&null!==n||(n="")),this.writeStartAttributeSpecialAttribute(t,e,n,i)},t.prototype.writeStartAttributeSpecialAttribute=function(t,e,n,i){if(0===t.length){if("x"===e[0]&&"xmlns"===e)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit("",i);n.length>0&&(t=this.lookupPrefix(n))}else{if("x"===t[0]){if("xmlns"===t)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit(e,i);if("xml"===t&&("space"===e||"lang"===e))return void this.skipPushAndWrite(t,e,n)}0===n.length&&(t="")}void 0!==t&&null!==t&&0!==t.length&&this.pushNamespaceImplicit(t,n),this.skipPushAndWrite(t,e,n)},t.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},t.prototype.writeStartElementInternal=function(t,e,n){this.bufferText+="<",t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e);var i=this.elementStack.length;this.elementStack.push(new o),this.elementStack[i].set(t,e,n,this.namespaceStack.length-1),this.pushNamespaceImplicit(t,n);for(var r=0;r<this.attributeStack.length;r++)this.attributeStack[r].destroy();this.attributeStack=[]},t.prototype.writeEndElementInternal=function(t,e){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",void 0!==t&&null!==t&&0!==t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},t.prototype.writeStartAttributeInternal=function(t,e,n){this.bufferText+=" ",void 0!==t&&null!==t&&t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+="=",this.bufferText+='"'},t.prototype.writeNamespaceDeclaration=function(t,e){this.writeStartNamespaceDeclaration(t),this.writeStringInternal(e,!0),this.bufferText+='"'},t.prototype.writeStartNamespaceDeclaration=function(t){void 0===t||null===t||0===t.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(t),this.bufferText+="=",this.bufferText+='"')},t.prototype.writeStringInternal=function(t,e){null!==t&&void 0!==t||(t=""),t=(t=(t=t.replace(/\&/g,"&")).replace(/\</g,"<")).replace(/\>/g,">"),e&&(t=t.replace(/\"/g,""")),this.bufferText+=t,e||(this.contentPos=0)},t.prototype.startElementContent=function(){for(var t=this.elementStack[this.elementStack.length-1].previousTop,e=this.namespaceStack.length-1;e>t;e--)"NeedToWrite"===this.namespaceStack[e].kind&&this.writeNamespaceDeclaration(this.namespaceStack[e].prefix,this.namespaceStack[e].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},t.prototype.rawText=function(t){this.bufferText+=t},t.prototype.addNamespace=function(t,e,n){var i=this.namespaceStack.length;this.namespaceStack.push(new r),this.namespaceStack[i].set(t,e,n)},t.prototype.lookupPrefix=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].namespaceUri===t)return this.namespaceStack[e].prefix},t.prototype.lookupNamespace=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return this.namespaceStack[e].namespaceUri},t.prototype.lookupNamespaceIndex=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return e;return-1},t.prototype.pushNamespaceImplicit=function(t,e){var n,i=this.lookupNamespaceIndex(t);if(-1!==i){if(i>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[i].namespaceUri!==e)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[i].kind){if("xml"!==t)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(e!==this.namespaceStack[i].namespaceUri)throw new Error("InvalidArgumentException: Xml String");n="Implied"}else n=this.namespaceStack[i].namespaceUri===e?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===e&&"xml"!==t||"http://www.w3.org/2000/xmlns/"===e&&"xmlns"!==t)throw new Error("InvalidArgumentException");n="NeedToWrite"}this.addNamespace(t,e,n)},t.prototype.pushNamespaceExplicit=function(t,e){var n=this.lookupNamespaceIndex(t);if(-1!==n&&n>this.elementStack[this.elementStack.length-1].previousTop)return void(this.namespaceStack[n].kind="Written");this.addNamespace(t,e,"Written")},t.prototype.addAttribute=function(t,e,n){var i=this.attributeStack.length;this.attributeStack.push(new s),this.attributeStack[i].set(t,e,n);for(var r=0;r<i;r++)if(this.attributeStack[r].isDuplicate(t,e,n))throw new Error("XmlException: duplicate attribute name")},t.prototype.skipPushAndWrite=function(t,e,n){this.addAttribute(t,e,n),this.writeStartAttributeInternal(t,e,n)},t.prototype.checkName=function(t){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(t))throw new Error("InvalidArgumentException: invalid name character")},t}(),r=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=e,this.kind=n},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0},t}(),o=function(){function t(){}return t.prototype.set=function(t,e,n,i){this.previousTop=i,this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0},t}(),s=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.isDuplicate=function(t,e,n){return this.localName===e&&(this.prefix===t||this.namespaceUri===n)},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0},t}(),a=function(){function t(t){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(t)}return Object.defineProperty(t.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.encodingType},set:function(t){this.encodingType=t},enumerable:!0,configurable:!0}),t.prototype.initBOM=function(t){this.emitBOM=void 0===t||null===t||t},t.prototype.getByteCount=function(t){return e(t,"string"),""===t?this.utf8Len(t.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(t,0,t.length))},t.prototype.utf8Len=function(t){return t<=127?1:t<=2047?2:t<=65535?3:t<=2097151?4:0},t.prototype.isHighSurrogate=function(t){return t>=55296&&t<=56319},t.prototype.toCodepoint=function(t,e){return((t=(1023&t)<<10)|1023&e)+65536},t.prototype.getByteCountInternal=function(t,e,n){var i=0;if("Utf8"===this.encodingType||"Unicode"===this.encodingType){for(var r="Utf8"===this.encodingType,o=0;o<n;o++){var s=t.charCodeAt(r?e:e++);if(this.isHighSurrogate(s))if(r){var a=s,h=t.charCodeAt(++e);i+=this.utf8Len(this.toCodepoint(a,h))}else i+=4,++o;else i+=r?this.utf8Len(s):2;r&&e++}return i}return i=n},t.prototype.getBytes=function(t,n,i){if(e(t,"string"),e(n,"charIndex"),e(i,"charCount"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(t.length-n<i)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===t)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var r=this.getByteCountInternal(t,n,i);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(r,t,n,i);case"Unicode":return this.getBytesOfUnicodeEncoding(r,t,n,i);default:return this.getBytesOfAnsiEncoding(r,t,n,i)}},t.prototype.getString=function(t,n,i){if(e(t,"bytes"),e(n,"index"),e(i,"count"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(t.byteLength-n<i)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===t.byteLength||0===i)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var r="",o=new Uint8Array(t);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(o,n,i);case"Unicode":var s=new Uint16Array(t);return r=this.getStringofUnicodeEncoding(s,n,i);default:for(var a=n,h=0;h<i;h++){var c=o[a];r+=String.fromCharCode(c),a++}return r}},t.prototype.getBytesOfAnsiEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=0,a=0;a<i;a++){var h=e.charCodeAt(n++);o[s]=h<2048?h:63,s++}return r},t.prototype.getBytesOfUtf8Encoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=n,a=0,h=0;h<i;h++){var c=e.charCodeAt(s);c<=127?o[a]=c:c<2048?(o[a]=192|c>>6,o[++a]=128|63&c):c<55296||c>=57344?(o[a]=224|c>>12,o[++a]=128|c>>6&63,o[++a]=128|63&c):(o[a]=239,o[++a]=191,o[++a]=189),++a,++s}return r},t.prototype.getBytesOfUnicodeEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint16Array(r),s=0;s<i;s++){var a=e.charCodeAt(s);o[s]=a}return r},t.prototype.getStringOfUtf8Encoding=function(t,e,n){var i=0,r=e,o="";for(i;i<n;i++){for(var s=t[r++];r>t.length;)return o;s>127&&(s>191&&s<224&&r<n?s=(31&s)<<6|63&t[r]:s>223&&s<240&&r<t.byteLength?s=(15&s)<<12|(63&t[r])<<6|63&t[++r]:s>239&&s<248&&r<t.byteLength&&(s=(7&s)<<18|(63&t[r])<<12|(63&t[++r])<<6|63&t[++r]),++r),o+=String.fromCharCode(s)}return o},t.prototype.getStringofUnicodeEncoding=function(t,e,n){if(n>t.length)throw new RangeError("ArgumentOutOfRange_Count");for(var i=new Uint16Array(n),r=0;r<n&&r<t.length;r++)i[r]=t[e++];return String.fromCharCode.apply(null,i)},t.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0},t}(),h=function(){function t(t){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(t),n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),t.prototype.init=function(t){null===t||void 0===t?(this.enc=new a(!1),this.enc.type="Utf8"):(this.enc=t,this.setBomByte())},t.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var t=new ArrayBuffer(2),e=new Uint8Array(t);e[0]=255,e[1]=254,this.bufferBlob=new Blob([t]);break;case"Utf8":var n=new ArrayBuffer(3),i=new Uint8Array(n);i[0]=239,i[1]=187,i[2]=191,this.bufferBlob=new Blob([n]);break;default:this.bufferBlob=new Blob([""])}},t.prototype.save=function(t){""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.write=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText+=t,this.bufferText.length>=10240&&this.flush()},t.prototype.flush=function(){if(void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length){var t=this.encoding.getBytes(this.bufferText,0,this.bufferText.length);this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,t])}},t.prototype.writeLine=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText=this.bufferText+t+"\r\n",this.bufferText.length>=10240&&this.flush()},t.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof a&&this.enc.destroy(),this.enc=void 0},t}();return t.XmlWriter=i,t.Namespace=r,t.XmlElement=o,t.XmlAttribute=s,t.StreamWriter=h,t.Encoding=a,t.validateNullOrUndefined=e,t.Save=n,t}({}),this.ejs=ej;
- /*!
- * filename: ej2-excel-export.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.excelexport=function(e,t,r){"use strict";var o=function(){function e(){this.numFmtId=0,this.backColor="none",this.fontName="Calibri",this.fontSize=10.5,this.fontColor="#000000",this.italic=!1,this.bold=!1,this.underline=!1,this.wrapText=!1,this.hAlign="general",this.vAlign="bottom",this.indent=0,this.rotation=0,this.numberFormat="GENERAL",this.type="datetime",this.borders=new m,this.isGlobalStyle=!1}return e}(),i=function(){function e(){this.sz=10.5,this.name="Calibri",this.u=!1,this.b=!1,this.i=!1,this.color="FF000000"}return e}(),n=function(){function e(){}return e}(),l=function(){function e(){}return e}(),s=function(){function e(){}return e}(),a=function(){function e(){this.name="Normal",this.xfId=0}return e}(),d=function(){function e(e,t){this.numFmtId=e,this.formatCode=t}return e}(),h=function(){function e(e,t){this.lineStyle=e,this.color=t}return e}(),m=function(){function e(){this.left=new h("none","#FFFFFF"),this.right=new h("none","#FFFFFF"),this.top=new h("none","#FFFFFF"),this.bottom=new h("none","#FFFFFF"),this.all=new h("none","#FFFFFF")}return e}(),p=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),u=function(){function e(){}return e}(),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var r=!1,o=0,i=0,n=t;i<n.length;i++)n[i].index===e.index&&(t[o]=e,r=!0),o++;r||t.push(e)},t}return p(t,e),t}(Array),f=function(){function e(){}return e}(),v=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),g=function(){function e(){}return e}(),y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var r=!1,o=0,i=0,n=t;i<n.length;i++)n[i].index===e.index&&(t[o]=e,r=!0),o++;r||t.push(e)},t}return v(t,e),t}(Array),x=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return x(t,e),t}(Array),b=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),F=function(){function e(){this.isSummaryRowBelow=!0,this.showGridLines=!0,this.enableRtl=!1}return e}(),S=function(){function e(){}return e}(),C=function(){function e(){}return e}(),I=function(){function e(){}return e}(),k=function(){function e(){}return e}(),T=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.add=function(e){for(var o=!1,i=0,n=0,l=r;n<l.length;n++){var s=l[n];if(t.isIntersecting(s,e)){var a=new k;a.x=Math.min(s.x,e.x),a.y=Math.min(s.Y,e.y),a.width=Math.max(s.Width+s.X,e.width+e.x),a.height=Math.max(s.Height+s.Y,e.height+e.y),a.ref=r[i].ref.split(":")[0]+":"+e.ref.split(":")[1],r[i]=a,e=a,o=!0}i++}return o||r.push(e),e},r}return b(t,e),t.isIntersecting=function(e,t){return e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height},t}(Array),R=function(){function e(){}return e}(),P=function(){function e(e){this.intl=new r.Internationalization}return e.prototype.getFormatFunction=function(e,t){return e.type?(t&&(e.isServerRendered=!0),this.intl.getDateFormat(e)):this.intl.getNumberFormat(e)},e.prototype.toView=function(e,t){var o=e;return r.isNullOrUndefined(t)||r.isNullOrUndefined(e)||(o=t(e)),o},e.prototype.displayText=function(e,t,r){return this.toView(e,this.getFormatFunction(t,r))},e}(),N=function(){function e(e,t){if(this.csvStr="",this.separator=null===t||void 0===t?",":t,this.formatter=new P,this.isMicrosoftBrowser=!!navigator.msSaveBlob,null!==e.isServerRendered&&void 0!==e.isServerRendered&&(this.isServerRendered=e.isServerRendered),null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var r=0;r<e.styles.length;r++)void 0!==e.styles[r].name&&void 0!==e.styles[r].numberFormat&&this.globalStyles.set(e.styles[r].name,e.styles[r].numberFormat)}null!==e.worksheets&&void 0!==e.worksheets&&this.parseWorksheet(e.worksheets[0])}return e.prototype.parseWorksheet=function(e){null!==e.rows&&void 0!==e.rows&&this.parseRows(e.rows)},e.prototype.parseRows=function(e){for(var t=1,r=0,o=e;r<o.length;r++){var i=o[r];if(null===i.index||void 0===i.index)throw Error("Row index is missing.");for(;t<i.index;)this.csvStr+="\n",t++;this.parseRow(i)}},e.prototype.parseRow=function(e){if(null!==e.cells&&void 0!==e.cells)for(var t=1,r=0,o=e.cells;r<o.length;r++){var i=o[r];if(null===i.index||void 0===i.index)throw Error("Cell index is missing.");for(;t<i.index;)this.csvStr+=this.separator,t++;this.parseCell(i)}},e.prototype.parseCell=function(e){var t=this.csvStr;if(void 0!==e.value)if(e.value instanceof Date)if(void 0!==e.style&&void 0!==e.style.numberFormat)try{t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:e.style.numberFormat},this.isServerRendered))}catch(r){t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",format:e.style.numberFormat},this.isServerRendered))}else if(void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name))try{t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:this.globalStyles.get(e.style.name)},this.isServerRendered))}catch(r){t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",format:this.globalStyles.get(e.style.name)},this.isServerRendered))}else t+=e.value;else"boolean"==typeof e.value?t+=e.value?"TRUE":"FALSE":"number"==typeof e.value?void 0!==e.style&&void 0!==e.style.numberFormat?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:e.style.numberFormat},this.isServerRendered)):void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name)?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:this.globalStyles.get(e.style.name)},this.isServerRendered)):t+=e.value:t+=this.parseCellValue(e.value);this.csvStr=t},e.prototype.parseCellValue=function(e){for(var t="",r=e.length,o=0;o<r;o++)'"'===e[o]?t+=e[o].replace('"','""'):t+=e[o];return e=t,-1!==e.indexOf(this.separator)||-1!==e.indexOf("\n")?e='"'+e+'"':e},e.prototype.save=function(e){if(this.buffer=new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"}),this.isMicrosoftBrowser)navigator.msSaveBlob(this.buffer,e);else{var t=window.URL.createObjectURL(this.buffer),r=document.createElementNS("http://www.w3.org/1999/xhtml","a");r.download=e,r.href=t;var o=document.createEvent("MouseEvent");o.initEvent("click",!0,!0),r.dispatchEvent(o),setTimeout(function(){window.URL.revokeObjectURL(t)})}},e.prototype.saveAsBlob=function(){return new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"})},e}(),A=function(){function e(){this.parts=[]}return e.prototype.append=function(e){this.parts.push(e),this.blob=void 0},e.prototype.getBlob=function(){return new Blob(this.parts,{type:"text/plain"})},e}(),O=function(){function e(){}return e}(),B=function(){function e(e,n,l,s,d){if(this.sharedStringCount=0,this.unitsProportions=[1.28,.32,96,96/25.4,96/2.54,1,96/72,96/72/12700],this.hyperlinkStyle={fontColor:"#0000FF",underline:!0},this.culture=void 0!==l?l:"en-US",this.currency=void 0!==s?s:"USD",this.intl=new r.Internationalization(this.culture),this.mSaveType=n,"xlsx"===n){if(this.mArchive=new t.ZipArchive,this.sharedString=[],this.mFonts=[],this.mBorders=[],this.mStyles=[],this.printTitles=new Map,this.cellStyles=new Map,this.mNumFmt=new Map,this.mFills=new Map,this.mStyles.push(new o),this.mFonts.push(new i),this.cellStyles.set("Normal",new a),this.mCellXfs=[],this.mCellStyleXfs=[],this.drawingCount=0,this.imageCount=0,null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var h=0;h<e.styles.length;h++)if(void 0!==e.styles[h].name){if(this.cellStyles.has(e.styles[h].name))throw Error("Style name "+e.styles[h].name+" is already existed");var m=new o;m.isGlobalStyle=!0,this.parserCellStyle(e.styles[h],m,"none");var p=new a;p.name=m.name,p.xfId=m.index-1,this.cellStyles.set(p.name,p);var u={};void 0!==e.styles[h].numberFormat&&(u.format=e.styles[h].numberFormat),void 0!==e.styles[h].type?u.type=e.styles[h].type:u.type="datetime",void 0!==u.format&&this.globalStyles.set(e.styles[h].name,u)}}if(null===e.worksheets||void 0===e.worksheets)throw Error("Worksheet is expected.");this.parserWorksheets(e.worksheets),null!==e.builtInProperties&&void 0!==e.builtInProperties&&(this.builtInProperties=new D,this.parserBuiltInProperties(e.builtInProperties,this.builtInProperties))}else this.csvHelper=new N(e,d)}return e.prototype.parserBuiltInProperties=function(e,t){null!==e.author&&void 0!==e.author&&(t.author=e.author),null!==e.comments&&void 0!==e.comments&&(t.comments=e.comments),null!==e.category&&void 0!==e.category&&(t.category=e.category),null!==e.company&&void 0!==e.company&&(t.company=e.company),null!==e.manager&&void 0!==e.manager&&(t.manager=e.manager),null!==e.subject&&void 0!==e.subject&&(t.subject=e.subject),null!==e.title&&void 0!==e.title&&(t.title=e.title),null!==e.createdDate&&void 0!==e.createdDate&&(t.createdDate=e.createdDate),null!==e.modifiedDate&&void 0!==e.modifiedDate&&(t.modifiedDate=e.modifiedDate),null!==e.tags&&void 0!==e.tags&&(t.tags=e.tags),null!==e.status&&void 0!==e.status&&(t.status=e.status)},e.prototype.parserWorksheets=function(e){this.worksheets=new w;for(var t=e.length,r=0;r<t;r++){var o=e[r],i=new F;this.mergeCells=new T,this.mergedCellsStyle=new Map,this.mHyperLinks=[],null!==o.name&&void 0!==o.name?i.name=o.name:i.name="Sheet"+(r+1).toString(),null!==o.enableRtl&&void 0!==o.enableRtl&&(i.enableRtl=o.enableRtl),i.index=r+1,null!==o.columns&&void 0!==o.columns&&this.parserColumns(o.columns,i),null!==o.rows&&void 0!==o.rows&&this.parserRows(o.rows,i),null!==o.showGridLines&&void 0!==o.showGridLines&&(i.showGridLines=o.showGridLines),null!==o.freeze&&void 0!==o.freeze&&this.parserFreezePanes(o.freeze,i),null!==o.printTitle&&void 0!==o.printTitle&&this.parserPrintTitle(o.printTitle,i),void 0!==o.pageSetup&&void 0!==o.pageSetup.isSummaryRowBelow&&(i.isSummaryRowBelow=o.pageSetup.isSummaryRowBelow),void 0!==o.images&&this.parserImages(o.images,i),null!==o.autoFilters&&void 0!==o.autoFilters&&this.parseFilters(o.autoFilters,i),i.index=r+1,i.mergeCells=this.mergeCells,i.hyperLinks=this.mHyperLinks,this.worksheets.push(i)}},e.prototype.mergeOptions=function(e,t){var r={};return this.applyProperties(e,r),this.applyProperties(t,r),r},e.prototype.applyProperties=function(e,t){for(var r=Object.keys(e),o=0;o<r.length;o++)"name"!==r[o]&&(t[r[o]]=e[r[o]])},e.prototype.getCellName=function(e,t){return this.getColumnName(t)+e.toString()},e.prototype.getColumnName=function(e){e--;var t="";do{var r=e%26;e=e/26-1,t=String.fromCharCode(65+r)+t}while(e>=0);return t},e.prototype.parserPrintTitle=function(e,t){var r,o="";if(null!==e.fromRow&&void 0!==e.fromRow){r="$"+e.fromRow+":$"+(null!==e.toRow&&void 0!==e.toRow?e.toRow:e.fromRow)}var i;if(null!==e.fromColumn&&void 0!==e.fromColumn){var n=e.fromColumn,l=void 0;l=null!==e.toColumn&&void 0!==e.toColumn?e.toColumn:e.fromColumn,i="$"+this.getColumnName(n)+":$"+this.getColumnName(l)}void 0!==r&&(o+=t.name+"!"+r),void 0!==i&&void 0!==r?o+=","+t.name+"!"+i:void 0!==i&&(o+=t.name+"!"+i),""!==o&&this.printTitles.set(t.index-1,o)},e.prototype.parserFreezePanes=function(e,t){t.freezePanes=new I,null!==e.row&&void 0!==e.row?t.freezePanes.row=e.row:t.freezePanes.row=0,null!==e.column&&void 0!==e.column?t.freezePanes.column=e.column:t.freezePanes.column=0,t.freezePanes.leftCell=this.getCellName(t.freezePanes.row+1,t.freezePanes.column+1)},e.prototype.parserColumns=function(e,t){var r=e.length;t.columns=[];for(var o=0;o<r;o++){var i=new f;if(null===e[o].index||void 0===e[o].index)throw Error("Column index is missing.");i.index=e[o].index,null!==e[o].width&&void 0!==e[o].width&&(i.width=e[o].width),t.columns.push(i)}},e.prototype.parserRows=function(e,t){var r=e.length;t.rows=new y;for(var o=0,i=0;i<r;i++){var n=this.parserRow(e[i],o);o=n.index,t.rows.add(n)}this.insertMergedCellsStyle(t)},e.prototype.insertMergedCellsStyle=function(e){var t=this;this.mergeCells.length>0&&this.mergedCellsStyle.forEach(function(o,i){var n=e.rows.filter(function(e){return e.index===o.y})[0];if(r.isNullOrUndefined(n)){var l=e.rows.filter(function(e){return e.index<=o.y}),s=new g;s.index=o.y,s.cells=new c,s.cells.add(t.createCell(o,i));h=0;l.length>0&&(h=e.rows.indexOf(l[l.length-1])+1),e.rows.splice(h,0,s)}else{var a=n.cells.filter(function(e){return e.index===o.x})[0];if(r.isNullOrUndefined(a)){var d=n.cells.filter(function(e){return e.index<=o.x}),h=0;d.length>0&&(h=n.cells.indexOf(d[d.length-1])+1),n.cells.splice(h,0,t.createCell(o,i))}else a.styleIndex=o.styleIndex}})},e.prototype.createCell=function(e,t){var r=new u;return r.refName=t,r.index=e.x,r.cellStyle=new o,r.styleIndex=e.styleIndex,r},e.prototype.parserRow=function(e,t){var r=new g;if(null!==e.height&&void 0!==e.height&&(r.height=e.height),null===e.index||void 0===e.index)throw Error("Row index is missing.");return r.index=e.index,null!==e.grouping&&void 0!==e.grouping&&this.parseGrouping(e.grouping,r),this.parseCells(e.cells,r),r},e.prototype.parseGrouping=function(e,t){t.grouping=new C,void 0!==e.outlineLevel&&(t.grouping.outlineLevel=e.outlineLevel),void 0!==e.isCollapsed&&(t.grouping.isCollapsed=e.isCollapsed),void 0!==e.isHidden&&(t.grouping.isHidden=e.isHidden)},e.prototype.parseCells=function(e,t){t.cells=new c;for(var r=void 0!==e?e.length:0,i=1,n=1,l=0;l<r;l++){var s=e[l],a=new u;if(null===s.index||void 0===s.index)throw Error("Cell index is missing.");if(a.index=s.index,a.index<i?i=a.index:a.index>n&&(n=a.index),a.refName=this.getCellName(t.index,a.index),null!==s.rowSpan&&void 0!==s.rowSpan?a.rowSpan=s.rowSpan-1:a.rowSpan=0,null!==s.colSpan&&void 0!==s.colSpan?a.colSpan=s.colSpan-1:a.colSpan=0,null!==s.hyperlink&&void 0!==s.hyperlink){var d=new S;void 0!==s.hyperlink.target&&(d.target=s.hyperlink.target,void 0!==s.hyperlink.displayText?a.value=s.hyperlink.displayText:a.value=s.hyperlink.target,a.type=this.getCellValueType(a.value),d.ref=a.refName,d.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(d),a.cellStyle=new o,this.parserCellStyle(void 0!==s.style?this.mergeOptions(s.style,this.hyperlinkStyle):this.hyperlinkStyle,a.cellStyle,"string"),a.styleIndex=a.cellStyle.index)}null!==s.formula&&void 0!==s.formula&&(a.formula=s.formula,a.type="formula"),null!==s.value&&void 0!==s.value&&(void 0!==a.formula?a.value=0:(a.value=s.value,a.type=this.getCellValueType(a.value))),null!==s.style&&void 0!==s.style&&void 0===a.styleIndex?(a.cellStyle=new o,a.value instanceof Date?this.parserCellStyle(s.style,a.cellStyle,a.type,14):this.parserCellStyle(s.style,a.cellStyle,a.type),a.styleIndex=a.cellStyle.index):a.value instanceof Date&&(a.cellStyle=new o,this.parserCellStyle({},a.cellStyle,a.type,14),a.styleIndex=a.cellStyle.index),this.parseCellType(a),this.mergeCells=this.processMergeCells(a,t.index,this.mergeCells),t.cells.add(a)}t.spans=i+":"+n},e.prototype.GetColors=function(){var e;return(e=new Map).set("WHITE","FFFFFFFF"),e.set("SILVER","FFC0C0C0"),e.set("GRAY","FF808080"),e.set("BLACK","FF000000"),e.set("RED","FFFF0000"),e.set("MAROON","FF800000"),e.set("YELLOW","FFFFFF00"),e.set("OLIVE","FF808000"),e.set("LIME","FF00FF00"),e.set("GREEN","FF008000"),e.set("AQUA","FF00FFFF"),e.set("TEAL","FF008080"),e.set("BLUE","FF0000FF"),e.set("NAVY","FF000080"),e.set("FUCHSIA","FFFF00FF"),e.set("PURPLE","FF800080"),e},e.prototype.processColor=function(e){return 0===e.indexOf("#")?e.replace("#","FF"):(e=e.toUpperCase(),this.rgbColors=this.GetColors(),e=this.rgbColors.has(e)?this.rgbColors.get(e):"FF000000")},e.prototype.processCellValue=function(e,t){var r=e;if(-1!==e.indexOf("<font")||-1!==e.indexOf("<a")||-1!==e.indexOf("<b>")||-1!==e.indexOf("<i>")||-1!==e.indexOf("<u>")){var o="",i=e.indexOf("<",0),n=e.indexOf(">",i+1);if(i>=0&&n>=0){for(0!==i&&(o+='<r><t xml:space="preserve">'+e.substring(0,i)+"</t></r>");i>=0&&n>=0;)if((n=e.indexOf(">",i+1))>=0){var l=e.substring(i+1,n);(i=e.indexOf("<",n+1))<0&&(i=r.length);var s=r.substring(n+1,i);if(0!==s.length){var a=l.split(" ");if(a.length>0&&(o+="<r><rPr>"),a.length>1)for(var d=0,h=a;d<h.length;d++){var m=h[d];switch(m.trim().substring(0,5)){case"size=":o+='<sz val="'+m.substring(6,m.length-1)+'"/>';break;case"face=":o+='<rFont val="'+m.substring(6,m.length-1)+'"/>';break;case"color":o+='<color rgb="'+this.processColor(m.substring(7,m.length-1))+'"/>';break;case"href=":var p=new S;p.target=m.substring(6,m.length-1).trim(),p.ref=t.refName,p.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(p),o+='<color rgb="FF0000FF"/><u/><b/>'}}else if(1===a.length)switch(a[0].trim()){case"b":o+="<b/>";break;case"i":o+="<i/>";break;case"u":o+="<u/>"}o+='</rPr><t xml:space="preserve">'+s+"</t></r>"}}return""===o?r:o}return r}return r},e.prototype.applyGlobalStyle=function(e,t){this.cellStyles.has(e.name)&&(t.index=this.mStyles.filter(function(t){return t.name===e.name})[0].index,t.name=e.name)},e.prototype.parserCellStyle=function(e,t,r,o){if(null!==e.name&&void 0!==e.name){if(!t.isGlobalStyle)return void this.applyGlobalStyle(e,t);t.name=e.name}null!==e.backColor&&void 0!==e.backColor&&(t.backColor=e.backColor),t.borders=new m,null!==e.borders&&void 0!==e.borders&&this.parserBorder(e.borders,t.borders.all),null!==e.leftBorder&&void 0!==e.leftBorder&&this.parserBorder(e.leftBorder,t.borders.left),null!==e.rightBorder&&void 0!==e.rightBorder&&this.parserBorder(e.rightBorder,t.borders.right),null!==e.topBorder&&void 0!==e.topBorder&&this.parserBorder(e.topBorder,t.borders.top),null!==e.bottomBorder&&void 0!==e.bottomBorder&&this.parserBorder(e.bottomBorder,t.borders.bottom),null!==e.fontName&&void 0!==e.fontName&&(t.fontName=e.fontName),null!==e.fontSize&&void 0!==e.fontSize&&(t.fontSize=e.fontSize),null!==e.fontColor&&void 0!==e.fontColor&&(t.fontColor=e.fontColor),null!==e.italic&&void 0!==e.italic&&(t.italic=e.italic),null!==e.bold&&void 0!==e.bold&&(t.bold=e.bold),null!==e.hAlign&&void 0!==e.hAlign&&(t.hAlign=e.hAlign.toLowerCase()),null!==e.indent&&void 0!==e.indent&&(t.indent=e.indent,"left"!==t.hAlign&&"right"!==t.hAlign&&(t.hAlign="left")),null!==e.rotation&&void 0!==e.rotation&&(t.rotation=e.rotation),null!==e.vAlign&&void 0!==e.vAlign&&(t.vAlign=e.vAlign.toLowerCase()),null!==e.underline&&void 0!==e.underline&&(t.underline=e.underline),null!==e.wrapText&&void 0!==e.wrapText&&(t.wrapText=e.wrapText),null!==e.numberFormat&&void 0!==e.numberFormat?null!==e.type&&void 0!==e.type?t.numberFormat=this.getNumberFormat(e.numberFormat,e.type):t.numberFormat=this.getNumberFormat(e.numberFormat,r):void 0!==o?(t.numFmtId=14,t.numberFormat="GENERAL"):t.numberFormat="GENERAL",t.index=this.processCellStyle(t)},e.prototype.switchNumberFormat=function(e,t){var r=this.getNumberFormat(e,t);if(r!==e){var o=this.mNumFmt.get(e);if(void 0!==o&&(o.formatCode=r,this.mNumFmt.has(r))){for(var i=0,n=this.mCellStyleXfs;i<n.length;i++){var l=n[i];l.numFmtId===o.numFmtId&&(l.numFmtId=this.mNumFmt.get(r).numFmtId)}for(var s=0,a=this.mCellXfs;s<a.length;s++){var d=a[s];d.numFmtId===o.numFmtId&&(d.numFmtId=this.mNumFmt.get(r).numFmtId)}}}},e.prototype.getNumberFormat=function(e,t){var r;switch(t){case"number":try{r=this.intl.getNumberPattern({format:e,currency:this.currency,useGrouping:!0},!0)}catch(t){r=e}break;case"datetime":try{r=this.intl.getDatePattern({skeleton:e,type:"dateTime"},!0)}catch(t){try{r=this.intl.getDatePattern({format:e,type:"dateTime"},!0)}catch(t){r=e}}break;case"date":try{r=this.intl.getDatePattern({skeleton:e,type:"date"},!0)}catch(t){try{r=this.intl.getDatePattern({format:e,type:"date"},!0)}catch(t){r=e}}break;case"time":try{r=this.intl.getDatePattern({skeleton:e,type:"time"},!0)}catch(t){try{r=this.intl.getDatePattern({format:e,type:"time"},!0)}catch(t){r=e}}break;default:r=e}return r},e.prototype.parserBorder=function(e,t){null!==e.color&&void 0!==e.color?t.color=e.color:t.color="#000000",null!==e.lineStyle&&void 0!==e.lineStyle?t.lineStyle=e.lineStyle:t.lineStyle="thin"},e.prototype.processCellStyle=function(e){if(e.isGlobalStyle)return this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length;var t=this.compareStyle(e);return t.result?t.index:(this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length)},e.prototype.processNumFormatId=function(e){if("GENERAL"!==e.numberFormat&&!this.mNumFmt.has(e.numberFormat)){var t=this.mNumFmt.size+164;this.mNumFmt.set(e.numberFormat,new d(t,e.numberFormat))}},e.prototype.isNewFont=function(e){for(var t=!1,r=0,o=0,i=this.mFonts;o<i.length;o++){var n=i[o];r++;var l=void 0;if(void 0!==e.fontColor&&(l="FF"+e.fontColor.replace("#","")),t=n.color===l&&n.b===e.bold&&n.i===e.italic&&n.u===e.underline&&n.name===e.fontName&&n.sz===e.fontSize)break}return r-=1,{index:r,result:t}},e.prototype.isNewBorder=function(e){var t=new o;return this.isAllBorder(e.borders)?t.borders.all.color===e.borders.all.color&&t.borders.all.lineStyle===e.borders.all.lineStyle:t.borders.left.color===e.borders.left.color&&t.borders.left.lineStyle===e.borders.left.lineStyle&&t.borders.right.color===e.borders.right.color&&t.borders.right.lineStyle===e.borders.right.lineStyle&&t.borders.top.color===e.borders.top.color&&t.borders.top.lineStyle===e.borders.top.lineStyle&&t.borders.bottom.color===e.borders.bottom.color&&t.borders.bottom.lineStyle===e.borders.bottom.lineStyle},e.prototype.isAllBorder=function(e){var t=new o;return t.borders.all.color!==e.all.color&&t.borders.all.lineStyle!==e.all.lineStyle},e.prototype.compareStyle=function(e){for(var t=!0,r=0,o=0,i=this.mStyles;o<i.length;o++){var n=i[o];if(t=!n.isGlobalStyle&&(n.backColor===e.backColor&&n.bold===e.bold&&n.numFmtId===e.numFmtId&&n.numberFormat===e.numberFormat&&n.type===e.type&&n.fontColor===e.fontColor&&n.fontName===e.fontName&&n.fontSize===e.fontSize&&n.hAlign===e.hAlign&&n.italic===e.italic&&n.underline===e.underline&&n.vAlign===e.vAlign&&n.indent===e.indent&&n.rotation===e.rotation&&n.wrapText===e.wrapText&&n.borders.all.color===e.borders.all.color&&n.borders.all.lineStyle===e.borders.all.lineStyle&&n.borders.left.color===e.borders.left.color&&n.borders.left.lineStyle===e.borders.left.lineStyle&&n.borders.right.color===e.borders.right.color&&n.borders.right.lineStyle===e.borders.right.lineStyle&&n.borders.top.color===e.borders.top.color&&n.borders.top.lineStyle===e.borders.top.lineStyle&&n.borders.bottom.color===e.borders.bottom.color&&n.borders.bottom.lineStyle===e.borders.bottom.lineStyle)){r=n.index;break}}return{index:r,result:t}},e.prototype.contains=function(e,t){var r=e.indexOf(t);return r>-1&&r<e.length},e.prototype.getCellValueType=function(e){return e instanceof Date?"datetime":"boolean"==typeof e?"boolean":"number"==typeof e?"number":"string"},e.prototype.parseCellType=function(e){var t,r=e.type,o=e.value;switch(r){case"datetime":if(o=this.toOADate(o),void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)){var i=this.globalStyles.get(e.cellStyle.name);this.switchNumberFormat(i.format,i.type)}t="n";break;case"boolean":o=o?1:0,t="b";break;case"number":t="n",void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)&&this.switchNumberFormat(this.globalStyles.get(e.cellStyle.name).format,"number");break;case"string":this.sharedStringCount++,t="s";var n=this.processCellValue(o,e);this.contains(this.sharedString,n)||this.sharedString.push(n),o=this.sharedString.indexOf(n)}e.saveType=t,e.value=o},e.prototype.parserImages=function(e,t){var r=e.length;t.images=[];for(var o=0;o<r;o++){var i=this.parserImage(e[o]);t.images.push(i)}},e.prototype.parseFilters=function(e,t){if(t.autoFilters=new O,null===e.row||void 0===e.row)throw new Error("Argument Null Exception: row null or empty");if(t.autoFilters.row=e.row,null===e.lastRow||void 0===e.lastRow)throw new Error("Argument Null Exception: lastRow cannot be null or empty");if(t.autoFilters.lastRow=e.lastRow,null===e.column||void 0===e.column)throw new Error("Argument Null Exception: column cannot be null or empty");if(t.autoFilters.column=e.column,null===e.lastColumn||void 0===e.row)throw new Error("Argument Null Exception: lastColumn cannot be null or empty");t.autoFilters.lastColumn=e.lastColumn},e.prototype.parserImage=function(e){var t=new R;return null!==e.image&&void 0!==e.image&&(t.image=e.image),null!==e.row&&void 0!==e.row&&(t.row=e.row),null!==e.column&&void 0!==e.column&&(t.column=e.column),null!==e.lastRow&&void 0!==e.lastRow&&(t.lastRow=e.lastRow),null!==e.lastColumn&&void 0!==e.lastColumn&&(t.lastColumn=e.lastColumn),null!==e.width&&void 0!==e.width&&(t.width=e.width),null!==e.height&&void 0!==e.height&&(t.height=e.height),null!==e.horizontalFlip&&void 0!==e.horizontalFlip&&(t.horizontalFlip=e.horizontalFlip),null!==e.verticalFlip&&void 0!==e.verticalFlip&&(t.verticalFlip=e.verticalFlip),null!==e.rotation&&void 0!==e.rotation&&(t.rotation=e.rotation),t},e.prototype.saveAsBlob=function(e){var t=this;switch(e){case"text/csv":return new Promise(function(e,r){var o={};o.blobData=t.csvHelper.saveAsBlob(),e(o)});default:return new Promise(function(e,r){t.saveInternal(),t.mArchive.saveAsBlob().then(function(t){var r={};r.blobData=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),e(r)})})}},e.prototype.save=function(e,t){var r=this;if(null===e||void 0===e||""===e)throw new Error("Argument Null Exception: fileName cannot be null or empty");var o=e.match(".xlsx$"),i=e.match(".csv$");if(null!==o&&o[0]==="."+this.mSaveType)this.saveInternal(),this.mArchive.save(e).then(function(){r.mArchive.destroy()});else{if(null===i||i[0]!=="."+this.mSaveType)throw Error("Save type and file extension is different.");this.csvHelper.save(e)}},e.prototype.saveInternal=function(){this.saveWorkbook(),this.saveWorksheets(),this.saveSharedString(),this.saveStyles(),this.saveApp(this.builtInProperties),this.saveCore(this.builtInProperties),this.saveContentType(),this.saveTopLevelRelation(),this.saveWorkbookRelation()},e.prototype.saveWorkbook=function(){for(var e='<?xml version="1.0" encoding="utf-8"?><workbook xmlns:r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns= "http://schemas.openxmlformats.org/spreadsheetml/2006/main"><workbookPr codeName="ThisWorkbook" defaultThemeVersion= "153222"/><bookViews><workbookView activeTab="0"/></bookViews>',t="<sheets>",r=this.worksheets.length,o=0;o<r;o++)t+='<sheet name="'+this.worksheets[o].name+'" sheetId="'+(o+1).toString()+'" r:id ="rId'+(o+1).toString()+'" />';if(t+="</sheets>",e+=t,this.printTitles.size>0){var i="<definedNames>";this.printTitles.forEach(function(e,t){i+='<definedName name="_xlnm.Print_Titles" localSheetId="'+t+'">'+e+"</definedName>"}),e+=i+="</definedNames>"}this.addToArchive(e+"</workbook>","xl/workbook.xml")},e.prototype.saveWorksheets=function(){for(var e=this.worksheets.length,t=0;t<e;t++)this.saveWorksheet(this.worksheets[t],t)},e.prototype.saveWorksheet=function(e,t){var o=new A,i='<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';if(e.isSummaryRowBelow?i+="<sheetPr />":i+='<sheetPr><outlinePr summaryBelow="0" ></outlinePr></sheetPr>',i+=this.saveSheetView(e),void 0!==e.columns){for(var n="<cols>",l=0,s=e.columns;l<s.length;l++){var a=s[l];void 0!==a.width?n+='<col min="'+a.index+'" max="'+a.index+'" width="'+this.pixelsToColumnWidth(a.width)+'" customWidth="1" />':n+='<col min="'+a.index+'" max="'+a.index+'" width="8.43" customWidth="1" />'}i+=n+"</cols>"}if(i+="<sheetData>",o.append(i),i="",void 0!==e.rows)for(var d=0,h=e.rows;d<h.length;d++){var m=h[d],p='<row r="'+m.index+'" ';r.isNullOrUndefined(m.spans)||(p+='spans="'+m.spans+'" '),void 0!==m.height&&(p+='ht="'+this.pixelsToRowHeight(m.height)+'" customHeight="1" '),void 0!==m.grouping&&(m.grouping.isHidden&&(p+='hidden="1" '),void 0!==m.grouping.outlineLevel&&(p+='outlineLevel="'+m.grouping.outlineLevel+'" '),m.grouping.isCollapsed&&(p+='collapsed="1" ')),p+=">";for(var u=0,c=m.cells;u<c.length;u++){var f=c[u];void 0===f||void 0===f.value&&void 0===f.cellStyle||(p+='<c r="'+f.refName+'" ',void 0!==f.saveType&&(p+='t="'+f.saveType+'" '),void 0!==f.styleIndex&&(p+='s="'+f.styleIndex+'" '),p+=" >",void 0!==f.formula&&(p+="<f>"+f.formula+"</f>"),void 0!==f.value?p+="<v>"+f.value+"</v></c>":p+="</c>")}p+="</row>",o.append(p)}if(i+="</sheetData>",null!==e.autoFilters&&void 0!==e.autoFilters&&(i+='<autoFilter ref="'+this.getCellName(e.autoFilters.row,e.autoFilters.column)+":"+this.getCellName(e.autoFilters.lastRow,e.autoFilters.lastColumn)+'"/>'),e.mergeCells.length>0){i+='<mergeCells count="'+e.mergeCells.length+'">';for(var v=0,g=e.mergeCells;v<g.length;v++)i+='<mergeCell ref="'+g[v].ref+'" />';i+="</mergeCells>"}if(e.hyperLinks.length>0){i+="<hyperlinks>";for(var y=0,x=e.hyperLinks;y<x.length;y++){var w=x[y];i+='<hyperlink ref="'+w.ref+'" r:id="rId'+w.rId+'" />'}i+="</hyperlinks>"}i+='<pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><headerFooter scaleWithDoc="1" alignWithMargins="0" differentFirst="0" differentOddEven="0" />',void 0!=e.images&&e.images.length>0&&(this.drawingCount++,this.saveDrawings(e,e.index),i+='<drawing r:id="rId'+(e.hyperLinks.length+1)+'"/>'),this.addToArchive(this.saveSheetRelations(e),"xl/worksheets/_rels/sheet"+e.index+".xml.rels"),o.append(i+"</worksheet>"),this.addToArchive(o.getBlob(),"xl/worksheets/sheet"+(t+1)+".xml")},e.prototype.saveDrawings=function(e,t){var r=new A,o='<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">';if(void 0!==e.images){for(var i=0,n=0,l=e.images;n<l.length;n++){var s=l[n];void 0!==s.height&&void 0!==s.width?(this.updatelastRowOffset(e,s),this.updatelastColumnOffSet(e,s)):void 0!==s.lastRow&&void 0!==s.lastColumn&&(s.lastRowOffset=0,s.lastColOffset=0),i++,o+='<xdr:twoCellAnchor editAs="oneCell">',o+="<xdr:from><xdr:col>",o+=s.column-1,o+="</xdr:col><xdr:colOff>",o+=0,o+="</xdr:colOff><xdr:row>",o+=s.row-1,o+="</xdr:row><xdr:rowOff>",o+=0,o+="</xdr:rowOff></xdr:from>",o+="<xdr:to><xdr:col>",o+=s.lastColumn,o+="</xdr:col><xdr:colOff>",o+=s.lastColOffset,o+="</xdr:colOff><xdr:row>",o+=s.lastRow,o+="</xdr:row><xdr:rowOff>",o+=s.lastRowOffset,o+="</xdr:rowOff></xdr:to>",o+="<xdr:pic>",o+="<xdr:nvPicPr>",o+='<xdr:cNvPr id="'+i+'" name="Picture '+i+'"> </xdr:cNvPr>',o+='<xdr:cNvPicPr><a:picLocks noChangeAspect="1"/></xdr:cNvPicPr> </xdr:nvPicPr>',o+="<xdr:blipFill>",o+='<a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+i+'" cstate="print">',o+="</a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill>",o+="<xdr:spPr>",o+="<a:xfrm",void 0!=s.rotation&&s.rotation<=3600&&s.rotation>=-3600&&(o+=' rot="'+6e4*s.rotation+'"'),void 0!=s.verticalFlip&&0!=s.verticalFlip&&(o+=' flipV="1"'),void 0!=s.horizontalFlip&&0!=s.horizontalFlip&&(o+=' flipH="1"'),o+="/>",o+='<a:prstGeom prst="rect"><a:avLst /></a:prstGeom></xdr:spPr>',o+="</xdr:pic><xdr:clientData /></xdr:twoCellAnchor>";var a=this.convertBase64toImage(s.image);this.imageCount+=1,this.addToArchive(a,"xl/media/image"+this.imageCount+".png")}r.append(o),r.append("</xdr:wsDr>"),this.saveDrawingRelations(e),this.addToArchive(r.getBlob(),"xl/drawings/drawing"+this.drawingCount+".xml")}},e.prototype.updatelastRowOffset=function(e,t){for(var r=t.height,o=t.row,i=0;r>=0;){var n=0,l=(n=void 0!==e.rows&&void 0!==e.rows[o-1]?this.convertToPixels(void 0===e.rows[o-1].height?15:e.rows[o-1].height):this.convertToPixels(15))-i*n/256;if(l>r){t.lastRow=o,t.lastRowOffset=i+256*r/n;var s=0;s=void 0!==e.rows&&void 0!==e.rows[o-1]?this.convertToPixels(void 0===e.rows[o-1].height?15:e.rows[o-1].height):this.convertToPixels(15),t.lastRowOffset=s*t.lastRowOffset/256,t.lastRowOffset=Math.round(t.lastRowOffset/this.unitsProportions[7]);break}r-=l,o++,i=0}},e.prototype.updatelastColumnOffSet=function(e,t){for(var r=t.width,o=t.column,i=0;r>=0;){var n=0,l=(n=void 0!==e.columns&&void 0!==e.columns[o-1]?this.ColumnWidthToPixels(void 0===e.columns[o-1].width?8.43:e.columns[o-1].width):this.ColumnWidthToPixels(8.43))-i*n/1024;if(l>r){t.lastColumn=o,t.lastColOffset=i+1024*r/n;var s=0;s=void 0!==e.columns&&void 0!==e.columns[o-1]?this.ColumnWidthToPixels(void 0===e.columns[o-1].width?8.43:e.columns[o].width):this.ColumnWidthToPixels(8.43),t.lastColOffset=s*t.lastColOffset/1024,t.lastColOffset=Math.round(t.lastColOffset/this.unitsProportions[7]);break}r-=l,o++,i=0}},e.prototype.convertToPixels=function(e){return e*this.unitsProportions[6]},e.prototype.convertBase64toImage=function(e){for(var t=window.atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r),i=0;i<t.length;i++)o[i]=t.charCodeAt(i);return new Blob([o],{type:"image/png"})},e.prototype.saveDrawingRelations=function(e){for(var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',r=e.images.length,o=this.imageCount-e.images.length,i=1;i<=r;i++)t+='<Relationship Id="rId'+i+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image'+ ++o+'.png" />';this.addToArchive(t+"</Relationships>","xl/drawings/_rels/drawing"+this.drawingCount+".xml.rels")},e.prototype.pixelsToColumnWidth=function(e){var t=e>12?this.trunc((e-5)/7*100+.5)/100:e/12;return t>1?(7*t+5)/7*256/256:12*t/7*256/256},e.prototype.ColumnWidthToPixels=function(e){var t=e>1?(7*e+5)/7*256/256:12*e/7*256/256;return this.trunc((256*t+this.trunc(128/7))/256*7)},e.prototype.trunc=function(e){var t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t},e.prototype.pixelsToRowHeight=function(e){return e*this.unitsProportions[5]/this.unitsProportions[6]},e.prototype.saveSheetRelations=function(e){for(var t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',r=0,o=e.hyperLinks;r<o.length;r++){var i=o[r];t+='<Relationship Id="rId'+i.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+i.target+'" TargetMode="External" />'}return void 0!=e.images&&e.images.length>0&&(t+='<Relationship Id="rId'+(e.hyperLinks.length+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing'+this.drawingCount+'.xml" />'),t+="</Relationships>"},e.prototype.saveSheetView=function(e){var t='<sheetViews><sheetView workbookViewId="0" ';return!0===e.enableRtl&&(t+='rightToLeft="1"'),!1===e.showGridLines?t+='showGridLines="0" >':t+=">",void 0!==e.freezePanes&&(t+='<pane state="frozen" topLeftCell="'+e.freezePanes.leftCell+'" ',0!==e.freezePanes.row&&(t+='ySplit="'+e.freezePanes.row+'" '),0!==e.freezePanes.column&&(t+='xSplit="'+e.freezePanes.column+'" '),t+="/>"),t+="</sheetView></sheetViews > "},e.prototype.saveSharedString=function(){var e=this.sharedString.length;if(e>0){for(var t='<?xml version="1.0" encoding="utf-8"?><sst uniqueCount="'+e+'" count="'+this.sharedStringCount+'" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',r="",o=0;o<e;o++)0!==this.sharedString[o].indexOf("<r>")?(r+="<si><t>",r+=this.processString(this.sharedString[o]),r+="</t></si>"):(r+="<si>",r+=this.sharedString[o],r+="</si>");r+="</sst>",this.addToArchive(t+r,"xl/sharedStrings.xml")}},e.prototype.processString=function(e){return-1!==e.indexOf("&")&&(e=e.replace(/&/g,"&")),-1!==e.indexOf("<")&&(e=e.replace(/</g,"<")),-1!==e.indexOf(">")&&(e=e.replace(/>/g,">")),e},e.prototype.saveStyles=function(){this.updateCellXfsStyleXfs();var e='<?xml version="1.0" encoding="utf-8"?><styleSheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';e+=this.saveNumberFormats(),e+=this.saveFonts(),e+=this.saveFills(),e+=this.saveBorders(),e+=this.saveCellStyleXfs(),e+=this.saveCellXfs(),e+=this.saveCellStyles(),this.addToArchive(e+"</styleSheet>","xl/styles.xml")},e.prototype.updateCellXfsStyleXfs=function(){for(var e=0,t=this.mStyles;e<t.length;e++){var r=t[e],o=void 0;r.isGlobalStyle?(o=new s).xfId=r.index-1:(o=new n).xfId=0;var a=this.isNewFont(r);if(a.result)o.fontId=a.index;else{var h=new i;h.b=r.bold,h.i=r.italic,h.name=r.fontName,h.sz=r.fontSize,h.u=r.underline,h.color="FF"+r.fontColor.replace("#",""),this.mFonts.push(h),o.fontId=this.mFonts.length-1}if("none"!==r.backColor){var m="FF"+r.backColor.replace("#","");if(this.mFills.has(m)){p=this.mFills.get(m);o.fillId=p}else{var p=this.mFills.size+2;this.mFills.set(m,p),o.fillId=p}}else o.fillId=0;if(this.isNewBorder(r)?o.borderId=0:(this.mBorders.push(r.borders),o.borderId=this.mBorders.length),"GENERAL"!==r.numberFormat)if(this.mNumFmt.has(r.numberFormat)){var u=this.mNumFmt.get(r.numberFormat);o.numFmtId=u.numFmtId}else{var c=this.mNumFmt.size+164;this.mNumFmt.set(r.numberFormat,new d(c,r.numberFormat)),o.numFmtId=c}else"GENERAL"===r.numberFormat&&14===r.numFmtId?o.numFmtId=14:o.numFmtId=0;r.isGlobalStyle||(o.applyAlignment=1),o.alignment=new l,o.alignment.indent=r.indent,o.alignment.horizontal=r.hAlign,o.alignment.vertical=r.vAlign,o.alignment.wrapText=r.wrapText?1:0,o.alignment.rotation=r.rotation,r.isGlobalStyle?(this.mCellStyleXfs.push(o),this.mCellXfs.push(o)):this.mCellXfs.push(o)}},e.prototype.saveNumberFormats=function(){if(this.mNumFmt.size>=1){var e='<numFmts count="'+this.mNumFmt.size+'">';return this.mNumFmt.forEach(function(t,r){e+='<numFmt numFmtId="'+t.numFmtId+'" formatCode="'+t.formatCode.replace(/"/g,""")+'" />'}),e+="</numFmts>"}return""},e.prototype.saveFonts=function(){var e='<fonts count="'+this.mFonts.length+'">';if(this.mFonts.length>=1)for(var t=0,r=this.mFonts;t<r.length;t++){var o=r[t];e+="<font>",o.b&&(e+="<b />"),o.i&&(e+="<i />"),o.u&&(e+="<u />"),e+='<sz val="'+o.sz+'" />',e+='<color rgb="'+o.color+'" />',e+='<name val="'+o.name+'" /></font>'}return e+"</fonts>"},e.prototype.saveFills=function(){var e='<fills count="'+(this.mFills.size+2)+'"><fill><patternFill patternType="none"></patternFill></fill><fill><patternFill patternType="gray125"></patternFill></fill>';return this.mFills.size>=1&&this.mFills.forEach(function(t,r){e+='<fill><patternFill patternType="solid"><fgColor rgb="'+r+'" /><bgColor rgb="FFFFFFFF" /></patternFill></fill>'}),e+"</fills>"},e.prototype.saveBorders=function(){var e='<borders count="'+(this.mBorders.length+1)+'"><border><left /><right /><top /><bottom /><diagonal /></border>';if(this.mBorders.length>=1)for(var t=0,r=this.mBorders;t<r.length;t++){var o=r[t];if(this.isAllBorder(o)){var i=o.all.color.replace("#",""),n=o.all.lineStyle;e+='<border><left style="'+n+'"><color rgb="FF'+i+'" /></left><right style="'+n+'"><color rgb="FF'+i+'" /></right><top style="'+n+'"><color rgb="FF'+i+'" /></top><bottom style="'+n+'"><color rgb="FF'+i+'" /></bottom></border>'}else e+='<border><left style="'+o.left.lineStyle+'"><color rgb="FF'+o.left.color.replace("#","")+'" /></left><right style="'+o.right.lineStyle+'"><color rgb="FF'+o.right.color.replace("#","")+'" /></right><top style="'+o.top.lineStyle+'"><color rgb="FF'+o.top.color.replace("#","")+'" /></top><bottom style="'+o.bottom.lineStyle+'"><color rgb="FF'+o.bottom.color.replace("#","")+'" /></bottom></border>'}return e+"</borders>"},e.prototype.saveCellStyles=function(){var e=this,t='<cellStyles count="'+this.cellStyles.size+'">';return this.cellStyles.forEach(function(r,o){t+='<cellStyle name="'+o+'" xfId="'+e.cellStyles.get(o).xfId+'"',"Normal"===o&&(t+=' builtinId="0"'),t+=" />"}),t+="</cellStyles>"},e.prototype.saveCellStyleXfs=function(){var e='<cellStyleXfs count="'+(this.mCellStyleXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" />';if(this.mCellStyleXfs.length>=1)for(var t=0,r=this.mCellStyleXfs;t<r.length;t++){var o=r[t];e+='<xf numFmtId="'+o.numFmtId+'" fontId="'+o.fontId+'" fillId="'+o.fillId+'" borderId="'+o.borderId+'" ',void 0!==o.alignment?e+=">"+this.saveAlignment(o)+"</xf>":e+=" />"}return e+"</cellStyleXfs>"},e.prototype.saveCellXfs=function(){var e='<cellXfs count="'+(this.mCellXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />';if(this.mCellXfs.length>=1)for(var t=0,r=this.mCellXfs;t<r.length;t++){var o=r[t];e+='<xf numFmtId="'+o.numFmtId+'" fontId="'+o.fontId+'" fillId="'+o.fillId+'" borderId="'+o.borderId+'" xfId="'+o.xfId+'" ',1===o.applyAlignment&&(e+='applyAlignment="1"'),e+=">"+this.saveAlignment(o)+"</xf>"}return e+"</cellXfs>"},e.prototype.saveAlignment=function(e){var t="<alignment ";return void 0!==e.alignment.horizontal&&(t+='horizontal="'+e.alignment.horizontal+'" '),void 0!==e.alignment.indent&&0!==e.alignment.indent?t+='indent="'+e.alignment.indent+'" ':void 0!==e.alignment.rotation&&0!==e.alignment.rotation&&(t+='textRotation="'+e.alignment.rotation+'" '),void 0!==e.alignment.vertical&&(t+='vertical="'+e.alignment.vertical+'" '),t+='wrapText="'+e.alignment.wrapText+'" />'},e.prototype.saveApp=function(e){var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>Essential XlsIO</Application>';void 0!==e&&(void 0!==e.manager&&(t+="<Manager>"+e.manager+"</Manager>"),void 0!==e.company&&(t+="<Company>"+e.company+"</Company>")),this.addToArchive(t+"</Properties>","docProps/app.xml")},e.prototype.saveCore=function(e){var t=new Date,r='<?xml version="1.0" encoding="utf-8" standalone="yes"?><cp:coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">';void 0!==this.builtInProperties?(void 0!==e.author&&(r+="<dc:creator>"+e.author+"</dc:creator>"),void 0!==e.subject&&(r+="<dc:subject>"+e.subject+"</dc:subject>"),void 0!==e.category&&(r+="<cp:category>"+e.category+"</cp:category>"),void 0!==e.comments&&(r+="<dc:description>"+e.comments+"</dc:description>"),void 0!==e.title&&(r+="<dc:title>"+e.title+"</dc:title>"),void 0!==e.tags&&(r+="<cp:keywords>"+e.tags+"</cp:keywords>"),void 0!==e.status&&(r+="<cp:contentStatus>"+e.status+"</cp:contentStatus>"),void 0!==e.createdDate?r+='<dcterms:created xsi:type="dcterms:W3CDTF">'+e.createdDate.toISOString()+"</dcterms:created>":r+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",void 0!==e.modifiedDate?r+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+e.modifiedDate.toISOString()+"</dcterms:modified>":r+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"):(r+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",r+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"),r+="</cp:coreProperties>",this.addToArchive(r,"docProps/core.xml")},e.prototype.saveTopLevelRelation=function(){this.addToArchive('<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml" /><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>',"_rels/.rels")},e.prototype.saveWorkbookRelation=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',t=this.worksheets.length,r=0,o=0;o<t;o++,r++)e+='<Relationship Id="rId'+(o+1).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(o+1).toString()+'.xml" />';e+='<Relationship Id="rId'+(++r).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />',this.sharedStringCount>0&&(e+='<Relationship Id="rId'+(++r).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />'),this.addToArchive(e+"</Relationships>","xl/_rels/workbook.xml.rels")},e.prototype.saveContentType=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />',t="",r=this.worksheets.length,o=0;o<r;o++)t+='<Override PartName="/xl/worksheets/sheet'+(o+1).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />',void 0!=this.worksheets[o].images&&this.worksheets[o].images.length>0&&(t+='<Override PartName="/xl/drawings/drawing'+(o+1).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />');this.imageCount>0&&(t+='<Default Extension="png" ContentType="image/png" />'),this.sharedStringCount>0&&(e+='<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" />'),this.addToArchive(e+t+"</Types>","[Content_Types].xml")},e.prototype.addToArchive=function(e,r){if("string"==typeof e){var o=new Blob([e],{type:"text/plain"}),i=new t.ZipArchiveItem(o,r);this.mArchive.addItem(i)}else{i=new t.ZipArchiveItem(e,r);this.mArchive.addItem(i)}},e.prototype.processMergeCells=function(e,t,r){if(0!==e.rowSpan||0!==e.colSpan){var o=new k;o.x=e.index,o.width=e.colSpan,o.y=t,o.height=e.rowSpan;var i=this.getCellName(o.y,o.x),n=this.getCellName(t+o.height,e.index+o.width);o.ref=i+":"+n;r.add(o);var l={x:o.x,y:o.y},s={x:e.index+o.width,y:t+o.height};this.updatedMergedCellStyles(l,s,e)}return r},e.prototype.updatedMergedCellStyles=function(e,t,r){for(var o=e.x;o<=t.x;o++)for(var i=e.y;i<=t.y;i++)this.mergedCellsStyle.set(this.getCellName(i,o),{x:o,y:i,styleIndex:r.styleIndex})},e.prototype.dateToTicks=function(e,t,r){var o=[0,31,59,90,120,151,181,212,243,273,304,334,365],i=[0,31,60,91,121,152,182,213,244,274,305,335,366];if(e>=1&&e<=9999&&t>=1&&t<=12){var n=e-1;return 864e9*(365*n+(n/4|0)-(n/100|0)+(n/400|0)+(this.isLeapYear(e)?i:o)[t-1]+r-1)}throw new Error("Not a valid date")},e.prototype.timeToTicks=function(e,t,r){if(e>=0&&e<24&&t>=0&&t<60&&r>=0&&r<60)return 1e4*(3600*e+60*t+r)*1e3;throw new Error("Not valid time")},e.prototype.isLeapYear=function(e){return e%4==0&&(e%100!=0||e%400==0)},e.prototype.toOADate=function(e){var t=0;if(0===(t=this.dateToTicks(e.getFullYear(),e.getMonth()+1,e.getDate())+this.timeToTicks(e.getHours(),e.getMinutes(),e.getSeconds())))return 0;if(t<31241376e9)throw new Error("Arg_OleAutDateInvalid");return(t-599264352e9)/1e4/864e5},e}(),D=function(){function e(){}return e}();return e.CellStyle=o,e.Font=i,e.CellXfs=n,e.Alignment=l,e.CellStyleXfs=s,e.CellStyles=a,e.NumFmt=d,e.Border=h,e.Borders=m,e.Cell=u,e.Cells=c,e.Column=f,e.Row=g,e.Rows=y,e.Workbook=B,e.BuiltInProperties=D,e.Worksheet=F,e.HyperLink=S,e.Grouping=C,e.FreezePane=I,e.MergeCell=k,e.MergeCells=T,e.Worksheets=w,e.CsvHelper=N,e.ValueFormatter=P,e.BlobHelper=A,e}({},ej.compression,ej.base),this.ejs=ej;
- /*!
- * filename: ej2-pdf-export.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.pdfexport=function(t,e,i){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}var n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||r}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(void 0!==e)return e.value},t.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},t.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},t.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t}(),o=function(){function t(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&t.length>0?(e=t,this.internalValue=this.normalizeValue(e)):this.internalValue=e},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},t.prototype.clone=function(e){var i=new t;return i.value=this.internalValue,i},t.prototype.escapeString=function(e){for(var i="",r=0,n=e.length;r<n;r++){var o=e[r];t.delimiters.indexOf(o);i+=o}return i},t.prototype.normalizeValue=function(t,e){return t},t.delimiters="()<>[]{}/%}",t.replacements=[" ","\t","\n","\r"],t}(),s=function(){function t(){this.forTest="test",this.forTest=t.obj}return t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN",t}(),a=function(){function t(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep"}return t}(),h=function(){function t(t){if(this.position7=-1,this.primitiveItems=new n,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isFont=!1,void 0===t)this.primitiveItems=new n,this.encrypt=!0,this.dictionaryProperties=new a;else{this.primitiveItems=new n;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this),this.encrypt=!0,this.dictionaryProperties=new a}}return Object.defineProperty(t.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.getArchive=function(){return this.archive},t.prototype.setArchive=function(t){this.archive=t},t.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},t.prototype.getEncrypt=function(){return this.encrypt},t.prototype.freezeChanges=function(t){this.bChanged=!1},t.prototype.clone=function(e){return new t},t.prototype.modify=function(){this.bChanged=!0},t.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},t.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},t.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},t.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},t.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},t.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},t.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},t.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},t.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),this.Count>0&&this.saveItems(t),t.write(this.suffix),t.write(s.newLine))},t.prototype.saveItems=function(t){t.write(s.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(s.whiteSpace),i[r].save(t),t.write(s.newLine)}},t}(),l=function(){function t(t){this.sender=t}return t}(),u=function(){function t(t){this.sender=t}return t}(),c=function(){function t(t){this.sender=t}return t}(),p=function(){function t(t){this.sender=t}return t}(),d=function(){function t(t,e){this.sender=t,this.state=e}return t}(),f=function(){function t(t){this.sender=t}return t}(),g=function(){function t(t){this.position5=-1,this.value=t}return Object.defineProperty(t.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.intValue.toString())},t.prototype.clone=function(e){return new t(this.value)},t.floatToString=function(t){var e=t.toFixed(2);return"0.00"===e&&(e=".00"),e},t.min=function(t,e,i){var r=Math.min(t,e);return Math.min(i,r)},t}(),m=function(){function t(e){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===e)this.internalElements=[];else if(void 0===e||e instanceof t){var i=e;this.internalElements=[];for(n=0;n<i.elements.length;n++)this.internalElements.push(i.elements[n])}else for(var r=e,n=0;n<r.length;n++){var o=new g(r[n]);this.add(o)}}return t.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),t.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},t.prototype.markedChange=function(){this.bChanged=!0},t.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},t.prototype.getItems=function(t){return this.internalElements[t]},t.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(s.whiteSpace);t.write(this.endMark)},t.prototype.clone=function(e){this.clonedObject9=null;for(var i=new t,r=0;r<this.internalElements.length;r++){var n=this.internalElements[r];i.add(n.clone(e))}return i.pdfCrossTable=e,this.clonedObject9=i,i},t.fromRectangle=function(e){return new t([e.x,e.y,e.width,e.height])},t.prototype.insert=function(t,e){if(t<this.internalElements.length&&t>0){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},t.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},t.prototype.remove=function(t){var e=this.internalElements.indexOf(t);this.internalElements[e]=null,this.markChanged()},t.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},t.prototype.clear=function(){this.internalElements=[],this.markChanged()},t.prototype.markChanged=function(){this.bChanged=!0},t}(),y=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function i(e,i){var r=t.call(this,e)||this;return r.dicPrefix="stream",r.dicSuffix="endstream",r.clonedObject2=null,r.bCompress=!0,r.isImageStream=!1,r.isFontStream=!1,void 0!==e||void 0!==i?(r.dataStream2=[],r.dataStream2=i,r.bCompress2=!1):(r.dataStream2=[],r.bCompress2=!0),r}return y(i,t),Object.defineProperty(i.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isImage",{get:function(){return this.isImageStream},set:function(t){this.isImageStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFont",{get:function(){return this.isFontStream},set:function(t){this.isFontStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),i.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},i.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},i.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},i.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},i.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},i.prototype.compressContent=function(t,i){if(this.bCompress){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var o=new Uint8Array(r),s=new e.CompressedStreamWriter;s.write(o,0,o.length),s.close(),t=s.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},i.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter);e instanceof C&&(e=e.object);var i=e,r=e;null!=r&&((i=new m).insert(0,r),this.items.setValue(this.dictionaryProperties.filter,i)),r=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,r):i.insert(0,r)},i.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var i="",r=0;r<this.data.length;r++)i+=this.data[r];i.length>1&&!this.isImage&&!this.isFont&&(i="q\r\n"+i+"Q\r\n");var n=(i=this.compressContent(i,e)).length;this.items.setValue(this.dictionaryProperties.length,new g(n)),t.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(s.newLine),i.length>0&&e.write(i),e.write(s.newLine),e.write(this.dicSuffix),e.write(s.newLine)},i.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},i}(h),w=function(){function t(t){this.sender=t}return t}(),S=function(){function t(t){this.sender=t}return t}();!function(t){!function(t){t[t.None=0]="None",t[t.Ascii=1]="Ascii",t[t.Unicode=2]="Unicode"}(t.ForceEncoding||(t.ForceEncoding={}));var e;!function(t){t[t.StringValue=0]="StringValue",t[t.ByteBuffer=1]="ByteBuffer"}(e||(e={}))}(t.InternalEnum||(t.InternalEnum={}));var P=function(){function e(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(t.length>0&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),e.bytesToHex=function(t){if(null==t)return"";return""},e.prototype.save=function(i){if(null===i)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii?i.write(this.pdfEncode()):i.write(e.stringMark[0]+this.value+e.stringMark[1])},e.prototype.pdfEncode=function(){var i="";if(void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii){for(var r=this.escapeSymbols(this.value),n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);i=e.stringMark[0]+i+e.stringMark[1]}else i=this.value;return i},e.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},e.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var i=new e(this.stringValue);return i.bHex=this.bHex,i.crossTable=t,i.isColorSpace=this.isColorSpace,this.clonedObject1=i,i},e.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},e.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},e.stringMark="()",e.hexStringMark="<>",e.hexFormatPattern="{0:X2}",e}(),v=function(){function t(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},t.prototype.clone=function(t){return null},t}(),C=function(){function t(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new a,this.initialize(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){if(t instanceof m||t instanceof h||t instanceof o||t instanceof g||t instanceof b||t instanceof v||t instanceof P)this.primitiveObject=t;else{var e=t;this.initialize(e.element)}},t.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},t.prototype.clone=function(t){return null},t}(),B=function(){function t(){this.action=null,this.dictionaryProperties=new a,this.initialize()}return Object.defineProperty(t.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new C(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new h),this.pdfDictionary},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),O=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(t){function e(e){var i=t.call(this)||this;return i.uniformResourceIdentifier="",i}return O(e,t),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new P(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))},e}(B);!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.PdfHorizontalAlignment||(t.PdfHorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.PdfVerticalAlignment||(t.PdfVerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify"}(t.PdfTextAlignment||(t.PdfTextAlignment={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.FillStroke=2]="FillStroke",t[t.None=3]="None",t[t.ClipFlag=4]="ClipFlag",t[t.ClipFill=4]="ClipFill",t[t.ClipStroke=5]="ClipStroke",t[t.ClipFillStroke=6]="ClipFillStroke",t[t.Clip=7]="Clip"}(t.TextRenderingMode||(t.TextRenderingMode={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(t.PdfLineJoin||(t.PdfLineJoin={})),function(t){t[t.Flat=0]="Flat",t[t.Round=1]="Round",t[t.Square=2]="Square"}(t.PdfLineCap||(t.PdfLineCap={})),function(t){t[t.Solid=0]="Solid",t[t.Dash=1]="Dash",t[t.Dot=2]="Dot",t[t.DashDot=3]="DashDot",t[t.DashDotDot=4]="DashDotDot",t[t.Custom=5]="Custom"}(t.PdfDashStyle||(t.PdfDashStyle={})),function(t){t[t.Winding=0]="Winding",t[t.Alternate=1]="Alternate"}(t.PdfFillMode||(t.PdfFillMode={})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.GrayScale=2]="GrayScale",t[t.Indexed=3]="Indexed"}(t.PdfColorSpace||(t.PdfColorSpace={})),function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity"}(t.PdfBlendMode||(t.PdfBlendMode={})),function(t){t[t.Centimeter=0]="Centimeter",t[t.Pica=1]="Pica",t[t.Pixel=2]="Pixel",t[t.Point=3]="Point",t[t.Inch=4]="Inch",t[t.Document=5]="Document",t[t.Millimeter=6]="Millimeter"}(t.PdfGraphicsUnit||(t.PdfGraphicsUnit={})),function(t){t[t.Fit=0]="Fit",t[t.Center=1]="Center",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(t.PdfGridImagePosition||(t.PdfGridImagePosition={})),function(t){t[t.None=0]="None",t[t.LeftToRight=1]="LeftToRight",t[t.RightToLeft=2]="RightToLeft"}(t.PdfTextDirection||(t.PdfTextDirection={}));var L=function(){function e(t,i,r,n){void 0===t?void 0!==i&&void 0!==r&&void 0!==n?this.assignRGB(i,r,n):this.filled=!1:t instanceof e?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===i&&void 0===r&&void 0===n?(t<0&&(t=0),t>1&&(t=1),this.redColor=t*e.maxColourChannelValue,this.greenColor=t*e.maxColourChannelValue,this.blueColor=t*e.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=e.maxColourChannelValue,this.filled=!0):void 0===n?this.assignRGB(t,i,r):this.assignRGB(i,r,n,t)}return e.prototype.assignRGB=function(t,i,r,n){void 0===t||void 0===i||void 0===r?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=i,this.blueColor=r,this.alpha=void 0===n?e.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(t,i,r))},e.prototype.assignCMYK=function(t,i,r){var n=t/e.maxColourChannelValue,o=i/e.maxColourChannelValue,s=r/e.maxColourChannelValue,a=g.min(1-n,1-o,1-s),h=1===a?0:(1-n-a)/(1-a),l=1===a?0:(1-o-a)/(1-a),u=1===a?0:(1-s-a)/(1-a);this.blackColor=a,this.cyanColor=h,this.magentaColor=l,this.yellowColor=u},Object.defineProperty(e.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"red",{get:function(){return this.r/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.b/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.g/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*e.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:t>1?1:t,this.r=this.grayColor*e.maxColourChannelValue,this.g=this.grayColor*e.maxColourChannelValue,this.b=this.grayColor*e.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),e.prototype.toString=function(e,i){if(this.isEmpty)return"";var r="";switch(e){case t.PdfColorSpace.Rgb:r=this.rgbToString(i);break;case t.PdfColorSpace.GrayScale:r=this.grayScaleToString(i);break;case t.PdfColorSpace.Cmyk:r=this.cmykToString(i)}return r},e.prototype.grayScaleToString=function(t){var i=this.gray,r="",n=null;return n=t?e.grayStringsSroke.containsKey(i)?e.grayStringsSroke.getValue(i):null:e.grayStringsFill.containsKey(i)?e.grayStringsFill.getValue(i):null,null==n?t&&(r=i.toString()+" G",e.grayStringsSroke.setValue(i,r)):r=n.toString(),r+s.newLine},e.prototype.rgbToString=function(t){var i=this.r,r=this.g,n=this.b,o=(i<<16)+(r<<8)+n;t&&(o+=1<<24);var a="",h=null;if(e.rgbStrings.containsKey(o)&&(h=e.rgbStrings.getValue(o)),null==h){var l=i/e.maxColourChannelValue,u=r/e.maxColourChannelValue,c=n/e.maxColourChannelValue;a=t?l.toString()+" "+u.toString()+" "+c.toString()+" RG":l.toString()+" "+u.toString()+" "+c.toString()+" rg",e.rgbStrings.setValue(o,a)}else a=h.toString();return a+s.newLine},e.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+s.newLine},e.prototype.toArray=function(e){var i=new m;switch(e){case t.PdfColorSpace.Rgb:i.add(new g(this.red)),i.add(new g(this.green)),i.add(new g(this.blue))}return i},e.rgbStrings=new n,e.grayStringsSroke=new n,e.grayStringsFill=new n,e.maxColourChannelValue=255,e}(),T=function(){function t(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)}return t}(),j=function(){function t(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)}return t}(),k=function(){function t(t,e,i,r){if(typeof t==typeof t&&void 0===t)this.x=0,this.y=0,this.height=0,this.width=0;else if(t instanceof T&&e instanceof j&&void 0===i){var n=t;this.x=n.x,this.y=n.y;var o=e;this.height=o.height,this.width=o.width}else{var s=t,a=e,h=i,l=r;this.x=s,this.y=a,this.height=l,this.width=h}}return t}(),V=function(){function t(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new T(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return new j(this.width,this.height)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.topLeft+"x"+this.size},t}(),R=function(){function t(){}return t.prototype.clone=function(){return this},t}(),N=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),A=function(e){function i(t){var i=e.call(this)||this;return i.pdfColor=t,i}return N(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return o=!0,e.setColorAndSpace(this.pdfColor,n,!1),o},i.prototype.resetChanges=function(e){e.setColorAndSpace(new L(0,0,0),t.PdfColorSpace.Rgb,!1)},i}(R);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.Underline=4]="Underline",t[t.Strikeout=8]="Strikeout"}(t.PdfFontStyle||(t.PdfFontStyle={})),function(t){t[t.Helvetica=0]="Helvetica",t[t.Courier=1]="Courier",t[t.TimesRoman=2]="TimesRoman",t[t.Symbol=3]="Symbol",t[t.ZapfDingbats=4]="ZapfDingbats"}(t.PdfFontFamily||(t.PdfFontFamily={})),function(t){t[t.Standard=0]="Standard",t[t.TrueType=1]="TrueType",t[t.TrueTypeEmbedded=2]="TrueTypeEmbedded"}(t.PdfFontType||(t.PdfFontType={})),function(t){t[t.None=0]="None",t[t.Word=1]="Word",t[t.WordOnly=2]="WordOnly",t[t.Character=3]="Character"}(t.PdfWordWrapType||(t.PdfWordWrapType={})),function(t){t[t.None=0]="None",t[t.SuperScript=1]="SuperScript",t[t.SubScript=2]="SubScript"}(t.PdfSubSuperScript||(t.PdfSubSuperScript={})),function(t){t[t.Unknown=0]="Unknown",t[t.StandardEncoding=1]="StandardEncoding",t[t.MacRomanEncoding=2]="MacRomanEncoding",t[t.MacExpertEncoding=3]="MacExpertEncoding",t[t.WinAnsiEncoding=4]="WinAnsiEncoding",t[t.PdfDocEncoding=5]="PdfDocEncoding",t[t.IdentityH=6]="IdentityH"}(t.FontEncoding||(t.FontEncoding={})),function(t){t[t.Apple=0]="Apple",t[t.Microsoft=4]="Microsoft",t[t.Trimmed=6]="Trimmed"}(t.TtfCmapFormat||(t.TtfCmapFormat={})),function(t){t[t.Unknown=0]="Unknown",t[t.Symbol=1]="Symbol",t[t.Unicode=2]="Unicode",t[t.Macintosh=3]="Macintosh"}(t.TtfCmapEncoding||(t.TtfCmapEncoding={})),function(t){t[t.AppleUnicode=0]="AppleUnicode",t[t.Macintosh=1]="Macintosh",t[t.Iso=2]="Iso",t[t.Microsoft=3]="Microsoft"}(t.TtfPlatformID||(t.TtfPlatformID={})),function(t){t[t.Undefined=0]="Undefined",t[t.Unicode=1]="Unicode"}(t.TtfMicrosoftEncodingID||(t.TtfMicrosoftEncodingID={})),function(t){t[t.Roman=0]="Roman",t[t.Japanese=1]="Japanese",t[t.Chinese=2]="Chinese"}(t.TtfMacintoshEncodingID||(t.TtfMacintoshEncodingID={})),function(t){t[t.FixedPitch=1]="FixedPitch",t[t.Serif=2]="Serif",t[t.Symbolic=4]="Symbolic",t[t.Script=8]="Script",t[t.Nonsymbolic=32]="Nonsymbolic",t[t.Italic=64]="Italic",t[t.ForceBold=262144]="ForceBold"}(t.FontDescriptorFlags||(t.FontDescriptorFlags={})),function(t){t[t.Arg1And2AreWords=1]="Arg1And2AreWords",t[t.ArgsAreXyValues=2]="ArgsAreXyValues",t[t.RoundXyToGrid=4]="RoundXyToGrid",t[t.WeHaveScale=8]="WeHaveScale",t[t.Reserved=16]="Reserved",t[t.MoreComponents=32]="MoreComponents",t[t.WeHaveAnXyScale=64]="WeHaveAnXyScale",t[t.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",t[t.WeHaveInstructions=256]="WeHaveInstructions",t[t.UseMyMetrics=512]="UseMyMetrics"}(t.TtfCompositeGlyphFlags||(t.TtfCompositeGlyphFlags={}));var D=function(){function e(e,i){this.scalingFactor=100,this.wordWrapType=t.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=t.PdfWordWrapType.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==i&&(this.verticalAlignment=i)}return Object.defineProperty(e.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?t.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?t.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e}(),M=function(){function t(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),t.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},t.prototype.readLine=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i}t++}if(t>this.currentPosition){var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}return null},t.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},t.prototype.readWord=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i;case" ":case"\t":t===this.currentPosition&&t++;var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}t++}if(t>this.currentPosition){var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}return null},t.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},t.prototype.read=function(t){if(void 0===t){var e="0";return this.end||(e=this.text[this.currentPosition],this.currentPosition++),e}for(var i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},t.prototype.peek=function(){var t="0";return this.end||(t=this.text[this.currentPosition]),t},t.prototype.close=function(){this.text=null},t.prototype.readToEnd=function(){var t;return t=0===this.currentPosition?this.text:this.text.substr(this.length,this.currentPosition),this.currentPosition=this.length,t},t.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},t.whiteSpace=" ",t.tab="\t",t.spaces=[t.whiteSpace,t.tab],t.whiteSpacePattern="^[ \t]+$",t}(),I=function(){function e(){this.isOverloadWithPosition=!1}return e.prototype.layout=function(t,e,i,r,n,o,s){if(r instanceof k){this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s;a=this.doLayout();return this.clear(),a}this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o;var a=this.doLayout();return this.clear(),a},e.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new j(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new M(t)}else this.initialize(t,e,i,new k(new T(0,0),r),0)},e.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},e.prototype.doLayout=function(){for(var t=new F,e=new F,i=[],r=this.reader.peekLine(),n=this.getLineIndent(!0);null!=r;){if(null!==(e=this.layoutLine(r,n))||void 0!==e){var o=0,s=this.copyToResult(t,e,i,o),a=s.success;if(o=s.numInserted,!a){this.reader.read(o);break}}this.reader.readLine(),r=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(t,i),t},e.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=this.size.width>0?Math.min(this.size.width,e):e),e},e.prototype.getLineHeight=function(){var t=this.font.height;return null!=this.format&&0!==this.format.lineSpacing&&(t=this.format.lineSpacing+this.font.height),t},e.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},e.prototype.layoutLine=function(e,i){var r=new F;r.layoutLineHeight=this.getLineHeight();var n=[],o=this.size.width,s=this.getLineWidth(e)+i,a=t.LineType.FirstParagraphLine,h=!0;if(o<=0||Math.round(s)<=Math.round(o))this.addToLineResult(r,n,e,s,t.LineType.NewLineBreak|a);else{var l="",u="";s=i;var c=i,p=new M(e),d=p.peekWord();for(d.length!==p.length&&" "===d&&(u+=d,l+=d,p.position+=1,d=p.peekWord());null!=d;){u+=d;var f=this.getLineWidth(u.toString())+c;if(" "===u.toString()&&(u="",f=0),f>o){if(this.getWrapType()===t.PdfWordWrapType.None)break;if(u.length===d.length){if(this.getWrapType()===t.PdfWordWrapType.WordOnly){r.textRemainder=e.substring(p.position);break}if(1===u.length){l+=d;break}h=!1,u="",d=p.peek().toString();continue}this.getLineWidth(d.toString())>o?this.format.wordWrap=t.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=t.PdfWordWrapType.Word),this.getWrapType()===t.PdfWordWrapType.Character&&h?(h=!1,u="",u+=l.toString(),d=p.peek().toString()):(" "!==(g=l.toString())&&this.addToLineResult(r,n,g,s,t.LineType.LayoutBreak|a),this.isOverloadWithPosition&&(o=this.clientSize.width),u="",l="",s=0,c=0,f=0,a=t.LineType.None,d=h?d:p.peekWord(),h=!0)}else l+=d,s=f,h?(p.readWord(),d=p.peekWord()):(p.read(),d=p.peek().toString())}if(l.length>0){var g=l.toString();this.addToLineResult(r,n,g,s,t.LineType.NewLineBreak|t.LineType.LastParagraphLine)}p.close()}r.layoutLines=[];for(var m=0;m<n.length;m++)r.layoutLines.push(n[m]);return n=[],r},e.prototype.addToLineResult=function(t,e,i,r,n){var o=new E;o.text=i,o.width=r,o.lineType=n,e.push(o);var s=t.actualSize;s.height+=this.getLineHeight(),s.width=Math.max(s.width,r),t.size=s},e.prototype.copyToResult=function(t,e,i,r){var n=!0,o=null!=this.format&&!this.format.lineLimit,s=t.actualSize.height,a=this.size.height;if(this.pageHeight>0&&a+this.rectangle.y>this.pageHeight&&(a=this.rectangle.y-this.pageHeight,a=Math.max(a,-a)),r=0,null!=e.lines)for(var h=0,l=e.lines.length;h<l;h++){var u=s+e.lineHeight;if(!(u<=a||a<=0||o)){n=!1;break}var c=e.lines[h];r+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c);var p=t.actualSize;p.width=Math.max(p.width,c.width),t.size=p,s=u}if(s!=t.size.height){var d=t.actualSize;d.height=s,t.size=d}return{success:n,numInserted:r}},e.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd()),e=[]},e.prototype.trimLine=function(e,i){var r=e.text,n=e.width;e.lineType,t.LineType.FirstParagraphLine,null==this.format||this.format.rightToLeft;return(r=r.trim()).length!==e.text.length&&(n=this.getLineWidth(r),(e.lineType&t.LineType.FirstParagraphLine)>0&&(n+=this.getLineIndent(i))),e.text=r,e.width=n,e},e.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:t.PdfWordWrapType.Word},e}(),F=function(){function t(){}return Object.defineProperty(t.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new j(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0}),t}(),E=function(){function t(){}return Object.defineProperty(t.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0}),t}();!function(t){t[t.None=0]="None",t[t.NewLineBreak=1]="NewLineBreak",t[t.LayoutBreak=2]="LayoutBreak",t[t.FirstParagraphLine=4]="FirstParagraphLine",t[t.LastParagraphLine=8]="LastParagraphLine"}(t.LineType||(t.LineType={}));var G=function(){function e(e,i){this.fontStyle=t.PdfFontStyle.Regular,"number"==typeof e&&void 0===i?this.fontSize=e:(this.fontSize=e,this.setStyle(i))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return(this.style&t.PdfFontStyle.Bold)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return(this.style&t.PdfFontStyle.Italic)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeout",{get:function(){return(this.style&t.PdfFontStyle.Strikeout)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return(this.style&t.PdfFontStyle.Underline)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),e.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof D||null==e)&&void 0===i&&void 0===r){a=e;return this.measureString(t,a,0,0)}if("string"==typeof t&&(e instanceof D||null==e)&&"number"==typeof i&&"number"==typeof r){a=e;return this.measureString(t,0,a,i,r)}if("string"==typeof t&&"number"==typeof e&&(i instanceof D||null==i)&&"number"==typeof r&&"number"==typeof n){var o=new j(e,0),s=i;return this.measureString(t,o,s,r,n)}if(null==t)throw Error('ArgumentNullException("text")');var a=e,s=i,h=(new I).layout(t,this,s,a,!1,new j(0,0));return r=t.length,n=h.empty?0:h.lines.length,h.actualSize},e.prototype.equalsTo=function(t){return this.equalsToFont(t)},e.prototype.getInternals=function(){return this.pdfFontInternals},e.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},e.prototype.setStyle=function(t){this.fontStyle=t},e.prototype.applyFormatSettings=function(t,e,i){var r=i;if(null!=e&&i>0&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)){var n=M.spaces;r+=M.getCharsCount(t,n)*e.wordSpacing}return r},e.charSizeMultiplier=.001,e.syncObject=new Object,e}(),z=function(){function t(t){this.streamWriter=t}return Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),t.prototype.write=function(t){var e=t;this.streamWriter.write(e)},t}();!function(t){t[t.None=0]="None",t[t.Registered=1]="Registered"}(t.ObjectStatus||(t.ObjectStatus={}));var W=function(){function e(){this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n}return Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),e.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(e.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var i=new H(e);this.objectCollections.push(i),this.primitiveObjectCollection.containsKey(e)||this.primitiveObjectCollection.setValue(e,this.objectCollections.length-1),e.position=this.index=this.objectCollections.length-1,e.status=t.ObjectStatus.Registered},e.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;i>=0;i--)if(this.objectCollections[i].object===t){e=i;break}return e},e.prototype.getReference=function(t,e){this.index=this.lookFor(t);return this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},e.prototype.trySetReference=function(t,e,i){return!0,this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},e.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n},e}(),H=function(){function t(t,e){this.pdfObject=t,this.pdfReference=e}return Object.defineProperty(t.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),t.prototype.setReference=function(t){this.pdfReference=t},t}(),_=function(){function t(t){this.isStreamCopied=!1,t instanceof Ce&&(this.document=t)}return Object.defineProperty(t.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),t.prototype.setMainObjectCollection=function(t){this.objects=t},t.prototype.setCrossTable=function(t){this.pdfCrossTable=t},t.prototype.setCatalog=function(t){this.pdfCatalog=t},t.prototype.save=function(t){var e=this,r=new i.Encoding(!0),n=new i.StreamWriter(r);if(void 0===t){var o=new i.Encoding(!0),s=new i.StreamWriter(o);return new Promise(function(t,i){var r={};r.blobData=new Blob([e.document.docSave(s,!0)],{type:"application/pdf"}),t(r)})}this.document.docSave(n,t,!0)},t.prototype.clone=function(){return this.document},t}();!function(t){t[t.Free=0]="Free",t[t.Normal=1]="Normal",t[t.Packed=2]="Packed"}(t.ObjectType||(t.ObjectType={}));var K=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),U=function(t){function e(){var e=t.call(this)||this;return e.sections=null,e.tempDictionaryProperties=new a,e.items.setValue((new a).type,new o("Catalog")),e}return K(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new C(t))},enumerable:!0,configurable:!0}),e}(h),q=function(){function e(){this.objects=new n,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new a}return Object.defineProperty(e.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new b),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),e.prototype.save=function(t,e){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var i=this.count,r=t.position;this.registerObject(0,new v(0,-1),!0);t.write(s.xref),t.write(s.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,r),this.count=i;for(var n=0;n<this.objectCollection.count;++n)this.objectCollection.items(n).object.isSaving=!1;if(void 0===e)return t.stream.buffer;t.stream.save(e)},e.prototype.saveTheEndess=function(t,e){t.write(s.newLine+s.startxref+s.newLine),t.write(e.toString()+s.newLine),t.write(s.eof+s.newLine)},e.prototype.saveTrailer=function(t,e,i){t.write(s.trailer+s.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new g(this.objectCount+1)),(r=new h(r)).setEncrypt(!1),r.save(t)},e.prototype.saveSections=function(t){var e=0,i=0;do{i=this.prepareSubsection(e),this.saveSubsection(t,e,i),e+=i}while(0!==i)},e.prototype.saveSubsection=function(e,i,r){if(!(r<=0||i>=this.count)){e.write(i+" "+(r+1)+s.newLine);for(var n=i;n<=i+r;++n){var o=this.objects.getValue(n),a="";a=o.type===t.ObjectType.Free?this.getItem(o.offset,65535,!0):this.getItem(o.offset,o.generation,!1),e.write(a)}}},e.prototype.getItem=function(t,e,i){var r="",n=10-t.toString().length;e<=0&&(e=0);for(var o=5-e.toString().length<=0?0:5-e.toString().length,a=0;a<n;a++)r+="0";r=r+t.toString()+" ";for(a=0;a<o;a++)r+="0";return r=r+e.toString()+" ",r=r+(i?s.f:s.n)+s.newLine},e.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(t>=r)return i;for(e=t;e<r;++e)break;for(t=e;e<r;++e)++i;return i},e.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},e.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(s.newLine)},e.prototype.generateFileVersion=function(t){return"1."+4..toString()},e.prototype.getReference=function(t,e){if(void 0===e){return this.getReference(t,!1)}return this.getSubReference(t,e)},e.prototype.getSubReference=function(e,i){var r,n=!1,o=null;if(this.items.count>0&&e.objectCollectionIndex>0&&this.items.count>e.objectCollectionIndex-1){var s=this.document.pdfObjects.getReference(e,r);o=s.reference,r=s.wasNew}if(r=null==o&&e.status!==t.ObjectStatus.Registered,null==o){var a=this.nextObjNumber;o=new v(a,0);if(r){this.document.pdfObjects.add(e),this.document.pdfObjects.trySetReference(e,o,void 0);var h=this.document.pdfObjects.count-1,l=this.document.pdfObjects.objectCollections[h].reference.objNumber,u=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1];this.document.pdfObjects.mainObjectCollection.setValue(l,u),e.position=-1}else this.document.pdfObjects.trySetReference(e,o,void 0);e.objectCollectionIndex=o.objNumber,e.status=t.ObjectStatus.None,n=!0}return n||this.bForceNew,o},e.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},e.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof U&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i;t.getArchive(),this.registerObject(e.position,i),this.doSaveObject(t,i,e)},e.prototype.doSaveObject=function(t,e,i){i.length;i.write(e.objNumber.toString()),i.write(s.whiteSpace),i.write(e.genNumber.toString()),i.write(s.whiteSpace),i.write(s.obj),i.write(s.newLine),t.save(i);i.stream;i.write(s.endObj),i.write(s.newLine)},e.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Y(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Y(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},e.dereference=function(t){var e=t;return null!=e&&(t=e.object),t},e}(),Y=function(){function e(e,i,r){var n=e;this.offsetNumber=n;var o=i;this.generation=o.genNumber,this.object=o.objNumber,this.type=void 0===r?t.ObjectType.Normal:t.ObjectType.Free}return Object.defineProperty(e.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0}),e}(),X=function(){function t(){}return t.letter=new j(612,792),t.note=new j(540,720),t.legal=new j(612,1008),t.a0=new j(2380,3368),t.a1=new j(1684,2380),t.a2=new j(1190,1684),t.a3=new j(842,1190),t.a4=new j(595,842),t.a5=new j(421,595),t.a6=new j(297,421),t.a7=new j(210,297),t.a8=new j(148,210),t.a9=new j(105,148),t.a10=new j(74,105),t.b0=new j(2836,4008),t.b1=new j(2004,2836),t.b2=new j(1418,2004),t.b3=new j(1002,1418),t.b4=new j(709,1002),t.b5=new j(501,709),t.archE=new j(2592,3456),t.archD=new j(1728,2592),t.archC=new j(1296,1728),t.archB=new j(864,1296),t.archA=new j(648,864),t.flsa=new j(612,936),t.halfLetter=new j(396,612),t.letter11x17=new j(792,1224),t.ledger=new j(1224,792),t}();!function(t){t[t.Portrait=0]="Portrait",t[t.Landscape=1]="Landscape"}(t.PdfPageOrientation||(t.PdfPageOrientation={})),function(t){t[t.RotateAngle0=0]="RotateAngle0",t[t.RotateAngle90=1]="RotateAngle90",t[t.RotateAngle180=2]="RotateAngle180",t[t.RotateAngle270=3]="RotateAngle270"}(t.PdfPageRotateAngle||(t.PdfPageRotateAngle={})),function(t){t[t.None=0]="None",t[t.Numeric=1]="Numeric",t[t.LowerLatin=2]="LowerLatin",t[t.LowerRoman=3]="LowerRoman",t[t.UpperLatin=4]="UpperLatin",t[t.UpperRoman=5]="UpperRoman"}(t.PdfNumberStyle||(t.PdfNumberStyle={})),function(t){t[t.None=0]="None",t[t.Bottom=1]="Bottom",t[t.Top=2]="Top",t[t.Left=3]="Left",t[t.Right=4]="Right",t[t.Fill=5]="Fill"}(t.PdfDockStyle||(t.PdfDockStyle={})),function(t){t[t.None=0]="None",t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"}(t.PdfAlignmentStyle||(t.PdfAlignmentStyle={})),function(t){t[t.None=0]="None",t[t.Top=1]="Top",t[t.Bottom=2]="Bottom",t[t.Left=3]="Left",t[t.Right=4]="Right"}(t.TemplateType||(t.TemplateType={}));var J=function(){function t(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),t.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},t.prototype.clone=function(){return this},t}(),Z=function(){function e(e){this.pageMargins=new J,this.pageSize=X.a4,this.rotateAngle=t.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=t.PdfPageOrientation.Portrait,this.pageOrigin=new T(0,0),this.isRotation=!1,"number"==typeof e&&this.pageMargins.setMargins(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),e.prototype.updateSize=function(e){var i=Math.min(this.pageSize.width,this.pageSize.height),r=Math.max(this.pageSize.width,this.pageSize.height);switch(e){case t.PdfPageOrientation.Portrait:this.pageSize=new j(i,r);break;case t.PdfPageOrientation.Landscape:this.pageSize=new j(r,i)}},e.prototype.clone=function(){var t=this;return t.pageMargins=this.pageMargins.clone(),t},e.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new j(t,e)},e.prototype.setSize=function(e){var i=Math.min(e.width,e.height),r=Math.max(e.width,e.height);this.orientation===t.PdfPageOrientation.Portrait?this.pageSize=new j(i,r):this.pageSize=new j(r,i)},e}(),$=function(){function t(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}return t.prototype.clear=function(){this.stream.clearStream()},t.prototype.setGraphicsState=function(t){t instanceof o?(this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState)):(this.stream.write(s.slash),this.stream.write(t),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState))},t.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.paintXObject),this.stream.write(s.newLine)},t.prototype.closePath=function(){this.writeOperator(s.closePath)},t.prototype.clipPath=function(t){this.stream.write(s.clipPath),t&&this.stream.write(s.evenOdd),this.stream.write(s.whiteSpace),this.stream.write(s.endPath),this.stream.write(s.newLine)},t.prototype.closeFillStrokePath=function(t){this.stream.write(s.closeFillStrokePath),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillStrokePath=function(t){this.stream.write(s.fillStroke),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillPath=function(t){this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.endPath=function(){this.writeOperator(s.n)},t.prototype.closeFillPath=function(t){this.writeOperator(s.closePath),this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.closeStrokePath=function(){this.writeOperator(s.closeStrokePath)},t.prototype.setTextScaling=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextScaling)},t.prototype.strokePath=function(){this.writeOperator(s.stroke)},t.prototype.restoreGraphicsState=function(){this.writeOperator(s.restoreState)},t.prototype.saveGraphicsState=function(){this.writeOperator(s.saveState)},t.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(s.goToNextLine):t instanceof T?(this.writePoint(t),this.writeOperator(s.setCoords)):(this.writePoint(t,e),this.writeOperator(s.setCoords))},t.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setText)},t.prototype.setLeading=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextLeading)},t.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(s.beginPath)},t.prototype.beginText=function(){this.writeOperator(s.beginText)},t.prototype.endText=function(){this.writeOperator(s.endText)},t.prototype.appendRectangle=function(t,e,i,r){t instanceof k?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(s.appendRectangle))},t.prototype.appendLineSegment=function(t,e){t instanceof T?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(s.appendLineSegment))},t.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setRenderingMode)},t.prototype.setCharacterSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.stream.write(s.setCharacterSpace),this.stream.write(s.newLine)},t.prototype.setWordSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setWordSpace)},t.prototype.showNextLineText=function(t,e){t instanceof P?(this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setTextOnNewLine)):(this.checkTextParam(t),this.writeText(t,e),this.writeOperator(s.setTextOnNewLine))},t.prototype.setColorSpace=function(t,e){if(t instanceof o&&"boolean"==typeof e){var i=t,r=(n=e)?s.selectcolorspaceforstroking:s.selectcolorspacefornonstroking;this.stream.write(i.toString()),this.stream.write(s.whiteSpace),this.stream.write(r),this.stream.write(s.newLine)}else{var i=t,n=e;this.setColorSpace(new o(i),n)}},t.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.modifyCtm)},t.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(s.whiteSpace),this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),this.writeOperator(s.setFont)}},t.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(s.newLine)},t.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},t.prototype.writeText=function(t,e){if(t instanceof P&&void 0===e)this.stream.write(t.pdfEncode());else{var i=void 0,r=void 0;e?(i=P.hexStringMark[0],r=P.hexStringMark[1]):(i=P.stringMark[0],r=P.stringMark[1]),this.stream.write(i),this.stream.write(t),this.stream.write(r)}},t.prototype.writePoint=function(t,e){if(t instanceof T&&void 0===e)this.writePoint(t.x,t.y);else{var i=t;this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),e=this.updateY(e),this.stream.write(g.floatToString(e)),this.stream.write(s.whiteSpace)}},t.prototype.updateY=function(t){return-t},t.prototype.write=function(t){var e="";e+=t,e+=s.newLine,this.writeOperator(e)},t.prototype.writeComment=function(t){if(!(null!=t&&t.length>0))throw new Error("Invalid comment");var e="";e+=s.comment,e+=s.whiteSpace,e+=t,this.writeOperator(e)},t.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(s.newLine))},t.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},t.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(t.length>1)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i+="] ",i+=e.toString(),i+=" "+s.setDashPattern,this.stream.write(i),this.stream.write(s.newLine)},t.prototype.setMiterLimit=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setMiterLimit)},t.prototype.setLineWidth=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineWidth)},t.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineCapStyle)},t.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineJoinStyle)},Object.defineProperty(t.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof T&&e instanceof T&&i instanceof T?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(s.appendbeziercurve)},t.prototype.setColourWithPattern=function(t,e,i){if(null!=t){var r=t.length,n=0;for(n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(s.whiteSpace)}null!=e&&(this.stream.write(e.toString()),this.stream.write(s.whiteSpace)),i?this.writeOperator(s.setColorAndPatternStroking):this.writeOperator(s.setColorAndPattern)},t}(),Q=function(){function e(e,i){this.pdfColor=new L(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=t.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=t.PdfColorSpace.Rgb,e instanceof R?this.setBrush(e):e instanceof L&&(this.color=e),"number"==typeof i&&(this.width=i)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(e){if(this.pdfDashStyle!==e)switch(this.pdfDashStyle=e,this.pdfDashStyle){case t.PdfDashStyle.Custom:break;case t.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case t.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case t.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case t.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case t.PdfDashStyle.Solid:break;default:this.pdfDashStyle=t.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e.prototype.setBrush=function(t){var e=t;null!=e&&e instanceof A&&(this.color=e.color,this.pdfBrush=e),this.color=e.color,this.pdfBrush=e},e.prototype.monitorChanges=function(t,e,i,r,n,o){r=!0,this.dashControl(t,r,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);var s=this.miterLimit;s>0&&e.setMiterLimit(s);this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},e.prototype.dashControl=function(t,e,i){e=!0;var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),e},e.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t},e}(),tt=function(){function t(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=void 0===t?new et(1,0,0,1,0,0):new et(1,0,0,-1,0,0)}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},t.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},t.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},t.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++){this.matrix.elements[e];t+=g.floatToString(this.transformationMatrix.elements[e]),t+=" "}return t},t.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},t.degreesToRadians=function(t){return this.degRadFactor*t},t.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},t.prototype.clone=function(){return this},t.degRadFactor=Math.PI/180,t}(),et=function(){function t(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},t.prototype.transform=function(t){var e=t.x,i=t.y,r=e*this.elements[0]+i*this.elements[2]+this.offsetX,n=e*this.elements[1]+i*this.elements[3]+this.offsetY;return new T(r,n)},t.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},t.prototype.dispose=function(){this.metrixElements=null},t.prototype.clone=function(){return new t(this.metrixElements)},t}(),it=function(){function t(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"}return t}(),rt=function(){function t(){this.mKeys=[],this.mValues=[]}return t.prototype.size=function(){return this.mKeys.length},t.prototype.add=function(t,e){if(void 0===t||null===t||void 0===e||null===e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},t.prototype.keys=function(){return this.mKeys},t.prototype.values=function(){return this.mValues},t.prototype.getValue=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},t.prototype.setValue=function(t,e){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},t.prototype.remove=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(e,1),this.mValues.splice(e,1),!0},t.prototype.containsKey=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},t.prototype.clear=function(){this.mKeys=[],this.mValues=[]},t}(),nt=function(){function t(t,e,i){this.dictionary=new h,this.dictionaryProperties=new a,this.dictionary.items.setValue(this.dictionaryProperties.CA,new g(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}return Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),ot=function(){function t(){this.automaticFieldsInformation=[]}return Object.defineProperty(t.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),t.prototype.add=function(t){return this.automaticFields.push(t)},t}(),st=function(){function t(){}return t.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},t}(),at=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ht=function(t){function e(){var e=t.call(this)||this;return e.internalBounds=new k(0,0,0,0),e.internalTemplateSize=new j(0,0),e}return at(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return new j(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return new T(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),e.prototype.performDrawHelper=function(t,e,i,r){if(0===this.bounds.height||0===this.bounds.width){var n=this.getValue(t);this.internalTemplateSize=this.getFont().measureString(n,this.size,this.stringFormat)}},e.prototype.draw=function(t,e,i){if(void 0===e){var r=new T(0,0);this.draw(t,r)}else if(e instanceof T)this.draw(t,e.x,e.y);else{this.drawHelper(t,e,i);var n=new lt(this,new T(e,i));t.automaticFields.add(n)}},e.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},e.prototype.drawInternal=function(t){},e.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new A(new L(0,0,0)):this.internalBrush},e.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Ce.defaultFont:this.internalFont},e.prototype.getPageFromGraphics=function(t){if(void 0!==t.page&&null!==t.page)return e=t.page;var e=t.currentPage;return e},e}(st),lt=function(){function t(e,i,r,n){this.pageNumberFieldLocation=new T,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===i&&e instanceof t?(this.pageNumberField=e.field,this.pageNumberFieldLocation=e.location,this.scaleX=e.scalingX,this.scaleY=e.scalingY):void 0===r&&i instanceof T&&e instanceof ht?(this.pageNumberField=e,this.pageNumberFieldLocation=i):(this.pageNumberField=e,this.pageNumberFieldLocation=i,this.scaleX=r,this.scaleY=n)}return Object.defineProperty(t.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0}),t}(),ut=function(){function t(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},t.prototype.getBuffer=function(t){return this.buffer[t]},t.prototype.writeFromBase64String=function(t){var e=this.encodedString(t);this.buffer=e},t.prototype.encodedString=function(t){var e,i,r,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,h=0,l=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;t.charAt(t.length-1)===s.charAt(64)&&l--;for(var u=new Uint8Array(0|l);a<t.length;)e=s.indexOf(t.charAt(a++))<<2|(n=s.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(o=s.indexOf(t.charAt(a++)))>>2,r=(3&o)<<6|s.indexOf(t.charAt(a++)),u[h++]=e,u[h++]=i,u[h++]=r;return u},t.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(t.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e<<=8,e|=t.readByte(this.position),this.position++,e},t}(),ct=function(){function t(t){this.currentPosition=-1,this.value=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.boolToStr(this.value))},t.prototype.clone=function(e){return new t(this.value)},t.prototype.boolToStr=function(t){return t?"true":"false"},t}();!function(t){t[t.Unknown=0]="Unknown",t[t.Bmp=1]="Bmp",t[t.Emf=2]="Emf",t[t.Gif=3]="Gif",t[t.Jpeg=4]="Jpeg",t[t.Png=5]="Png",t[t.Wmf=6]="Wmf",t[t.Icon=7]="Icon"}(t.ImageFormat||(t.ImageFormat={}));var pt=function(){function e(e){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=t.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new a,this.mStream=e,this.initialize()}return Object.defineProperty(e.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.mFormat===t.ImageFormat.Unknown&&this.checkIfJpeg()&&(this.mFormat=t.ImageFormat.Jpeg,this.parseJpegImage()),this.reset(),this.mImageData=new ut(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},e.prototype.reset=function(){this.mStream.position=0},e.prototype.parseJpegImage=function(){this.reset();var t=new ut(this.mStream.count);this.mStream.read(t,0,t.count);for(var e=4,i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(e.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),e.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<e.mJpegHeader.length;t++){if(e.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},e.prototype.getImageDictionary=function(){if(this.mFormat===t.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new b,this.imageStream.isImage=!0;for(var e="",i="",r=0;r<this.imageDataAsNumberArray.byteLength;r++)e+=String.fromCharCode(null,this.mStream.readByte(r));for(r=0;r<e.length;r++)r%2!=0&&(i+=e[r]);return this.imageStream.data=[i],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new g(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new g(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams()),this.imageStream}return this.imageStream},e.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},e.prototype.getDecodeParams=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.columns,new g(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new ct(!0)),t.items.setValue(this.dictionaryProperties.k,new g(-1)),t.items.setValue(this.dictionaryProperties.predictor,new g(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),t},e.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},e.prototype.skip=function(t,e){this.mStream=t;var i=new ut(e);this.mStream.read(i,0,i.count)},e.prototype.getMarker=function(t){var e=32;for(e=t.readByte(this.mStream.position),t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;do{e=t.readByte(this.mStream.position),t.position++}while(255===e);return e},e.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;e>0&&(t.position+=e)},e.mPngHeader=[137,80,78,71,13,10,26,10],e.mJpegHeader=[255,216],e.GIF_HEADER="G,I,F,8",e.BMP_HEADER="B,M",e}(),dt=function(){function t(t){this.updateProportionsHelper(t)}return t.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},t.prototype.convertToPixels=function(t,e){var i=e;return t*this.proportions[i]},t.prototype.convertFromPixels=function(t,e){var i=e;return t/this.proportions[i]},t.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},t.horizontalResolution=96,t.verticalResolution=96,t}(),ft=function(){function e(){}return Object.defineProperty(e.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new j(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),e.prototype.getPointSize=function(e,i,r,n){if(void 0===r){var o=dt.horizontalResolution,s=dt.verticalResolution;return c=this.getPointSize(e,i,o,s)}var a=new dt(r),h=new dt(n),l=a.convertUnits(e,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),u=h.convertUnits(i,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),c=new j(l,u);return c},e}(),gt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mt=function(t){function e(e){var i=t.call(this)||this;return i.imageStatus=!0,i.dictionaryProperties=new a,i.loadImage(e),i}return gt(e,t),e.prototype.loadImage=function(t){this.initializeAsync(t)},e.prototype.initializeAsync=function(t){var e=new ut(t.length);e.writeFromBase64String(t),this.decoder=new pt(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},e.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()},e}(ft),yt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0}),t}(),bt=function(){function t(){}return t}(),wt=function(){function t(){}return t}(),St=function(){function t(){}return t}(),Pt=function(){function t(){}return Object.defineProperty(t.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),t}(),vt=function(){function t(){}return t}(),Ct=function(){function t(){}return t}(),Bt=function(){function t(){}return t}(),Ot=function(){function t(){}return t}(),xt=function(){function t(){}return t}(),Lt=function(){function t(){}return t}(),Tt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),t.prototype.compareTo=function(t){var e=t;return this.index-e.index},t}(),jt=function(){function t(){}return t}(),kt=function(){function t(){}return t}(),Vt=function(){function t(){}return t}(),Rt=function(){function t(){}return t}(),Nt=function(){function t(){}return t}(),At=function(){function t(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}return Object.defineProperty(t.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),t.prototype.writeShort=function(t){var e=[(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeUInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},t.prototype.writeBytes=function(t){this.flush(t)},t.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},t}(),Dt=function(){function e(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}return Object.defineProperty(e.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new n),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new n),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new n),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new n),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new Pt),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},e.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new n);for(var e=0;e<t;++e){var i=new yt,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},e.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(a=this.tableDirectory.getValue(e[i])).offset;if(t>r&&(t=r)<=this.lowestPosition)break}var o=t-this.lowestPosition;if(0!==o){for(var s=new n,i=0;i<e.length;i++){var a=this.tableDirectory.getValue(e[i]);a.offset-=o,s.setValue(e[i],a)}this.tableDirectory=s}},e.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},e.prototype.readNameTable=function(){var t=this.getTable("name");this.offset=t.offset;var e=new bt;e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[];for(var i=this.offset,r=0;r<e.recordsCount;r++){this.offset=i;var n=new wt;n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset;var o=0===n.platformID||3===n.platformID;n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},e.prototype.readHeadTable=function(){var t=this.getTable("head");this.offset=t.offset;var e=new St;return e.version=this.readFixed(this.offset),e.fontRevision=this.readFixed(this.offset),e.checkSumAdjustment=this.readUInt32(this.offset),e.magicNumber=this.readUInt32(this.offset),e.flags=this.readUInt16(this.offset),e.unitsPerEm=this.readUInt16(this.offset),e.created=this.readInt64(this.offset),e.modified=this.readInt64(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.macStyle=this.readUInt16(this.offset),e.lowestReadableSize=this.readUInt16(this.offset),e.fontDirectionHint=this.readInt16(this.offset),e.indexToLocalFormat=this.readInt16(this.offset),e.glyphDataFormat=this.readInt16(this.offset),e},e.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea");this.offset=t.offset;var e=new vt;return e.version=this.readFixed(this.offset),e.ascender=this.readInt16(this.offset),e.descender=this.readInt16(this.offset),e.lineGap=this.readInt16(this.offset),e.advanceWidthMax=this.readUInt16(this.offset),e.minLeftSideBearing=this.readInt16(this.offset),e.minRightSideBearing=this.readInt16(this.offset),e.xMaxExtent=this.readInt16(this.offset),e.caretSlopeRise=this.readInt16(this.offset),e.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,e.metricDataFormat=this.readInt16(this.offset),e.numberOfHMetrics=this.readUInt16(this.offset),e},e.prototype.readOS2Table=function(){var t=this.getTable("OS/2");this.offset=t.offset;var e=new Ct;return e.version=this.readUInt16(this.offset),e.xAvgCharWidth=this.readInt16(this.offset),e.usWeightClass=this.readUInt16(this.offset),e.usWidthClass=this.readUInt16(this.offset),e.fsType=this.readInt16(this.offset),e.ySubscriptXSize=this.readInt16(this.offset),e.ySubscriptYSize=this.readInt16(this.offset),e.ySubscriptXOffset=this.readInt16(this.offset),e.ySubscriptYOffset=this.readInt16(this.offset),e.ySuperscriptXSize=this.readInt16(this.offset),e.ySuperscriptYSize=this.readInt16(this.offset),e.ySuperscriptXOffset=this.readInt16(this.offset),e.ySuperscriptYOffset=this.readInt16(this.offset),e.yStrikeoutSize=this.readInt16(this.offset),e.yStrikeoutPosition=this.readInt16(this.offset),e.sFamilyClass=this.readInt16(this.offset),e.panose=this.readBytes(10),e.ulUnicodeRange1=this.readUInt32(this.offset),e.ulUnicodeRange2=this.readUInt32(this.offset),e.ulUnicodeRange3=this.readUInt32(this.offset),e.ulUnicodeRange4=this.readUInt32(this.offset),e.vendorIdentifier=this.readBytes(4),e.fsSelection=this.readUInt16(this.offset),e.usFirstCharIndex=this.readUInt16(this.offset),e.usLastCharIndex=this.readUInt16(this.offset),e.sTypoAscender=this.readInt16(this.offset),e.sTypoDescender=this.readInt16(this.offset),e.sTypoLineGap=this.readInt16(this.offset),e.usWinAscent=this.readUInt16(this.offset),e.usWinDescent=this.readUInt16(this.offset),e.ulCodePageRange1=this.readUInt32(this.offset),e.ulCodePageRange2=this.readUInt32(this.offset),e.version>1?(e.sxHeight=this.readInt16(this.offset),e.sCapHeight=this.readInt16(this.offset),e.usDefaultChar=this.readUInt16(this.offset),e.usBreakChar=this.readUInt16(this.offset),e.usMaxContext=this.readUInt16(this.offset)):(e.sxHeight=0,e.sCapHeight=0,e.usDefaultChar=0,e.usBreakChar=0,e.usMaxContext=0),e},e.prototype.readPostTable=function(){var t=this.getTable("post");this.offset=t.offset;var e=new Bt;return e.formatType=this.readFixed(this.offset),e.italicAngle=this.readFixed(this.offset),e.underlinePosition=this.readInt16(this.offset),e.underlineThickness=this.readInt16(this.offset),e.isFixedPitch=this.readUInt32(this.offset),e.minType42=this.readUInt32(this.offset),e.maxType42=this.readUInt32(this.offset),e.minType1=this.readUInt32(this.offset),e.maxType1=this.readUInt32(this.offset),e},e.prototype.readWidthTable=function(t,e){var i=this.getTable("hmtx");this.offset=i.offset;for(var r=[],n=0;n<t;n++){var o=new Ot;o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset);var s=1e3*o.advanceWidth/e;r.push(Math.floor(s))}return r},e.prototype.readCmapTable=function(){var t=this.getTable("cmap");this.offset=t.offset;var e=new Lt;e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset);for(var i=this.offset,r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new xt;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},e.prototype.readCmapSubTable=function(e){var i=this.getTable("cmap");this.offset=i.offset+e.offset;var r=this.readUInt16(this.offset),n=this.getCmapEncoding(e.platformID,e.encodingID);n===t.TtfCmapEncoding.Macintosh?t.TtfPlatformID.Macintosh:t.TtfPlatformID.Microsoft;if(n!==t.TtfCmapEncoding.Unknown)switch(r){case t.TtfCmapFormat.Apple:this.readAppleCmapTable(e,n);break;case t.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(e,n);break;case t.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(e,n)}},e.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new kt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var n=0;n<256;++n){var o=new Tt;o.index=this.readByte(this.offset),o.width=this.getWidth(o.index),o.charCode=n,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.readMicrosoftCmapTable=function(e,i){var r=this.getTable("cmap");this.offset=r.offset+e.offset;var n=i===t.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh,o=new Vt;o.format=this.readUInt16(this.offset),o.length=this.readUInt16(this.offset),o.version=this.readUInt16(this.offset),o.segCountX2=this.readUInt16(this.offset),o.searchRange=this.readUInt16(this.offset),o.entrySelector=this.readUInt16(this.offset),o.rangeShift=this.readUInt16(this.offset);var s=o.segCountX2/2;o.endCount=this.readUshortArray(s),o.reservedPad=this.readUInt16(this.offset),o.startCount=this.readUshortArray(s),o.idDelta=this.readUshortArray(s),o.idRangeOffset=this.readUshortArray(s);var a=o.length/2-8-4*s;o.glyphID=this.readUshortArray(a);for(var h=0,l=0,u=0;u<s;u++)for(var c=o.startCount[u];c<=o.endCount[u]&&65535!==c;c++){if(0===o.idRangeOffset[u])h=c+o.idDelta[u]&65535;else{if((l=u+o.idRangeOffset[u]/2-s+c-o.startCount[u])>=o.glyphID.length)continue;h=o.glyphID[l]+o.idDelta[u]&65535}var p=new Tt;p.index=h,p.width=this.getWidth(p.index);var d=i===t.TtfCmapEncoding.Symbol&&61440==(65280&c)?255&c:c;p.charCode=d,n.setValue(d,p),this.addGlyph(p,i)}},e.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new Rt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Tt;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},e.prototype.getTable=function(t){var e,i=new yt;return this.tableDirectory.containsKey(t)&&(e=this.tableDirectory.getValue(t)),null!==e&&void 0!==e&&(i=e),i},e.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},e.prototype.getCmapEncoding=function(e,i){var r=t.TtfCmapEncoding.Unknown;return e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Undefined?r=t.TtfCmapEncoding.Symbol:e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Unicode?r=t.TtfCmapEncoding.Unicode:e==t.TtfPlatformID.Macintosh&&i==t.TtfMacintoshEncodingID.Roman&&(r=t.TtfCmapEncoding.Macintosh),r},e.prototype.addGlyph=function(e,i){var r=null;switch(i){case t.TtfCmapEncoding.Unicode:r=this.microsoftGlyphs;break;case t.TtfCmapEncoding.Macintosh:case t.TtfCmapEncoding.Symbol:r=this.macintoshGlyphs}r.setValue(e.index,e)},e.prototype.initializeMetrics=function(e,i,r,n,o,s){this.initializeFontName(e);for(var a=!1,h=0;h<s.length;h++){var l=s[h];if(this.getCmapEncoding(l.platformID,l.encodingID)===t.TtfCmapEncoding.Symbol){a=!0;break}}this.metrics.isSymbol=a,this.metrics.macStyle=i.macStyle,this.metrics.isFixedPitch=0!==o.isFixedPitch,this.metrics.italicAngle=o.italicAngle;var u=1e3/i.unitsPerEm;this.metrics.winAscent=n.sTypoAscender*u,this.metrics.macAscent=r.ascender*u,this.metrics.capHeight=0!==n.sCapHeight?n.sCapHeight:.7*i.unitsPerEm*u,this.metrics.winDescent=n.sTypoDescender*u,this.metrics.macDescent=r.descender*u,this.metrics.leading=(n.sTypoAscender-n.sTypoDescender+n.sTypoLineGap)*u,this.metrics.lineGap=Math.ceil(r.lineGap*u);var c=i.xMin*u,p=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),d=i.xMax*u,f=this.metrics.macDescent;this.metrics.fontBox=new V(c,p,d,f),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=i.unitsPerEm/n.ySubscriptYSize,this.metrics.superscriptSizeFactor=i.unitsPerEm/n.ySuperscriptYSize},e.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(n=0;n<256;n++){var e=this.getGlyph(String.fromCharCode(n));t[n]=e.empty?0:e.width}else for(var i=[],r=String.fromCharCode(32),n=0;n<256;n++){i[0]=n;var o=this.getString(i,0,i.length),s=o.length>0?o[0]:"?";(e=this.getGlyph(s)).empty?(e=this.getGlyph(r),t[n]=e.empty?0:e.width):t[n]=e.width}return t},e.prototype.getDefaultGlyph=function(){return this.getGlyph(M.whiteSpace)},e.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},e.prototype.readLocaTable=function(t){var e=this.getTable("loca");this.offset=e.offset;var i=new jt,r=null;if(t){n=e.length/2;r=[];for(o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset)}else{var n=e.length/4;r=[];for(var o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},e.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new n,r=t.keys(),o=0;o<r.length;o++)i.setValue(r[o],t.getValue(r[o]));for(o=0;o<r.length;o++){var s=r[o];this.processCompositeGlyph(t,s,e)}},e.prototype.processCompositeGlyph=function(e,i,r){if(i<r.offsets.length-1){var n=r.offsets[i];if(n!==r.offsets[i+1]){var o=this.getTable("glyf");this.offset=o.offset+n;var s=new Nt;if(s.numberOfContours=this.readInt16(this.offset),s.xMin=this.readInt16(this.offset),s.yMin=this.readInt16(this.offset),s.xMax=this.readInt16(this.offset),s.yMax=this.readInt16(this.offset),s.numberOfContours<0)for(var a=0;;){var h=this.readUInt16(this.offset),l=this.readUInt16(this.offset);if(e.containsKey(l)||e.setValue(l,0),0==(h&t.TtfCompositeGlyphFlags.MoreComponents))break;a=0!=(h&t.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(h&t.TtfCompositeGlyphFlags.WeHaveScale)?a+=2:0!=(h&t.TtfCompositeGlyphFlags.WeHaveAnXyScale)?a+=4:0!=(h&t.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(a+=8),this.offset+=a}}}},e.prototype.generateGlyphTable=function(t,e,i,r){i=[];var n=t.keys();n.sort(function(t,e){return t-e});for(var o=0,s=0;s<n.length;s++){var a=n[s];e.offsets.length>0&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l=0,u=0,c=this.getTable("glyf"),s=0;s<e.offsets.length;s++)if(i.push(l),u<n.length&&n[u]===s){++u,i[s]=l;var p=e.offsets[s],d=e.offsets[s+1]-p;d>0&&(this.offset=c.offset+p,r=this.read(r,l,d).buffer,l+=d)}return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},e.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new At(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},e.prototype.align=function(t){return t+3&-4},e.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,s=n.numTables,a=new At(o);a.writeInt(65536),a.writeShort(s);var h=this.entrySelectors[s];return a.writeShort(16*(1<<(31&h))),a.writeShort(h),a.writeShort(16*(s-(1<<(31&h)))),this.writeCheckSums(a,s,t,e,i,r),this.writeGlyphs(a,t,e),a.data},e.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];if("glyf"!==s&&"loca"!==s){var a=this.getTable(s);a.empty||(++i,n+=this.align(a.length))}}return n+=t.length,n+=e.length,n+=16*i+12,{fontProgramLength:n,numTables:i}},e.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u=s[l],c=this.getTable(u);if(!c.empty){if(t.writeString(u),"glyf"===u){p=this.calculateCheckSum(r);t.writeInt(p),h=n}else if("loca"===u){var p=this.calculateCheckSum(i);t.writeInt(p),h=o}else t.writeInt(c.checksum),h=c.length;t.writeUInt(a),t.writeUInt(h),a+=this.align(h)}}},e.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return a+=r<<8,a+=n<<16,a+=o<<24},e.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;var u=this.read(h,0,s.length);t.writeBytes(u.buffer)}}},e.prototype.setOffset=function(t){this.offset=t},e.prototype.createInternals=function(){this.metrics=new Pt;var t=this.readNameTable(),e=this.readHeadTable();this.bIsLocaShort=0===e.indexToLocalFormat;var i=this.readHorizontalHeaderTable(),r=this.readOS2Table(),n=this.readPostTable();this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm);var o=this.readCmapTable();this.initializeMetrics(t,e,i,r,n,o)},e.prototype.getGlyph=function(t){if("number"==typeof t){var e=null;return this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),n=null!=e?e:this.getDefaultGlyph()}var i=null,r=t.charCodeAt(0);this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?r%=this.maxMacIndex+1:r=61440==(65280&r)?255&r:r,this.macintosh.containsKey(r)&&(i=this.macintosh.getValue(r),this.isFontPresent=!0)):this.microsoft.containsKey(r)?(i=this.microsoft.getValue(r),r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),t===M.whiteSpace&&null===i&&(i=new Tt);var n=null!==i?i:this.getDefaultGlyph();return n},e.prototype.getGlyphChars=function(t){if(null===t||void 0===t)throw new Error("Argument Null Exception : chars");for(var e=new n,i=t.keys(),r=0;r<i.length;r++){var o=i[r],s=this.getGlyph(o);s.empty||e.setValue(s.index,o.charCodeAt(0))}return e},e.prototype.getAllGlyphs=function(){for(var t=[],e=new Tt,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},e.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort);e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i);var r=this.generateGlyphTable(e,i,null,null),n=r.glyphTableSize,o=r.newLocaTable,s=r.newGlyphTable,a=this.updateLocaTable(o,this.bIsLocaShort,null),h=a.newLocaSize,l=a.newLocaUpdated;return this.getFontProgram(l,s,n,h)},e.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],n=this.getGlyph(r);n.empty||(e+=String.fromCharCode(n.index))}return e},e.prototype.getCharWidth=function(t){var e=this.getGlyph(t);return(e=e.empty?this.getDefaultGlyph():e).empty?0:e.width},e.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(var r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},e.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},e.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(n<<24)},e.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|n<<24},e.prototype.readInt16=function(t){var e=(this.fontData[t]<<8)+this.fontData[t+1];return e=32768&e?e-65536:e,this.offset+=2,e},e.prototype.readInt64=function(t){var e=this.readInt32(t+4),i=4294967296*this.readInt32(t)+e;return e<0&&(i+=4294967296),i},e.prototype.readUInt16=function(t){var e=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,e},e.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},e.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},e.prototype.readByte=function(t){var e=this.fontData[t];return this.offset+=1,e},e.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r=0,n=0;do{for(var o=0;o<i-r&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o];n=i-r,this.offset+=n,r+=n}while(r<i);return{buffer:t,written:r}},e}(),Mt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),It=function(){function e(){this.lineGap=0}return e.prototype.getAscent=function(t){return this.ascent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getDescent=function(t){return this.descent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getLineGap=function(t){return this.lineGap*G.charSizeMultiplier*this.getSize(t)},e.prototype.getHeight=function(t){for(var e=["cambria","candara","constantia","corbel","cariadings"],i=[],r=0;r<e.length;r++){var n=e[r];i.push(n)}return this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t)},e.prototype.getSize=function(e){var i=this.size;if(null!=e)switch(e.subSuperScript){case t.PdfSubSuperScript.SubScript:i/=this.subScriptSizeFactor;break;case t.PdfSubSuperScript.SuperScript:i/=this.superscriptSizeFactor}return i},e.prototype.clone=function(){var t=this;return t.widthTable=Ft.clone(),t},Object.defineProperty(e.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),e}(),Ft=function(){function t(){}return t.clone=function(){return null},t}(),Et=function(t){function e(e){var i=t.call(this)||this;if(null==e)throw new Error("ArgumentNullException:widths");return i.widths=e,i}return Mt(e,t),e.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(e.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this;return t.widths=this.widths,t},e.prototype.toArray=function(){return new m(this.widths)},e}(Ft),Gt=function(){function e(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new a,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+s.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+s.newLine,this.cmapEndCodespaceRange="endcodespacerange"+s.newLine,this.cmapBeginRange="beginbfrange"+s.newLine,this.cmapEndRange="endbfrange"+s.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+s.newLine,null===t||void 0===t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}return e.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},e.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},e.prototype.Initialize=function(){var t=new ut(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new Dt(this.fontData),this.ttfMetrics=this.ttfReader.metrics},e.prototype.createInternals=function(){this.fontDictionary=new h,this.fontProgram=new b,this.cmap=new b,this.descendantFont=new h,this.metrics=new It,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},e.prototype.getInternals=function(){return this.fontDictionary},e.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new Et(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},e.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return e+="+",e+=this.ttfReader.metrics.postScriptName,t=e.toString(),t=this.formatName(t)},e.prototype.formatName=function(t){var e=t.replace("(","#28");return e=e.replace(")","#29"),e=e.replace("[","#5B"),e=e.replace("]","#5D"),e=e.replace("<","#3C"),e=e.replace(">","#3E"),e=e.replace("{","#7B"),e=e.replace("}","#7D"),e=e.replace("/","#2F"),(e=e.replace("%","#25")).replace(" ","#20")},e.prototype.createDescendantFont=function(){this.descendantFont.isFont=!0,this.descendantFont.descendantFontBeginSave=new u(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new g(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new C(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},e.prototype.createFontDescriptor=function(){var t=new h,e=this.ttfReader.metrics;return t.isFont=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new g(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,m.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new g(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new g(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new g(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new g(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new g(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new g(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new C(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new g(0)),t.items.setValue(this.dictionaryProperties.stemH,new g(0)),t},e.prototype.createCmap=function(){this.cmap.cmapBeginSave=new w(this)},e.prototype.createFontDictionary=function(){this.fontDictionary.isFont=!0,this.fontDictionary.fontDictionaryBeginSave=new c(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new m,e=new C(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},e.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new S(this)},e.prototype.createSystemInfo=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.registry,new P("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new P(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new g(0)),t},e.prototype.descendantFontBeginSave=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.getDescendantWidth();null!==t&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)}},e.prototype.cmapBeginSave=function(){this.generateCmap()},e.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new C(this.cmap))},e.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},e.prototype.getDescendantWidth=function(){var t=new m;if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new m,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&e.length>1&&(t.add(new g(o)),0!==r&&t.add(h),o=l.index,h=new m),h.add(new g(l.width)),r+1===e.length&&(t.add(new g(o)),t.add(h)),s=l.index}}return t},e.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.ttfReader.getGlyphChars(this.usedChars);if(t.size()>0){var e=t.keys().sort(),i=e[0],r=e[e.length-1],n=this.toHexString(i,!1)+this.toHexString(r,!1)+s.newLine,o="";o+=this.cmapPrefix,o+=n,o+=this.cmapEndCodespaceRange;for(var a=0,h=0;h<e.length;h++){0===a&&(0!==h&&(o+=this.cmapEndRange),o+=a=Math.min(100,e.length-h),o+=s.whiteSpace,o+=this.cmapBeginRange),a-=1;var l=e[h];o+=this.toHexString(l,!0)+this.toHexString(l,!0)+this.toHexString(t.getValue(l),!0)+"\n"}o+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isFont=!0,this.cmap.write(o)}}},e.prototype.generateFontProgram=function(){var t=null;this.usedChars=null===this.usedChars||void 0===this.usedChars?new n:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isFont=!0,this.fontProgram.writeBytes(t)},e.prototype.getDescriptorFlags=function(){var e=0,i=this.ttfReader.metrics;return i.isFixedPitch&&(e|=t.FontDescriptorFlags.FixedPitch),i.isSymbol?e|=t.FontDescriptorFlags.Symbolic:e|=t.FontDescriptorFlags.Nonsymbolic,i.isItalic&&(e|=t.FontDescriptorFlags.Italic),i.isBold&&(e|=t.FontDescriptorFlags.ForceBold),e},e.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new k(t.left,t.bottom,e,i)},e.prototype.toHexString=function(t,e){var i=t.toString(16);return e&&(i=i.toUpperCase()),"<0000".substring(0,5-i.length)+i+">"},e.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new n);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()},e}(),zt=function(){function t(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new n;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}return t.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa)return t;return t},t.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];o>=""&&o<="ۿ"?r+=o:(r.length>0&&(i+=s=this.doShape(r.toString(),0),r=""),i+=o)}if(r.length>0){var s=this.doShape(r.toString(),0);i+=s}return i.toString()},t.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o="",s=new Wt,a=new Wt;n<t.length;)if(o=t[n++],0===this.ligature(o,a)){var h=this.getShapeCount(o);r=1===h?0:2,s.Shapes>2&&(r+=1),r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),s=a,(a=new Wt).Value=o,a.Shapes=h,a.Ligature++}return r=s.Shapes>2?1:0,r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),(i=this.append(i,a,e)).toString()},t.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,e.Ligature-=1,""!==e.Type&&(0==(i&this.vowel)?(t+=e.Type,e.Ligature-=1):e.Ligature-=1),""!==e.vowel&&(0==(i&this.vowel)?(t+=e.vowel,e.Ligature-=1):e.Ligature-=1)),t},t.prototype.ligature=function(t,e){if(""!==e.Value){var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;return 1===i&&e.Ligature++,i}return""!==e.vowel?0:(e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3)),i)}return 0},t.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1},t}(),Wt=function(){function t(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}return Object.defineProperty(t.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0}),t}(),Ht=function(){function t(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new n,this.update()}return t.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},t.prototype.getLogicalToVisualString=function(t,e){var i=new _t;this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1);for(var r=this.doMirrorShaping(t),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},t.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},t.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];a>i?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o)){if(1==(1&n))return void this.reArrange(t,e+1);for(r|=1;i>=r;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(h>e)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}i-=1}}},t.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},t.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)},t}(),_t=function(){function t(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}return t.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},t.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},t.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},t.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},t.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(var r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},t.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,s=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,s),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},t.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},t.prototype.checkEmbeddedCharacters=function(t){for(e=this.types.length-1;e>=0;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(t-=1,this.result[e]=this.result[t],this.levels[e]=this.levels[t]);for(var e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},t.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},t.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;s>=t;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},t.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},t.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o=t+1;o<e-1;++o)if(this.result[o]===this.ES||this.result[o]===this.CS){var s=this.result[o-1],a=this.result[o+1];s===this.EN&&a===this.EN?this.result[o]=this.EN:this.result[o]===this.CS&&s===this.AN&&a===this.AN&&(this.result[o]=this.AN)}this.checkEuropeanNumberTerminator(t,e,i,r,n)},t.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[];a.push(this.ET);var h=this.getLength(s,e,a),l=s===t?r:this.result[s-1];if(l!==this.EN&&(l=h===e?n:this.result[h]),l===this.EN)for(var u=s;u<h;++u)this.result[u]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},t.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},t.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;a>=t;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},t.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},t.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),l=0,u=0,c=0;s===t?l=r:(l=this.result[s-1])===this.AN?l=this.R:l===this.EN&&(l=this.R),h===e?u=n:(u=this.result[h])===this.AN?u=this.R:u===this.EN&&(u=this.R),c=l===u?l:0==(1&i)?this.L:this.R;for(var p=s;p<h;++p)this.result[p]=c;o=h}},t}(),Kt=function(){function e(){this.openBracket="(",this.closeBracket=")"}return e.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},e.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},e.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:r};var o=(new zt).shape(t,0),s=e.fontInternal.ttfReader;r=new Uint16Array(o.length);for(var a=0,h=0,l=o.length;h<l;h++){var u=o[h],c=s.getGlyph(u);null!==c&&void 0!==c&&(r[a++]=c.index)}return{success:!0,glyphs:r}},e.prototype.customLayout=function(e,i,r,n,o){if(null===o||void 0===o){if(null==e)throw new Error("ArgumentNullException : line");h=null;return null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None&&(h=(new Ht).getLogicalToVisualString(e,i)),h}if(null==e)throw new Error("ArgumentNullException : line");if(null==n)throw new Error("ArgumentNullException : font");var s=null;if(null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None){var a=(new zt).shape(e,0);s=this.customLayout(a,i,r)}var h=[];if(o){for(var l=s.split(""),u=l.length,c=0;c<u;c++)l[c]=this.addChars(n,l[c]);h=l}else(h=[])[0]=this.addChars(n,s);return h},e.prototype.addChars=function(t,e){var i=e;if(null==t)throw new Error("ArgumentNullException : font");if(null==i)throw new Error("ArgumentNullException : line");var r=i,n=t.fontInternal.ttfReader;t.setSymbols(r),r=n.convertString(r);var o=P.toUnicodeArray(r,!1);return r=P.byteToString(o)},e.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")},e}();!function(t){t[t.Paginate=0]="Paginate",t[t.OnePage=1]="OnePage"}(t.PdfLayoutType||(t.PdfLayoutType={})),function(t){t[t.FitPage=0]="FitPage",t[t.FitElement=1]="FitElement",t[t.FitColumnsToPage=2]="FitColumnsToPage"}(t.PdfLayoutBreakType||(t.PdfLayoutBreakType={})),function(t){t[t.Start=0]="Start",t[t.Line=1]="Line",t[t.Bezier3=3]="Bezier3",t[t.Bezier=3]="Bezier",t[t.PathTypeMask=7]="PathTypeMask",t[t.DashMode=16]="DashMode",t[t.PathMarker=32]="PathMarker",t[t.CloseSubpath=128]="CloseSubpath"}(t.PathPointType||(t.PathPointType={}));var Ut=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qt=function(e){function i(i){var r=e.call(this)||this;return r.mbackground=new L(255,255,255),r.mbStroking=!1,r.mfunction=null,r.dictionaryProperties=new a,r.mpatternDictionary=new h,r.mpatternDictionary.items.setValue(r.dictionaryProperties.type,new o(r.dictionaryProperties.pattern)),r.mpatternDictionary.items.setValue(r.dictionaryProperties.patternType,new g(2)),r.shading=i,r.colorSpace=t.PdfColorSpace.Rgb,r}return Ut(i,e),Object.defineProperty(i.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new ct(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"function",{get:function(){return this.mfunction},set:function(t){this.mfunction=t,null!=t&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new C(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);if(t!==this.mcolorSpace||null==e){this.mcolorSpace=t;var i=this.colorSpaceToDeviceName(t);this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(i))}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new h),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new C(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");if(t!==this.mmatrix){this.mmatrix=t.clone();var e=new m(this.mmatrix.matrix.elements);this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,e)}},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,r,n,o){var s=!1;if(t instanceof i){this.colorSpace!==o&&(this.colorSpace=o,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking);var a=r.getResources().getName(this);e.setColourWithPattern(null,a,this.mbStroking),s=!0}return s},i.prototype.resetChanges=function(t){},i.prototype.colorSpaceToDeviceName=function(e){var i;switch(e){case t.PdfColorSpace.Rgb:i="DeviceRGB"}return i},i.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},i.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new ct(e.value))},i.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(i.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0}),i}(R),Yt=function(){function t(t,e){if(this.dictionaryProperties=new a,this.writeTransformation=!0,void 0===t);else if(t instanceof j&&void 0===e){this.content=new b;var i=new j(t.width,t.height);this.setSize(i),this.initialize()}else this.content=new b,this.setSize(new j(t,e)),this.initialize()}return Object.defineProperty(t.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){if(null==this.pdfGraphics||void 0===this.pdfGraphics){var t=new ee(this),e=new te(this.size,t,this.content);this.pdfGraphics=e,this.pdfGraphics.initializeCoordinates()}return this.pdfGraphics},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},t.prototype.initialize=function(){this.addType(),this.addSubType()},t.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},t.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},t.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},t.prototype.setSize=function(t){var e=new k(new T(0,0),t),i=m.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,i),this.templateSize=t},Object.defineProperty(t.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),t}(),Xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jt=function(t){function e(e){var i=t.call(this,e)||this;return i.properties=new h,i}return Xt(e,t),Object.defineProperty(e.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),e.prototype.getName=function(t){var e=t.element,i=null;if(this.names.containsKey(e)&&(i=this.names.getValue(e)),null==i){var r=this.generateName();i=new o(r),this.names.setValue(e,i),t instanceof G?this.add(t,i):t instanceof Yt?this.add(t,i):t instanceof qt||t instanceof Qt?this.add(t,i):t instanceof nt?this.add(t,i):(t instanceof ft||t instanceof mt)&&this.add(t,i)}return i},e.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new rt);var t=this.items.getValue(this.dictionaryProperties.font);if(null!=t){q.dereference(t)}return this.pdfNames},e.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset);null==e&&(e=new m,this.items.setValue(this.dictionaryProperties.procset,e));var i=new o(t);e.contains(i)||e.add(i)},e.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},e.prototype.generateName=function(){return Zt.getNewGuidString()},e.prototype.add=function(t,e){if(t instanceof G){var i=null,r=this.items.getValue(this.dictionaryProperties.font);if(null!=r){f=r;i=r,i=r}else i=new h,this.items.setValue(this.dictionaryProperties.font,i);i.items.setValue(e.value,new C(t.element))}else if(t instanceof Yt){a=void 0;null==(a=this.items.getValue(this.dictionaryProperties.xObject))&&(a=new h,this.items.setValue(this.dictionaryProperties.xObject,a)),a.items.setValue(e.value,new C(t.element))}else if(t instanceof R){if((t instanceof qt||t instanceof Qt)&&null!=(o=t.element)){var n=this.items.getValue(this.dictionaryProperties.pattern);null==n&&(n=new h,this.items.setValue(this.dictionaryProperties.pattern,n)),n.items.setValue(e.value,new C(o))}}else if(t instanceof nt){var o=t.element,s=null;null==(s=this.items.getValue(this.dictionaryProperties.extGState))&&(s=new h,this.items.setValue(this.dictionaryProperties.extGState,s)),s.items.setValue(e.value,new C(o))}else{var a=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),l=void 0;void 0!==this.pdfDocument&&(l=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject));this.Dictionary.items.values();var u=!1,c=void 0;if(void 0===this.pdfDocument||void 0!==typeof l&&null!=l){if(void 0!==this.pdfDocument)for(var p=l.items.values(),d=0;d<p.length;d++)void 0!==p[d]&&void 0!==p[d].element&&p[d].element.data[0]===t.element.data[0]&&(c=p[d],u=!0)}else l=new h,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,l);if(null==a&&(a=new h,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,a)),u&&void 0!==c)a.items.setValue(e.value,c);else{var f=new C(t.element);a.items.setValue(e.value,f),void 0!==this.pdfDocument&&l.items.setValue(e.value,f)}}},e}(h),Zt=function(){function t(){}return t.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})},t}(),$t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qt=function(t){function e(e,i){var r=t.call(this)||this;r.mStroking=!1,r.mLocation=new T(0,0),r.mDictionaryProperties=new a;var n=null;return e instanceof V?n=e:e instanceof j&&(n=new V(0,0,e.width,e.height)),null!==i&&i instanceof ce&&(r.mPage=i),r.brushStream=new b,r.mResources=new Jt,r.brushStream.items.setValue(r.mDictionaryProperties.resources,r.mResources),r.setBox(n),r.setObligatoryFields(),null!==i&&i instanceof ce&&(r.mPage=i,r.graphics.colorSpace=i.document.colorSpace),r}return $t(e,t),e.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new b;var n=new Jt;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,n),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(e.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),e.prototype.setObligatoryFields=function(){if(this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new g(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new g(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation)if(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix){t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y;this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([1,0,0,1,this.mLocation.x,t]))}else{var t=0,e=this.mTransformationMatrix.matrix.elements;t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([e[0],e[1],e[2],e[3],e[4],t]))}},e.prototype.setBox=function(t){this.mBox=t;var e=new k(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,m.fromRectangle(e))},Object.defineProperty(e.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){if(null==this.mGraphics&&void 0===this.mGraphics){var t=new ee(this),e=new te(this.size,t,this.brushStream);this.mGraphics=e,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()}return this.mGraphics},enumerable:!0,configurable:!0}),e.prototype.getResources=function(){return this.mResources},Object.defineProperty(e.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Jt(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},e.prototype.monitorChanges=function(t,i,r,n,o){var s=!1;if(t!==this){i.setColorSpace("Pattern",this.mStroking);var a=r.getResources().getName(this);i.setColourWithPattern(null,a,this.mStroking),s=!0}else if(t instanceof e){i.setColorSpace("Pattern",this.mStroking);var h=r.getResources().getName(this);i.setColourWithPattern(null,h,this.mStroking),s=!0}return s},e.prototype.resetChanges=function(t){},Object.defineProperty(e.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0}),e}(R),te=function(){function e(e,i,r){this.currentColorSpace=t.PdfColorSpace.Rgb,this.previousTextRenderingMode=t.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new it,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new j(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new a,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=i,this.canvasSize=e,this.pdfStreamWriter=r instanceof $?r:new $(r),this.initialize()}return Object.defineProperty(e.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientSize",{get:function(){return new j(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new tt),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ot),this.internalAutomaticFields},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=t.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new k(new T(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},e.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=t.width>0?i.width/t.width:1,n=t.height>0?i.height/t.height:1,o=!(1===r&&1===n),s=this.save(),a=new tt;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var h=this.getResources.getResources().getName(t);this.pdfStreamWriter.executeObject(h),this.restore(s);var l=t.graphics;if(null!=l)for(var u=0;u<l.automaticFields.automaticFields.length;u++){var c=l.automaticFields.automaticFields[u],p=new T(c.location.x+e.x,c.location.y+e.y),d=0==t.size.width?0:i.width/t.size.width,f=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new lt(c.field,p,d,f)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},e.prototype.drawString=function(t,e,i,r,n,o,s,a,h){if("string"==typeof t&&e instanceof G&&(i instanceof Q||null===i)&&(r instanceof R||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof D||null===s)&&void 0===a)this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s);else{var l=i,u=r,c=n,p=o,d=s,f=a,g=h,m=(new I).layout(t,e,g,new j(d,f),this.isOverloadWithPosition,this.clientSize);if(!m.empty){var y=this.checkCorrectLayoutRectangle(m.actualSize,c,p,g);d<=0&&(c=y.x,d=y.width),f<=0&&(p=y.y,f=y.height),this.drawStringLayoutResult(m,e,l,u,new k(c,p,d,f),g),this.isEmfTextScaled=!1,this.emfScalingFactor=new j(0,0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=m,this.isUseFontSize=!1}},e.prototype.drawLine=function(t,e,i,r,n){if(e instanceof T){var o=e,s=i;this.drawLine(t,o.x,o.y,s.x,s.y)}else{var o=e,s=i,a=r,h=n;this.stateControl(t,null,null);var l=this.streamWriter;l.beginPath(o,s),l.appendLineSegment(a,h),l.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)}},e.prototype.drawRectangle=function(t,e,i,r,n,o){if(t instanceof Q&&"number"==typeof e){s=i;this.drawRectangle(t,null,e,s,r,n)}else if(t instanceof R&&"number"==typeof e){s=i;this.drawRectangle(null,t,e,s,r,n)}else{var s=i,a=r,h=n,l=o;if(e instanceof Qt){this.bCSInitialized=!1;var u=this.matrix.matrix.offsetX+s,c=void 0;c=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+a:this.clientSize.height-this.matrix.matrix.offsetY+a,e.location=new T(u,c),e.graphics.colorSpace=this.colorSpace}else e instanceof qt&&(e.colorSpace=this.colorSpace);e instanceof A&&e.color.isEmpty&&(e=null);var p=t,d=e;this.stateControl(p,d,null),this.streamWriter.appendRectangle(s,a,h,l),this.drawPathHelper(p,d,!1)}},e.prototype.drawPathHelper=function(e,i,r,n){if("boolean"==typeof r){var o=r;this.drawPathHelper(e,i,t.PdfFillMode.Winding,o)}else{var s=null!=e,a=null!=i,h=(o=r)===t.PdfFillMode.Alternate;s&&a?this.streamWriter.fillStrokePath(h):s||a?s?this.streamWriter.strokePath():this.streamWriter.fillPath(h):this.streamWriter.endPath()}},e.prototype.drawImage=function(t,e,i,r,n){if("number"==typeof e&&"number"==typeof i&&void 0===r){var o=t.physicalDimension;this.drawImage(t,e,i,o.width,o.height)}else{var a=e,h=i,l=n;t.save();var u=new tt;this.getTranslateTransform(a,h+l,u),this.getScaleTransform(r,n,u),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(u);var c=this.getResources.getResources();void 0!==this.pageLayer&&null!=this.page&&(c.document=this.page.document);var p=c.getName(t);void 0!==this.pageLayer&&this.page.setResources(c),this.pdfStreamWriter.executeObject(p),this.pdfStreamWriter.write(s.restoreState),this.pdfStreamWriter.write(s.newLine);var d=this.getResources.getResources();d.requireProcedureSet(this.procedureSets.imageB),d.requireProcedureSet(this.procedureSets.imageC),d.requireProcedureSet(this.procedureSets.imageI),d.requireProcedureSet(this.procedureSets.text)}},e.prototype.getLineBounds=function(t,e,i,r,n){var o;if(!e.empty&&t<e.lineCount&&t>=0){var s=e.lines[t],a=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,h=s.width,l=this.getHorizontalAlignShift(h,r.width,n),u=this.getLineIndent(s,n,r,0===t);l+=this.rightToLeft(n)?0:u;var c=r.x+l,p=this.shouldJustify(s,r.width,n)?r.width-u:h-u,d=e.lineHeight;o=new k(c,a,p,d)}else o=new k(0,0,0,0);return o},e.prototype.checkCorrectLayoutRectangle=function(e,i,r,n){var o=new k(i,r,e.width,e.width);if(null!=n){switch(n.alignment){case t.PdfTextAlignment.Center:o.x-=o.width/2;break;case t.PdfTextAlignment.Right:o.x-=o.width}switch(n.lineAlignment){case t.PdfVerticalAlignment.Middle:o.y-=o.height/2;break;case t.PdfVerticalAlignment.Bottom:o.y-=o.height}}return o},e.prototype.setLayer=function(t){this.pageLayer=t;var e=t.page;null!=e&&void 0!==e&&(e.beginSave=this.pageSave)},e.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},e.prototype.drawStringLayoutResult=function(e,i,r,n,o,s){if(e.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(i,r,n,s,o);var a=null!=s?s.horizontalScalingFactor:100;a===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(a),this.previousTextScaling=a);var h=null==s||0===s.lineSpacing?i.height:s.lineSpacing+i.height,l=0;l=null!=s&&s.subSuperScript===t.PdfSubSuperScript.SubScript?h-(i.height+i.metrics.getDescent(s)):h-i.metrics.getAscent(s),this.shift=l,this.pdfStreamWriter.startNextLine(o.x,o.y-l),this.pdfStreamWriter.setLeading(+h);for(var u=0,c="",p=0;p<e.lines.length;p++)if(u+=e.lineHeight,o.y+u>this.clientSize.height){this.startCutIndex=p;break}for(var d=this.startCutIndex;d<e.lines.length&&d>=0;d++)c+=e.lines[d].text;var f=new k(o.x,o.y,o.width,o.height);this.drawLayoutResult(e,i,s,o),this.underlineStrikeoutText(r,n,e,i,f,s),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(c,i,r,n,o.x,0,o.width,0,s)},e.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},e.prototype.setClip=function(e,i){void 0===i?this.setClip(e,t.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.clipPath(i===t.PdfFillMode.Alternate))},e.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Qt?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof qt&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r);this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o);var s=null!=r?r.characterSpacing:0;s===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(s),this.previousCharacterSpacing=s);var a=null!=r?r.wordSpacing:0;a!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(a),this.previousWordSpacing=a)},e.prototype.getTextVerticalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.lineAlignment!==t.PdfVerticalAlignment.Top)switch(r.lineAlignment){case t.PdfVerticalAlignment.Middle:n=(i-e)/2;break;case t.PdfVerticalAlignment.Bottom:n=i-e}return n},e.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=e,s=null!=o&&o.isUnicode,a=(null!=o&&o.isEmbedFont,t.lines),h=0,l=a.length;h<l&&h!==this.startCutIndex;h++){var u=a[h],c=(u.text,u.width),p=this.getHorizontalAlignShift(c,r.width,i),d=this.getLineIndent(u,i,r,0===h);0===(p+=this.rightToLeft(i)?0:d)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(p,0),s?this.drawUnicodeLine(u,r,e,i):this.drawAsciiLine(u,r,e,i),0===p||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-p,0),this.isOverloadWithPosition&&a.length>1&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},e.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text);var s="("+n+")";this.pdfStreamWriter.showNextLineText(new P(s))},e.prototype.drawUnicodeLine=function(e,i,r,n){var o=e.text,s=(e.width,null!==n&&void 0!==n&&n.rightToLeft),a=null!==n&&void 0!==n&&(0!==n.wordSpacing||n.alignment===t.PdfTextAlignment.Justify),h=r,l=this.justifyLine(e,i.width,n),u=new Kt;if(s||null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None){var c=null,p=null!==n&&void 0!==n&&n.alignment===t.PdfTextAlignment.Right,d=null;d=(c=null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.layout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.layout(o,h,p,a,n)).length>1?null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.splitLayout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.splitLayout(o,h,p,a,n):[o],this.drawUnicodeBlocks(c,d,h,n,l)}else if(a){var f=this.breakUnicodeLine(o,h,null),c=f.tokens,d=f.words;this.drawUnicodeBlocks(c,d,h,n,l)}else{var g=this.convertToUnicode(o,h),m=this.getUnicodeString(g);this.streamWriter.showNextLineText(m)}},e.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!==r&&void 0!==r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(M.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!==r&&void 0!==r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p=t[c],d=e[c],f=0;if(0!==o&&this.streamWriter.startNextLine(o,0),d.length>0){f+=i.measureString(d,r).width,f+=u;var g=this.getUnicodeString(p);this.streamWriter.showText(g)}c!==t.length-1&&(s+=o=f+l)}s>0&&this.streamWriter.startNextLine(-s,0)}finally{null!==r&&void 0!==r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},e.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],s=this.convertToUnicode(o,e);r[n]=s}return{tokens:r,words:i}},e.prototype.getUnicodeString=function(e){if(null===e)throw new Error("Argument Null Exception : token");var i=new P(e);return i.converted=!0,i.encode=t.InternalEnum.ForceEncoding.Ascii,i},e.prototype.convertToUnicode=function(t,e){var i=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");if(e.fontInternal instanceof Gt){var r=e.fontInternal.ttfReader;e.setSymbols(t),i=r.convertString(t);var n=P.toUnicodeArray(i,!1);i=P.byteToString(n)}return i},e.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,o=this.shouldJustify(t,e,i),s=null!=i&&0!==i.wordSpacing,a=M.spaces,h=M.getCharsCount(r,a),l=0;return o?(s&&(n-=h*i.wordSpacing),l=(e-n)/h,this.pdfStreamWriter.setWordSpacing(l)):s?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),l},e.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},e.prototype.shouldJustify=function(e,i,r){var n=e.text,o=e.width,s=null!=r&&r.alignment===t.PdfTextAlignment.Justify,a=i>=0&&o<i,h=M.spaces,l=M.getCharsCount(n,h)>0&&n[0]!==M.whiteSpace,u=(e.lineType&t.LineType.LayoutBreak)>0;return s&&a&&l&&(u||r.alignment===t.PdfTextAlignment.Justify)},e.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){var a=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),h=0;h=n.y+a+r.metrics.getAscent(o)+1.5*s.width;for(var l=n.y+a+r.metrics.getHeight(o)/2+1.5*s.width,u=i.lines,c=0,p=i.lineCount;c<p;c++){var d=u[c],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===c);g+=this.rightToLeft(o)?0:m;var y=n.x+g,b=this.shouldJustify(d,n.width,o)?y+n.width-m:y+f-m;if(r.underline){w=h;this.drawLine(s,y,w,b,w),h+=i.lineHeight}if(r.strikeout){var w=l;this.drawLine(s,y,w,b,w),l+=i.lineHeight}this.isPointOverload&&u.length>1&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},e.prototype.createUnderlineStikeoutPen=function(t,e,i,r){var n=i.metrics.getSize(r)/20,o=null;return null!=t?o=new Q(t.color,n):null!=e&&(o=new Q(e,n)),o},e.prototype.getTextRenderingMode=function(e,i,r){var n=t.TextRenderingMode.None;return n=null!=e&&null!=i?t.TextRenderingMode.FillStroke:null!=e?t.TextRenderingMode.Stroke:t.TextRenderingMode.Fill,null!=r&&r.clipPath&&(n|=t.TextRenderingMode.ClipFlag),n},e.prototype.getLineIndent=function(e,i,r,n){var o=0,s=(e.lineType&t.LineType.FirstParagraphLine)>0;return null!=i&&s&&(o=n?i.firstLineIndent:i.paragraphIndent,o=r.width>0?Math.min(r.width,o):o),o},e.prototype.getHorizontalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.alignment!==t.PdfTextAlignment.Left)switch(r.alignment){case t.PdfTextAlignment.Center:n=(i-e)/2;break;case t.PdfTextAlignment.Right:n=i-e}return n},e.prototype.rightToLeft=function(e){var i=null!==e&&void 0!==e&&e.rightToLeft;return null!==e&&void 0!==e&&e.textDirection!==t.PdfTextDirection.None&&void 0!==e.textDirection&&(i=!0),i},e.prototype.stateControl=function(t,e,i,r){if(void 0===r)this.stateControl(t,e,i,null);else{e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Qt&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace);null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1)}},e.prototype.initCurrentColorSpace=function(e){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=t.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1),this.bCSInitialized=!0):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1),this.bCSInitialized=!0))},e.prototype.penControl=function(t,e){null!=t&&(this.currentPen=t,t.monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},e.prototype.brushControl=function(t,e){if(null!=t&&void 0!==t){var i=t.clone(),r=i;if(!(null===r||void 0===r||t instanceof A||t instanceof Qt)){var n=r.matrix,o=this.matrix.clone();null!=n&&(n.multiply(o),o=n),r.matrix=o}this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t,t=null}},e.prototype.fontControl=function(e,i,r){if(null!=e){var n=null!=i?i.subSuperScript:t.PdfSubSuperScript.None,o=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:t.PdfSubSuperScript.None;if(r||e!==this.currentFont||n!==o){var s=this.getResources.getResources();this.currentFont=e,this.currentStringFormat=i;var a=e.metrics.getSize(i);this.isEmfTextScaled=!1;var h=s.getName(e);this.pdfStreamWriter.setFont(e,h,a)}}},e.prototype.setTransparency=function(e,i,r){if(void 0===i)this.istransparencySet=!0,this.setTransparency(e,e,t.PdfBlendMode.Normal);else if("number"==typeof i&&void 0===r)this.setTransparency(e,i,t.PdfBlendMode.Normal);else{null==this.trasparencies&&(this.trasparencies=new rt);var n=null,o=new re(e,i,r);this.trasparencies.containsKey(o)&&(n=this.trasparencies.getValue(o)),null==n&&(n=new nt(e,i,r),this.trasparencies.setValue(o,n));var s=this.getResources.getResources().getName(n);this.streamWriter.setGraphicsState(s)}},e.prototype.clipTranslateMargins=function(t,e,i,r,n,o){if(t instanceof k&&void 0===e)this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y);else if("number"==typeof t){var s=new k(i,r,this.size.width-i-n,this.size.height-r-o);this.clipBounds=s,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(s),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e)}},e.prototype.updateY=function(t){return-t},e.prototype.translateTransform=function(t,e){var i=new tt;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},e.prototype.scaleTransform=function(t,e){var i=new tt;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getScaleTransform=function(t,e,i){return null==i&&(i=new tt),i.scale(t,e),i},e.prototype.rotateTransform=function(t){var e=new tt;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},e.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},e.prototype.getRotateTransform=function(t,e){return null!=e&&void 0!==e||(e=new tt),e.rotate(this.updateY(t)),e},e.prototype.save=function(){var t=new ie(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},e.prototype.restore=function(t){if(void 0===t)this.graphicsState.length>0&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length&&this.doRestoreState()!==t;);},e.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},e.prototype.drawPath=function(t,e,i){e instanceof Qt?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i.pathPoints,i.pathTypes),this.drawPathHelper(t,e,i.fillMode,!1)},e.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof k?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},e.prototype.buildUpPath=function(i,r){for(var n=i.length,o=0;o<n;++o){var s=0,a=i[o];switch(r[o]&e.pathTypesValuesMask){case t.PathPointType.Start:this.pdfStreamWriter.beginPath(a.x,a.y);break;case t.PathPointType.Bezier3:var h=new T(0,0),l=new T(0,0),u=this.getBezierPoints(i,r,o,h,l);this.pdfStreamWriter.appendBezierSegment(a,u.p2,u.p3),o=u.i;break;case t.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(a);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}s=r[o],this.checkFlags(s)}},e.prototype.getBezierPoints=function(i,r,n,o,s){if(++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(o=i[n],++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return s=i[n],{i:n,p2:o,p3:s}},e.prototype.checkFlags=function(e){(e&t.PathPointType.CloseSubpath)===t.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},e.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this.pdfStreamWriter.beginPath(a[0],a[1]);var h=0;for(h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},e.prototype.getBezierArc=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},e.pathTypesValuesMask=15,e.transparencyObject=!1,e}(),ee=function(){function t(t){this.sender=t}return t.prototype.getResources=function(){return this.sender.getResources()},t}(),ie=function(){function e(e,i){this.internalTextRenderingMode=t.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=t.PdfColorSpace.Rgb,void 0!==e&&(this.pdfGraphics=e,this.transformationMatrix=i)}return Object.defineProperty(e.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0}),e}(),re=function(){function t(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i}return t}(),ne=function(){function e(e,i){if(this.pdfColorSpace=t.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new a,null===e)throw new Error("ArgumentNullException:page");if(this.pdfPage=e,this.clipPageTemplates=!0,void 0===i)this.content=new b;else if(i instanceof b||null===i){if(null===i)throw new Error("ArgumentNullException:stream");this.content=i}else this.content=new b,this.clipPageTemplates=i}return Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layers",{get:function(){return null==this.layer?(this.layer=new ae(this.page),this.layer.sublayer=!0,this.layer):this.layer},enumerable:!0,configurable:!0}),e.prototype.add=function(){var t=new e(this.pdfPage);return t.name="",t},e.prototype.sign=function(t){return 0===t?0:t>0?1:-1},e.prototype.initializeGraphics=function(t){var e=t,i=new ee(this.page);if(this.pdfGraphics=new te(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e){var r=e.section.parent;null!=r&&(this.pdfGraphics.colorSpace=r.document.colorSpace,this.colorSpace=r.document.colorSpace)}var n=this.sign(t.origin.y)===this.sign(t.origin.x);(t.origin.x>=0&&t.origin.y>=0||!n)&&this.pdfGraphics.initializeCoordinates();var o=e.section.getActualBounds(e,!0),s=e.section.pageSettings.margins;this.clipPageTemplates?t.origin.x>=0&&t.origin.y>=0&&this.pdfGraphics.clipTranslateMargins(o):this.graphics.clipTranslateMargins(o.x,o.y,s.left,s.top,s.right,s.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(e.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),e}(),oe=function(){function t(){}return Object.defineProperty(t.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0}),t}(),se=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ae=function(t){function e(e){var i=t.call(this)||this;if(i.parentLayerCount=0,i.sublayer=!1,i.optionalContent=new h,e instanceof he){i.page=e;var r=e;i.parseLayers(r)}return i}return se(e,t),e.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},e.prototype.add=function(t,e){if(void 0===t){var i=new ne(this.page);return i.name="",this.add(i),i}if(t instanceof ne){var r=this.list.push(t);return this.addLayer(r,t),r}return 0},e.prototype.addLayer=function(t,e){var i=new C(e);this.page.contents.add(i)},e.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},e.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");var i=new C(e);this.page.contents.insert(t,i)},e.prototype.parseLayers=function(t){var e=this.page.contents;this.page.getResources();t.crossTable;var i=new b,r=new b,n=[];n.push("q"),i.data=n,e.insert(0,new C(i)),(n=[]).push("Q"),r.data=n,e.insert(e.count,new C(r))},e.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)},e}(oe),he=function(){function t(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new a,this.pageDictionary=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayerIndex",{get:function(){if(0===this.layerCollection.count||-1===this.defLayerIndex){var t=this.layerCollection.add();this.defLayerIndex=this.layerCollection.indexOf(t)}return this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new ae(this)),this.layerCollection},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(t.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new m,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0},t}(),le=function(){function e(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new a,this.internalAnnotations=new m,this.lists=[],void 0!==t&&(this.page=t)}return Object.defineProperty(e.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),e.prototype.add=function(t){this.doAdd(t)},e.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new C(t)),this.lists.push(t);var e=(new I).layout(t.text,t.font,t.stringFormat,new j(t.bounds.width,0),!1,new j(0,0)),i=t.bounds.y;if(1===e.lines.length){n=t.font.measureString(e.lines[0].text);t.bounds=new k(new T(t.bounds.x,i),n),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t)}else for(var r=0;r<e.lines.length;r++){var n=t.font.measureString(e.lines[r].text);if(0===r)t.bounds=new k(t.bounds.x,i,n.width,n.height),t.text=e.lines[r].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,n.width,n.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t),i+=t.bounds.height;else{var o=t.clone();o.bounds=new k(new T(t.bounds.x,i),n),o.text=e.lines[r].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new C(o)),this.lists.push(o),i+=o.bounds.height}}},e.prototype.setColor=function(e){var i=t.PdfColorSpace.Rgb,r=e.color.toArray(i);e.dictionary.items.setValue(this.dictionaryProperties.c,r)},Object.defineProperty(e.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0}),e}(),ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ce=function(t){function e(){var e=t.call(this,new h)||this;return e.annotationCollection=null,e.beginSave=null,e.initialize(),e}return ue(e,t),Object.defineProperty(e.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return null===this.section.parent?this.section.parentDocument.crossTable:this.section.parent.document.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new le(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new f(this)},e.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new C(t))},e.prototype.resetProgress=function(){this.isProgressOn=!1},e.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new j(t.width,t.height)},e.prototype.pageBeginSave=function(){var t=this.document;void 0!==typeof t&&null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},e.prototype.drawPageTemplates=function(t){if(this.section.containsTemplates(t,this,!1)){var e=new ne(this,!1);if(this.layers.insert(0,e),this.section.drawTemplates(this,e,t,!1),null!==e.graphics&&void 0!==e.graphics)for(var i=0;i<e.graphics.automaticFields.automaticFields.length;i++){var r=e.graphics.automaticFields.automaticFields[i];r.field.performDraw(e.graphics,r.location,r.scalingX,r.scalingY)}}if(this.section.containsTemplates(t,this,!0)){var n=new ne(this,!1);this.layers.add(n),this.section.drawTemplates(this,n,t,!0)}},e}(he),pe=function(){function t(t){this.pdfPage=void 0!==t?t:null}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),t}(),de=function(){function t(t){if(this.pdfSection=null,null==t)throw Error('ArgumentNullException("section")');this.section=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){return this.section.contains(t)},t.prototype.remove=function(t){this.section.remove(t)},t.prototype.add=function(){return this.section.add()},t}(),fe=function(){function e(){}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftTemplate},set:function(e){this.leftTemplate=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topTemplate},set:function(e){this.topTemplate=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightTemplate},set:function(e){this.rightTemplate=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(e){this.bottomTemplate=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(e){this.evenLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(e){this.evenTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(e){this.evenRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(e){this.evenBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(e){this.oddLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddTop",{get:function(){return this.oddTop},set:function(e){this.oddTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddRight",{get:function(){return this.oddRight},set:function(e){this.oddRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(e){this.oddBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),e.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},e.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},e.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},e.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},e.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},e.prototype.checkElement=function(e,i){if(null!=e){if(void 0!==e.type&&e.type!==t.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");e.type=i}return e},e}(),ge=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),me=function(t){function e(){var e=t.call(this)||this;return e.leftValue=e.topValue=e.rightValue=e.bottomValue=e.stampValue=!0,e}return ge(e,t),Object.defineProperty(e.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0}),e}(fe),ye=function(){function t(t,e){this.pageAdded=new pe,this.pdfPages=[],this.dictionaryProperties=new a,this.pdfDocument=t,void 0===e?(this.settings=t.pageSettings.clone(),this.initialSettings=this.settings.clone()):(this.settings=e.clone(),this.initialSettings=this.settings.clone()),this.initialize()}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new C(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new me),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new de(this)),this.pagesCollection},enumerable:!0,configurable:!0}),t.prototype.getPages=function(){return this.pdfPages},t.prototype.pointToNativePdf=function(t,e){var i=this.getActualBounds(t,!0);return e.x+=i.x,e.y=this.pageSettings.height-e.y,e},t.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},t.prototype.initialize=function(){this.pagesReferences=new m,this.section=new h,this.state=new be(this.pdfDocument),this.section.sectionBeginSave=new d(this,this.state),this.pageCount=new g(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},t.prototype.containsTemplates=function(t,e,i){var r=this.getDocumentTemplates(t,e,i),n=this.getSectionTemplates(e,i);return r.length>0||n.length>0},t.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},t.prototype.getSectionTemplates=function(t,e){var i=[];if(null!=this.template.getTop(t)&&(!(r=this.template.getTop(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getBottom(t)&&(!(r=this.template.getBottom(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getLeft(t)&&(!(r=this.template.getLeft(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getRight(t)){var r=this.template.getRight(t);(!r.foreground&&!e||r.foreground&&e)&&i.push(r)}return i},t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}var i=this.checkPresence(t);this.pdfPages.push(t),this.pagesReferences.add(i),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},t.prototype.checkPresence=function(t){for(var e=new C(t),i=!1,r=this.parent,n=0;n<r.section.length;n++){var o=r.section[n];i=i||o.contains(t)}return e},t.prototype.contains=function(t){return 0<=this.indexOf(t)},t.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new C(t);return this.pagesReferences.indexOf(i)},t.prototype.pageAddedMethod=function(t){var e=new pe(t);this.onPageAdded(e),this.parent.document.pages.onPageAdded(e),this.pageCount.intValue=this.count},t.prototype.onPageAdded=function(t){},t.prototype.getActualBounds=function(t,e,i){if(t instanceof ce&&"boolean"==typeof e){var r=this.parent.document;return this.getActualBounds(r,t,e)}t=t,e=e,i=i;var n=new k(0,0,0,0);n.height=i?this.pageSettings.size.height:this.pageSettings.getActualSize().height,n.width=i?this.pageSettings.size.width:this.pageSettings.getActualSize().width;var o=this.getLeftIndentWidth(t,e,i),s=this.getTopIndentHeight(t,e,i),a=this.getRightIndentWidth(t,e,i),h=this.getBottomIndentHeight(t,e,i);return n.x+=o,n.y+=s,n.width-=o+a,n.height-=s+h,n},t.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.left:0,n=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,o=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return r+=this.template.applyDocumentLeftTemplate?Math.max(n,o):n},t.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.top:0,n=null!=this.template.getTop(e)?this.template.getTop(e).height:0,o=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return r+=this.template.applyDocumentTopTemplate?Math.max(n,o):n},t.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.right:0,n=null!=this.template.getRight(e)?this.template.getRight(e).width:0,o=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return r+=this.template.applyDocumentRightTemplate?Math.max(n,o):n},t.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.bottom:0,n=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,o=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return r+=this.template.applyDocumentBottomTemplate?Math.max(n,o):n},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');var e=this.pdfPages.indexOf(t);this.pagesReferences.removeAt(e);for(var i=[],r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},t.prototype.applyPageSettings=function(t,e,i){var r=new k(i.origin,i.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(r));var n=0;n=we.rotateFactor*i.rotate;var o=new g(n);t.items.setValue(this.dictionaryProperties.rotate,o)},t.prototype.beginSave=function(t,e){var i=e.document;this.applyPageSettings(this.section,i.pageSettings,t)},t.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),o=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,o)},t.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&i.length>0)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)},t}(),be=function(){function t(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}return Object.defineProperty(t.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),t}(),we=function(){function t(t){this.sections=[],this.dictionaryProperties=new a,this.pdfDocument=t.clone(),this.initialize()}return Object.defineProperty(t.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.sectionCount=new g(0),this.sectionCollection=new m,this.pages=new h,this.pages.beginSave=new l(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new h),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},t.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},t.prototype.setPageSettings=function(t,e){var i=new k(new T,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(i))},t.prototype.add=function(t){if(void 0===t){var e=new ye(this.pdfDocument);return this.add(e),e}var i=this.checkSection(t);return this.sections.push(t),t.parent=this,this.sectionCollection.add(i),this.sections.indexOf(t)},t.prototype.checkSection=function(t){var e=new C(t);this.sectionCollection.contains(e);return e},t.prototype.countPages=function(){var t=0;return this.sections.forEach(function(e){return t+=e.count}),t},t.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},t.rotateFactor=90,t}(),Se=function(){function t(t){this.pdfPageCollectionIndex=new n,this.document=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}this.getLastSection().add(t)},t.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},t.prototype.onPageAdded=function(t){},t.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},t.prototype.getPageByIndex=function(t){return this.getPage(t)},t.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=0,n=0,o=this.document.sections.count,s=0;s<o;s++){var a=this.document.sections.section[s];if(r=a.count,n=t-i,t>=i&&n<r){e=a.getPages()[n];break}i+=r}return e},t.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if((e=o.indexOf(t))>=0){e+=i;break}e=-1,i+=o.count}return e},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e},t}(),Pe=function(){function t(){this.referenceObjects=[],this.pdfFontCollection=new n}return t.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():i.length>0&&(e=i[0]),i.push(t),e},t.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},t.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(this.referenceObjects.length>0){var n=this.referenceObjects[r];if(n.length>0){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},t.prototype.removeGroup=function(t){if(null!==t){var e=this.referenceObjects.indexOf(t);this.referenceObjects.slice(e,e+1)}},t.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0},t}(),ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ce=function(e){function i(t){var r=e.call(this)||this;r.defaultMargin=40,r.streamWriter=null,r.document=r;var n=!1;void 0===t?(i.cacheCollection=new Pe,n=!1):n=t;var o=new W;r.setMainObjectCollection(o);var s=new q;s.isMerging=n,s.document=r,r.setCrossTable(s);var a=new U;return r.setCatalog(a),o.add(a),a.position=-1,r.sectionCollection=new we(r),r.documentPageCollection=new Se(r),a.pages=r.sectionCollection,r}return ve(i,e),Object.defineProperty(i,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new xe(t.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Z(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i,"cache",{get:function(){return void 0===i.cacheCollection||null==i.cacheCollection?new Pe:i.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(i,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===t.PdfColorSpace.Rgb||this.pdfColorSpace===t.PdfColorSpace.Cmyk||this.pdfColorSpace===t.PdfColorSpace.GrayScale?this.pdfColorSpace:t.PdfColorSpace.Rgb},set:function(e){e===t.PdfColorSpace.Rgb||e===t.PdfColorSpace.Cmyk||e===t.PdfColorSpace.GrayScale?this.pdfColorSpace=e:this.pdfColorSpace=t.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new fe),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),i.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;var r=new z(t);if(r.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(r);this.crossTable.save(r,e)},i.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},i.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,i.cache.destroy(),this.crossTable.pdfObjects.destroy(),i.cache=void 0,this.streamWriter.destroy()},i.defaultStandardFont=null,i.isCacheEnabled=!0,i}(_),Be=function(){function e(){}return e.getMetrics=function(e,i,r){var n=null;switch(e){case t.PdfFontFamily.Helvetica:n=this.getHelveticaMetrics(e,i,r);break;case t.PdfFontFamily.Courier:n=this.getCourierMetrics(e,i,r);break;case t.PdfFontFamily.TimesRoman:n=this.getTimesMetrics(e,i,r);break;case t.PdfFontFamily.Symbol:n=this.getSymbolMetrics(e,i,r);break;case t.PdfFontFamily.ZapfDingbats:n=this.getZapfDingbatsMetrics(e,i,r);break;default:n=this.getHelveticaMetrics(t.PdfFontFamily.Helvetica,i,r)}return n.name=e.toString(),n.subScriptSizeFactor=this.subSuperScriptFactor,n.superscriptSizeFactor=this.subSuperScriptFactor,n},e.getHelveticaMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaBoldItalicAscent,n.descent=this.helveticaBoldItalicDescent,n.postScriptName=this.helveticaBoldItalicName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.helveticaBoldAscent,n.descent=this.helveticaBoldDescent,n.postScriptName=this.helveticaBoldName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaItalicAscent,n.descent=this.helveticaItalicDescent,n.postScriptName=this.helveticaItalicName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent):(n.ascent=this.helveticaAscent,n.descent=this.helveticaDescent,n.postScriptName=this.helveticaName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent),n},e.getCourierMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierBoldItalicAscent,n.descent=this.courierBoldItalicDescent,n.postScriptName=this.courierBoldItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.courierBoldAscent,n.descent=this.courierBoldDescent,n.postScriptName=this.courierBoldName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierItalicAscent,n.descent=this.courierItalicDescent,n.postScriptName=this.courierItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(n.ascent=this.courierAscent,n.descent=this.courierDescent,n.postScriptName=this.courierName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent),n},e.getTimesMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesBoldItalicAscent,n.descent=this.timesBoldItalicDescent,n.postScriptName=this.timesBoldItalicName,n.size=r,n.widthTable=new Et(this.timesRomanBoldItalicWidths),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.timesBoldAscent,n.descent=this.timesBoldDescent,n.postScriptName=this.timesBoldName,n.size=r,n.widthTable=new Et(this.timesRomanBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesItalicAscent,n.descent=this.timesItalicDescent,n.postScriptName=this.timesItalicName,n.size=r,n.widthTable=new Et(this.timesRomanItalicWidth),n.height=n.ascent-n.descent):(n.ascent=this.timesAscent,n.descent=this.timesDescent,n.postScriptName=this.timesName,n.size=r,n.widthTable=new Et(this.timesRomanWidth),n.height=n.ascent-n.descent),n},e.getSymbolMetrics=function(t,e,i){var r=new It;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new Et(this.symbolWidth),r.height=r.ascent-r.descent,r},e.getZapfDingbatsMetrics=function(t,e,i){var r=new It;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new Et(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},e.subSuperScriptFactor=1.52,e.helveticaAscent=931,e.helveticaDescent=-225,e.helveticaName="Helvetica",e.helveticaBoldAscent=962,e.helveticaBoldDescent=-228,e.helveticaBoldName="Helvetica-Bold",e.helveticaItalicAscent=931,e.helveticaItalicDescent=-225,e.helveticaItalicName="Helvetica-Oblique",e.helveticaBoldItalicAscent=962,e.helveticaBoldItalicDescent=-228,e.helveticaBoldItalicName="Helvetica-BoldOblique",e.courierAscent=805,e.courierDescent=-250,e.courierName="Courier",e.courierBoldAscent=801,e.courierBoldDescent=-250,e.courierBoldName="Courier-Bold",e.courierItalicAscent=805,e.courierItalicDescent=-250,e.courierItalicName="Courier-Oblique",e.courierBoldItalicAscent=801,e.courierBoldItalicDescent=-250,e.courierBoldItalicName="Courier-BoldOblique",e.timesAscent=898,e.timesDescent=-218,e.timesName="Times-Roman",e.timesBoldAscent=935,e.timesBoldDescent=-218,e.timesBoldName="Times-Bold",e.timesItalicAscent=883,e.timesItalicDescent=-217,e.timesItalicName="Times-Italic",e.timesBoldItalicAscent=921,e.timesBoldItalicDescent=-218,e.timesBoldItalicName="Times-BoldItalic",e.symbolAscent=1010,e.symbolDescent=-293,e.symbolName="Symbol",e.zapfDingbatsAscent=820,e.zapfDingbatsDescent=-143,e.zapfDingbatsName="ZapfDingbats",e.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],e.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],e.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],e.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],e.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],e.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],e.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],e.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],e.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918],e}(),Oe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xe=function(e){function i(r,n,o){var s=e.call(this,n,void 0===o?r instanceof i?r.style:t.PdfFontStyle.Regular:o)||this;return s.dictionaryProperties=new a,s.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],s.pdfFontFamily=void 0===r?t.PdfFontFamily.Helvetica:r instanceof i?r.fontFamily:r,s.checkStyle(),s.initializeInternals(),s}return Oe(i,e),Object.defineProperty(i.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),i.prototype.checkStyle=function(){if(this.fontFamily===t.PdfFontFamily.Symbol||this.fontFamily===t.PdfFontFamily.ZapfDingbats){var e=this.style;e&=~(t.PdfFontStyle.Bold|t.PdfFontStyle.Italic),this.setStyle(e)}},i.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var r=0,n=(this.name,0),o=(t=i.convert(t)).length;n<o;n++){var s=t[n];r+=this.getCharWidthInternal(s,e)}var a=this.metrics.getSize(e);return r*=G.charSizeMultiplier*a,r=this.applyFormatSettings(t,e,r)},i.prototype.equalsToFont=function(e){var i=!1,r=e;if(null!=r){var n=this.fontFamily===r.fontFamily,o=~(t.PdfFontStyle.Underline|t.PdfFontStyle.Strikeout),s=(this.style&o)==(r.style&o);i=n&&s}return i},i.prototype.initializeInternals=function(){Ce.cache.search(this);var t=null,e=Be.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=e,t=this.createInternals(),this.setInternals(t)},i.prototype.createInternals=function(){var e=new h;if(e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==t.PdfFontFamily.Symbol&&this.fontFamily!==t.PdfFontFamily.ZapfDingbats){var i=this.encodings[t.FontEncoding.WinAnsiEncoding];e.items.setValue(this.dictionaryProperties.encoding,new o(i))}return e},i.prototype.getCharWidthInternal=function(t,e){var r=0;return r=t.charCodeAt(0),"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(r-=i.charOffset),r=r>=0&&128!==r?r:0,this.metrics.widthTable.items(r)},i.convert=function(t){return t},i.charOffset=32,i}(G),Le=function(){function e(e){this.dictionaryProperties=new a,this.pdfColor=new L(255,255,255),this.rectangle=new k(0,0,0,0),this.pdfPage=null,this.textBrush=new A(new L(0,0,0)),this.textFont=new xe(t.PdfFontFamily.TimesRoman,10),this.format=new D(t.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new h,this.internalColor=new L,this.darkness=1,void 0===e?this.initialize():(this.initialize(),this.bounds=e)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new P(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new p(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},e.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new C(this.pdfPage))},e.prototype.beginSave=function(){this.save()},e.prototype.save=function(){var t=new k(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,r=e.pointToNativePdf(this.page,new T(t.x,t.y));t.x=r.x,t.width=r.x+t.width,t.y=r.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,m.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(this.darkness))},Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0}),e}(),Te=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),je=function(t){function e(e){return t.call(this,e)||this}return Te(e,t),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))},e}(Le),ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ve=function(t){function e(e){var i=t.call(this,e)||this;return i.pdfAction=null,i}return ke(e,t),e.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t},e}(je),Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ne=function(t){function e(e,i){var r=t.call(this,e)||this;return r.pdfDestination=null,void 0!==i&&(r.destination=i),r}return Re(e,t),Object.defineProperty(e.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),e.prototype.save=function(){t.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},e.prototype.clone=function(){var t=new e(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t},e}(je),Ae=function(){function t(t){this.layoutElement=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),t.prototype.getElement=function(){return this.layoutElement},t.prototype.layout=function(t){return this.layoutInternal(t)},t.prototype.Layouter=function(t){return this.layoutInternal(t)},t.prototype.getNextPage=function(t){return t.section.add()},t.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new k(t.bounds.x,0,t.bounds.width,t.bounds.height)},t}(),De=function(){function t(t){void 0===t||(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}return Object.defineProperty(t.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new k(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0}),t}(),Me=function(){function t(){}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new k(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0}),t}(),Ie=function(){function t(t,e){this.pdfPage=t,this.layoutBounds=e}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0}),t}(),Fe=function(){function e(){var e=new Q(new L(0,0,0));e.dashStyle=t.PdfDashStyle.Solid;var i=new Q(new L(0,0,0));i.dashStyle=t.PdfDashStyle.Solid;var r=new Q(new L(0,0,0));r.dashStyle=t.PdfDashStyle.Solid;var n=new Q(new L(0,0,0));n.dashStyle=t.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=i,this.topPen=r,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}(),Ee=function(){function t(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),t}(),Ge=function(){function t(){}return Object.defineProperty(t.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),t.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},t.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},t.prototype.drawHelper=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.bEmbedFonts=i,this.drawHelper(t,e,null);var s=new Me,a=e,h=i;if(s.page=t,s.bounds=a,null!=s){var l=s.bounds.x,u=s.bounds.y;0===s.bounds.x&&(l=Fe.default.right.width/2),0===s.bounds.y&&(u=Fe.default.top.width/2);var c=new k(l,u,s.bounds.width,s.bounds.height);s.bounds=c}return s.format=null!=h?h:new De,this.layout(s)},t}(),ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),We=function(e){function i(t){return e.call(this,t)||this}return ze(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return e.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new He;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},i.prototype.getLayoutResult=function(t){return new _e(t.page,t.bounds,t.remainder,t.lastLineBounds)},i.prototype.layoutOnPage=function(e,i,r,n){var o=new He;o.remainder=e,o.page=i,r=this.checkCorrectBounds(i,r);var s=(new I).layout(e,this.element.font,this.format,r,i.getClientSize().height,!1,new j(0,0)),a=null==s.remainder,h=(n.format.break===t.PdfLayoutBreakType.FitElement||s.empty,i.graphics),l=this.element.getBrush();this.element instanceof Je&&(l.color=new L(0,0,255)),h.drawStringLayoutResult(s,this.element.font,this.element.pen,l,r,this.format);s.lines[s.lineCount-1];return o.lastLineBounds=h.getLineBounds(s.lineCount-1,s,this.element.font,r,this.format),o.bounds=this.getTextPageBounds(i,r,s),o.remainder=s.remainder,o.end=a,o},i.prototype.checkCorrectBounds=function(t,e){var i=t.graphics.clientSize;return e.height=e.height>0?e.height:i.height-e.y,e},i.prototype.getTextPageBounds=function(t,e,i){var r=i.actualSize,n=e.x,o=e.y,s=e.width>0?e.width:r.width,a=r.height;n=t.graphics.checkCorrectLayoutRectangle(r,e.x,e.y,this.format).x;var h=t.graphics.getTextVerticalAlignShift(r.height,e.height,this.format);return new k(n,o+=h,s,a)},i}(Ae),He=function(){function t(){}return t}(),_e=function(t){function e(e,i,r,n){var o=t.call(this,e,i)||this;return o.remainderText=r,o.lastLineTextBounds=n,o}return ze(e,t),Object.defineProperty(e.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),e}(Ie),Ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ue=function(e){function i(t,i,r,n,o){var s=e.call(this)||this;return s.content="",s.elementValue="",s.hasPointOverload=!1,s.isPdfTextElement=!1,void 0===t||("string"==typeof t&&void 0===i?(s.content=t,s.elementValue=t):"string"==typeof t&&i instanceof G&&void 0===r?(s.content=t,s.elementValue=t,s.pdfFont=i):"string"==typeof t&&i instanceof G&&r instanceof Q&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r):"string"==typeof t&&i instanceof G&&r instanceof R&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfBrush=r):(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r,s.pdfBrush=n,s.format=o)),s}return Ke(i,e),Object.defineProperty(i.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof xe&&null!=this.content?this.elementValue=xe.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),i.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new A(new L(0,0,0)):this.pdfBrush},i.prototype.layout=function(t){return new We(this).layout(t)},i.prototype.drawText=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){this.hasPointOverload=!0;var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawText(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var s=new I;if(this.hasPointOverload){var a=s.layout(this.value,this.font,this.stringFormat,new j(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),h=void 0,l=e,u=i;if((f=new Me).page=t,f.bounds=l,f.format=null!=u?u:new De,a.lines.length>1){if(this.text=a.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){g=new T(f.bounds.x,f.bounds.y);h=this.layout(f);for(var c=new k(0,h.bounds.y+a.lineHeight,t.graphics.clientSize.width,a.lineHeight),p=1;p<a.lines.length;p++)if(f.page=h.page,f.bounds=new k(new T(c.x,c.y),new j(c.width,c.height)),this.text=a.layoutLines[p].text,c.y+a.lineHeight>h.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>h.page.graphics.clientSize.height-h.bounds.height?new k(0,h.bounds.height,h.page.graphics.clientSize.width,a.lineHeight):new k(0,0,h.page.graphics.clientSize.width,a.lineHeight),f.bounds=c),h=this.layout(f),p!==a.lines.length-1)c=new k(0,h.bounds.y+a.lineHeight,h.page.graphics.clientSize.width,a.lineHeight);else{m=this.font.measureString(this.text,this.format).width;h=this.calculateResultBounds(h,m,h.page.graphics.clientSize.width,0)}}return h}y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(h=this.layout(f),h=this.calculateResultBounds(h,y.width,h.page.graphics.clientSize.width,0)),h}var h=s.layout(this.value,this.font,this.stringFormat,new j(e.width,0),!1,t.graphics.clientSize),d=void 0,f=new Me,l=e,u=i;if(f.page=t,f.bounds=l,f.format=null!=u?u:new De,h.lines.length>1){if(this.text=h.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){var g=new T(f.bounds.x,f.bounds.y);d=this.layout(f);for(var c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight),p=1;p<h.lines.length;p++)if(f.page=d.page,f.bounds=new k(c.x,c.y,c.width,c.height),this.text=h.layoutLines[p].text,c.y+h.lineHeight>d.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>d.page.graphics.clientSize.height-d.bounds.height?new k(l.x,h.lineHeight,l.width,h.lineHeight):new k(l.x,0,l.width,h.lineHeight),f.bounds=c),d=this.layout(f),p!==h.lines.length-1)c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight);else{var m=this.font.measureString(this.text,this.format).width;d=this.calculateResultBounds(d,m,l.width,l.x)}}return d}var y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(d=this.layout(f),d=this.calculateResultBounds(d,y.width,l.width,l.x)),d},i.prototype.calculateResultBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.bounds.x=n+(r-i)/2,e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.bounds.x=n+(r-i),e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.bounds.x=n,e.bounds.width=r):(e.bounds.width=n,e.bounds.width=i),e},i}(Ge),qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ye=function(t){function e(e,i){var r=t.call(this,e)||this;return void 0!==i&&(r.uri=i),r}return qe(e,t),Object.defineProperty(e.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new x),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)},e}(Ve),Xe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Je=function(e){function i(){var t=e.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new m;for(var i=0;i<3;i++)t.defaultBorder.add(new g(0));return t}return Xe(i,e),Object.defineProperty(i.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),i.prototype.draw=function(e,i){if(e instanceof ce){var r=new I,n=this.font.style;if(i instanceof T){if(this.recalculateBounds=!0,this.font.style=t.PdfFontStyle.Underline,1===(h=r.layout(this.value,this.font,this.stringFormat,new j(e.graphics.clientSize.width-i.x,0),!0,e.graphics.clientSize)).lines.length){var o=this.font.measureString(this.value),s=new k(i,o);s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);a=this.drawText(e,i);return this.font.style=n,a}var a=this.drawMultipleLineWithPoint(h,e,i);return this.font.style=n,a}var h=r.layout(this.value,this.font,this.stringFormat,new j(i.width,0),!1,new j(0,0));if(this.font.style=t.PdfFontStyle.Underline,1===h.lines.length){var o=this.font.measureString(this.value),s=new k(new T(i.x,i.y),o);s=this.calculateBounds(s,o.width,i.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);l=this.drawText(e,i);return this.font.style=n,l}var l=this.drawMultipleLineWithBounds(h,e,i);return this.font.style=n,l}var u=new ce;return u=e.page,this.draw(u,i)},i.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new k(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new T(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},i.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(new T(i.x,i.y),o);if(s=this.calculateBounds(s,o.width,i.width,i.x),this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new k(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},i.prototype.calculateBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.x=n+(r-i)/2,e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.x=n+(r-i),e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.x=n,e.width=r):(e.width=n,e.width=i),e},i}(Ue),Ze=function(){function e(){}return e.convert=function(e,i){var r="";switch(i){case t.PdfNumberStyle.None:r="";break;case t.PdfNumberStyle.Numeric:r=e.toString();break;case t.PdfNumberStyle.LowerLatin:r=this.arabicToLetter(e).toLowerCase();break;case t.PdfNumberStyle.LowerRoman:r=this.arabicToRoman(e).toLowerCase();break;case t.PdfNumberStyle.UpperLatin:r=this.arabicToLetter(e);break;case t.PdfNumberStyle.UpperRoman:r=this.arabicToRoman(e)}return r},e.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M");e+=i.returnValue,t=i.intArabic;var r=this.generateNumber(t,900,"CM");e+=r.returnValue,t=r.intArabic;var n=this.generateNumber(t,500,"D");e+=n.returnValue,t=n.intArabic;var o=this.generateNumber(t,400,"CD");e+=o.returnValue,t=o.intArabic;var s=this.generateNumber(t,100,"C");e+=s.returnValue,t=s.intArabic;var a=this.generateNumber(t,90,"XC");e+=a.returnValue,t=a.intArabic;var h=this.generateNumber(t,50,"L");e+=h.returnValue,t=h.intArabic;var l=this.generateNumber(t,40,"XL");e+=l.returnValue,t=l.intArabic;var u=this.generateNumber(t,10,"X");e+=u.returnValue,t=u.intArabic;var c=this.generateNumber(t,9,"IX");e+=c.returnValue,t=c.intArabic;var p=this.generateNumber(t,5,"V");e+=p.returnValue,t=p.intArabic;var d=this.generateNumber(t,4,"IV");e+=d.returnValue,t=d.intArabic;var f=this.generateNumber(t,1,"I");return e+=f.returnValue,t=f.intArabic,e.toString()},e.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";e.length>0;){var r=e.pop();i=this.appendChar(i,r)}return i.toString()},e.generateNumber=function(t,e,i){for(var r="";t>=e;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},e.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},e.appendChar=function(t,i){return t+=String.fromCharCode(e.acsiiStartIndex+i)},e.letterLimit=26,e.acsiiStartIndex=64,e}(),$e=function(){function t(t,e){this.pdfTemplate=null,this.content="",void 0===t||(this.template=t,this.value=e)}return Object.defineProperty(t.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),t}(),Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ti=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e}return Qe(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getValue(e),s=new Yt(this.getSize());this.list.setValue(e,new $e(s,o));var a=this.getSize();s.graphics.drawString(o,this.getFont(),this.pen,this.getBrush(),0,0,a.width,a.height,this.stringFormat);var h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(s,h,new j(s.width*r,s.height*n))},e}(ht),ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ii=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ei(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t);return this.internalGetValue(e)},i.prototype.internalGetValue=function(t){var e=t.document.pages.indexOf(t)+1;return Ze.convert(e,this.numberStyle)},i}(ti),ri=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ni=function(t){function e(e,i,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var s=t.call(this)||this;return s.internalAutomaticFields=null,s.internalText="",s.font=e,s.brush=i,s.text=r,s.automaticFields=n,s}return ri(e,t),Object.defineProperty(e.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&this.automaticFields.length>0)for(var i=0;i<this.automaticFields.length;i++){var r=this.automaticFields[i];e=e.replace("{"+i+"}",r.getValue(t))}return e},e}(ti),oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),si=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e.painterGraphics=[],e}return oi(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getPageFromGraphics(e).document,s=this.getValue(e);if(this.list.containsKey(o)){var a=this.list.getValue(o),h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(a.template,h,new j(a.template.width*r,a.template.height*n)),this.painterGraphics.push(e)}else{var l=this.getSize(),u=new Yt(l);this.list.setValue(o,new $e(u,s)),u.graphics.drawString(s,this.getFont(),this.pen,this.getBrush(),0,0,l.width,l.height,this.stringFormat);h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(u,h,new j(u.width*r,u.height*n)),this.painterGraphics.push(e)}},e}(ht),ai=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hi=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ai(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t).section.parent.document.pages.count;return Ze.convert(e,this.numberStyle)},i}(si);!function(t){t[t.Location=0]="Location",t[t.FitToPage=1]="FitToPage",t[t.FitR=2]="FitR"}(t.PdfDestinationMode||(t.PdfDestinationMode={}));var li,ui=function(){function e(e,i){this.dictionaryProperties=new a,this.destinationMode=t.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new T(0,0),this.bounds=new k,this.array=new m;t.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new T(0,this.destinationLocation.y),this.pdfPage=e,i instanceof T?this.destinationLocation=i:this.bounds=i}return Object.defineProperty(e.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),e.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},e.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new C(this.pdfPage)),this.destinationMode){case t.PdfDestinationMode.Location:var e=this.pdfPage,i=new T;i=this.pointToNativePdf(e,this.destinationLocation),this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new g(i.x)),this.array.add(new g(i.y)),this.array.add(new g(this.zoomFactor));break;case t.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(e.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0}),e}(),ci=function(){function t(t){this.mDictionary=null,this.mDictionaryProperties=new a,this.mDictionary=t}return Object.defineProperty(t.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),t}(),pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),di=function(t){function e(e,i,r,n){var o=t.call(this,new b)||this;return void 0===e?o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)):(o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)),o.checkParams(e,i,r,n),o.setDomainAndRange(e,i),o.setSizeAndValues(r,n)),o}return pi(e,t),e.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},e.prototype.setDomainAndRange=function(t,e){this.domain=new m(t),this.range=new m(e)},e.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;this.dictionary.items.setValue(this.mDictionaryProperties.size,new m(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new g(8)),i.writeBytes(e)},e}(ci);!function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.End=2]="End",t[t.Both=3]="Both"}(li||(li={}));var fi;!function(t){t[t.BackwardDiagonal=0]="BackwardDiagonal",t[t.ForwardDiagonal=1]="ForwardDiagonal",t[t.Horizontal=2]="Horizontal",t[t.Vertical=3]="Vertical"}(fi||(fi={}));var gi;!function(t){t[t.Function=1]="Function",t[t.Axial=2]="Axial",t[t.Radial=3]="Radial"}(gi||(gi={}));var mi;!function(t){t[t.ActiveBorder=1]="ActiveBorder",t[t.ActiveCaption=2]="ActiveCaption",t[t.ActiveCaptionText=3]="ActiveCaptionText",t[t.AppWorkspace=4]="AppWorkspace",t[t.Control=5]="Control",t[t.ControlDark=6]="ControlDark",t[t.ControlDarkDark=7]="ControlDarkDark",t[t.ControlLight=8]="ControlLight",t[t.ControlLightLight=9]="ControlLightLight",t[t.ControlText=10]="ControlText",t[t.Desktop=11]="Desktop",t[t.GrayText=12]="GrayText",t[t.Highlight=13]="Highlight",t[t.HighlightText=14]="HighlightText",t[t.HotTrack=15]="HotTrack",t[t.InactiveBorder=16]="InactiveBorder",t[t.InactiveCaption=17]="InactiveCaption",t[t.InactiveCaptionText=18]="InactiveCaptionText",t[t.Info=19]="Info",t[t.InfoText=20]="InfoText",t[t.Menu=21]="Menu",t[t.MenuText=22]="MenuText",t[t.ScrollBar=23]="ScrollBar",t[t.Window=24]="Window",t[t.WindowFrame=25]="WindowFrame",t[t.WindowText=26]="WindowText",t[t.Transparent=27]="Transparent",t[t.AliceBlue=28]="AliceBlue",t[t.AntiqueWhite=29]="AntiqueWhite",t[t.Aqua=30]="Aqua",t[t.Aquamarine=31]="Aquamarine",t[t.Azure=32]="Azure",t[t.Beige=33]="Beige",t[t.Bisque=34]="Bisque",t[t.Black=35]="Black",t[t.BlanchedAlmond=36]="BlanchedAlmond",t[t.Blue=37]="Blue",t[t.BlueViolet=38]="BlueViolet",t[t.Brown=39]="Brown",t[t.BurlyWood=40]="BurlyWood",t[t.CadetBlue=41]="CadetBlue",t[t.Chartreuse=42]="Chartreuse",t[t.Chocolate=43]="Chocolate",t[t.Coral=44]="Coral",t[t.CornflowerBlue=45]="CornflowerBlue",t[t.Cornsilk=46]="Cornsilk",t[t.Crimson=47]="Crimson",t[t.Cyan=48]="Cyan",t[t.DarkBlue=49]="DarkBlue",t[t.DarkCyan=50]="DarkCyan",t[t.DarkGoldenrod=51]="DarkGoldenrod",t[t.DarkGray=52]="DarkGray",t[t.DarkGreen=53]="DarkGreen",t[t.DarkKhaki=54]="DarkKhaki",t[t.DarkMagenta=55]="DarkMagenta",t[t.DarkOliveGreen=56]="DarkOliveGreen",t[t.DarkOrange=57]="DarkOrange",t[t.DarkOrchid=58]="DarkOrchid",t[t.DarkRed=59]="DarkRed",t[t.DarkSalmon=60]="DarkSalmon",t[t.DarkSeaGreen=61]="DarkSeaGreen",t[t.DarkSlateBlue=62]="DarkSlateBlue",t[t.DarkSlateGray=63]="DarkSlateGray",t[t.DarkTurquoise=64]="DarkTurquoise",t[t.DarkViolet=65]="DarkViolet",t[t.DeepPink=66]="DeepPink",t[t.DeepSkyBlue=67]="DeepSkyBlue",t[t.DimGray=68]="DimGray",t[t.DodgerBlue=69]="DodgerBlue",t[t.Firebrick=70]="Firebrick",t[t.FloralWhite=71]="FloralWhite",t[t.ForestGreen=72]="ForestGreen",t[t.Fuchsia=73]="Fuchsia",t[t.Gainsboro=74]="Gainsboro",t[t.GhostWhite=75]="GhostWhite",t[t.Gold=76]="Gold",t[t.Goldenrod=77]="Goldenrod",t[t.Gray=78]="Gray",t[t.Green=79]="Green",t[t.GreenYellow=80]="GreenYellow",t[t.Honeydew=81]="Honeydew",t[t.HotPink=82]="HotPink",t[t.IndianRed=83]="IndianRed",t[t.Indigo=84]="Indigo",t[t.Ivory=85]="Ivory",t[t.Khaki=86]="Khaki",t[t.Lavender=87]="Lavender",t[t.LavenderBlush=88]="LavenderBlush",t[t.LawnGreen=89]="LawnGreen",t[t.LemonChiffon=90]="LemonChiffon",t[t.LightBlue=91]="LightBlue",t[t.LightCoral=92]="LightCoral",t[t.LightCyan=93]="LightCyan",t[t.LightGoldenrodYellow=94]="LightGoldenrodYellow",t[t.LightGray=95]="LightGray",t[t.LightGreen=96]="LightGreen",t[t.LightPink=97]="LightPink",t[t.LightSalmon=98]="LightSalmon",t[t.LightSeaGreen=99]="LightSeaGreen",t[t.LightSkyBlue=100]="LightSkyBlue",t[t.LightSlateGray=101]="LightSlateGray",t[t.LightSteelBlue=102]="LightSteelBlue",t[t.LightYellow=103]="LightYellow",t[t.Lime=104]="Lime",t[t.LimeGreen=105]="LimeGreen",t[t.Linen=106]="Linen",t[t.Magenta=107]="Magenta",t[t.Maroon=108]="Maroon",t[t.MediumAquamarine=109]="MediumAquamarine",t[t.MediumBlue=110]="MediumBlue",t[t.MediumOrchid=111]="MediumOrchid",t[t.MediumPurple=112]="MediumPurple",t[t.MediumSeaGreen=113]="MediumSeaGreen",t[t.MediumSlateBlue=114]="MediumSlateBlue",t[t.MediumSpringGreen=115]="MediumSpringGreen",t[t.MediumTurquoise=116]="MediumTurquoise",t[t.MediumVioletRed=117]="MediumVioletRed",t[t.MidnightBlue=118]="MidnightBlue",t[t.MintCream=119]="MintCream",t[t.MistyRose=120]="MistyRose",t[t.Moccasin=121]="Moccasin",t[t.NavajoWhite=122]="NavajoWhite",t[t.Navy=123]="Navy",t[t.OldLace=124]="OldLace",t[t.Olive=125]="Olive",t[t.OliveDrab=126]="OliveDrab",t[t.Orange=127]="Orange",t[t.OrangeRed=128]="OrangeRed",t[t.Orchid=129]="Orchid",t[t.PaleGoldenrod=130]="PaleGoldenrod",t[t.PaleGreen=131]="PaleGreen",t[t.PaleTurquoise=132]="PaleTurquoise",t[t.PaleVioletRed=133]="PaleVioletRed",t[t.PapayaWhip=134]="PapayaWhip",t[t.PeachPuff=135]="PeachPuff",t[t.Peru=136]="Peru",t[t.Pink=137]="Pink",t[t.Plum=138]="Plum",t[t.PowderBlue=139]="PowderBlue",t[t.Purple=140]="Purple",t[t.Red=141]="Red",t[t.RosyBrown=142]="RosyBrown",t[t.RoyalBlue=143]="RoyalBlue",t[t.SaddleBrown=144]="SaddleBrown",t[t.Salmon=145]="Salmon",t[t.SandyBrown=146]="SandyBrown",t[t.SeaGreen=147]="SeaGreen",t[t.SeaShell=148]="SeaShell",t[t.Sienna=149]="Sienna",t[t.Silver=150]="Silver",t[t.SkyBlue=151]="SkyBlue",t[t.SlateBlue=152]="SlateBlue",t[t.SlateGray=153]="SlateGray",t[t.Snow=154]="Snow",t[t.SpringGreen=155]="SpringGreen",t[t.SteelBlue=156]="SteelBlue",t[t.Tan=157]="Tan",t[t.Teal=158]="Teal",t[t.Thistle=159]="Thistle",t[t.Tomato=160]="Tomato",t[t.Turquoise=161]="Turquoise",t[t.Violet=162]="Violet",t[t.Wheat=163]="Wheat",t[t.White=164]="White",t[t.WhiteSmoke=165]="WhiteSmoke",t[t.Yellow=166]="Yellow",t[t.YellowGreen=167]="YellowGreen",t[t.ButtonFace=168]="ButtonFace",t[t.ButtonHighlight=169]="ButtonHighlight",t[t.ButtonShadow=170]="ButtonShadow",t[t.GradientActiveCaption=171]="GradientActiveCaption",t[t.GradientInactiveCaption=172]="GradientInactiveCaption",t[t.MenuBar=173]="MenuBar",t[t.MenuHighlight=174]="MenuHighlight"}(mi||(mi={}));var yi=function(){function t(){}return Object.defineProperty(t,"AliceBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AliceBlue)&&(t=this.sBrushes.getValue(mi.AliceBlue)),null==t&&(t=this.getBrush(mi.AliceBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AntiqueWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AntiqueWhite)&&(t=this.sBrushes.getValue(mi.AntiqueWhite)),null==t&&(t=this.getBrush(mi.AntiqueWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aqua",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aqua)&&(t=this.sBrushes.getValue(mi.Aqua)),null==t&&(t=this.getBrush(mi.Aqua)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aquamarine)&&(t=this.sBrushes.getValue(mi.Aquamarine)),null==t&&(t=this.getBrush(mi.Aquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Azure",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Azure)&&(t=this.sBrushes.getValue(mi.Azure)),null==t&&(t=this.getBrush(mi.Azure)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Beige",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Beige)&&(t=this.sBrushes.getValue(mi.Beige)),null==t&&(t=this.getBrush(mi.Beige)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Bisque",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Bisque)&&(t=this.sBrushes.getValue(mi.Bisque)),null==t&&(t=this.getBrush(mi.Bisque)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Black",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Black)&&(t=this.sBrushes.getValue(mi.Black)),null==t&&(t=this.getBrush(mi.Black)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlanchedAlmond",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlanchedAlmond)&&(t=this.sBrushes.getValue(mi.BlanchedAlmond)),null==t&&(t=this.getBrush(mi.BlanchedAlmond)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Blue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Blue)&&(t=this.sBrushes.getValue(mi.Blue)),null==t&&(t=this.getBrush(mi.Blue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlueViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlueViolet)&&(t=this.sBrushes.getValue(mi.BlueViolet)),null==t&&(t=this.getBrush(mi.BlueViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Brown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Brown)&&(t=this.sBrushes.getValue(mi.Brown)),null==t&&(t=this.getBrush(mi.Brown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BurlyWood",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BurlyWood)&&(t=this.sBrushes.getValue(mi.BurlyWood)),null==t&&(t=this.getBrush(mi.BurlyWood)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CadetBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CadetBlue)&&(t=this.sBrushes.getValue(mi.CadetBlue)),null==t&&(t=this.getBrush(mi.CadetBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chartreuse",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chartreuse)&&(t=this.sBrushes.getValue(mi.Chartreuse)),null==t&&(t=this.getBrush(mi.Chartreuse)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chocolate",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chocolate)&&(t=this.sBrushes.getValue(mi.Chocolate)),null==t&&(t=this.getBrush(mi.Chocolate)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Coral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Coral)&&(t=this.sBrushes.getValue(mi.Coral)),null==t&&(t=this.getBrush(mi.Coral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CornflowerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CornflowerBlue)&&(t=this.sBrushes.getValue(mi.CornflowerBlue)),null==t&&(t=this.getBrush(mi.CornflowerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cornsilk",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cornsilk)&&(t=this.sBrushes.getValue(mi.Cornsilk)),null==t&&(t=this.getBrush(mi.Cornsilk)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Crimson",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Crimson)&&(t=this.sBrushes.getValue(mi.Crimson)),null==t&&(t=this.getBrush(mi.Crimson)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cyan)&&(t=this.sBrushes.getValue(mi.Cyan)),null==t&&(t=this.getBrush(mi.Cyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkBlue)&&(t=this.sBrushes.getValue(mi.DarkBlue)),null==t&&(t=this.getBrush(mi.DarkBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkCyan)&&(t=this.sBrushes.getValue(mi.DarkCyan)),null==t&&(t=this.getBrush(mi.DarkCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGoldenrod)&&(t=this.sBrushes.getValue(mi.DarkGoldenrod)),null==t&&(t=this.getBrush(mi.DarkGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGray)&&(t=this.sBrushes.getValue(mi.DarkGray)),null==t&&(t=this.getBrush(mi.DarkGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGreen)&&(t=this.sBrushes.getValue(mi.DarkGreen)),null==t&&(t=this.getBrush(mi.DarkGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkKhaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkKhaki)&&(t=this.sBrushes.getValue(mi.DarkKhaki)),null==t&&(t=this.getBrush(mi.DarkKhaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkMagenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkMagenta)&&(t=this.sBrushes.getValue(mi.DarkMagenta)),null==t&&(t=this.getBrush(mi.DarkMagenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOliveGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOliveGreen)&&(t=this.sBrushes.getValue(mi.DarkOliveGreen)),null==t&&(t=this.getBrush(mi.DarkOliveGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrange)&&(t=this.sBrushes.getValue(mi.DarkOrange)),null==t&&(t=this.getBrush(mi.DarkOrange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrchid)&&(t=this.sBrushes.getValue(mi.DarkOrchid)),null==t&&(t=this.getBrush(mi.DarkOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkRed)&&(t=this.sBrushes.getValue(mi.DarkRed)),null==t&&(t=this.getBrush(mi.DarkRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSalmon)&&(t=this.sBrushes.getValue(mi.DarkSalmon)),null==t&&(t=this.getBrush(mi.DarkSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSeaGreen)&&(t=this.sBrushes.getValue(mi.DarkSeaGreen)),null==t&&(t=this.getBrush(mi.DarkSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateBlue)&&(t=this.sBrushes.getValue(mi.DarkSlateBlue)),null==t&&(t=this.getBrush(mi.DarkSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateGray)&&(t=this.sBrushes.getValue(mi.DarkSlateGray)),null==t&&(t=this.getBrush(mi.DarkSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkTurquoise)&&(t=this.sBrushes.getValue(mi.DarkTurquoise)),null==t&&(t=this.getBrush(mi.DarkTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkViolet)&&(t=this.sBrushes.getValue(mi.DarkViolet)),null==t&&(t=this.getBrush(mi.DarkViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepPink)&&(t=this.sBrushes.getValue(mi.DeepPink)),null==t&&(t=this.getBrush(mi.DeepPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepSkyBlue)&&(t=this.sBrushes.getValue(mi.DeepSkyBlue)),null==t&&(t=this.getBrush(mi.DeepSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DimGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DimGray)&&(t=this.sBrushes.getValue(mi.DimGray)),null==t&&(t=this.getBrush(mi.DimGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DodgerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DodgerBlue)&&(t=this.sBrushes.getValue(mi.DodgerBlue)),null==t&&(t=this.getBrush(mi.DodgerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Firebrick",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Firebrick)&&(t=this.sBrushes.getValue(mi.Firebrick)),null==t&&(t=this.getBrush(mi.Firebrick)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FloralWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.FloralWhite)&&(t=this.sBrushes.getValue(mi.FloralWhite)),null==t&&(t=this.getBrush(mi.FloralWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ForestGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.ForestGreen)&&(t=this.sBrushes.getValue(mi.ForestGreen)),null==t&&(t=this.getBrush(mi.ForestGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Fuchsia",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Fuchsia)&&(t=this.sBrushes.getValue(mi.Fuchsia)),null==t&&(t=this.getBrush(mi.Fuchsia)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gainsboro",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gainsboro)&&(t=this.sBrushes.getValue(mi.Gainsboro)),null==t&&(t=this.getBrush(mi.Gainsboro)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GhostWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GhostWhite)&&(t=this.sBrushes.getValue(mi.GhostWhite)),null==t&&(t=this.getBrush(mi.GhostWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gold",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gold)&&(t=this.sBrushes.getValue(mi.Gold)),null==t&&(t=this.getBrush(mi.Gold)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Goldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Goldenrod)&&(t=this.sBrushes.getValue(mi.Goldenrod)),null==t&&(t=this.getBrush(mi.Goldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gray)&&(t=this.sBrushes.getValue(mi.Gray)),null==t&&(t=this.getBrush(mi.Gray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Green",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Green)&&(t=this.sBrushes.getValue(mi.Green)),null==t&&(t=this.getBrush(mi.Green)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GreenYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GreenYellow)&&(t=this.sBrushes.getValue(mi.GreenYellow)),null==t&&(t=this.getBrush(mi.GreenYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Honeydew",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Honeydew)&&(t=this.sBrushes.getValue(mi.Honeydew)),null==t&&(t=this.getBrush(mi.Honeydew)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"HotPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.HotPink)&&(t=this.sBrushes.getValue(mi.HotPink)),null==t&&(t=this.getBrush(mi.HotPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IndianRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.IndianRed)&&(t=this.sBrushes.getValue(mi.IndianRed)),null==t&&(t=this.getBrush(mi.IndianRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Indigo",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Indigo)&&(t=this.sBrushes.getValue(mi.Indigo)),null==t&&(t=this.getBrush(mi.Indigo)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Ivory",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Ivory)&&(t=this.sBrushes.getValue(mi.Ivory)),null==t&&(t=this.getBrush(mi.Ivory)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Khaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Khaki)&&(t=this.sBrushes.getValue(mi.Khaki)),null==t&&(t=this.getBrush(mi.Khaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lavender",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lavender)&&(t=this.sBrushes.getValue(mi.Lavender)),null==t&&(t=this.getBrush(mi.Lavender)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LavenderBlush",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LavenderBlush)&&(t=this.sBrushes.getValue(mi.LavenderBlush)),null==t&&(t=this.getBrush(mi.LavenderBlush)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LawnGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LawnGreen)&&(t=this.sBrushes.getValue(mi.LawnGreen)),null==t&&(t=this.getBrush(mi.LawnGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LemonChiffon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LemonChiffon)&&(t=this.sBrushes.getValue(mi.LemonChiffon)),null==t&&(t=this.getBrush(mi.LemonChiffon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightBlue)&&(t=this.sBrushes.getValue(mi.LightBlue)),null==t&&(t=this.getBrush(mi.LightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCoral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCoral)&&(t=this.sBrushes.getValue(mi.LightCoral)),null==t&&(t=this.getBrush(mi.LightCoral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCyan)&&(t=this.sBrushes.getValue(mi.LightCyan)),null==t&&(t=this.getBrush(mi.LightCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGoldenrodYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGoldenrodYellow)&&(t=this.sBrushes.getValue(mi.LightGoldenrodYellow)),null==t&&(t=this.getBrush(mi.LightGoldenrodYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGray)&&(t=this.sBrushes.getValue(mi.LightGray)),null==t&&(t=this.getBrush(mi.LightGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGreen)&&(t=this.sBrushes.getValue(mi.LightGreen)),null==t&&(t=this.getBrush(mi.LightGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightPink)&&(t=this.sBrushes.getValue(mi.LightPink)),null==t&&(t=this.getBrush(mi.LightPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSalmon)&&(t=this.sBrushes.getValue(mi.LightSalmon)),null==t&&(t=this.getBrush(mi.LightSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSeaGreen)&&(t=this.sBrushes.getValue(mi.LightSeaGreen)),null==t&&(t=this.getBrush(mi.LightSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSkyBlue)&&(t=this.sBrushes.getValue(mi.LightSkyBlue)),null==t&&(t=this.getBrush(mi.LightSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSlateGray)&&(t=this.sBrushes.getValue(mi.LightSlateGray)),null==t&&(t=this.getBrush(mi.LightSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSteelBlue)&&(t=this.sBrushes.getValue(mi.LightSteelBlue)),null==t&&(t=this.getBrush(mi.LightSteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightYellow)&&(t=this.sBrushes.getValue(mi.LightYellow)),null==t&&(t=this.getBrush(mi.LightYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lime",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lime)&&(t=this.sBrushes.getValue(mi.Lime)),null==t&&(t=this.getBrush(mi.Lime)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LimeGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LimeGreen)&&(t=this.sBrushes.getValue(mi.LimeGreen)),null==t&&(t=this.getBrush(mi.LimeGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Linen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Linen)&&(t=this.sBrushes.getValue(mi.Linen)),null==t&&(t=this.getBrush(mi.Linen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Magenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Magenta)&&(t=this.sBrushes.getValue(mi.Magenta)),null==t&&(t=this.getBrush(mi.Magenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Maroon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Maroon)&&(t=this.sBrushes.getValue(mi.Maroon)),null==t&&(t=this.getBrush(mi.Maroon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumAquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumAquamarine)&&(t=this.sBrushes.getValue(mi.MediumAquamarine)),null==t&&(t=this.getBrush(mi.MediumAquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumBlue)&&(t=this.sBrushes.getValue(mi.MediumBlue)),null==t&&(t=this.getBrush(mi.MediumBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumOrchid)&&(t=this.sBrushes.getValue(mi.MediumOrchid)),null==t&&(t=this.getBrush(mi.MediumOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumPurple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumPurple)&&(t=this.sBrushes.getValue(mi.MediumPurple)),null==t&&(t=this.getBrush(mi.MediumPurple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSeaGreen)&&(t=this.sBrushes.getValue(mi.MediumSeaGreen)),null==t&&(t=this.getBrush(mi.MediumSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSlateBlue)&&(t=this.sBrushes.getValue(mi.MediumSlateBlue)),null==t&&(t=this.getBrush(mi.MediumSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSpringGreen)&&(t=this.sBrushes.getValue(mi.MediumSpringGreen)),null==t&&(t=this.getBrush(mi.MediumSpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumTurquoise)&&(t=this.sBrushes.getValue(mi.MediumTurquoise)),null==t&&(t=this.getBrush(mi.MediumTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumVioletRed)&&(t=this.sBrushes.getValue(mi.MediumVioletRed)),null==t&&(t=this.getBrush(mi.MediumVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MidnightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MidnightBlue)&&(t=this.sBrushes.getValue(mi.MidnightBlue)),null==t&&(t=this.getBrush(mi.MidnightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MintCream",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MintCream)&&(t=this.sBrushes.getValue(mi.MintCream)),null==t&&(t=this.getBrush(mi.MintCream)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MistyRose",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MistyRose)&&(t=this.sBrushes.getValue(mi.MistyRose)),null==t&&(t=this.getBrush(mi.MistyRose)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Moccasin",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Moccasin)&&(t=this.sBrushes.getValue(mi.Moccasin)),null==t&&(t=this.getBrush(mi.Moccasin)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"NavajoWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.NavajoWhite)&&(t=this.sBrushes.getValue(mi.NavajoWhite)),null==t&&(t=this.getBrush(mi.NavajoWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Navy",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Navy)&&(t=this.sBrushes.getValue(mi.Navy)),null==t&&(t=this.getBrush(mi.Navy)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OldLace",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OldLace)&&(t=this.sBrushes.getValue(mi.OldLace)),null==t&&(t=this.getBrush(mi.OldLace)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Olive",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Olive)&&(t=this.sBrushes.getValue(mi.Olive)),null==t&&(t=this.getBrush(mi.Olive)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OliveDrab",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OliveDrab)&&(t=this.sBrushes.getValue(mi.OliveDrab)),null==t&&(t=this.getBrush(mi.OliveDrab)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orange)&&(t=this.sBrushes.getValue(mi.Orange)),null==t&&(t=this.getBrush(mi.Orange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OrangeRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OrangeRed)&&(t=this.sBrushes.getValue(mi.OrangeRed)),null==t&&(t=this.getBrush(mi.OrangeRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orchid)&&(t=this.sBrushes.getValue(mi.Orchid)),null==t&&(t=this.getBrush(mi.Orchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGoldenrod)&&(t=this.sBrushes.getValue(mi.PaleGoldenrod)),null==t&&(t=this.getBrush(mi.PaleGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGreen)&&(t=this.sBrushes.getValue(mi.PaleGreen)),null==t&&(t=this.getBrush(mi.PaleGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleTurquoise)&&(t=this.sBrushes.getValue(mi.PaleTurquoise)),null==t&&(t=this.getBrush(mi.PaleTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleVioletRed)&&(t=this.sBrushes.getValue(mi.PaleVioletRed)),null==t&&(t=this.getBrush(mi.PaleVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PapayaWhip",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PapayaWhip)&&(t=this.sBrushes.getValue(mi.PapayaWhip)),null==t&&(t=this.getBrush(mi.PapayaWhip)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PeachPuff",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PeachPuff)&&(t=this.sBrushes.getValue(mi.PeachPuff)),null==t&&(t=this.getBrush(mi.PeachPuff)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Peru",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Peru)&&(t=this.sBrushes.getValue(mi.Peru)),null==t&&(t=this.getBrush(mi.Peru)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Pink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Pink)&&(t=this.sBrushes.getValue(mi.Pink)),null==t&&(t=this.getBrush(mi.Pink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Plum",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Plum)&&(t=this.sBrushes.getValue(mi.Plum)),null==t&&(t=this.getBrush(mi.Plum)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PowderBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PowderBlue)&&(t=this.sBrushes.getValue(mi.PowderBlue)),null==t&&(t=this.getBrush(mi.PowderBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Purple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Purple)&&(t=this.sBrushes.getValue(mi.Purple)),null==t&&(t=this.getBrush(mi.Purple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Red",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Red)&&(t=this.sBrushes.getValue(mi.Red)),null==t&&(t=this.getBrush(mi.Red)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RosyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RosyBrown)&&(t=this.sBrushes.getValue(mi.RosyBrown)),null==t&&(t=this.getBrush(mi.RosyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RoyalBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RoyalBlue)&&(t=this.sBrushes.getValue(mi.RoyalBlue)),null==t&&(t=this.getBrush(mi.RoyalBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SaddleBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SaddleBrown)&&(t=this.sBrushes.getValue(mi.SaddleBrown)),null==t&&(t=this.getBrush(mi.SaddleBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Salmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Salmon)&&(t=this.sBrushes.getValue(mi.Salmon)),null==t&&(t=this.getBrush(mi.Salmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SandyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SandyBrown)&&(t=this.sBrushes.getValue(mi.SandyBrown)),null==t&&(t=this.getBrush(mi.SandyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaGreen)&&(t=this.sBrushes.getValue(mi.SeaGreen)),null==t&&(t=this.getBrush(mi.SeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaShell",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaShell)&&(t=this.sBrushes.getValue(mi.SeaShell)),null==t&&(t=this.getBrush(mi.SeaShell)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Sienna",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Sienna)&&(t=this.sBrushes.getValue(mi.Sienna)),null==t&&(t=this.getBrush(mi.Sienna)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Silver",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Silver)&&(t=this.sBrushes.getValue(mi.Silver)),null==t&&(t=this.getBrush(mi.Silver)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SkyBlue)&&(t=this.sBrushes.getValue(mi.SkyBlue)),null==t&&(t=this.getBrush(mi.SkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateBlue)&&(t=this.sBrushes.getValue(mi.SlateBlue)),null==t&&(t=this.getBrush(mi.SlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateGray)&&(t=this.sBrushes.getValue(mi.SlateGray)),null==t&&(t=this.getBrush(mi.SlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Snow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Snow)&&(t=this.sBrushes.getValue(mi.Snow)),null==t&&(t=this.getBrush(mi.Snow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SpringGreen)&&(t=this.sBrushes.getValue(mi.SpringGreen)),null==t&&(t=this.getBrush(mi.SpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SteelBlue)&&(t=this.sBrushes.getValue(mi.SteelBlue)),null==t&&(t=this.getBrush(mi.SteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tan)&&(t=this.sBrushes.getValue(mi.Tan)),null==t&&(t=this.getBrush(mi.Tan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Teal",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Teal)&&(t=this.sBrushes.getValue(mi.Teal)),null==t&&(t=this.getBrush(mi.Teal)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Thistle",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Thistle)&&(t=this.sBrushes.getValue(mi.Thistle)),null==t&&(t=this.getBrush(mi.Thistle)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tomato",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tomato)&&(t=this.sBrushes.getValue(mi.Tomato)),null==t&&(t=this.getBrush(mi.Tomato)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Transparent",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Transparent)&&(t=this.sBrushes.getValue(mi.Transparent)),null==t&&(t=this.getBrush(mi.Transparent)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Turquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Turquoise)&&(t=this.sBrushes.getValue(mi.Turquoise)),null==t&&(t=this.getBrush(mi.Turquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Violet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Violet)&&(t=this.sBrushes.getValue(mi.Violet)),null==t&&(t=this.getBrush(mi.Violet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Wheat",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Wheat)&&(t=this.sBrushes.getValue(mi.Wheat)),null==t&&(t=this.getBrush(mi.Wheat)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"White",{get:function(){var t=null;return this.sBrushes.containsKey(mi.White)&&(t=this.sBrushes.getValue(mi.White)),null==t&&(t=this.getBrush(mi.White)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WhiteSmoke",{get:function(){var t=null;return this.sBrushes.containsKey(mi.WhiteSmoke)&&(t=this.sBrushes.getValue(mi.WhiteSmoke)),null==t&&(t=this.getBrush(mi.WhiteSmoke)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Yellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Yellow)&&(t=this.sBrushes.getValue(mi.Yellow)),null==t&&(t=this.getBrush(mi.Yellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"YellowGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.YellowGreen)&&(t=this.sBrushes.getValue(mi.YellowGreen)),null==t&&(t=this.getBrush(mi.YellowGreen)),t},enumerable:!0,configurable:!0}),t.getBrush=function(t){var e=this.getColorValue(t),i=new A(e);return this.sBrushes.setValue(t,i),i},t.getColorValue=function(t){var e=new L;switch(t){case mi.Transparent:e=new L(0,255,255,255);break;case mi.AliceBlue:e=new L(255,240,248,255);break;case mi.AntiqueWhite:e=new L(255,250,235,215);break;case mi.Aqua:e=new L(255,0,255,255);break;case mi.Aquamarine:e=new L(255,127,255,212);break;case mi.Azure:e=new L(255,240,255,255);break;case mi.Beige:e=new L(255,245,245,220);break;case mi.Bisque:e=new L(255,255,228,196);break;case mi.Black:e=new L(255,0,0,0);break;case mi.BlanchedAlmond:e=new L(255,255,235,205);break;case mi.Blue:e=new L(255,0,0,255);break;case mi.BlueViolet:e=new L(255,138,43,226);break;case mi.Brown:e=new L(255,165,42,42);break;case mi.BurlyWood:e=new L(255,222,184,135);break;case mi.CadetBlue:e=new L(255,95,158,160);break;case mi.Chartreuse:e=new L(255,127,255,0);break;case mi.Chocolate:e=new L(255,210,105,30);break;case mi.Coral:e=new L(255,255,127,80);break;case mi.CornflowerBlue:e=new L(255,100,149,237);break;case mi.Cornsilk:e=new L(255,255,248,220);break;case mi.Crimson:e=new L(255,220,20,60);break;case mi.Cyan:e=new L(255,0,255,255);break;case mi.DarkBlue:e=new L(255,0,0,139);break;case mi.DarkCyan:e=new L(255,0,139,139);break;case mi.DarkGoldenrod:e=new L(255,184,134,11);break;case mi.DarkGray:e=new L(255,169,169,169);break;case mi.DarkGreen:e=new L(255,0,100,0);break;case mi.DarkKhaki:e=new L(255,189,183,107);break;case mi.DarkMagenta:e=new L(255,139,0,139);break;case mi.DarkOliveGreen:e=new L(255,85,107,47);break;case mi.DarkOrange:e=new L(255,255,140,0);break;case mi.DarkOrchid:e=new L(255,153,50,204);break;case mi.DarkRed:e=new L(255,139,0,0);break;case mi.DarkSalmon:e=new L(255,233,150,122);break;case mi.DarkSeaGreen:e=new L(255,143,188,139);break;case mi.DarkSlateBlue:e=new L(255,72,61,139);break;case mi.DarkSlateGray:e=new L(255,47,79,79);break;case mi.DarkTurquoise:e=new L(255,0,206,209);break;case mi.DarkViolet:e=new L(255,148,0,211);break;case mi.DeepPink:e=new L(255,255,20,147);break;case mi.DeepSkyBlue:e=new L(255,0,191,255);break;case mi.DimGray:e=new L(255,105,105,105);break;case mi.DodgerBlue:e=new L(255,30,144,255);break;case mi.Firebrick:e=new L(255,178,34,34);break;case mi.FloralWhite:e=new L(255,255,250,240);break;case mi.ForestGreen:e=new L(255,34,139,34);break;case mi.Fuchsia:e=new L(255,255,0,255);break;case mi.Gainsboro:e=new L(255,220,220,220);break;case mi.GhostWhite:e=new L(255,248,248,255);break;case mi.Gold:e=new L(255,255,215,0);break;case mi.Goldenrod:e=new L(255,218,165,32);break;case mi.Gray:e=new L(255,128,128,128);break;case mi.Green:e=new L(255,0,128,0);break;case mi.GreenYellow:e=new L(255,173,255,47);break;case mi.Honeydew:e=new L(255,240,255,240);break;case mi.HotPink:e=new L(255,255,105,180);break;case mi.IndianRed:e=new L(255,205,92,92);break;case mi.Indigo:e=new L(255,75,0,130);break;case mi.Ivory:e=new L(255,255,255,240);break;case mi.Khaki:e=new L(255,240,230,140);break;case mi.Lavender:e=new L(255,230,230,250);break;case mi.LavenderBlush:e=new L(255,255,240,245);break;case mi.LawnGreen:e=new L(255,124,252,0);break;case mi.LemonChiffon:e=new L(255,255,250,205);break;case mi.LightBlue:e=new L(255,173,216,230);break;case mi.LightCoral:e=new L(255,240,128,128);break;case mi.LightCyan:e=new L(255,224,255,255);break;case mi.LightGoldenrodYellow:e=new L(255,250,250,210);break;case mi.LightGreen:e=new L(255,144,238,144);break;case mi.LightGray:e=new L(255,211,211,211);break;case mi.LightPink:e=new L(255,255,182,193);break;case mi.LightSalmon:e=new L(255,255,160,122);break;case mi.LightSeaGreen:e=new L(255,32,178,170);break;case mi.LightSkyBlue:e=new L(255,135,206,250);break;case mi.LightSlateGray:e=new L(255,119,136,153);break;case mi.LightSteelBlue:e=new L(255,176,196,222);break;case mi.LightYellow:e=new L(255,255,255,224);break;case mi.Lime:e=new L(255,0,255,0);break;case mi.LimeGreen:e=new L(255,50,205,50);break;case mi.Linen:e=new L(255,250,240,230);break;case mi.Magenta:e=new L(255,255,0,255);break;case mi.Maroon:e=new L(255,128,0,0);break;case mi.MediumAquamarine:e=new L(255,102,205,170);break;case mi.MediumBlue:e=new L(255,0,0,205);break;case mi.MediumOrchid:e=new L(255,186,85,211);break;case mi.MediumPurple:e=new L(255,147,112,219);break;case mi.MediumSeaGreen:e=new L(255,60,179,113);break;case mi.MediumSlateBlue:e=new L(255,123,104,238);break;case mi.MediumSpringGreen:e=new L(255,0,250,154);break;case mi.MediumTurquoise:e=new L(255,72,209,204);break;case mi.MediumVioletRed:e=new L(255,199,21,133);break;case mi.MidnightBlue:e=new L(255,25,25,112);break;case mi.MintCream:e=new L(255,245,255,250);break;case mi.MistyRose:e=new L(255,255,228,225);break;case mi.Moccasin:e=new L(255,255,228,181);break;case mi.NavajoWhite:e=new L(255,255,222,173);break;case mi.Navy:e=new L(255,0,0,128);break;case mi.OldLace:e=new L(255,253,245,230);break;case mi.Olive:e=new L(255,128,128,0);break;case mi.OliveDrab:e=new L(255,107,142,35);break;case mi.Orange:e=new L(255,255,165,0);break;case mi.OrangeRed:e=new L(255,255,69,0);break;case mi.Orchid:e=new L(255,218,112,214);break;case mi.PaleGoldenrod:e=new L(255,238,232,170);break;case mi.PaleGreen:e=new L(255,152,251,152);break;case mi.PaleTurquoise:e=new L(255,175,238,238);break;case mi.PaleVioletRed:e=new L(255,219,112,147);break;case mi.PapayaWhip:e=new L(255,255,239,213);break;case mi.PeachPuff:e=new L(255,255,218,185);break;case mi.Peru:e=new L(255,205,133,63);break;case mi.Pink:e=new L(255,255,192,203);break;case mi.Plum:e=new L(255,221,160,221);break;case mi.PowderBlue:e=new L(255,176,224,230);break;case mi.Purple:e=new L(255,128,0,128);break;case mi.Red:e=new L(255,255,0,0);break;case mi.RosyBrown:e=new L(255,188,143,143);break;case mi.RoyalBlue:e=new L(255,65,105,225);break;case mi.SaddleBrown:e=new L(255,139,69,19);break;case mi.Salmon:e=new L(255,250,128,114);break;case mi.SandyBrown:e=new L(255,244,164,96);break;case mi.SeaGreen:e=new L(255,46,139,87);break;case mi.SeaShell:e=new L(255,255,245,238);break;case mi.Sienna:e=new L(255,160,82,45);break;case mi.Silver:e=new L(255,192,192,192);break;case mi.SkyBlue:e=new L(255,135,206,235);break;case mi.SlateBlue:e=new L(255,106,90,205);break;case mi.SlateGray:e=new L(255,112,128,144);break;case mi.Snow:e=new L(255,255,250,250);break;case mi.SpringGreen:e=new L(255,0,255,127);break;case mi.SteelBlue:e=new L(255,70,130,180);break;case mi.Tan:e=new L(255,210,180,140);break;case mi.Teal:e=new L(255,0,128,128);break;case mi.Thistle:e=new L(255,216,191,216);break;case mi.Tomato:e=new L(255,255,99,71);break;case mi.Turquoise:e=new L(255,64,224,208);break;case mi.Violet:e=new L(255,238,130,238);break;case mi.Wheat:e=new L(255,245,222,179);break;case mi.White:e=new L(255,255,255,255);break;case mi.WhiteSmoke:e=new L(255,245,245,245);break;case mi.Yellow:e=new L(255,255,255,0);break;case mi.YellowGreen:e=new L(255,154,205,50)}return e},t.sBrushes=new n,t}(),bi=function(){function e(t){this.precision=1e3}return Object.defineProperty(e.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||e[i]>1)&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),e.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new Si(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else{var o=t[0],s=t[1];n=new Array(this.count);var a=0,h=this.count;for(a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e)}return i.positions=r,i.colors=n,i},e.prototype.clonePdfBlend=function(){var t=this;return null!=this.mFactors&&(t.factors=this.mFactors),null!=this.positions&&(t.positions=this.positions),t},e.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||t>1)throw new Error("ArgumentOutOfRangeException : u");if(e<0||e>1)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),r=Math.max(1,e*this.precision);return this.gcdInt(i,r)/this.precision}var n=t;if(null==n)throw new Error("ArgumentNullException : values");if(n.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var o=n[0];if(n.length>1)for(var s=n.length,a=1;a<s&&(o=this.gcd(n[a],o))!==1/this.precision;++a);return o},e.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i=0;this.isEven(t,e);)++i,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1;if(t>e){var r=e;e=t,t=r}e-=t}while(0!==e);return t<<i},e.prototype.isEven=function(t,e){if("number"==typeof e&&void 0!==e){var i=!0;return i=i&&(1&t)<=0,i=i&&(1&e)<=0}return(1&t)<=0},e.prototype.interpolate=function(e,i,r,n){if(i instanceof L){var o=new L;switch(n){case t.PdfColorSpace.Rgb:var s=this.interpolate(e,i.red,r.red),a=this.interpolate(e,i.green,r.green),h=this.interpolate(e,i.blue,r.blue);o=new L(s,a,h);break;case t.PdfColorSpace.GrayScale:var l=this.interpolate(e,i.gray,r.gray);o=new L(l);break;case t.PdfColorSpace.Cmyk:var u=this.interpolate(e,i.c,r.c),c=this.interpolate(e,i.m,r.m),p=this.interpolate(e,i.y,r.y),d=this.interpolate(e,i.k,r.k);o=new L(u,c,p,d)}return o}return 0===e?i:1===e?r:i+(r-i)/1*(e-0)},e}(),wi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Si=function(e){function i(t){var i=e.call(this)||this;return"number"==typeof t&&(i=e.call(this,t)||this),i}return wi(i,e),Object.defineProperty(i.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),i.prototype.getFunction=function(t){var e=[0,1],i=this.getColorComponentsCount(t),r=this.getMaxComponentValue(t),n=this.setRange(i,r),o=null;if(null==this.mbrush&&void 0===this.mbrush){var s=[1],a=void 0,h=1;if(2===this.positions.length)a=2;else{var l=this.positions,u=this.getIntervals(l),c=this.gcd(u);h=c,a=1/c+1}s[0]=a;var p=this.getSamplesValues(t,a,r,h);return o=new di(e,n,s,p)}return o},i.prototype.cloneColorBlend=function(){var t=this;return null!=this.mcolors&&void 0!==this.mcolors&&(t.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(t.positions=this.positions),t},i.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},i.prototype.getColorComponentsCount=function(e){var i=0;switch(e){case t.PdfColorSpace.Rgb:i=3;break;case t.PdfColorSpace.Cmyk:i=4;break;case t.PdfColorSpace.GrayScale:i=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return i},i.prototype.getSamplesValues=function(e,i,r,n){var o;switch(e){case t.PdfColorSpace.GrayScale:o=this.getGrayscaleSamples(i,r,n);break;case t.PdfColorSpace.Cmyk:o=this.getCmykSamples(i,r,n);break;case t.PdfColorSpace.Rgb:o=this.getRgbSamples(i,r,n);break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return o},i.prototype.getGrayscaleSamples=function(e,i,r){for(var n=[2*e],o=0;o<e;++o)this.getNextColor(o,r,t.PdfColorSpace.GrayScale);return n},i.prototype.getRgbSamples=function(e,i,r){for(var n=[3*e],o=0;o<e;++o){var s=this.getNextColor(o,r,t.PdfColorSpace.Rgb),a=3*o;n[a]=s.r,n[a+1]=s.g,n[a+2]=s.b}return n},i.prototype.getCmykSamples=function(e,i,r){for(var n=[4*e],o=0;o<e;o++){var s=this.getNextColor(o,r,t.PdfColorSpace.Cmyk),a=4*o;n[a]=s.c*i,n[a+1]=s.m*i,n[a+2]=s.y*i,n[a+3]=s.k*i}return n},i.prototype.getNextColor=function(t,e,i){var r,n,o,s=e*t,a=this.getIndices(s,n,r);if((n=a.indexLow)===(r=a.indexHi))o=this.mcolors[n];else{var h=this.positions[n],l=this.positions[r],u=this.mcolors[n],c=this.mcolors[r],p=(s-h)/(l-h);o=this.interpolate(p,u,c,i)}return o},i.prototype.getIndices=function(t,e,i){var r=this.positions;e=0,i=0;for(var n=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){i=n,e=n;break}if(o>t){i=n;break}e=n,i=n}return{indexLow:e,indexHi:i}},i.prototype.getMaxComponentValue=function(e){var i=0;switch(e){case t.PdfColorSpace.Cmyk:case t.PdfColorSpace.Rgb:i=255;break;case t.PdfColorSpace.GrayScale:i=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+"colorSpace")}return i},i.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i},i}(bi),Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vi=function(e){function i(t,i,r,n){var o=e.call(this,new h)||this;if(o.mDictionaryProperties=new a,t instanceof T&&i instanceof T&&r instanceof L&&n instanceof L)o.initialize(r,n),o.mPointStart=t,o.mPointEnd=i,o.setPoints(o.mPointStart,o.mPointEnd);else if(t instanceof V)if(o.initialize(i,r),n===fi.BackwardDiagonal||n===fi.ForwardDiagonal||n===fi.Horizontal||n===fi.Vertical){switch(o.mBoundaries=t,n){case fi.BackwardDiagonal:o.mPointStart=new T(t.right,t.top),o.mPointEnd=new T(t.left,t.bottom);break;case fi.ForwardDiagonal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.bottom);break;case fi.Horizontal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);break;case fi.Vertical:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+n+" mode")}o.setPoints(o.mPointStart,o.mPointEnd)}else if("number"==typeof n&&void 0!==n){if(o.mBoundaries=t,0===(n%=360))o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);else if(90===n)o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);else if(180===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.right,t.top);else if(270===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.left,t.bottom);else{var s=n*(Math.PI/180),l=Math.tan(s),u=o.mBoundaries.left+(o.mBoundaries.right-o.mBoundaries.left)/2,c=o.mBoundaries.top+(o.mBoundaries.bottom-o.mBoundaries.top)/2,p=new T(u,c);c=l*(u=o.mBoundaries.width/(2*Math.cos(s))),u+=p.x,c+=p.y;var d=new T(u,c),f=o.subPoints(d,p),g=o.choosePoint(n),m=o.mulPoints(o.subPoints(g,p),f)/o.mulPoints(f,f);o.mPointEnd=o.addPoints(p,o.mulPoint(f,m)),o.mPointStart=o.addPoints(p,o.mulPoint(f,-1*m))}o.setPoints(o.mPointEnd,o.mPointStart)}return o}return Pi(i,e),i.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new Si(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new Si(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!=e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.addPoints=function(t,e){var i=t.x+e.x,r=t.y+e.y;return new T(i,r)},i.prototype.subPoints=function(t,e){var i=t.x-e.x,r=t.y-e.y;return new T(i,r)},i.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},i.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},i.prototype.choosePoint=function(t){var e=new T(0,0);if(t<90&&t>0)e=new T(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&t>90)e=new T(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&t>180)e=new T(this.mBoundaries.left,this.mBoundaries.top);else{if(!(t>270))throw new Error("PdfException - Internal error.");e=new T(this.mBoundaries.right,this.mBoundaries.top)}return e},i.prototype.setPoints=function(t,e){var i=new m;i.add(new g(t.x)),i.add(new g(this.updateY(t.y))),i.add(new g(e.x)),i.add(new g(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Axial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof i&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)},i}(qt),Ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bi=function(e){function i(t,i,r,n,o,s){var l=e.call(this,new h)||this;if(l.mDictionaryProperties=new a,l.initialize(o,s),i<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(n<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return l.mPointEnd=r,l.mPointStart=t,l.mRadiusStart=i,l.mRadiusEnd=n,l.setPoints(l.mPointStart,l.mPointEnd,l.mRadiusStart,l.mRadiusEnd),l}return Ci(i,e),i.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new Si(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new Si(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=m.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!==e&&void 0!==e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t,e,i,r){var n=new m;n.add(new g(t.x)),n.add(new g(this.updateY(t.y))),n.add(new g(i)),n.add(new g(e.x)),n.add(new g(this.updateY(e.y))),i!==r?n.add(new g(r)):n.add(new g(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Radial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof i&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)},i}(qt);!function(t){t[t.Overlap=0]="Overlap",t[t.Inside=1]="Inside"}(t.PdfBorderOverlapStyle||(t.PdfBorderOverlapStyle={}));var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xi=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),t}(),Li=function(e){function i(){var i=e.call(this)||this;return i.gridBorderOverlapStyle=t.PdfBorderOverlapStyle.Overlap,i.bAllowHorizontalOverflow=!1,i.gridHorizontalOverflowType=t.PdfHorizontalOverflowType.LastPage,i}return Oi(i,e),Object.defineProperty(i.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new Ee),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding?(this.gridCellPadding=new Ee,this.gridCellPadding=t):this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0}),i}(xi),Ti=function(t){function e(){var e=t.call(this)||this;return e.gridCellBorders=Fe.default,e}return Oi(e,t),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new Ee),this.gridCellPadding=t},enumerable:!0,configurable:!0}),e}(xi),ji=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),t.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),t.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),t.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(t.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),t.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(t.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Fe),this.gridRowBorder},enumerable:!0,configurable:!0}),t.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},t.prototype.setParent=function(t){this.parent=t},Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),t}();!function(t){t[t.NextPage=0]="NextPage",t[t.LastPage=1]="LastPage"}(t.PdfHorizontalOverflowType||(t.PdfHorizontalOverflowType={}));var ki=function(){function e(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}return Object.defineProperty(e.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new D),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Fi){this.row.grid.isSingleGrid=!1,this.objectValue.ParentCell=this,this.objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Ti),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return(0===this.cellWidth||this.row.grid.isComplete)&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var t=0,e=new I;if("string"==typeof this.objectValue)t+=e.layout(this.objectValue,this.getTextFont(),this.stringFormat,new j(Number.MAX_VALUE,Number.MAX_VALUE),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width);else if(this.objectValue instanceof Fi)t=this.objectValue.size.width;else if(this.objectValue instanceof ft||this.objectValue instanceof mt)t+=this.objectValue.width;else if(this.objectValue instanceof Je){var i=this.objectValue;t+=e.layout(i.text,i.font,i.stringFormat,new j(0,0),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width)}return this.objectValue instanceof Fi?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(t+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(t+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?t+=this.style.cellPadding.left+this.style.cellPadding.right:t+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,t+=this.row.grid.style.cellSpacing},e.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();if(null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage){this.getBackgroundImage();t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height)}},e.prototype.adjustContentLayoutArea=function(t){var e=new k(t.x,t.y,t.width,t.height);return this.objectValue instanceof Fi?(null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.gridRow.grid.style.cellPadding.left&&this.gridRow.grid.style.cellPadding.hasLeftPad&&(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&this.gridRow.grid.style.cellPadding.hasTopPad&&(e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&this.gridRow.grid.style.cellPadding.hasRightPad&&(e.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&this.gridRow.grid.style.cellPadding.hasBottomPad&&(e.height-=this.gridRow.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e.height-=this.style.cellPadding.bottom)),e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):void 0===this.style.cellPadding||null==this.style.cellPadding?(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,e.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.style.cellPadding.right+this.style.cellPadding.left,e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width,1===this.rowSpan&&(e.width-=this.style.borders.left.width)),e},e.prototype.draw=function(e,i,r){var n=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return n;if(this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return n}i=this.adjustOuterLayoutArea(i,e),this.drawCellBackground(e,i);var o=this.getTextPen(),s=this.getTextBrush();void 0===o&&void 0===s&&(s=new A(new L(0,0,0)));var a=this.getTextFont(),h=this.getStringFormat(),l=i;if(l.height>=e.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(l.height-=l.y),l=this.adjustContentLayoutArea(l),"string"==typeof this.objectValue||"string"==typeof this.remaining){var u=void 0,c=void 0;if(c=l.height<a.height?new k(l.x,l.y,l.width,a.height):l,l.height<a.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell){var p=c.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom;-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),p>0&&p<a.height&&(c.height=p)}0!=this.gridRow.grid.style.cellSpacing&&(c.width-=this.gridRow.grid.style.cellSpacing,i.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(u=""===this.remaining?this.remaining:this.objectValue,e.drawString(u,a,o,s,c.x,c.y,c.width,c.height,h),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&e.drawString(this.remaining,a,o,s,c.x,c.y,c.width,c.height,h),this.isFinish=!0),n=e.stringLayoutResult}else if(this.objectValue instanceof Fi){var d=this.objectValue;d.isChildGrid=!0,d.ParentCell=this;var f=void 0;f=l,0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing);var g=new Gi(d),m=new Wi;null!=this.row.grid.LayoutFormat?m=this.row.grid.LayoutFormat:m.layout=t.PdfLayoutType.Paginate;var y=new Me;if(null!=e.layer){y.page=e.page,y.bounds=f,y.format=m,d.setSpan(),d.checkSpan();var b=g.Layouter(y);this.value=d,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),y.page!=b.page&&(b.bounds.height=this.row.rowBreakHeightValue,0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=b:this.row.rowBreakHeight=this.row.rowBreakHeightValue)}}else if(this.objectValue instanceof ft||this.objectValue instanceof mt){var w=void 0;w=this.objectValue.width<=l.width?new k(l.x,l.y,this.objectValue.width,l.height):l,e.drawImage(this.objectValue,w.x,w.y,w.width,w.height)}else this.objectValue instanceof Je?this.objectValue.draw(e.currentPage,l):void 0===this.objectValue&&(this.objectValue="",e.drawString(this.objectValue,a,o,s,l.x,l.y,l.width,l.height,h),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(i.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing));return null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(e,i)):this.drawCellBorders(e,i)),n},e.prototype.drawCellBorders=function(e,i){this.row.grid.style.borderOverlapStyle===t.PdfBorderOverlapStyle.Inside&&(i.x+=this.style.borders.left.width,i.y+=this.style.borders.top.width,i.width-=this.style.borders.right.width,i.height-=this.style.borders.bottom.width);var r=new T(i.x,i.y+i.height),n=new T(i.x,i.y),o=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y),n=new T(i.x+i.width,i.y+i.height),o=this.cellStyle.borders.right,i.x+i.width>e.clientSize.width-o.width/2&&(r=new T(e.clientSize.width-o.width/2,i.y),n=new T(e.clientSize.width-o.width/2,i.y+i.height)),this.cellStyle.borders.right.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x,i.y),n=new T(i.x+i.width,i.y),o=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y+i.height),n=new T(i.x,i.y+i.height),o=this.cellStyle.borders.bottom,i.y+i.height>e.clientSize.height-o.width/2&&(r=new T(i.x+i.width,e.clientSize.height-o.width/2),n=new T(i.x,e.clientSize.height-o.width/2)),this.cellStyle.borders.bottom.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n)},e.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing;r>0&&(t=new k(t.x+r,t.y+r,t.width-r,t.height-r));var n=this.row.cells.indexOf(this);if(this.columnSpan>1||this.row.rowOverflowIndex>0&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(l=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)l++;for(var s=0,a=n;a<n+l;a++){if(this.row.grid.style.allowHorizontalOverflow){var h=this.row.grid.size.width<e.clientSize.width?this.row.grid.size.width:e.clientSize.width;if((this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width)>h)break}s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(this.rowSpan>1||this.row.rowSpanExists){var l=this.rowSpan,u=this.row.grid.rows.rowCollection.indexOf(this.row);-1==u&&-1!=(u=this.row.grid.headers.indexOf(this.row))&&(i=!0);for(var c=0,a=u;a<u+l;a++){c+=i?this.row.grid.headers.getHeader(a).height:this.row.grid.rows.getRow(a).height;var p=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(p)}this.row.cells.indexOf(this);c-=this.row.grid.style.cellSpacing,t.height=c,this.row.rowMergeComplete||(t.height=c)}return t},e.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Ce.defaultFont},e.prototype.getTextBrush=function(){return void 0!==this.style.textBrush&&null!=this.style.textBrush?this.style.textBrush:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row.style.textBrush:this.row.grid.style.textBrush},e.prototype.getTextPen=function(){return void 0!==this.style.textPen&&null!=this.style.textPen?this.style.textPen:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row.style.textPen:this.row.grid.style.textPen},e.prototype.getBackgroundBrush=function(){return void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this.style.backgroundBrush:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row.style.backgroundBrush:this.row.grid.style.backgroundBrush},e.prototype.getBackgroundImage=function(){return void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this.style.backgroundImage:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row.style.backgroundImage:this.row.grid.style.backgroundImage},e.prototype.getStringFormat=function(){return void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style.stringFormat:this.stringFormat},e.prototype.measureHeight=function(){var t=this.calculateWidth();null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width);var e=0,i=new I;if("string"==typeof this.objectValue||"string"==typeof this.remaining){var r=this.objectValue;this.isFinish||(r=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue);n=this.row.cells.indexOf(this);0!=this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan||(this.gridRow.grid.isChildGrid?(t<0?(this.tempval=t,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=t,e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(this.tempval,0),!1,new j(0,0)).actualSize.height):e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else if(this.objectValue instanceof Fi){var n=this.row.cells.indexOf(this),o=0;null!=this.style.cellPadding||void 0!==this.style.cellPadding?(o=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(o-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(o-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(o=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(o-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(o-=this.row.grid.style.cellPadding.right)):o=this.calculateWidth(),this.objectValue.tempWidth=o,this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan?e+=2*(this.style.borders.top.width+this.style.borders.bottom.width):e=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(e+=this.row.grid.style.cellPadding.bottom)),e+=this.objectValue.style.cellSpacing}else if(this.objectValue instanceof ft||this.objectValue instanceof mt)e+=this.objectValue.height;else if(this.objectValue instanceof Je){var s=this.objectValue;e+=i.layout(s.text,s.font,s.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height,e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width));return this.objectValue instanceof Fi?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(e+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?e+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:e+=this.style.cellPadding.top+this.style.cellPadding.bottom,e+=this.row.grid.style.cellSpacing},e.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(e>1)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&this.parent.row.width>0&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){i=0;for(var n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i},e}(),Vi=function(){function t(t){this.cells=[],this.gridRow=t}return t.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ki;return this.add(e),t}t.row=this.gridRow,this.cells.push(t)},t.prototype.indexOf=function(t){return this.cells.indexOf(t)},t}(),Ri=function(){function t(t){this.columnWidth=0,this.grid=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new D),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0}),t}(),Ni=function(){function t(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}return t.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Ri(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new ki;n.value="",r.cells.add(n)}}},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),t.prototype.getColumn=function(t){if(t>=0&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},t.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},t.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&t>=0&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,this.internalColumns[r].width>0&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++){var n=t/i;e[r]<=0&&(e[r]=n)}return e},t}(),Ai=function(){function t(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.pdfGrid=t}return Object.defineProperty(t.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new Vi(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new ji,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),t.prototype.measureHeight=function(){var t,e=0,i=0;t=this.cells.getCell(0).rowSpan>1?0:this.cells.getCell(0).height;for(var r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>e&&(e=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,n.rowSpan>1){for(var o=r,s=this.grid.rows.rowCollection.indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&(this.grid.rows.getRow(s+a+1).cells.getCell(o).hasRowSpan=!0);i<n.height&&(i=n.height)}else t=Math.max(t,n.height)}return i>t&&(t=i),0===t?t=i:e>0&&(t+=e),t},t.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t},t}(),Di=function(){function t(t){this.rows=[],this.grid=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),t.prototype.addRow=function(t){if(void 0===t){var e=new Ai(this.grid);return this.addRow(e),e}if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new ki);this.rows.push(t)},t.prototype.getRow=function(t){return this.rows[t]},t}(),Mi=function(){function t(t){this.rows=[],this.grid=t,this.rows=[]}return t.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){e=new Ai(this.grid);for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new ki);this.rows.push(e)}return this.rows}this.rows.push(t)},t.prototype.indexOf=function(t){return this.rows.indexOf(t)},t}(),Ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fi=function(t){function e(){var e=t.call(this)||this;return e.gridSize=new j(0,0),e.isGridSplit=!1,e.isRearranged=!1,e.pageBounds=new k,e.listOfNavigatePages=[],e.parentCellIndex=0,e.tempWidth=0,e.breakRow=!0,e.splitChildRowIndex=-1,e.hasRowSpanSpan=!1,e.hasColumnSpan=!1,e.isSingleGrid=!0,e}return Ii(e,t),Object.defineProperty(e.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Ni(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Di(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Mi(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new Li),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return e instanceof k&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},e.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=(r=this.headers.getHeader(i)).height;for(i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);t+=r.height}return new j(e,t)},e.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},e.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},e.prototype.layout=function(t){if(0!==this.rows.count){var e=this.rows.getRow(0).cells.getCell(0).style;if(null!=e.borders&&(null!=e.borders.left&&1!==e.borders.left.width||null!=e.borders.top&&1!==e.borders.top.width)){var i=e.borders.left.width/2,r=e.borders.top.width/2;if(t.bounds.x===Fe.default.right.width/2&&t.bounds.y===Fe.default.right.width/2){var n=new k(i,r,this.gridSize.width,this.gridSize.height);t.bounds=n}}}return this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new Gi(this).Layouter(t)},e.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){var a=this.headers.getHeader(s);n=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(n=Math.max(n,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;e>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;t>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(e=u.rowSpan,r=s;e>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},e.prototype.checkSpan=function(){var t,e,i=1,r=0,n=0;if(t=i=1,e=n=0,this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){var a=this.rows.getRow(s);r=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(r=Math.max(r,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,i=u.rowSpan,e=l,n=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,a.cells.getCell(e).isRowMergeContinue=!0,t--;for(e=l,t=u.columnSpan;i>1;){for(n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,i--;t>1;)e++,this.rows.getRow(n).cells.getCell(e).isCellMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,t--;t=u.columnSpan,e=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,e=l,u.isCellMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(i=u.rowSpan,n=s;i>1;)n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,i--}}a.maximumRowSpan=r}},e.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n=0,o=0,s=this.columns.count,a=0;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(n+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(n+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)o+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(o-=this.gridColumns.getColumn(d).width,s--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(n+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(n+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(o-=2*this.ParentCell.row.grid.style.cellSpacing),o>n&&(a=(o-n)/s,this.tempWidth=a,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=a)}}else{for(var e=[this.columns.count],h=0;h<this.columns.count;h++)e[h]=0;var l=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),this.headers.count>0)for(var u=this.headers.getHeader(0).cells.count,c=this.headers.count,i=0;i<u;i++){l=0;for(d=0;d<c;d++){f=Math.min(this.initialWidth,this.headers.getHeader(d).cells.getCell(i).width);l=Math.max(l,f)}e[i]=l}l=0;for(var i=0,p=this.columns.count;i<p;i++){for(var d=0,c=this.rows.count;d<c;d++)if(1==this.rows.getRow(d).cells.getCell(i).columnSpan&&!this.rows.getRow(d).cells.getCell(i).isCellMergeContinue||null!=this.rows.getRow(d).cells.getCell(i).value){if(null!=this.rows.getRow(d).cells.getCell(i).value&&!this.rows.getRow(d).grid.style.allowHorizontalOverflow)this.rows.getRow(d).grid.style.cellPadding.right,this.rows.getRow(d).grid.style.cellPadding.left,this.rows.getRow(d).cells.getCell(i).style.borders.left.width;var f=0;f=this.initialWidth>0?Math.min(this.initialWidth,this.rows.getRow(d).cells.getCell(i).width):this.rows.getRow(d).cells.getCell(i).width,l=Math.max(e[i],Math.max(l,f)),l=Math.max(this.columns.getColumn(i).width,l)}0!=this.rows.count&&(e[i]=l),l=0}for(var i=0,g=this.rows.count;i<g;i++)for(var d=0,m=this.columns.count;d<m;d++)if(this.rows.getRow(i).cells.getCell(d).columnSpan>1)for(var y=e[d],b=1;b<this.rows.getRow(i).cells.getCell(d).columnSpan;b++)y+=e[d+b];for(var i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).width<=0?this.columns.getColumn(i).columnWidth=e[i]:this.columns.getColumn(i).width>0&&!this.columns.getColumn(i).isCustomWidth&&(this.columns.getColumn(i).columnWidth=e[i]);var n=0,w=0,S=this.columns.count,P=0;w=this.tempWidth;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(w-=this.gridColumns.getColumn(d).width,S--);if(w>0&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),w>n&&(P=w/S,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=P)}},e}(Ge),Ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gi=function(e){function i(t){var i=e.call(this,t)||this;return i.gridInitialWidth=0,i.gridSize=new j(0,0),i.parentCellIndex=0,i.tempWidth=0,i.childheight=0,i.isChildGrid=!1,i.hasRowSpanSpan=!1,i.isRearranged=!1,i.pageBounds=new k,i.listOfNavigatePages=[],i.flag=!0,i.columnRanges=[],i.currentLocation=new T(0,0),i.breakRow=!0,i.isOverloadWithPosition=!1,i}return Ei(i,e),Object.defineProperty(i.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.getFormat=function(t){return t},i.prototype.layoutInternal=function(e){var i=this.getFormat(e.format);if(this.gridLayoutFormat=this.getFormat(e.format),this.currentPage=e.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width;this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var r=0;if(r=this.currentGraphics.page.section.indexOf(this.currentGraphics.page),this.listOfNavigatePages.push(r),null!=i&&i.break===t.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),new j(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=e.bounds.width}if(this.startLocation=new T(e.bounds.x,e.bounds.y),e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],this.Grid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var n=0;n<this.Grid.rows.count;n++)-1===this.Grid.rows.getRow(n).height||this.Grid.rows.getRow(n).isRowHeightSet||(this.Grid.rows.getRow(n).isRowHeightSet=!0);return this.layoutOnPage(e)},i.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if((i+=this.Grid.columns.getColumn(n).width)>=r){for(var o=0,s=t;s<=n&&!((o+=this.Grid.columns.getColumn(s).width)>r);s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},i.prototype.layoutOnPage=function(e){this.pageBounds.x=e.bounds.x,this.pageBounds.y=e.bounds.y,this.pageBounds.height=e.bounds.height;for(var r=this.getFormat(e.format),n=null,o=new rt,s=e.page,a=[],h=0;h<this.columnRanges.length;h++){var l=this.columnRanges[h];this.cellStartIndex=l[0],this.cellEndIndex=l[1];var u=this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex);this.currentBounds=u.currentBounds,this.currentRowIndex=u.currentRowIndex;for(var c=0;c<this.Grid.headers.count;c++)m=this.Grid.headers.getHeader(c),this.currentBounds.y,this.drawRow(m);var p=0,d=(this.Grid.rows.count,void 0),f=!0;a=[];for(var g=0;g<this.Grid.rows.count;g++){var m=this.Grid.rows.getRow(g);p++,this.currentRowIndex=p-1;var y=this.currentBounds.y;s=this.currentPage,i.repeatRowIndex=-1,f&&m.grid.isChildGrid&&(f=!1);var b=null;if(-1==this.Grid.splitChildRowIndex)b=this.drawRow(m),m.isrowFinish=!0;else{if(!(m.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=m.rowIndex)){if(m.isrowFinish)continue;break}b=this.drawRow(m),m.isrowFinish=!0}for(a.push(b.bounds.width),y===this.currentBounds.y?(d=!0,i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(m)):(d=!1,i.repeatRowIndex=-1);!b.isFinish&&null!=s;){var w=this.getLayoutResult();if(this.raisePageLayouted(w).cancel||d)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y;var S=new T(Fe.default.right.width/2,Fe.default.top.width/2);if(0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.width&&0===r.paginateBounds.height&&this.startLocation.x===S.x&&this.startLocation.y===S.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.Grid.isChildGrid&&null!=m.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=m.grid.ParentCell){m.grid.ParentCell.row.isRowBreaksNextPage=!0,m.grid.ParentCell.row.rowBreakHeightValue=m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var P=m.rowIndex+1;P<m.grid.rows.count;P++)m.grid.ParentCell.row.rowBreakHeightValue+=m.grid.rows.getRow(P).height}if(m.grid.isChildGrid){m.isrowFinish=!1,m.grid.splitChildRowIndex=m.rowIndex,m.grid.ParentCell.row.grid.splitChildRowIndex=m.grid.ParentCell.row.rowIndex,m.grid.ParentCell.row.grid.isGridSplit&&(m.grid.ParentCell.row.noOfPageCount+=1,m.grid.ParentCell.row.grid.isGridSplit=!1);break}if(m.noOfPageCount<1){if(-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),null!=m.style.border&&(null!=m.style.border.left&&1!==m.style.border.left.width||null!=m.style.border.top&&1!==m.style.border.top.width)){var v=m.style.border.left.width/2,C=m.style.border.top.width/2;if(this.currentBounds.x===Fe.default.right.width/2&&this.currentBounds.y===Fe.default.right.width/2){var B=new k(v,C,this.currentBounds.width,this.currentBounds.height);this.currentBounds=B}}if(this.Grid.repeatHeader)for(var O=0;O<this.Grid.headers.count;O++){var x=this.Grid.headers.getHeader(O);this.drawRow(x)}if(b=this.drawRow(m),m.noOfPageCount>=1){m.rowBreakHeightValue;for(var L=0;L<m.noOfPageCount;L++){var V=this.getLayoutResult();if(this.raisePageLayouted(V),this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y,-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var R=0;R<this.Grid.headers.count;R++){D=this.Grid.headers.getHeader(R);this.drawRow(D)}this.drawRow(m)}}m.grid.splitChildRowIndex=-1,m.grid.isGridSplit=!1,b.isFinish=!0;for(var N=0;N<m.cells.count;N++)m.cells.getCell(N).value instanceof Fi&&(m.cells.getCell(N).value.splitChildRowIndex=-1)}}}if(!b.isFinish&&null!==s&&r.layout!==t.PdfLayoutType.OnePage&&d){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(r),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.y>0&&!this.Grid.isChildGrid&&(this.currentBounds.y=e.bounds.y),this.startLocation.y=this.currentBounds.y,r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Fe.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var A=0;A<this.Grid.headers.count;A++){var D=this.Grid.headers.getHeader(A);this.drawRow(D)}this.drawRow(m),null===this.currentPage||o.containsKey(this.currentPage)||o.add(this.currentPage,l)}if(null!=m.NestedGridLayoutResult){this.currentPage=m.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new T(m.NestedGridLayoutResult.bounds.x,m.NestedGridLayoutResult.bounds.y);var M=this.ReCalculateHeight(m,m.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=M,s!=this.currentPage){for(var I=this.currentPage.section,F=I.indexOf(s)+1,E=I.indexOf(this.currentPage),G=F;G<E+1;G++){var z=this.currentPage.graphics,W=new T(r.paginateBounds.x,r.paginateBounds.y),H=G==E?m.NestedGridLayoutResult.bounds.height-e.bounds.y:this.currentBounds.height-W.y;H<=z.clientSize.height&&(H+=e.bounds.y),W.y=null==r?.5:r.paginateBounds.y;for(Z=0;Z<m.cells.count;Z++){var _=m.cells.getCell(Z),K=0,U=0;if(_.value instanceof Fi)for(var q=0;q<_.value.columns.count;q++)U+=_.value.columns.getColumn(q).columnWidth;else U=_.width;K=Math.max(U,m.grid.columns.getColumn(Z).width),_.drawCellBorders(z,new k(W,new j(K,H))),W.x+=K,Z+=_.columnSpan-1}}s=this.currentPage}}}var Y=!1,X=0;a.length>0&&(X=a[0]);for(var J=[[1,2]],Z=0;Z<this.Grid.rows.count;Z++)if(-1!=this.cellEndIndex&&this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value instanceof Fi){var $=this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value;this.rowLayoutBoundsWidth=$.rowLayoutBoundsWidth,Y=!0}if(!Y&&a.length>0){for(Z=0;Z<p-1;Z++)X<a[Z]&&(X=a[Z]);this.rowLayoutBoundsWidth=X}else this.rowLayoutBoundsWidth=J[0][1];if(this.columnRanges.indexOf(l)<this.columnRanges.length-1&&null!=s&&r.layout!=t.PdfLayoutType.OnePage)if(this.Grid.isChildGrid,0!=J[0][0]){this.currentPage.section.indexOf(this.currentPage);this.currentGraphics=this.currentPage.graphics,this.currentBounds=new k(new T(0,0),this.currentPage.getClientSize());this.currentGraphics.page.section.indexOf(this.currentGraphics.page)}else this.currentPage=this.getNextPageformat(r);this.columnRanges.length-1!==h&&this.columnRanges.length>1&&r.layout!==t.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(r),r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y))}return n=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==t.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(o),this.raisePageLayouted(n),n},i.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage);this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics;var n=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);return-1===this.listOfNavigatePages.indexOf(n)&&this.listOfNavigatePages.push(n),this.currentBounds=new k(new T(0,0),i.getClientSize()),i},i.prototype.CheckIfDefaultFormat=function(t){var e=new D;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},i.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){var s=null;return this.Grid.raiseBeginCellDraw&&(s=new _i(t,e,i,r,n,o),this.Grid.onBeginCellDraw(s),o=s.style),o},i.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){var s=null;this.Grid.raiseEndCellDraw&&(s=new Ki(t,e,i,r,n,o),this.Grid.onEndCellDraw(s))},i.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(a=r[n]).section=null,i.push(a),e.pages.remove(a);for(n=0;n<t.size();n++)for(var o=n,s=t.size()/this.columnRanges.length;o<t.size();o+=s){var a=i[o];-1===e.pages.indexOf(a)&&e.pages.add(a)}},i.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);e.rowBreakHeight>0&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new k(this.startLocation,new j(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new zi(this.currentPage,i)},i.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},i.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;if(this.Grid.raiseBeginPageLayout){var n=new Xi(e,t,i);this.Grid.onBeginPageLayout(n),r=n.cancel,e=n.bounds,i=n.startRowIndex}return{returnValue:r,currentBounds:e,currentRowIndex:i}},i.prototype.raisePageLayouted=function(t){var e=new Ji(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(e),e},i.prototype.drawRow=function(e,r,n){if(void 0===r){var o=new Zi,s=0,a=new j(0,0),h=!1;if(e.rowSpanExists){var l=0,u=this.Grid.rows.rowCollection.indexOf(e);-1===u&&-1!==(u=this.Grid.headers.indexOf(e))&&(h=!0);for(f=0;f<e.cells.count;f++){var c=e.cells.getCell(f);l=Math.max(l,c.rowSpan)}for(f=u;f<u+l;f++)s+=h?this.Grid.headers.getHeader(f).height:this.Grid.rows.getRow(f).height}var p=e.rowBreakHeight>0?e.rowBreakHeight:e.height;return this.Grid.isChildGrid&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+s>this.currentPageBounds.height?(this.Grid.ParentCell.row.grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,o.bounds=this.currentBounds,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex)):(o.isFinish=!0,e.grid.ParentCell.row.rowBreakHeightValue>0?e.repeatFlag=!0:(e.repeatFlag=!1,p=e.height),this.Grid.isChildGrid&&e.rowBreakHeight>0&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(e,o,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.isrowFinish=!0,e.repeatFlag=!0,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+s>this.currentPageBounds.height?(this.Grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):o.isFinish=!1):(o.isFinish=!0,this.drawRow(e,o,p),e.repeatFlag=!1),o}var d=new T(this.currentBounds.x,this.currentBounds.y);r.bounds=new k(d,new j(0,0)),n=this.ReCalculateHeight(e,n);for(var f=this.cellStartIndex;f<=this.cellEndIndex;f++){var g=f>this.cellEndIndex+1&&e.cells.getCell(f).columnSpan>1;if(!g)for(var m=1;m<e.cells.getCell(f).columnSpan;m++)e.cells.getCell(f+m).isCellMergeContinue=!0;a=new j(this.Grid.columns.getColumn(f).width,n);!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(f).format)&&this.CheckIfDefaultFormat(e.cells.getCell(f).stringFormat)&&(e.cells.getCell(f).stringFormat=this.Grid.columns.getColumn(f).format);var y=e.cells.getCell(f).style,b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"";e.cells.getCell(f).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,y),e.cells.getCell(f).value instanceof Fi&&((S=e.cells.getCell(f).value).parentCellIndex=f);var w=e.cells.getCell(f).draw(this.currentGraphics,new k(d,a),g);if(e.grid.style.allowHorizontalOverflow&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),e.grid.style.allowHorizontalOverflow&&e.rowOverflowIndex>0&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1>0&&(e.cells.getCell(e.rowOverflowIndex+1).value=null!==w&&void 0!==w.remainder?w.remainder:"",e.cells.getCell(e.rowOverflowIndex+1).stringFormat=e.cells.getCell(f).stringFormat,e.cells.getCell(e.rowOverflowIndex+1).style=e.cells.getCell(f).style,e.cells.getCell(e.rowOverflowIndex+1).columnSpan=e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1),b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"",g||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,e.cells.getCell(f).style),e.cells.getCell(f).value instanceof Fi){var S=e.cells.getCell(f).value;this.Grid.columns.getColumn(f).width>=this.currentGraphics.clientSize.width?(d.x=S.rowLayoutBoundsWidth,d.x+=S.style.cellSpacing):d.x+=this.Grid.columns.getColumn(f).width}else d.x+=this.Grid.columns.getColumn(f).width}e.rowMergeComplete&&!e.isRowHeightSet||(this.currentBounds.y+=n),r.bounds=new k(new T(r.bounds.x,r.bounds.y),new j(d.x,d.y))},i.prototype.drawRowWithBreak=function(t,e,i){var r=new T(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new k(r,new j(0,0)),this.gridHeight=e.rowBreakHeight>0?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(o=0;o<e.cells.count;o++){var n=e.cells.getCell(o);n.measureHeight()===i&&n.value instanceof Fi&&(e.rowBreakHeight=0)}for(var o=this.cellStartIndex;o<=this.cellEndIndex;o++){var s=e.cells.getCell(o).columnSpan+o>this.cellEndIndex+1&&e.cells.getCell(o).columnSpan>1,a=new j(this.Grid.columns.getColumn(o).width,this.gridHeight>0?this.gridHeight:this.currentPageBounds.height),h=e.cells.getCell(o).style;e.cells.getCell(o).style=h;var l=null;if(l=e.cells.getCell(o).draw(this.currentGraphics,new k(r,a),s),e.rowBreakHeight>0&&null!=l&&(e.cells.getCell(o).FinishedDrawingCell=!1,e.cells.getCell(o).remainingString=null==l.remainder?" ":l.remainder,e.grid.isChildGrid&&(e.rowBreakHeight=i-l.actualSize.height)),t.isFinish=t.isFinish?e.cells.getCell(o).FinishedDrawingCell:t.isFinish,e.cells.getCell(o).value instanceof Fi){var u=e.cells.getCell(o).value;this.rowBreakPageHeightCellIndex=o,this.Grid.columns.getColumn(o).width>=this.currentGraphics.clientSize.width?(r.x=this.rowLayoutBoundsWidth,r.x+=u.style.cellSpacing):r.x+=this.Grid.columns.getColumn(o).width}else r.x+=this.Grid.columns.getColumn(o).width}this.currentBounds.y+=this.gridHeight>0?this.gridHeight:i,t.bounds=new k(new T(t.bounds.x,t.bounds.y),new j(r.x,r.y))},i.repeatRowIndex=-1,i}(Ae),zi=function(t){function e(e,i){return t.call(this,e,i)||this}return Ei(e,t),e}(Ie),Wi=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(De),Hi=function(){function t(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}return Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),t}(),_i=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.style=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),e}(Hi),Ki=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.cellStyle=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0}),e}(Hi),Ui=function(){function t(){}return Object.defineProperty(t.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0}),t}(),qi=function(t){function e(e,i){var r=t.call(this)||this;return r.bounds=e,r.pdfPage=i,r}return Ei(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),e}(Ui),Yi=function(t){function e(e){var i=t.call(this)||this;return i.layoutResult=e,i}return Ei(e,t),Object.defineProperty(e.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0}),e}(Ui),Xi=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;return n.startRow=r,n}return Ei(e,t),Object.defineProperty(e.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0}),e}(qi),Ji=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(Yi),Zi=function(){function t(){this.layoutedBounds=new k(0,0,0,0)}return Object.defineProperty(t.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0}),t}(),$i=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qi=function(e){function i(t){var i=e.call(this,t)||this;return i.olderPdfForm=0,i.shapeBounds=new k,i.totalPageSize=0,i}return $i(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds();r.x=0,r.y=0;var n=this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height;this.isPdfGrid&&!n&&(r=this.shapeBounds);var o=null,s=new tr;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i);i=a.currentBounds;var h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},i.prototype.raiseBeforePageLayout=function(t,e){var i=!1;if(this.element.raiseBeginPageLayout){var r=new qi(e,t);this.element.onBeginPageLayout(r),i=r.cancel,e=r.bounds}return{currentBounds:e,cancel:i}},i.prototype.raiseEndPageLayout=function(t){var e=null;if(this.element.raiseEndPageLayout){var i=this.getLayoutResult(t);e=new Yi(i),this.element.onEndPageLayout(e)}return e},i.prototype.getLayoutResult=function(t){return new Ie(t.page,t.bounds)},i.prototype.getNextShapeBounds=function(t,e){var i=e.bounds;return t.y=t.y+i.height,t.height=t.height-i.height,t},i.prototype.layoutOnPage=function(e,i,r,n){var o=new tr;i=this.checkCorrectCurrentBounds(e,i,n);var s=this.fitsToBounds(i,r),a=!1;if(!(n.format.break===t.PdfLayoutBreakType.FitElement&&!s&&e===n.page)){var h=this.getDrawBounds(i,r);this.drawShape(e.graphics,i,h),o.bounds=this.getPageResultBounds(i,r),a=i.height>=r.height}return o.end=a||n.format.layout===t.PdfLayoutType.OnePage,o.page=e,o},i.prototype.getDrawBounds=function(t,e){var i=t;return i.y=i.y-e.y,i.height=i.height+e.y,i},i.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new T(i.x,i.y))}finally{t.restore(r)}},i.prototype.checkCorrectCurrentBounds=function(t,e,i){var r=t.graphics.clientSize;return e.width=e.width>0?e.width:r.width-e.x,e.height=e.height>0?e.height:r.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},i.prototype.getPageResultBounds=function(t,e){var i=t;return i.height=Math.min(i.height,e.height),i},i.prototype.fitsToBounds=function(t,e){return e.height<=t.height},i.index=0,i.splitDiff=0,i.last=!1,i.borderWidth=0,i}(Ae),tr=function(){function t(){}return t}(),er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return er(e,t),e.prototype.getBounds=function(){return this.getBoundsInternal()},e.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},e.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},e.prototype.layout=function(t){return new Qi(this).layout(t)},e}(Ge),rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nr=function(t){function e(e){var i=t.call(this)||this;return void 0!==e&&(i.mpen=e),i}return rr(e,t),Object.defineProperty(e.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0}),e}(ir),or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sr=function(t){function e(e,i){var r=t.call(this)||this;return r.mbrush=null,void 0===e||(e instanceof Q?r=t.call(this,e)||this:r.mbrush=i),r}return or(e,t),Object.defineProperty(e.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),e.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new Q(new L(0,0,0)):this.pen},e}(nr),ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hr=function(e){function i(i,r,n,o){var s=e.call(this)||this;return s.mpoints=null,s.mpathTypes=null,s.mStartFigure=!0,s.mfillMode=t.PdfFillMode.Alternate,s.isBeziers3=!1,s.isXps=!1,void 0===i||(i instanceof Q?(s=e.call(this,i)||this,r instanceof R?(s=e.call(this,i,r)||this).fillMode=n:null!==r&&void 0!==r&&null!==n&&void 0!==n&&s.addPath(r,n)):i instanceof R?(s=e.call(this,i)||this,null!==r&&void 0!==r&&(s.fillMode=r),null!==n&&void 0!==n&&null!==o&&void 0!==o&&s.addPath(n,o)):s.addPath(i,r)),s}return ar(i,e),Object.defineProperty(i.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pointCount",{get:function(){var t=0;return null!=this.mpoints&&(t=this.mpoints.length),t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),i.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},i.prototype.addArc=function(e,i,r,n,o,s){if(e instanceof k)this.addArc(e.x,e.y,e.width,e.height,i,r);else for(var a=this.getBezierArcPoints(e,i,i+r,i+n,o,s),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addBezier=function(e,i,r,n,o,s,a,h){if(e instanceof T&&i instanceof T&&r instanceof T&&n instanceof T)this.addBezier(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y);else{var l=[];l.push(e),l.push(i),l.push(r),l.push(n),l.push(o),l.push(s),l.push(a),l.push(h),this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addEllipse=function(t,e,i,r){t instanceof k?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},i.prototype.addLine=function(e,i,r,n){if(e instanceof T&&i instanceof T)this.addLine(e.x,e.y,i.x,i.y);else{var o=[];o.push(e),o.push(i),o.push(r),o.push(n),this.addPoints(o,t.PathPointType.Line)}},i.prototype.addPath=function(t,e){if(t instanceof i)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},i.prototype.addPie=function(e,i,r,n,o,s){e instanceof k?this.addPie(e.x,e.y,e.width,e.height,i,r):(this.startFigure(),this.addArc(e,i,r,n,o,s),this.addPoint(new T(e+r/2,i+n/2),t.PathPointType.Line),this.closeFigure())},i.prototype.addPolygon=function(e){e.length;var i=[];this.startFigure();for(var r=0;r<e.length;r++)i.push(e[r].x),i.push(e[r].y);this.addPoints(i,t.PathPointType.Line),this.closeFigure()},i.prototype.addRectangle=function(e,i,r,n){if(e instanceof k)this.addRectangle(e.x,e.y,e.width,e.height);else{var o=[];this.startFigure(),o.push(e),o.push(i),o.push(e+r),o.push(i),o.push(e+r),o.push(i+n),o.push(e),o.push(i+n),this.addPoints(o,t.PathPointType.Line),this.closeFigure()}},i.prototype.startFigure=function(){this.mStartFigure=!0},i.prototype.closeAllFigures=function(){for(var e=this.pathPoints[0],i=0;i<this.mpathTypes.length;i++){var r=this.types[i],n=!1;0!==i&&r===t.PathPointType.Start?(this.closeFigure(i-1),n=!0):i===this.mpathTypes.length-1&&!n&&this.isXps&&e.x===this.pathPoints[i].y&&this.closeFigure(i)}},i.prototype.getLastPoint=function(){var t=new T(0,0),e=this.pointCount;return e>0&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},i.prototype.getBezierArcPoints=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},i.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new k(0,0,0,0);if(t.length>0){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++){var a=t[s];i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o)}e=new k(i,n,r-i,o-n)}return e},i.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},i.prototype.addPoints=function(e,i,r,n){if(void 0===r&&void 0===n)this.addPoints(e,i,0,e.length);else for(var o=r;o<n;o++){var s=new T(e[o],e[o+1]);o===r?this.pointCount<=0||this.mStartFigure?(this.addPoint(s,t.PathPointType.Start),this.mStartFigure=!1):s.x===this.lastPoint.x||s.y===this.lastPoint.y||this.isBeziers3?s.x!==this.lastPoint.x&&s.y!==this.lastPoint.y&&this.addPoint(s,t.PathPointType.Bezier3):this.addPoint(s,t.PathPointType.Line):this.addPoint(s,i),o++}},i.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},i.prototype.closeFigure=function(e){if(void 0===e)this.pointCount>0&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(e<0)throw new Error("IndexOutOfRangeException()");var i=this.types[e];i|=t.PathPointType.CloseSubpath,this.types[e]=i}},i}(sr),lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ur=function(t){function e(e,i,r,n,o,s){var a=t.call(this)||this;return a.bounds=new k(0,0,0,0),void 0===e||(e instanceof Q?(a=t.call(this,e,i)||this).bounds=r instanceof k?r:new k(r,n,o,s):a.bounds=e instanceof k?e:new k(e,i,r,n)),a}return lr(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),e.prototype.getBoundsInternal=function(){return this.bounds},e}(sr),cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(t){function e(e,i,r,n,o,s,a,h){var l=t.call(this)||this;return l.startAngle=0,l.sweepAngle=0,void 0===e||(e instanceof k&&void 0!==i&&void 0!==r?((l=t.call(this,e)||this).startAngle=i,l.sweepAngle=r):e instanceof Q?r instanceof k?((l=t.call(this,e,i,r)||this).startAngle=n,l.sweepAngle=o):((l=t.call(this,e,i,r,n,o,s)||this).startAngle=a,l.sweepAngle=h):((l=t.call(this,e,i,r,n)||this).startAngle=o,l.sweepAngle=s)),l}return cr(e,t),e}(ur),dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(t){function e(e,i,r,n,o,s,a){var h=this;return void 0===e?h=t.call(this)||this:e instanceof k?h=t.call(this,e,i,r)||this:e instanceof Q?i instanceof k?h=t.call(this,e,null,i,r,n)||this:void 0===s&&void 0===a?h=t.call(this,e,null,0,0,i,r,n,o)||this:void 0!==s&&void 0!==a&&(h=t.call(this,e,null,i,r,n,o,s,a)||this):void 0!==e&&void 0===o&&void 0===s?h=t.call(this,0,0,e,i,r,n)||this:void 0!==e&&void 0!==o&&void 0!==s&&(h=t.call(this,e,i,r,n,o,s)||this),h}return dr(e,t),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},e.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)},e}(pr),gr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mr=function(e){function i(i,r,n){var o=e.call(this,r)||this;return o.isEmbedFont=!1,o.isUnicode=!0,void 0!==n?o.createFontInternal(i,n):o.createFontInternal(i,t.PdfFontStyle.Regular),o}return gr(i,e),i.prototype.equalsToFont=function(t){return!1},i.prototype.getLineWidth=function(e,i){var r=0;r=null!==i&&void 0!==i&&i.textDirection!==t.PdfTextDirection.None?this.getUnicodeLineWidth(e,r,i).width:this.fontInternal.getLineWidth(e);var n=this.metrics.getSize(i);return r*=G.charSizeMultiplier*n,r=this.applyFormatSettings(e,i,r)},i.prototype.getCharWidth=function(t,e){var i=this.fontInternal.getCharWidth(t);return i*=.001*this.metrics.getSize(e)},i.prototype.createFontInternal=function(t,e){this.fontInternal=new Gt(t,this.size),this.calculateStyle(e),this.initializeInternals()},i.prototype.calculateStyle=function(e){var i=this.fontInternal.ttfMetrics.macStyle;0!=(e&t.PdfFontStyle.Underline)&&(i|=t.PdfFontStyle.Underline),0!=(e&t.PdfFontStyle.Strikeout)&&(i|=t.PdfFontStyle.Strikeout),this.setStyle(i)},i.prototype.initializeInternals=function(){var t=null;Ce.enableCache&&(t=Ce.cache.search(this));var e=null;if(null!==t&&void 0!==t){e=t.getInternals();var i=t.metrics;(i=i.clone()).size=this.size,this.metrics=i,this.fontInternal=t.fontInternal}else null==t&&(this.fontInternal instanceof Gt&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),e=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics);this.metrics.isUnicodeFont=!0,this.setInternals(e)},i.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(i.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),i.prototype.getUnicodeLineWidth=function(e,i,r){i=0;var n=null,o=(new Kt).getGlyphIndex(e,this,r.textDirection===t.PdfTextDirection.RightToLeft,n,!0),s=o.success;if(n=o.glyphs,s&&null!==n)for(var a=this.fontInternal.ttfReader,h=0,l=n.length;h<l;h++){var u=n[h],c=a.getGlyph(u);null!==c&&void 0!==c&&(i+=c.width)}return{success:s,width:i}},i}(G),yr=function(){function e(t,e,i,r,n){t instanceof k&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof k&&e instanceof ce&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof T&&e instanceof j&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof T&&e instanceof j&&i instanceof ce&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof j&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof ce&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}return Object.defineProperty(e.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.currentLocation},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.x=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.y=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.template.size},set:function(e){this.type===t.TemplateType.None&&this.template.reset(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.template.width},set:function(e){if(this.template.width!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.width=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.template.height},set:function(e){if(this.template.height!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.height=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new k(new T(this.x,this.y),this.size)},set:function(e){this.type===t.TemplateType.None&&(this.location=new T(e.x,e.y),this.size=new j(e.width,e.height))},enumerable:!0,configurable:!0}),e.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Yt(i,r)},e.prototype.updateDocking=function(e){if(e!==t.TemplateType.None){switch(e){case t.TemplateType.Top:this.dock=t.PdfDockStyle.Top;break;case t.TemplateType.Bottom:this.dock=t.PdfDockStyle.Bottom;break;case t.TemplateType.Left:this.dock=t.PdfDockStyle.Left;break;case t.TemplateType.Right:this.dock=t.PdfDockStyle.Right}this.resetAlignment()}},e.prototype.resetAlignment=function(){this.alignment=t.PdfAlignmentStyle.None},e.prototype.setAlignment=function(e){if(this.dock===t.PdfDockStyle.None)this.alignmentStyle=e;else{var i=!1;switch(this.dock){case t.PdfDockStyle.Left:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.MiddleLeft||e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Top:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.TopCenter||e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Right:i=e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.MiddleRight||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Bottom:i=e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.BottomCenter||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Fill:i=e===t.PdfAlignmentStyle.MiddleCenter||e===t.PdfAlignmentStyle.None}i&&(this.alignmentStyle=e)}},e.prototype.draw=function(t,e){var i=t.page,r=this.calculateBounds(i,e);-0===r.x&&(r.x=0),t.graphics.drawPdfTemplate(this.template,new T(r.x,r.y),new j(r.width,r.height))},e.prototype.calculateBounds=function(e,i){var r=this.bounds;return this.alignmentStyle!==t.PdfAlignmentStyle.None?r=this.getAlignmentBounds(e,i):this.dockStyle!==t.PdfDockStyle.None&&(r=this.getDockBounds(e,i)),r},e.prototype.getAlignmentBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleAlignmentBounds(e,i):this.getTemplateAlignmentBounds(e,i)},e.prototype.getSimpleAlignmentBounds=function(e,i){var r=this.bounds,n=e.section.getActualBounds(i,e,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:o=0,s=0;break;case t.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=0;break;case t.PdfAlignmentStyle.TopRight:o=n.width-this.width,s=0;break;case t.PdfAlignmentStyle.MiddleLeft:o=0,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:o=n.width-this.width,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:o=0,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomRight:o=n.width-this.width,s=n.height-this.height}return r.x=o,r.y=s,r},e.prototype.getTemplateAlignmentBounds=function(e,i){var r=this.bounds,n=e.section,o=n.getActualBounds(i,e,!1),s=this.x,a=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:this.type===t.TemplateType.Left?(s=-o.x,a=0):this.type===t.TemplateType.Top&&(s=-o.x,a=-o.y);break;case t.PdfAlignmentStyle.TopCenter:s=(o.width-this.width)/2,a=-o.y;break;case t.PdfAlignmentStyle.TopRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=0):this.type===t.TemplateType.Top&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=-o.y);break;case t.PdfAlignmentStyle.MiddleLeft:s=-o.x,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:s=(o.width-this.width)/2,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:this.type===t.TemplateType.Left?(s=-o.x,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=-o.x,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height);break;case t.PdfAlignmentStyle.BottomCenter:s=(o.width-this.width)/2,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height;break;case t.PdfAlignmentStyle.BottomRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height)}return r.x=s,r.y=a,r},e.prototype.getDockBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleDockBounds(e,i):this.getTemplateDockBounds(e,i)},e.prototype.getSimpleDockBounds=function(e,i){this.bounds;var r=e.section.getActualBounds(i,e,!1),n=this.x,o=this.y,s=this.width,a=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:n=0,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Top:n=0,o=0,s=r.width,a=this.height;break;case t.PdfDockStyle.Right:n=r.width-this.width,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Bottom:n=0,o=r.height-this.height,s=r.width,a=this.height;break;case t.PdfDockStyle.Fill:n=0,n=0,s=r.width,a=r.height}return new k(n,o,s,a)},e.prototype.getTemplateDockBounds=function(e,i){this.bounds;var r=e.section,n=r.getActualBounds(i,e,!1),o=r.pageSettings.getActualSize(),s=this.x,a=this.y,h=this.width,l=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:s=-n.x,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Top:s=-n.x,a=-n.y,h=o.width,l=this.height,n.height<0&&(a=-n.y+o.height);break;case t.PdfDockStyle.Right:s=n.width+r.getRightIndentWidth(i,e,!1)-this.width,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Bottom:s=-n.x,a=n.height+r.getBottomIndentHeight(i,e,!1)-this.height,h=o.width,l=this.height,n.height<0&&(a-=o.height);break;case t.PdfDockStyle.Fill:s=0,s=0,h=n.width,l=n.height}return new k(s,a,h,l)},e}();return t.PdfAction=B,t.PdfUriAction=x,t.PdfActionLinkAnnotation=Ve,t.PdfAnnotation=Le,t.PdfAnnotationCollection=le,t.PdfDocumentLinkAnnotation=Ne,t.PdfLinkAnnotation=je,t.PdfTextWebLink=Je,t.PdfUriAnnotation=Ye,t.Dictionary=n,t.defaultToString=r,t.PdfCatalog=U,t.PdfDocument=Ce,t.PdfDocumentBase=_,t.PdfDocumentTemplate=fe,t.PdfPageNumberField=ii,t.PdfCompositeField=ni,t.PdfPageCountField=hi,t.PointF=T,t.SizeF=j,t.RectangleF=k,t.Rectangle=V,t.PdfCacheCollection=Pe,t.PdfCollection=oe,t.PdfDestination=ui,t.PdfFunction=ci,t.PdfSampledFunction=di,t.ProcedureSets=it,t.PdfColor=L,t.PdfGraphics=te,t.GetResourceEventHandler=ee,t.PdfGraphicsState=ie,t.PdfMargins=J,t.PdfPen=Q,t.PdfResources=Jt,t.Guid=Zt,t.PdfTransformationMatrix=tt,t.Matrix=et,t.PdfBrush=R,t.PdfBrushes=yi,t.PdfSolidBrush=A,t.PdfLinearGradientBrush=vi,t.PdfRadialGradientBrush=Bi,t.PdfTilingBrush=Qt,t.PdfGradientBrush=qt,t.PdfColorBlend=Si,t.PdfBlend=bi,t.PdfTemplate=Yt,t.PdfLayoutElement=Ge,t.PdfPath=hr,t.PdfArc=fr,t.PdfTextElement=Ue,t.ElementLayouter=Ae,t.PdfLayoutFormat=De,t.PdfLayoutParams=Me,t.PdfLayoutResult=Ie,t.TextLayouter=We,t.TextPageLayoutResult=He,t.PdfTextLayoutResult=_e,t.PdfFont=G,t.PdfFontMetrics=It,t.WidthTable=Ft,t.StandardWidthTable=Et,t.PdfStandardFont=xe,t.PdfStandardFontMetricsFactory=Be,t.PdfStringFormat=D,t.PdfStringLayouter=I,t.PdfStringLayoutResult=F,t.LineInfo=E,t.StringTokenizer=M,t.PdfTrueTypeFont=mr,t.RtlRenderer=Kt,t.ArabicShapeRenderer=zt,t.ArabicShape=Wt,t.Bidi=Ht,t.RtlCharacters=_t,t.ByteArray=ut,t.ImageDecoder=pt,t.PdfBitmap=mt,t.PdfImage=ft,t.PdfTransparency=nt,t.PdfCrossTable=q,t.RegisteredObject=Y,t.DictionaryProperties=a,t.PdfMainObjectCollection=W,t.ObjectInfo=H,t.Operators=s,t.PdfStreamWriter=$,t.PdfWriter=z,t.PageAddedEventArgs=pe,t.PdfDocumentPageCollection=Se,t.PdfPage=ce,t.PdfPageBase=he,t.PdfPageLayer=ne,t.PdfPageLayerCollection=ae,t.PdfPageSettings=Z,t.PdfPageSize=X,t.PdfPageTemplateElement=yr,t.PdfSection=ye,t.PageSettingsState=be,t.PdfSectionCollection=we,t.PdfSectionPageCollection=de,t.PdfSectionTemplate=me,t.PdfArray=m,t.PdfDictionary=h,t.SaveSectionCollectionEventHandler=l,t.SaveDescendantFontEventHandler=u,t.SaveFontDictionaryEventHandler=c,t.SaveAnnotationEventHandler=p,t.SaveSectionEventHandler=d,t.SaveTemplateEventHandler=f,t.PdfName=o,t.PdfNumber=g,t.PdfReference=v,t.PdfReferenceHolder=C,t.PdfStream=b,t.SaveCmapEventHandler=w,t.SaveFontProgramEventHandler=S,t.PdfString=P,t.PdfGridStyleBase=xi,t.PdfGridStyle=Li,t.PdfGridCellStyle=Ti,t.PdfGridRowStyle=ji,t.PdfBorders=Fe,t.PdfPaddings=Ee,t.PdfGridLayouter=Gi,t.PdfGridLayoutResult=zi,t.PdfGridLayoutFormat=Wi,t.GridCellEventArgs=Hi,t.PdfGridBeginCellDrawEventArgs=_i,t.PdfGridEndCellDrawEventArgs=Ki,t.PdfCancelEventArgs=Ui,t.BeginPageLayoutEventArgs=qi,t.EndPageLayoutEventArgs=Yi,t.PdfGridBeginPageLayoutEventArgs=Xi,t.PdfGridEndPageLayoutEventArgs=Ji,t.RowLayoutResult=Zi,t.PdfGrid=Fi,t.PdfGridColumn=Ri,t.PdfGridColumnCollection=Ni,t.PdfGridRow=Ai,t.PdfGridRowCollection=Di,t.PdfGridHeaderCollection=Mi,t.PdfGridCell=ki,t.PdfGridCellCollection=Vi,t}({},ej.compression,ej.fileutils),this.ejs=ej;
- /*!
- * filename: ej2-grids.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.grids=function(e,t,i,r,n,o,s,l,a,h,d){"use strict";function c(e,t,i,r){if(r&&e)return void e.removeAttribute(t);e&&e.setAttribute(t,i)}function p(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"]}function u(e,t){return e.prototype&&t in e.prototype}function g(e,r,n){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function f(e,r){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function m(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function y(e){return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.columns)&&e.columns.length>0}function v(e,t){for(var i=e.columns,r=t.columns,n=0;n<i.length;n++)if(r.length-1>=n)if(r[n].columns)for(var o=0;o<r[n].columns.length;o++)i[n].columns[o].type=r[n].columns[o].type;else i[n].type=r[n].type}function C(e){for(var t=[],i=e.vRows,r=0;r<i.length;r++)i[r].isDataRow?t.push(i[r]):i[r].isDataRow||(t.push(i[r]),!i[r].isExpand&&i[r].isCaptionRow&&(r+=w(i[r],e)));e.vcRows=t}function w(e,i){vn=0;var r=i.groupSettings.columns.length,n="items",o=e.gSummary,s=0,l="aggregatesCount";if(o===e.data.count)return i.groupSettings.columns.length&&!t.isNullOrUndefined(e[l])&&e[l]?1!==i.groupSettings.columns.length?vn+=0!==e.indent&&o<2?e.gSummary*(r-e.indent+(r-e.indent)*e[l]):e.gSummary*(r-e.indent+(r-e.indent-1)*e[l])+e[l]:1===i.groupSettings.columns.length&&(vn+=e.gSummary*(r-e.indent)+e[l]):i.groupSettings.columns.length&&(1!==i.groupSettings.columns.length?vn+=e.gSummary*(i.groupSettings.columns.length-e.indent):vn+=e.gSummary),vn;for(var a=0,h=e.data[n].length;a<h;a++){var d=e.data[n][a];vn+=d[n].length+(r===i.columns.length||t.isNullOrUndefined(d[n].records)?0:d[n].records.length),s+=t.isNullOrUndefined(d[n].records)||t.isNullOrUndefined(e[l])?d[n].length:d[n].records.length,d[n].GroupGuid&&0!==d[n].childLevels&&b(d)}return vn+=e.data[n].length,t.isNullOrUndefined(e[l])||e[l]&&vn&&0!==s&&(vn+=(vn-s)*e[l]+e[l]),vn}function b(e){for(var t=0,i=e.items.length;t<i;t++){var r=e.items[t];vn+=r.count,0!==r.items.childLevels&&b(r)}}function S(e,i){for(var r=[],n=0,o=e.length;n<o;n++){var s=i(e[n],n);t.isNullOrUndefined(s)||r.push(s)}return r}function R(e){for(var i=[],r=0;r<e.length;r++)i.push(t.extend({},M(e[r]),{},!0));return i}function x(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}}function F(e,i){var r={},n=["style","class"];t.extend(r,i,{}),"style"in r&&(t.setStyleAttribute(e,r[n[0]]),delete r[n[0]]),"class"in r&&(t.addClass([e],r[n[1]]),delete r[n[1]]),t.attributes(e,r)}function E(e,i,r,n){for(var o=t.extend(e,i,r),s=Object.keys(o),l=0;l<s.length;l++)n&&-1!==n.indexOf(s[l])&&delete o[s[l]];return o}function I(e,i){void 0===i&&(i=0);for(var r=0,n=e.length;r<n;r++)e[r].columns?(e[r].index=t.isNullOrUndefined(e[r].index)?i:e[r].index,i++,i=I(e[r].columns,i)):(e[r].index=t.isNullOrUndefined(e[r].index)?i:e[r].index,i++);return i}function T(e,i,r){for(var n=0,o=e.length;n<o;n++){var s=void 0;"string"==typeof e[n]?s=new Ct({field:e[n]},r):e[n]instanceof Ct?s=e[n]:e[n].columns?(e[n].columns=T(e[n].columns,null,r),s=new Ct(e[n],r)):s=new Ct(e[n],r),s.type&&"checkbox"===s.type.toLowerCase()&&(s.allowReordering=!1),s.headerText=t.isNullOrUndefined(s.headerText)?s.foreignKeyValue||s.field||"":s.headerText,s.foreignKeyField=s.foreignKeyField||s.field,s.valueAccessor=("string"==typeof s.valueAccessor?t.getValue(s.valueAccessor,window):s.valueAccessor)||g,s.width=i&&t.isNullOrUndefined(s.width)?200:s.width,t.isNullOrUndefined(s.visible)&&(s.visible=!0),e[n]=s}return e}function z(e,i,r){var n=e.querySelector("span"),o=e.parentElement.getBoundingClientRect(),s=i.target.getBoundingClientRect();n.className=r,e.style.display="";var l=(t.isNullOrUndefined(i.clientY)?i.changedTouches[0].clientY:i.clientY)>e.offsetHeight+10;e.style.top=s.top-o.top+(l?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=D(e,i,s,o.left)+"px",l?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function D(e,t,i,r){var n=e.offsetWidth/2,o=N(t).x;return o-i.left<n?i.left-r:i.right-o<n?i.right-r-2*n:o-r-n}function M(e){return e instanceof t.ChildProperty?t.getValue("properties",e):e}function O(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function k(e,t){for(var i=-1,r=0,n=t.length;r<n;r++)if(t[r].isEqualNode(e)){i=r;break}return i}function A(e,t){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}function B(e){for(var t=[],i=0,r=e.length;i<r;i++)e[i].hasOwnProperty("properties")?t.push(e[i].properties):t.push(e[i]);return t}function P(e,i){for(var r=[].slice.call(e.querySelectorAll(i)),n=0;n<r.length;n++)t.remove(r[n])}function N(e){var i={};return i.x=t.isNullOrUndefined(e.clientX)?e.changedTouches[0].clientX:e.clientX,i.y=t.isNullOrUndefined(e.clientY)?e.changedTouches[0].clientY:e.clientY,i}function L(e){return e+Cn++}function q(e,t){for(var i=0,r=t.length;i<r;i++)r===t.length?e.appendChild(t[i]):e.appendChild(t[0]);return e}function H(e,t,i){for(var r=e,n=[];r;)(i?r.id===t:r.classList.contains(t))&&n.push(r),r=r.parentElement;return n}function U(e,r,n,o){if("Custom"===e){var s=n.customAggregate;return"string"==typeof s&&(s=t.getValue(s,window)),s?s.call(o,r,n):""}return n.field in r||r instanceof Array?i.DataUtil.aggregates[e.toLowerCase()](r,n.field):null}function j(){if(null!==wn)return wn;var e=document.createElement("div"),t=0;return e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),wn=t}function V(e){if(void 0!==fi)return fi;var i=t.createElement("table",{className:Mi,styles:"visibility: hidden"});i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var r=i.querySelector("td").getBoundingClientRect();return e.removeChild(i),fi=Math.ceil(r.height)}function G(e){if(void 0!==mi)return fi;var i=t.createElement("table",{className:Mi,styles:"visibility: hidden"});i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var r=i.querySelector("tr").getBoundingClientRect();return e.removeChild(i),r.height}function _(e){return e.split(".").length>1}function W(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function K(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function Q(e,t,i){var r=O(i,Oi),n=!r||r&&!r.classList.contains("e-insertedrow");return"beginEdit"===t&&n?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(n&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function X(e){var i=t.select("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&t.selectAll(".e-updatedtd",e.element).length&&e.editSettings.showConfirmDialog&&(!i||i.classList.contains("e-popup-close"))}function J(e,t){e=e instanceof Array?e:[e];for(var i=0;i<e.length;i++)t?e[i].classList.add("e-wrap"):e[i].classList.remove("e-wrap")}function Y(e,i,r){var n,o=e.getService("valueFormatter");if("date"===i.type||"datetime"===i.type){if(n={type:i.type,skeleton:i.format},t.isBlazor()&&r){n.isServerRendered=r}"string"==typeof i.format&&"yMd"!==i.format&&(n.format=i.format)}switch(i.type){case"date":case"datetime":i.setFormatter(o.getFormatFunction(n)),i.setParser(o.getParserFunction(n));break;case"number":i.setFormatter(o.getFormatFunction({format:i.format})),i.setParser(o.getParserFunction({format:i.format}))}}function Z(e,i){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];for(var o=0,s=e.length;o<s;o++)i?(t.classList(e[o],r.slice(),[]),e[o].setAttribute("aria-selected","true")):(t.classList(e[o],[],r.slice()),e[o].removeAttribute("aria-selected"))}function $(e){for(var t={},i=[],r=0;r<e.length;r++)e[r]in t||(i.push(e[r].toString()),t[e[r]]=1);return i}function ee(e,t){var i=t.element.style.display;t.element.style.display="block";var n=t.width,o=r.calculateRelativeBasedPosition(e,t.element);t.element.style.display=i,t.element.style.top=o.top+e.getBoundingClientRect().height-5+"px";var s=o.left-n+e.clientWidth;t.element.style.left=s<1?n+s-16+"px":s+-4+"px"}function te(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function ie(e){var i=e.querySelector(".e-frame"),r=i.previousSibling;i.classList.contains("e-check")?(r.checked=!1,t.classList(i,["e-uncheck"],["e-check"])):(r.checked=!0,t.classList(i,["e-check"],["e-uncheck"]))}function re(e,t){e.checked=t}function ne(e,i,r){var n=t.createElement("div",{className:r});return n.appendChild(i),n.setAttribute("uid",e),n}function oe(e,i){t.removeClass([e],["e-check","e-stop","e-uncheck"]),i?e.classList.add("e-check"):e.classList.add("e-uncheck")}function se(e,i,r){for(o=0;o<i.length;o++)t.setValue(i[o].field,le(i[o],r),e.foreignKeyData);for(var n=e.cells,o=0;o<n.length;o++)n[o].isForeignKey&&t.setValue("foreignKeyData",t.getValue(n[o].column.field,e.foreignKeyData),n[o])}function le(e,r,n,o){var s=e.foreignKeyField,l=t.isNullOrUndefined(n)?g(e.field,r,e):n;l=t.isNullOrUndefined(l)?"":l;var a=new i.Query,h=o||(e.dataSource instanceof i.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return l.getDay?a.where(he({field:s,operator:"equal",value:l,matchCase:!1})):a.where(s,"==",l,!1),new i.DataManager(h).executeLocal(a)}function ae(e,t){var i;return t.some(function(t){return i=t,t.foreignKeyValue===e})&&i}function he(e,r){var n,o,s,l=t.extend({},M(e)),a=t.extend({},M(e));if(t.isNullOrUndefined(e.value))return n=new i.Predicate(l.field,l.operator,l.value,!1);var h=new Date(e.value);if("equal"===e.operator||"notequal"===e.operator){"datetime"===r?(o=new Date(h.setSeconds(h.getSeconds()-1)),s=new Date(h.setSeconds(h.getSeconds()+2)),e.value=new Date(h.setSeconds(s.getSeconds()-1))):(o=new Date(h.setHours(0)-1),s=new Date(h.setHours(24))),l.value=o,a.value=s,"equal"===e.operator?(l.operator="greaterthan",a.operator="lessthan"):"notequal"===e.operator&&(l.operator="lessthanorequal",a.operator="greaterthanorequal");var d=new i.Predicate(l.field,l.operator,l.value,!1),c=new i.Predicate(a.field,a.operator,a.value,!1);n="equal"===e.operator?d.and(c):d.or(c)}else"string"==typeof l.value&&(l.value=new Date(l.value)),n=new i.Predicate(l.field,l.operator,l.value,!1);return e.setProperties?e.setProperties({ejpredicate:n},!0):e.ejpredicate=n,n}function de(e,t,i){t=t&&i&&i.isRowDragable()?t+1:t;for(var r=e.cloneNode(!0),n=0;n<t;n++)r.removeChild(r.children[0]);for(var n=t,o=e.childElementCount;n<o;n++)e.removeChild(e.children[e.childElementCount-1]);return r}function ce(e){return e.enableVirtualization&&e.groupSettings.columns.length>0&&e.isVirtualAdaptive}function pe(e,i){if(void 0===e&&(e=""),e){for(var r=i,n=e.split("."),o=0;o<n.length&&!t.isNullOrUndefined(r);o++)r=r[n[o]];return r}}function ue(e,i){var r=new t.Internationalization;return"date"===i?"object"==typeof e?r.getDatePattern({type:e.type?e.type:"date",format:e.format},!1):t.isBlazor()?r.getDatePattern({type:"dateTime",format:e},!1):r.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?r.getDatePattern({type:e.type?e.type:"dateTime",format:e.format},!1):t.isBlazor()?r.getDatePattern({type:"dateTime",format:e},!1):r.getDatePattern({type:"dateTime",skeleton:e},!1)}function ge(e,t){for(var i={},r=0,n=e.getRowsObject();r<n.length;r++){var o=n[r];if(o.isExpand&&!o.isDetailRow){var s=e.allowPaging&&"AllPages"===e.printMode?o.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:o.index;i[s]={},i[s].isExpand=!0,i[s].gridModel=fe(o.childGrid,t),i[s].gridModel.query=e.childGrid.query}}return i}function fe(e,t){void 0===t&&(t="Expanded");var i={};if(!e)return i;for(var r=e.isFrozenGrid()&&!e.getFrozenColumns(),n=0,o=yn.printGridProp;n<o.length;n++){var s=o[n];i[s]="columns"===s?B(r?e.getColumns():e[s]):"allowPaging"===s?"CurrentPage"===e.printMode:M(e[s])}return i.enableHover=!1,e.childGrid&&"None"!==t&&(i.expandedRows=ge(e,t)),i}function me(e,i,r,n){var o=e||{},s=arguments.length;n&&(s-=1);for(var l=1;l<s;l++)if(arguments[l])for(var a=arguments[l],h=Object.keys(Object.getPrototypeOf(a)).length?Object.keys(a).concat(ye(a)):Object.keys(a),d=0;d<h.length;d++){var c=o[h[d]],p=a[h[d]],u=void 0;n&&(t.isObject(p)||Array.isArray(p))?t.isObject(p)?(u=c||{},o[h[d]]=t.extend({},u,p,n)):(u=c||[],o[h[d]]=t.extend([],u,p,n)):o[h[d]]=p}return o}function ye(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function ve(e){for(var t=0,i=0;i<e.length;i++){var r=Ce(e[i],0);t<r&&(t=r)}return t+1}function Ce(e,t){var i=t,r=[];if(e.columns){t++;for(var n=0;n<e.columns.length;n++)r[n]=Ce(e.columns[n],t);for(var o=0;o<r.length;o++)i<r[o]&&(i=r[o]);t=i}return t}function we(e,t){for(var i=0;i<t.length;i++){var r=e.enableColumnVirtualization?Ze(e,t[i].field).uid:e.getColumnByField(t[i].field).uid;t[i].uid=t[i].isForeignKey?ae(t[i].field,e.getForeignKeyColumns()).uid:r}}function be(e){var t=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(t.split(" ")[4]),height:parseFloat(t.split(" ")[5])}}function Se(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function Re(e,i){if(e&&i){var r=t.closest(e,"."+Oi).getBoundingClientRect().height,n=t.closest(i,"."+Oi).getBoundingClientRect().height;r>n?i.style.height=r+"px":e.style.height=n+"px"}}function xe(e,t){var i=t.getContent().firstElementChild.offsetHeight;return e&&e.getBoundingClientRect().top>i}function Fe(e,t){return e&&e.getBoundingClientRect().top<t}function Ee(e,t){var i=t.getRowHeight(),r=t.getContent().firstElementChild.scrollTop/i;return e<r+t.getContent().firstElementChild.offsetHeight/i&&e>r}function Ie(e,t){var i,r=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,n){e[r]===t[r]&&(i=n)}),i}function Te(e,t){var r=ze(t),n=new i.Deferred;return r.dataSource=n.resolve,r.action=e,{state:r,deffered:n}}function ze(e){var t=new i.UrlAdaptor,r=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),n=t.processQuery(r,e);return JSON.parse(n.data)}function De(e){for(var i=e.getVisibleColumns(),r=0,n=0,o=0;o<i.length;o++)t.isUndefined(i[o].width)?n++:-1!==i[o].width.toString().indexOf("%")&&r++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&"chrome"!==t.Browser.info.name&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&r&&!n}function Me(e,t,i,r){for(var n=r||0,o=0;o<t.length;o++)if(t[o].isDataRow){t[o].index=n,t[o].isAltRow=!!e.enableAltRow&&n%2!=0,i[o].setAttribute(Hi,n.toString()),t[o].isAltRow?i[o].classList.add("e-altrow"):i[o].classList.remove("e-altrow");for(var s=0;s<i[o].cells.length;s++)i[o].cells[s].setAttribute("index",n.toString());n++}t.length||e.renderModule.emptyRow(!0)}function Oe(e,t,i,r){var n=e.dataToBeUpdated[i].concat(t[i]).reduce(function(e,t){return e[t[r]]=void 0===e[t[r]]?t:Object.assign(e[t[r]],t),e},{});e.dataToBeUpdated[i]=Object.keys(n).map(function(e){return n[e]})}function ke(e){if(e.isFrozenGrid()){e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-movableheader .e-row, .e-movablecontent .e-row"));var t=e.getFrozenMode()===Pi?".e-frozen-left-header .e-row, .e-frozen-left-content .e-row":".e-frozenheader .e-row, .e-frozencontent .e-row";e.contentModule.freezeRowElements=[].slice.call(e.element.querySelectorAll(t)),e.getFrozenMode()===Pi&&(e.contentModule.frozenRightRowElements=[].slice.call(e.element.querySelectorAll(".e-frozen-right-header .e-row, .e-frozen-right-content .e-row")))}else e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow)"))}function Ae(e,t,i){var r=e.getFrozenLeftCount(),n=e.getMovableColumnsCount(),o=e.getFrozenRightColumnsCount(),s=e.getFrozenMode(),l=e.isRowDragable()?1:0,a="Right"===s?r+n:r+n+l,h="Right"===s?r:r+l,d="Right"===s?t.length-o-l:o?t.length-o:t.length;return i===Li?t=t.slice(0,r?r+l:t.length):i===Ni?t=t.slice(a,t.length):"movable"===i&&(t=t.slice(h,d)),t}function Be(e,t,i,r,n){(i[0].length||r)&&(n?t(Li,i[0],n[0]):t(Li,i[0])),e.isFrozenGrid()&&(i[1].length||r)&&(n?t("movable",i[1],n[1]):t("movable",i[1])),e.getFrozenMode()!==Pi&&"Right"!==e.getFrozenMode()||!i[2].length&&!r||(n?t(Ni,i[2],n[2]):t(Ni,i[2]))}function Pe(e){return["Right"!==e.getFrozenMode()?e.getRowsObject():[],e.getMovableRowsObject(),e.getFrozenRightRowsObject()]}function Ne(e){return["Right"!==e.getFrozenMode()?e.getAllDataRows(!0):[],e.getAllMovableDataRows(!0),e.getAllFrozenRightDataRows(!0)]}function Le(e,t,i){for(var r=e.children.length,n=0,o=0;o<r;o++,n++)o>=t&&o<i||(e.removeChild(e.children[n]),n--)}function qe(e,t,i){return"movable"===t.getFreezeTableName()?[].slice.call(e.getMovableDataRows()[i].getElementsByClassName(bi)):t.getFreezeTableName()===Ni?[].slice.call(e.getFrozenRightDataRows()[i].getElementsByClassName(bi)):[].slice.call(e.getDataRows()[i].getElementsByClassName(bi))}function He(e,t,i,r){var n=e.getFrozenLeftCount(),o=e.getMovableColumnsCount();return r="movable"===t.getFreezeTableName()?r-n:t.getFreezeTableName()===Ni?r-(n+o):r,qe(e,t,i)[r]}function Ue(e,t,i,r,n,o,s){s?i[W(e.field)]=e.validationRules:e.getFreezeTableName()===Li||!t&&e.getFreezeTableName()===Ni||1===o?i[W(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===Ni&&(n[W(e.field)]=e.validationRules):r[W(e.field)]=e.validationRules}function je(e){var t;return e.isFrozenGrid()&&(t=e.frozenRows&&"Top"===e.editSettings.newRowPosition?e.getMovableHeaderTbody():e.getMovableContentTbody()),t}function Ve(e){var t;return e.getFrozenMode()===Pi&&(t=e.frozenRows&&"Top"===e.editSettings.newRowPosition?e.getFrozenRightHeaderTbody():e.getFrozenRightContentTbody()),t}function Ge(e,t,i,r,n,o,s){e&&r&&s(e,r),t&&n&&s(t,n),i&&o&&s(i,o)}function _e(e,i,r){var n,o=new t.Internationalization;if("number"===i)try{n=o.getNumberPattern({format:e,currency:this.currency,useGrouping:!0},!0)}catch(t){n=e}else if("date"===i||"time"===i||"datetime"===i)try{if(n=o.getDatePattern({skeleton:e,type:i},r),t.isNullOrUndefined(n))throw"error"}catch(t){try{n=o.getDatePattern({format:e,type:i},r)}catch(t){n=e}}else n=e;if("number"!==i){var s={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};n=n.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return s[e]})}return n}function We(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[i].classList.add("e-bigger")}function Ke(e,t){for(var i,r=e.split(".").length,n=e.split("."),o=t,s=0;s<r;s++)o=i=o[n[s]];return i}function Qe(e,i,r,n,o,s){for(var l=Object.keys(e),a=0;a<l.length;a++){var h=e[l[a]].querySelectorAll("td.e-rowcell")[i];if(e[l[a]].querySelectorAll("td.e-rowcell").length&&h)if(t.setStyleAttribute(e[l[a]].querySelectorAll("td.e-rowcell")[i],{display:r}),e[l[a]].querySelectorAll("td.e-rowcell")[i].classList.contains("e-hide")&&t.removeClass([e[l[a]].querySelectorAll("td.e-rowcell")[i]],["e-hide"]),s&&o.isRowDragable()){var d=o.getFrozenColumns()?i:i+1;n[l[a]].cells[d].visible=""===r}else n[l[a]].cells[i].visible=""===r}}function Xe(e,t,i,r){for(var n=0,o=t;n<o.length;n++){var s=o[n];i?e.on(s.event,s.handler,r):e.off(s.event,s.handler)}}function Je(e,t,i,r){var n=W(t.field);return r=Object.assign(r,{id:e.element.id+n,name:n,"e-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:r})}function Ye(e,t){for(var i,r=0,n=e.columnModel;r<n.length;r++){var o=n[r];if(o.uid===t){i=o;break}}return i}function Ze(e,t){for(var i,r=0,n=e.columnModel;r<n.length;r++){var o=n[r];if(o.field===t){i=o;break}}return i}function $e(e,t){for(var i=0;i<e.length;i++)for(var r=0;r<e[i].columns.length;r++)t(e[i].columns[r],e[i])}function et(e,t,i){var r="Dialog"!==t,n=ue(e.column.format,e.column.type),o=pe(e.column.field,e.rowData);return o=o?new Date(o):null,{floatLabelType:r?"Never":"Always",value:o,format:n,placeholder:r?"":e.column.headerText,enableRtl:i,enabled:Q(e.column,e.requestType,e.element)}}function tt(e,t,i,r,n,o,s,l){r.clearSelection(),e.startIndex=0;var a=new Vi(o,null,r),h=n.generateRows(t,e);e.renderMovableContent?(s.vgenerator.movableCache[1]=h,h=r.getMovableRowsObject()):e.renderFrozenRightContent||e.renderMovableContent?e.renderFrozenRightContent&&(s.vgenerator.frozenRightCache[1]=h,h=r.getFrozenRightRowsObject()):(s.vgenerator.cache[1]=h,h=r.getRowsObject());var d=e.renderMovableContent||e.renderFrozenRightContent?e.renderMovableContent?r.getHeaderContent().querySelector("."+Ii).querySelector(Ui):r.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(Ui):r.getHeaderContent().querySelector("."+zi).querySelector(Ui);d.innerHTML="";for(var c=0;c<r.frozenRows;c++)if(d.appendChild(a.render(h[c],r.getColumns())),i.indexOf(c)>-1){h[c].isSelected=!0;for(var p=0;p<h[c].cells.length;p++)h[c].cells[p].isSelected=!0}e.renderMovableContent?l.mvblRows=s.vgenerator.movableCache[1]:e.renderMovableContent||e.renderFrozenRightContent?e.renderFrozenRightContent&&(l.frRows=s.vgenerator.frozenRightCache[1]):l.frzRows=s.vgenerator.cache[1],e.renderMovableContent=!e.renderMovableContent&&!e.renderFrozenRightContent,e.renderFrozenRightContent=r.getFrozenMode()===Pi&&!e.renderMovableContent&&!e.renderFrozenRightContent,(e.renderMovableContent||e.renderFrozenRightContent)&&(tt(e,t,i,r,n,o,s,l),e.renderMovableContent||e.renderFrozenRightContent||(e.isFrozenRowsRender=!1))}function it(e,i,r){for(var n=[],o=0;o<e.length;o++)n.push(t.extend({},e[o])),n[o].cells=Ae(r,n[o].cells,i);return n}function rt(e,t,i){var r,n=[];e===Li?r=t.vgenerator.cache:"movable"===e?r=t.vgenerator.movableCache:e===Ni&&(r="Right"===i.getFrozenMode()?t.vgenerator.cache:t.vgenerator.frozenRightCache);for(var o=Object.keys(r),s=0;s<o.length;s++)n=n.concat(it(r[o[s]],e,i));return n}function nt(e,t){for(var i=Object.keys(t.vgenerator.cache),r=Object.keys(t.vgenerator.movableCache),n=Object.keys(t.vgenerator.frozenRightCache),o=0;o<i.length;o++)ot(e,t.vgenerator.cache[i[o]]);for(o=0;o<r.length;o++)ot(e,t.vgenerator.movableCache[r[o]]);for(o=0;o<n.length;o++)ot(e,t.vgenerator.frozenRightCache[n[o]])}function ot(e,t){for(var i=t.filter(function(t){return e.clearAll||e.uid===t.uid}),r=0;r<i.length;r++){i[r].isSelected=e.set;for(var n=i[r].cells,o=0;o<n.length;o++)n[o].isSelected=e.set}}function st(e,t,i,r,n){e.appendContent(i,r,n),t.refreshFrozenScrollbar()}function lt(e,i,r,n,o){var s=[];s=e.vgenerator.generateRows(i,r).map(function(e){return t.extend({},e)});var l=n.generateRows(i,r,s);return o.frozenRows&&"delete"===r.requestType&&1===o.pageSettings.currentPage&&(l=l.slice(o.frozenRows)),l}function at(e,t,i,r,n){var o=e.virtualInfo.blockIndexes,s=e.virtualInfo.columnIndexes,l=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.renderMovableContent||(e.virtualInfo.columnIndexes=[]);var a=i.getCurrentViewRecords().length;n=i.renderModule.data.dataManager.dataSource.json.slice(0,a);var h=ht(t.vgenerator.generateRows(n,e),i,e,r);return e.virtualInfo.blockIndexes=o,e.virtualInfo.columnIndexes=s,e.virtualInfo.page=l,h.splice(0,i.frozenRows)}function ht(e,t,i,r){var n;n=i.renderMovableContent?"movable":i.renderFrozenRightContent?"frozen-right":"frozen-left";for(var o=0,s=e.length;o<s;o++)e[o].cells=Ae(t,e[o].cells,n);return e}function dt(e){var t=!1;return e&&(t="virtualscroll"===e.requestType&&"X"===e.currentInfo.sentinelInfo.axis),t}function ct(e,t){var i=dt(e)?t.getMovableVirtualHeader():t.getHeaderContent();return i?[].slice.call(i.querySelectorAll(".e-headercell:not(.e-stackedheadercell)")):[]}function pt(e,t){return dt(e)?t.getMovableVirtualHeader().querySelector("."+Mi):t.getFrozenVirtualHeader().querySelector("."+Mi)}function ut(e,t){return e=t.columns.slice(0,t.getFrozenColumns()).concat(e)}function gt(e,i,r){return dt(i)||(t.isNullOrUndefined(e)||(e.id="content-"+e.id),r.colgroup=e),r.colgroup}function ft(e,t){e.virtualRenderer.vgenerator.cache[1]?e.virtualRenderer.vgenerator.cache[1][t]=e.frzRows[t]:e.virtualRenderer.vgenerator.cache[1]=e.frzRows,e.virtualRenderer.vgenerator.movableCache[1]?e.virtualRenderer.vgenerator.movableCache[1][t]=e.mvblRows[t]:e.virtualRenderer.vgenerator.movableCache[1]=e.mvblRows}function mt(e,t,r,n){var o=e.dataSource instanceof i.DataManager&&!e.dataSource.dataSource.offline,s={container:t.content,pageHeight:2*t.getBlockHeight(),debounceEvent:o,axes:e.enableColumnVirtualization?["X","Y"]:["Y"],scrollbar:r,movableContainer:n};t.observer=new no(t.virtualEle.wrapper,s,t.virtualEle.movableWrapper)}var yt=function(){function e(e){this.intl=new t.Internationalization,t.isNullOrUndefined(e)||(this.intl.culture=e)}return e.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},e.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},e.prototype.fromView=function(e,i,r){return"date"!==r&&"datetime"!==r&&"number"!==r||t.isNullOrUndefined(i)?e:i(e)},e.prototype.toView=function(e,i){var r=e;return t.isNullOrUndefined(i)||t.isNullOrUndefined(e)||(r=i(e)),r},e.prototype.setCulture=function(e){t.isNullOrUndefined(e)||t.setCulture(e)},e}(),vt=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ct=function(){function e(e,r){var n=this;this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return n.editTemplateFn},this.getFilterTemplate=function(){return n.filterTemplateFn},t.merge(this,e),this.parent=r,"none"===this.type?this.type=t.isBlazor()&&!t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(this.field)?"none":null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),t.isNullOrUndefined(this.uid)&&(this.uid=L("grid-column"));var o=new yt;if(e.format&&(e.format.skeleton||e.format.format)&&(this.setFormatter(o.getFormatFunction(t.extend({},e.format))),this.setParser(o.getParserFunction(e.format))),this.toJSON=function(){for(var e={},i=["filter","dataSource",t.isBlazor()?" ":"headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],r=Object.keys(n),o=0;o<r.length;o++)if("columns"===r[o]){e[r[o]]=[];for(var s=0;s<n[r[o]].length;s++)e[r[o]].push(n[r[o]][s].toJSON())}else i.indexOf(r[o])<0&&(e[r[o]]=n[r[o]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=x(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=x(this.headerTemplate)),!t.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=x(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=x(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=x(this.filterTemplate)),this.isForeignColumn()&&(t.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params=t.extend({dataSource:this.dataSource,query:new i.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer){var s=this.sortComparer;this.sortComparer=function(e,t,i,r){if("string"==typeof s&&(s=pe(s,window)),"Descending"===this.sortDirection){var n=e;e=t,t=n;var o=i;i=r,r=o}return s(e,t,i,r)}}!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=pe(n.foreignKeyValue,le(n,{},e)[0]),t=pe(n.foreignKeyValue,le(n,{},t)[0]),"Descending"===n.sortDirection?i.DataUtil.fnDescending(e,t):i.DataUtil.fnAscending(e,t)})}return e.prototype.getSortDirection=function(){return this.sortDirection},e.prototype.setSortDirection=function(e){this.sortDirection=e},e.prototype.getFreezeTableName=function(){return this.freezeTable},e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)this[t[i]]=e[t[i]],this.parent&&this.parent.isReact&&"template"===t[i]&&this.parent.refreshReactColumnTemplateByUid(this.uid)},e.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},e.prototype.getFormatter=function(){return this.formatFn},e.prototype.setFormatter=function(e){this.formatFn=e},e.prototype.getParser=function(){return this.parserFn},e.prototype.setParser=function(e){this.parserFn=e},e.prototype.getColumnTemplate=function(){return this.templateFn},e.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},e.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},e.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},e}(),wt=function(){function e(){}return vt([t.Property()],e.prototype,"title",void 0),vt([t.Property()],e.prototype,"type",void 0),vt([t.Property()],e.prototype,"buttonOption",void 0),e}(),bt="actionBegin",St="actionComplete",Rt="dataBound",xt="columnDragStart",Ft="columnDrag",Et="columnDrop",It="rowDragStartHelper",Tt="rowDragStart",zt="rowDrag",Dt="rowDrop",Mt="initial-load",Ot="initial-end",kt="data-ready",At="content-ready",Bt="ui-update",Pt="on-empty",Nt="inbound-model-changed",Lt="model-changed",qt="colgroup-refresh",Ht="header-refreshed",Ut="reorder-complete",jt="beforecellfocused",Vt="key-pressed",Gt="click",_t="destroy",Wt="column-visible-changed",Kt="column-position-changed",Qt="rows-added",Xt="rows-removed",Jt="column-drag-stop",Yt="header-drop",Zt="datasource-modified",$t="refresh-virtual-block",ei="auto-col",ti="update-data",ii="prevent-batch",ri="dialog-destroy",ni="add-delete-Action",oi="freezerender",si="hierarchyprint",li="expandchildgrid",ai="row-position-changed",hi="columns-prepared",di="cbox-filter-complete",ci="filter-Prevent",pi="get-virtual-data",ui="refresh-infinite-mode-blocks",gi="refreshResizeHandlers";!function(e){e[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon"}(e.CellType||(e.CellType={})),function(e){e[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary"}(e.RenderType||(e.RenderType={})),function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport"}(e.ToolbarItem||(e.ToolbarItem={})),function(e){e[e.isEdit=0]="isEdit",e[e.isAdd=1]="isAdd",e[e.isSort=2]="isSort",e[e.isFilter=3]="isFilter"}(e.ResponsiveDialogAction||(e.ResponsiveDialogAction={})),function(e){e[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch"}(e.ResponsiveToolbarAction||(e.ResponsiveToolbarAction={}));var fi,mi,yi=function(){function e(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Qt,this.addRows,this),this.parent.on(ai,this.reorderRows,this),this.parent.on(Xt,this.removeRows,this),this.parent.on(Zt,this.initDataManager,this),this.parent.on(_t,this.destroy,this),this.parent.on(ti,this.crudActions,this),this.parent.on(ni,this.getData,this),this.parent.on(ei,this.refreshFilteredCols,this),this.parent.on(hi,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},e.prototype.getModuleName=function(){return"data"},e.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof i.DataManager?e.dataSource:t.isNullOrUndefined(e.dataSource)?new i.DataManager:new i.DataManager(e.dataSource),!e.isAngular||e.query instanceof i.Query?(this.isQueryInvokedFromData=!0,e.query=e.query instanceof i.Query?e.query:new i.Query):e.setProperties({query:new i.Query},!0)},e.prototype.generateQuery=function(e){var t=this.parent.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)t.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var i=[],r=this.parent.columns,n=0;n<r.length;n++)i.push(r[n].field);t.select(i)}return this.filterQuery(t),this.searchQuery(t),this.aggregateQuery(t),this.sortQuery(t),ce(this.parent)?this.virtualGroupPageQuery(t):this.pageQuery(t,e),this.groupQuery(t),t},e.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var r=t[i],n=0;n<r.columns.length;n++)for(var o=r.columns[n],s=o.type instanceof Array?o.type:[o.type],l=0;l<s.length;l++)e.aggregate(s[l].toLowerCase(),o.field);return e},e.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[t].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,i){var r=this.parent,n={query:e,skipPage:!1};if(r.notify("set-virtual-page-query",n),n.skipPage)return e;if((r.allowPaging||r.enableVirtualization||r.enableInfiniteScrolling)&&!0!==i){if(r.pageSettings.currentPage=Math.max(1,r.pageSettings.currentPage),r.pageSettings.pageCount<=0&&(r.pageSettings.pageCount=8),r.pageSettings.pageSize<=0&&(r.pageSettings.pageSize=12),e.queries.length)for(var o=0;o<e.queries.length;o++)"onPage"===e.queries[o].fn&&e.queries.splice(o,1);!t.isNullOrUndefined(r.infiniteScrollModule)&&r.enableInfiniteScrolling?this.parent.notify("infinite-page-query",e):e.page(r.pageSettings.currentPage,r.pageSettings.pageSize)}return e},e.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,r=0,n=i.length;r<n;r++){var o=this.getColumnByField(i[r]);o||this.parent.log("initial_action",{moduleName:"group",columnName:i[r]});var s=o.enableGroupByFormat,l=o.format;s?e.group(i[r],this.formatGroupColumn.bind(this),l):e.group(i[r],null)}}return e},e.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,r=[],n=i.length-1;n>-1;n--){if(!(l=this.getColumnByField(i[n].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[n].field}),e;l.setSortDirection(i[n].direction);var o=i[n].direction;l.sortComparer&&(this.parent.log("grid_sort_comparer"),o=this.isRemote()?i[n].direction:l.sortComparer.bind(l)),-1===t.groupSettings.columns.indexOf(i[n].field)?l.isForeignColumn()||l.sortComparer?e.sortByForeignKey(l.field,o,void 0,i[n].direction.toLowerCase()):e.sortBy(l.field,o):r.push({direction:o,field:l.field})}for(var n=0,s=r.length;n<s;n++)if("string"==typeof r[n].direction)e.sortBy(r[n].field,r[n].direction);else{var l=this.getColumnByField(r[n].field);e.sortByForeignKey(r[n].field,r[n].direction,void 0,l.getSortDirection().toLowerCase())}}return e},e.prototype.searchQuery=function(e,t,r){var n=this.parent.searchSettings,o=n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[],l=!1;if(this.parent.searchSettings.key.length){l=this.parent.getForeignKeyColumns().some(function(e){return o.indexOf(e.field)>-1});var a=r?t.dataSource.adaptor:this.dataManager.adaptor;if(l||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){o=r?[t.foreignKeyValue]:o;for(var h=0;h<o.length;h++){var d=r?t:this.getColumnByField(o[h]);d.isForeignColumn()&&!r?s=this.fGeneratePredicate(d,s):s.push(new i.Predicate(o[h],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}var c=i.Predicate.or(s);c.key=n.key,e.where(c)}else e.search(n.key,o,n.operator,n.ignoreCase,n.ignoreAccent)}return e},e.prototype.filterQuery=function(e,r,n){var o,s=this.parent,l=[],a=[],h=this.parent.getForeignKeyColumns();if(s.allowFiltering&&s.filterSettings.columns.length){for(var d=r||s.filterSettings.columns,c={},p=0,u=s.getColumns();p<u.length;p++)c[(v=u[p]).field]=v.filter.type?v.filter.type:s.filterSettings.type;for(var g=[],f=[],m=0,y=d;m<y.length;m++){var v=y[m],C=s.getColumnByField(v.field);t.isNullOrUndefined(v.type)&&C&&("date"===C.type||"datetime"===C.type)&&(v.type=s.getColumnByField(v.field).type),v.isForeignKey?g.push(v):f.push(v)}if(f.length){for(var w=0,b=f.length;w<b;w++)f[w].uid=f[w].uid||this.parent.grabColumnByFieldFromAllCols(f[w].field).uid;for(var S=bn.getPredicate(f),R=0,x=Object.keys(S);R<x.length;R++){D=x[R];l.push(S[D])}}if(g.length)for(var F=0,E=g;F<E.length;F++){(v=E[F]).uid=v.uid||this.parent.grabColumnByFieldFromAllCols(v.field).uid;var I=this.parent.grabColumnByUidFromAllCols(v.uid);if(I||this.parent.log("initial_action",{moduleName:"filter",columnName:v.field}),I.isForeignColumn()&&ae(v.field,h)&&!n)a.push(v),I.columnData.length||(o=!0),l=this.fGeneratePredicate(I,l);else for(var S=bn.getPredicate(d),T=0,z=Object.keys(S);T<z.length;T++){var D=z[T];l.push(S[D])}}l.length&&!o?e.where(i.Predicate.and(l)):this.parent.notify("showEmptyGrid",{})}return e},e.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify("generateQuery",{predicate:i,column:e}),i.predicate.predicates.length&&t.push(i.predicate)),t},e.prototype.getData=function(e,i){var r=this;void 0===e&&(e={requestType:""});var n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,i,n).promise;var o=void 0;switch(e.requestType){case"delete":if(i=i||this.generateQuery(),1===Object.keys(e.data).length)o=this.dataManager.remove(n,e.data[0],i.fromTable,i);else{var s={addedRecords:[],deletedRecords:[],changedRecords:[]};s.deletedRecords=e.data,o=this.dataManager.saveChanges(s,n,i.fromTable,i.requiresCount())}break;case"save":i=i||this.generateQuery(),e.index=t.isNullOrUndefined(e.index)?0:e.index,o=this.dataManager.insert(e.data,i.fromTable,i,e.index)}return e.promise=o,!o||Array.isArray(o)||o.hasOwnProperty("deletedRecords")?this.insert(i,e):o.then(function(){return r.insert(i,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&this.parent.notify("recordAdded",t),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t=this;if(this.dataManager.ready){var r=new i.Deferred;return this.dataManager.ready.then(function(){t.dataManager.executeQuery(e).then(function(e){r.resolve(e)})}).catch(function(e){r.reject(e)}),r.promise}return this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,i){var r=this.serviceLocator,n=this.getColumnByField(i),o=e;return n.type||(n.type=o.getDay?o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0||o.getMilliseconds()>0?"datetime":"date":typeof e),t.isNullOrUndefined(n.getFormatter())&&Y(r,n),yt.prototype.toView(e,n.getFormatter())},e.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,r="promise",n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());switch(this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,n),e.requestType){case"save":i=this.dataManager.update(n,e.data,t.fromTable,t,e.previousData)}e[r]=i||e[r],this.parent.notify("crud-Action",e)},e.prototype.saveChanges=function(e,t,r,n){if(void 0===n&&(n=this.generateQuery()),n.requiresCount(),"result"in this.parent.dataSource){var o=new i.Deferred,s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:o.resolve};return this.setState({isPending:!0,resolver:o.resolve}),this.parent.trigger("dataSourceChanged",s),o.promise}return this.dataManager.saveChanges(e,t,n.fromTable,n,r)},e.prototype.getKey=function(e){if(e&&e.length)return e[0]},e.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},e.prototype.addRows=function(e){for(var t=e.records.length;t>0;t--)this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(e){var t=this.dataManager.dataSource.json;this.dataManager.dataSource.json=t.filter(function(t){return-1===e.records.indexOf(t)})},e.prototype.getColumnByField=function(e){var t;return this.parent.columnModel.some(function(i){return t=i,i.field===e})&&t},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Qt,this.addRows),this.parent.off(Xt,this.removeRows),this.parent.off(Zt,this.initDataManager),this.parent.off(_t,this.destroy),this.parent.off(ti,this.crudActions),this.parent.off(ni,this.getData),this.parent.off(ei,this.refreshFilteredCols),this.parent.off(hi,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},e.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},e.prototype.getStateEventArgument=function(e){var r=new i.UrlAdaptor,n=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),o=r.processQuery(n,e),s=JSON.parse(o.data);return t.extend(s,o.pvtData)},e.prototype.eventPromise=function(e,t,r){var n=this,o=e,s=this.getStateEventArgument(t),l=new i.Deferred,a=new i.Deferred;if(void 0!==e.requestType&&!1!==this.dataState.isDataChanged)if(s.action=e,"save"===e.requestType||"delete"===e.requestType){var h=e;h.key=r;h.promise=a.promise,h.state=s,this.setState({isPending:!0,resolver:a.resolve}),o.endEdit=a.resolve,o.cancelEdit=a.reject,this.parent.trigger("dataSourceChanged",h),a.promise.then(function(){n.setState({isPending:!0,resolver:l.resolve,group:s.group,aggregates:s.aggregates}),"save"===h.requestType&&n.parent.notify("recordAdded",h),n.parent.trigger("dataStateChange",s)}).catch(function(){})}else this.setState({isPending:!0,resolver:l.resolve,group:s.group,aggregates:s.aggregates}),this.parent.trigger("dataStateChange",s);else this.setState({}),l.resolve(this.parent.dataSource);return l},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],i=0,r=this.parent.getColumns();i<r.length;i++){var n=r[i];n.allowSearching&&!t.isNullOrUndefined(n.field)&&e.push(n.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&we(this.parent,this.parent.filterSettings.columns)},e}(),vi=function(){function e(e,i){t.merge(this,e),this.parent=i}return e.prototype.clone=function(){var i=new e({});return t.merge(i,this),i.cells=this.cells.map(function(e){return e.clone()}),i},e.prototype.setRowValue=function(e){if(this.parent){var t=this.data[this.parent.getPrimaryKeyFieldNames()[0]];this.parent.setRowData(t,e)}},e.prototype.setCellValue=function(e,t){if(this.parent&&!(this.data[e].toString()===t.toString())){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.data[i];this.parent.setCellValue(r,e,t),this.makechanges(i,this.data)}},e.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)},e}(),Ci=function(){function e(e){this.isSpanned=!1,this.isRowSpanned=!1,t.merge(this,e)}return e.prototype.clone=function(){var i=new e({});return t.merge(i,this),i},e}(),wi=function(){function i(e,t){this.serviceLocator=e,this.parent=t}return i.prototype.render=function(i,r,n,o){var s,l=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(r.cells[n].cellType||e.CellType.Data),a=r.cells[n].cellSpan?r.cells[n].cellSpan:i.colSpan+n<=r.cells.length?i.colSpan:r.cells.length-n,h=i.rowSpan,d=0;if(r.index>0){var c=this.parent.groupSettings.columns.length>0&&!this.parent.getRowsObject()[r.index-1].isDataRow?this.parent.getRowsObject()[r.index].cells:this.parent.getRowsObject()[r.index-1].cells,p=r.cells[n];s=c.filter(function(e){return e.column.uid===p.column.uid})[0]}for(var u=s&&s.colSpanRange>1&&s.rowSpanRange>1?s.colSpanRange:a,g=n+1;g<n+u&&g<r.cells.length;g++)!1===r.cells[g].visible?d++:r.cells[g].isSpanned=!0;if(d>0){for(g=n+a;g<n+a+d&&g<r.cells.length;g++)r.cells[g].isSpanned=!0;n+a+d>=r.cells.length&&(a-=n+a+d-r.cells.length)}return r.cells[n].cellSpan&&(r.data[i.column.field]=r.cells[n].spanText,o=l.render(r.cells[n],r.data,{index:t.isNullOrUndefined(r.index)?"":r.index.toString()})),a>1&&t.attributes(o,{colSpan:a.toString(),"aria-colSpan":a.toString()}),h>1&&(t.attributes(o,{rowspan:h.toString(),"aria-rowspan":h.toString()}),r.cells[n].isRowSpanned=!0,r.cells[n].rowSpanRange=Number(h),a>1&&(r.cells[n].colSpanRange=Number(a))),r.index>0&&s.rowSpanRange>1&&(r.cells[n].isSpanned=!0,r.cells[n].rowSpanRange=Number(s.rowSpanRange-1),r.cells[n].colSpanRange=s.rowSpanRange>0?s.colSpanRange:1),!this.parent.enableColumnVirtualization||r.cells[n].cellSpan||this.containsKey(i.column.field,i.data[i.column.field])||this.backupMergeCells(i.column.field,i.data[i.column.field],i.colSpan),o},i.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},i.prototype.generteKey=function(e,t){return e+"__"+t.toString()},i.prototype.splitKey=function(e){return e.split("__")},i.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},i.prototype.getMergeCells=function(){return this.parent.mergeCells},i.prototype.setMergeCells=function(e,t){this.parent.mergeCells[e]=t},i.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,r=Object.keys(t);i<r.length;i++){var n=r[i],o=t[n],s=this.splitKey(n),l=this.getIndexFromAllColumns(s[0]),a=this.parent.getColumnIndexesInView(),h=o-(a[0]-l);if(l<a[0]&&h>1)for(var d=0,c=e;d<c.length;d++){var p=c[d];if(p.data[s[0]].toString()===s[1].toString()){p.cells[0].cellSpan=h,p.cells[0].spanText=s[1];break}}}return e},i.prototype.getIndexFromAllColumns=function(e){return S(this.parent.getVisibleColumns(),function(t,i){if(t.field===e)return i})[0]},i}(),bi="e-rowcell",Si="e-gridheader",Ri="e-gridcontent",xi="e-gridfooter",Fi="e-headercontent",Ei="e-movablecontent",Ii="e-movableheader",Ti="e-frozencontent",zi="e-frozenheader",Di="e-content",Mi="e-table",Oi="e-row",ki="e-gridchkbox",Ai="e-editedrow",Bi="e-addedrow",Pi="Left-Right",Ni="frozen-right",Li="frozen-left",qi="aria-colindex",Hi="aria-rowindex",Ui="tbody",ji="colgroup",Vi=function(){function i(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}return i.prototype.render=function(e,t,i,r,n){return this.refreshRow(e,t,i,r,n)},i.prototype.refresh=function(e,t,i,r,n){i&&(e.data=me({},e.changes),this.refreshMergeCells(e));var o=this.parent.element.querySelector("[data-uid="+e.uid+"]"),s=this.refreshRow(e,t,r,n,null,i),l=[].slice.call(s.cells);o.innerHTML="";for(var a=0,h=l;a<h.length;a++){var d=h[a];o.appendChild(d)}},i.prototype.refreshRow=function(i,r,n,o,s,l){var a=t.isNullOrUndefined(s)?this.element.cloneNode():s,h={data:i.data},d={data:i.data},c=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],p=!1;c&&(p=pe(c.field,h.data));var u=this.parent.getSelectedRowIndexes();i.isDataRow&&(i.isSelected=u.indexOf(i.index)>-1||p),i.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(i.isSelected=!0,-1===u.indexOf(i.index)&&u.push(i.index)),this.buildAttributeFromRow(a,i),t.attributes(a,t.extend({},n,{})),F(a,i.attributes);for(var g=this.serviceLocator.getService("cellRendererFactory"),f=this,m=0,y=i.cells.length;m<y;m++)!function(r,n){var o=i.cells[r];o.isSelected=i.isSelected,o.isColumnSelected=o.column.isSelected;var s=g.getCellRenderer(i.cells[r].cellType||e.CellType.Data),h={index:t.isNullOrUndefined(i.index)?"":i.index.toString()};i.isExpand&&i.cells[r].cellType===e.CellType.DetailExpand&&(h.class=f.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand");var c=s.render(i.cells[r],i.data,h,i.isExpand,l);if(i.cells[r].cellType!==e.CellType.Filter){if(i.cells[r].cellType===e.CellType.Data||i.cells[r].cellType===e.CellType.CommandColumn){f.parent.trigger("queryCellInfo",t.extend(d,{cell:c,column:o.column,colSpan:1,rowSpan:1,foreignKeyData:i.cells[r].foreignKeyData,requestType:f.parent.requestTypeAction}));var p=!1;if(i.index>0&&f.isSpan){var u=(f.parent.groupSettings.columns.length>0&&!f.parent.getRowsObject()[i.index-1].isDataRow?f.parent.getRowsObject()[i.index].cells:f.parent.getRowsObject()[i.index-1].cells).filter(function(e){return e.column.uid===i.cells[r].column.uid})[0];p=u.isRowSpanned?u.isRowSpanned:u.rowSpanRange>1}(d.colSpan>1||i.cells[r].cellSpan>1||d.rowSpan>1||p)&&(f.isSpan=!0,c=new wi(f.serviceLocator,f.parent).render(d,i,r,c))}i.cells[r].isSpanned||a.appendChild(c)}}(m);var v={row:a,rowHeight:this.parent.rowHeight};if(i.isDataRow&&(this.parent.trigger("rowDataBound",t.extend(h,v)),this.parent.childGrid||this.parent.isRowDragable()||this.parent.detailTemplate)){var C=a.querySelectorAll(".e-rowcell:not(.e-hide)")[0];C&&C.classList.add("e-detailrowvisible")}if(this.parent.enableVirtualization&&(h.rowHeight=this.parent.rowHeight),h.rowHeight?a.style.height=h.rowHeight+"px":this.parent.rowHeight&&(a.querySelector(".e-headercell")||a.querySelector(".e-groupcaption"))&&(a.style.height=this.parent.rowHeight+"px"),i.cssClass&&a.classList.add(i.cssClass),i.lazyLoadCssClass&&a.classList.add(i.lazyLoadCssClass),!(this.parent.enableColumnVirtualization&&0!==this.parent.frozenColumns)&&this.parent.element.scrollHeight>this.parent.height&&this.parent.aggregates.length)for(m=0;m<this.parent.aggregates.length;m++){if(this.parent.aggregates[m].properties.columns[0].footerTemplate){var w=[].slice.call(a.getElementsByClassName("e-summarycell"));if(w.length){var b=w[w.length-1];t.addClass([b],["e-lastsummarycell"]);var S=w[0];t.addClass([S],["e-firstsummarycell"])}}}return a},i.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},i.prototype.buildAttributeFromRow=function(e,i){var r={},n={rowindex:Hi,dataUID:"data-uid",ariaSelected:"aria-selected"},o=[];i.isDataRow&&o.push(Oi),i.isAltRow&&o.push("e-altrow"),t.isNullOrUndefined(i.index)||(r[n.rowindex]=i.index),i.rowSpan&&(r.rowSpan=i.rowSpan),i.uid&&(r[n.dataUID]=i.uid),i.isSelected&&(r[n.ariaSelected]=!0),!1===i.visible&&o.push("e-hide"),r.class=o,F(e,r)},i}(),Gi=function(){function i(e){this.parent=e}return i.prototype.generateRows=function(e,t){var i=[],r=this.parent.enableVirtualization&&t?t.startIndex:0;r=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):r;for(var n=0,o=Object.keys(e).length;n<o;n++,r++)i[n]=this.generateRow(e[n],r);return i},i.prototype.ensureColumns=function(){var t=[];if(this.parent.detailTemplate||this.parent.childGrid){var i={};this.parent.notify("detail-indentcell-info",i),t.push(this.generateCell(i,null,e.CellType.DetailExpand))}return this.parent.isRowDragable()&&t.push(this.generateCell({},null,e.CellType.RowDragIcon)),t},i.prototype.generateRow=function(e,t,i,r,n,o,s){var l={};l.foreignKeyData={},l.uid=L("grid-row"),l.data=e,l.index=t,l.indent=r,l.tIndex=o,l.isDataRow=!0,l.parentGid=n,l.parentUid=s,this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?l.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[t]&&(l.isExpand=this.parent.expandedRows[t].isExpand)),l.cssClass=i,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,l.isSelected=this.parent.getSelectedRowIndexes().indexOf(t)>-1,this.refreshForeignKeyRow(l);var a=this.ensureColumns(),h=new vi(l,this.parent);return h.cells="Right"===this.parent.getFrozenMode()?this.generateCells(l).concat(a):a.concat(this.generateCells(l)),h},i.prototype.refreshForeignKeyRow=function(e){for(var i=this.parent.getForeignKeyColumns(),r=0;r<i.length;r++)t.setValue(i[r].field,le(i[r],e.data),e.foreignKeyData)},i.prototype.generateCells=function(i){for(var r=this.parent.getColumns(),n=[],o=0;o<r.length;o++)n.push(this.generateCell(r[o],i.uid,t.isNullOrUndefined(r[o].commands)?void 0:e.CellType.CommandColumn,null,o,i.foreignKeyData));return n},i.prototype.generateCell=function(i,r,n,o,s,l){var a={visible:i.visible,isDataCell:!t.isNullOrUndefined(i.field||i.template),isTemplate:!t.isNullOrUndefined(i.template),rowID:r,column:i,cellType:t.isNullOrUndefined(n)?e.CellType.Data:n,colSpan:o,commands:i.commands,isForeignKey:i.isForeignColumn&&i.isForeignColumn(),foreignKeyData:i.isForeignColumn&&i.isForeignColumn()&&t.getValue(i.field,l)};return(a.isDataCell||"checkbox"===a.column.type||a.commands)&&(a.index=s),new Ci(a)},i.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[t]),e[t].cells=this.generateCells(e[t]);return e},i.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?e.startIndex:0},i}(),_i=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wi=function(){function i(e){this.parent=e}return i.prototype.getData=function(){for(var e=this,t=[],i=this.parent.aggregates.slice(),r=0;r<i.length;r++){var n=i[r].columns.filter(function(t){return!(t.footerTemplate||t.groupFooterTemplate||t.groupCaptionTemplate)||e.columnSelector(t)});n.length&&t.push({columns:n})}return t},i.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},i.prototype.getColumns=function(e,i){var r=[];if(this.parent.allowGrouping)for(var n=0;n<this.parent.groupSettings.columns.length;n++)r.push(new Ct({}));return!this.parent.detailTemplate&&t.isNullOrUndefined(this.parent.childGrid)||r.push(new Ct({})),this.parent.isRowDragable()&&!e&&r.push(new Ct({})),r.push.apply(r,this.parent.getColumns()),i=i&&!e?i+this.parent.getIndentCount():i,t.isNullOrUndefined(e)?r:r.slice(e,i)},i.prototype.generateRows=function(e,t,i,r,n){if(0===e.length&&(void 0===t||!t.count))return[];for(var o=this.buildSummaryData(e,t),s=[],l=this.getData(),a=0;a<l.length;a++)s.push(this.getGeneratedRow(l[a],o[a],t?t.level:void 0,i,r,t?t.parentUid:void 0,n));return s},i.prototype.getGeneratedRow=function(i,r,n,o,s,l,a){var h=[],d=this.getIndentByLevel(),c=!t.isNullOrUndefined(this.parent.childGrid),p=o?0:this.parent.getIndentCount();this.parent.isRowDragable()&&!o&&(d=["e-indentcelltop"]);for(var u=a||this.getColumns(o,s),g=0;g<u.length;g++)h.push(this.getGeneratedCell(u[g],i,g>=p?this.getCellType():g<this.parent.groupSettings.columns.length?e.CellType.Indent:e.CellType.DetailFooterIntent,d[g],c));var f=new vi({data:r,attributes:{class:"e-summaryrow"}});return f.cells=h,f.uid=L("grid-row"),f.parentUid=l,f.visible=h.some(function(e){return e.isDataCell&&e.visible}),f},i.prototype.getGeneratedCell=function(e,i,r,n,o){var s=i.columns.filter(function(t){return t.columnName===e.field})[0],l={style:{textAlign:e.textAlign},"e-mappinguid":e.uid,index:e.index};n&&(l.class=n),t.isNullOrUndefined(n)&&o&&(l.class="e-detailindentcelltop");var a={visible:e.visible,isDataCell:!t.isNullOrUndefined(s),isTemplate:s&&!t.isNullOrUndefined(s.footerTemplate||s.groupFooterTemplate||s.groupCaptionTemplate),column:s||{},attributes:l,cellType:r};return a.column.headerText=e.headerText,new Ci(a)},i.prototype.buildSummaryData=function(e,t){for(var i=[],r=this.getData(),n={},o=0;o<r.length;o++){n={};for(var s=r[o].columns,l=0;l<s.length;l++)n=this.setTemplate(s[l],t&&t.aggregates?t:e,n);i.push(n)}return i},i.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},i.prototype.setTemplate=function(e,i,r){var n=e.type,o={},s=e.getFormatter()||function(){return function(e){return e}}(),l=i;n instanceof Array||(n=[e.type]);for(var a=0;a<n.length;a++){var h=e.field+" - "+n[a].toLowerCase(),d=e.columnName,c="Custom"!==n[a]&&l.aggregates&&h in l.aggregates?l.aggregates[h]:U(n[a],l.aggregates?l:i,e,this.parent);r[d]=r[d]||{},r[d][h]=c,r[d][n[a]]=t.isNullOrUndefined(c)?" ":s(c),l.field&&(r[d].field=l.field,r[d].key=l.key)}return o.format=e.getFormatter(),e.setTemplate(o),r},i.prototype.getCellType=function(){return e.CellType.Summary},i}(),Ki=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _i(i,t),i.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},i.prototype.getIndentByLevel=function(e){return void 0===e&&(e=this.parent.groupSettings.columns.length),this.parent.groupSettings.columns.map(function(t,i){return i<=e-1?"":"e-indentcelltop"})},i.prototype.getCellType=function(){return e.CellType.GroupSummary},i}(Wi),Qi=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return _i(i,t),i.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},i.prototype.getData=function(){var e={columns:[]};return[t.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},e)]},i.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},i.prototype.getCellType=function(){return e.CellType.CaptionSummary},i}(Wi),Xi=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ji=function(i){function r(e){var t=i.call(this,e)||this;return t.rows=[],t.index=0,t.parent=e,t.summaryModelGen=new Ki(e),t.captionModelGen=new Qi(e),t}return Xi(r,i),r.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return i.prototype.generateRows.call(this,e,t);this.isInfiniteScroll="infiniteScroll"===t.requestType,this.rows=[],this.index=this.parent.enableVirtualization||this.isInfiniteScroll?t.startIndex:0;for(var r=0,n=e.length;r<n;r++)this.getGroupedRecords(0,e[r],e.level,r,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},r.prototype.getGroupedRecords=function(e,i,r,n,o,s,l){var a,h=this.isInfiniteScroll&&this.prevKey===i.key,d=r;if(t.isNullOrUndefined(i.items))if(t.isNullOrUndefined(i.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(i,e,n,this.rows.length,l));else for(var c=0,p=i.length;c<p;c++)this.getGroupedRecords(e,i[c],i.level,n,e,this.rows.length,l);else{var u=this.generateCaptionRow(i,e,n,o,s,l);if(h||(this.rows=this.rows.concat(u)),i.items&&i.items.length&&this.getGroupedRecords(e+1,i.items,i.items.level,n,e+1,this.rows.length,u.uid),this.parent.aggregates.length){var g=this.rows.length;(a=this.rows).push.apply(a,this.summaryModelGen.generateRows(i,{level:d,parentUid:u.uid}));for(var f=g-1;f>=0;f--)if(this.rows[f].isCaptionRow)this.rows[f].aggregatesCount=this.rows.length-g;else if(!this.rows[f].isCaptionRow&&!this.rows[f].isDataRow)break}}this.prevKey=i.key},r.prototype.getCaptionRowCells=function(i,r,n){var o=[],s=[],l=this.parent.getColumnByField(i),a=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(l=this.parent.columns.filter(function(e){return e.field===i})[0]);var h=this.parent.groupSettings.columns.length,d=this.parent;if(!this.parent.enableColumnVirtualization||-1!==a.indexOf(r)){for(var c=0;c<r;c++)o.push(this.generateIndentCell());o.push(this.generateCell({},null,e.CellType.Expand))}if(r=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+h+(d.detailTemplate||d.childGrid?1:0)-r+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()){var p=this.captionModelGen.generateRows(n)[0];t.extend(n,p.data);var u=0;p.cells.some(function(e,t){return u=t,e.visible&&e.isDataCell}),s=p.cells.slice(u).filter(function(e){return e.visible}),p.visible&&s[0].column.field===this.parent.getVisibleColumns()[0].field&&(s=s.slice(1)),1===this.parent.getVisibleColumns().length&&(s=[]),r-=s.length}for(var g=this.parent.enableColumnVirtualization?this.parent.getColumns():[l],f=!0,m=0;m<g.length;m++){var y=f&&-1!==a.indexOf(r);y&&(f=!1);var v=!this.parent.enableColumnVirtualization||y?e.CellType.GroupCaption:e.CellType.GroupCaptionEmpty;r=this.parent.enableColumnVirtualization&&v===e.CellType.GroupCaption?r+h:r,d.isRowDragable()&&r++,o.push(this.generateCell(l,null,v,r))}return o.push.apply(o,s),o},r.prototype.generateCaptionRow=function(e,i,r,n,o,s){var l={},a=this.parent.getColumnByField(e.field);l.data=t.extend({},e),a&&(l.data.field=e.field),l.isDataRow=!1,l.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),l.parentGid=r,l.childGid=n,l.tIndex=o,l.isCaptionRow=!0,l.parentUid=s,l.gSummary=t.isNullOrUndefined(e.items.records)?e.items.length:e.items.records.length,l.uid=L("grid-row");var h=new vi(l);return h.indent=i,this.getForeignKeyData(h),h.cells=this.getCaptionRowCells(e.field,i,h.data),h},r.prototype.getForeignKeyData=function(e){var i=e.data,r=this.parent.getColumnByField(i.field);if(r&&r.isForeignColumn&&r.isForeignColumn()){var n=t.isNullOrUndefined(i.key)?"":r.valueAccessor(r.foreignKeyValue,le(r,{},i.key)[0],r);t.setValue("foreignKey",n,e.data)}},r.prototype.generateDataRows=function(e,t,i,r,n){for(var o=[],s=this.parent.getColumnIndexesInView(),l=0,a=e.length;l<a;l++,r++){o[l]=this.generateRow(e[l],this.index,l?void 0:"e-firstchildrow",t,i,r,n);for(var h=0;h<t;h++)this.parent.enableColumnVirtualization&&-1===s.indexOf(t)||o[l].cells.unshift(this.generateIndentCell());this.index++}return o},r.prototype.generateIndentCell=function(){return this.generateCell({},null,e.CellType.Indent)},r.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[i].isDataRow){e[i].cells=this.generateCells(e[i]);for(var r=0;r<e[i].indent;r++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[i].indent)||e[i].cells.unshift(this.generateIndentCell())}else{var n=this.generateCaptionRow(e[i].data,e[i].indent);e[i].cells=n.cells}return e},r.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[e];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var r=this.rows[i];t.uid===r.parentUid&&(this.rows[i].visible=t.isExpand)}}},r}(Gi),Yi=function(){function e(e,i){var r=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.viewColIndexes=[],this.drop=function(e){r.parent.notify(Et,{target:e.target,droppedElement:e.droppedElement}),t.remove(e.droppedElement)},this.infiniteCache={},this.isRemove=!1,this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.mutableData=!1,this.rafCallback=function(e){var t=e;return function(){if(r.parent.isFrozenGrid()&&r.parent.enableVirtualization){var i=e.tableName;if(r.isLoaded=r.parent.getFrozenMode()===Pi?"frozen-right"===i:"movable"===i,r.parent.enableColumnVirtualization&&"virtualscroll"===e.requestType&&r.isLoaded){var n=[].slice.call(r.parent.getMovableVirtualHeader().getElementsByClassName(Oi)),o=[].slice.call(r.parent.getFrozenVirtualHeader().getElementsByClassName(Oi));r.isLoaded=n.length===o.length}}if(r.ariaService.setBusy(r.getPanel().querySelector("."+Di),!1),!r.parent.isDestroyed){var s=r.rows.slice(0);if(r.parent.isFrozenGrid()&&(s=e.isFrozen?r.freezeRows:e.renderFrozenRightContent?r.parent.getFrozenRightRowsObject():r.movableRows),r.parent.notify(At,{rows:s,args:t}),r.isLoaded&&(r.parent.isManualRefresh=!1,r.parent.trigger(Rt,{},function(){r.parent.allowTextWrap&&r.parent.notify(oi,{case:"textwrap"})})),t){var l=(t.requestType||"").toLowerCase()+"-complete";r.parent.notify(l,t),"batchsave"===e.requestType&&(e.cancel=!1,r.parent.trigger(St,e))}r.isLoaded&&r.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=i,this.ariaService=this.serviceLocator.getService("ariaService"),this.mutableData=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(Wt,this.setVisible,this),this.parent.on(qt,this.colGroupRefresh,this),this.parent.on(Bt,this.enableAfterRender,this),this.parent.on(ui,this.refreshContentRows,this),this.parent.on(jt,this.beforeCellFocused,this),this.parent.on(_t,this.droppableDestroy,this))}return e.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},e.prototype.renderPanel=function(){var e=this.parent,t=this.parent.element.querySelector("."+Ri);if(t)return this.ariaService.setOptions(this.parent.element.querySelector("."+Di),{busy:!1}),void this.setPanel(t);t=this.parent.createElement("div",{className:Ri});var i=this.parent.createElement("div",{className:Di});this.ariaService.setOptions(i,{busy:!1}),t.appendChild(i),this.setPanel(t),e.element.appendChild(t)},e.prototype.renderTable=function(){var e=this.getPanel(),i=e.querySelector(".e-virtualtable"),r=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||(t.remove(i),t.remove(r)),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector("."+Mi)),this.ariaService.setOptions(this.getTable(),{multiselectable:"Multiple"===this.parent.selectionSettings.type}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")},e.prototype.createContentTable=function(e){var i=this.getPanel().firstElementChild;this.getTable()&&t.remove(this.getTable());var r=i.querySelector("."+Mi)?i.querySelector("."+Mi):this.parent.createElement("table",{className:Mi,attrs:{cellspacing:"0.25px",role:"grid",id:this.parent.element.id+e}});return this.setColGroup(this.parent.getHeaderTable().querySelector(ji).cloneNode(!0)),r.appendChild(this.getColGroup()),r.appendChild(this.parent.createElement(Ui)),i.appendChild(r),i},e.prototype.refreshContentRows=function(e){var i=this;void 0===e&&(e={});var r=this.parent;if(0!==r.currentViewData.length){var n=this.currentMovableRows||r.currentViewData,o=this.parent.contentModule,s=r.isReact&&!t.isNullOrUndefined(r.rowTemplate),l=s?r.createElement(Ui):document.createDocumentFragment();this.initialPageRecords||(this.initialPageRecords=t.extend([],n));var a,h,d,c=s?r.createElement(Ui):document.createDocumentFragment(),p=r.getColumns(),u=r.getFrozenColumns(),g=this.parent.isFrozenGrid(),f=new Vi(this.serviceLocator,null,this.parent),y=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;this.rowElements=[],this.rows=[];var v,C,w=this.getPanel().querySelector("."+Ti),b=this.getPanel().querySelector("."+Ei),S=this.getPanel().querySelector("."+Di);ce(r)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(t){return e.requestType===t})&&this.emptyVcRows();var R;this.parent.enableVirtualization&&this.parent.isFrozenGrid()?(this.parent.enableColumnVirtualization&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis&&(R=this.parent.contentModule.generateRows(n,e),e.renderMovableContent=!0),R=this.parent.contentModule.generateRows(n,e)):(R=this.checkCache(R,e),this.isAddRows||this.useGroupCache||(R=this.generator.generateRows(n,e))),this.setGroupCache(R,e),this.parent.notify("set-infinite-cache",{isInfiniteScroll:y,modelData:R,args:e});var x=R[0].cells[0].index;g&&(C=o.setTbody(R,e),v=o.getTbody(C));var F=this.parent.getFrozenMode()===Pi&&C===Ni;if("infiniteScroll"!==e.requestType&&this.parent.registeredTemplate&&this.parent.registeredTemplate.template&&!e.isFrozen&&!F){for(var E=[],I=0;I<this.parent.registeredTemplate.template.length;I++)for(W=0;W<this.parent.registeredTemplate.template[I].rootNodes.length;W++)t.isNullOrUndefined(this.parent.registeredTemplate.template[I].rootNodes[W].parentNode)&&E.push(this.parent.registeredTemplate.template[I]);this.parent.destroyTemplate(["template"],E)}this.parent.isReact&&"infiniteScroll"!==e.requestType&&!e.isFrozen&&(this.parent.destroyTemplate(["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate"]),this.parent.renderTemplates()),this.parent.enableColumnVirtualization&&new wi(this.serviceLocator,this.parent).updateVirtualCells(R),g||(this.tbody=this.getTable().querySelector(Ui));var T=0,z=!0;if(ce(r)&&r.vcRows.length){var D=t.isNullOrUndefined(e.virtualInfo.offsets)?t.isNullOrUndefined(e.scrollTop)?0:e.scrollTop.top:e.virtualInfo.offsets.top;if(0!==D){for(var M=r.vGroupOffsets,O=r.pageSettings.pageSize/2,k=Object.keys(M).map(function(e){return M[e]}),A=0;A<k.length;A++)if(D<k[A]){if(t.isNullOrUndefined(e.virtualInfo)||"up"!==e.virtualInfo.direction){e.virtualInfo.blockIndexes=0===A||1===A?[1,2]:[A,A+1],T=0===A||1===A?0:A*O;break}e.virtualInfo.blockIndexes=0===A||1===A?[1,2]:[A,A+1],T=0===A||1===A?0:A*O;break}Math.round(D+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!e.rowObject&&(z=!1)}}var B=r.frozenRows&&!r.isFrozenGrid()&&this.parent.enableVirtualization&&"reorder"===e.requestType;if(r.frozenRows&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis||B){var P=e.virtualInfo.blockIndexes,N=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],B&&(e.virtualInfo.page=1);var L=B?this.initialPageRecords:n,H=this.vgenerator.generateRows(L,e);H.splice(this.parent.frozenRows);for(I=0;I<this.parent.frozenRows;I++)H[I].cells.splice(0,this.parent.getFrozenColumns()),a=f.render(H[I],p),c.appendChild(a);e.virtualInfo.blockIndexes=P,e.virtualInfo.page=N,B&&1===e.virtualInfo.page&&R.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(c,R,f,e,n,p);for(var I=T,U=R.length;I<U;I++)if(this.rows.push(R[I]),!this.parent.groupSettings.enableLazyLoading||this.useGroupCache||!this.parent.groupSettings.columns.length||(this.setRowsInLazyGroup(R[I],I),!t.isNullOrUndefined(R[I].indent))){if(this.setInfiniteVisibleRows(e,R[I],C),ce(r)&&this.rows.length>=r.pageSettings.pageSize&&z)break;if(r.rowTemplate){var j=r.element.id+"rowTemplate",V=void 0;if(r.isReact){var G=r.frozenRows&&I<r.frozenRows,_=t.extend({index:I},n[I]);r.getRowTemplate()(_,r,"rowTemplate",j,null,null,G?c:l),r.renderTemplates()}else V=r.getRowTemplate()(t.extend({index:I},n[I]),r,"rowTemplate",j);if(r.isReact||"TBODY"!==V[0].tagName)r.frozenRows&&I<r.frozenRows?a=r.isReact?c.lastElementChild:q(c,V):(r.isReact||(a=q(l,V)),d=r.isReact?l.lastElementChild:a.lastElementChild);else{for(var W=0;W<V.length;W++){var K="tr"===V[W].nodeName.toLowerCase();(K||V[W].querySelectorAll&&V[W].querySelectorAll("tr").length)&&(a=K?V[W]:V[W].querySelector("tr"))}r.frozenRows&&I<r.frozenRows?c.appendChild(a):l.appendChild(a)}var Q={data:R[I].data,row:d||a};this.parent.trigger("rowDataBound",Q)}else{a=f.render(R[I],p);var X=this.ensureFrozenHeaderRender(e);r.frozenRows&&I<r.frozenRows&&!y&&"virtualscroll"!==e.requestType&&X&&this.ensureVirtualFrozenHeaderRender(e)?c.appendChild(a):l.appendChild(a),R[I].isExpand&&r.notify(li,a.cells[r.groupSettings.columns.length])}R[I].isDataRow&&this.rowElements.push(a),this.ariaService.setOptions(this.getTable(),{colcount:r.getColumns().length.toString()})}if(g&&o.splitRows(C),r.frozenRows&&"virtualscroll"!==e.requestType&&!y&&this.ensureVirtualFrozenHeaderRender(e)||"virtualscroll"===e.requestType&&e.virtualInfo.sentinelInfo&&"X"===e.virtualInfo.sentinelInfo.axis)if(h=g?o.getFrozenHeader(C):r.getHeaderTable().querySelector(Ui),s){var J=h.parentElement;t.remove(h),J.appendChild(c)}else h.innerHTML="",h.appendChild(c);!r.enableVirtualization&&r.frozenRows&&0===x&&S.offsetHeight===Number(r.height)&&(S.style.height=S.offsetHeight-h.offsetHeight+"px"),e.rows=this.rows.slice(0),g&&o.setIsFrozen(e,C),this.index=x,m(function(){i.parent.notify("beforeFragAppend",e);var n=i.parent.enableVirtualization&&i.parent.isFrozenGrid();if(i.parent.enableVirtualization||y||(i.parent.isFrozenGrid()?(t.remove(o.getTbody(C)),v=i.parent.createElement(Ui)):(t.remove(i.tbody),i.tbody=i.parent.createElement(Ui))),!g||n||i.parent.enableInfiniteScrolling)if(r.rowTemplate&&t.updateBlazorTemplate(r.element.id+"rowTemplate","RowTemplate",r),n){if(e.renderFrozenRightContent){var s=r.getContent().querySelector(".e-frozen-right-content").querySelector(Ui);i.appendContent(s,l,e)}else e.renderMovableContent?(i.appendContent(b.querySelector(Ui),l,e),e.renderMovableContent=!1):i.appendContent(w.querySelector(Ui),l,e);i.parent.getFrozenColumns()||o.renderNextFrozentPart(e,C)}else!t.isNullOrUndefined(i.parent.infiniteScrollModule)&&i.parent.enableInfiniteScrolling?(i.isAddRows=!1,i.parent.notify("remove-infinite-rows",{args:e}),i.parent.notify("append-infinite-content",{tbody:v||i.tbody,frag:l,args:e,rows:i.rows,rowElements:i.rowElements,visibleRows:i.visibleRows,tableName:C}),!u&&g&&((r.getFrozenMode()===Pi||C!==Li&&C!==Ni)&&(r.getFrozenMode()!==Pi||C!==Li&&"movable"!==C)||i.refreshContentRows(t.extend({},e)))):(i.useGroupCache=!1,i.appendContent(i.tbody,l,e));else i.appendContent(v,l,e,C);u&&o.renderNextFrozentPart(e,C),l=null},this.rafCallback(t.extend({},e)))}},e.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},e.prototype.appendContent=function(e,i,r,n){this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?this.getTable().appendChild(i):(e.appendChild(i),this.getTable().appendChild(e))},e.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.contentModule.maintainRows(e,t)},e.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify("group-cache",{args:t,data:e})},e.prototype.ensureFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&("reorder"===e.requestType||"refresh"===e.requestType)||this.parent.infiniteScrollSettings.enableCache&&this.parent.frozenRows&&"delete"===this.parent.infiniteScrollModule.requestType&&1!==this.parent.pageSettings.currentPage)},e.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},e.prototype.checkCache=function(e,i){if(this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===i.requestType){var r=i.isFrozen?1:0,n=this.parent.isFrozenGrid();if(this.isAddRows=!t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage]),n&&!t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&(this.isAddRows=0!==this.infiniteCache[this.parent.pageSettings.currentPage][r].length),this.isAddRows){var o=n?this.infiniteCache[this.parent.pageSettings.currentPage][r]:this.infiniteCache[this.parent.pageSettings.currentPage];e=1===this.parent.pageSettings.currentPage?o.slice(this.parent.frozenRows):o}return e}return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===i.requestType||"columnstate"===i.requestType||"reorder"===i.requestType)&&this.parent.contentModule.getGroupCache()[this.parent.pageSettings.currentPage]?(this.useGroupCache=!0,this.parent.contentModule.initialGroupRows("reorder"===i.requestType)):null},e.prototype.setInfiniteVisibleRows=function(e,t,i){var r=this.parent.isFrozenGrid();this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&(r?i===Li||"Right"===this.parent.getFrozenMode()&&i===Ni?this.visibleFrozenRows.push(t):"movable"===i?this.visibleRows.push(t):this.rightFreezeRows.push(t):this.parent.infiniteScrollSettings.enableCache||this.visibleRows.push(t))},e.prototype.getCurrentBlockInfiniteRecords=function(e){var t=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];var i=this.parent.isFrozenGrid(),r=this.parent.getRows(),n=parseInt(r[this.parent.frozenRows].getAttribute(Hi),10),o=Math.ceil((n+1)/this.parent.pageSettings.pageSize);n=parseInt(r[r.length-1].getAttribute(Hi),10);var s=Math.ceil(n/this.parent.pageSettings.pageSize);if(i){for(var l=e?0:1,a=o;a<=s;a++)t=t.length?t.concat(this.infiniteCache[a][l]):this.infiniteCache[a][l];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(t=this.infiniteCache[1][l].slice(0,this.parent.frozenRows).concat(t))}else{for(a=o;a<=s;a++)t=t.length?t.concat(this.infiniteCache[a]):this.infiniteCache[a];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(t=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(t))}}return t},e.prototype.getReorderedVFRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.virtualFrozenHdrRefresh=function(e,t,i,r,n,o){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===r.requestType||"refresh"===r.requestType)){var s=void 0,l=[];this.parent.isFrozenGrid()?(this.currentMovableRows=n,l=this.getReorderedVFRows(r)):l=this.getReorderedRows(r);for(var a=0;a<l.length;a++)s=i.render(l[a],o),e.appendChild(s);1===r.virtualInfo.page&&t.splice(0,this.parent.frozenRows),r.renderMovableContent&&(this.parent.currentViewData=this.currentMovableRows,this.currentMovableRows=null)}},e.prototype.getInfiniteRows=function(){var e=[],t=this.parent.isFrozenGrid();if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var i=Object.keys(this.infiniteCache),r=0;r<i.length;r++)e=t?e.concat(this.infiniteCache[i[r]][0]):e.concat(this.infiniteCache[i[r]]);else e=t?this.visibleFrozenRows:this.visibleRows;return e},e.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},e.prototype.getPanel=function(){return this.contentPanel},e.prototype.setPanel=function(e){this.contentPanel=e},e.prototype.getTable=function(){return this.contentTable},e.prototype.setTable=function(e){this.contentTable=e},e.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.parent.getFrozenColumns()?this.freezeRows:this.rows},e.prototype.getMovableRows=function(){var e=this.getInfiniteMovableRows();return e.length?e:this.movableRows},e.prototype.getRowElements=function(){return this.parent.getFrozenColumns()?this.freezeRowElements:this.rowElements},e.prototype.getMovableRowElements=function(){return this.rowElements},e.prototype.setRowElements=function(e){this.rowElements=e},e.prototype.getColGroup=function(){return this.colgroup},e.prototype.setColGroup=function(e){return t.isNullOrUndefined(e)||(e.id="content-"+e.id),this.colgroup=e},e.prototype.setVisible=function(e){var i=this.parent,r=this.parent.isFrozenGrid(),n=i.getFrozenColumns(),o=[];if(r){var s=this.freezeRows,l=this.movableRows,a=s.length,h=void 0,d=[];i.getFrozenMode()===Pi&&(d=i.getFrozenRightRowsObject());for(var c=0,p=void 0;c<a;c++){h=l[c].cells.length;var u=d.length?d[c].cells.length:0;p=s[c].clone();for(var g=0;g<h;g++)p.cells.push(l[c].cells[g]);for(var f=0;f<u;f++)p.cells.push(d[c].cells[f]);o.push(p)}}else o=this.getRows();var m;o.some(function(e){return e.isDataRow&&(m=e),e.isDataRow});var y=!0;!i.groupSettings.columns.length&&m&&(y=!1);for(var v=i.getDataRows(),C={},w=this.infiniteRowVisibility(),b=w||this.rows.filter(function(e){return!e.isDetailRow}),S=0,R=e.length;S<R;S++){var x=e[S],F=this.parent.getNormalizedColumnIndex(x.uid),E=this.parent.getColumnIndexByUid(x.uid),I=!0===x.visible?"":"none";if(-1!==F&&m&&F<m.cells.length)if(r)if("movable"!==x.getFreezeTableName())if(x.getFreezeTableName()===Ni){E=F-=this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount();var T=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(ji);t.setStyleAttribute(T.childNodes[F],{display:I}),b=i.getFrozenRightRowsObject(),v=i.getFrozenRightDataRows()}else{t.setStyleAttribute(this.getColGroup().childNodes[F],{display:I});var z=this.infiniteRowVisibility(!0);b=z||this.freezeRows,v=i.getDataRows()}else{var D=i.getContent().querySelector("."+Ei).querySelector(ji);E=F=F-n-this.parent.getFrozenLeftColumnsCount(),t.setStyleAttribute(D.childNodes[F],{display:I}),v=i.getMovableDataRows();var M=this.infiniteRowVisibility();b=M||this.movableRows}else t.setStyleAttribute(this.getColGroup().childNodes[F],{display:I});y||this.setDisplayNone(v,E,I,b),!this.parent.invokedFromMedia&&x.hideAtMedia&&this.parent.updateMediaColumns(x),this.parent.invokedFromMedia=!1}y?this.refreshContentRows({requestType:"refresh"}):this.parent.getFrozenColumns()?(this.parent.notify("partial-refresh",{rows:this.freezeRows,args:{isFrozen:!0,rows:this.freezeRows}}),this.parent.notify("partial-refresh",{rows:this.movableRows,args:{isFrozen:!1,rows:this.movableRows}})):this.parent.notify("partial-refresh",{rows:b,args:C})},e.prototype.setDisplayNone=function(e,t,i,r){Qe(e,t,i,r,this.parent,this.parent.isRowDragable()),this.parent.notify("infinite-show-hide",{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},e.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?e?this.getCurrentBlockInfiniteRecords(!0):this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},e.prototype.colGroupRefresh=function(){if(this.getColGroup()){var e=void 0;e=this.parent.enableColumnVirtualization&&this.parent.getFrozenColumns()&&this.parent.contentModule.isXaxis()?this.parent.getMovableVirtualHeader().querySelector(ji).cloneNode(!0):this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)}},e.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+Si).querySelector(ji).cloneNode(!0)},e.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new t.Droppable(e.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},e.prototype.canSkip=function(e,i,r){return t.isNullOrUndefined(i)||t.isNullOrUndefined(e.visible)||i.cells[r].visible===e.visible},e.prototype.getModelGenerator=function(){return this.generator=this.parent.allowGrouping?new Ji(this.parent):new Gi(this.parent)},e.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(Ui).innerHTML="")},e.prototype.setSelection=function(e,t,i){this.parent.notify("set-freeze-selection",{uid:e,set:t,clearAll:i});var r=this.parent.isFrozenGrid();if(!r||!this.parent.enableVirtualization){if(r)for(var n=this.getMovableRows().filter(function(t){return i||e===t.uid}),o=0;o<n.length;o++)n[o].isSelected=t;for(var s=this.getRows().filter(function(t){return i||e===t.uid}),l=0;l<s.length;l++){s[l].isSelected=t;for(var a=s[l].cells,h=0;h<a.length;h++)a[h].isSelected=t}}},e.prototype.getRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),this.parent.getDataRows()[e]},e.prototype.getInfiniteRowIndex=function(e){if(this.parent.infiniteScrollSettings.enableCache){var t=this.parent.frozenRows,i=t>e?0:t,r=parseInt(this.parent.getRows()[i].getAttribute(Hi),10);e=t>e?e:e-r+t}return e},e.prototype.getVirtualRowIndex=function(e){return e},e.prototype.getMovableRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),this.parent.getMovableDataRows()[e]},e.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},e.prototype.setRowObjects=function(e){this.rows=e},e.prototype.immutableModeRendering=function(e){var i=this;void 0===e&&(e={});var r=this.parent;r.hideSpinner();var n=r.getPrimaryKeyFieldNames()[0],o={},s={},l=[],a={},h=r.getRowsObject().slice(),d=this.getBatchEditedRecords(n,h),c={},p=0!==Object.keys(d).length;if(r.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else{if(0===r.currentViewData.length)return;var u={},g=r.createElement(Ui),f=r.currentViewData,m=[].slice.call(this.getTable().querySelector(Ui).children);if(this.prevCurrentView.length){var y=this.prevCurrentView.length,v=f.length;if(y===v)for(C=0;C<v;C++)"Batch"===this.parent.editSettings.mode&&m[C].classList.contains("e-insertedrow")?(m.splice(C,1),--C):(s[f[C][n]]=o[this.prevCurrentView[C][n]]=C,c[C]=f[C][n],u[h[C].uid]=m[C],a[C]=this.prevCurrentView[C][n]);else{for(C=0;C<v;C++)s[f[C][n]]=C,c[C]=f[C][n];for(C=0;C<y;C++)"Batch"===this.parent.editSettings.mode&&m[C].classList.contains("e-insertedrow")?(m.splice(C,1),--C):(u[h[C].uid]=m[C],o[this.prevCurrentView[C][n]]=C,a[C]=this.prevCurrentView[C][n])}}for(var C=0;C<f.length;C++){var w=o[f[C][n]];if(t.isNullOrUndefined(w)){var b=new Vi(this.serviceLocator,null,r),S=this.generator.generateRows([f[C]]);l.push(S[0]);x=b.render(S[0],r.getColumns());g.appendChild(x),this.refreshImmutableContent(C,x,l[C])}else{var R=!1;this.mutableData&&(R=this.objectEqualityChecker(this.prevCurrentView[w],f[C]));var x=u[h[w].uid];if(l.push(h[w]),this.rowElements[w]&&this.rowElements[w].getAttribute("data-uid")===l[C].uid&&(p&&t.isNullOrUndefined(d[c[C]])||!p&&(R||this.prevCurrentView[w]===f[C]))){w!==C&&this.refreshImmutableContent(C,x,l[C]),g.appendChild(x);continue}(p&&!t.isNullOrUndefined(d[c[C]])||!this.mutableData&&f[C]!==this.prevCurrentView[w]||this.mutableData&&!R)&&h[w].setRowValue(f[C]),g.appendChild(x),this.refreshImmutableContent(C,x,l[C])}}if(this.rows=l,this.rowElements=[].slice.call(g.children),t.remove(this.getTable().querySelector(Ui)),this.getTable().appendChild(g),this.parent.trigger(Rt,{},function(){i.parent.allowTextWrap&&i.parent.notify(oi,{case:"textwrap"})}),e){var F=(e.requestType||"").toLowerCase()+"-complete";this.parent.notify(F,e)}}},e.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),r=!0,n=0;n<i.length;n++)if(!(e[i[n]]===t[i[n]]||e[i[n]]instanceof Date&&t[i[n]]instanceof Date&&e[i[n]].getTime()===t[i[n]].getTime())){r=!1;break}return r},e.prototype.getBatchEditedRecords=function(e,t){var i={},r=this.parent.getBatchChanges(),n=[],o=[];Object.keys(r).length&&(n=r.changedRecords,o=r.addedRecords);var s={cancel:!1};this.parent.notify("immutable-batch-cancel",{rows:t,args:s}),o.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,o.length):s.cancel||t.splice(0,o.length));for(var l=0;l<n.length;l++)i[n[l][e]]=l;return i},e.prototype.refreshImmutableContent=function(e,t,i){i.isAltRow=!!this.parent.enableAltRow&&e%2!=0,i.isAltRow?t.classList.add("e-altrow"):t.classList.remove("e-altrow"),i.index=e,i.edit=void 0,i.isDirty=!1,t.setAttribute(Hi,e.toString()),this.updateCellIndex(t,e)},e.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[i].setAttribute("index",t.toString())},e}(),Zi=function(){function i(e,i){var r=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var i=r.parent,n=r.draggable.currentStateTarget,o=O(n,"e-headercell");if(!i.allowReordering&&!i.allowGrouping||!t.isNullOrUndefined(o)&&o.getElementsByClassName("e-checkselectall").length>0)return!1;var s=r.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),l=n.classList.contains("e-headercell")?n:o;if(!l||!i.allowReordering&&l.classList.contains("e-stackedheadercell"))return!1;var a,h=l.offsetHeight,d=l.querySelector(".e-headercelldiv")||l.querySelector(".e-stackedheadercelldiv");if(d){if(a=l.querySelector(".e-stackedheadercelldiv")?i.getStackedHeaderColumnByHeaderText(d.innerText.trim(),i.columns):i.getColumnByUid(d.getAttribute("e-mappinguid")),r.column=a,r.column.lockColumn)return!1;s.setAttribute("e-mappinguid",r.column.uid)}if(a&&!t.isNullOrUndefined(a.headerTemplate))if(t.isNullOrUndefined(a.headerTemplate))s.innerHTML=a.headerTemplate;else{var c=i.getColumnIndexByField(a.field);q(s,a.getHeaderTemplate()(t.extend({index:c},a),i,"headerTemplate"))}else s.innerHTML=d?a.headerText:l.firstElementChild.innerHTML;return s.style.width=l.offsetWidth+"px",s.style.height=l.offsetHeight+"px",s.style.lineHeight=(h-6).toString()+"px",i.element.appendChild(s),s},this.dragStart=function(e){var t=r.parent;t.element.querySelector(".e-gridpopup").style.display="none",t.notify(xt,{target:r.draggable.currentStateTarget,column:r.column,event:e.event})},this.drag=function(e){var i=r.parent,n=e.target;if(n){var o=t.closest(n,".e-grid"),s=r.parent.element.querySelector(".e-cloneproperties");if(!(o&&o.getAttribute("id")===i.element.getAttribute("id")||(t.classList(s,["e-notallowedcur"],["e-defaultcur"]),i.allowReordering&&(i.element.querySelector(".e-reorderuparrow").style.display="none",i.element.querySelector(".e-reorderdownarrow").style.display="none"),i.groupSettings.allowReordering)))return;i.notify(Ft,{target:e.target,column:r.column,event:e.event})}},this.dragStop=function(e){var i,n=r.parent;n.element.querySelector(".e-gridpopup").style.display="none",(!O(e.target,"e-headercell")&&!O(e.target,"e-groupdroparea")||!n.allowReordering&&O(e.target,"e-headercell")||!e.helper.getAttribute("e-mappinguid")&&O(e.target,"e-groupdroparea"))&&(t.remove(e.helper),i=!0),n.notify(Jt,{target:e.target,event:e.event,column:r.column,cancel:i})},this.drop=function(e){var i=r.parent,n=e.droppedElement.getAttribute("e-mappinguid"),o=t.closest(e.target,".e-grid");t.remove(e.droppedElement),o&&o.getAttribute("id")!==i.element.getAttribute("id")||!i.allowReordering&&!i.allowGrouping||i.notify(Yt,{target:e.target,uid:n,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=i,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount()||this.parent.on(Wt,this.setVisible,this),this.parent.on(Kt,this.colPosRefresh,this),this.parent.on(Ot,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(Bt,this.updateCustomResponsiveToolbar,this))}return i.prototype.renderPanel=function(){var e=this.parent.element.querySelector("."+Si),t=null!=e;e=t?e:this.parent.createElement("div",{className:"e-gridheader"});var i=t?e.querySelector("."+Fi):this.parent.createElement("div",{className:Fi});this.toggleStackClass(e),e.appendChild(i),this.setPanel(e),t||this.parent.element.appendChild(e)},i.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector("."+Mi)),this.parent.getFrozenColumns()||this.parent.getFrozenRightColumnsCount()||this.parent.getFrozenLeftColumnsCount()||(this.initializeHeaderDrag(),this.initializeHeaderDrop()),this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:this.parent.isFrozenGrid()}})},i.prototype.getPanel=function(){return this.headerPanel},i.prototype.setPanel=function(e){this.headerPanel=e},i.prototype.getTable=function(){return this.headerTable},i.prototype.setTable=function(e){this.headerTable=e},i.prototype.getColGroup=function(){return this.colgroup},i.prototype.setColGroup=function(e){return this.colgroup=e},i.prototype.getRows=function(){return this.getTable().tHead.rows},i.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().querySelector("."+Fi);return t.appendChild(e),t},i.prototype.createHeader=function(e,i){void 0===e&&(e=null);var r=this.parent,n=r.isFrozenGrid();this.getTable()&&!n&&t.remove(this.getTable());var o=this.parent.createElement("table",{className:Mi,attrs:{cellspacing:"0.25px",role:"grid"}}),s=i||(r.getFrozenLeftCount()?"frozen-left":"frozen-right"),l=this.createHeaderContent(s),a=l.thead,h=this.parent.createElement(Ui,{className:this.parent.frozenRows?"":"e-hide"});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var d,c=this.parent.createElement(ji),p=this.parent.createElement("tr"),u=this.rows=l.rows,g=0,f=u.length;g<f;g++)for(var m=0,y=u[g].cells.length;m<y;m++)d=this.parent.createElement("td"),p.appendChild(d);return(r.allowFiltering||r.allowSorting||r.allowGrouping)&&o.classList.add("e-sortfilter"),this.updateColGroup(c),h.appendChild(p),o.appendChild(this.setColGroup(c)),o.appendChild(a),o.appendChild(h),o.appendChild(this.caption),this.ariaService.setOptions(o,{colcount:r.getColumns().length.toString()}),o},i.prototype.createTable=function(e){return void 0===e&&(e=null),this.createHeader(e)},i.prototype.createHeaderContent=function(t){var i=this.parent,r=1,n=i.getFrozenMode(),o=i.getColumns(),s=this.parent.createElement("thead"),l=this.parent.createElement("tr",{className:"e-columnheader"}),a=new Vi(this.serviceLocator,e.CellType.Header,i);a.element=l;var h,d=[];this.colDepth=ve(i.columns);for(var c=0,p=this.colDepth;c<p;c++)d[c]=this.generateRow(c),d[c].cells=[];"Right"!==n&&(d=this.ensureColumns(d)),d=this.getHeaderCells(d,t),"Right"===n&&(r=0,d=this.ensureColumns(d));var u=this.parent.getFrozenColumns();if(this.parent.isRowDragable()&&this.parent.isFrozenGrid()&&d[0].cells[r]){var g=d[0].cells[r].column.getFreezeTableName();"movable"===g||n===Pi&&g===Ni?"Right"===n?d[0].cells.pop():d[0].cells.shift():u||g!==Li?"Right"===n&&g===Ni&&(d[0].cells[d[0].cells.length-1].column.freeze="Right"):d[0].cells[0].column.freeze=g===Li?"Left":"Right"}for(var c=0,p=this.colDepth;c<p;c++)h=a.render(d[c],o),this.parent.rowHeight&&h.querySelector(".e-headercell")&&(h.style.height=this.parent.rowHeight+"px"),s.appendChild(h);return{thead:s,rows:d}},i.prototype.updateColGroup=function(e){var i,r=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(this.parent.enableColumnVirtualization&&this.parent.getFrozenColumns()&&this.parent.contentModule.isXaxis()&&(r=t.extend([],this.parent.getColumns())).splice(0,this.parent.getFrozenColumns()),e.id=this.parent.element.id+ji,this.parent.allowGrouping)for(var o=0,s=this.parent.groupSettings.columns.length;o<s;o++)this.parent.enableColumnVirtualization&&-1===n.indexOf(o)||(i=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(i));(this.parent.detailTemplate||this.parent.childGrid)&&(i=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(i)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(i=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(i));for(var o=0,s=r.length;o<s;o++)i=this.parent.createElement("col"),!1===r[o].visible&&t.setStyleAttribute(i,{display:"none"}),e.appendChild(i);return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&(i=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(i)),e},i.prototype.ensureColumns=function(t){for(var i=this.parent,r=this.parent.getColumnIndexesInView(),n=0,o=t.length;n<o;n++){if(i.allowGrouping)for(var s=0,l=i.groupSettings.columns.length;s<l;s++)this.parent.enableColumnVirtualization&&-1===r.indexOf(s)||t[n].cells.push(this.generateCell({},e.CellType.HeaderIndent));if(i.detailTemplate||i.childGrid){var a={};this.parent.notify("detail-indentcell-info",a),t[n].cells.push(this.generateCell(a,e.CellType.DetailHeader))}i.isRowDragable()&&t[n].cells.push(this.generateCell({},e.CellType.RowDragHIcon))}return t},i.prototype.getHeaderCells=function(e,t){var i=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),r=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(n=0;n<r.length;n++)this.lockColsRendered=!1,e=this.appendCells(r[n],e,0,0===n,!1,n===r.length-1,i,t);for(var n=0,o=r.length;n<o;n++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(r[n],e,0,0===n,!1,n===o-1,i,t);return e},i.prototype.appendCells=function(t,i,r,n,o,s,l,a){var h,d=s?"e-lastcell":"",c=this.parent.isFrozenGrid(),p=!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered,u=!this.parent.lockcolPositionCount||t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered,g=this.parent.getContent().querySelector(".e-movablescrollbar");if(c&&g&&this.parent.enableColumnVirtualization&&(h=g.scrollLeft),t.columns){this.isFirstCol=!1;var f=this.getCellCnt(t,0);if(f){var m=this.getStackedLockColsCount(t,0),y=0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==m||this.lockColsRendered&&f-m!=0,v=c&&this.ensureStackedFrozen(t.columns,a,!1);(!c&&y||v)&&i[r].cells.push(new Ci({cellType:e.CellType.StackedHeader,column:t,colSpan:this.getColSpan(f,m,t.columns,a,c)}))}if(this.parent.lockcolPositionCount&&!this.lockColsRendered)for(C=0;C<t.columns.length;C++)i=this.appendCells(t.columns[C],i,r+1,n,0===C,C===t.columns.length-1&&s,l,a);if(this.lockColsRendered)for(var C=0,w=t.columns.length;C<w;C++){var b=this.isFirstCol=t.columns[C].visible&&!this.isFirstCol&&1!==w,S=C===w-1;i=this.appendCells(t.columns[C],i,r+1,n,b,S&&s,l,a)}}else h&&h>0&&this.parent.contentModule.isXaxis()&&0!==this.parent.inViewIndexes[0]&&"movable"===t.getFreezeTableName()?i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))):(!c&&p||c&&t.getFreezeTableName()===a&&u)&&i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))),this.parent.lockcolPositionCount?this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(t.lockColumn&&!this.lockColsRendered||!t.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++:this.frzIdx++;return i},i.prototype.ensureStackedFrozen=function(e,t,i){for(var r=e.length,n=0;n<r;n++)if(e[n].columns)i=this.ensureStackedFrozen(e[n].columns,t,i);else if(e[n].getFreezeTableName()===t){i=!0;break}return i},i.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[i],t);else e.lockColumn&&t++;return t},i.prototype.getColSpan=function(e,t,i,r,n){return n?e=this.getFrozenColSpan(i,r,0):this.parent.lockcolPositionCount&&(e=this.lockColsRendered?e-t:t),e},i.prototype.getFrozenColSpan=function(e,t,i){for(var r=e.length,n=0;n<r;n++)e[n].columns?i=this.getFrozenColSpan(e[n].columns,t,i):e[n].getFreezeTableName()===t&&e[n].visible&&i++;return i},i.prototype.generateRow=function(e){return new vi({})},i.prototype.generateCell=function(e,i,r,n,o,s){var l={visible:e.visible,isDataCell:!1,isTemplate:!t.isNullOrUndefined(e.headerTemplate),rowID:"",column:e,cellType:i,rowSpan:r,className:n,index:o,colIndex:s};return(!l.rowSpan||l.rowSpan<2)&&delete l.rowSpan,new Ci(l)},i.prototype.setVisible=function(e){for(var i,r,n=this.parent,o=n.getFrozenColumns(),s=0,l=e.length;s<l;s++){var a=e[s];if(r=n.getNormalizedColumnIndex(a.uid),i=a.visible?"":"none",o){var h=this.parent.isRowDragable()?o+1:o;if(r<h)t.setStyleAttribute(this.getColGroup().children[r],{display:i});else{var d=n.getHeaderContent().querySelector("."+Ii).querySelector(ji);t.setStyleAttribute(d.children[r-h],{display:i})}}else t.setStyleAttribute(this.getColGroup().children[r],{display:i})}this.refreshUI()},i.prototype.colPosRefresh=function(){this.refreshUI()},i.prototype.refreshUI=function(){var e=this.parent.isFrozenGrid(),i=this.parent.enableColumnVirtualization&&e,r=this.getPanel();this.toggleStackClass(r);var n=this.freezeReorder?this.headerPanel.querySelector("."+Ii).querySelector("."+Mi):this.getTable(),o=this.parent.isFrozenGrid()?this.parent.getFrozenLeftCount()?"frozen-left":"frozen-right":void 0;if(i&&(n=this.parent.contentModule.getVirtualFreezeHeader(),o=this.parent.contentModule.isXaxis()?"movable":o),n){t.remove(n),n.removeChild(n.firstChild),n.removeChild(n.childNodes[0]);var s=this.parent.createElement(ji),l=this.createHeaderContent(o);this.rows=l.rows,n.insertBefore(l.thead,n.firstChild),this.updateColGroup(s),n.insertBefore(this.setColGroup(s),n.firstChild),i||this.setTable(n),this.appendContent(n),this.parent.notify(qt,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),(!e||this.parent.enableColumnVirtualization&&e)&&this.initializeHeaderDrag();for(var a=[].slice.call(r.querySelectorAll("tr.e-columnheader")),h=0,d=a;h<d.length;h++){var c=d[h],p=[].slice.call(c.getElementsByClassName("e-grouptopleftcell"));p.length&&p[p.length-1].classList.add("e-lastgrouptopleftcell")}e||this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:e}}),this.parent.enableColumnVirtualization&&O(n,Ii)&&this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&J(a,!0)}},i.prototype.toggleStackClass=function(e){this.parent.columns.some(function(e){return!t.isNullOrUndefined(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},i.prototype.appendContent=function(e){this.getPanel().querySelector("."+Fi).appendChild(e)},i.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,r=e.columns.length;i<r;i++)t=this.getCellCnt(e.columns[i],t);else e.visible&&t++;return t},i.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new t.Draggable(e.getHeaderContent(),{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler",isReplaceDragEle:this.isReplaceDragEle}))},i.prototype.initializeHeaderDrop=function(){var e=this.parent;new t.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop})},i.prototype.renderCustomToolbar=function(){var e=this,t=this.parent;if("Vertical"===t.rowRenderingMode&&!t.toolbar&&(t.allowSorting||t.allowFiltering&&"FilterBar"!==t.filterSettings.type)){for(var i=t.createElement("div",{className:"e-res-toolbar e-toolbar"}),r=t.createElement("div",{className:"e-toolbar-items"}),o=t.createElement("div",{className:"e-toolbar-left"}),s=this.parent.allowFiltering&&this.parent.allowSorting?2:1,l=0;l<s;l++){var a=t.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),h=1===s?this.parent.allowSorting?"sort":"filter":1===l?"sort":"filter",d=t.createElement("button",{className:"e-tbar-btn e-control e-btn e-lib e-icon-btn"}),c=t.createElement("span",{className:"e-btn-icon e-res"+h+"-icon e-icons"});d.appendChild(c),new n.Button({}).appendTo(d),d.onclick=function(t){t.target.classList.contains("e-ressort-btn")||t.target.classList.contains("e-ressort-icon")?e.parent.showResponsiveCustomSort():e.parent.showResponsiveCustomFilter()},a.appendChild(d),o.appendChild(a)}r.appendChild(o),i.appendChild(r),t.element.insertBefore(i,this.parent.element.querySelector("."+Si))}else t.toolbar||t.getContent().classList.add("e-responsive-header")},i.prototype.updateCustomResponsiveToolbar=function(e){var i=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(i?t.remove(i):this.renderCustomToolbar())},i}(),$i=function(){function i(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:bi,attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox"}})}return i.prototype.getGui=function(){return""},i.prototype.format=function(e,i,r){return t.isNullOrUndefined(e.format)||("number"===e.type&&isNaN(parseInt(i,10))&&(i=null),i=this.formatter.toView(i,e.getFormatter())),t.isNullOrUndefined(i)?"":i.toString()},i.prototype.evaluate=function(e,i,r,n,o,s){var l,a;if(i.column.template){var h=this.parent.isReact&&"string"!=typeof i.column.template,d=["index"],c=me({},r,(l={},l.foreignKeyData=o,l.column=i.column,l)),p=this.parent.element.id+i.column.uid,u="isStringTemplate";if(h){var g={index:n[d[0]]};i.column.getColumnTemplate()(t.extend(g,c),this.parent,"columnTemplate",p,this.parent[u],null,e),this.parent.renderTemplates()}else a=i.column.getColumnTemplate()(t.extend({index:n[d[0]]},c),this.parent,"template",p,this.parent[u]);return h||q(e,a),this.parent.notify("template-result",{template:a}),a=null,e.setAttribute("aria-label",e.innerText+" is template cell column header "+i.column.headerText),!1}return!0},i.prototype.invokeFormatter=function(e,i,r){return t.isNullOrUndefined(e.formatter)||(i=u(e.formatter,"getValue")?(new(0,e.formatter)).getValue(e,r):"function"==typeof e.formatter?e.formatter(e,r):e.formatter.getValue(e,r)),i},i.prototype.render=function(e,t,i,r,n){return this.refreshCell(e,t,i,n)},i.prototype.refreshTD=function(e,i,r,n){var o="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){e.innerHTML="";var s=e.cellIndex,l=e.parentElement;t.remove(e);var a=this.refreshCell(i,r,n,o);this.cloneAttributes(a,e),l.cells.length!==s-1?l.insertBefore(a,l.cells[s]):l.appendChild(a)}else{var h=this.refreshCell(i,r,n,o);e.innerHTML="",e.setAttribute("aria-label",h.getAttribute("aria-label"));for(var d=0,c=[].slice.call(h.childNodes);d<c.length;d++){var p=c[d];e.appendChild(p)}}},i.prototype.cloneAttributes=function(e,t){for(var i,r=t.attributes,n=r.length;n--;)i=r[n],e.setAttribute(i.name,i.value)},i.prototype.refreshCell=function(e,i,r,o){var s,l,a=this.element.cloneNode(),h=e.column;e.isForeignKey&&(l=e.foreignKeyData[0]||(s={},s[h.foreignKeyValue]=h.format?null:"",s));var d=this.getGui(),c=e.isForeignKey?this.getValue(h.foreignKeyValue,l,h):this.getValue(h.field,i,h);if("date"!==h.type&&"datetime"!==h.type||t.isNullOrUndefined(c)||(c=new Date(c)),c=this.format(h,c,i),d=c.toString(),"boolean"===h.type&&!h.displayAsCheckBox){var p="true"!==c&&"false"!==c?null:"true"===c?"True":"False";d=p?this.localizer.getConstant(p):d}var u=this.invokeFormatter(h,c,i);if(d=t.isNullOrUndefined(h.formatter)?d:t.isNullOrUndefined(u)?"":u.toString(),a.setAttribute("aria-label",d+" column header "+e.column.headerText),this.evaluate(a,e,i,r,l,o)&&"checkbox"!==h.type?this.appendHtml(a,d,h.getDomSetter?h.getDomSetter():"innerHTML"):"checkbox"===h.type&&(a.classList.add(ki),a.setAttribute("aria-label","checkbox"),c=!!this.parent.selectionSettings.persistSelection&&"true"===c,(f=n.createCheckBox(this.parent.createElement,!1,{checked:c,label:" "})).insertBefore(this.rowChkBox.cloneNode(),f.firstChild),a.appendChild(f)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(a,e,r),"boolean"===h.type&&h.displayAsCheckBox){var g=isNaN(parseInt(c.toString(),10))?"true"===c:parseInt(c.toString(),10)>0,f=n.createCheckBox(this.parent.createElement,!1,{checked:g,label:" "});a.innerHTML="",f.classList.add("e-checkbox-disabled"),a.appendChild(f),a.setAttribute("aria-label",g+" column header "+e.column.headerText)}return a},i.prototype.appendHtml=function(e,t,i){return void 0===i&&(i="innerHTML"),e[i]=t,e},i.prototype.setAttributes=function(e,t,i){var r=t.column;this.buildAttributeFromCell(e,t,"checkbox"===r.type),F(e,i),F(e,t.attributes),r.customAttributes&&F(e,r.customAttributes),"Vertical"===this.parent.rowRenderingMode&&F(e,{"data-cell":r.headerText}),r.textAlign&&(e.style.textAlign=r.textAlign),"Clip"===r.clipMode||!r.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):("EllipsisWithTooltip"===r.clipMode||!r.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&"checkbox"!==r.type&&e.classList.add("e-ellipsistooltip")},i.prototype.buildAttributeFromCell=function(i,r,n){var o={},s={colindex:qi},l=[];r.colSpan&&(o.colSpan=r.colSpan),r.rowSpan&&(o.rowSpan=r.rowSpan),r.isTemplate&&l.push("e-templatecell"),r.isSelected&&(l.push.apply(l,["e-selectionbackground","e-active"]),n&&i.querySelector(".e-frame").classList.add("e-check")),r.isColumnSelected&&l.push.apply(l,["e-columnselection"]),r.cellType===e.CellType.Header?o[s.colindex]=r.colIndex:t.isNullOrUndefined(r.index)||(o[s.colindex]=r.index),r.visible||l.push("e-hide"),o.class=l,F(i,o)},i.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)},i}(),er=function(){function e(){}return e.prototype.setOptions=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++)c(e,tr[i[r]],t[i[r]])},e.prototype.setExpand=function(e,t){c(e,tr.expand,t)},e.prototype.setSort=function(e,t){c(e,tr.sort,t,"boolean"==typeof t)},e.prototype.setBusy=function(e,t){c(e,tr.busy,t),c(e,tr.invalid,null,!0)},e.prototype.setGrabbed=function(e,t,i){c(e,tr.grabbed,t,i)},e.prototype.setDropTarget=function(e,t){c(e,tr.dropeffect,"copy",!t)},e}(),tr={expand:"aria-expanded",role:"role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount",rowcount:"aria-rowcount"},ir=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rr=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell",attrs:{role:"columnheader",tabindex:"-1"}}),t.ariaService=new er,t.hTxtEle=t.parent.createElement("span",{className:"e-headertext"}),t.sortEle=t.parent.createElement("div",{className:"e-sortfilterdiv e-icons"}),t.gui=t.parent.createElement("div"),t.chkAllBox=t.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox"}}),t}return ir(i,e),i.prototype.getGui=function(){return this.gui.cloneNode()},i.prototype.render=function(e,t,i){var r=this.element.cloneNode(),n=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,r,n)},i.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter"});return this.prepareHeader(e,t,i)},i.prototype.clean=function(e){e.innerHTML=""},i.prototype.prepareHeader=function(e,i,r){var o,s=e.column,l={},a=this.getGui();if(t.attributes(a,{"e-mappinguid":s.uid,class:"e-headercelldiv"}),t.isNullOrUndefined(s.headerValueAccessor)||(o=this.getValue(s.headerText,s)),"checkbox"!==s.type){var h=s.headerText;t.isNullOrUndefined(o)||(h=o);var d=this.hTxtEle.cloneNode();d[s.getDomSetter()]=h,a.appendChild(d)}else{s.editType="booleanedit";var c=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "});c.insertBefore(this.chkAllBox.cloneNode(),c.firstChild),a.appendChild(c),a.classList.add("e-headerchkcelldiv")}if(this.buildAttributeFromCell(i,e),this.appendHtml(i,a),i.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&s.allowFiltering&&!t.isNullOrUndefined(s.field)&&(!this.parent.showColumnMenu||!s.showColumnMenu)){t.attributes(r,{"e-mappinguid":"e-flmenu-"+s.uid}),i.classList.add("e-fltr-icon");var p=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==p.length)for(var u=this.parent.getForeignKeyColumns(),g=0;g<this.parent.columns.length;g++)for(var f=0;f<this.parent.filterSettings.columns.length;f++)if(this.parent.filterSettings.columns[f].field===s.field||u.length&&s.foreignKeyValue===this.parent.filterSettings.columns[f].field){r.classList.add("e-filtered"),p.push(s.field);break}i.appendChild(r.cloneNode())}e.className&&i.classList.add(e.className),s.customAttributes&&F(i,s.customAttributes),s.allowSorting&&(l.sort="none"),s.allowGrouping&&(l.grabbed=!1),i=this.extendPrepareHeader(s,i);var m,y=this.parent,v=y.getColumnIndexByField(s.field);if(!t.isNullOrUndefined(s.headerTemplate)){var C=y.element.id+s.uid+"headerTemplate",w="isStringTemplate",b=s;if(this.parent.isReact&&"string"!=typeof s.headerTemplate){var S={index:v};i.firstElementChild.innerHTML="",s.getHeaderTemplate()(t.extend(S,b),y,"headerTemplate",C,this.parent[w],null,i.firstElementChild),this.parent.renderTemplates()}else m=s.getHeaderTemplate()(t.extend({index:v},b),y,"headerTemplate",C,this.parent[w]),i.firstElementChild.innerHTML="",q(i.firstElementChild,m)}if(this.ariaService.setOptions(i,l),!t.isNullOrUndefined(s.headerTextAlign)||!t.isNullOrUndefined(s.textAlign)){var R=s.headerTextAlign||s.textAlign;a.style.textAlign=R,"Right"===R||"Left"===R?i.classList.add("Right"===R?"e-rightalign":"e-leftalign"):"Center"===R&&i.classList.add("e-centeralign")}return"Clip"===s.clipMode||!s.clipMode&&"Clip"===this.parent.clipMode?i.classList.add("e-gridclip"):("EllipsisWithTooltip"===s.clipMode||!s.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&"checkbox"!==s.type&&i.classList.add("e-ellipsistooltip"),i.setAttribute("aria-rowspan",(t.isNullOrUndefined(e.rowSpan)?1:e.rowSpan).toString()),i.setAttribute("aria-colspan","1"),this.parent.trigger("headerCellInfo",{cell:e,node:i}),i},i.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},i.prototype.extendPrepareHeader=function(e,i){if(this.parent.showColumnMenu&&e.showColumnMenu&&!t.isNullOrUndefined(e.field)){var r=this.parent.createElement("div",{className:"e-icons e-columnmenu"}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var o=0;o<this.parent.columns.length;o++)for(var s=0;s<this.parent.filterSettings.columns.length;s++)if(this.parent.filterSettings.columns[s].field===e.field){r.classList.add("e-filtered"),n.push(e.field);break}i.classList.add("e-fltr-icon"),i.appendChild(r)}if(this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",i.appendChild(l)}return i},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i}($i),nr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),or=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{role:"columnheader",tabindex:"-1"}}),t}return nr(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode(),o=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"e-mappinguid":e.column.uid}}),s=e.column;if(n.appendChild(o),t.isNullOrUndefined(s.headerTemplate)?this.appendHtml(o,s.headerText,s.getDomSetter()):q(o,s.getHeaderTemplate()(s,this.parent,"headerTemplate")),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===s.clipMode||!s.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):("EllipsisWithTooltip"===s.clipMode||!s.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&n.classList.add("e-ellipsistooltip"),t.isNullOrUndefined(e.column.textAlign)||(o.style.textAlign=e.column.textAlign),e.column.customAttributes&&F(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing){var l=this.parent.createElement("div");l.className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(l)}return this.parent.trigger("headerCellInfo",{cell:e,node:n}),n},i}($i),sr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-indentcell"}),t}return sr(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return F(i,e.attributes),i},t}($i),ar=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hr=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:t.parent.element.id+"captioncell",role:"gridcell",tabindex:"-1"}}),t}return ar(i,e),i.prototype.render=function(e,i){var r,n,o=this.element.cloneNode(),s=this.parent;i.headerText=e.column.headerText,e.isForeignKey&&(n=this.format(e.column,e.column.valueAccessor("foreignKey",i,e.column)));var l=e.isForeignKey?n:e.column.enableGroupByFormat?i.key:this.format(e.column,e.column.valueAccessor("key",i,e.column));if(t.isNullOrUndefined(s.groupSettings.captionTemplate))s.groupSettings.enableLazyLoading?o.innerHTML=e.column.headerText+": "+l:o.innerHTML=e.column.headerText+": "+l+" - "+i.count+" "+(i.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"));else{var a=this.parent.isReact&&"string"!=typeof s.groupSettings.captionTemplate;if(a){var h=s.element.id+"captionTemplate";x(s.groupSettings.captionTemplate)(i,this.parent,"captionTemplate",h,null,null,o),this.parent.renderTemplates()}else r=this.parent.isVue?x(s.groupSettings.captionTemplate)(i,this.parent):x(s.groupSettings.captionTemplate)(i);a||q(o,r)}return o.setAttribute("colspan",e.colSpan.toString()),o.setAttribute("aria-label",o.innerHTML+" is groupcaption cell"),o.setAttribute("title",o.innerHTML),o},i}($i),dr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption"}),t}return ar(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML=" ",i.setAttribute("colspan",e.colSpan.toString()),i},t}($i),cr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return cr(t,e),t.prototype.render=function(e,t,i,r){var n=this.element.cloneNode();return n.className=r?"e-recordplusexpand":"e-recordpluscollapse",n.setAttribute("ej-mappingname",t.field),n.setAttribute("ej-mappingvalue",t.key),n.setAttribute("aria-expanded",r?"true":"false"),n.setAttribute("tabindex","-1"),n.appendChild(this.parent.createElement("div",{className:r?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"})),n},t}(lr),ur=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-grouptopleftcell"}),t}return ur(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),i},t}($i),fr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-detailheadercell"}),t}return fr(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),i},t}($i),yr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vr=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",role:"gridcell",tabindex:"-1"}}),t}return yr(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode();return r&&!t.isNullOrUndefined(r.class)?(n.className="",n.className=r.class,n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow"}))):n.appendChild(this.parent.createElement("div",{className:"e-icons e-dtdiagonalright e-icon-grightarrow"})),n},i}($i),Cr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-rowdragdrop",attrs:{role:"gridcell",tabindex:"-1"}}),t}return Cr(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon"})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),i},t}($i),br=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sr=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-rowdragheader"}),t}return br(i,e),i.prototype.render=function(e,i){var r=this.element.cloneNode();return r.appendChild(t.createElement("div",{className:"e-emptycell"})),r},i}($i),Rr=function(){function r(e,t){this.emptyGrid=!1,this.counter=0,this.parent=e,this.locator=t,this.data=new yi(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}return r.prototype.render=function(){var t=this.parent;this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),t.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},r.prototype.refresh=function(e){var t=this;void 0===e&&(e={requestType:"refresh"});var i=this.parent;i.notify(e.requestType+"-begin",e),i.trigger(bt,e,function(e){if(void 0===e&&(e={requestType:"refresh"}),e.cancel)return void i.notify("cancel-Begin",e);if("delete"===e.requestType&&i.allowPaging){var r=e.data.length,n=i.pageSettings.totalRecordsCount-r;i.getCurrentViewRecords().length-r||!n||(i.pageSettings.currentPage-1)*i.pageSettings.pageSize!==n||(i.prevPageMoving=!0,i.setProperties({pageSettings:{totalRecordsCount:n,currentPage:Math.ceil(n/i.pageSettings.pageSize)}},!0),i.pagerModule.pagerObj.totalRecordsCount=n)}"reorder"===e.requestType&&t.parent.dataSource&&"result"in t.parent.dataSource?t.contentRenderer.refreshContentRows(e):("paging"===e.requestType||"columnstate"===e.requestType||"reorder"===e.requestType)&&t.parent.groupSettings.enableLazyLoading&&t.parent.groupSettings.columns.length&&t.parent.contentModule.getGroupCache()[t.parent.pageSettings.currentPage]?t.contentRenderer.refreshContentRows(e):t.refreshDataManager(e)})},r.prototype.resetTemplates=function(){var e=this.parent,i=e.getColumns();if(e.detailTemplate){var r=e.element.id+"detailTemplate";t.blazorTemplates[r]=[],t.resetBlazorTemplate(r,"DetailTemplate")}e.groupSettings.captionTemplate&&t.resetBlazorTemplate(e.element.id+"captionTemplate","CaptionTemplate"),e.rowTemplate&&t.resetBlazorTemplate(e.element.id+"rowTemplate","RowTemplate"),e.toolbarTemplate&&t.resetBlazorTemplate(e.element.id+"toolbarTemplate","ToolbarTemplate"),e.pageSettings.template&&t.resetBlazorTemplate(e.element.id+"_template","pageSettings");for(var n=0;n<i.length;n++)i[n].template&&(t.blazorTemplates[e.element.id+i[n].uid]=[],t.resetBlazorTemplate(e.element.id+i[n].uid,"Template")),i[n].headerTemplate&&t.resetBlazorTemplate(e.element.id+i[n].uid+"headerTemplate","HeaderTemplate"),i[n].filterTemplate&&t.resetBlazorTemplate(e.element.id+i[n].uid+"filterTemplate","FilterTemplate");for(var o=0;o<e.aggregates.length;o++)for(var s=0;s<e.aggregates[o].columns.length;s++){if(e.aggregates[o].columns[s].footerTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"footerTemplate";t.resetBlazorTemplate(l,"FooterTemplate")}if(e.aggregates[o].columns[s].groupFooterTemplate){l=e.element.id+e.aggregates[o].columns[s].guid+"groupFooterTemplate";t.resetBlazorTemplate(l,"GroupFooterTemplate")}if(e.aggregates[o].columns[s].groupCaptionTemplate){var l=e.element.id+e.aggregates[o].columns[s].guid+"groupCaptionTemplate";t.resetBlazorTemplate(l,"GroupCaptionTemplate")}}},r.prototype.refreshComplete=function(e){this.parent.trigger(St,e)},r.prototype.refreshDataManager=function(e){var t=this;void 0===e&&(e={}),"virtualscroll"!==e.requestType&&this.parent.showSpinner(),this.parent.notify("reset-infinite-blocks",e),this.emptyGrid=!1;var r,n=this.isNeedForeignAction();if(this.ariaService.setBusy(this.parent.getContent().querySelector("."+Di),!0),n){var o=new i.Deferred;r=this.getFData(o,e)}if(r=r?r.then(function(r){var n=t.data.generateQuery().requiresCount();if(t.emptyGrid){var o=new i.Deferred;return o.resolve({result:[],count:0}),o.promise}return t.data.getData(e,n)}):this.data.getData(e,this.data.generateQuery().requiresCount()),this.parent.getForeignKeyColumns().length&&(!n||this.parent.searchSettings.key.length)){var s=new i.Deferred;r=r.then(function(i){return t.parent.notify("getForeignKeyData",{dataManager:r,result:i,promise:s,action:e}),s.promise})}this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&(r=r.then(function(e){return t.validateGroupRecords(e)})),r.then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(i){return t.dataManagerFailure(i,e)})},r.prototype.getFData=function(e,t){return this.parent.notify("getForeignKeyData",{isComplex:!0,promise:e,action:t}),e.promise},r.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},r.prototype.foreignKey=function(e){var t=this;return e.some(function(e){return!(!t.parent.filterSettings.columns.some(function(t){return e.uid===t.uid})&&!t.parent.searchSettings.key.length)})},r.prototype.sendBulkRequest=function(e){var t=this;e.requestType="batchsave";var i=this.data.saveChanges(e.changes,this.parent.getPrimaryKeyFieldNames()[0],e.original),r=this.data.generateQuery().requiresCount();if(this.data.dataManager.dataSource.offline)return void this.refreshDataManager({requestType:"batchsave"});i.then(function(i){t.data.getData(e,r).then(function(i){return t.dmSuccess(i,e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})},r.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},r.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},r.prototype.renderEmptyRow=function(){this.emptyRow(!0)},r.prototype.emptyRow=function(e){var i=this.parent,r=this.contentRenderer.getTable().querySelector(Ui);t.isNullOrUndefined(r)||t.remove(r),r=this.parent.createElement(Ui);var n=0;(i.detailTemplate||i.childGrid)&&++n;var o=this.parent.createElement("tr",{className:"e-emptyrow"});o.appendChild(this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(i.getVisibleColumns().length+n).toString()}})),r.appendChild(o),this.contentRenderer.renderEmpty(r),e&&(this.parent.trigger(Rt,{}),this.parent.notify(Pt,{rows:[new vi({isDataRow:!0,cells:[new Ci({isDataCell:!0,visible:!0})]})]}))},r.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},r.prototype.updateColumnType=function(e){for(var i,r=this.parent.getColumns(),n=e&&e.items?e.items[0]:e,o=this.locator.getService("valueFormatter"),s=0,l=r.length;s<l;s++){i=pe(r[s].field||"",n),t.isNullOrUndefined(r[s].customFormat)||(r[s].format=r[s].customFormat),t.isNullOrUndefined(r[s].validationRules)||t.isNullOrUndefined(r[s].validationRules.equalTo)||(r[s].validationRules.equalTo[0]=this.parent.element.id+r[s].validationRules.equalTo[0]),r[s].isForeignColumn()&&r[s].columnData&&(i=pe(r[s].foreignKeyValue||"",r[s].columnData[0])),t.isNullOrUndefined(i)?r[s].type=r[s].type||null:(this.isColTypeDef=!0,r[s].type||(r[s].type=i.getDay?i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0||i.getMilliseconds()>0?"datetime":"date":typeof i));var a=new yt;if(r[s].format&&(r[s].format.skeleton||r[s].format.format)&&(r[s].setFormatter(a.getFormatFunction(t.extend({},r[s].format))),r[s].setParser(a.getParserFunction(r[s].format))),"string"==typeof r[s].format){var h=this.parent.isServerRendered||this.parent.printModule.isPrintGrid();Y(this.locator,r[s],h)}else r[s].format||"number"!==r[s].type||r[s].setParser(o.getParserFunction({format:"n2"}))}},r.prototype.dataManagerSuccess=function(i,r){var n=this,o=this.parent;this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),i.actionArgs=r;var s=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&("delete"===r.requestType||"save"===r.requestType&&"add"===this.parent.infiniteScrollModule.requestType);o.trigger("beforeDataBound",i,function(e){if(!e.cancel){e.result=t.isNullOrUndefined(e.result)?[]:e.result;var l=Object.keys(e.result).length;if(!n.parent.isDestroyed){if(!(o.getColumns().length||l||o.columns.length&&o.columns[0]instanceof Ct))return void o.hideSpinner();if(n.isInfiniteEnd(r)&&!l)return void n.parent.notify("infinite-edit-handler",{e:r,result:i.result,count:i.count,agg:i.aggregates});if(n.parent.isEdit=!1,n.parent.notify("edit-reset",{}),n.parent.notify("tooltip-destroy",{}),n.contentRenderer.prevCurrentView=n.parent.currentViewData.slice(),o.currentViewData=e.result,o.notify("refresh-infinite-current-view-data",{args:r,data:e.result}),!l&&e.count&&o.allowPaging&&r&&"delete"!==r.requestType)return!n.parent.groupSettings.enableLazyLoading||"grouping"!==r.requestType&&"ungrouping"!==r.requestType||n.parent.notify("grouping-complete",r),o.prevPageMoving=!0,o.pageSettings.totalRecordsCount=e.count,"paging"!==r.requestType&&(o.pageSettings.currentPage=Math.ceil(e.count/o.pageSettings.pageSize)),void o.dataBind();if((o.getColumns().length||!l)&&n.isLayoutRendered||ce(o)||n.updatesOnInitialRender(e),!n.isColTypeDef&&o.getCurrentViewRecords()&&(n.data.dataManager.dataSource.offline&&o.dataSource&&o.dataSource.length?n.updateColumnType(o.dataSource[0]):n.updateColumnType(o.getCurrentViewRecords()[0])),n.parent.isInitialLoad||!n.parent.groupSettings.disablePageWiseAggregates||n.parent.groupSettings.columns.length||(e.result=n.parent.dataSource instanceof Array?n.parent.dataSource:n.parent.currentViewData),n.parent.notify(kt,t.extend({count:e.count,result:e.result,aggregates:e.aggregates},r)),(o.groupSettings.columns.length||r&&"ungrouping"===r.requestType)&&r&&"filtering"!==r.requestType&&n.headerRenderer.refreshUI(),l){if(ce(o)){r.scrollTop={top:n.contentRenderer.content.scrollTop}}s?n.parent.notify("infinite-edit-handler",{e:r,result:i.result,count:i.count,agg:i.aggregates}):n.parent.enableImmutableMode?n.contentRenderer.immutableModeRendering(r):n.contentRenderer.refreshContentRows(r)}else{if(!o.getColumns().length)return o.element.innerHTML="",void alert(n.l10n.getConstant("EmptyDataSourceError"));if(n.contentRenderer.setRowElements([]),n.contentRenderer.setRowObjects([]),n.ariaService.setBusy(n.parent.getContent().querySelector("."+Di),!1),n.renderEmptyRow(),r){var a=(r.requestType||"").toLowerCase()+"-complete";n.parent.notify(a,r),"batchsave"===r.requestType&&(r.cancel=!1,r.rows=[],r.isFrozen=0!==n.parent.getFrozenColumns()&&!r.isFrozen,n.parent.trigger(St,r))}n.parent.hideSpinner()}n.parent.notify("toolbar-refresh",{}),n.setRowCount(n.parent.getCurrentViewRecords().length),n.parent.getDataModule().isQueryInvokedFromData=!1}}})},r.prototype.dataManagerFailure=function(e,t){this.ariaService.setOptions(this.parent.getContent().querySelector("."+Di),{busy:!1,invalid:!0}),this.setRowCount(1),this.parent.trigger("actionFailure",{error:e}),this.parent.hideSpinner(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),this.parent.log("actionfailure",{error:e}))},r.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.getHeaderTable(),{rowcount:e?e.toString():"1"})},r.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},r.prototype.updatesOnInitialRender=function(e){this.isLayoutRendered=!0,this.parent.columns.length<1&&this.buildColumns(e.result[0]),T(this.parent.columns,null,this.parent),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(ei,{})},r.prototype.iterateComplexColumns=function(e,t,i){for(var r=Object.keys(e),n=0;n<r.length;n++)("object"!=typeof e[r[n]]||!e[r[n]]||e[r[n]]instanceof Date?[]:Object.keys(e[r[n]])).length?this.iterateComplexColumns(e[r[n]],t+(r[n]+"."),i):(i[this.counter]=t+r[n],this.counter++)},r.prototype.buildColumns=function(e){var i=[],r={};this.iterateComplexColumns(e,"",r);for(var n=Object.keys(r).filter(function(e){return"BlazId"!==r[e]}).map(function(e){return r[e]}),o=0,s=n.length;o<s;o++)i[o]={field:n[o]},this.parent.enableColumnVirtualization&&(i[o].width=t.isNullOrUndefined(i[o].width)?200:i[o].width);this.parent.setProperties({columns:i},!0)},r.prototype.instantiateRenderer=function(){this.renderer.addRenderer(e.RenderType.Header,new Zi(this.parent,this.locator)),this.renderer.addRenderer(e.RenderType.Content,new Yi(this.parent,this.locator));var t=this.locator.getService("cellRendererFactory");t.addCellRenderer(e.CellType.Header,new rr(this.parent,this.locator)),t.addCellRenderer(e.CellType.Data,new $i(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new or(this.parent,this.locator)),t.addCellRenderer(e.CellType.Indent,new lr(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaption,new hr(this.parent,this.locator)),t.addCellRenderer(e.CellType.GroupCaptionEmpty,new dr(this.parent,this.locator)),t.addCellRenderer(e.CellType.Expand,new pr(this.parent,this.locator)),t.addCellRenderer(e.CellType.HeaderIndent,new gr(this.parent,this.locator)),t.addCellRenderer(e.CellType.StackedHeader,new or(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailHeader,new mr(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragHIcon,new Sr(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailExpand,new vr(this.parent,this.locator)),t.addCellRenderer(e.CellType.DetailFooterIntent,new lr(this.parent,this.locator)),t.addCellRenderer(e.CellType.RowDragIcon,new wr(this.parent,this.locator))},r.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(Mt,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(Lt,this.refresh,this),this.parent.on("refresh-complete",this.refreshComplete,this),this.parent.on("bulk-save",this.sendBulkRequest,this),this.parent.on("showEmptyGrid",function(){e.emptyGrid=!0},this),this.parent.on(ei,this.dynamicColumnChange,this))},r.prototype.validateGroupRecords=function(e){var t=this,r=e.result.length-1;if(r<0)return Promise.resolve(e);var n=e.result[0],o=e.result[r],s=[],l=function(e){for(var r=[n,o],l=0;l<r.length;l++)s.push(new i.Predicate("field","==",r[l].field).and(t.getPredicate("key","equal",r[l].key)));e.where(i.Predicate.or(s))},a=new i.Query;l(a);var h=new i.DataManager(e.result).executeLocal(a),d=this.data.generateQuery(!0),c=[];if(this.data.isRemote()){for(var p=[n,o],u=0;u<p.length;u++)c.push(this.getPredicate(p[u].field,"equal",p[u].key));d.where(i.Predicate.or(c))}else l(d);var g=new i.Deferred;return this.data.getData({},d).then(function(i){t.updateGroupInfo(h,i.result),g.resolve(e)}).catch(function(e){return g.reject(e)}),g.promise},r.prototype.getPredicate=function(e,t,r){return r instanceof Date?he({field:e,operator:t,value:r}):new i.Predicate(e,t,r)},r.prototype.updateGroupInfo=function(e,t){for(var r=new i.DataManager(t),n=e,o=0;o<n.length;o++){var s=r.executeLocal((new i.Query).where(new i.Predicate("field","==",n[o].field).and(this.getPredicate("key","equal",n[o].key))))[0];n[o].count=s.count;var l=n[o].items,a=s.items;l.GroupGuid&&(n[o].items=this.updateGroupInfo(n[o].items,s.items));for(var h=this.parent.aggregates,d=0;d<h.length;d++)for(var c=h[d],p=0;p<c.columns.length;p++)for(var u=c.columns[p].type instanceof Array?c.columns[p].type:[c.columns[p].type],g=0;g<u.length;g++){var f=c.columns[p].field+" - "+u[g].toLowerCase(),m=l.level?a.records:s.items,y=this.parent;if("Custom"===u[g]){var v=l.level?a:s;n[o].aggregates[f]=c.columns[p].customAggregate?c.columns[p].customAggregate.call(y,v,c.columns[p]):""}else n[o].aggregates[f]=i.DataUtil.aggregates[u[g].toLowerCase()](m,c.columns[p].field)}}return e},r}(),xr=function(){function i(){this.cellRenderMap={}}return i.prototype.addCellRenderer=function(i,r){i="string"==typeof i?i:t.getEnumValue(e.CellType,i),t.isNullOrUndefined(this.cellRenderMap[i])&&(this.cellRenderMap[i]=r)},i.prototype.getCellRenderer=function(i){if(i="string"==typeof i?i:t.getEnumValue(e.CellType,i),t.isNullOrUndefined(this.cellRenderMap[i]))throw"The cellRenderer "+i+" is not found";return this.cellRenderMap[i]},i}(),Fr=function(){function i(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}return i.prototype.addEventListener=function(){this.evtHandlers=[{event:"filter-dialog-close",handler:this.closeCustomDialog},{event:"refresh-cutsom-filter-ok-button",handler:this.refreshCustomFilterOkBtn},{event:"render-responsive-cmenu",handler:this.renderResponsiveContextMenu},{event:"filter-cmenu-select",handler:this.renderCustomFilterDiv},{event:"custom-filter-close",handler:this.customExFilterClose},{event:"refresh-cutsom-filter-clear-button",handler:this.refreshCustomFilterClearBtn}],Xe(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(St,this.onActionCompleteFn)},i.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},i.prototype.renderCustomFilterDiv=function(){var e=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),t=e.querySelector(".e-dlg-custom-header"),i=e.querySelector(".e-dlg-closeicon-btn");this.isCustomDlgRender=!0,this.parent.filterModule.filterModule.closeDialog(),this.saveBtn.element.style.display="",this.refreshCustomFilterOkBtn({disabled:!1}),this.backBtn.element.style.display="none",i.style.display="",t.innerHTML=this.parent.localeObj.getConstant("CustomFilter");var r=this.customResponsiveDlg.element.querySelector(".e-dlg-content");this.customExcelFilterParent=this.parent.createElement("div",{className:"e-xl-customfilterdiv e-default-filter"}),r.appendChild(this.customExcelFilterParent)},i.prototype.renderResponsiveContextMenu=function(i){if(this.action===e.ResponsiveDialogAction.isFilter){var r=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),o=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),s=o.querySelector(".e-dlg-closeicon-btn"),l=o.querySelector(".e-dlg-custom-header");if(i.isOpen){r.firstChild.style.display="none",r.appendChild(i.target),s.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",l.innerHTML=i.header;var a=this.parent.createElement("button"),h=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"});a.appendChild(h),this.backBtn=new n.Button({cssClass:"e-res-back-btn"}),this.backBtn.appendTo(a),l.parentElement.insertBefore(a,l)}else this.backBtn&&!this.isCustomDlgRender&&(r.firstChild.style.display="",t.remove(this.backBtn.element),s.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),l.innerHTML=this.getHeaderTitle({action:e.ResponsiveDialogAction.isFilter},i.col))}},i.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},i.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled)},i.prototype.renderResponsiveContent=function(i){var r=this,o=this.parent;if(i)return this.filterParent=this.parent.createElement("div",{className:"e-mainfilterdiv e-default-filter",id:i.uid+"-main-filter"}),this.filterParent;var s=o.getColumns();this.customColumnDiv=o.createElement("div",{className:"columndiv",styles:"width: 100%"});var l=o.createElement("div",{className:"e-ressortbutton-parent"}),a=[],h=this.action===e.ResponsiveDialogAction.isSort,d=this.action===e.ResponsiveDialogAction.isFilter;if(d)for(c=0;c<o.filterSettings.columns.length;c++)a.push(o.filterSettings.columns[c].field);for(var c=0;c<s.length;c++)if(!(!s[c].visible||!s[c].allowSorting&&h||!s[c].allowFiltering&&d)){var p=o.createElement("div",{className:"e-responsivecoldiv"});p.setAttribute("data-e-mappingname",s[c].field),p.setAttribute("data-e-mappinguid",s[c].uid);var u=o.createElement("span",{innerHTML:s[c].headerText,className:"e-res-header-text"});if(p.appendChild(u),this.customColumnDiv.appendChild(p),h){var g=this.getSortedFieldsAndDirections("field").indexOf(s[c].field),f=o.createElement("button",{id:o.element.id+s[c].field+"sortbutton"}),m=l.cloneNode();m.appendChild(f),p.appendChild(m),new n.Button({cssClass:"e-ressortbutton"}).appendTo(f),f.innerHTML=g>-1?this.parent.sortSettings.columns[g].direction:"None",f.onclick=function(e){r.sortButtonClickHandler(e.target)}}if(d&&a.indexOf(s[c].field)>-1){var y=o.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),v=o.createElement("span",{className:"e-icons e-res-icon e-filterset"});v.setAttribute("colType",s[c].type),y.appendChild(v),p.appendChild(y)}}return t.EventHandler.add(this.customColumnDiv,"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},i.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[i][e]);return t},i.prototype.sortButtonClickHandler=function(e){if(e){var t=O(e,"e-responsivecoldiv").getAttribute("data-e-mappingname");this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e));var i=e.textContent,r="None"===i?"Ascending":"Ascending"===i?"Descending":"None";e.innerHTML=r,this.setSortedCols(t,r)}},i.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.getElementsByClassName("e-ressortbutton")),i=0;i<t.length;i++)t[i]!==e&&(t[i].innerHTML="None")},i.prototype.setSortedCols=function(e,t){var i=this.getCurrentSortedFields().indexOf(e);this.parent.allowMultiSorting&&i>-1&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},i.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[t]);return e},i.prototype.customFilterColumnClickHandler=function(t){if(this.action===e.ResponsiveDialogAction.isFilter){var i=this.parent,r=t.target;if("FilterBar"!==i.filterSettings.type)if(r.classList.contains("e-responsivecoldiv")||r.parentElement.classList.contains("e-responsivecoldiv")){if((s=r.getAttribute("data-e-mappingname"))||(s=r.parentElement.getAttribute("data-e-mappingname")),s){var n=i.getColumnByField(s);this.isRowResponsive=!0,this.showResponsiveDialog(n)}}else if(r.classList.contains("e-filterset")||r.parentElement.classList.contains("e-filtersetdiv")){var o=O(r,"e-responsivecoldiv");if(o){var s=o.getAttribute("data-e-mappingname");("Menu"===(n=i.getColumnByField(s)).filter.type||!n.filter.type&&"Menu"===i.filterSettings.type)&&(this.isDialogClose=!0),this.parent.filterModule.filterModule.clearCustomFilter(n),this.removeCustomDlgFilterEle(r)}}}},i.prototype.showResponsiveDialog=function(t){if(this.isCustomDialog&&this.action===e.ResponsiveDialogAction.isFilter&&!this.isRowResponsive)this.renderCustomFilterDialog();else{if(this.filteredCol=t,this.renderResponsiveDialog(t),this.parent.enableAdaptiveUI&&t&&(this.parent.filterModule.setFilterModel(t),this.parent.filterModule.filterModule.openDialog(this.parent.filterModule.createOptions(t,void 0))),this.action===e.ResponsiveDialogAction.isSort){var i={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger("beforeOpenAdaptiveDialog",i),i.cancel)return}this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element)}},i.prototype.setTopToChildDialog=function(e){var t=e.querySelector(".e-dialog");if(t){var i=e.querySelector(".e-dlg-header-content").getBoundingClientRect().height;t.style.top=i+"px"}},i.prototype.renderCustomFilterDialog=function(t){var i=this.parent;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==i.filterSettings.type){var r=this.parent.createElement("div",{id:i.element.id+"customfilter",className:"e-customfilterdiv e-responsive-dialog"});this.parent.element.appendChild(r),this.customFilterDlg=this.getDialogOptions(t,!0);var n={cancel:!1,dialogObj:this.customFilterDlg,requestType:"beforeOpenAptiveFilterDialog"};this.parent.trigger("beforeOpenAdaptiveDialog",n),n.cancel||(this.customFilterDlg.appendTo(r),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")}},i.prototype.getDialogOptions=function(t,i,n){var o=new r.Dialog({isModal:!0,showCloseIcon:!0,closeOnEscape:!1,locale:this.parent.locale,target:this.parent.adaptiveDlgTarget?this.parent.adaptiveDlgTarget:document.body,visible:!1,enableRtl:this.parent.enableRtl,content:this.renderResponsiveContent(t),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"}});return o.isStringTemplate=!0,i?(o.header=this.renderResponsiveHeader(t,void 0,!0),o.cssClass="e-customfilter"):(o.header=this.renderResponsiveHeader(t),o.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===e.ResponsiveDialogAction.isFilter?"e-res"+n+" e-row-responsive-filter":"e-res"+n),o},i.prototype.renderResponsiveDialog=function(t){var i=this.parent;if(this.action!==e.ResponsiveDialogAction.isFilter||"FilterBar"!==i.filterSettings.type){var r=this.action===e.ResponsiveDialogAction.isFilter?"filter":"sort",n=this.parent.createElement("div",{id:i.element.id+"responsive"+r,className:"e-res"+r+"div e-responsive-dialog"});this.parent.element.appendChild(n),this.customResponsiveDlg=this.getDialogOptions(t,!1,r),this.customResponsiveDlg.appendTo(n)}},i.prototype.dialogCreated=function(){We(this.parent)},i.prototype.dialogOpen=function(){if(this.action===e.ResponsiveDialogAction.isSort&&this.parent.allowMultiSorting)for(var t=0;t<this.parent.sortSettings.columns.length;t++){this.sortedCols.push(this.parent.sortSettings.columns[t].field);var i=this.parent.sortSettings.columns[t].field,r=this.parent.sortSettings.columns[t].direction;this.sortPredicate.push({field:i,direction:r})}},i.prototype.beforeDialogClose=function(t){this.isDialogClose=t.element&&!t.element.querySelector(".e-xl-customfilterdiv")&&t.element.classList.contains("e-resfilterdiv"),this.action===e.ResponsiveDialogAction.isFilter?t.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):t.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter():this.action===e.ResponsiveDialogAction.isSort&&this.closeCustomDialog(),this.parent.off("enter-key-handler",this.keyHandler)},i.prototype.sortColumn=function(){if(!this.isSortApplied)return void this.closeCustomDialog();this.sortPredicate.length&&this.parent.setProperties({sortSettings:{columns:[]}},!0);for(var e=0;e<this.sortPredicate.length;e++)this.parent.sortColumn(this.sortPredicate[e].field,this.sortPredicate[e].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting(),this.closeCustomDialog()},i.prototype.getHeaderTitle=function(t,i){var r,n=this.parent;return this.action===e.ResponsiveDialogAction.isEdit?r=n.localeObj.getConstant("EditFormTitle")+t.primaryKeyValue[0]:this.action===e.ResponsiveDialogAction.isAdd?r=n.localeObj.getConstant("AddFormTitle"):this.action===e.ResponsiveDialogAction.isFilter?r=i?i.headerText||i.field:n.localeObj.getConstant("FilterButton"):this.action===e.ResponsiveDialogAction.isSort&&(r=n.localeObj.getConstant("Sort")),r},i.prototype.getDialogName=function(t){var i;return t===e.ResponsiveDialogAction.isAdd||t===e.ResponsiveDialogAction.isEdit?i="dialogEdit_wrapper_title":t===e.ResponsiveDialogAction.isFilter&&(i="responsive_filter_dialog_wrapper"),i},i.prototype.getButtonText=function(t){var i;return t===e.ResponsiveDialogAction.isAdd||t===e.ResponsiveDialogAction.isEdit?i="Save":t!==e.ResponsiveDialogAction.isFilter&&this.action!==e.ResponsiveDialogAction.isSort||(i="OKButton"),i},i.prototype.renderResponsiveHeader=function(t,i,r){var o=this,s=this.parent;s.on("enter-key-handler",this.keyHandler,this);var l=s.element.id+this.getDialogName(this.action),a=s.createElement("div",{className:"e-res-custom-element"}),h=s.createElement("div",{className:"e-dlg-custom-header",id:l});h.innerHTML=this.getHeaderTitle(i,t),a.appendChild(h);var d=s.createElement("button");r||(this.saveBtn=new n.Button({cssClass:"e-primary e-flat e-res-apply-btn"}),d.innerHTML=s.localeObj.getConstant(this.getButtonText(this.action)),this.saveBtn.appendTo(d),d.onclick=function(e){o.dialogHdrBtnClickHandler()});var c=this.action===e.ResponsiveDialogAction.isSort,p=this.action===e.ResponsiveDialogAction.isFilter;if(p||c){var u=c?"sort":"filter",g=s.createElement("button");if(this.filterClearBtn=new n.Button({cssClass:"e-primary e-flat e-res-"+u+"-clear-btn"}),p){var f=s.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"});g.appendChild(f)}else g.innerHTML=s.localeObj.getConstant("Clear");a.appendChild(g),this.filterClearBtn.appendTo(g),g.onclick=function(e){O(e.target,"e-customfilter")?(o.parent.filterModule.clearFiltering(),o.removeCustomDlgFilterEle()):p?o.filterClear():(o.resetSortButtons(),o.sortedCols=[],o.sortPredicate=[],o.isSortApplied=!0)},a.appendChild(g)}return r||a.appendChild(d),a},i.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},i.prototype.dialogHdrBtnClickHandler=function(){this.action===e.ResponsiveDialogAction.isEdit||this.action===e.ResponsiveDialogAction.isAdd?this.parent.endEdit():this.action===e.ResponsiveDialogAction.isFilter?this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}):this.action===e.ResponsiveDialogAction.isSort&&this.sortColumn()},i.prototype.closeCustomDialog=function(){if(this.isCustomDlgRender){var e=this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv");return void t.remove(e)}this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog()},i.prototype.destroyCustomFilterDialog=function(){if(this.customResponsiveDlg){var i=document.getElementById(this.customResponsiveDlg.element.id);this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&i&&(this.customResponsiveDlg.destroy(),t.remove(i)),this.closeCustomFilter(),this.action===e.ResponsiveDialogAction.isSort&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)}},i.prototype.closeCustomFilter=function(){if(!this.isDialogClose&&this.customFilterDlg){var e=document.getElementById(this.customFilterDlg.element.id);this.customFilterDlg&&!this.customFilterDlg.isDestroyed&&e&&(this.customFilterDlg.destroy(),t.remove(e))}this.isCustomDialog=!1,this.isDialogClose=!1},i.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?t.remove(e.parentElement):t.remove(e);else for(var i=this.customColumnDiv.children,r=0;r<i.length;r++)(e=i[r].querySelector(".e-filtersetdiv"))&&(t.remove(e),r--)},i.prototype.keyHandler=function(t){13===t.keyCode&&(this.action===e.ResponsiveDialogAction.isFilter&&t.target.classList.contains("e-searchinput")||this.action===e.ResponsiveDialogAction.isEdit||this.action===e.ResponsiveDialogAction.isAdd)&&this.dialogHdrBtnClickHandler()},i.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off("enter-key-handler",this.keyHandler)},i.prototype.removeEventListener=function(){this.customColumnDiv&&t.EventHandler.remove(this.customColumnDiv,"click",this.customFilterColumnClickHandler),Xe(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(St,this.onActionCompleteFn)},i}(),Er=function(){function e(){this.services={}}return e.prototype.register=function(e,i){t.isNullOrUndefined(this.services[e])&&(this.services[e]=i)},e.prototype.getService=function(e){if(t.isNullOrUndefined(this.services[e]))throw"The service "+e+" is not registered";return this.services[e]},e.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new Fr(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)},e}(),Ir=function(){function i(){this.rendererMap={}}return i.prototype.addRenderer=function(i,r){var n=t.getEnumValue(e.RenderType,i);t.isNullOrUndefined(this.rendererMap[n])&&(this.rendererMap[n]=r)},i.prototype.getRenderer=function(i){var r=t.getEnumValue(e.RenderType,i);if(t.isNullOrUndefined(this.rendererMap[r]))throw"The renderer "+r+" is not found";return this.rendererMap[r]},i}(),Tr=function(){function e(e){this.parent=e}return e.prototype.setWidthToColumns=function(){var e=0,t=this.parent.getColumnIndexesInView(),i=!0,r=0;if(this.parent.allowGrouping)for(var n=this.parent.groupSettings.columns.length;e<n;e++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e)?i=!1:this.setColumnWidth(new Ct({width:"30px"}),e);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new Ct({width:"30px"}),e),e++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new Ct({width:"30px"}),e),e++);for(var o=this.parent.getColumns(),s=0;s<o.length;s++)this.setColumnWidth(o[s],i&&this.parent.enableColumnVirtualization?void 0:s+e);this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new Ct({width:"30px"}),o.length),r=this.getTableWidth(this.parent.getColumns()),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(r)},e.prototype.setMinwidthBycalculation=function(e){var i=0,r=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)||"auto"===e.width});if(r.length){i=t.isNullOrUndefined(this.parent.width)||"auto"===this.parent.width||"string"!=typeof this.parent.width||-1!==this.parent.width.indexOf("%")?this.parent.element.getBoundingClientRect().width-e:("string"==typeof this.parent.width?parseInt(this.parent.width,10):this.parent.width)-e;for(var n=0,o=0,s=r;o<s.length;o++){var l=s[o];n+=t.isNullOrUndefined(l.minWidth)?0:"string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth}for(var a=0;a<r.length;a++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&a!==r.length-1&&this.setUndefinedColumnWidth(r);var h=this.parent.getColumnIndexByField(r[a].field)+this.parent.getIndentCount();0!==e&&i<n?this.setWidth(r[a].minWidth,h):0!==e&&i>n&&this.setWidth("",h,!0)}}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[t].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[t].field)))},e.prototype.setColumnWidth=function(e,i,r){if(!(this.parent.getColumns().length<1)){var n=t.isNullOrUndefined(i)?this.parent.getNormalizedColumnIndex(e.uid):i,o=this.getWidth(e),s=this.getTableWidth(this.parent.getColumns());null!==o&&(this.setWidth(o,n),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(s),(this.parent.allowResizing&&"resize"===r||this.parent.getFrozenColumns()&&this.parent.allowResizing)&&this.setWidthToTable(),this.parent.notify("column-width-changed",{index:n,width:o,column:e,module:r}))}},e.prototype.setWidth=function(e,i,r){this.parent.groupSettings.columns.length>i&&De(this.parent)&&(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n,o=this.parent.getHeaderTable(),s=this.parent.getContentTable(),l=t.formatUnit(e),a=this.parent.getFrozenColumns(),h=this.parent.isRowDragable();a=a&&h?a+1:a;var d=this.parent.getHeaderContent().querySelector("."+Ii),c=this.parent.getContent().querySelector("."+Ei),p=this.parent.getFrozenLeftColumnsCount(),u=this.parent.getFrozenRightColumnsCount(),g=this.parent.getMovableColumnsCount(),f=0!==p||0!==u;if(a&&i>=a){if(!d||!d.querySelector(ji))return;n=d.querySelector(ji).children[i-a]}else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&d.scrollLeft>0)n=(v=d.querySelector(ji)).children[v.children.length-1-i];else if(f){C=void 0;if(p&&!u)C=(i=h?i-1:i)<p?o:d;else if(!p&&u)C=i>=g?o:d;else if(p&&u){i=h?i-1:i;var m=this.parent.getFrozenRightHeader();C=i<p?o:i<p+g?d:m}if(!(n=this.getColumnLevelFrozenColgroup(i,p,g,C)))return}else n=o.querySelector(ji).children[i];n&&!r?n.style.width=l:n&&r&&(n.style.width="");var y;if(a&&i>=a)y=this.parent.getContent().querySelector("."+Ei).querySelector(ji).children[i-a];else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&c.scrollLeft>0){var v=this.parent.getContent().querySelector("."+Ei).querySelector(ji);y=v.children[v.children.length-1-i]}else if(f){var C=void 0;if(p&&!u&&(C=i<p?s:c),!p&&u&&(C=i>=g?s:c),p&&u){var w=this.parent.getContent().querySelector(".e-frozen-right-content");C=i<p?s:i<p+g?c:w}y=this.getColumnLevelFrozenColgroup(i,p,g,C)}else y=s.querySelector(ji).children[i];if(y&&!r?y.style.width=l:y&&r&&(y.style.width=""),!this.parent.enableColumnVirtualization){for(var b=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),S=[],R=0;R<b.length;R++)if(O(b[R],"e-grid").id===this.parent.element.id)for(var x=0;x<b[R].querySelector("colgroup").children.length;x++)S.push(b[R].querySelector("colgroup").children[x]);b.length&&S.length&&(S[i].style.width=l)}this.parent.isFrozenGrid()&&this.refreshFrozenScrollbar()},e.prototype.getColumnLevelFrozenColgroup=function(e,t,i,r){if(!r||!r.querySelector(ji))return null;var n=this.parent.getColumns(),o=this.parent.isRowDragable(),s=this.parent.getFrozenMode(),l=[].slice.call(r.querySelector(ji).children);return"Right"===s&&o&&e===i+this.parent.getFrozenRightColumnsCount()?l[l.length-1]:o&&-1===e?l[0]:"Left"===n[e].freeze?l[o?e+1:e]:"Right"===n[e].freeze?l[e-(t+i)]:l[e-t]},e.prototype.refreshFrozenScrollbar=function(){var e={cancel:!1};if(this.parent.notify("prevent-frozen-scroll-refresh",e),!e.cancel){var t=j(),i=this.parent.element.querySelector(".e-frozenscrollbar"),r=this.parent.element.querySelector(".e-movablescrollbar"),n=this.parent.getContent().querySelector("."+Ti),o=this.parent.getContent().querySelector("."+Ei),s=n.firstElementChild.getBoundingClientRect().width,l=o.firstElementChild.getBoundingClientRect().width;if("Right"===this.parent.getFrozenMode()&&(s+=t),i.style.width=s+"px",this.parent.getFrozenMode()===Pi){var a=this.parent.element.querySelector(".e-frozen-right-scrollbar"),h=this.parent.getContent().querySelector(".e-frozen-right-content").firstElementChild.getBoundingClientRect().width;"auto"!==this.parent.height&&(h+=t),a.style.width=h+"px"}else{if(this.parent.enableColumnVirtualization){var d=this.parent.getMovableVirtualContent().querySelector(".e-virtualtrack");d&&(l=d.scrollWidth)}"Right"!==this.parent.getFrozenMode()&&"auto"!==this.parent.height&&(l+=t)}r.firstElementChild.style.width=l+"px"}},e.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},e.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],r=0,n=[Si,xi,"e-groupdroparea","e-gridpager","e-toolbar"];i;)n.some(function(e){return i.classList.contains(e)})&&(r+=i.offsetHeight),i=i[t+"ElementSibling"];return r},e.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)&&t.isNullOrUndefined(e.minWidth)}).length;return this.parent.getColumns().length===e},e.prototype.getWidth=function(e){if(t.isNullOrUndefined(e.width)&&this.parent.allowResizing&&t.isNullOrUndefined(e.minWidth)&&!this.isWidthUndefined()&&(e.width=200),this.parent.isFrozenGrid()&&t.isNullOrUndefined(e.width)&&(e.getFreezeTableName()===Li||e.getFreezeTableName()===Ni)&&(e.width=200),!e.width)return null;var i=parseInt(e.width.toString(),10);return e.minWidth&&i<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&i>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width},e.prototype.getTableWidth=function(e){for(var t=0,i=0,r=e;i<r.length;i++){var n=r[i],o=this.getWidth(n);"auto"===n.width&&(o=0),!1!==n.visible&&null!==o&&(t+=parseInt(o.toString(),10))}return t},e.prototype.calcMovableOrFreezeColWidth=function(e){var i=this.parent.getColumns().slice(),r=this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenColumns(),n=this.parent.getMovableColumnsCount(),o=this.parent.getFrozenRightColumnsCount();return"movable"===e?(o&&i.splice(r+n,i.length),r&&i.splice(0,r)):"freeze-left"===e?i.splice(r,i.length):"freeze-right"===e&&i.splice(0,r+n),t.formatUnit(this.getTableWidth(i))},e.prototype.setWidthToFrozenRightTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze-right");e=this.isAutoResize()?"100%":e;var t=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("."+Mi),i=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("."+Mi);t.style.width=e,i.style.width=e},e.prototype.setWidthToFrozenLeftTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze-left");e=this.isAutoResize()?"100%":e,this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e},e.prototype.setWidthToMovableTable=function(){var e="",i=this.parent.getColumns().filter(function(e){return t.isNullOrUndefined(e.width)}).length>=1,r=this.parent.getColumns().filter(function(e){return"auto"===e.width}).length>=1;"number"!=typeof this.parent.width||i||r?i||r||(e=this.calcMovableOrFreezeColWidth("movable")):e=t.formatUnit(this.parent.width-parseInt(this.calcMovableOrFreezeColWidth("freeze").split("px")[0],10)-5),e=this.isAutoResize()?"100%":e,this.parent.getHeaderContent().querySelector("."+Ii).firstElementChild&&(this.parent.getHeaderContent().querySelector("."+Ii).firstElementChild.style.width=e),this.parent.getContent().querySelector("."+Ei).firstElementChild.style.width=e},e.prototype.setWidthToFrozenEditTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[0].style.width=e},e.prototype.setWidthToMovableEditTable=function(){var e=this.calcMovableOrFreezeColWidth("movable");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[1].style.width=e},e.prototype.setWidthToTable=function(){var e=t.formatUnit(this.getTableWidth(this.parent.getColumns()));this.parent.isFrozenGrid()?((this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount())&&this.setWidthToFrozenLeftTable(),this.setWidthToMovableTable(),this.parent.getFrozenRightColumnsCount()&&this.setWidthToFrozenRightTable()):((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new Ct({width:"30px"})),e=this.isAutoResize()?"100%":e,this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e);var i=this.parent.element.querySelector(".e-table.e-inline-edit");i&&this.parent.getFrozenColumns()?(this.setWidthToFrozenEditTable(),this.setWidthToMovableEditTable()):i&&(i.style.width=e)},e.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode},e}(),zr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dr=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.parent=e,this.rowModelGen=new Gi(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.onFocus=function(){if(!(this.parent.isDestroyed||t.Browser.isDevice||this.parent.enableVirtualization)){this.setActive(!this.parent.enableHeaderFocus&&0===this.parent.frozenRows,this.parent.isFrozenGrid()),this.parent.enableHeaderFocus||this.parent.getCurrentViewRecords().length||"Batch"===this.parent.editSettings.mode&&("Batch"!==this.parent.editSettings.mode||this.parent.editModule.getBatchChanges().addedRecords.length)||this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new vi({isDataRow:!0})]}),this.getContent().selector,!1);var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.skipFocus&&(this.focus(),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){this.parent.isDestroyed||e.target&&e.target.classList.contains("e-detailcell")&&(this.currentInfo.skipAction=!1,t.addClass([this.currentInfo.element],["e-focused","e-focus"]))},e.prototype.onBlur=function(e){this.parent.isEdit||e&&(!e.relatedTarget||t.closest(e.relatedTarget,".e-grid"))||(this.removeFocus(),this.skipFocus=!1,this.currentInfo.skipAction=!1,this.getContent().getFocusInfo().elementToFocus&&(this.getContent().getFocusInfo().elementToFocus.tabIndex=0))},e.prototype.onClick=function(e,i){if(!O(e.target,"e-filterbarcell")||!e.target.classList.contains("e-input-group-icon")){var r=!t.isNullOrUndefined(t.closest(e.target,"."+Ri)),n=!t.isNullOrUndefined(t.closest(e.target,"."+Si));r=r&&n?!r:r;var o=!t.isNullOrUndefined(t.closest(e.target,"."+Ti))||!t.isNullOrUndefined(t.closest(e.target,"."+zi)),s=!1;if(this.parent.getFrozenMode()===Pi&&(s=!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-content"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-header")),o=o&&!s),!(!r&&t.isNullOrUndefined(t.closest(e.target,"."+Si))||e.target.classList.contains(Di))&&t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))){if(this.setActive(r,o,s),!r&&t.isNullOrUndefined(t.closest(e.target,"."+Si)))return void this.clearOutline();var l={cancel:!1,byKey:!1,byClick:!t.isNullOrUndefined(e.target),clickArgs:e};if(this.parent.notify(jt,l),!l.cancel&&!t.closest(e.target,".e-inline-edit")&&(this.setActive(r,o,s),this.getContent())){if(!1===this.getContent().onClick(e,i))return;this.focus()}}}},e.prototype.onKeyPress=function(e){if(!this.skipOn(e)){this.activeKey=e.action;var t={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(jt,t),!t.cancel){var i=this.getContent().matrix.current;this.currentInfo.outline=!0;var r=this.getContent().jump(e.action,i);if(this.swap=r,r.swap&&(this.setActive(!r.toHeader,r.toFrozen,r.toFrozenRight),this.getContent().matrix.current=this.getContent().getNextCurrent(i,r,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),!1===(!this.content.lastIdxCell&&this.getContent().onKeyPress(e)))return void this.clearIndicator();e.preventDefault(),this.focus(e)}}},e.prototype.skipOn=function(e){var i=e.target;if(!i)return!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(["pageUp","pageDown","altDownArrow"].indexOf(e.action)>-1)return this.clearIndicator(),!0;var r=t.closest(i,"th")&&!t.closest(i,"th").tabIndex;!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||t.closest(e.target,".e-filterbarcell").querySelector("input").focus(),r&&null!==t.closest(document.activeElement,".e-filterbarcell")&&this.removeFocus();var n=null!==t.closest(document.activeElement,".e-filterbarcell");if(this.parent.enableHeaderFocus&&n){var o=this.active.matrix,s=o.current;n=o.matrix[s[0]].lastIndexOf(1)!==s[1]}return"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit||["insert","f2"].indexOf(e.action)>-1)||n||null!==t.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===t.closest(i,"."+Ri)&&null===t.closest(i,"."+Si)||"space"===e.action&&!i.classList.contains(ki)&&null===t.closest(i,"."+ki)&&null===t.closest(i,".e-headerchkcelldiv")||null!==t.closest(i,".e-filter-popup")},e.prototype.focusVirtualElement=function(e){var t=this;if(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling){var i={virtualData:{},isAdd:!1,isCancel:!1};this.parent.notify(pi,i);var r=this.actions.some(function(e){return e===t.activeKey}),n=!!this.parent.contentModule&&this.parent.contentModule.selectedRowIndex>-1;i.isAdd||Object.keys(i.virtualData).length||r||i.isCancel||n?(this.parent.notify("reset-virtual-focus",{isCancel:!1}),i.isCancel=!1,this.parent.contentModule.selectedRowIndex=-1,r&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()}this.isVirtualScroll=!1},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e,t,i){this.active=e?t?this.fContent:i?this.frContent:this.content:t?this.fHeader:i?this.frHeader:this.header},e.prototype.setFocusedElement=function(e,i){var r=this;this.currentInfo.elementToFocus=e,setTimeout(function(){t.isNullOrUndefined(r.currentInfo.elementToFocus)||(r.parent.enableVirtualization||r.parent.enableInfiniteScrolling?r.focusVirtualElement(i):r.currentInfo.elementToFocus.focus())},0)},e.prototype.focus=function(e){this.parent.notify("virtaul-cell-focus",e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},e.prototype.removeFocus=function(e){this.currentInfo.element&&(t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},e.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&(t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]))},e.prototype.focusHeader=function(){this.setActive(!1,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.focusContent=function(){this.setActive(!0,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.resetFocus=function(){var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},e.prototype.addFocus=function(e,i){if(this.currentInfo=e,this.currentInfo.outline=e.outline&&!t.isNullOrUndefined(i),e.element){var r=e.elementToFocus.classList.contains("e-focus");if(!r){this.currentInfo.outline&&t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]),e.element.tabIndex=0,r||this.setFocusedElement(e.elementToFocus,i),this.parent.notify("cellfocused",{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!t.isNullOrUndefined(i),byClick:t.isNullOrUndefined(i),keyArgs:i,isJump:this.swap.swap,container:this.getContent().getInfo(i),outline:!t.isNullOrUndefined(i),swapInfo:this.swap});var n=this.getContent().matrix.current,o=n[0],s=n[1];this.prevIndexes={rowIndex:o,cellIndex:s},this.focusedColumnUid=this.parent.getColumnByIndex(s).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var i=this;return function(r){e&&r.args&&r.args.isFrozen&&!i.fContent?i.fContent=new Ar(i.parent):e&&!i.frContent&&r.args&&r.args.renderFrozenRightContent?i.frContent=new Nr(i.parent):e&&!i.content&&(i.content=new Or(i.parent)),!e&&r.args&&r.args.isFrozen&&!i.fHeader?i.fHeader=new Br(i.parent):!e&&r.args&&r.args.renderFrozenRightContent&&!i.frHeader?i.frHeader=new Lr(i.parent):e||i.header||(i.header=new kr(i.parent));var n=e?r.args&&r.args.isFrozen?i.fContent:r.args&&r.args.renderFrozenRightContent?i.frContent:i.content:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header,o=e?r.rows.slice(i.parent.frozenRows):r.rows,s=e?r.rows.slice(0,i.parent.frozenRows):r.rows;i.parent.isCollapseStateEnabled()&&e&&(o=o.filter(function(e){return!1!==e.visible}));var l=!t.isNullOrUndefined(i.parent.rowTemplate),a=n.matrix.generate(s,n.selector,l);if("batchAdd"===r.name&&i.parent.isFrozenGrid()){var h=i.parent.getMovableRowsObject().map(function(e){return e.clone()}),d=o.map(function(e){return e.clone()});if(i.fContent.matrix.generate(d,i.fContent.selector,l),i.content.matrix.generate(h,i.content.selector,l),i.parent.getFrozenMode()===Pi){var c=i.parent.getFrozenRightRowsObject().map(function(e){return e.clone()});i.frContent.matrix.generate(c,i.frContent.selector,l)}}else n.matrix.generate(o,n.selector,l);if(n.generateRows(s,{matrix:a,handlerInstance:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header}),!t.Browser.isDevice&&r&&r.args&&(i.focusByClick||"paging"!==r.args.requestType||(i.skipFocus=!1,i.parent.element.focus()),"grouping"===r.args.requestType&&(i.skipFocus=!0)),r&&r.args&&"virtualscroll"===r.args.requestType)if(i.currentInfo.uid){var p;if(r.rows.some(function(e,t){return p=t,e.uid===i.currentInfo.uid})&&(i.content.matrix.current[0]=p,i.content.matrix.current[1]=i.parent.getColumnIndexByUid(i.focusedColumnUid)||0,f=i.getContent().getFocusInfo().elementToFocus)){var u=f.getBoundingClientRect(),g=i.parent.element.getBoundingClientRect();u.top>=0&&u.left>=0&&u.right<=Math.min(g.right,window.innerWidth||document.documentElement.clientWidth)&&u.bottom<=Math.min(g.bottom,window.innerHeight||document.documentElement.clientHeight)&&(i.isVirtualScroll=!0,i.focus())}}else if(r.args.focusElement&&r.args.focusElement.classList.contains("e-filtertext")){var f=i.parent.element.querySelector("#"+r.args.focusElement.id);f&&f.focus()}}},e.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(t.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),t.EventHandler.add(this.parent.element,"focus",this.onFocus,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(t){return e.passiveFocus(t)},!0),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.evtHandlers=[{event:Vt,handler:this.onKeyPress},{event:Gt,handler:this.onClick},{event:At,handler:this.refMatrix},{event:"partial-refresh",handler:this.refMatrix},{event:"refresh-Expand-and-Collapse",handler:this.refMatrix},{event:Ht,handler:this.refreshMatrix()},{event:"close-edit",handler:this.restoreFocus},{event:"restore-Focus",handler:this.restoreFocus},{event:"start-edit",handler:this.clearIndicator},{event:"start-add",handler:this.clearIndicator},{event:"sorting-complete",handler:this.restoreFocus},{event:"filtering-complete",handler:this.filterfocus},{event:"grouping-complete",handler:this.restoreFocusWithAction},{event:"ungrouping-complete",handler:this.restoreFocusWithAction},{event:"batchAdd",handler:this.refMatrix},{event:"batchCancel",handler:this.refMatrix},{event:"batchDelete",handler:this.refMatrix},{event:"detailDataBound",handler:this.refMatrix},{event:Pt,handler:this.refMatrix},{event:"cellfocused",handler:this.internalCellFocus}],Xe(this.parent,this.evtHandlers,!0,this))},e.prototype.filterfocus=function(){"FilterBar"!==this.parent.filterSettings.type&&this.restoreFocus()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),t.EventHandler.remove(this.parent.element,"focus",this.onFocus),t.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),Xe(this.parent,this.evtHandlers,!1))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.restoreFocus=function(){this.addFocus(this.getContent().getFocusInfo())},e.prototype.restoreFocusWithAction=function(e){if(!this.parent.enableInfiniteScrolling){var i=this.getContent().matrix,r=i.current;switch(e.requestType){case"grouping":case"ungrouping":r[1]=!r.length||this.parent.groupSettings.showGroupedColumn||t.isNullOrUndefined(i.matrix[r[0]])?"grouping"===e.requestType?r[1]+1:r[1]-1:i.matrix[r[0]].indexOf(1)}this.getContent().matrix.current=r,this.addFocus(this.getContent().getFocusInfo())}},e.prototype.clearOutline=function(){this.getContent().matrix.current=this.getContent().matrix.get(0,-1,[0,1],"downArrow",this.getContent().validator()),this.clearIndicator()},e.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},e.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e||!Object.keys(this.prevIndexes).length?{rowIndex:null,cellIndex:null}:this.prevIndexes},e.prototype.forgetPrevious=function(){this.forget=!0},e.prototype.setActiveByKey=function(e,t){var i=this;if(this.parent.isFrozenGrid()||0!==this.parent.frozenRows){var r,n={home:function(){return{toHeader:!r.isContent,toFrozen:!0}},end:function(){return{toHeader:!r.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:i.parent.isFrozenGrid()}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}};if(e in n){r=t.getInfo();var o=n[e]();this.setActive(!o.toHeader,o.toFrozen),this.getContent().matrix.current=t.matrix.current}}},e.prototype.internalCellFocus=function(e){if(e.byKey&&e.container.isContent&&"enter"===e.keyArgs.action&&(e.parent.classList.contains("e-detailcell")||e.parent.classList.contains("e-unboundcell")||e.parent.classList.contains("e-templatecell"))){this.clearIndicator();var t=this.getContent().getFocusable(this.getFocusedElement());this.setFocusedElement(t),this.currentInfo.skipAction=!0}},e}(),Mr=function(){function e(){this.matrix=[],this.current=[]}return e.prototype.set=function(e,t,i){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[e]=this.matrix[e]||[],this.matrix[e][t]=i?1:0},e.prototype.get=function(e,i,r,n,o){var s=i;if(e+r[0]<0)return[e,i];e=Math.max(0,Math.min(e+r[0],this.rows));var l=!0;if(t.isNullOrUndefined(this.matrix[e]))return null;if(i=Math.max(0,Math.min(i+r[1],this.matrix[e].length-1)),s+r[1]>this.matrix[e].length-1&&o(e,i,n))return[e,s];var a=this.first(this.matrix[e],i,r,!0,n);i=null===a?s:a;var h=t.getValue(e+"."+i,this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(r[0]=-1),null===a){for(var d=0;d<this.rows;d++)if(this.matrix[d].some(function(e){return 1===e})){l=!1;break}if(l)return e=this.current[0],[e,i]}return this.inValid(h)||!o(e,i,n)?this.get(e,s,r,n,o):[e,i]},e.prototype.first=function(e,t,i,r,n){return(t<0||t===e.length)&&this.inValid(e[t])&&"upArrow"!==n&&"downArrow"!==n||!e.some(function(e){return 1===e})?null:this.inValid(e[t])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown"].indexOf(n)?r?0:++t:t+i[1],i,!1,n):t},e.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[e].length-1)),this.current=[e,t]},e.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var r=0;r<e.length;r++){var n=e[r].cells.filter(function(e){return!0!==e.isSpanned});this.columns=Math.max(n.length-1,0|this.columns);for(var o=0;o<n.length;o++)this.set(r,o,!1!==e[r].visible&&t(e[r],n[o],i))}return this.matrix},e.prototype.inValid=function(e){return 0===e||void 0===e},e}(),Or=function(){function i(e){var t=this;this.matrix=new Mr,this.lastIdxCell=!1,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[e]||null}}return i.prototype.getTable=function(){return this.parent.isFrozenGrid()?this.parent.getContent().querySelector(".e-movablecontent .e-table"):this.parent.getContentTable()},i.prototype.onKeyPress=function(e){var t=this.keyActions[e.action],i=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(i){if((["tab","shiftTab"].indexOf(e.action)>-1&&this.matrix.current||[]).toString()===i.toString()){if(i.toString()===[this.matrix.rows,this.matrix.columns].toString()||i.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===i.toString())return!1;i=this.editNextRow(i[0],i[1],e.action)}this.matrix.select(i[0],i[1])}},i.prototype.editNextRow=function(e,t,i){var r=this.parent,n=r.editSettings.allowNextRowEdit&&(r.isEdit||r.isLastCellPrimaryKey),o=r.getColumnIndexByField(r.getVisibleColumns()[0].field),s=this.getTable().rows[e].cells[t];return"tab"===i&&n&&(e++,t=o+(this.getTable().rows[e].getElementsByClassName("e-indentcell").length+this.getTable().rows[e].getElementsByClassName("e-detailrowcollapse").length)),"shiftTab"===i&&n&&(e--,t=r.getColumnIndexByField(r.getVisibleColumns()[r.getVisibleColumns().length-1].field)),s.classList.contains(bi)||s.classList.contains("e-headercell")||s.classList.contains("e-groupcaption")?[e,t]:this.editNextRow(e,t,i)},i.prototype.getCurrentFromAction=function(e,t,i,r){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(r))return this.matrix.current;var n=this.indexesByKey(e)||this.matrix.current.concat(t),o=n[0],s=n[1],l=n[2],a=n[3];return this.matrix.get(o,s,[l,a],e,this.validator())},i.prototype.onClick=function(e,i){var r=e.target;if(this.target=r,r=r.classList.contains(bi)?r:t.closest(r,"td"),r=r||(t.closest(e.target,"td.e-detailrowcollapse")||t.closest(e.target,"td.e-detailrowexpand")),r=t.closest(e.target,"td.e-detailcell")&&t.isNullOrUndefined(t.closest(t.closest(e.target,".e-grid"),"td.e-detailcell"))?null:r,!(r=r&&t.closest(r,"table").classList.contains(Mi)?r:null))return!1;var n=[r.parentElement.rowIndex,r.cellIndex],o=n[0],s=n[1],l=this.matrix.current,a=l[0],h=l[1],d=t.getValue(o+"."+s,this.matrix.matrix);if(this.matrix.inValid(d)||!i&&a===o&&h===s||!O(e.target,bi)&&!O(e.target,"e-groupcaption"))return!1;this.matrix.select(o,s)},i.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return this.matrix.current=[n,s],e.element=t.isNullOrUndefined(this.getTable().rows[n])?null:this.getTable().rows[n].cells[s],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid"),e):e},i.prototype.getFocusable=function(e){var i='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',r=!t.isNullOrUndefined(t.closest(e,".e-templatecell"));this.parent.isEdit&&(i='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea');var n=[].slice.call(e.querySelectorAll(i));return n.length?r&&n.length>1?this.target:n[0]:e},i.prototype.selector=function(i,r,n){var o=[e.CellType.Expand,e.CellType.GroupCaption,e.CellType.CaptionSummary,e.CellType.GroupSummary];return(i.isDataRow&&r.visible&&(r.isDataCell||r.isTemplate)||i.isDataRow&&r.cellType===e.CellType.DetailExpand&&t.isNullOrUndefined(r.visible)||!i.isDataRow&&o.indexOf(r.cellType)>-1||r.column&&"checkbox"===r.column.type||r.cellType===e.CellType.CommandColumn||i.isDataRow&&n)&&!("delete"===i.edit&&i.isDirty)},i.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,r=this.matrix.rows;i<r;i++){if(-1!==this.matrix.matrix[e].indexOf(1))return e;e+=1}return this.lastIdxCell=!0,t},i.prototype.previousRowFocusValidate=function(e){for(var t=e,i=e;i>=0;i--){if(-1!==this.matrix.matrix[e].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},i.prototype.jump=function(e,t){var i=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftTab"===e)&&0===t[1],r=("rightArrow"===e||"tab"===e)&&t[1]===this.matrix.columns,n=this.parent.getFrozenMode()===Pi&&r;"Right"===this.parent.getFrozenMode()&&(i=r),this.lastIdxCell=!1;var o=0!==this.parent.frozenRows&&"shiftEnter"===e;"tab"!==e||this.parent.isEdit||t[1]!==this.matrix.matrix[t[0]].lastIndexOf(1)||this.matrix.matrix.length-1===t[0]||(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1,i=this.parent.isFrozenGrid()),"shiftTab"!==e||this.parent.isEdit||0===t[0]||this.matrix.matrix[t[0]].indexOf(1)!==t[1]||(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length);var s=!1,l=document.activeElement.parentElement;return(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&l.classList.contains(Oi)&&(s=parseInt(l.getAttribute(Hi),10)>0),{swap:!s&&(("upArrow"===e||o)&&0===t[0]||i||n),toHeader:("upArrow"===e||o)&&0===t[0],toFrozen:i,toFrozenRight:n}},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||this.parent.getFrozenMode()===Pi?("leftArrow"!==r&&"shiftTab"!==r||(n[0]=e[0],n[1]=i.matrix.columns+1),this.parent.getFrozenMode()!==Pi||"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1)):"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},i.prototype.generateRows=function(e,t){var i,r=t.matrix,n=t.handlerInstance,o=n.matrix.matrix.length,s=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?o+1:o;n.matrix.matrix=n.matrix.matrix.slice(0,s),n.matrix.rows=s,(i=n.matrix.matrix).push.apply(i,r),n.matrix.rows+=r.length},i.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,r=i[0],n=i[1],o=t.element.classList.contains(bi),s=o||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),l=[Math.min(parseInt(t.element.parentElement.getAttribute(Hi),10),r),Math.min(parseInt(t.element.getAttribute(qi),10),n)];return{isContent:!0,isDataCell:o,indexes:[l[0],l[1]],isSelectable:s}},i.prototype.validator=function(){var e=this.getTable();return function(i,r,n){if(!t.isNullOrUndefined(e.rows[i])){var o=void 0;r=e.querySelector(".e-emptyrow")?0:r;var s=0!==(o=e.rows[i].cells[0].classList.contains("e-editcell")?e.rows[i].cells[0].querySelectorAll("td")[r]:e.rows[i].cells[r]).getBoundingClientRect().width;if("enter"===n||"shiftEnter"===n)return s&&o.classList.contains(bi);if(("shiftUp"===n||"shiftDown"===n)&&o.classList.contains(bi))return s;if("shiftUp"!==n&&"shiftDown"!==n)return s}return!1}},i.prototype.shouldFocusChange=function(e){var i=this.matrix.current,r=i[0],n=void 0===r?-1:r,o=i[1],s=void 0===o?-1:o;if(n<0||s<0)return!0;var l=t.getValue(n+".cells."+s,this.getTable().rows);return!l||("enter"!==e.action&&"shiftEnter"!==e.action||l.classList.contains(bi)&&!l.classList.contains("e-unboundcell")&&(!l.classList.contains("e-templatecell")||l.classList.contains("e-editedbatchcell"))&&!l.classList.contains("e-detailcell"))},i.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection},i}(),kr=function(i){function r(e){return i.call(this,e)||this}return zr(r,i),r.prototype.getTable=function(){return this.parent.isFrozenGrid()?this.parent.getHeaderContent().querySelector(".e-movableheader .e-table"):this.parent.getHeaderTable()},r.prototype.onClick=function(e){var i=e.target;if(this.target=i,(i=i.classList.contains("e-headercell")?i:t.closest(i,"th"))||0===this.parent.frozenRows||(i=e.target.classList.contains(bi)?e.target:t.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(i){var r=[i.parentElement.rowIndex,i.cellIndex],n=r[0],o=r[1],s=t.getValue(n+"."+o,this.matrix.matrix);if(this.matrix.inValid(s))return!1;this.matrix.select(i.parentElement.rowIndex,i.cellIndex)}},r.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return e.element=this.getTable().rows[n].cells[s],t.isNullOrUndefined(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},r.prototype.selector=function(i,r){return r.visible&&(void 0!==r.column.field||r.isTemplate||!t.isNullOrUndefined(r.column.template))||"checkbox"===r.column.type||r.cellType===e.CellType.StackedHeader},r.prototype.jump=function(e,i){var r=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1],n=("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns,o=this.parent.getFrozenMode()===Pi&&n;"Right"===this.parent.getFrozenMode()&&(r=n);var s,l,a=0!==this.parent.frozenRows&&"enter"===e,h=r||o,d=this.parent.focusModule.fHeader&&this.parent.focusModule.fHeader.matrix.matrix,c=d&&!t.isNullOrUndefined(d[i[0]]);return this.parent.enableHeaderFocus&&"tab"===e&&(l=this.matrix.matrix.length-1===i[0],(s=i[1]===this.matrix.matrix[i[0]].lastIndexOf(1))&&(this.matrix.current[0]=l?0:this.matrix.current[0]+1,this.matrix.current[1]=-1),this.parent.isFrozenGrid()&&l&&s&&(r=!0,h=!1)),{swap:("downArrow"===e||a)&&i[0]===this.matrix.matrix.length-1||c&&(r||o)||"tab"===e&&l&&s,toHeader:h,toFrozen:r,toFrozenRight:o}},r.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||this.parent.getFrozenMode()===Pi?(("leftArrow"===r||"shiftLeft"===r&&this.getGridSeletion()||"shiftTab"===r)&&(n[0]=e[0],n[1]=i.matrix.columns+1),this.parent.getFrozenMode()===Pi&&("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1)):("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},r.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,r=0;r<i.length;r++)this.matrix.set(t,r,i[r].visible&&!1!==i[r].column.allowFiltering)}},r.prototype.getInfo=function(e){return t.extend(i.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},r.prototype.validator=function(){return function(){return!0}},r.prototype.shouldFocusChange=function(e){var i=this.matrix.current,r=i[0],n=i[1];if(r<0||n<0)return!0;var o=t.getValue(r+".cells."+n,this.getTable().rows);return!o||("enter"!==e.action&&"altDownArrow"!==e.action||!o.classList.contains("e-headercell"))},r}(Or),Ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zr(t,e),t.prototype.getTable=function(){return this.parent.getContent().querySelector(".e-frozencontent .e-table")},t.prototype.jump=function(e,t){var i=0!==this.parent.frozenRows&&"shiftEnter"===e,r=("upArrow"===e||i)&&0===t[0];return"Right"===this.parent.getFrozenMode()?{swap:r||("shiftTab"===e||"leftArrow"===e)&&0===t[1],toHeader:r,toFrozen:r}:{swap:r||("tab"===e||"rightArrow"===e)&&t[1]===this.matrix.columns,toHeader:r,toFrozen:r}},t.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()?"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1):("tab"===r&&this.parent.enableHeaderFocus&&(n[0]=e[0],n[1]=-1),"leftArrow"!==r&&"shiftTab"!==r||(n[0]=e[0],n[1]=i.matrix.columns+1)),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},t}(Or),Br=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return zr(i,e),i.prototype.jump=function(e,i){var r=0!==this.parent.frozenRows&&"enter"===e,n=this.parent.focusModule.header&&this.parent.focusModule.header.matrix.matrix,o=n&&!t.isNullOrUndefined(n[i[0]]);if("Right"===this.parent.getFrozenMode()){var s=("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1];return{swap:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1||o&&s,toHeader:s,toFrozen:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1}}return{swap:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1||("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns&&o,toHeader:("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns,toFrozen:("downArrow"===e||r)&&i[0]===this.matrix.matrix.length-1}},i.prototype.getTable=function(){return this.parent.getHeaderContent().querySelector(".e-frozenheader .e-table")},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()?("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1):("leftArrow"===r||"shiftLeft"===r&&this.getGridSeletion()||"shiftTab"===r)&&(n[0]=e[0],n[1]=i.matrix.columns+1),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},i}(kr),Pr=function(){function e(e){this.searchBox=e}return e.prototype.searchFocus=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.searchBlur=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.wireEvent=function(){this.searchBox&&(t.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),t.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},e.prototype.unWireEvent=function(){this.searchBox&&(t.EventHandler.remove(this.searchBox,"focus",this.searchFocus),t.EventHandler.remove(this.searchBox,"blur",this.searchBlur))},e}(),Nr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zr(t,e),t.prototype.getTable=function(){return this.parent.getContent().querySelector(".e-frozen-right-content .e-table")},t.prototype.jump=function(e,t){var i=0!==this.parent.frozenRows&&"shiftEnter"===e,r=("upArrow"===e||i)&&0===t[0];return{swap:r||("shiftTab"===e||"leftArrow"===e)&&0===t[1],toHeader:r,toFrozenRight:r}},t.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},t}(Or),Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return zr(i,e),i.prototype.jump=function(e,i){var r=this.parent.focusModule.header&&this.parent.focusModule.header.matrix.matrix,n=r&&!t.isNullOrUndefined(r[i[0]]),o=0!==this.parent.frozenRows&&"enter"===e,s=("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1];return{swap:("downArrow"===e||o)&&i[0]===this.matrix.matrix.length-1||n&&s,toHeader:s,toFrozenRight:("downArrow"===e||o)&&i[0]===this.matrix.matrix.length-1}},i.prototype.getTable=function(){return this.parent.getHeaderContent().querySelector(".e-frozen-right-header .e-table")},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=0),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},i}(kr),qr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qr(i,e),Hr([t.Property(12)],i.prototype,"pageSize",void 0),Hr([t.Property(8)],i.prototype,"pageCount",void 0),Hr([t.Property(1)],i.prototype,"currentPage",void 0),Hr([t.Property()],i.prototype,"totalRecordsCount",void 0),Hr([t.Property(!1)],i.prototype,"enableQueryString",void 0),Hr([t.Property(!1)],i.prototype,"pageSizes",void 0),Hr([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),jr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Gr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jr(i,e),Vr([t.Property("startsWith")],i.prototype,"operator",void 0),Vr([t.Property(!1)],i.prototype,"ignoreAccent",void 0),i}(t.ChildProperty),_r=function(){return(_r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},Wr=function(){function r(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.deSelectedData=[],this.needColumnSelection=!1,this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.cellselected=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.initialRowSelection=!1,this.isPrevRowSelection=!1,this.isKeyAction=!1,this.autoFillRLselection=!0,this.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}return r.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},r.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},r.prototype.fDataUpdate=function(e){if(!(this.isMultiSelection||t.isNullOrUndefined(e.cellIndex)&&t.isNullOrUndefined(e.rowIndex))){var i=this.getRowObj(t.isNullOrUndefined(e.rowIndex)?t.isNullOrUndefined(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex);e.foreignKeyData=i.foreignKeyData}return e},r.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},r.prototype.getModuleName=function(){return"selection"},r.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.hidePopUp(),this.clearSelection(),this.removeEventListener(),this.unWireEvents(),t.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},r.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.isPersistSelection},r.prototype.getSelectedMovableRow=function(e){var t=this.parent;return t.isFrozenGrid()&&this.parent.getContent().querySelector("."+Ei)?t.getMovableRowByIndex(e):null},r.prototype.getSelectedFrozenRightRow=function(e){var t=this.parent;return t.isFrozenGrid()&&t.getFrozenMode()===Pi&&t.getFrozenRightContent()?t.getFrozenRightRowByIndex(e):null},r.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){var t=R(this.parent.getCurrentViewRecords());t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges().addedRecords):this.parent.editModule.getBatchChanges().addedRecords.concat(t);for(var i=this.parent.editModule.getBatchChanges().deletedRecords,r=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<i.length;n++)for(var o=0;o<t.length;o++)if(i[n][r]===t[o][r]){t.splice(o,1);break}return t}return e.getCurrentViewRecords()},r.prototype.selectRow=function(e,t){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)return void this.addRowsToSelection([e]);var i,r=this.parent,n=r.getRowByIndex(e),o=this.getSelectedMovableRow(e),s=this.getSelectedFrozenRightRow(e);if(r.enableVirtualization&&e>-1){var l={selectedIndex:e,isAvailable:!0};this.parent.notify("select-virtual-Row",l);var a=r.isFrozenGrid()?r.contentModule.getRowObjectByIndex(e):null;if(!n||!r.getRowObjectFromUID(n.getAttribute("data-uid"))&&!a)return void(l.isAvailable&&!r.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&this.clearRowSelection());i=a||r.getRowObjectFromUID(n.getAttribute("data-uid")).data}else i=this.getCurrentBatchRecordChanges()[e];if(this.isRowType()&&n&&!this.isEditing()){var h=n.hasAttribute("aria-selected");this.activeTarget(),t=t?!!this.selectedRowIndexes.length&&(1===this.selectedRowIndexes.length&&((!this.isKeyAction||!this.parent.isCheckBoxSelection)&&e===this.selectedRowIndexes[0])):t,this.isKeyAction=!1;var d;t?this.rowSelectingCallBack(d,t,e,i,!1,h,"cancel")(d):(d={data:i,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:n,previousRow:r.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},d=this.addMovableArgs(d,o,s),this.parent.trigger("rowSelecting",this.fDataUpdate(d),this.rowSelectingCallBack(d,t,e,i,!1,h,"cancel")))}},r.prototype.rowSelectingCallBack=function(e,i,r,n,o,s,l){var a=this;return function(e){if(!t.isNullOrUndefined(e)&&!0===e[l])return void a.disableInteracted();a.index=r,a.toggle=i,a.data=n,a.removed=o,s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode?(a.clearSelectedRow(r),a.selectRowCallBack()):!s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&a.selectRowCallBack(),"ResetOnRowClick"===a.selectionSettings.checkboxMode&&a.clearSelection(),(!a.selectionSettings.persistSelection||"ResetOnRowClick"===a.selectionSettings.checkboxMode||!a.parent.isCheckBoxSelection&&a.selectionSettings.persistSelection)&&(a.selectRowCheck=!0,a.clearRow())}},r.prototype.selectRowCallBack=function(){var e,t=this.parent,i=this.index,r=this.toggle,n=this.data,o=this.removed,s=t.getRowByIndex(i),l=this.getSelectedMovableRow(i),a=this.getSelectedFrozenRightRow(i);r||o||(this.selectedRowIndexes.indexOf(i)<=-1&&(this.updateRowSelection(s,i),this.selectMovableRow(l,a,i)),this.selectRowIndex(i)),r||(e={data:n,rowIndex:i,row:s,previousRow:t.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked},e=this.addMovableArgs(e,l,a),this.onActionComplete(e,"rowSelected")),this.isInteracted=!1,this.updateRowProps(i)},r.prototype.selectMovableRow=function(e,t,i){this.parent.isFrozenGrid()&&(this.updateRowSelection(e,i),this.parent.getFrozenMode()===Pi&&t&&this.updateRowSelection(t,i))},r.prototype.addMovableArgs=function(e,t,i){if(this.parent.isFrozenGrid()){var r={mRow:t,previousMovRow:this.parent.getMovableRows()[this.prevRowIndex]};this.parent.getFrozenMode()===Pi&&i&&(r.frozenRightRow=i,r.previousFrozenRightRow=this.parent.getFrozenRightDataRows()[this.prevRowIndex]),e=_r({},e,r)}return e},r.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},r.prototype.selectRows=function(e){var i=this,r=this.parent,n=this.isSingleSel()?e[e.length-1]:e[0];this.isMultiSelection=!0;var o=[],s=[],l=this.getSelectedMovableRow(n),a=this.getSelectedFrozenRightRow(n),h=[];if(this.isRowType()&&!this.isEditing()){for(var d=0,c=e.length;d<c;d++){var p=this.parent.getDataRows()[e[d]],u=this.getRowObj(p);u&&(h.push(u.data),o.push(p),s.push(u.foreignKeyData))}this.activeTarget();var g;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(g={cancel:!1,rowIndexes:e,row:o,rowIndex:n,target:this.actualTarget,prevRow:r.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:h,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:s},g=this.addMovableArgs(g,l,a)):g={cancel:!1,rowIndexes:e,rowIndex:n,previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:h,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:s},this.parent.trigger("rowSelecting",this.fDataUpdate(g),function(h){if(!t.isNullOrUndefined(h)&&!0===h.cancel)return void i.disableInteracted();i.clearRow(),i.selectRowIndex(e.slice(-1)[0]);var d=function(e){if(i.updateRowSelection(r.getRowByIndex(e),e),r.isFrozenGrid()){var t=i.parent.getFrozenMode()===Pi?r.getFrozenRightRowByIndex(e):void 0;i.selectMovableRow(r.getMovableRowByIndex(e),t,e)}i.updateRowProps(n)};if(i.isSingleSel())d(n);else for(var c=0,p=e;c<p.length;c++)d(p[c]);!t.isBlazor()||i.parent.isJsComponent||i.parent.isHybrid?(h={rowIndexes:e,row:o,rowIndex:n,target:i.actualTarget,prevRow:r.getRows()[i.prevRowIndex],previousRowIndex:i.prevRowIndex,data:i.getSelectedRecords(),isInteracted:i.isInteracted,isHeaderCheckboxClicked:i.isHeaderCheckboxClicked,foreignKeyData:s},h=i.addMovableArgs(h,l,a)):h={rowIndexes:e,rowIndex:n,previousRowIndex:i.prevRowIndex,row:o,prevRow:r.getRows()[i.prevRowIndex],data:i.getSelectedRecords(),isInteracted:i.isInteracted,isHeaderCheckboxClicked:i.isHeaderCheckboxClicked,foreignKeyData:s},i.isRowSelected&&i.onActionComplete(h,"rowSelected"),i.isInteracted=!1})}},r.prototype.addRowsToSelection=function(e){var i=this.parent,r=this.target;this.isMultiSelection=!0;var n=i.getSelectedRowIndexes().concat(e),o=this.isSingleSel()?i.getRowByIndex(e[e.length-1]):i.getRowByIndex(e[0]),s=this.isSingleSel()?this.getSelectedMovableRow(e[e.length-1]):this.getSelectedMovableRow(e[0]),l=this.isSingleSel()?this.getSelectedFrozenRightRow(e[e.length-1]):this.getSelectedFrozenRightRow(e[0]);if(this.isRowType()&&!this.isEditing()||this.selectionSettings.checkboxOnly)for(var a,h=this.parent.getColumns().filter(function(e){return"checkbox"===e.type}),d=0,c=e;d<c.length;d++){var p=c[d],u=this.getRowObj(p),g=this.selectedRowIndexes.indexOf(p)>-1;if(this.selectRowIndex(p),g&&(h.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect("rowDeselecting",[p],[u.data],[o],[u.foreignKeyData],r),this.isCancelDeSelect)return;this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(p),1),this.selectedRecords.splice(this.selectedRecords.indexOf(o),1),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),o.removeAttribute("aria-selected"),this.addRemoveClassesForRow(o,!1,null,"e-selectionbackground","e-active"),s&&(this.selectedRecords.splice(this.selectedRecords.indexOf(s),1),s.removeAttribute("aria-selected"),this.addRemoveClassesForRow(s,!1,null,"e-selectionbackground","e-active")),l&&(this.selectedRecords.splice(this.selectedRecords.indexOf(l),1),l.removeAttribute("aria-selected"),this.addRemoveClassesForRow(l,!1,null,"e-selectionbackground","e-active")),this.rowDeselect("rowDeselected",[p],[u.data],[o],[u.foreignKeyData],r,[s],void 0,[l]),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1}else{f="isHybrid";if(this.activeTarget(),!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={cancel:!1,data:u.data,rowIndex:p,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={cancel:!1,data:u.data,rowIndex:p,previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.parent.trigger("rowSelecting",this.fDataUpdate(a)),!t.isNullOrUndefined(a)&&!0===a.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(o,p),this.selectMovableRow(s,l,p)}if(!g){var f="isHybrid";!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={data:u.data,rowIndex:p,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={data:u.data,rowIndex:p,previousRowIndex:this.prevRowIndex,row:o,prevRow:i.getRows()[this.prevRowIndex],foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.onActionComplete(a,"rowSelected")}if(this.isInteracted=!1,this.updateRowProps(p),this.isSingleSel())break}},r.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],r=e<=t?{i:e,max:t}:{i:t,max:e},n=r.i,o=r.max;n<=o;n++)i.push(n);return e>t&&i.reverse(),i},r.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},r.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},r.prototype.clearSelectedRow=function(e){if(this.toggle){var t=this.parent.getRowByIndex(e);this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1)}},r.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},r.prototype.updatePersistCollection=function(e,i){var r=this;if((this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0)&&!t.isNullOrUndefined(e)){this.parent.isPersistSelection||this.ensureCheckboxFieldSelection();var n=this.getRowObj(e),o=n.data?n.data[this.primaryKey]:null;if(null===o)return;n.isSelected=i,i?(this.selectedRowState[o]=i,this.persistSelectedData.some(function(e){return e[r.primaryKey]===o})||this.persistSelectedData.push(n.data)):this.updatePersistDelete(o)}},r.prototype.updatePersistDelete=function(e){var t=this;delete this.selectedRowState[e];var i;this.persistSelectedData.some(function(r,n){return i=n,r[t.primaryKey]===e})&&this.persistSelectedData.splice(i,1)},r.prototype.updateCheckBoxes=function(e,i,r){if(!t.isNullOrUndefined(e)){var n=e.querySelector(".e-checkselect");t.isNullOrUndefined(n)||(oe(n.nextElementSibling,i),re(n,i),(t.isNullOrUndefined(this.checkedTarget)||!t.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(r))}},r.prototype.updateRowSelection=function(e,t){if(e){this.selectedRowIndexes.push(t);var i=this.selectedRowIndexes.length;if(this.parent.isFrozenGrid()&&i>1&&this.selectedRowIndexes[i-2]===this.selectedRowIndexes[i-1]&&this.selectedRowIndexes.pop(),this.selectedRecords.push(e),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),!this.preventFocus){var r=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide):not(.e-detailrowcollapse):not(.e-detailrowexpand)");if(this.parent.contextMenuModule&&2===this.mouseButton&&(r=this.parent.contextMenuModule.cell),!r)return;this.focus.onClick({target:r},!0)}}},r.prototype.clearSelection=function(){if(this.checkSelectAllClicked=!0,this.selectionSettings.persistSelection&&this.persistSelectedData.length&&(this.deSelectedData=R(this.persistSelectedData)),!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!t.isNullOrUndefined(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall")){var e=this.parent.element.querySelector(".e-gridpopup").querySelector("span");e.classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.parent.isPersistSelection&&(this.persistSelectedData=[],this.selectedRowState={}),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.enableSelectMultiTouch=!1,this.isInteracted=!1,this.checkSelectAllClicked=!1}},r.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){for(var i=this.parent,r=this.parent.getDataRows(),n=[],o=[],s=[],l=[],a=[],h=[],d=this.target,c=0,p=this.selectedRowIndexes.length;c<p;c++){var u="Batch"===this.parent.editSettings.mode?this.parent.getRows()[this.selectedRowIndexes[c]]:this.parent.getDataRows()[this.selectedRowIndexes[c]],g=this.getRowObj(u);g&&(n.push(g.data),o.push(u),a.push(this.selectedRowIndexes[c]),h.push(g.foreignKeyData)),i.isFrozenGrid()&&(s.push(i.getMovableRows()[this.selectedRowIndexes[c]]),i.getFrozenMode()===Pi&&l.push(i.getFrozenRightRows()[this.selectedRowIndexes[c]]))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect("rowDeselecting",a,n,o,h,d,s,function(){if(e.isCancelDeSelect&&(e.isRowClicked||e.checkSelectAllClicked||e.isInteracted&&!e.parent.isPersistSelection)){if(e.parent.isPersistSelection)if("Intermediate"===e.getCheckAllStatus(e.parent.element.querySelector(".e-checkselectall")))for(p=0;p<e.selectedRecords.length;p++)e.updatePersistCollection(e.selectedRecords[p],!0);else e.parent.checkAllRows="Check",e.updatePersistSelectedData(!0);return void(e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1)))}for(var i=[].slice.call(r.filter(function(e){return e.hasAttribute("aria-selected")})),c=0;c<i.length;c++)e.disableUI&&!t.isBlazor()||(i[c].removeAttribute("aria-selected"),e.addRemoveClassesForRow(i[c],!1,!0,"e-selectionbackground","e-active")),e.isPrevRowSelection||e.updatePersistCollection(i[c],!1),e.updateCheckBoxes(i[c]);for(var p=0,u=e.selectedRowIndexes.length;p<u;p++){var g=e.getSelectedMovableRow(e.selectedRowIndexes[p]);g&&(e.disableUI&&!t.isBlazor()||(g.removeAttribute("aria-selected"),e.addRemoveClassesForRow(g,!1,!0,"e-selectionbackground","e-active")),e.updateCheckBoxes(g),e.isPrevRowSelection||e.updatePersistCollection(g,!1));var f=e.getSelectedFrozenRightRow(e.selectedRowIndexes[p]);f&&(e.disableUI||(f.removeAttribute("aria-selected"),e.addRemoveClassesForRow(f,!1,!0,"e-selectionbackground","e-active")),e.updateCheckBoxes(f),e.isPrevRowSelection||e.updatePersistCollection(f,!1))}e.selectedRowIndexes=[],e.selectedRecords=[],e.isRowSelected=!1,e.selectRowIndex(-1),e.isPrevRowSelection=!1,e.rowDeselect("rowDeselected",a,n,o,h,d,s,void 0,l),e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))},l)}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck&&(this.selectRowCallBack(),this.selectRowCheck=!1))},r.prototype.rowDeselect=function(e,i,r,n,o,s,l,a,h){var d=this;if(this.selectionSettings.persistSelection&&(this.isRowClicked||this.checkSelectAllClicked)||!this.selectionSettings.persistSelection){var c=1===i.length&&1===this.deSelectedData.length,p={rowIndex:i[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!c&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.deSelectedData:r,foreignKeyData:o,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked};"rowDeselected"===e&&delete p.cancel;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){p.row=n,p.target=this.actualTarget,this.actualTarget&&!t.isNullOrUndefined(t.closest(this.actualTarget,"thead"))||i.length>1?(p.rowIndex=i[0],p.rowIndexes=i):1===i.length&&(p.data=p.data[0],p.row=p.row[0],p.foreignKeyData=p.foreignKeyData[0],this.isAddRowsToSelection&&(p.rowIndexes=i))}else{p.rowIndex=p.rowIndex[p.rowIndex.length-1],p.data=p.data[p.data.length-1]}this.parent.trigger(e,t.isBlazor()&&!this.parent.isJsComponent||!this.parent.isFrozenGrid()?p:_r({},p,{mRow:l,frozenRightRow:h}),function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,i[0]),l&&d.updateCheckBoxes(l[0],void 0,i[0]),h&&d.updateCheckBoxes(h[0],void 0,i[0])),void 0!==a&&a()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},r.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),t.isNullOrUndefined(e)?{}:("number"==typeof e&&(e=this.parent.getRowByIndex(e)),e?this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}:{})},r.prototype.getSelectedMovableCell=function(e){var t=this.parent,i=t.getColumnByIndex(e.cellIndex);return t.isFrozenGrid()&&"movable"===i.getFreezeTableName()?t.getMovableCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)):null},r.prototype.selectCell=function(e,i){if(this.isCellType()){var r,n=this.parent,o=this.getSelectedMovableCell(e);o||(o=n.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex))),this.currentIndex=e.rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&o&&!this.isEditing()){var l=o.classList.contains("e-cellselectionbackground");if(i=i?!t.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&l:i)this.successCallBack(r,i,e,o,s)(r);else{if(r={data:s,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1},!t.isBlazor()||this.parent.isJsComponent){r.currentCell=o;r.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(r),this.successCallBack(r,i,e,o,s)),this.cellselected=!0}}}},r.prototype.successCallBack=function(e,i,r,n,o){var s=this;return function(e){if((t.isNullOrUndefined(e)||!0!==e.cancel)&&(i||(e.currentCell=e.currentCell?e.currentCell:n),s.clearCell(),i||s.updateCellSelection(n,r.rowIndex,r.cellIndex),!i)){var l=void 0;if(!t.isBlazor()||s.parent.isJsComponent||s.parent.isHybrid){(l={data:o,cellIndex:r,currentCell:n,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=s.prevECIdxs}else l={data:o,cellIndex:r,selectedRowCellIndex:s.selectedRowCellIndexes};s.updateCellProps(r,r),s.onActionComplete(l,"cellSelected")}}},r.prototype.getCellIndex=function(e,t){return this.parent.getFrozenColumns()&&t>=this.parent.getFrozenColumns()?this.parent.getMovableCellFromIndex(e,t):this.parent.getCellFromIndex(e,t)},r.prototype.selectCellsByRange=function(e,i){var r=this;if(this.isCellType()){var n=this.parent,o=this.getSelectedMovableCell(e),s=n.getFrozenColumns();o||(o=n.getCellFromIndex(e.rowIndex,e.cellIndex));var l,a,h,d=e,c=i=i||e;this.currentIndex=e.rowIndex;var p=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var u={data:p,cellIndex:e,currentCell:o,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){u.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(u),function(u){if(t.isNullOrUndefined(u)||!0!==u.cancel){if(r.clearCell(),e.rowIndex>i.rowIndex){var g=e;e=i,i=g}for(var f=e.rowIndex;f<=i.rowIndex;f++){r.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=f===e.rowIndex?e.cellIndex:0,a=f===i.rowIndex?i.cellIndex:r.getLastColIndex(f)):(l=e.cellIndex,a=i.cellIndex),h=[];for(var m=l<a?l:a,y=l>a?l:a;m<=y;m++)(o=s?m<s?n.getCellFromIndex(f,m):n.getMovableCellFromIndex(f,m):n.getCellFromIndex(f,m))&&(h.push(m),r.updateCellSelection(o),r.addAttribute(o));r.selectedRowCellIndexes.push({rowIndex:f,cellIndexes:h})}var v;if(!t.isBlazor()||r.parent.isJsComponent||r.parent.isHybrid){(v={data:p,cellIndex:c,currentCell:n.getCellFromIndex(c.rowIndex,c.cellIndex),selectedRowCellIndex:r.selectedRowCellIndexes,previousRowCell:r.prevECIdxs?r.getCellIndex(r.prevECIdxs.rowIndex,r.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=r.prevECIdxs}else v={data:p,cellIndex:c,selectedRowCellIndex:r.selectedRowCellIndexes};r.isDragged||(r.onActionComplete(v,"cellSelected"),r.cellselected=!0),r.updateCellProps(d,c)}})}}},r.prototype.selectCells=function(e){if(this.isCellType()){var i=this.parent,r=this.getSelectedMovableCell(e[0]),n=i.getFrozenColumns();r||(r=i.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0])),this.currentIndex=e[0].rowIndex;var o=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var s;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(s={data:o,cellIndex:e[0].cellIndexes[0],currentCell:r,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[p="previousRowCellIndex"]=this.prevECIdxs:s={data:o,cellIndex:e[0].cellIndexes[0],isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest},this.onActionBegin(s,"cellSelecting");for(var l=0,a=e.length;l<a;l++)for(var h=0,d=e[l].cellIndexes.length;h<d;h++)(r=n?e[l].cellIndexes[h]<n?i.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]):i.getMovableCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]):i.getCellFromIndex(e[l].rowIndex,e[l].cellIndexes[h]))&&(this.updateCellSelection(r),this.addAttribute(r),this.addRowCellIndex({rowIndex:e[l].rowIndex,cellIndex:e[l].cellIndexes[h]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});var c;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){var p="previousRowCellIndex";(c={data:o,cellIndex:e[0].cellIndexes[0],currentCell:r,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[p]=this.prevECIdxs}else c={data:o,cellIndex:e[0].cellIndexes[0],selectedRowCellIndex:this.selectedRowCellIndexes};this.onActionComplete(c,"cellSelected")}}},r.prototype.addCellsToSelection=function(e){if(this.isCellType()){var i,r,n=this.parent;this.currentIndex=e[0].rowIndex;var o=this.getCurrentBatchRecordChanges()[this.currentIndex],s=n.getFrozenLeftCount(),l=n.getMovableColumnsCount();if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill();var a,h=n.getColumnByIndex(e[0].cellIndex);Be(this.parent,function(t,i){a=i[e[0].rowIndex]},[h.getFreezeTableName()&&h.getFreezeTableName()!==Li?[]:n.getRowsObject(),"movable"===h.getFreezeTableName()?n.getMovableRowsObject():[],h.getFreezeTableName()===Ni?n.getFrozenRightRowsObject():[]]);for(var d=[],c=0,p=e;c<p.length;c++){for(var u=p[c],g=0,f=this.selectedRowCellIndexes.length;g<f;g++)if(this.selectedRowCellIndexes[g].rowIndex===u.rowIndex){r=g;break}(i=this.getSelectedMovableCell(u))||(i=n.getCellFromIndex(u.rowIndex,this.getColIndex(u.rowIndex,u.cellIndex)));var m="movable"===h.getFreezeTableName()?u.cellIndex-s:h.getFreezeTableName()===Ni?u.cellIndex-(s+l):u.cellIndex;d.push(a.cells[m].foreignKeyData);var y=void 0;!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(y={cancel:!1,data:o,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?n.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0})[b="previousRowCellIndex"]=this.prevECIdxs:y={cancel:!1,data:o,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,isCtrlPressed:this.isMultiCtrlRequest};var v=r>-1;if(v){var C=this.selectedRowCellIndexes[r].cellIndexes;C.indexOf(u.cellIndex)>-1?(this.cellDeselect("cellDeselecting",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d),C.splice(C.indexOf(u.cellIndex),1),0===C.length&&this.selectedRowCellIndexes.splice(r,1),i.classList.remove("e-cellselectionbackground"),i.removeAttribute("aria-selected"),this.cellDeselect("cellDeselected",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d)):(v=!1,this.onActionBegin(y,"cellSelecting"),this.addRowCellIndex({rowIndex:u.rowIndex,cellIndex:u.cellIndex}),this.updateCellSelection(i),this.addAttribute(i))}else{if(this.onActionBegin(y,"cellSelecting"),!t.isNullOrUndefined(y)&&!0===y.cancel)return;this.updateCellSelection(i,u.rowIndex,u.cellIndex)}if(!v){var w=void 0;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){var b="previousRowCellIndex";(w={data:o,cellIndex:e[0],currentCell:i,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes})[b]=this.prevECIdxs}else w={data:o,cellIndex:e[0],selectedRowCellIndex:this.selectedRowCellIndexes};this.onActionComplete(w,"cellSelected"),this.cellselected=!0}this.updateCellProps(u,u)}}}},r.prototype.getColIndex=function(e,t){var i=this.parent.isFrozenGrid(),r=this.parent.getColumnByIndex(t),n=qe(this.parent,r,e);if(n)for(var o=0;o<n.length;o++)if(parseInt(n[o].getAttribute(qi),10)===t)return i&&("movable"===r.getFreezeTableName()?o+=this.parent.getFrozenLeftCount():r.getFreezeTableName()===Ni&&(o+=this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount())),o;return-1},r.prototype.getLastColIndex=function(e){var t=this.parent.getFrozenColumns()?this.parent.getMovableDataRows()[e].querySelectorAll("td.e-rowcell"):this.parent.getDataRows()[e].querySelectorAll("td.e-rowcell");return parseInt(t[t.length-1].getAttribute(qi),10)},r.prototype.clearCell=function(){this.clearCellSelection()},r.prototype.cellDeselect=function(e,i,r,n,o){n[0]&&n[0].classList.contains(ki)&&this.updateCheckBoxes(t.closest(n[0],"tr"));var s={cells:n,data:r,cellIndexes:i,foreignKeyData:o,cancel:!1};this.parent.trigger(e,s),this.isPreventCellSelect=s.cancel},r.prototype.updateCellSelection=function(e,i,r){t.isNullOrUndefined(i)||this.addRowCellIndex({rowIndex:i,cellIndex:r}),e.classList.add("e-cellselectionbackground"),e.classList.contains(ki)&&this.updateCheckBoxes(t.closest(e,"tr"),!0),this.addAttribute(e)},r.prototype.addAttribute=function(e){this.target=e,t.isNullOrUndefined(e)||(e.setAttribute("aria-selected","true"),this.preventFocus||this.focus.onClick({target:e},!0))},r.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},r.prototype.addRowCellIndex=function(e){for(var t,i,r=0,n=this.selectedRowCellIndexes.length;r<n;r++)if(this.selectedRowCellIndexes[r].rowIndex===e.rowIndex){t=!0,i=r;break}t?this.selectedRowCellIndexes[i].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[i].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},r.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,r=[],n=[],o=[],s=this.getCurrentBatchRecordChanges(),l=e.isFrozenGrid();this.hideAutoFill();for(var a=0,h=i.length;a<h;a++){r.push(s[i[a].rowIndex]);for(var d=this.getRowObj(i[a].rowIndex),c=0,p=i[a].cellIndexes.length;c<p;c++)if(l){var u=e.getColumnByIndex(i[a].cellIndexes[c]);n.push(He(this.parent,u,i[a].rowIndex,i[a].cellIndexes[c]))}else d.cells&&o.push(d.cells[i[a].cellIndexes[c]].foreignKeyData),n.push(e.getCellFromIndex(i[a].rowIndex,i[a].cellIndexes[c]))}if(this.cellDeselect("cellDeselecting",i,r,n,o),!0===this.isPreventCellSelect)return;for(var a=0,h=t.length;a<h;a++)t[a].classList.remove("e-cellselectionbackground"),t[a].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect("cellDeselected",i,r,n,o)}},r.prototype.getSelectedCellsElement=function(){var e,t=this.parent,i=t.getDataRows();t.isFrozenGrid()&&(e=t.getMovableDataRows(),i=t.addMovableRows(i,e),t.getFrozenMode()===Pi&&(i=t.addMovableRows(i,t.getFrozenRightDataRows())));for(var r=[],n=0,o=i.length;n<o;n++)r=r.concat([].slice.call(i[n].getElementsByClassName("e-cellselectionbackground")));return r},r.prototype.mouseMoveHandler=function(e){e.preventDefault();var i,r=this.parent.element.getBoundingClientRect(),n=this.x,o=this.y,s=N(e),l=s.x-r.left,a=s.y-r.top,h=t.closest(e.target,"tr");if(this.isDragged=!0,this.isCellDrag||(h||(h=t.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr")),n>l&&(i=l,l=n,n=i),o>a&&(i=a,a=o,o=i),this.element.style.left=n+"px",this.element.style.top=o+"px",this.element.style.width=l-n+"px",this.element.style.height=a-o+"px"),h&&!e.ctrlKey&&!e.shiftKey){var d=parseInt(h.getAttribute(Hi),10);if(this.isCellDrag){var c=O(e.target,bi);c&&(this.startAFCell=this.startCell,this.endAFCell=O(e.target,bi),this.selectLikeExcel(e,d,parseInt(c.getAttribute(qi),10)))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,d)}},r.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},r.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders()):this.showHideBorders("none")},r.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},r.prototype.isLastRow=function(e){var i=[].slice.call(t.closest(e,Ui).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[i.length-1]},r.prototype.isFirstRow=function(e){var i=[].slice.call(t.closest(e,Ui).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[0]},r.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},r.prototype.setBorders=function(e,t,i){var r=[].slice.call(e.getElementsByClassName("e-cellselectionbackground")).filter(function(e){return""===e.style.display});if(r.length){var n=this.parent.isFrozenGrid(),o=r[0],s=r[r.length-1],l=o.getBoundingClientRect(),a=s.getBoundingClientRect(),h=o.offsetParent.getBoundingClientRect(),d=!this.isLastRow(s)||"1"!==i&&"2"!==i&&"5"!==i?0:2,c=this.parent.frozenRows&&("1"===i||"2"===i)&&this.isFirstRow(o)?1.5:0,p=n&&("2"===i||"4"===i)&&this.isFirstCell(o)?1:0,u=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&(this.parent.getFrozenMode()!==Pi||"5"!==i&&"6"!==i)||!this.isFirstCell(o)?0:1;this.parent.enableRtl?(t.style.right=h.right-l.right-p+"px",t.style.width=l.right-a.left+p+1+"px"):(t.style.left=l.left-h.left-p-u+"px",t.style.width=a.right-l.left+p-u+1+"px"),t.style.top=l.top-h.top-c+"px",t.style.height=a.top-l.top>0?a.top-h.top+a.height+1-(l.top-h.top)-d+c+"px":a.height+c-d+1+"px",this.selectDirection+=i}else t.style.display="none"},r.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.contentModule.getMovableContent(),this.mcBdrElement,"2"),this.parent.getFrozenMode()===Pi&&this.setBorders(this.parent.contentModule.getFrozenRightContent(),this.frcBdrElement,"5")),this.parent.frozenRows&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.headerModule.getMovableHeader(),this.mhBdrElement,"4"),this.parent.getFrozenMode()===Pi&&this.setBorders(this.parent.headerModule.getFrozenRightHeader(),this.frhBdrElement,"6"))),this.applyBorders(this.selectDirection))},r.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=this.bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=this.top,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right;break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 3:this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mcBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mhBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom);break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=this.top_right_left)),e.includes("2")&&(this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows&&(this.mhBdrElement.style.borderWidth=this.top_right_left)),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.bdrElement.style.borderWidth=this.right_bottom_left),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.mcBdrElement.style.borderWidth=this.right_bottom_left),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.parent.frozenRows&&(this.frhBdrElement.style.borderWidth=this.top_right_left)),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=this.right_bottom_left);break;default:this.bdrElement.style.borderWidth=this.all_border,this.mcBdrElement.style.borderWidth=this.all_border,this.frcBdrElement.style.borderWidth=this.all_border,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=this.all_border,this.mhBdrElement.style.borderWidth=this.all_border,this.frhBdrElement.style.borderWidth=this.all_border)}},r.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if(this.parent.getFrozenMode()===Pi)this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.fhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left):(this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left,this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom,this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left)):(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom)));break;default:this.bdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=this.all_border),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=this.all_border))}},r.prototype.createBorders=function(){this.bdrElement||(this.bdrElement=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr",styles:"width: 2px; border-width: 0;"})),this.parent.isFrozenGrid()&&(this.mcBdrElement=this.parent.contentModule.getMovableContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr",styles:"height: 2px; border-width: 0;"})),this.parent.getFrozenMode()===Pi&&(this.frcBdrElement=this.parent.contentModule.getFrozenRightContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr",styles:"height: 2px; border-width: 0;"})))),this.parent.frozenRows&&(this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr",styles:"height: 2px;"}))),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement=this.parent.headerModule.getMovableHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr",styles:"height: 2px;"})),this.parent.getFrozenMode()===Pi&&(this.frhBdrElement=this.parent.headerModule.getFrozenRightHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr",styles:"height: 2px;"})))))},r.prototype.showHideBorders=function(e){this.bdrElement&&(this.bdrElement.style.display=e,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.display=e,this.parent.getFrozenMode()===Pi&&(this.frcBdrElement.style.display=e)),this.parent.frozenRows&&(this.fhBdrElement.style.display=e),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement.style.display=e,this.parent.getFrozenMode()===Pi&&(this.frhBdrElement.style.display=e)))},r.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},r.prototype.positionAFBorders=function(){if(this.startCell&&this.bdrAFLeft){var e=this.startAFCell.getBoundingClientRect(),t=this.endAFCell.getBoundingClientRect(),i=t.top-e.top>0?1:0,r=t.top-e.top>=0&&(O(this.startAFCell,Ei)||O(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,n=(O(this.startAFCell,Ei)||O(this.startAFCell,Ii))&&this.isFirstCell(this.startAFCell)?1:0,o=this.isLastRow(this.endAFCell)&&(O(this.endAFCell,Ei)||O(this.endAFCell,"e-frozencontent"))?2:0,s=this.startAFCell.offsetParent.getBoundingClientRect(),l=this.parent.element.getBoundingClientRect(),a=this.startAFCell.offsetParent.parentElement.scrollTop,h=this.startAFCell.offsetParent.parentElement.scrollLeft,d=a-this.startAFCell.offsetTop,c=h-this.startAFCell.offsetLeft,p=this.parent.element.clientHeight,u=this.parent.element.clientWidth;d=d>0?Math.floor(d)-1:0,c=c>0?c:0;var g=e.left-l.left;if(this.parent.enableRtl){var f=O(this.startAFCell,Ei)||O(this.startAFCell,Ii)?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-l.left:0;this.bdrAFLeft.style.right=l.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=u<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px",this.bdrAFRight.style.right=l.right-e.right-n+f-1+"px",this.bdrAFTop.style.left=t.left-l.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-n+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px",this.bdrAFTop.style.left="0px")}else if(this.bdrAFLeft.style.left=g-n+c-1+"px",this.bdrAFRight.style.left=t.left-l.left-2+t.width+"px",this.bdrAFRight.style.width=u<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=g+c-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-n+1+"px",u<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)){var m=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-u;this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-m+"px"}if(this.bdrAFLeft.style.top=e.top-l.top-r+d+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-s.top+t.height+1-(e.top-s.top)+r-o-d+"px":t.height+r-o-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=p<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,p<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)){var y=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-p;this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-y+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px"}}},r.prototype.createAFBorders=function(){this.bdrAFLeft||(this.bdrAFLeft=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft",styles:"width: 2px;"})),this.bdrAFRight=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright",styles:"width: 2px;"})),this.bdrAFBottom=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom",styles:"height: 2px;"})),this.bdrAFTop=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop",styles:"height: 2px;"})))},r.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},r.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},r.prototype.updateValue=function(e,t,i){var r=this.createBeforeAutoFill(e,t,i);if(!r.cancel){var n=this.parent.getColumnByIndex(t);this.parent.editModule&&i&&("number"===n.type?this.parent.editModule.updateCell(e,n.field,parseInt(r.value,10)):this.parent.editModule.updateCell(e,n.field,r.value))}},r.prototype.createBeforeAutoFill=function(e,t,i){var r={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger("beforeAutoFill",r),r},r.prototype.getAutoFillCells=function(e,t){var i=".e-cellselectionbackground",r=[].slice.call(this.parent.getDataRows()[e].querySelectorAll(i));return this.parent.isFrozenGrid()&&(r=r.concat([].slice.call(this.parent.getMovableDataRows()[e].querySelectorAll(i))),this.parent.getFrozenMode()===Pi&&(r=r.concat([].slice.call(this.parent.getFrozenRightDataRows()[e].querySelectorAll(i))))),r},r.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(O(this.startAFCell,Oi).getAttribute(Hi),10),r=parseInt(this.startAFCell.getAttribute(qi),10),n=parseInt(O(this.endAFCell,Oi).getAttribute(Hi),10),o=parseInt(this.endAFCell.getAttribute(qi),10),s=this.selectedRowCellIndexes.length-1,l=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!O(e.target,bi):this.startAFCell=this.parent.getCellFromIndex(i,r),this.endAFCell=this.parent.getCellFromIndex(i+s,r+l),this.drawAFBorders();break;case this.autoFillRLselection&&r+l<o&&o-r-l+1>n-i-s&&o-r-l+1>i-n:if(this.endAFCell=this.parent.getCellFromIndex(i+s,o),n=parseInt(O(this.endAFCell,Oi).getAttribute(Hi),10),o=parseInt(this.endAFCell.getAttribute(qi),10),t){for(var a=parseInt(this.endCell.getAttribute(qi),10),h=i;h<=n;h++)for(var d=this.getAutoFillCells(h,r),c=0,p=a+1;p<=o;p++)c>l&&(c=0),this.updateValue(h,p,d[c]),c++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:n,cellIndex:o})}else this.drawAFBorders();break;case this.autoFillRLselection&&r>o&&r-o+1>n-i-s&&r-o+1>i-n:if(this.startAFCell=this.parent.getCellFromIndex(i,o),this.endAFCell=this.endCell,t){for(h=i;h<=i+s;h++){(d=this.getAutoFillCells(h,r)).reverse();for(var c=0,p=this.startCellIndex-1;p>=o;p--)c>l&&(c=0),this.updateValue(h,p,d[c]),c++}this.selectCellsByRange({rowIndex:i,cellIndex:o},{rowIndex:i+s,cellIndex:this.startCellIndex+l})}else this.drawAFBorders();break;case i>n:if(this.startAFCell=this.parent.getCellFromIndex(n,r),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute(Hi),10),h=i-1;h>=n;h--){u===this.startIndex-1&&(u=g);var d=this.getAutoFillCells(u,r),c=0;u--;for(p=this.startCellIndex;p<=this.startCellIndex+l;p++)this.updateValue(h,p,d[c]),c++}this.selectCellsByRange({rowIndex:n,cellIndex:r+l},{rowIndex:i+s,cellIndex:r})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(n,r+l),t){for(var g=parseInt(this.endCell.parentElement.getAttribute(Hi),10),u=this.startIndex,h=g+1;h<=n;h++){u===g+1&&(u=this.startIndex);d=this.getAutoFillCells(u,r);u++;for(var c=0,f=this.startCellIndex;f<=this.startCellIndex+l;f++)this.updateValue(h,f,d[c]),c++}this.selectCellsByRange({rowIndex:g-s,cellIndex:r},{rowIndex:n,cellIndex:r+l})}else this.drawAFBorders()}},r.prototype.mouseUpHandler=function(e){if(document.body.classList.remove("e-disableuserselect"),this.element&&t.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=O(e.target,bi):this.mUPTarget=null,this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode){var i=e.target,r=parseInt(i.parentElement.getAttribute(Hi),10),n=parseInt(i.getAttribute(qi),10);this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:r,cellIndex:n})}if(this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel){var o=O(e.target,bi);this.endAFCell=o||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.isAutoFillSel=!1}t.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),this.parent.frozenRows&&t.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},r.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},r.prototype.updateAutoFillPosition=function(){if(this.parent.enableAutoFill&&!this.parent.isEdit&&this.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length){var e=parseInt(this.target.getAttribute(qi),10),i=parseInt(this.target.getAttribute("index"),10),r=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,n=this.getAutoFillCells(r,e).filter(function(e){return""===e.style.display}),o=this.parent.getColumnByIndex(e),s="movable"===o.getFreezeTableName(),l=i<this.parent.frozenRows,a=this.parent.getFrozenMode()===Pi&&o.getFreezeTableName()===Ni;t.select("#"+this.parent.element.id+"_autofill",O(this.target,Mi))||(t.select("#"+this.parent.element.id+"_autofill",this.parent.element)&&t.select("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=t.createElement("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"}),this.autofill.style.display="none",l?s?this.parent.headerModule.getMovableHeader().appendChild(this.autofill):this.parent.getHeaderTable().parentElement.appendChild(this.autofill):s?this.parent.contentModule.getMovableContent().appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill),a&&(l?this.parent.getFrozenRightHeader().appendChild(this.autofill):this.parent.getFrozenRightContent().appendChild(this.autofill)));var h=n[n.length-1];if(h&&h.offsetParent){var d=h.getBoundingClientRect(),c=h.offsetParent.getBoundingClientRect(),p=this.isLastCell(h)?4:0,u=this.isLastRow(h)?3:0;this.parent.enableRtl?this.autofill.style.right=c.right-d.right+d.width-4-p+"px":this.autofill.style.left=d.left-c.left+d.width-4-p+"px",this.autofill.style.top=d.top-c.top+d.height-5-u+"px"}this.autofill.style.display=""}else this.hideAutoFill()},r.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var i,r=e.target,n=this.parent,o=O(r,"e-grid");if(!(o&&o.id!==n.element.id||O(r,Fi)&&!this.parent.frozenRows||O(r,"e-editedbatchcell")||O(r,Ai))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),O(r,bi)&&!e.shiftKey&&!e.ctrlKey){if(n.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,i=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(!this.isRowType()||this.isSingleSel()||t.closest(r,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);i=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}i&&this.enableDrag(e,!0)}this.updateStartEndCells(),(r.classList.contains("e-autofill")||r.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},r.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(Hi),10),this.startCellIndex=parseInt(O(this.startCell,bi).getAttribute(qi),10))},r.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(Hi),10),this.startCellIndex=parseInt(O(this.startCell,bi).getAttribute(qi),10))},r.prototype.enableDrag=function(e,i){var r=this.parent;if(i){var n=t.closest(e.target,"tr");this.startDIndex=parseInt(n.getAttribute(Hi),10),this.startDCellIndex=parseInt(O(e.target,bi).getAttribute(qi),10)}document.body.classList.add("e-disableuserselect");var o=r.element.getBoundingClientRect(),s=N(e);this.x=s.x-o.left,this.y=s.y-o.top,t.EventHandler.add(r.getContent(),"mousemove",this.mouseMoveHandler,this),this.parent.frozenRows&&t.EventHandler.add(r.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},r.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection()},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Bt,handler:this.enableAfterRender},{event:Ot,handler:this.initializeSelection},{event:"rowselected",handler:this.onActionComplete},{event:"cellselected",handler:this.onActionComplete},{event:Nt,handler:this.onPropertyChanged},{event:"cellfocused",handler:this.onCellFocused},{event:"beforeFragAppend",handler:this.clearSelAfterRefresh},{event:Kt,handler:this.columnPositionChanged},{event:At,handler:this.initialEnd},{event:Xt,handler:this.rowsRemoved},{event:Ht,handler:this.refreshHeader}],Xe(this.parent,this.evtHandlers,!0,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(bt,this.actionBeginFunction),this.parent.addEventListener(St,this.actionCompleteFunction),this.addEventListener_checkbox())},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(Xe(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(bt,this.actionBeginFunction),this.parent.removeEventListener(St,this.actionCompleteFunction),this.removeEventListener_checkbox())},r.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS&&(t.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this))},r.prototype.unWireEvents=function(){this.isMacOS&&(t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler))},r.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},r.prototype.refreshHeader=function(){this.setCheckAllState()},r.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)delete this.selectedRowState[e.records[t][this.primaryKey]],--this.totalRecordsCount;this.setCheckAllState()},r.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},r.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},r.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},r.prototype.render=function(e){t.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},r.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){var i=this.parent;t.isNullOrUndefined(e.properties.type)||"Single"!==this.selectionSettings.type||(this.selectedRowCellIndexes.length>1&&(this.clearCellSelection(),this.prevCIdxs=void 0),this.selectedRowIndexes.length>1&&(this.clearRowSelection(),this.prevRowIndex=void 0),this.selectedColumnsIndexes.length>1&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()),t.isNullOrUndefined(e.properties.mode)&&t.isNullOrUndefined(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(i.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},r.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},r.prototype.initialEnd=function(e){var t=this.parent.isFrozenGrid(),i=this.parent.getFrozenMode()===Pi;(!t||t&&!i&&!e.args.isFrozen||i&&e.args.renderFrozenRightContent)&&(this.parent.off(At,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},r.prototype.checkBoxSelectionChanged=function(){var e=this.parent;e.off(At,this.checkBoxSelectionChanged);var i=e.getColumns().filter(function(e){return"checkbox"===e.type});i.length>0&&(e.isCheckBoxSelection=!0,this.chkField=i[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,t.isNullOrUndefined(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},r.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},r.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;if(this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)){var t=this.parent.getDataModule(),r=(new i.Query).where(this.chkField,"equal",!0);r.params||(r.params=this.parent.query.params);var n=t.getData({},r),o=this;this.parent.showSpinner(),n.then(function(e){o.dataSuccess(e.result),o.refreshPersistSelection(),o.parent.hideSpinner()})}},r.prototype.dataSuccess=function(e){for(var i=0;i<e.length;i++)t.isNullOrUndefined(this.selectedRowState[e[i][this.primaryKey]])&&e[i][this.chkField]&&(this.selectedRowState[e[i][this.primaryKey]]=e[i][this.chkField]);this.persistSelectedData=e},r.prototype.setRowSelection=function(e){if(!this.parent.getDataModule().isRemote()&&!t.isBlazor())if(e)if(this.parent.groupSettings.columns.length)for(var i=0,r=this.getData().records;i<r.length;i++){s=r[i];this.selectedRowState[s[this.primaryKey]]=!0}else for(var n=0,o=this.getData();n<o.length;n++){var s=o[n];this.selectedRowState[s[this.primaryKey]]=!0}else this.selectedRowState={}},r.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},r.prototype.refreshPersistSelection=function(){var e=this.parent.getRows();if(this.parent.isCheckBoxSelection&&this.parent.isFrozenGrid()&&(this.parent.getMovableContentTbody().querySelector(".e-checkselect")&&(e=this.parent.getMovableRows()),this.parent.getFrozenMode()===Pi&&this.parent.getFrozenRightContentTbody().querySelector(".e-checkselect")&&(e=this.parent.getFrozenRightRows())),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),null!==e&&e.length>0&&(this.parent.isPersistSelection||this.chkField)){for(var i=[],r=0;r<e.length;r++){var n=this.getRowObj(e[r]),o=n&&n.data?n.data[this.primaryKey]:null;if(null===o)return;var s=void 0,l=e[r].querySelector(".e-checkselect");this.selectedRowState[o]||"Check"===this.parent.checkAllRows&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(o)<0||"Uncheck"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(o)>0||"Intermediate"===this.parent.checkAllRows&&!t.isNullOrUndefined(this.chkField)&&n.data[this.chkField]?(i.push(parseInt(e[r].getAttribute(Hi),10)),s=!0):(s=!1,this.checkedTarget!==l&&this.parent.isCheckBoxSelection&&oe(l.nextElementSibling,s)),this.updatePersistCollection(e[r],s)}this.isSingleSel()&&i.length>0?this.selectRow(i[0],!0):this.selectRows(i)}this.parent.isCheckBoxSelection&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},r.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var i=this.parent.element.querySelector(".e-edit-checkselect");if(!t.isNullOrUndefined(i)){var r=t.closest(i,"."+Ai);if(r){"Dialog"===this.parent.editSettings.mode&&(r=this.parent.element.querySelector(".e-dlgeditrow"));var n=this.getRowObj(r);if(!n)return;this.selectedRowState[n.data[this.primaryKey]]=n.isSelected=i.checked}else this.isCheckedOnAdd=i.checked}}},r.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){if("add"===e.action&&this.isCheckedOnAdd){var i=this.parent.getRowObjectFromUID(this.parent.getRows()[e.selectedRow].getAttribute("data-uid"));this.selectedRowState[i.data[this.primaryKey]]=i.isSelected=this.isCheckedOnAdd}this.refreshPersistSelection()}if("delete"===e.requestType&&this.parent.isPersistSelection){for(var r=e.data.slice(),n=0;n<r.length;n++)t.isNullOrUndefined(r[n][this.primaryKey])||this.updatePersistDelete(r[n][this.primaryKey]);this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}"paging"===e.requestType&&(this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0)},r.prototype.onDataBound=function(){if(!this.parent.enableVirtualization&&this.parent.isPersistSelection&&(this.selectedRecords.length&&(this.isPrevRowSelection=!0),this.refreshPersistSelection()),this.parent.enableVirtualization&&this.setCheckAllState(),this.initialRowSelection=!!(this.isRowType()&&this.parent.element.querySelectorAll(".e-selectionbackground")&&this.parent.getSelectedRows().length),this.parent.isCheckBoxSelection&&!this.initialRowSelection){for(var e=this.parent.getRowsObject(),t=[],i=0;i<e.length;i++)e[i].isSelected&&t.push(i);t.length&&this.selectRows(t),this.initialRowSelection=!0}},r.prototype.updatePersistSelectedData=function(e){if(this.parent.isPersistSelection){for(var i=this.parent.getRows(),r=0;r<i.length;r++)this.updatePersistCollection(i[r],e);"Uncheck"===this.parent.checkAllRows?(this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()?this.persistSelectedData:[]):"Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||t.isBlazor()?this.persistSelectedData:this.parent.groupSettings.columns.length?this.getData().records.slice():this.getData().slice())}},r.prototype.checkSelectAllAction=function(e){var i=this.getRenderer(),r=this.parent.element.querySelector(".e-gridform");if(this.checkedTarget=this.getCheckAllBox(),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(i.getVirtualRowIndex(0),i.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1))):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],!t.isNullOrUndefined(r)){var n=r.querySelector(".e-edit-checkselect");t.isNullOrUndefined(n)||oe(n.nextElementSibling,e)}},r.prototype.checkSelectAll=function(e){var t=this,i=this.getCheckAllStatus(e),r="Check"===i;this.isHeaderCheckboxClicked=!0,"Intermediate"===i&&(r=this.getCurrentBatchRecordChanges().some(function(e){return e[t.primaryKey]in t.selectedRowState})),this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!r),this.target=null,this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState(),this.triggerChkChangeEvent(e,!r)},r.prototype.getCheckAllStatus=function(e){var t=e?e.nextElementSibling.classList:this.getCheckAllBox().nextElementSibling.classList;return t.contains("e-check")?"Check":t.contains("e-uncheck")?"Uncheck":t.contains("e-stop")?"Intermediate":"None"},r.prototype.checkSelect=function(e){var i=t.closest(this.checkedTarget,"."+bi),r=this.parent;this.isMultiCtrlRequest=!0;var n=0;if(this.isHeaderCheckboxClicked=!1,ce(r)){var o=i.parentElement.getAttribute("data-uid");n=r.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(o)}else n=parseInt(i.parentElement.getAttribute(Hi),10);this.parent.isPersistSelection&&this.parent.element.getElementsByClassName(Bi).length>0&&"Top"===this.parent.editSettings.newRowPosition&&++n,this.rowCellSelectionHandler(n,parseInt(i.getAttribute(qi),10)),this.moveIntoUncheckCollection(t.closest(i,"."+Oi)),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},r.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),i=t&&t.data?t.data[this.primaryKey]:null;if(!i)return;this.chkAllCollec.indexOf(i)<0?this.chkAllCollec.push(i):this.chkAllCollec.splice(this.chkAllCollec.indexOf(i),1)}},r.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger("checkBoxChange",{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},r.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.getDataModule().isRemote()&&(!t.isBlazor()||!this.parent.isServerRendered))if("Check"===this.parent.checkAllRows){this.selectedRowIndexes=[];for(var i=this.getData().length,r=0;r<i;r++)this.selectedRowIndexes.push(r)}else if("Uncheck"===this.parent.checkAllRows)this.selectedRowIndexes=[];else{var n=this.parent.getRowByIndex(e);if(e&&n&&"false"===n.getAttribute("aria-selected")){var o=this.selectedRowIndexes.indexOf(e);this.selectedRowIndexes.splice(o,1)}}},r.prototype.setCheckAllState=function(e,i){if(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode){var r=Object.keys(this.selectedRowState).length;this.parent.isPersistSelection||(r=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length);var n=this.getCheckAllBox();if(n){var o=n.nextElementSibling;t.removeClass([o],["e-check","e-stop","e-uncheck"]),re(n,!1),n.indeterminate=!1,r===this.totalRecordsCount&&this.totalRecordsCount||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&!this.parent.getDataModule().isRemote()&&(!t.isBlazor()||!this.parent.isServerRendered)&&this.getData().length&&r===this.getData().length?(t.addClass([o],["e-check"]),re(n,!0),i&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):!this.selectedRowIndexes.length||0===r&&0===this.getCurrentBatchRecordChanges().length?(t.addClass([o],["e-uncheck"]),i&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck",0===r&&0===this.getCurrentBatchRecordChanges().length?t.addClass([o.parentElement],["e-checkbox-disabled"]):t.removeClass([o.parentElement],["e-checkbox-disabled"])):(t.addClass([o],["e-stop"]),this.parent.checkAllRows="Intermediate",n.indeterminate=!0),!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||this.updateSelectedRowIndex(e)}}},r.prototype.keyDownHandler=function(e){(("chrome"===t.Browser.info.name||"safari"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!0)},r.prototype.keyUpHandler=function(e){(("chrome"===t.Browser.info.name||"safari"===t.Browser.info.name)&&(91===e.keyCode||93===e.keyCode)||"opera"===t.Browser.info.name&&17===e.keyCode||"mozilla"===t.Browser.info.name&&224===e.keyCode)&&(this.cmdKeyPressed=!1)},r.prototype.clickHandler=function(e){var i=e.target;this.actualTarget=i,this.selectionSettings.persistSelection&&(this.deSelectedData=R(this.persistSelectedData)),(O(i,Oi)||O(i,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&i.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.isMultiShiftRequest=e.shiftKey,this.popUpClickHandler(e);var r=!1;this.preventFocus=!0;var n,o=O(i,"e-checkbox-wrapper");if(this.checkSelectAllClicked=!!(o&&o.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&O(i,Oi)),o&&o.querySelectorAll(".e-checkselect,.e-checkselectall").length>0&&(n=o.querySelector('input[type="checkbox"]'),r=!0),this.drawBorders(),this.updateAutoFillPosition(),(i=O(i,bi))&&i.parentElement.classList.contains(Oi)&&!this.parent.selectionSettings.checkboxOnly||r){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,t.isNullOrUndefined(n)){var s=this.parent,l=0;if(ce(s)){a=i.parentElement.getAttribute("data-uid");l=s.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(a)}else l=parseInt(i.parentElement.getAttribute(Hi),10);this.parent.isPersistSelection&&this.parent.element.getElementsByClassName(Bi).length>0&&++l,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(l,parseInt(i.getAttribute(qi),10)),this.parent.hoverFrozenRows(e),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(t.closest(i,"."+Oi)),this.setCheckAllState())}else this.checkedTarget=n,n.classList.contains("e-checkselectall")?this.checkSelectAll(n):this.checkSelect(n);this.parent.isCheckBoxSelection||!t.Browser.isDevice||this.isSingleSel()||this.showPopup(e)}else if(e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")){var a=e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");this.headerSelectionHandler(this.parent.getColumnIndexByUid(a))}this.isMultiCtrlRequest=!1,this.isMultiShiftRequest=!1,t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},r.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains(bi)||t.closest(i,".e-gridpopup")?i.classList.contains("e-rowselect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},r.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||z(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>(this.parent.getFrozenColumns()?2:1)||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},r.prototype.rowCellSelectionHandler=function(e,i){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?(this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:i},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders()):this.isMultiShiftRequest?(this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!t.closest(this.target,"."+bi).classList.contains(ki)?this.selectRowsByRange(t.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(t.isUndefined(this.prevCIdxs)?{rowIndex:e,cellIndex:i}:this.prevCIdxs,{rowIndex:e,cellIndex:i}),this.updateAutoFillPosition(),this.drawBorders()):(this.addRowsToSelection([e]),this.addCellsToSelection([{rowIndex:e,cellIndex:i}]),this.showHideBorders("none")),this.isDragged=!1},r.prototype.onCellFocused=function(e){if(this.parent.frozenRows&&e.container.isHeader&&e.byKey)if("upArrow"===e.keyArgs.action)this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName;else if("downArrow"===e.keyArgs.action){var i=Number(e.element.parentElement.getAttribute(Hi));e.isJump=0===i}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var r=this.parent.isFrozenGrid()?(e.container.isHeader&&"TD"!==e.element.tagName&&e.isJump&&!this.selectionSettings.allowColumnSelection||(e.container.isContent||"TD"===e.element.tagName)&&!(e.container.isSelectable||"TD"===e.element.tagName))&&!(e.byKey&&"space"===e.keyArgs.action):(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),n=e.container.isHeader&&"TD"!==e.element.tagName&&!t.closest(e.element,"."+bi)&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||r)return void(r&&!this.parent.isCheckBoxSelection&&this.clearSelection());var o=e.container.isContent?e.container.indexes:e.indexes,s=o[0],l=o[1],a=this.focus.getPrevIndexes();if(this.parent.frozenRows)if(e.container.isHeader&&("TD"===e.element.tagName||t.closest(e.element,"."+bi))){var h=this.parent.getHeaderTable().querySelector("thead").childElementCount;s-=h,a.rowIndex=t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex-h}else s+=this.parent.frozenRows,a.rowIndex=0!==a.rowIndex&&t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex+this.parent.frozenRows;if(this.parent.isFrozenGrid()){var d=Number(e.element.getAttribute(qi)),c=this.parent.getSelectedRowCellIndexes();c.length&&0===a.cellIndex&&(a.cellIndex=c[c.length-1].cellIndexes[0]),a.cellIndex=t.isNullOrUndefined(a.cellIndex)?null:a.cellIndex===l?d:d-1,l=d}if(!(n||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&s===a.rowIndex&&l===a.cellIndex)||this.selectionSettings.allowColumnSelection){this.preventFocus=!0;var p=this.getKeyColIndex(e);switch(this.needColumnSelection&&(l=p),e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.isKeyAction=!0,this.applyDownUpKey(s,l);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(s,l);break;case"shiftDown":case"shiftUp":this.shiftDownKey(s,l);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(s,l);break;case"home":case"end":l="end"===e.keyArgs.action?this.getLastColIndex(s):0,this.applyHomeEndKey(s,l);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(s,l);break;case"escape":this.clearSelection();break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(s)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.updateAutoFillPosition()}},r.prototype.getKeyColIndex=function(e){var t,i=null,r=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&O(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,r){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return i;t=r.getAttribute("e-mappinguid");var n=this.getstackedColumns(this.parent.getColumnByUid(t).columns),o=this.parent.getColumnIndexByUid(n[n.length-1].uid),s=this.parent.getColumnIndexByUid(n[0].uid);i=this.prevColIndex>=o?s:o}else i=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));return i},r.prototype.ctrlPlusA=function(){this.isRowType()&&!this.isSingleSel()&&this.selectRowsByRange(0,this.getCurrentBatchRecordChanges().length-1),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},r.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},r.prototype.applyDownUpKey=function(e,t){var i=this.parent;this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&!this.selectionSettings.persistSelection&&(this.checkSelectAllAction(!1),this.checkedTarget=null),this.isRowType()&&(this.parent.frozenRows,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},r.prototype.applyUpDown=function(e){if(!(e<0)){this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]);var t=parseInt(this.target.getAttribute(qi),10),i=this.parent.getFrozenColumns();this.target=i&&t>=i?this.contentRenderer.getMovableRowByIndex(e).getElementsByClassName(bi)[t-i]:this.contentRenderer.getRowByIndex(e).getElementsByClassName(bi)[t],this.addAttribute(this.target)}},r.prototype.applyRightLeftKey=function(e,t){this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},r.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},r.prototype.shiftDownKey=function(e,i){this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(t.isUndefined(this.prevRowIndex)?this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:i}),this.isMultiShiftRequest=!1},r.prototype.applyShiftLeftRightKey=function(e,t){this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},r.prototype.getstackedColumns=function(e){for(var t=[],i=0,r=e.length;i<r;i++)e[i].columns?this.getstackedColumns(e[i].columns):t.push(e[i]);return t},r.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},r.prototype.addRemoveClassesForRow=function(e,t,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];if(e){var o=[].slice.call(e.getElementsByClassName(bi)),s=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),l=e.querySelector(".e-rowdragdrop");s&&o.push(s),l&&o.push(l),Z.apply(void 0,[o,t].concat(r))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},r.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},r.prototype.getRenderer=function(){return t.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(e.RenderType.Content)),this.contentRenderer},r.prototype.getSelectedRecords=function(){return this.selectionSettings.persistSelection?this.persistSelectedData:this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data})},r.prototype.selectColumn=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[e])){var r=i.getColumnByIndex(e),n=i.getColumnHeaderByUid(r.uid),o=n.classList.contains("e-columnselection");if(i.selectionSettings.allowColumnSelection){var s=this.selectedColumnsIndexes.length>1&&this.selectedColumnsIndexes.indexOf(e)>-1;if(this.clearColDependency(),!o||!this.selectionSettings.enableToggle||s){var l={columnIndex:e,headerCell:n,column:r,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(l,"columnSelecting"),l.cancel)return void this.disableInteracted();i.selectionSettings.enableToggle&&e===this.prevColIndex&&o&&!s||this.updateColSelection(n,e);var a={columnIndex:e,headerCell:n,column:r,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(a,"columnSelected")}this.updateColProps(e)}}},r.prototype.selectColumnsByRange=function(e,i){var r=this.parent;if(!t.isNullOrUndefined(r.getColumns()[e])){var n=[];if("Single"===r.selectionSettings.type||t.isNullOrUndefined(i))n[0]=e;else for(var o=e<i,s=e;o?s<=i:s>=i;o?s++:s--)n.push(s);this.selectColumns(n)}},r.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var r={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(r,"columnSelecting"),r.cancel)return void this.disableInteracted();for(var n=0,o=e.length;n<o;n++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[n]).uid),e[n]);i=this.getselectedCols();var s={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(s,"columnSelected"),this.updateColProps(e[0])}},r.prototype.selectColumnWithExisting=function(e){var i=this.parent;if(!t.isNullOrUndefined(i.getColumns()[e])){var r=i.getColumnHeaderByUid(i.getColumnByIndex(e).uid),n=this.getselectedCols();if("Single"===i.selectionSettings.type&&this.clearColDependency(),i.selectionSettings.allowColumnSelection){if(this.selectedColumnsIndexes.indexOf(e)>-1)this.clearColumnSelection(e);else{var o={columnIndex:e,headerCell:n,columnIndexes:this.selectedColumnsIndexes,column:i.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(o,"columnSelecting"),o.cancel)return void this.disableInteracted();this.updateColSelection(r,e);var s={columnIndex:e,headerCell:n=this.getselectedCols(),column:i.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(s,"columnSelected")}this.updateColProps(e)}}},r.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var i=this.parent;if(!t.isNullOrUndefined(e)&&-1===this.selectedColumnsIndexes.indexOf(e))return;var r=t.isNullOrUndefined(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=i.getColumnByIndex(r),o=void 0,s=i.getColumnByIndex(r),l={columnIndex:r,headerCell:o=n.getFreezeTableName()===Ni?i.getFrozenRightColumnHeaderByIndex(r):"movable"===n.getFreezeTableName()?i.getMovableColumnHeaderByIndex(r):i.getColumnHeaderByUid(s.uid),columnIndexes:this.selectedColumnsIndexes,column:s,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(l,"columnDeselecting"))return void this.disableInteracted();for(var a=t.isNullOrUndefined(e)?[].slice.call(i.getHeaderContent().getElementsByClassName("e-columnselection")):[o],h=this.getSelectedColumnCells(e),d=0,c=a.length;d<c;d++)Z([a[d]],!1,"e-columnselection");for(var d=0,c=h.length;d<c;d++)Z([h[d]],!1,"e-columnselection");t.isNullOrUndefined(e)?(this.columnDeselect(l,"columnDeselected"),this.selectedColumnsIndexes=[],this.isColumnSelected=!1,this.parent.getColumns().filter(function(e){return e.isSelected=!1})):(this.selectedColumnsIndexes.splice(this.selectedColumnsIndexes.indexOf(e),1),this.parent.getColumns()[e].isSelected=!1)}},r.prototype.getselectedCols=function(){var e,t=this.parent;if(this.selectedColumnsIndexes.length>1){e=[];for(var i=0;i<this.selectedColumnsIndexes.length;i++)e.push(t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[i]).uid))}else e=t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return e},r.prototype.getSelectedColumnCells=function(e){var i,r,n=this.parent,o=!t.isNullOrUndefined(this.parent.rowTemplate),s=o?n.getRows():n.getDataRows();n.isFrozenGrid()&&n.getContent().querySelector("."+Ei)&&(i=o?n.getMovableRows():n.getMovableDataRows(),s=n.addMovableRows(s,i),n.getFrozenMode()===Pi&&(r=o?n.getFrozenRightRows():n.getFrozenRightDataRows(),s=n.addMovableRows(s,r)));for(var l=[],a=t.isNullOrUndefined(e)?".e-columnselection":'[aria-colindex="'+e+'"]',h=0,d=s.length;h<d;h++)l=l.concat([].slice.call(s[h].querySelectorAll(a)));return l},r.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},r.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},r.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},r.prototype.updateColSelection=function(e,i){if(!t.isNullOrUndefined(this.parent.getColumns()[i])){var r,n=this.parent.getFrozenLeftCount(),o=this.parent.getMovableColumnsCount(),s=this.parent.getColumnByIndex(i),l=!t.isNullOrUndefined(this.parent.rowTemplate);this.selectedColumnsIndexes.push(i),this.parent.getColumns()[i].isSelected=!0,s.getFreezeTableName()===Ni?(i-=n+o,r=l?this.parent.getFrozenRightRows():this.parent.getFrozenRightDataRows()):"movable"===s.getFreezeTableName()?(i-=n,r=l?this.parent.getMovableRows():this.parent.getMovableDataRows()):(i+=this.parent.getIndentCount(),r=l?this.parent.getRows():this.parent.getDataRows()),Z([e],!0,"e-columnselection");for(var a=0,h=r.length;a<h;a++)r[a].classList.contains(Oi)&&(!r[a].classList.contains(Ai)&&!r[a].classList.contains(Bi)||"Normal"!==this.parent.editSettings.mode||t.isNullOrUndefined(r[a].querySelector("tr").childNodes[i])?t.isNullOrUndefined(r[a].childNodes[i])||Z([r[a].childNodes[i]],!0,"e-columnselection"):Z([r[a].querySelector("tr").childNodes[i]],!0,"e-columnselection"))}},r.prototype.headerSelectionHandler=function(e){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?this.selectColumn(e):this.isMultiShiftRequest?this.selectColumnsByRange(t.isUndefined(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},r.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(kt,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(Rt,this.onDataBoundFunction),this.parent.on(At,this.checkBoxSelectionChanged,this),this.parent.on("before-refresh-on-data-change",this.initPerisistSelection,this),this.parent.on(Pt,this.setCheckAllForEmptyGrid,this),this.actionCompleteFunc=this.actionCompleteHandler.bind(this),this.parent.addEventListener(St,this.actionCompleteFunc),this.parent.on(Gt,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener("resizeStop",this.resizeEndFn)},r.prototype.removeEventListener_checkbox=function(){this.parent.off(kt,this.dataReady),this.parent.removeEventListener(Rt,this.onDataBoundFunction),this.parent.removeEventListener(St,this.actionCompleteFunc),this.parent.off(Pt,this.setCheckAllForEmptyGrid),this.parent.off(Gt,this.clickHandler),this.parent.off("before-refresh-on-data-change",this.initPerisistSelection)},r.prototype.setCheckAllForEmptyGrid=function(){var e=this.getCheckAllBox();if(e){this.parent.isCheckBoxSelection=!0;var i=e.nextElementSibling;t.removeClass([i],["e-check","e-stop","e-uncheck"])}},r.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||(this.disableUI=!this.parent.enableImmutableMode,this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},r.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},r.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,this.parent.selectedRowIndex=e},r.prototype.disableInteracted=function(){this.isInteracted=!1},r.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null},r}(),Kr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.search=function(e){var i=this.parent;if(e=t.isNullOrUndefined(e)?"":e,X(i))return void i.notify(ii,{instance:this,handler:this.search,arg1:e});e!==i.searchSettings.key?(i.searchSettings.key=e.toString(),i.dataBind()):this.refreshSearch&&i.refresh()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Nt,this.onPropertyChanged,this),this.parent.on("searching-complete",this.onSearchComplete,this),this.parent.on(_t,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(St,this.actionCompleteFunc),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Nt,this.onPropertyChanged),this.parent.off("searching-complete",this.onSearchComplete),this.parent.off(_t,this.destroy),this.parent.removeEventListener(St,this.actionCompleteFunc),this.parent.off("cancel-Begin",this.cancelBeginEvent))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(t.isNullOrUndefined(e.properties.key)?this.parent.notify(Lt,{requestType:"searching",type:bt}):this.parent.notify(Lt,{requestType:"searching",type:bt,searchString:this.parent.searchSettings.key}))},e.prototype.onSearchComplete=function(e){this.parent.trigger(St,t.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:St}))},e.prototype.onActionComplete=function(e){this.refreshSearch="searching"!==e.requestType},e.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},e.prototype.getModuleName=function(){return"search"},e}(),Qr=function(){function e(e){this.parent=e}return e.prototype.show=function(e,t){var i=this.getToggleFields(e),r=this.getColumns(i,t);this.parent.notify("tooltip-destroy",{module:"edit"});for(var n=0;n<r.length;n++)r[n].visible=!0;this.setVisible(r)},e.prototype.hide=function(e,t){var i=this.getToggleFields(e),r=this.getColumns(i,t);this.parent.notify("tooltip-destroy",{module:"edit"});for(var n=0;n<r.length;n++)r[n].visible=!1;this.setVisible(r)},e.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},e.prototype.getColumns=function(e,t){var i=this;return S(e,function(e){return S(i.parent.columnModel,function(i){if(i[t]===e)return i})[0]})},e.prototype.setVisible=function(e,i){var r=this;void 0===i&&(i=[]);var n={requestType:"columnstate",cancel:!1,columns:i=i.length>0?i:e};this.parent.trigger(bt,n,function(n){var o=r.parent.getColumns();if(e=t.isNullOrUndefined(e)?o:e,n.cancel)return r.parent.notify("reset-columns",{showHideArgs:n}),void(e.length>0&&(e[0].visible=!0));ce(r.parent)&&r.parent.contentModule.emptyVcRows(),r.parent.allowSelection&&r.parent.getSelectedRecords().length&&!r.parent.selectionSettings.persistSelection&&r.parent.clearSelection(),r.parent.enableColumnVirtualization?e.filter(function(e){return o.some(function(t){return e.field===t.field})}).length&&r.parent.notify(Wt,e):r.parent.notify(Wt,e);var s={requestType:"columnstate",columns:i};r.parent.trigger(St,s),"All"!==r.parent.columnQueryMode&&r.parent.refresh()})},e}(),Xr=function(){function e(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new Tr(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){this.parent.element.style.width=t.formatUnit(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&this.parent.toolbarModule.toolbar.refreshOverflow()},e.prototype.setHeight=function(){var i=0,r=this.parent.getContent().querySelector("."+Di),n=this.parent.height;if(this.parent.isFrozenGrid()&&"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-e.getScrollBarWidth()),!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height){var o=this.parent.getHeaderContent().querySelector(Ui);i=o?o.offsetHeight:0,o&&i&&(i-=o.getElementsByClassName(Bi).length*this.parent.getRowHeight()),r.style.height=t.formatUnit(n-i)}else r.style.height=t.formatUnit(n);this.ensureOverflow(r),this.parent.isFrozenGrid()&&this.refresh()},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),i=e.getScrollBarWidth()-this.getThreshold(),r=this.getCssProperties(),n="Right"===this.parent.getFrozenMode()||this.parent.getFrozenMode()===Pi?"0.5px":"1px";t.querySelector("."+Fi).style[r.border]=i>0?n:"0px",t.style[r.padding]=i>0?i+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e),i=this.parent.getHeaderContent().querySelector("."+Fi);i.style[t.border]="",i.parentElement.style[t.padding]="";var r=this.parent.getFooterContent();r&&r.classList.contains("e-footerpadding")&&r.classList.remove("e-footerpadding")},e.prototype.refresh=function(){if("100%"===this.parent.height){var e=this.parent.getContent();this.parent.element.style.height="100%";var t=this.widthService.getSiblingsHeight(e);e.style.height="calc(100% - "+t+"px)",this.parent.isFrozenGrid()&&(e.firstElementChild.style.height="calc(100% - "+j()+"px)")}},e.prototype.getThreshold=function(){return"mozilla"===t.Browser.info.name?.5:1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Pt,this.wireEvents,this),this.parent.on(At,this.wireEvents,this),this.parent.on(Bt,this.onPropertyChanged,this),this.parent.on("textWrapRefresh",this.wireEvents,this),this.parent.on(Ht,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Pt,this.wireEvents),this.parent.off(At,this.wireEvents),this.parent.off(Bt,this.onPropertyChanged),this.parent.off("textWrapRefresh",this.wireEvents),this.parent.off(Ht,this.setScrollLeft))},e.prototype.setScrollLeft=function(){this.parent.isFrozenGrid()?this.parent.headerModule.getMovableHeader().scrollLeft=this.previousValues.left:this.parent.getHeaderContent().querySelector("."+Fi).scrollLeft=this.previousValues.left},e.prototype.onFrozenContentScroll=function(){var e=this;return function(i){null===e.content.querySelector(Ui)||e.parent.isPreventScrollEvent||(!t.isNullOrUndefined(e.parent.infiniteScrollModule)&&e.parent.enableInfiniteScrolling&&e.parent.notify("infinite-scroll-handler",i),e.previousValues.top=i.target.scrollTop)}},e.prototype.onContentScroll=function(e){var i=this,r=e,n=r.classList.contains(Fi);return function(e){if(null!==i.content.querySelector(Ui)&&!i.parent.isPreventScrollEvent){var o=e.target,s=o.scrollLeft;if(!t.isNullOrUndefined(i.parent.infiniteScrollModule)&&i.parent.enableInfiniteScrolling&&i.parent.notify("infinite-scroll-handler",{target:e.target,isLeft:i.previousValues.left!==s}),i.parent.groupSettings.columns.length&&i.parent.groupSettings.enableLazyLoading){var l=i.previousValues.top<i.parent.getContent().firstElementChild.scrollTop;i.parent.notify("lazy-load-scroll-handler",{scrollDown:l})}i.parent.notify("virtual-scroll-edit",{});var a=o.classList.contains("e-summarycontent");if(i.previousValues.left===s)return void(i.previousValues.top=n?o.scrollTop:i.previousValues.top);i.parent.notify("close-filter-dialog",e),r.scrollLeft=s,a&&(i.header.scrollLeft=s),i.previousValues.left=s,i.parent.notify("scroll",{left:s})}}},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,r=e,n=t;return function(e){if(null!==i.content.querySelector(Ui)){var t=e.target.scrollLeft;i.previousValues.left!==t&&(r.scrollLeft=t,n.scrollLeft=t,i.previousValues.left=t,i.parent.notify("scroll",{left:t}),i.parent.isDestroyed)}}},e.prototype.onTouchScroll=function(e){var t=this,i=e;return function(e){if("mouse"!==e.pointerType){var r=t.parent.isFrozenGrid(),n=t.getPointXY(e),o=i.scrollLeft+(t.pageXY.x-n.x),s=r?t.parent.getHeaderContent().querySelector("."+Ii):t.parent.getHeaderContent().querySelector("."+Fi),l=r?t.parent.getContent().querySelector("."+Ei):t.parent.getContent().querySelector("."+Di);t.previousValues.left===o||o<0||s.scrollWidth-s.clientWidth<o||(e.preventDefault(),s.scrollLeft=o,l.scrollLeft=o,r&&(t.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=o),t.pageXY.x=n.x,t.previousValues.left=o)}}},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.wireEvents=function(){var e=this;if(this.oneTimeReady){var i=this.parent.isFrozenGrid();this.content=this.parent.getContent().querySelector("."+Di),this.header=this.parent.getHeaderContent().querySelector("."+Fi);var r=this.content.querySelector("."+Ei),n=this.header.querySelector("."+Ii),o=this.parent.getContent().querySelector(".e-movablescrollbar");this.parent.frozenRows&&(t.EventHandler.add(i?n:this.header,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(i?n:this.header,"touchmove pointermove",this.onTouchScroll(i?r:this.content),this)),this.parent.isFrozenGrid()?(t.EventHandler.add(o,"scroll",this.onCustomScrollbarScroll(r,n),this),t.EventHandler.add(r,"scroll",this.onCustomScrollbarScroll(o,n),this),t.EventHandler.add(n,"scroll",this.onCustomScrollbarScroll(o,r),this),t.EventHandler.add(this.content,"scroll",this.onFrozenContentScroll(),this),t.EventHandler.add(n,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(n,"touchmove pointermove",this.onTouchScroll(r),this),t.EventHandler.add(r,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(r,"touchmove pointermove",this.onTouchScroll(n),this)):(t.EventHandler.add(this.content,"scroll",this.onContentScroll(this.header),this),t.EventHandler.add(this.header,"scroll",this.onContentScroll(this.content),this)),this.parent.aggregates.length&&t.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.refresh(),this.oneTimeReady=!1}var s,l,a,h=this.parent.getContentTable();m(function(){s=e.header.scrollLeft,l=h.scrollHeight,a=e.parent.getContent().clientHeight},function(){var i={cancel:!1};e.parent.notify("check-scroll-reset",i),e.parent.enableVirtualization||e.parent.enableInfiniteScrolling||(l<a&&(t.addClass(h.querySelectorAll("tr:last-child td"),"e-lastrowcell"),e.parent.isFrozenGrid()&&t.addClass(e.parent.getContent().querySelector("."+Ei).querySelectorAll("tr:last-child td"),"e-lastrowcell")),i.cancel||((e.parent.frozenRows>0||e.parent.isFrozenGrid())&&e.header.querySelector("."+Ii)?e.header.querySelector("."+Ii).scrollLeft=e.previousValues.left:e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top)),e.parent.enableColumnVirtualization||(e.content.scrollLeft=s),e.parent.isFrozenGrid()&&e.header.querySelector("."+Ii)&&(e.header.querySelector("."+Ii).scrollLeft=e.content.querySelector("."+Ei).scrollLeft)}),this.parent.isPreventScrollEvent=!1},e.prototype.getCssProperties=function(e){var i={},r=t.isNullOrUndefined(e)?this.parent.enableRtl:e;return i.border=r?"borderLeftWidth":"borderRightWidth",i.padding=r?"paddingLeft":"paddingRight",i},e.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight();this.setWidth(!t.isNullOrUndefined(e.properties.width))}},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))){this.removeEventListener(),this.removePadding();var i=this.parent.getContent().querySelector("."+Di);t.removeClass([this.parent.getHeaderContent().querySelector("."+Fi)],Fi),t.removeClass([i],Di),i.style.height="",this.parent.element.style.width="",t.EventHandler.remove(i,"scroll",this.onContentScroll)}},e.getScrollBarWidth=function(){return j()},e}(),Jr=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Zr=function(i){function r(){var e=null!==i&&i.apply(this,arguments)||this;return e.templateFn={},e}return Jr(r,i),r.prototype.setFormatter=function(e){this.formatFn=e},r.prototype.getFormatter=function(){return this.formatFn},r.prototype.setTemplate=function(i){void 0===i&&(i={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.Summary)]={fn:t.compile(this.footerTemplate,i),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]={fn:t.compile(this.groupFooterTemplate,i),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]={fn:t.compile(this.groupCaptionTemplate,i),property:"groupCaptionTemplate"})},r.prototype.getTemplate=function(i){return this.templateFn[t.getEnumValue(e.CellType,i)]},r.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},Yr([t.Property()],r.prototype,"type",void 0),Yr([t.Property()],r.prototype,"field",void 0),Yr([t.Property()],r.prototype,"columnName",void 0),Yr([t.Property()],r.prototype,"format",void 0),Yr([t.Property()],r.prototype,"footerTemplate",void 0),Yr([t.Property()],r.prototype,"groupFooterTemplate",void 0),Yr([t.Property()],r.prototype,"groupCaptionTemplate",void 0),Yr([t.Property()],r.prototype,"customAggregate",void 0),r}(t.ChildProperty),$r=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Jr(i,e),Yr([t.Collection([],Zr)],i.prototype,"columns",void 0),i}(t.ChildProperty),en=function(){function e(e){this.copyContent="",this.isSelect=!1,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(At,this.initialEnd,this),this.parent.on(Vt,this.keyDownHandler,this),this.parent.on(Gt,this.clickHandler,this),t.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Vt,this.keyDownHandler),this.parent.off(At,this.initialEnd),this.parent.off(Gt,this.clickHandler),t.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=O(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var i=this,r=this.parent,n=/(Mac)/i.test(navigator.platform);if(86===e.keyCode&&(e.ctrlKey||n&&e.metaKey)&&!r.isEdit){if(!t.closest(document.activeElement,"."+bi)||!r.editSettings.allowEditing||"Batch"!==r.editSettings.mode||"Cell"!==r.selectionSettings.mode||"Flow"===r.selectionSettings.cellSelectionMode)return;this.activeElement=document.activeElement,this.clipBoardTextArea.value="";var o=window.scrollX,s=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){i.activeElement.focus(),window.scrollTo(o,s),i.paste(i.clipBoardTextArea.value,i.parent.getSelectedRowCellIndexes()[0].rowIndex,i.parent.getSelectedRowCellIndexes()[0].cellIndexes[0])},10)}},e.prototype.paste=function(e,i,r){var n,o,s,l=this.parent,a=r,h=i;if(l.editSettings.allowEditing&&"Batch"===l.editSettings.mode&&"Cell"===l.selectionSettings.mode&&"Flow"!==l.selectionSettings.cellSelectionMode){var d,c,p,u=e.split("\n"),g=l.getDataRows(),f=this.parent.isFrozenGrid();f&&(c=l.getMovableDataRows(),l.getFrozenRightColumnsCount()&&(p=l.getFrozenRightDataRows()));for(var m=0;m<u.length;m++){if(d=u[m].split("\t"),a=r,m===u.length-1&&""===u[m]||t.isUndefined(l.getRowByIndex(h))){a++;break}for(var y=0;y<d.length;y++){if(s=l.getCellFromIndex(h,a),f){var v=g[h],C=c[h];s=!!v.querySelector('[aria-colindex="'+a+'"]')||C.querySelector('[aria-colindex="'+a+'"]'),p&&!s&&(s=p[h].querySelector('[aria-colindex="'+a+'"]'))}if(!s){a++;break}if(n=l.getColumnByIndex(a),o=n.getParser()?n.getParser()(d[y]):d[y],n.allowEditing&&!n.isPrimaryKey&&!n.template){var w={column:n,data:o,rowIndex:h};this.parent.trigger("beforePaste",w),h=w.rowIndex,w.cancel||l.editModule&&("number"===n.type?this.parent.editModule.updateCell(h,n.field,parseFloat(w.data)):l.editModule.updateCell(h,n.field,w.data))}a++}h++}l.selectionModule.selectCellsByRange({rowIndex:i,cellIndex:r},{rowIndex:h-1,cellIndex:a-1});var b=this.parent.getCellFromIndex(h-1,a-1);b&&t.classList(b,["e-focus","e-focused"],[])}},e.prototype.initialEnd=function(){this.parent.off(At,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",styles:"opacity: 0",attrs:{tabindex:"-1","aria-label":"clipboard"}}),this.parent.element.appendChild(this.clipBoardTextArea)},e.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},e.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){var i=this.parent.isFrozenGrid();this.clipBoardTextArea.value=this.copyContent="";var r=void 0,n=void 0,o=this.parent.getRows();if(i&&(r=this.parent.getMovableDataRows(),this.parent.getFrozenMode()===Pi&&(n=this.parent.getFrozenRightRows())),"Cell"!==this.parent.selectionSettings.mode){var s=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var l=[],a=0;a<this.parent.getVisibleColumns().length;a++)l[a]=this.parent.getVisibleColumns()[a].headerText;this.getCopyData(l,!1,"\t",e),this.copyContent+="\n"}for(a=0;a<s.length;a++){a>0&&(this.copyContent+="\n");c=[].slice.call(o[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"));i&&(c.push.apply(c,[].slice.call(r[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"))),n&&c.push.apply(c,[].slice.call(n[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)")))),this.getCopyData(c,!1,"\t",e)}}else{var h=this.checkBoxSelection();if(h.status){if(e){for(var d=[],a=0;a<h.colIndexes.length;a++)d.push(this.parent.getColumnHeaderByIndex(h.colIndexes[a]));this.getCopyData(d,!1,"\t",e),this.copyContent+="\n"}for(a=0;a<h.rowIndexes.length;a++){a>0&&(this.copyContent+="\n");var c=[].slice.call(o[h.rowIndexes[a]].getElementsByClassName("e-cellselectionbackground"));i&&(c.push.apply(c,[].slice.call(r[h.rowIndexes[a]].getElementsByClassName("e-cellselectionbackground"))),n&&c.push.apply(c,[].slice.call(n[h.rowIndexes[a]].getElementsByClassName("e-cellselectionbackground")))),this.getCopyData(c,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground")),!0,"\n",e)}var p={data:this.copyContent,cancel:!1};if(this.parent.trigger("beforeCopy",p),p.cancel)return;this.clipBoardTextArea.value=this.copyContent=p.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0}},e.prototype.getCopyData=function(e,t,i,r){for(var n="string"!=typeof e[0],o=0;o<e.length;o++){if(r&&t){var s=parseInt(e[o].getAttribute(qi),10);this.copyContent+=this.parent.getColumns()[s].headerText+"\n"}n?e[o].classList.contains("e-hide")||(this.copyContent+=e[o].innerText):this.copyContent+=e[o],o<e.length-1&&(this.copyContent+=i)}},e.prototype.copy=function(e){document.queryCommandSupported("copy")&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},e.prototype.getModuleName=function(){return"clipboard"},e.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&t.remove(this.clipBoardTextArea)},e.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){var i=e.getSelectedRowCellIndexes(),r=void 0,n=[],o=void 0;for(o=0;o<i.length&&(i[o].cellIndexes.length&&n.push(i[o].rowIndex),!i[o].cellIndexes.length||(r||(r=JSON.stringify(i[o].cellIndexes.sort())),r===JSON.stringify(i[o].cellIndexes.sort())));o++);n.sort(function(e,t){return e-t}),o===i.length&&n[n.length-1]-n[0]==n.length-1&&(t={status:!0,rowIndexes:n,colIndexes:i[0].cellIndexes})}return t},e}(),tn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rn=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},nn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property()],i.prototype,"field",void 0),rn([t.Property()],i.prototype,"direction",void 0),rn([t.Property(!1)],i.prototype,"isFromGroup",void 0),i}(t.ChildProperty),on=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Collection([],nn)],i.prototype,"columns",void 0),rn([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),sn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property()],i.prototype,"field",void 0),rn([t.Property()],i.prototype,"operator",void 0),rn([t.Property()],i.prototype,"value",void 0),rn([t.Property()],i.prototype,"matchCase",void 0),rn([t.Property(!1)],i.prototype,"ignoreAccent",void 0),rn([t.Property()],i.prototype,"predicate",void 0),rn([t.Property({})],i.prototype,"actualFilterValue",void 0),rn([t.Property({})],i.prototype,"actualOperator",void 0),rn([t.Property()],i.prototype,"type",void 0),rn([t.Property()],i.prototype,"ejpredicate",void 0),rn([t.Property()],i.prototype,"uid",void 0),rn([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),ln=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property(!1)],i.prototype,"enableCache",void 0),rn([t.Property(3)],i.prototype,"maxBlocks",void 0),rn([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),an=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Collection([],sn)],i.prototype,"columns",void 0),rn([t.Property("FilterBar")],i.prototype,"type",void 0),rn([t.Property()],i.prototype,"mode",void 0),rn([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),rn([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),rn([t.Property()],i.prototype,"operators",void 0),rn([t.Property(!1)],i.prototype,"ignoreAccent",void 0),rn([t.Property(!1)],i.prototype,"enableCaseSensitivity",void 0),rn([t.Property(!1)],i.prototype,"showFilterBarOperator",void 0),i}(t.ChildProperty),hn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property("Row")],i.prototype,"mode",void 0),rn([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),rn([t.Property("Single")],i.prototype,"type",void 0),rn([t.Property(!1)],i.prototype,"checkboxOnly",void 0),rn([t.Property(!1)],i.prototype,"persistSelection",void 0),rn([t.Property("Default")],i.prototype,"checkboxMode",void 0),rn([t.Property(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0),rn([t.Property(!0)],i.prototype,"enableToggle",void 0),rn([t.Property(!1)],i.prototype,"allowColumnSelection",void 0),i}(t.ChildProperty),dn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property([])],i.prototype,"fields",void 0),rn([t.Property("")],i.prototype,"key",void 0),rn([t.Property("contains")],i.prototype,"operator",void 0),rn([t.Property(!0)],i.prototype,"ignoreCase",void 0),rn([t.Property(!1)],i.prototype,"ignoreAccent",void 0),i}(t.ChildProperty),cn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),pn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),un=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property("Normal")],i.prototype,"mode",void 0),i}(t.ChildProperty),gn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property(!0)],i.prototype,"showDropArea",void 0),rn([t.Property(!1)],i.prototype,"allowReordering",void 0),rn([t.Property(!1)],i.prototype,"showToggleButton",void 0),rn([t.Property(!1)],i.prototype,"showGroupedColumn",void 0),rn([t.Property(!0)],i.prototype,"showUngroupButton",void 0),rn([t.Property(!1)],i.prototype,"disablePageWiseAggregates",void 0),rn([t.Property([])],i.prototype,"columns",void 0),rn([t.Property()],i.prototype,"captionTemplate",void 0),rn([t.Property(!1)],i.prototype,"enableLazyLoading",void 0),i}(t.ChildProperty),fn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return tn(i,e),rn([t.Property(!1)],i.prototype,"allowAdding",void 0),rn([t.Property(!1)],i.prototype,"allowEditing",void 0),rn([t.Property(!1)],i.prototype,"allowDeleting",void 0),rn([t.Property("Normal")],i.prototype,"mode",void 0),rn([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),rn([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),rn([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),rn([t.Property("")],i.prototype,"template",void 0),rn([t.Property("")],i.prototype,"headerTemplate",void 0),rn([t.Property("")],i.prototype,"footerTemplate",void 0),rn([t.Property("Top")],i.prototype,"newRowPosition",void 0),rn([t.Property({})],i.prototype,"dialog",void 0),rn([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),mn=function(n){function o(e,i){var r=n.call(this,e,i)||this;return r.isPreventScrollEvent=!1,r.inViewIndexes=[],r.keyA=!1,r.frozenRightCount=0,r.frozenLeftCount=0,r.tablesCount=1,r.movableCount=0,r.visibleFrozenLeft=0,r.visibleFrozenRight=0,r.visibleMovable=0,r.frozenLeftColumns=[],r.frozenRightColumns=[],r.movableColumns=[],r.media={},r.isFreezeRefresh=!1,r.tableIndex=0,r.componentRefresh=t.Component.prototype.refresh,r.isVirtualAdaptive=!1,r.vRows=[],r.vcRows=[],r.vGroupOffsets={},r.rowUid=0,r.currentViewData=[],r.isManualRefresh=!1,r.lockcolPositionCount=0,r.prevPageMoving=!1,r.pageTemplateChange=!1,r.isAutoGen=!1,r.mediaBindInstance={},r.commandDelIndex=void 0,r.asyncTimeOut=50,r.isExportGrid=!1,r.enableLogger=!0,r.needsID=!0,s.Inject(Wr),t.setValue("mergePersistData",r.mergePersistGridData,r),r}tn(o,n),s=o,o.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],i={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=0;r<e.length;r++)for(var n=this[e[r]],o=0,s=i[e[r]];o<s.length;o++)delete n[s[o]];var l=this.pageSettings.template,a=Object.assign({template:void 0},this.pageSettings);this.setProperties({pageSettings:a},!0),this.isAngular&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!t.isNullOrUndefined(this.pagerTemplate);var h=this.addOnPersist(e);return a.template=l,this.setProperties({pageSettings:a},!0),h},o.prototype.requiredModules=function(){this.setFrozenCount();var e=[];return this.isDestroyed?e:(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator]}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this]}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator]}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings]}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator]}),e.push({member:"resize",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this]}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator]}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator]}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator]}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator]}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator]}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator]}),this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator]}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator]}),this.extendRequiredModules(e),e)},o.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator]}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator]}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator]}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator]}),this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator]}),this.enableLogger&&e.push({member:"logger",args:[this]})},o.prototype.preRender=function(){this.serviceLocator=new Er,this.initProperties(),this.initializeServices()},o.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=t.Component.prototype.refresh,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.defaultLocale={EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",ClearButton:"Clear",StartsWith:"Starts With",EndsWith:"Ends With",Contains:"Contains",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",AutoFitAll:"Autofit all columns",AutoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No matches found",ClearFilter:"Clear Filter",Clear:"Clear",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:",FilterMenuDialogARIA:"Filter menu dialog",ExcelFilterDialogARIA:"Excel filter dialog",DialogEditARIA:"Edit dialog",ColumnChooserDialogARIA:"Column chooser dialog",ColumnMenuDialogARIA:"Column menu dialog",CustomFilterDialogARIA:"Customer filter dialog",SortAtoZ:"Sort A to Z",SortZtoA:"Sort Z to A",SortByOldest:"Sort by Oldest",SortByNewest:"Sort by Newest",SortSmallestToLargest:"Sort Smallest to Largest",SortLargestToSmallest:"Sort Largest to Smallest",Sort:"Sort"},this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H",ctrlSpace:"ctrl+space",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow"}},o.prototype.render=function(){this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),r.createSpinner({target:this.element},this.createElement),this.renderModule=new Rr(this,this.serviceLocator),this.searchModule=new Kr(this),this.scrollModule=new Xr(this),this.notify(Mt,{}),!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||(this.isVirtualAdaptive=!0),this.trigger("load"),T(this.columns,this.enableColumnVirtualization,this),this.enablePersistence&&this.notify(hi,{}),this.getMediaColumns(),I(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),this.showSpinner(),this.notify(Ot,{})},o.prototype.showSpinner=function(){this.isExportGrid||r.showSpinner(this.element)},o.prototype.hideSpinner=function(){this.isExportGrid||r.hideSpinner(this.element)},o.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().getElementsByClassName("e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},o.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i].hideAtMedia)||!t.isNullOrUndefined(e[i].visible)&&!e[i].visible||this.pushMediaColumn(e[i],i)}},o.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.mediaBindInstance[t]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[t])},o.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),i=0;i<this.mediaCol.length;i++)if(e.uid===this.mediaCol[i].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},o.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[e];this.mediaCol.some(function(e){return e.uid===i.uid})&&(i.visible=t.matches,this.isInitialLoad&&(this.invokedFromMedia=!0,i.visible?this.showHider.show(i.headerText,"headerText"):this.showHider.hide(i.headerText,"headerText")))},o.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+xi);this.aggregates.length&&this.element.scrollHeight>this.height&&e&&t.addClass([e],["e-footerpadding"]),this.getColumns().filter(function(e){return"checkbox"===e.type}).length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),t.removeClass([this.element],"e-gridhover"))},o.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[e].uid].removeListener(this.mediaBindInstance[this.mediaCol[e].index])},o.prototype.eventInitializer=function(){},o.prototype.destroy=function(){var e=this.element;if(e){var i=!(!e.querySelector("."+Si)||!e.querySelector("."+Ri));i&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(_t,{}),this.destroyDependentModules(),i&&n.prototype.destroy.call(this),this.toolTipObj.destroy();for(var r=["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule"],o=0;o<r.length;o++)this[r[o]]&&(this[r[o]]=null);this.element.innerHTML="",t.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"]),this.isAngular&&!this.isFreezeRefresh&&(this.element=null),this.isFreezeRefresh=!1}},o.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy())},o.prototype.getModuleName=function(){return"grid"},o.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):this.element.classList.remove("e-afenabled")},o.prototype.onPropertyChanged=function(e,i){var r,n=!1,o=!1,s=!1,l={requestType:"refresh"};if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var a=Object.keys(e);a.indexOf("columns")>-1&&(this.updateColumnObject(),o=!0);for(var h=0,d=a;h<d.length;h++){var c=d[h];switch(c){case"allowPaging":this.notify(Bt,{module:"pager",enable:this.allowPaging}),n=!0;break;case"pageSettings":if(this.pageTemplateChange){this.pageTemplateChange=!1,this.notify(Nt,{module:"pager",properties:e.pageSettings});break}this.notify(Nt,{module:"pager",properties:e.pageSettings}),(t.isNullOrUndefined(e.pageSettings.currentPage)&&t.isNullOrUndefined(e.pageSettings.pageSize)&&t.isNullOrUndefined(e.pageSettings.totalRecordsCount)||!t.isNullOrUndefined(i.pageSettings)&&e.pageSettings.currentPage!==i.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0);break;case"allowSorting":this.notify(Bt,{module:"sort",enable:this.allowSorting}),n=!0,r=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(Bt,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type&&this.refreshHeader();break;case"height":case"width":this.notify(Bt,{module:"scroll",properties:{width:e.width,height:e.height}});break;case"allowReordering":this.headerModule.refreshUI(),r=!0;break;case"allowRowDragAndDrop":this.notify(Bt,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(Bt,{module:"selection",enable:this.allowSelection});break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=x(this.rowTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=x(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(Bt,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),n=!0,r=!0;break;case"enableInfiniteScrolling":case"childGrid":n=!0;break;case"toolbar":this.notify(Bt,{module:"toolbar"});break;case"groupSettings":this.notify(Nt,{module:"group",properties:e.groupSettings,oldProperties:i.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(Bt,{module:"aggregate",properties:e});break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"currencyCode":case"locale":this.log("frozen_rows_columns"),s=!0,o=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(n=!0),this.getDataModule().isQueryInvokedFromData=!1;break;default:this.extendedPropertyChange(c,e,o)}}r&&this.updateDefaultCursor(),o?s||this.getFrozenColumns()||this.frozenRows?t.isBlazor()&&this.isServerRendered||this.freezeRefresh():this.refresh():n&&(this.notify(Lt,l),n=!1,this.maintainSelection(e.selectedRowIndex))}},o.prototype.extendedPropertyChange=function(e,r,n){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=r.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!r.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=r.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=r.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=r.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&this.refreshHeader(),this.notify("rtl-updated",{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?t.addClass([this.element],"e-grid-min-height"):t.removeClass([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(Bt,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(Bt,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(Bt,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.notify(Bt,{module:"columnChooser",enable:this.showColumnChooser});break;case"filterSettings":this.updateStackedFilter(),this.notify(Nt,{module:"filter",properties:r.filterSettings});break;case"searchSettings":this.notify(Nt,{module:"search",properties:r.searchSettings});break;case"sortSettings":this.notify(Nt,{module:"sort"});break;case"selectionSettings":this.notify(Nt,{module:"selection",properties:r.selectionSettings});break;case"editSettings":this.notify(Nt,{module:"edit",properties:r.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(oi,{case:"textwrap",isModeChg:"textWrapSettings"===e});break;case"dataSource":var o=this.getDataModule().getState();if(Object.getPrototypeOf(r).deepWatch)for(var s=this.getPrimaryKeyFieldNames()[0],l=0,a=Object.keys(r.dataSource);l<a.length;l++)this.setRowData(t.getValue(s,this.dataSource[a[l]]),this.dataSource[a[l]]);else if(o.isPending){for(var h=t.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result,d=o.group||[],l=0;l<d.length;l++)h=i.DataUtil.group(h,d[l],o.aggregates||[]);this.dataSource={result:h,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),o.resolver(this.dataSource)}else this.getDataModule().setState({isDataChanged:!1}),this.notify(Zt,{}),n||(this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify("before-refresh-on-data-change",{}));this.scrollRefresh();break;case"enableHover":(r.enableHover?t.addClass:t.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(r.selectedRowIndex),this.isSelectedRowIndexUpdating=!1;break;case"resizeSettings":this.widthService.setWidthToTable();break;case"enableAdaptiveUI":this.notify("set-fullscreen-dialog",{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify("row-mode-change",{}),this.refresh()}},o.prototype.maintainSelection=function(e){var t=this;if(-1!==e){var i=function(){t.selectRow(e),t.off(At,i)};this.on(At,i,this)}},o.prototype.setProperties=function(e,t){n.prototype.setProperties.call(this,e,t);e.filterSettings&&this.filterModule&&t&&this.filterModule.refreshFilter()},o.prototype.setTablesCount=function(){var e=this.getFrozenColumns(),t=this.getFrozenLeftColumnsCount(),i=this.getFrozenRightColumnsCount();!e||t||i?e||!t&&!i||(t&&!i||i&&!t?this.tablesCount=2:t&&i&&(this.tablesCount=3)):this.tablesCount=2},o.prototype.getTablesCount=function(){return this.tablesCount},o.prototype.updateDefaultCursor=function(){var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().getElementsByClassName("e-stackedheadercell")),i=this.getColumns();if(this.enableColumnVirtualization&&this.getFrozenColumns()){var r=this.contentModule.getHeaderCells();e=r.length?r:e}for(var n=0;n<e.length;n++){var o=e[n];(this.allowGrouping||this.allowReordering||this.allowSorting)&&(i[n].allowReordering&&i[n].allowSorting&&i[n].allowGrouping?o.classList.add("e-mousepointer"):o.classList.add("e-defaultcursor"))}for(var s=0;s<t.length;s++)this.allowReordering&&t[s].classList.add("e-mousepointer")},o.prototype.updateColumnModel=function(e){for(var t=0,i=e.length;t<i;t++)e[t].columns?this.updateColumnModel(e[t].columns):this.columnModel.push(e[t]);this.updateColumnLevelFrozen(),this.updateFrozenColumns(),this.updateLockableColumns()},o.prototype.updateColumnLevelFrozen=function(){var e=this.columnModel,t=[],i=[],r=[];if(this.frozenLeftCount||this.frozenRightCount){for(var n=0,o=e.length;n<o;n++){var s=e[n];"Left"===s.freeze?(s.freezeTable=Li,t.push(s)):"Right"===s.freeze?(s.freezeTable=Ni,i.push(s)):(s.freezeTable="movable",r.push(s))}this.columnModel=t.concat(r).concat(i)}},o.prototype.updateFrozenColumns=function(){if(!this.frozenLeftCount&&!this.frozenRightCount)for(var e=this.columnModel,t=this.frozenColumns,i=this.getFrozenColumns(),r=0,n=0,o=e.length;n<o;n++){var s=e[n];t&&(s.freezeTable=n<t?Li:"movable"),s.isFrozen&&n>=t?(s.freezeTable=Li,e.splice(this.frozenColumns+r,0,e.splice(n,1)[0]),r++):i&&!t&&(s.freezeTable="movable")}},o.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},o.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.getFrozenLeftColumnsCount()||0!==this.getFrozenRightColumnsCount()},o.prototype.getFrozenMode=function(){return this.frozenName},o.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,r=this.getFrozenColumns(),n=0;n<e.length;n++)e[n].lockColumn&&(n<r?(e.splice(t,0,e.splice(n,1)[0]),t++):(e.splice(r+i,0,e.splice(n,1)[0]),i++))},o.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[t].columns?this.checkLockColumns(e[t].columns):e[t].lockColumn&&this.lockcolPositionCount++},o.prototype.getColumns=function(e){var i=this,r=this.inViewIndexes.map(function(e){return e-i.groupSettings.columns.length}).filter(function(e){return e>-1}),n=r.length;(!this.enableColumnVirtualization||t.isNullOrUndefined(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns));var o=0===n?this.columnModel:this.columnModel.slice(r[0],r[n-1]+1);return this.contentModule&&this.enableColumnVirtualization&&this.isFrozenGrid()&&r.length&&r[0]>0&&(o=this.contentModule.ensureFrozenCols(o)),o},o.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var r=t[i];if(r.field===e||r.headerText===e){this.stackedColumn=r;break}r.columns&&this.getStackedHeaderColumnByHeaderText(e,r.columns)}return this.stackedColumn},o.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},o.prototype.getQuery=function(){return this.query},o.prototype.getLocaleConstants=function(){return this.defaultLocale},o.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},o.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},o.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},o.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},o.prototype.getContentTable=function(){return this.contentModule.getTable()},o.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},o.prototype.getContent=function(){return this.contentModule.getPanel()},o.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},o.prototype.getHeaderTable=function(){return this.headerModule.getTable()},o.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},o.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(xi)[0],this.footerElement},o.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(xi)[0],this.footerElement.firstChild.firstChild},o.prototype.getPager=function(){return this.gridPager},o.prototype.setGridPager=function(e){this.gridPager=e},o.prototype.getRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},o.prototype.getMovableRowByIndex=function(e){return this.contentModule.getMovableRowByIndex(e)},o.prototype.getFrozenRowByIndex=function(e){return this.getFrozenDataRows()[e]},o.prototype.getRows=function(){return this.contentModule.getRowElements()},o.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getFrozenRightRowByIndex(e)},o.prototype.getRowInfo=function(e){var i=e,r={target:e};if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(O(i,"e-detailrowcollapse")&&t.isNullOrUndefined(O(i,"e-recordplusexpand")))){var n=t.closest(i,"."+bi);if(!n){var o=t.closest(i,"."+Oi);if(!t.isNullOrUndefined(o)){var s=this.getRowObjectFromUID(o.getAttribute("data-uid")),l=parseInt(o.getAttribute(Hi),10);r={row:o,rowData:s.data,rowIndex:l}}return r}var a=parseInt(n.getAttribute(qi),10);if(!t.isNullOrUndefined(n)&&!isNaN(a)){var h=t.closest(n,"."+Oi),l=parseInt(h.getAttribute(Hi),10),d=this.getFrozenColumns(),c=this.columnModel[a].getFreezeTableName(),p=this.contentModule.getRows(),u=a+this.getIndentCount();this.isFrozenGrid()&&(c===Li?p=this.contentModule.getRows():"movable"===c?(u=a-d-this.frozenLeftCount,p=this.contentModule.getMovableRows()):c===Ni&&(u=a-(this.frozenLeftCount+this.movableCount),p=this.contentModule.getFrozenRightRows()));var g=p.filter(function(e){return e.uid===h.getAttribute("data-uid")}),f={},m=void 0;Object.keys(g).length&&(f=g[0].data,m=g[0].cells[u].column),r={cell:n,cellIndex:a,row:h,rowIndex:l,rowData:f,column:m,target:e}}}return r},o.prototype.getMovableRows=function(){return this.contentModule.getMovableRowElements()},o.prototype.getFrozenRightRows=function(){return this.contentModule.getFrozenRightRowElements()},o.prototype.getDataRows=function(){return this.getAllDataRows()},o.prototype.getAllDataRows=function(e){if(t.isNullOrUndefined(this.getContentTable().querySelector(Ui)))return[];var i=this.isFrozenGrid()?this.getFrozenLeftContentTbody():this.getContentTable().querySelector(Ui),r=[].slice.call(i.children);if(this.frozenRows){var n=this.isFrozenGrid()?this.getHeaderContent().querySelector("."+zi).querySelector(Ui):this.getHeaderTable().querySelector(Ui),o=[].slice.call(n.children);r=this.addMovableRows(o,r)}return this.generateDataRows(r,e)},o.prototype.addMovableRows=function(e,t){for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},o.prototype.generateDataRows=function(e,t){for(var i=[],r=0,n=e.length;r<n;r++)!e[r].classList.contains(Oi)||e[r].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[r].getAttribute("aria-rowindex"),10)]=e[r]:i.push(e[r]));return i},o.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},o.prototype.getAllMovableDataRows=function(e){if(!this.isFrozenGrid())return[];var t=[].slice.call(this.getContent().querySelector("."+Ei).querySelector(Ui).children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector("."+Ii).querySelector(Ui).children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},o.prototype.getAllFrozenDataRows=function(e){var t=[].slice.call(this.getContent().querySelector("."+Ti).querySelector(Ui).children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector("."+zi).querySelector(Ui).children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},o.prototype.getAllFrozenRightDataRows=function(e){if("Right"!==this.getFrozenMode()&&"Left-Right"!==this.getFrozenMode())return[];var t=[].slice.call(this.getContent().querySelector(".e-frozen-right-content").querySelector(Ui).children);if(this.frozenRows){var i=[].slice.call(this.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(Ui).children);t=this.addMovableRows(i,t)}return this.generateDataRows(t,e)},o.prototype.setCellValue=function(e,i,r){var n="Right"===this.getFrozenMode(),o=this.getPrimaryKeyFieldNames()[0],s=new $i(this,this.serviceLocator),l=this.getColumnIndexByField(i),a=this.getColumnByField(i),h=("movable"===a.getFreezeTableName()?this.contentModule.getMovableRows():"frozen-right"===a.getFreezeTableName()?this.getFrozenRightRowsObject():this.contentModule.getRows()).filter(function(i){return t.getValue(o,i.data)===e})[0],d=h?this.element.querySelector("[data-uid="+h.uid+"]"):null;if(!t.isNullOrUndefined(d)){t.setValue(i,r,h.data);var c=this.getFrozenLeftColumnsCount()||this.getFrozenColumns(),p=this.getMovableColumnsCount();this.isRowDragable()&&!n&&c++;var u=c+p,g=this.getCellFromIndex(h.index,l);if(!t.isNullOrUndefined(g)){var f="movable"===a.getFreezeTableName()?c:"frozen-right"===a.getFreezeTableName()?u:0;this.groupSettings.columns.length&&(l+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&l++,this.isRowDragable()&&!n&&l++;var m=h.cells[l-f];s.refreshTD(g,m,h.data,{index:h.index}),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})),t.isNullOrUndefined(h)||t.isNullOrUndefined(h.changes)||(h.changes[i]=r),this.trigger("queryCellInfo",{cell:g,column:a,data:h.data})}}},o.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){for(var r=i.getRowsObject(),n=i.getIndentCount(),o=i.getNormalizedColumnIndex(e),s=0;s<r.length;s++)if(r[s].isDataRow&&!t.isNullOrUndefined(r[s].index)){var l=r[s].cells[o],a=new $i(i,i.serviceLocator),h=i.getCellFromIndex(r[s].index,o-n);a.refreshTD(h,l,r[s].data,{index:r[s].index})}})},o.prototype.setRowData=function(e,i){var r=this.contentModule.getRows(),n=this.getPrimaryKeyFieldNames()[0],o=new Vi(this.serviceLocator,null,this);this.groupSettings.columns.length>0&&this.aggregates.length>0&&(r=r.filter(function(e){return e.isDataRow}));var s=r.filter(function(i){return t.getValue(n,i.data)===e})[0];!t.isNullOrUndefined(s)&&this.element.querySelectorAll("[data-uid="+s.uid+"]").length&&(s.changes=i,se(s,this.getForeignKeyColumns(),s.changes),o.refresh(s,this.getColumns(),!0),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})))},o.prototype.getCellFromIndex=function(e,t){return He(this,this.getColumnByIndex(t),e,t)},o.prototype.getMovableCellFromIndex=function(e,t){if(!("Left-Right"===this.frozenName&&t>=this.movableCount)){var i=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableDataRows()[e]&&this.getMovableDataRows()[e].getElementsByClassName(bi)[t-i]}},o.prototype.getFrozenRightCellFromIndex=function(e,t){var i=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount(),r=this.getFrozenRightDataRows();return r[e]&&r[e].getElementsByClassName(bi)[t-i]},o.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().getElementsByClassName("e-headercell")[e]},o.prototype.getMovableColumnHeaderByIndex=function(e){var t=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableVirtualHeader().getElementsByClassName("e-headercell")[e-t]},o.prototype.getFrozenRightColumnHeaderByIndex=function(e){var t=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount();return this.getFrozenRightHeader().getElementsByClassName("e-headercell")[e-t]},o.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getFrozenVirtualHeader().getElementsByClassName("e-headercell")[e]},o.prototype.getRowObjectFromUID=function(e,i,r){var n=this.contentModule.getRows(),o=this.rowObject(n,e);return this.isFrozenGrid()&&(!o||i||r)?((!(o=this.rowObject(this.contentModule.getMovableRows(),e))&&"Left-Right"===this.getFrozenMode()||r)&&(o=this.rowObject(this.contentModule.getFrozenRightRows(),e)),o):t.isNullOrUndefined(o)&&this.enableVirtualization&&this.groupSettings.columns.length>0?o=this.rowObject(this.vRows,e):o},o.prototype.rowObject=function(e,t){for(var i=0,r=e;i<r.length;i++){var n=r[i];if(n.uid===t)return n}return null},o.prototype.getRowsObject=function(){return this.contentModule.getRows()},o.prototype.getMovableRowsObject=function(){var e=[];return this.isFrozenGrid()&&(e=this.contentModule.getMovableRows()),e},o.prototype.getFrozenRightRowsObject=function(){var e=[];return"Right"!==this.getFrozenMode()&&"Left-Right"!==this.getFrozenMode()||(e=this.contentModule.getFrozenRightRows()),e},o.prototype.getColumnHeaderByField=function(e){var t=this.getColumnByField(e);return t?this.getColumnHeaderByUid(t.uid):void 0},o.prototype.getColumnHeaderByUid=function(e){var t=this.getHeaderContent().querySelector("[e-mappinguid="+e+"]");return t?t.parentElement:void 0},o.prototype.getColumnByIndex=function(e){var t;return this.getColumns().some(function(i,r){return t=i,r===e}),t},o.prototype.getColumnByField=function(e){return S(this.getColumns(),function(t){if(t.field===e)return t})[0]},o.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[i].field===e)return i;return-1},o.prototype.getColumnByUid=function(e){return S(this.getColumns().concat(this.getStackedColumns(this.columns)),function(t){if(t.uid===e)return t})[0]},o.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,r=e;i<r.length;i++){var n=r[i];n.columns&&(t.push(n),this.getStackedColumns(n.columns,t))}return t},o.prototype.getColumnIndexByUid=function(e){var i=S(this.getColumns(),function(t,i){if(t.uid===e)return i})[0];return t.isNullOrUndefined(i)?-1:i},o.prototype.getUidByColumnField=function(e){return S(this.getColumns(),function(t){if(t.field===e)return t.uid})[0]},o.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},o.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&t.isNullOrUndefined(this.rowDropSettings.targetID)&&e++,e},o.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,r=this.getColumns().length;i<r;i++)(e=this.getColumns()[i]).visible&&t.push(e.field);return t},o.prototype.getRowTemplate=function(){return this.rowTemplateFn},o.prototype.getDetailTemplate=function(){return this.detailTemplateFn},o.prototype.getEditTemplate=function(){return this.editTemplateFn},o.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},o.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},o.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[t].isPrimaryKey&&e.push(this.columnModel[t].field);return e},o.prototype.refresh=function(){this.isDestroyed||(this.isManualRefresh=!0,this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},o.prototype.refreshHeader=function(){this.headerModule.refreshUI()},o.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},o.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},o.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},o.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},o.prototype.getSelectedColumnsUid=function(){var e=this,t=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(i){return t.push(e.getColumns()[i].uid)}),t},o.prototype.getDataModule=function(){return this.renderModule.data},o.prototype.showColumns=function(e,t){t=t||"headerText",this.showHider.show(e,t)},o.prototype.hideColumns=function(e,t){t=t||"headerText",this.showHider.hide(e,t)},o.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},o.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount},o.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount},o.prototype.getMovableColumnsCount=function(){return this.movableCount},o.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.splitFrozenCount(this.columns),this.frozenColumns&&(this.frozenLeftCount||this.frozenRightCount)&&this.setProperties({frozenColumns:0},!0),this.setTablesCount(),this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount&&(this.frozenName="Left-Right")},o.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},o.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},o.prototype.getVisibleMovableCount=function(){return this.visibleMovable},o.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},o.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},o.prototype.getMovableColumns=function(){return this.movableColumns},o.prototype.splitFrozenCount=function(e){for(var t=0;t<e.length;t++)e[t].columns?this.splitFrozenCount(e[t].columns):"Right"===e[t].freeze?(!1!==e[t].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[t]),this.frozenRightCount++):"Left"===e[t].freeze?(!1!==e[t].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[t]),this.frozenLeftCount++):(!1!==e[t].visible&&this.visibleMovable++,this.movableColumns.push(e[t]),this.movableCount++)},o.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},o.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},o.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[i].visible&&e++;if(this.frozenLeftCount||this.frozenRightCount)for(i=0;i<t.length;i++)!t[i].visible||"Left"!==t[i].freeze&&"Right"!==t[i].freeze||e++;return e},o.prototype.getVisibleFrozenCount=function(e,t){if(!this.frozenLeftCount&&!this.frozenRightCount)for(var i=0,r=e.length;i<r;i++)e[i].columns?t=this.getVisibleFrozenCount(e[i].columns,t):e[i].isFrozen&&e[i].visible&&t++;return t},o.prototype.getFrozenCount=function(e,t,i){for(var r=0,n=e.length;r<n;r++)e[r].columns?t=this.getFrozenCount(e[r].columns,t,i):(e[r].isFrozen&&i>this.frozenColumns-1&&t++,i++);return t},o.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},o.prototype.updateExternalMessage=function(e){this.pagerModule&&this.pagerModule.updateExternalMessage(e)},o.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},o.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},o.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},o.prototype.filterByColumn=function(e,t,i,r,n,o,s,l){this.filterModule&&this.filterModule.filterByColumn(e,t,i,r,n,o,s,l)},o.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},o.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},o.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},o.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},o.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},o.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},o.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},o.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},o.prototype.print=function(){this.printModule&&this.printModule.print()},o.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},o.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},o.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},o.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},o.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},o.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},o.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},o.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},o.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},o.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},o.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},o.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},o.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},o.prototype.recalcIndentWidth=function(){var e=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell").getAttribute("indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,i=[].slice.call(this.getHeaderTable().querySelector(ji).childNodes),r=[].slice.call(this.getContentTable().querySelector(ji).childNodes),n=t/30,o="Right"===this.getFrozenMode()?this.frozenRightCount:0,s=this.element.offsetWidth,l=function(t,n){if(De(e)){var o=(n/s*100).toFixed(1)+"%";i[t].style.width=o,r[t].style.width=o}else i[t].style.width=n+"px",r[t].style.width=n+"px";e.notify("column-width-changed",{index:t,width:n})};for(n>=1&&(t=30/n),t<1&&(t=1),(this.enableColumnVirtualization||this.isAutoGen)&&(t=30);o<this.groupSettings.columns.length;)l(o,t),o++;this.isDetail()&&(l(o,t),o++),this.isRowDragable()&&l(o,t),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").setAttribute("indentRefreshed","true")}},o.prototype.resetIndentWidth=function(){if(De(this)&&(this.getHeaderTable().querySelector(".e-emptycell").removeAttribute("indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth()),("auto"===this.width||"string"==typeof this.width&&-1!==this.width.indexOf("%"))&&this.getColumns().filter(function(e){return(!e.width||"auto"===e.width)&&e.minWidth}).length>0){var e=this.widthService.getTableWidth(this.getColumns());this.widthService.setMinwidthBycalculation(e)}this.isFrozenGrid()&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!==this.textWrapSettings.wrapMode&&this.notify(gi,{})},o.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},o.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},o.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},o.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},o.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},o.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},o.prototype.disableRowDD=function(e){var i=this.getHeaderTable(),r=this.getContentTable(),n=i.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),o=this.getRows(),s=e?"none":"";t.setStyleAttribute(i.querySelector(ji).childNodes[0],{display:s}),t.setStyleAttribute(r.querySelector(ji).childNodes[0],{display:s});for(var l=0;l<this.getRows().length;l++){h=o[l].firstElementChild;e?t.addClass([h],"e-hide"):t.removeClass([h],["e-hide"])}for(var a=0;a<i.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;a++){var h=n[a];e?t.addClass([h],"e-hide"):t.removeClass([h],["e-hide"])}},o.prototype.autoFitColumns=function(e){this.resizeModule&&this.resizeModule.autoFitColumns(e)},o.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},o.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new Tr(this)),this.serviceLocator.register("cellRendererFactory",new xr),this.serviceLocator.register("rendererFactory",new Ir),this.serviceLocator.register("localization",this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new yt(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new Qr(this)),this.serviceLocator.register("ariaService",this.ariaService=new er),this.serviceLocator.register("focus",this.focusModule=new Dr(this))},o.prototype.processModel=function(){var e,i,r=this.groupSettings.columns,n=this.sortSettings.columns;if(this.allowGrouping)for(var o=this,s=0,l=r.length;s<l;s++)!function(t,s){i=0;for(var l=n.length;i<l;i++)if(n[i].field===r[t]){e=!0;break}if(e?o.allowSorting?o.sortedColumns.push(n[i].field):n[i].direction="Ascending":n.push({field:r[t],direction:"Ascending",isFromGroup:!0}),!o.groupSettings.showGroupedColumn){var a=o.enableColumnVirtualization?o.columns.filter(function(e){return e.field===r[t]})[0]:o.getColumnByField(r[t]);a?a.visible=!1:o.log("initial_action",{moduleName:"group",columnName:r[t]})}}(s);if(!r.length)for(s=0;s<n.length;s++)this.sortedColumns.push(n[s].field);if(this.rowTemplateFn=x(this.rowTemplate),this.detailTemplateFn=x(this.detailTemplate),this.editTemplateFn=x(this.editSettings.template),this.editHeaderTemplateFn=x(this.editSettings.headerTemplate),this.editFooterTemplateFn=x(this.editSettings.footerTemplate),!t.isNullOrUndefined(this.parentDetails)){var a=t.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue;this.query.where(this.queryString,"equal",a,!0)}this.initForeignColumn()},o.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify("initForeignKeyColumn",this.getForeignKeyColumns())},o.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},o.prototype.gridRender=function(){this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),t.Browser.isDevice&&this.element.classList.add("e-device"),this.rowHeight&&this.element.classList.add("e-grid-min-height"),t.classList(this.element,["e-responsive","e-default"],[]);var i=this.serviceLocator.getService("rendererFactory");this.headerModule=i.getRenderer(e.RenderType.Header),this.contentModule=i.getRenderer(e.RenderType.Content),this.printModule=new yn(this,this.scrollModule),this.clipboardModule=new en(this),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},o.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},o.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},o.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup",styles:"display:none;"}),i=this.createElement("div",{className:Di,attrs:{tabIndex:"-1"}});t.append([i,this.createElement("div",{className:"e-uptail e-tail"})],e),i.appendChild(this.createElement("span")),t.append([i,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},o.prototype.updateGridLines=function(){switch(t.classList(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},o.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},o.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":J(this.element,!1),J(this.getContent(),!1),J(e,!0);break;case"Content":J(this.getContent(),!0),J(this.element,!1),J(e,!1);break;default:J(this.element,!0),J(this.getContent(),!1),J(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(gi,{})}},o.prototype.removeTextWrap=function(){J(this.element,!1),J([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),J(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(gi,{})},o.prototype.createTooltip=function(){this.toolTipObj=new r.Tooltip({opensOn:"custom",content:""},this.element)},o.prototype.freezeRefresh=function(){this.isFreezeRefresh=!0,this.enableVirtualization&&(this.pageSettings.currentPage=1),this.componentRefresh()},o.prototype.getTooltipStatus=function(e){var t=this.getHeaderTable(),i=this.createTable(t,"e-gridheader","header"),r=this.createTable(t,"e-gridheader","content"),n=e.classList.contains("e-headercell")?i:r,o=e.classList.contains("e-headercell")?"th":"tr";n.querySelector(o).className=e.className,n.querySelector(o).innerHTML=e.innerHTML;var s=n.querySelector(o).getBoundingClientRect().width;return document.body.removeChild(i),document.body.removeChild(r),s>e.getBoundingClientRect().width},o.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var i=O(e.target,"e-ellipsistooltip");this.prevElement===i&&"mouseout"!==e.type||this.toolTipObj.close();var r=e.target.tagName,n=["A","BUTTON","INPUT"];if(i&&"mouseout"!==e.type&&(!t.Browser.isDevice||-1===n.indexOf(r))){if(i.getAttribute("aria-describedby"))return;this.getTooltipStatus(i)&&(i.getElementsByClassName("e-headertext").length?this.toolTipObj.content=i.getElementsByClassName("e-headertext")[0].innerText:this.toolTipObj.content=i.innerText,this.prevElement=i,this.toolTipObj.open(i))}}this.hoverFrozenRows(e)},o.prototype.hoverFrozenRows=function(e){if(this.isFrozenGrid()){var t=O(e.target,Oi);if([].slice.call(this.element.getElementsByClassName("e-frozenhover")).length&&"mouseout"===e.type)for(var i=[].slice.call(this.element.getElementsByClassName("e-frozenhover")),r=0;r<i.length;r++)i[r].classList.remove("e-frozenhover");else if(t){(i=[].slice.call(this.element.querySelectorAll('tr[aria-rowindex="'+t.getAttribute(Hi)+'"]'))).splice(i.indexOf(t),1);for(r=0;r<i.length;r++)"true"!==t.getAttribute("aria-selected")&&i[r]?i[r].classList.add("e-frozenhover"):i[r]&&i[r].classList.remove("e-frozenhover")}}},o.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[t].clipMode)return!0;return!1},o.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},o.prototype.createTable=function(e,t,i){var r=this.createElement("div");r.className=this.element.className,r.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.createElement("div");n.className=t;var o=this.createElement("table");o.className=e.className,o.style.cssText="table-layout: auto;width: auto";var s="header"===i?"th":"td",l=this.createElement("tr"),a=this.createElement(s);return l.appendChild(a),o.appendChild(l),n.appendChild(o),r.appendChild(n),document.body.appendChild(r),r},o.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),t.EventHandler.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),t.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),t.EventHandler.add(this.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),t.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this),t.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},o.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.mouseClickHandler),t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),t.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),t.EventHandler.remove(this.element,"mousemove",this.mouseMoveHandler),t.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),t.EventHandler.remove(this.element,"keydown",this.keyPressHandler),t.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent),t.EventHandler.remove(document.body,"keydown",this.keyDownHandler),t.EventHandler.remove(window,"resize",this.resetIndentWidth)},o.prototype.addListener=function(){this.isDestroyed||(this.on(kt,this.dataReady,this),this.on(At,this.recalcIndentWidth,this),this.on(Ht,this.recalcIndentWidth,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(Rt,this.dataBoundFunction),this.on(Vt,this.onKeyPressed,this))},o.prototype.removeListener=function(){this.isDestroyed||(this.off(kt,this.dataReady),this.off(At,this.recalcIndentWidth),this.off(Ht,this.recalcIndentWidth),this.removeEventListener(Rt,this.dataBoundFunction),this.off(Vt,this.onKeyPressed))},o.prototype.getCurrentViewRecords=function(){return ce(this)?t.isNullOrUndefined(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:this.groupSettings.enableLazyLoading?this.currentViewData:this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length&&this.currentViewData.records?this.currentViewData.records:this.currentViewData},o.prototype.mouseClickHandler=function(e){if(!(this.isChildGrid(e)||O(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e))&&((this.allowRowDragAndDrop||!O(e.target,Ri)&&"TD"!==e.target.tagName)&&(this.allowGrouping||this.allowReordering||!O(e.target,"e-gridheader"))||!e.touches)){O(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!O(e.target,"e-filterbarcell")&&e.preventDefault();var i=this.getRowInfo(e.target);i.cancel=!1;var r=!1,n=t.closest(e.target,"tr");if(n&&n.getAttribute("data-uid")){var o=this.getRowObjectFromUID(n.getAttribute("data-uid"));r=!!o&&o.isDataRow}r&&this.trigger("recordClick",i),this.notify(Gt,e)}},o.prototype.checkEdit=function(e){var t=O(e.target,Oi),i="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains(Ai)||t.classList.contains(Bi));return!O(e.target,"e-unboundcelldiv")&&(i||O(e.target,bi)&&O(e.target,bi).classList.contains("e-editedbatchcell"))},o.prototype.dblClickHandler=function(e){var i=O(e.target,"e-grid");if(!t.isNullOrUndefined(i)&&i.id===this.element.id&&!t.closest(e.target,".e-unboundcelldiv")){var r=!1,n=t.closest(e.target,"tr");if(n&&n.getAttribute("data-uid")){var o=this.getRowObjectFromUID(n.getAttribute("data-uid"));r=!!o&&o.isDataRow}var s=this.getRowInfo(e.target);s.target=e.target,r&&this.trigger("recordDoubleClick",s),this.notify("dblclick",e)}},o.prototype.focusOutHandler=function(e){if(!this.isChildGrid(e)){O(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None");var i=this.element.querySelector(".e-cancel:not(.e-hide)");i&&i.classList.add("e-hide");var r=e.relatedTarget,n=r?r.getAttribute("aria-owns"):null;r&&(O(r,"e-grid")||(!t.isNullOrUndefined(n)&&n)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||t.Browser.isDevice||("Batch"===this.editSettings.mode&&(this.editModule.saveCell(),this.notify("editNextValCell",{})),"Normal"===this.editSettings.mode&&this.editModule.editFormValidate()),this.keyPress=!1}},o.prototype.isChildGrid=function(e){var t=O(e.target,"e-grid");return!(!t||t.id===this.element.id)},o.prototype.mergePersistGridData=function(e){var i=this.getLocalData();if(!t.isNullOrUndefined(i)&&""!==i||!t.isNullOrUndefined(e)){var r=t.isNullOrUndefined(e)?JSON.parse(i):e;this.enableVirtualization&&(r.pageSettings.currentPage=1);var n=Object.keys(r);this.isProtectedOnChange=!0;for(var o=0,s=n;o<s.length;o++){var l=s[o];"object"!=typeof this[l]||t.isNullOrUndefined(this[l])?this[l]=r[l]:Array.isArray(this[l])&&"columns"===l?(I(this[l]),this.mergeColumns(r[l],this[l]),this[l]=r[l]):t.extend(this[l],r[l])}this.isProtectedOnChange=!1}},o.prototype.mergeColumns=function(e,i){for(var r=e,n=this,o=0;o<r.length;o++)!function(e){var o=i.filter(function(t){return t.index===r[e].index})[0];t.isNullOrUndefined(o)||(o.columns&&o.columns.length?(n.mergeColumns(r[e].columns,o.columns),r[e]=t.extend(o,r[e],{},!0)):r[e]=t.extend(o,r[e],{},!0))}(o)},o.prototype.isDetail=function(){return!t.isNullOrUndefined(this.detailTemplate)||!t.isNullOrUndefined(this.childGrid)},o.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},o.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},o.prototype.keyPressHandler=function(e){var i=t.extend(e,{cancel:!1});this.trigger("keyPressed",i),!0===i.cancel&&e.stopImmediatePropagation()},o.prototype.keyDownHandler=function(e){e.altKey&&(74===e.keyCode&&(this.keyA?(this.notify("group-collapse",{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule.focusHeader(),this.focusModule.addOutline())),87===e.keyCode&&(this.focusModule.focusContent(),this.focusModule.addOutline()),65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify("group-collapse",{target:e.target,collapse:!0}),this.keyA=!1)),13===e.keyCode&&this.notify("enter-key-handler",e)},o.prototype.keyActionHandler=function(e){this.isChildGrid(e)||this.isEdit&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=!0,this.allowKeyboard&&("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(Vt,e)))},o.prototype.setInjectedModules=function(e){this.injectedModules=e},o.prototype.updateColumnObject=function(){T(this.columns,this.enableColumnVirtualization,this),I(this.columns),this.initForeignColumn(),this.notify(ei,{})},o.prototype.getForeignKeyColumns=function(){return this.getColumns().filter(function(e){return e.isForeignColumn()})},o.prototype.getRowHeight=function(){return this.rowHeight?this.rowHeight:V(this.element)},o.prototype.refreshColumns=function(){this.setFrozenCount();var e=this.getContent().querySelector(".e-frozen-left-content"),i=this.getContent().querySelector(".e-frozen-right-content"),r=!this.frozenRightCount&&!this.frozenLeftCount;if(!(0!==this.getFrozenColumns())&&(!e&&this.frozenLeftCount||!i&&this.frozenRightCount||e&&!this.frozenLeftCount||i&&!this.frozenRightCount))this.tableIndex=0,this.tablesCount=1,this.enableColumnVirtualization&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.freezeRefresh();else if(r&&(1===this.getFrozenColumns()&&!e||0===this.getFrozenColumns()&&e))this.tableIndex=0,this.tablesCount=1,this.enableColumnVirtualization&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.freezeRefresh();else if(this.isPreventScrollEvent=!0,this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()){var n=this.contentModule.getMovableContent().querySelector("."+Mi);t.remove(n.querySelector(ji));var o=this.getHeaderContent().querySelector("."+Ii).querySelector(ji).cloneNode(!0);if(n.insertBefore(o,n.querySelector(Ui)),"Left-Right"===this.getFrozenMode()){var s=this.contentModule.getFrozenRightContent().querySelector("."+Mi);t.remove(s.querySelector(ji));var l=this.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji).cloneNode(!0);s.insertBefore(l,s.querySelector(Ui))}}if(this.isFrozenGrid()){var a=this.getContent().querySelector(".e-movablescrollbar").scrollLeft;this.headerModule.getMovableHeader().scrollLeft=a,this.contentModule.getMovableContent().scrollLeft=a}},o.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!1,r):null},o.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,r):null},o.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule?this.pdfExportModule.Map(this,e,t,i,r):null},o.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},o.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},o.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},o.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},o.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},o.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},o.prototype.scrollRefresh=function(){var e=this,t=function(){e.scrollModule.refresh(),e.off(At,t)};this.on(At,t,this)},o.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},o.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},o.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},o.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},o.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},o.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},o.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},o.prototype.ensureModuleInjected=function(e){return this.getInjectedModules().indexOf(e)>=0},o.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},o.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.log(e,t)},o.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},o.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},o.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+Di),t=this.getContent().querySelector(".e-scrollbar");if(e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto"),this.isFrozenGrid()&&t){var i=this.getContent().querySelector(".e-movablescrollbar"),r=this.getContent().querySelector(".e-movablechild");t.style.display="flex",i.offsetWidth>=r.offsetWidth&&(t.style.display="none",this.notify("frozenHeight",0))}},o.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[t]:e;for(var i=this.getRowsObject(),r=0;r<i.length;r++)if(!i[r].isDetailRow&&!i[r].isCaptionRow){var n=i[r].data[t];if(t.split(".").length>1&&(n=Ke(t,i[r].data)),n===e)return i[r].index}return-1},o.prototype.grabColumnByFieldFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,r=0;r<i.length;r++)e===i[r].field&&(t=i[r]);return t},o.prototype.grabColumnByUidFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,r=0;r<i.length;r++)e===i[r].uid&&(t=i[r]);return t},o.prototype.getFilteredRecords=function(){if(this.allowFiltering&&this.filterSettings.columns.length){var e=this.renderModule.data.generateQuery(!0);return this.dataSource&&this.renderModule.data.isRemote()&&this.dataSource instanceof i.DataManager?this.renderModule.data.getData(this.dataSource,e):this.dataSource instanceof i.DataManager?this.dataSource.executeLocal(e):new i.DataManager(this.dataSource,e).executeLocal(e)}return[]},o.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},o.prototype.tapEvent=function(t){this.getUserAgent()&&(e.Global.timer?(clearTimeout(e.Global.timer),e.Global.timer=null,this.dblClickHandler(t),this.notify("double-tap",t)):e.Global.timer=setTimeout(function(){e.Global.timer=null},300))},o.prototype.getRowUid=function(e){return""+e+this.rowUid++},o.prototype.getMovableVirtualContent=function(){return this.getContent().querySelector("."+Ei)},o.prototype.getFrozenVirtualContent=function(){return this.getContent().querySelector("."+Ti)},o.prototype.getMovableVirtualHeader=function(){return this.getHeaderContent().querySelector("."+Ii)},o.prototype.getFrozenVirtualHeader=function(){return this.getHeaderContent().querySelector("."+zi)},o.prototype.getRowElementByUID=function(e){var t,i=[];if(this.isFrozenGrid()){var r=[].slice.call(this.getFrozenVirtualContent().querySelector(Ui).children),n=[].slice.call(this.getMovableVirtualContent().querySelector(Ui).children),o=[];if(3===this.tablesCount&&(o=[].slice.call(this.getContent().querySelector(".e-frozen-right-content").querySelector(Ui).children)),this.frozenRows){if(i=[].slice.call(this.getFrozenVirtualHeader().querySelector(Ui).children),i=i.concat([].slice.call(this.getMovableVirtualHeader().querySelector(Ui).children)),3===this.tablesCount){var s=this.getHeaderContent().querySelector(".e-frozen-right-header");i=i.concat([].slice.call(s.querySelector(Ui).children)).concat(o)}i=i.concat(r).concat(n)}else i=r.concat(n).concat(o)}else{var l=[].slice.call(this.getContent().querySelector(Ui).children);i=this.frozenRows?(i=[].slice.call(this.getHeaderContent().querySelector(Ui).children)).concat(l):l}for(var a=0,h=i;a<h.length;a++){var d=h[a];if(d.getAttribute("data-uid")===e){t=d;break}}return t},o.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var r=i[t];!1===r.visible&&e.push(r)}return e},o.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if(-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),e>this.getNoncontentHeight()+this.getRowHeight()){t=(e-this.getNoncontentHeight())/this.getRowHeight()}if(t>0)return Math.floor(t)}return 0},o.prototype.getNoncontentHeight=function(){var e=0;if(t.isNullOrUndefined(this.getHeaderContent().clientHeight)||(e+=this.getHeaderContent().clientHeight),this.toolbar&&!t.isNullOrUndefined(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!t.isNullOrUndefined(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.showColumnChooser&&!t.isNullOrUndefined(this.element.querySelector(".e-columnheader").clientHeight)&&(e+=this.element.querySelector(".e-columnheader").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!t.isNullOrUndefined(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),this.aggregates.length>0&&!t.isNullOrUndefined(this.element.querySelector(".e-summaryrow").clientHeight))for(var i=0;i<this.element.getElementsByClassName("e-summaryrow").length;i++)e+=this.element.getElementsByClassName("e-summaryrow")[i].clientHeight;return e},o.prototype.getSummaryValues=function(e,t){return i.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},o.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportGrid(e)},o.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportGrid(e)},o.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportGrid(e)},o.prototype.exportGrid=function(e){var t=this.getDataModule().generateQuery(!0),r=(new i.UrlAdaptor).processQuery(new i.DataManager({url:""}),t),n=JSON.parse(r.data),o=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"])),s=["field","headerText","type","format","visible","foreignKeyValue","foreignKeyField","template","index","width","textAlign","headerTextAlign","columns"];o.filterSettings.columns=n.where,o.searchSettings.fields=n.search&&n.search[0].fields||[],o.sortSettings.columns=n.sorted,o.columns=this.setHeaderText(o.columns,s);var l=this.createElement("form",{id:"ExportForm",styles:"display:none;"}),a=this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}});a.value=JSON.stringify(o),l.method="POST",l.action=e,l.appendChild(a),document.body.appendChild(l),l.submit(),l.remove()},o.prototype.setHeaderText=function(e,i){for(var r=0;r<e.length;r++){var n=this.getColumnByUid(e[r].uid);e[r].headerText=n.headerText,t.isNullOrUndefined(n.template)||(e[r].template="true"),e[r].format&&(e[r].format=_e(this.getFormat(e[r].format),e[r].type,this.isExcel)),e[r].columns&&this.setHeaderText(e[r].columns,i);for(var o=Object.keys(e[r]),s=0;s<o.length;s++)i.indexOf(o[s])<0&&delete e[r][o[s]]}return e},o.prototype.getFormat=function(e){return"object"==typeof e?t.isNullOrUndefined(e.format)?e.skeleton:e.format:e},o.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},o.prototype.updateRowValue=function(e,t){var i={requestType:"save",data:t};this.showSpinner(),this.notify(ti,i),this.refresh()},o.prototype.setForeignKeyData=function(){this.dataBind();var e=this.getDataModule().getForeignKeyDataState();e.isPending?(this.getDataModule().setForeignKeyDataState({}),e.resolver()):(this.getDataModule().setForeignKeyDataState({isDataChanged:!1}),(this.contentModule||this.headerModule)&&this.renderModule.render())},o.prototype.resetFilterDlgPosition=function(e){var t=this.getColumnHeaderByField(e);if(t){var i=t.querySelector(".e-filtermenudiv"),r=this.element.querySelector(".e-filter-popup");if(i&&r){var n=this.element.getBoundingClientRect(),o=i.getBoundingClientRect();r&&(r.style.left=(o.right-n.left).toString()+"px")}}},o.prototype.renderTemplates=function(){this.notify("reactTemplateRender",this.portals),this.renderReactTemplates()},o.prototype.batchUpdate=function(e){this.processRowChanges(e)},o.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},o.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=["addedRecords","changedRecords","deletedRecords"],r=this.getPrimaryKeyFieldNames()[0],n=0;n<i.length;n++)e[i[n]]&&Oe(this,e,i[n],r);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},o.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0];e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e);var r=this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount());this.getDataModule().isRemote()?r.then(function(){t.setNewData()}):this.setNewData()},o.prototype.setNewData=function(){var e=this,t=JSON.parse(JSON.stringify(this.getCurrentViewRecords()));this.getDataModule().getData({},this.getDataModule().generateQuery().requiresCount()).then(function(i){e.bulkRefresh(i.result,t,i.count)})},o.prototype.deleteRowElement=function(e){var i=this.getRowElementByUID(e.uid),r=parseInt(i.getAttribute(Hi),10);if(t.remove(i),this.getFrozenColumns()){var n=this.getMovableRows()[r];t.remove(n)}},o.prototype.bulkRefresh=function(e,t,i){for(var r,n=this,o=this.getRowsObject(),s=this.getPrimaryKeyFieldNames()[0],l=this,a=0;a<o.length;a++)!function(t){e.filter(function(e){return e[s]===o[t].data[s]}).length||(l.deleteRowElement(o[t]),o.splice(t,1),t--),r=t}(a),a=r;for(var h=this,a=0;a<e.length;a++)!function(i){var r;t.filter(function(t){t[s]===e[i][s]&&(t!==e[i]&&n.setRowData(e[i][s],e[i]),r=!0)}),r||h.renderRowElement(e[i],i)}(a);this.currentViewData=e;var d=[].slice.call(this.getContentTable().getElementsByClassName(Oi));Me(this,this.getRowsObject(),d),ke(this),this.allowPaging&&this.notify(Nt,{module:"pager",properties:{totalRecordsCount:i}})},o.prototype.renderRowElement=function(e,t){var i,r=new Vi(this.serviceLocator,null,this),n=new Gi(this).generateRows([e]),o=r.render(n[0],this.getColumns());this.addRowObject(n[0],t);var s=this.getContentTable().querySelector(Ui);if(s.querySelector(".e-emptyrow")){var l=s.querySelector(".e-emptyrow");if(l.parentNode.removeChild(l),this.getFrozenColumns()){var a=this.getContent().querySelector("."+Ei).querySelector(Ui);a.firstElementChild.parentNode.removeChild(a.firstElementChild)}}this.getFrozenColumns()&&(i=de(o,this.getFrozenColumns(),this),(this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector("."+Ii).querySelector(Ui):this.getContent().querySelector("."+Ei).querySelector(Ui)).appendChild(i),"auto"===this.height&&this.notify("frozenHeight",{})),s=this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector(Ui):this.getContent().querySelector(Ui),(s=this.getContent().querySelector(Ui)).appendChild(o)},o.prototype.addRowObject=function(e,t){var i=this.getFrozenColumns();if(i){var r=this.getMovableRowsObject(),n=e.clone();n.cells=n.cells.slice(i),e.cells=e.cells.slice(0,i),r.splice(t,1,n)}this.getRowsObject().splice(t,1,e)},o.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1===e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e,10):parseInt(e,10)/100*this.element.clientHeight},o.prototype.getFrozenRightContent=function(){return this.getContent().querySelector(".e-frozen-right-content")},o.prototype.getFrozenRightHeader=function(){return this.getHeaderContent().querySelector(".e-frozen-right-header")},o.prototype.getMovableHeaderTbody=function(){return this.getMovableVirtualHeader().querySelector(Ui)},o.prototype.getMovableContentTbody=function(){return this.getMovableVirtualContent().querySelector(Ui)},o.prototype.getFrozenHeaderTbody=function(){return this.getFrozenVirtualHeader().querySelector(Ui)},o.prototype.getFrozenLeftContentTbody=function(){return this.getFrozenVirtualContent().querySelector(Ui)},o.prototype.getFrozenRightHeaderTbody=function(){return this.getFrozenRightHeader().querySelector(Ui)},o.prototype.getFrozenRightContentTbody=function(){var e;return this.getFrozenRightContent()&&(e=this.getFrozenRightContent().querySelector(Ui)),e},o.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},o.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},o.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},o.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},o.prototype.getCurrentVisibleColumns=function(e){for(var t=[],i=0,r=e?this.getColumns():this.columnModel;i<r.length;i++){var n=r[i];n.visible&&t.push(n)}return t};var s;return rn([t.Property()],o.prototype,"parentDetails",void 0),rn([t.Property([])],o.prototype,"columns",void 0),rn([t.Property(!0)],o.prototype,"enableAltRow",void 0),rn([t.Property(!0)],o.prototype,"enableHover",void 0),rn([t.Property(!1)],o.prototype,"enableAutoFill",void 0),rn([t.Property(!0)],o.prototype,"allowKeyboard",void 0),rn([t.Property(!1)],o.prototype,"allowTextWrap",void 0),rn([t.Complex({},pn)],o.prototype,"textWrapSettings",void 0),rn([t.Complex({},un)],o.prototype,"resizeSettings",void 0),rn([t.Property(!1)],o.prototype,"allowPaging",void 0),rn([t.Complex({},Ur)],o.prototype,"pageSettings",void 0),rn([t.Property(!1)],o.prototype,"enableVirtualization",void 0),rn([t.Property(!1)],o.prototype,"enableColumnVirtualization",void 0),rn([t.Property(!1)],o.prototype,"enableInfiniteScrolling",void 0),rn([t.Complex({},dn)],o.prototype,"searchSettings",void 0),rn([t.Property(!1)],o.prototype,"allowSorting",void 0),rn([t.Property("Ellipsis")],o.prototype,"clipMode",void 0),rn([t.Property(!0)],o.prototype,"allowMultiSorting",void 0),rn([t.Property(!1)],o.prototype,"allowExcelExport",void 0),rn([t.Property(!1)],o.prototype,"allowPdfExport",void 0),rn([t.Complex({},on)],o.prototype,"sortSettings",void 0),rn([t.Complex({},ln)],o.prototype,"infiniteScrollSettings",void 0),rn([t.Property(!0)],o.prototype,"allowSelection",void 0),rn([t.Property(-1)],o.prototype,"selectedRowIndex",void 0),rn([t.Complex({},hn)],o.prototype,"selectionSettings",void 0),rn([t.Property(!1)],o.prototype,"allowFiltering",void 0),rn([t.Property("Horizontal")],o.prototype,"rowRenderingMode",void 0),rn([t.Property(!1)],o.prototype,"enableAdaptiveUI",void 0),rn([t.Property(!1)],o.prototype,"allowReordering",void 0),rn([t.Property(!1)],o.prototype,"allowResizing",void 0),rn([t.Property(!1)],o.prototype,"allowRowDragAndDrop",void 0),rn([t.Complex({},cn)],o.prototype,"rowDropSettings",void 0),rn([t.Complex({},an)],o.prototype,"filterSettings",void 0),rn([t.Property(!1)],o.prototype,"allowGrouping",void 0),rn([t.Property(!1)],o.prototype,"enableImmutableMode",void 0),rn([t.Property(!1)],o.prototype,"showColumnMenu",void 0),rn([t.Complex({},gn)],o.prototype,"groupSettings",void 0),rn([t.Complex({},fn)],o.prototype,"editSettings",void 0),rn([t.Collection([],$r)],o.prototype,"aggregates",void 0),rn([t.Property(!1)],o.prototype,"showColumnChooser",void 0),rn([t.Complex({},Gr)],o.prototype,"columnChooserSettings",void 0),rn([t.Property(!1)],o.prototype,"enableHeaderFocus",void 0),rn([t.Property("auto")],o.prototype,"height",void 0),rn([t.Property("auto")],o.prototype,"width",void 0),rn([t.Property("Default")],o.prototype,"gridLines",void 0),rn([t.Property()],o.prototype,"rowTemplate",void 0),rn([t.Property()],o.prototype,"detailTemplate",void 0),rn([t.Property()],o.prototype,"childGrid",void 0),rn([t.Property()],o.prototype,"queryString",void 0),rn([t.Property("AllPages")],o.prototype,"printMode",void 0),rn([t.Property("Expanded")],o.prototype,"hierarchyPrintMode",void 0),rn([t.Property([])],o.prototype,"dataSource",void 0),rn([t.Property(null)],o.prototype,"rowHeight",void 0),rn([t.Property()],o.prototype,"query",void 0),rn([t.Property("USD")],o.prototype,"currencyCode",void 0),rn([t.Property()],o.prototype,"toolbar",void 0),rn([t.Property()],o.prototype,"contextMenuItems",void 0),rn([t.Property()],o.prototype,"columnMenuItems",void 0),rn([t.Property()],o.prototype,"toolbarTemplate",void 0),rn([t.Property()],o.prototype,"pagerTemplate",void 0),rn([t.Property(0)],o.prototype,"frozenRows",void 0),rn([t.Property(0)],o.prototype,"frozenColumns",void 0),rn([t.Property("All")],o.prototype,"columnQueryMode",void 0),rn([t.Property({})],o.prototype,"currentAction",void 0),rn([t.Property("19.2.46")],o.prototype,"ej2StatePersistenceVersion",void 0),rn([t.Event()],o.prototype,"created",void 0),rn([t.Event()],o.prototype,"destroyed",void 0),rn([t.Event()],o.prototype,"load",void 0),rn([t.Event()],o.prototype,"rowDataBound",void 0),rn([t.Event()],o.prototype,"queryCellInfo",void 0),rn([t.Event()],o.prototype,"headerCellInfo",void 0),rn([t.Event()],o.prototype,"actionBegin",void 0),rn([t.Event()],o.prototype,"actionComplete",void 0),rn([t.Event()],o.prototype,"actionFailure",void 0),rn([t.Event()],o.prototype,"dataBound",void 0),rn([t.Event()],o.prototype,"recordDoubleClick",void 0),rn([t.Event()],o.prototype,"recordClick",void 0),rn([t.Event()],o.prototype,"rowSelecting",void 0),rn([t.Event()],o.prototype,"rowSelected",void 0),rn([t.Event()],o.prototype,"rowDeselecting",void 0),rn([t.Event()],o.prototype,"rowDeselected",void 0),rn([t.Event()],o.prototype,"cellSelecting",void 0),rn([t.Event()],o.prototype,"cellSelected",void 0),rn([t.Event()],o.prototype,"cellDeselecting",void 0),rn([t.Event()],o.prototype,"cellDeselected",void 0),rn([t.Event()],o.prototype,"columnSelecting",void 0),rn([t.Event()],o.prototype,"columnSelected",void 0),rn([t.Event()],o.prototype,"columnDeselecting",void 0),rn([t.Event()],o.prototype,"columnDeselected",void 0),rn([t.Event()],o.prototype,"columnDragStart",void 0),rn([t.Event()],o.prototype,"columnDrag",void 0),rn([t.Event()],o.prototype,"columnDrop",void 0),rn([t.Event()],o.prototype,"printComplete",void 0),rn([t.Event()],o.prototype,"beforePrint",void 0),rn([t.Event()],o.prototype,"pdfQueryCellInfo",void 0),rn([t.Event()],o.prototype,"pdfHeaderQueryCellInfo",void 0),rn([t.Event()],o.prototype,"pdfAggregateQueryCellInfo",void 0),rn([t.Event()],o.prototype,"excelAggregateQueryCellInfo",void 0),rn([t.Event()],o.prototype,"exportDetailDataBound",void 0),rn([t.Event()],o.prototype,"excelQueryCellInfo",void 0),rn([t.Event()],o.prototype,"excelHeaderQueryCellInfo",void 0),rn([t.Event()],o.prototype,"beforeExcelExport",void 0),rn([t.Event()],o.prototype,"excelExportComplete",void 0),rn([t.Event()],o.prototype,"beforePdfExport",void 0),rn([t.Event()],o.prototype,"pdfExportComplete",void 0),rn([t.Event()],o.prototype,"rowDragStartHelper",void 0),rn([t.Event()],o.prototype,"detailDataBound",void 0),rn([t.Event()],o.prototype,"rowDragStart",void 0),rn([t.Event()],o.prototype,"rowDrag",void 0),rn([t.Event()],o.prototype,"rowDrop",void 0),rn([t.Event()],o.prototype,"toolbarClick",void 0),rn([t.Event()],o.prototype,"beforeOpenColumnChooser",void 0),rn([t.Event()],o.prototype,"beforeOpenAdaptiveDialog",void 0),rn([t.Event()],o.prototype,"batchAdd",void 0),rn([t.Event()],o.prototype,"batchDelete",void 0),rn([t.Event()],o.prototype,"batchCancel",void 0),rn([t.Event()],o.prototype,"beforeBatchAdd",void 0),rn([t.Event()],o.prototype,"beforeBatchDelete",void 0),rn([t.Event()],o.prototype,"beforeBatchSave",void 0),rn([t.Event()],o.prototype,"beginEdit",void 0),rn([t.Event()],o.prototype,"commandClick",void 0),rn([t.Event()],o.prototype,"cellEdit",void 0),rn([t.Event()],o.prototype,"cellSave",void 0),rn([t.Event()],o.prototype,"cellSaved",void 0),rn([t.Event()],o.prototype,"resizeStart",void 0),rn([t.Event()],o.prototype,"resizing",void 0),rn([t.Event()],o.prototype,"resizeStop",void 0),rn([t.Event()],o.prototype,"keyPressed",void 0),rn([t.Event()],o.prototype,"beforeDataBound",void 0),rn([t.Event()],o.prototype,"contextMenuOpen",void 0),rn([t.Event()],o.prototype,"contextMenuClick",void 0),rn([t.Event()],o.prototype,"columnMenuOpen",void 0),rn([t.Event()],o.prototype,"columnMenuClick",void 0),rn([t.Event()],o.prototype,"checkBoxChange",void 0),rn([t.Event()],o.prototype,"beforeCopy",void 0),rn([t.Event()],o.prototype,"beforePaste",void 0),rn([t.Event()],o.prototype,"beforeAutoFill",void 0),rn([t.Event()],o.prototype,"columnDataStateChange",void 0),rn([t.Event()],o.prototype,"dataStateChange",void 0),rn([t.Event()],o.prototype,"dataSourceChanged",void 0),rn([t.Event()],o.prototype,"exportGroupCaption",void 0),rn([t.Event()],o.prototype,"lazyLoadGroupExpand",void 0),rn([t.Event()],o.prototype,"lazyLoadGroupCollapse",void 0),o=s=rn([t.NotifyPropertyChanges],o)}(t.Component),yn=function(){function e(e,t){this.isAsyncPrint=!1,this.defered=new i.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(At,this.isContentReady(),this),this.parent.addEventListener(bt,this.actionBegin.bind(this)),this.parent.on(Pt,this.onEmpty.bind(this)),this.parent.on(si,this.hierarchyPrint,this),this.scrollModule=t)}return e.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},e.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},e.prototype.print=function(){this.renderPrintGrid(),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight)},e.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},e.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},e.prototype.renderPrintGrid=function(){var e=this.parent,i=t.createElement("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"});i.classList.remove("e-gridhover"),document.body.appendChild(i);var r=new mn(fe(e,e.hierarchyPrintMode));if(e.isFrozenGrid()&&!e.getFrozenColumns())for(var n=0;n<r.columns.length;n++)r.columns[n]=t.extend({},r.columns[n]),r.columns[n].freeze=void 0;this.parent.isAngular&&(r.viewContainerRef=this.parent.viewContainerRef),r.load=function(){},r.query=e.getQuery().clone(),window.printGridObj=r,r.isPrinting=!0;var o=r.getInjectedModules(),s=e.getInjectedModules();o&&o.length===s.length||r.setInjectedModules(s),e.notify("printGrid-Init",{element:i,printgrid:r}),this.parent.log("exporting_begin",this.getModuleName()),r.registeredTemplate=this.parent.registeredTemplate,r.appendTo(i),r.trigger=e.trigger},e.prototype.contentReady=function(){if(this.isPrintGrid()){var e=this.parent;if(this.isAsyncPrint)return void this.printGrid();var i={requestType:"print",element:e.element,selectedRows:e.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:e.hierarchyPrintMode};if(this.isAsyncPrint||e.trigger("beforePrint",i),i.cancel)return void t.detach(e.element);this.isAsyncPrint||this.printGrid()}},e.prototype.printGrid=function(){var e=this.parent;if("auto"!==e.height){var i=this.scrollModule.getCssProperties(),r=e.element.querySelector("."+Di),n=e.element.querySelector("."+Si);r.style.height="auto",r.style.overflowY="auto",n.style[i.padding]="",n.firstElementChild.style[i.border]=""}e.allowGrouping&&(e.groupSettings.columns.length?this.removeColGroup(e):e.element.querySelector(".e-groupdroparea").style.display="none");for(var o=0,s=[].slice.call(e.element.getElementsByClassName(Di));o<s.length;o++)(d=s[o]).style.overflowX="hidden";for(var l=[].slice.call(e.element.getElementsByClassName("e-spin-show")),a=0,h=[].slice.call(l);a<h.length;a++){var d=h[a];t.classList(d,["e-spin-hide"],["e-spin-show"])}this.printGridElement(e),e.isPrinting=!1,delete window.printGridObj;var c={element:e.element};e.trigger("printComplete",c),this.parent.log("exporting_complete",this.getModuleName())},e.prototype.printGridElement=function(e){t.classList(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&t.detach(e.element),this.printWind=t.print(e.element,this.printWind)},e.prototype.removeColGroup=function(e){var i=e.groupSettings.columns.length,r=e.element,n="#"+e.element.id;if(i){for(var o=t.selectAll(n+"captioncell.e-groupcaption",r),s=o[i-1].getAttribute("colspan"),l=0;l<o.length;l++)o[l].setAttribute("colspan",s);var a=t.selectAll("colgroup"+n+"colGroup",r),h=t.selectAll(".e-content colgroup",r);this.hideColGroup(a,i),this.hideColGroup(h,i)}},e.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var r=0;r<t;r++)e[i].children[r].style.display="none"},e.prototype.isPrintGrid=function(){return this.parent.element.id.indexOf("_print")>0&&this.parent.isPrinting},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(At,this.contentReady.bind(this)),this.parent.removeEventListener(bt,this.actionBegin.bind(this)),this.parent.off(Pt,this.onEmpty.bind(this)),this.parent.off(si,this.hierarchyPrint))},e.prototype.getModuleName=function(){return"print"},e.printGridProp=["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"].concat(["beforePrint","printComplete","load"]),e}(),vn=0,Cn=0,wn=null;!function(e){e.timer=null}(e.Global||(e.Global={}));var bn=function(){function e(e){this.existingPredicate={},this.foreignKeyQuery=new i.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new yt(this.parent.locale),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){this.closeDialog()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlg,"click",this.clickHandler,this),t.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=t.debounce(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.add(e,"keyup",this.searchHandler,this)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.dlg,"click",this.clickHandler),t.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.remove(e,"keyup",this.searchHandler)},e.prototype.foreignKeyFilter=function(e,t,i){var r=this,n={},o=[],s=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(s.where(i)).then(function(i){r.options.column.columnData=i.result,r.parent.notify("generateQuery",{predicate:n,column:r.options.column}),e.ejpredicate=n.predicate.predicates;for(var s=n.predicate.predicates,l=0;l<s.length;l++)o.push({field:s[l].field,predicate:"or",matchCase:s[l].ignoreCase,ignoreAccent:s[l].ignoreAccent,operator:s[l].operator,value:s[l].value,type:r.options.type});e.filterCollection=o.length?o:t.filter(function(e){return e.field=r.options.field}),r.options.handler(e)})},e.prototype.foreignFilter=function(e,t){var r=this.options.isRemote?"string"===this.options.column.type?"contains":"equal":this.options.column.type?"contains":"equal",n=new i.Predicate(this.options.column.foreignKeyValue,r,t,!0,this.options.ignoreAccent);this.foreignKeyFilter(e,[e.filterCollection],n)},e.prototype.searchBoxClick=function(e){e.target.classList.contains("e-searchclear")&&(this.sInput.value="",this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},e.prototype.searchBoxKeyUp=function(e){this.refreshCheckboxes(),this.updateSearchIcon()},e.prototype.updateSearchIcon=function(){this.sInput.value.length?t.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]):t.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"])},e.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},e.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof i.DataManager))for(var t=0;t<e.length;t++)if("object"!=typeof e){var r={};r[this.options.field]=e[t],e[t]=r}},e.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.options.dataManager=e.dataManager?e.dataManager:e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.ignoreAccent=e.ignoreAccent||!1,this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.query=e.query||new i.Query,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length},e.prototype.getAndSetChkElem=function(e){if(this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{uid:this.options.column.uid},className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),!e.hideSearchbox){this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox);var t={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search")}};o.Input.createInput(t,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)}return this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},e.prototype.showDialog=function(e){var i={requestType:"filterbeforeopen",columnName:this.options.field,columnType:this.options.type,cancel:!1};if(i.filterModel=this,this.parent.notify("cbox-filter-begin",i),!i.cancel){this.dialogObj=new r.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!t.isNullOrUndefined(O(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this)});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e),this.dlg.setAttribute("aria-label",this.getLocalizedLabel("ExcelFilterDialogARIA")),e.isResponsiveFilter?document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlg):this.parent.element.appendChild(this.dlg),this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),r.createSpinner({target:this.spinner},this.parent.createElement),r.showSpinner(this.spinner),this.getAllData()}},e.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},e.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":t.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:ee(this.options.target,this.dialogObj),this.parent.notify("filterDialogCreated",e)},e.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},e.prototype.closeDialog=function(){if(this.dialogObj&&!this.dialogObj.isDestroyed){var e=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),i=this.parent.registeredTemplate;e.length&&!t.isNullOrUndefined(i)&&i.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.isReact&&void 0!==this.parent.destroyTemplate&&(this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.renderTemplates()),this.parent.notify("filter-menu-close",{field:this.options.field}),this.dialogObj.destroy(),this.unWireEvents(),t.remove(this.dlg),this.dlg=null,this.parent.notify("filter-dialog-close",{})}},e.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(ci,t),t.cancel||this.options.handler({action:"clear-filter",field:e?e.field:this.options.field})},e.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")){var t=e.target.value;"boolean"===this.options.column.type&&(""!==t&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(t.toLowerCase())?t=!0:""!==t&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(t.toLowerCase())&&(t=!1));var i={action:"filtering",filterCollection:{field:this.options.field,operator:this.options.isRemote?"string"===this.options.column.type?"contains":"equal":"date"===this.options.column.type||"datetime"===this.options.column.type||"boolean"===this.options.column.type?"equal":"contains",value:t,matchCase:!1,type:this.options.column.type,ignoreAccent:this.options.ignoreAccent},field:this.options.field};void 0!==t&&null!==t&&""!==t?this.isForeignColumn(this.options.column)?this.foreignFilter(i,t):this.options.handler(i):this.closeDialog()}else if(13===e.keyCode)this.fltrBtnHandler();else{var r=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===r?this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===r&&this.clearFilter()}this.closeDialog()}else"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog())},e.prototype.fltrBtnHandler=function(){var i=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall)")),r=i,n="equal",o=this.dialogObj.element.querySelector(".e-dropdownlist");o&&(this.options.operator=n=o.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator;var s;this.options.hideSearchbox||(s=this.searchBox.querySelector(".e-searchinput"));var l=this.options.allowCaseSensitive,a={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:n,type:this.options.type,matchCase:l,ignoreAccent:this.options.ignoreAccent},h=this.itemsCnt!==i.length&&this.itemsCnt-i.length<i.length;h&&s&&""===s.value&&(n=this.isMenuNotEqual?"equal":"notequal",i=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),a.predicate=this.isMenuNotEqual?"or":"and",a.operator=n);var d,c,p,u,g=[];if(i.length!==this.itemsCnt||s&&s.value&&""!==s.value){for(var f=0;f<i.length;f++){d=this.values[O(i[f],"e-ftrchk").getAttribute("uid")],u=t.extend({},{value:d},a),d&&!d.toString().length&&(u.operator=h?"notequal":"equal"),""===d||t.isNullOrUndefined(d)?g=g.concat(e.generateNullValuePredicates(a)):g.push(u);var m={instance:this,handler:this.fltrBtnHandler,arg1:u.field,arg2:u.predicate,arg3:u.operator,arg4:u.matchCase,arg5:u.ignoreAccent,arg6:u.value,cancel:!1};if(this.parent.notify(ci,m),m.cancel)return}"date"!==this.options.type&&"datetime"!==this.options.type||(p=r.length-1,c=this.values[O(r[p],"e-ftrchk").getAttribute("uid")],t.isNullOrUndefined(c)&&h&&g.push({field:a.field,matchCase:a.matchCase,operator:"equal",predicate:"and",value:null})),this.initiateFilter(g)}else this.clearFilter()},e.generateNullValuePredicates=function(e){var t=[];return"string"===e.type&&t.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),t},e.prototype.initiateFilter=function(e){var r,n=e[0];if(!t.isNullOrUndefined(n)){r=n.ejpredicate?n.ejpredicate:new i.Predicate(n.field,n.operator,n.value,!n.matchCase,n.ignoreAccent);for(var o=1;o<e.length;o++)r=void 0!==e[o].ejpredicate?r[e[o].predicate](e[o].ejpredicate):r[e[o].predicate](e[o].field,e[o].operator,e[o].value,!e[o].matchCase,e[o].ignoreAccent);var s={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:i.Predicate.or(r)};this.options.handler(s)}},e.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},e.prototype.refreshCheckboxes=function(){var e=this,n=this.sInput.value,o=this.options.column,s=this.isForeignColumn(o)?this.foreignKeyQuery.clone():this.options.query.clone(),l=this.options.query.clone(),a=s.queries.filter(function(e){return e&&"onWhere"===e.fn})[0];s.queries=[],l.queries=[];var h="string"!==this.options.type&&parseFloat(n)?parseFloat(n):n,d=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",c=this.options.ignoreAccent,p=this.isForeignColumn(o)?o.foreignKeyValue:o.field;h=""===h||void 0===h?void 0:h;var u,g=this.options.dataManager.adaptor.getModuleName;"boolean"===this.options.type&&(void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())?h="true":void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&(h="false"),void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())&&g?(g(),h=!0):void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&g&&(g(),h=!1),d="equal"),"date"!==this.options.type&&"datetime"!==this.options.type||(h=this.valueFormatter.fromView(n,this.options.parserFn,this.options.type)),this.addDistinct(s);var f={requestType:"filtersearchbegin",filterModel:this,columnName:p,column:o,operator:d,matchCase:!0,ignoreAccent:c,filterChoiceCount:null,query:s,value:h};this.parent.trigger(bt,f,function(g){if(g.operator=g.operator,u=new i.Predicate(p,g.operator,h,g.matchCase,g.ignoreAccent),"date"===e.options.type||"datetime"===e.options.type){if(d="equal",t.isNullOrUndefined(h)&&n.length)return;u=he({field:p,operator:d,value:h,matchCase:!0,ignoreAccent:c},e.options.type)}n.length?(u=t.isNullOrUndefined(a)?u:u.and(a.e),s.where(u)):t.isNullOrUndefined(a)||s.where(a.e),g.filterChoiceCount=t.isNullOrUndefined(g.filterChoiceCount)?1e3:g.filterChoiceCount;var f={};r.showSpinner(e.spinner),e.renderEmpty=!1,e.isForeignColumn(o)&&n.length?("result"in o.dataSource?new i.DataManager(o.dataSource.result):o.dataSource).executeQuery(s).then(function(t){var i=e.options.column.columnData;e.options.column.columnData=t.result,e.parent.notify("generateQuery",{predicate:f,column:o}),f.predicate.predicates.length?l.where(f.predicate):e.renderEmpty=!0,e.options.column.columnData=i,l.take(g.filterChoiceCount),e.search(g,l)}):(s.take(g.filterChoiceCount),e.search(g,s))})},e.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},e.prototype.getPredicateFromCols=function(t){for(var r=e.getPredicate(t),n=[],o={},s=void 0!==this.parent.getForeignKeyColumns,l=s?this.parent.getForeignKeyColumns():[],a=0,h=Object.keys(r);a<h.length;a++){var d=h[a],c=void 0;s&&this.parent.getColumnByField(d).isForeignColumn()&&(c=ae(d,l)),c?(this.parent.notify("generateQuery",{predicate:o,column:c}),o.predicate.predicates.length&&n.push(i.Predicate.or(o.predicate.predicates))):n.push(r[d])}return n.length&&i.Predicate.and(n)},e.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new i.Query},e.prototype.getAllData=function(){var e=this,i=this.getQuery();i.requiresCount(),this.addDistinct(i);var r={requestType:"filterchoicerequest",query:i,filterChoiceCount:null};r.filterModel=this,this.parent.trigger(bt,r,function(r){r.filterChoiceCount=t.isNullOrUndefined(r.filterChoiceCount)?1e3:r.filterChoiceCount,i.take(r.filterChoiceCount),e.parent.dataSource&&"result"in e.parent.dataSource?e.filterEvent(r,i):e.processDataOperation(i,!0)})},e.prototype.addDistinct=function(e){var t=i.DataUtil.distinct(this.options.filteredColumns,"field");return t.indexOf(this.options.column.field)<=-1&&(t=t.concat(this.options.column.field)),e.distinct(t),e},e.prototype.filterEvent=function(e,t){var i=this,r=Te(e,t);this.parent.trigger("dataStateChange",r.state),r.deffered.promise.then(function(e){i.dataSuccess(e)})},e.prototype.processDataOperation=function(e,t){var r=this;this.options.dataSource=this.options.dataSource instanceof i.DataManager?this.options.dataSource:new i.DataManager(this.options.dataSource);var n=[],o=[];if(this.isForeignColumn(this.options.column)&&t){var s="result"in this.options.column.dataSource?new i.DataManager(this.options.column.dataSource.result):this.options.column.dataSource;this.foreignKeyQuery.params=e.params,n.push(s.executeQuery(this.foreignKeyQuery)),o.push(function(e){return r.foreignKeyData=e})}n.push(this.options.dataSource.executeQuery(e)),o.push(this.dataSuccess.bind(this));var l=0;Promise.all(n).then(function(e){for(var t=0;t<e.length;t++)o[l++](e[t].result)})},e.prototype.dataSuccess=function(t){this.fullData=t;var r={dataSource:this.fullData,executeQuery:!0,field:this.options.field};if(this.parent.notify("beforeCheckboxRenderer",r),r.executeQuery){var n=new i.Query;if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var o=this.parent.searchSettings,s=o.fields.length?o.fields:this.options.columns.map(function(e){return e.field});n.search(o.key,s,o.operator,o.ignoreCase,o.ignoreAccent)}if(this.options.filteredColumns.length){for(var l=[],a=0;a<this.options.filteredColumns.length;a++){var h=this.options.filteredColumns[a];this.options.uid?(h.uid=h.uid||this.parent.getColumnByField(h.field).uid,h.uid!==this.options.uid&&l.push(this.options.filteredColumns[a])):h.field!==this.options.field&&l.push(this.options.filteredColumns[a])}var d=this.getPredicateFromCols(l);d&&n.where(d)}var c=new i.DataManager(r.dataSource).executeLocal(n),p=this.options.column;this.filteredData=e.getDistinct(c,this.options.field,p,this.foreignKeyData).records||[]}var u=r.executeQuery?this.filteredData:r.dataSource;this.processDataSource(null,!0,u,r),this.sInput&&this.sInput.focus();var g={requestType:"filterafteropen",columnName:this.options.field,columnType:this.options.type};g.filterModel=this,this.parent.notify(di,g)},e.prototype.processDataSource=function(e,t,i,n){r.showSpinner(this.spinner),this.updateResult(),this.createFilterItems(i,t,n)},e.prototype.processSearch=function(e){this.processDataOperation(e)},e.prototype.updateResult=function(){this.result={};var e=this.getPredicateFromCols(this.options.filteredColumns),t=new i.Query;e&&t.where(e),this.parent.notify("before-checkbox-renderer-query",{query:t});for(var r=0,n=new i.DataManager(this.fullData).executeLocal(t);r<n.length;r++){var o=n[r];this.result[pe(this.options.field,o)]=!0}},e.prototype.clickHandler=function(e){var t=e.target,i=O(t,"e-checkbox-wrapper");if(O(t,"e-searchbox")&&this.searchBoxClick(e),i){var r=i.querySelector(".e-selectall");r?this.updateAllCBoxes(!r.classList.contains("e-check")):ie(i.parentElement),this.updateIndeterminatenBtn(),i.querySelector(".e-chk-hidden").focus()}this.setFocus(O(i,"e-ftrchk"))},e.prototype.keyupHandler=function(e){this.setFocus(O(e.target,"e-ftrchk"))},e.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e.classList.add("e-chkfocus")},e.prototype.updateAllCBoxes=function(e){for(var t=0,i=[].slice.call(this.cBox.getElementsByClassName("e-frame"));t<i.length;t++){var r=i[t];oe(r,e),re(r.previousSibling,e)}},e.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.options.isResponsiveFilter||this.dialogObj.element.querySelector(".e-btn").focus())},e.prototype.createCheckbox=function(e,i,r){var n=i?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);re(n.querySelector("input"),i);var o=n.querySelector(".e-label"),s=me({},r,{column:this.options.column,parent:this.parent});return o.innerHTML=!t.isNullOrUndefined(e)&&e.toString().length?e:this.getLocalizedLabel("Blanks"),"boolean"==typeof e&&(o.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),t.addClass([o],["e-checkboxfiltertext"]),this.options.template&&r[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&(o.innerHTML="",this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate?(this.options.template(s,this.parent,"filterItemTemplate",null,null,null,o),this.parent.renderTemplates()):q(o,this.options.template(s,this.parent,"filterItemTemplate"))),n},e.prototype.updateIndeterminatenBtn=function(){var e,i=this.cBox.children.length-1,r=[],n=!1,o=this.cBox.querySelector(".e-selectall"),s=this.cBox.querySelectorAll(".e-check:not(.e-selectall)").length;this.options.isResponsiveFilter||((e=this.dialogObj.btnObj[0]).disabled=!1);var l=o.previousSibling;re(l,!1),l.indeterminate=!1,i===s?(r=["e-check"],re(l,!0)):s?(r=["e-stop"],l.indeterminate=!0):(r=["e-uncheck"],n=!0,e&&(e.disabled=!0)),e&&(this.filterState=!e.disabled,e.dataBind()),t.removeClass([o],["e-check","e-stop","e-uncheck"]),t.addClass([o],r),this.parent.notify("refresh-cutsom-filter-ok-button",{disabled:n})},e.prototype.createFilterItems=function(e,n,o){var s,l,a=this.parent.createElement("div"),h=!1;this.options.isResponsiveFilter||(l=this.dialogObj.btnObj[0]);var d=-1,c="ejValue";o.executeQuery||(c=o.field);for(C=0;C<e.length;C++){var p=t.getValue(c,e[C]);(""===p||t.isNullOrUndefined(p))&&(d+=1)}if(this.itemsCnt=-1!==d?e.length-d:e.length,e.length&&!this.renderEmpty){var u=this.getLocalizedLabel("SelectAll"),g=this.createCheckbox(u,!1,(s={},s[this.options.field]=u,s)),f=ne(L("cbox"),g,"e-ftrchk");f.querySelector(".e-frame").classList.add("e-selectall"),a.appendChild(f);var m=new i.Predicate("field","equal",this.options.field);this.options.foreignKeyValue&&(m=m.or("field","equal",this.options.foreignKeyValue));for(var y=new i.DataManager(this.options.filteredColumns).executeLocal((new i.Query).where(m)).length,v=void 0,C=0;C<e.length;C++){var w=L("cbox");this.values[w]=t.getValue(c,e[C]);var b=t.getValue(this.options.field,e[C]);this.options.formatFn&&(b=this.valueFormatter.toView(b,this.options.formatFn));var S={value:b,column:this.options.column,data:e[C]};if(this.parent.notify("filter-cbox-value",S),""===(b=S.value)||t.isNullOrUndefined(b)){if(v)continue;v=!0}var R=this.createCheckbox(b,this.getCheckedState(y,this.values[w]),t.getValue("dataObj",e[C]));a.appendChild(ne(w,R,"e-ftrchk"))}this.cBox.innerHTML="",q(this.cBox,[].slice.call(a.children)),this.updateIndeterminatenBtn(),l&&(l.disabled=!1),h=!1}else a.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",q(this.cBox,[].slice.call(a.children)),l&&(l.disabled=!0),h=!0;l&&(this.filterState=!l.disabled,l.dataBind());var x={requestType:"filterchoicerequest",dataSource:this.renderEmpty?[]:e};x.filterModel=this,this.parent.notify(di,x),this.parent.notify("refresh-cutsom-filter-ok-button",{disabled:h}),r.hideSpinner(this.spinner)},e.prototype.getCheckedState=function(e,t){if(this.isFiltered&&e){var i=this.result[t];return"notequal"===this.options.operator?!i:i}return!0},e.getDistinct=function(e,r,n,o){for(var s,l=e.length,a=[],h={},d=!(!n||!n.isForeignColumn)&&n.isForeignColumn();l--;)if(s=e[l],!((s=pe(r,s))in h)){var c={};if(c.ejValue=s,h[s]=!0,d){var p=le(n,{},s,o)[0];t.setValue("foreignKeyData",p,e[l]),s=t.getValue(n.foreignKeyValue,p)}t.setValue(r,t.isNullOrUndefined(s)?null:s,c),t.setValue("dataObj",e[l],c),a.push(c)}return i.DataUtil.group(i.DataUtil.sort(a,r,i.DataUtil.fnAscending),"ejValue")},e.getPredicate=function(t){for(var r=i.DataUtil.distinct(t,"field",!0)||[],n=[],o={},s=0;s<r.length;s++)0!==(n=new i.DataManager(t).executeLocal((new i.Query).where("field","equal",r[s].field))).length&&(o[r[s].field]=e.generatePredicate(n));return o},e.generatePredicate=function(r){var n,o=r?r.length:0,s=e.updateDateFilter(r[0]);s.ignoreAccent=!t.isNullOrUndefined(s.ignoreAccent)&&s.ignoreAccent,n="date"===s.type||"datetime"===s.type?he(s,s.type):s.ejpredicate?s.ejpredicate:new i.Predicate(s.field,s.operator,s.value,!e.getCaseValue(s),s.ignoreAccent);for(var l=1;l<o;l++)r[l]=e.updateDateFilter(r[l]),o>2&&l>1&&"or"===r[l].predicate?"date"===r[l].type||"datetime"===r[l].type?n.predicates.push(he(r[l],r[l].type)):n.predicates.push(new i.Predicate(r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent)):n="date"===r[l].type||"datetime"===r[l].type?"and"===r[l].predicate&&"equal"===r[l].operator?n.or(he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):n[r[l].predicate](he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):r[l].ejpredicate?n[r[l].predicate](r[l].ejpredicate):n[r[l].predicate](r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent);return n||null},e.getCaseValue=function(e){return t.isNullOrUndefined(e.matchCase)?!("string"===e.type||t.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},e.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},e}(),Sn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rn=function(e){function h(t,i){var r=e.call(this,t)||this;return r.customFilterOperators=i,r.isExcel=!0,r}return Sn(h,e),h.prototype.getCMenuDS=function(e,t){var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","","CustomFilter"]};i.date=i.number,i.datetime=i.number;for(var r=[],n=0;n<i[e].length;n++)i[e][n].length?t?r.push({text:this.getLocalizedLabel(i[e][n])+"...",iconCss:"e-icons e-icon-check "+(t===i[e][n].toLowerCase()?"":"e-emptyicon")}):r.push({text:this.getLocalizedLabel(i[e][n])+"..."}):r.push({separator:!0});return r},h.prototype.destroy=function(){this.dlg&&(this.unwireExEvents(),e.prototype.destroy.call(this)),this.cmenu&&this.cmenu.parentElement&&t.remove(this.cmenu)},h.prototype.createMenu=function(e,t,i,r){var n={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"};this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl");var o=this.parent.createElement("ul"),s=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";if(this.parent.allowSorting&&"grid"===this.parent.getModuleName()&&!this.options.isResponsiveFilter){var l=this.parent.getColumnHeaderByUid(r.uid).getAttribute("aria-sort"),a=this.parent.getColumnByField(r.field).allowSorting,h=a&&"Ascending"!==l?"e-excel-ascending":"e-disabled e-excel-ascending",d=a&&"Descending"!==l?"e-excel-descending":"e-disabled e-excel-descending",c="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),p="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest");o.appendChild(this.createMenuElem(c,h,"e-sortascending")),o.appendChild(this.createMenuElem(p,d,"e-sortdescending"));var u=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"});o.appendChild(u)}this.options.isResponsiveFilter||o.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",s)),"boolean"!==e&&o.appendChild(this.createMenuElem(this.getLocalizedLabel(n[e]),"e-submenu",i&&this.ensureTextFilter()?"e-icon-check":s+" e-emptyicon",!0)),this.menu.appendChild(o),this.parent.notify("before-filter-cmenu-open",{element:this.menu}),this.parent.notify("refresh-cutsom-filter-clear-button",{isFiltered:t})},h.prototype.createMenuElem=function(e,t,i,r){var n=this.parent.createElement("li",{className:t+" e-menu-item"});return n.innerHTML=e,n.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i}),n.firstChild),r&&n.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),n},h.prototype.wireExEvents=function(){t.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.dlg,"click",this.clickExHandler,this)},h.prototype.unwireExEvents=function(){t.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),t.EventHandler.remove(this.dlg,"click",this.clickExHandler)},h.prototype.clickExHandler=function(e){var t={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"},i=O(e.target,"e-menu-item");i&&(this.getLocalizedLabel("ClearFilter")===i.innerText.trim()?(this.clearFilter(),this.closeDialog()):this.options.isResponsiveFilter&&this.getLocalizedLabel(t[this.options.type])===i.innerText.trim()&&this.hoverHandler(e))},h.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),t.remove(this.cmenu),this.parent.notify("render-responsive-cmenu",{target:null,header:"",isOpen:!1,col:this.options.column}))},h.prototype.hoverHandler=function(e){if(!this.options.isResponsiveFilter||"mouseover"!==e.type){var i,r=e.target.querySelector(".e-contextmenu"),n=O(e.target,"e-menu-item"),o=this.menu.querySelector(".e-focused");if(o&&o.classList.remove("e-focused"),n&&(n.classList.add("e-focused"),i=n.classList.contains("e-submenu")),!r){if(!i){var s=this.menu.querySelector(".e-submenu");t.isNullOrUndefined(s)||s.classList.remove("e-selected"),this.destroyCMenu()}var l=this.ensureTextFilter();if(!this.isCMenuOpen&&i){n.classList.add("e-selected"),this.isCMenuOpen=!0;var h={items:this.getCMenuDS(this.options.type,l?l.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":""};this.parent.element.appendChild(this.cmenu),this.menuObj=new a.ContextMenu(h,this.cmenu);var d=this.menu.querySelector(".e-submenu").getBoundingClientRect(),c={top:0,left:0};if(this.options.isResponsiveFilter){var p={string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"},u=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.menuObj.element.style.height="calc(100% - "+u+"px)",this.menuObj.open(u,0,document.body);var g=this.getLocalizedLabel(p[this.options.type]);this.parent.notify("render-responsive-cmenu",{target:this.menuObj.element.parentElement,header:g,isOpen:!0})}else{if(t.Browser.isDevice){var f=this.getContextBounds();c.top=(window.innerHeight-f.height)/2,c.left=(window.innerWidth-f.width)/2,this.closeDialog()}else c.top=t.Browser.isIE?window.pageYOffset+d.top:window.scrollY+d.top,c.left=this.getCMenuYPosition(this.dlg);this.menuObj.open(c.top,c.left,e.target)}Se(this.parent.element,this.menuObj.element.parentElement)}}}},h.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},h.prototype.preventClose=function(e){if(this.options&&this.options.isResponsiveFilter&&e.event){var t=e.event.target,i=t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item");e.cancel=!i}else e.event instanceof MouseEvent&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},h.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},h.prototype.getCMenuYPosition=function(e){var t=this.getContextBounds().width,i=e.getBoundingClientRect(),r=i.right+t-this.parent.element.clientWidth,n=e.offsetWidth-e.clientWidth;return n=n?n+1:0,r<1?i.right+1-n:i.left-t-1+n},h.prototype.openDialog=function(e){var t=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),this.dialogObj.dataBind();var i=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return t.options.field===e.field}).length;this.createMenu(e.type,i>0,1===i||2===i,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.parent.notify("filterDialogCreated",{}),this.wireExEvents()},h.prototype.closeDialog=function(){e.prototype.closeDialog.call(this)},h.prototype.selectHandler=function(e){e.item&&(this.parent.notify("filter-cmenu-select",{}),this.menuItem=e.item,this.renderDialogue(e))},h.prototype.renderDialogue=function(e){var i=this,n=e?e.element:void 0,o=this.options.field,s=!t.isNullOrUndefined(o)&&_(o),l=!t.isNullOrUndefined(o)&&W(o),a=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:s?l+"-xlflmenu":o+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:s?l+"-xlfldlg":o+"-xlfldlg"}),this.options.isResponsiveFilter?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,closeOnEscape:!1,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){var e=i.dlgObj.element.querySelector("table.e-xlfl-table>tr");i.options.column.filterTemplate&&e.querySelector("#"+i.options.column.field+"-xlfl-frstvalue").focus()},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,n,o),buttons:[{click:this.filterBtnClick.bind(this,o),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:"e-xlfl-cancelbtn"}}],content:a,width:430,animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.dlgObj.appendTo(this.dlgDiv)},h.prototype.renderResponsiveDialog=function(){if(this.options.isResponsiveFilter){var e=document.querySelector(".e-row-responsive-filter");e&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1}},h.prototype.removeDialog=function(){this.parent.notify("custom-filter-close",{}),this.parent.isReact&&void 0!==this.parent.destroyTemplate&&(this.parent.destroyTemplate(["filterTemplate"]),this.parent.renderTemplates()),this.removeObjects([this.dropOptr,this.datePicker,this.dateTimePicker,this.actObj,this.numericTxtObj,this.dlgObj]),t.remove(this.dlgDiv),this.parent.notify("filter-dialog-close",{})},h.prototype.createdDialog=function(e,i){if(this.renderCustomFilter(e,i),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter){var r=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.dlgObj.element.style.top=r+"px"}else this.dlgObj.element.style.top="0px";!this.options.isResponsiveFilter&&t.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify("beforeCustomFilterOpen",{column:i,dialog:this.dialogObj}),this.dlgObj.show(),Se(this.parent.element,this.dlgObj.element.parentElement)},h.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),r=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});i.appendChild(r);var n=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});i.appendChild(n),this.renderFilterUI(t,i)},h.prototype.filterBtnClick=function(e){var i,r=!t.isNullOrUndefined(e)&&_(e),n=!t.isNullOrUndefined(e)&&W(e),o=r?n:e,s=this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue").ej2_instances[0],l=this.dlgDiv.querySelector("#"+o+"-xlfl-frstoptr").ej2_instances[0],a=this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue").ej2_instances[0],h=this.dlgDiv.querySelector("#"+o+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(i=this.dlgDiv.querySelector("#"+o+"-xlflmtcase").ej2_instances[0].checked);var d=this.dlgDiv.querySelector("#"+o+"e-xlfl-frstpredicate").ej2_instances[0].checked?"and":"or";null===a.value&&(d="or"),this.filterByColumn(this.options.field,l.value,s.value,d,i,this.options.ignoreAccent,h.value,a.value),this.removeDialog()},h.prototype.filterByColumn=function(e,r,n,o,s,l,a,h){var d,c=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,p=this.isForeignColumn(c)?c.foreignKeyValue:e,u=[];u.push({field:p,predicate:o,matchCase:s,ignoreAccent:l,operator:r,value:n,type:this.options.type});var g={instance:this,handler:this.filterByColumn,arg1:e,arg2:r,arg3:n,arg4:o,arg5:s,arg6:l,arg7:a,arg8:h,cancel:!1};if(this.parent.notify(ci,g),!g.cancel){d=new i.Predicate(p,r.toLowerCase(),n,!s,l),t.isNullOrUndefined(h)||t.isNullOrUndefined(a)||(u.push({field:p,predicate:o,matchCase:s,ignoreAccent:l,operator:a,value:h,type:this.options.type}),d=d[o](p,a.toLowerCase(),h,!s,l));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:d,actualPredicate:u};this.isForeignColumn(c)?this.foreignKeyFilter(f,u,d):this.options.handler(f)}},h.prototype.renderOperatorUI=function(e,i,r,n,o){var l=this.parent.createElement("tr",{className:"e-xlfl-fields"});i.appendChild(l);var a=this.parent.createElement("td",{className:"e-xlfl-optr"});l.appendChild(a);var h=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),d=!t.isNullOrUndefined(e)&&_(e),c=!t.isNullOrUndefined(e)&&W(e),p=this.parent.createElement("input",{id:d?c+r:e+r});h.appendChild(p),a.appendChild(h);var u=this.options.type+"Operator",g=this.customFilterOperators[u];this.optrData=g;var f=this.dropSelectedVal(this.options.column,n,o),m="";this.menuItem&&((m=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(f=o?m:void 0),m===this.getLocalizedLabel("Between")&&(f=this.getLocalizedLabel(o?"GreaterThanOrEqual":"LessThanOrEqual")));var y=this.options.column;return this.dropOptr=new s.DropDownList(E({dataSource:g,fields:{text:"text",value:"value"},text:f,open:this.dropDownOpen.bind(this),enableRtl:this.parent.enableRtl,change:this.dropDownValueChange.bind(this)},y.filter.params)),this.dropOptr.appendTo(p),{fieldElement:l,operator:this.getSelectedValue(f)}},h.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},h.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString()},h.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},h.prototype.getSelectedValue=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("text","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].value},h.prototype.dropSelectedVal=function(e,t,i){var r;return r=t&&t.length>0?2===t.length?i?t[0].operator:t[1].operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0,this.getSelectedText(r)},h.prototype.getSelectedText=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].text},h.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[e],r=this.parent.createElement("table",{className:"e-xlfl-table"});t.appendChild(r);var n=this.parent.createElement(ji);n.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',r.appendChild(n);var o=this.renderOperatorUI(e,r,"-xlfl-frstoptr",i,!0);this.firstOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-frstvalue",i,!0);var s=this.parent.createElement("tr",{className:"e-xlfl-predicate"});r.appendChild(s),this.renderRadioButton(e,s,i),o=this.renderOperatorUI(e,r,"-xlfl-secndoptr",i,!1),this.secondOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-secndvalue",i,!1)},h.prototype.renderRadioButton=function(e,i,r){var o=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});i.appendChild(o);var s=this.parent.createElement("div",{className:"e-xlfl-radiodiv",attrs:{style:"display: inline-block"}}),l=!t.isNullOrUndefined(e)&&_(e),a=!t.isNullOrUndefined(e)&&W(e),h=this.parent.createElement("input",{id:l?a+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),d=this.parent.createElement("input",{id:l?a+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});s.appendChild(h),s.appendChild(d),o.appendChild(s),"string"===this.options.type&&this.renderMatchCase(e,i,o,"-xlflmtcase",r);var c=new n.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",cssClass:"e-xlfl-radio-and",checked:!0,enableRtl:this.parent.enableRtl}),p=new n.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",cssClass:"e-xlfl-radio-or",enableRtl:this.parent.enableRtl});"and"===(r&&2===r.length?r[1].predicate:"and")?(c.checked=!0,p.checked=!1):(p.checked=!0,c.checked=!1),c.appendTo(h),p.appendTo(d)},h.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&!r.isDestroyed&&r.destroy()}},h.prototype.renderFlValueUI=function(e,i,r,n,o){var s=this.parent.createElement("td",{className:"e-xlfl-value"});i.fieldElement.appendChild(s);var l=!t.isNullOrUndefined(e)&&_(e),a=!t.isNullOrUndefined(e)&&W(e),h=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),d=this.options.filteredColumns.some(function(t){return e===t.field}),c=this.options.filteredColumns.filter(function(t){return t.field===e});if(this.options.column.filterTemplate){var p={},u=this.options.column;d&&r&&(p=this.getExcelFilterData(r,p,u,n,c));var g=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate,f=this.parent.element.id+u.uid+"filterTemplate";g?(this.options.column.getFilterTemplate()(p,this.parent,"filterTemplate",f,null,null,h),this.parent.renderTemplates()):q(h,this.options.column.getFilterTemplate()(p,this.parent,"filterTemplate",f)),(this.parent.isAngular?h.children[0]:h.querySelector("input")).id=l?a+r:e+r,s.appendChild(h)}else{var m=this.parent.createElement("input",{id:l?a+r:e+r});h.appendChild(m),s.appendChild(h);var y=void 0,v=void 0;n&&n.length>0&&(y=(v=2===n.length?o?n[0]:n[1]:o?n[0]:void 0)&&v.operator===i.operator?v.value:void 0,t.isNullOrUndefined(y)&&(y=void 0)),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,m,y,this.parent.enableRtl)}},h.prototype.getExcelFilterData=function(e,t,i,r,n){var o="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||n.length>1){t={column:r instanceof Array?r[o]:r};var s=this.options.column.columnData&&n.length>1?1===this.options.column.columnData.length?0:1:o;t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[s][i.foreignKeyValue]:n[s].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[s][i.foreignKeyValue])}return t},h.prototype.renderMatchCase=function(e,i,r,o,s){var l=this.parent.createElement("div",{className:"e-xlfl-matchcasediv",attrs:{style:"display: inline-block"}}),a=!t.isNullOrUndefined(e)&&_(e),h=!t.isNullOrUndefined(e)&&W(e),d=this.parent.createElement("input",{id:a?h+o:e+o,attrs:{type:"checkbox"}});l.appendChild(d),r.appendChild(l);var c=!!(s&&s.length>0)&&(s&&2===s.length?s[1].matchCase:s[0].matchCase);new n.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:c}).appendTo(d)},h.prototype.renderDate=function(e,t,i,r,n){var o=ue(e.format,e.type);this.datePicker=new l.DatePicker(E({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.datePicker.appendTo(i)},h.prototype.renderDateTime=function(e,t,i,r,n){var o=ue(e.format,e.type);this.dateTimePicker=new l.DateTimePicker(E({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.dateTimePicker.appendTo(i)},h.prototype.completeAction=function(e){e.result=$(e.result)},h.prototype.renderNumericTextBox=function(e,t,i,r,n){this.numericTxtObj=new o.NumericTextBox(E({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:n,value:r,locale:this.parent.locale},e.column.filter.params)),this.numericTxtObj.appendTo(i)},h.prototype.renderAutoComplete=function(e,r,n,o,l){var a=this,h=this.options.column,d=this.isForeignColumn(h),c=d?h.dataSource:e.dataSource,p={value:d?h.foreignKeyValue:r},u=new s.AutoComplete(E({dataSource:c instanceof i.DataManager?c:new i.DataManager(c),fields:p,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:"e-popup-flmenu",autofill:!0,focus:function(){var i=!t.isNullOrUndefined(r)&&_(r),o=!t.isNullOrUndefined(r)&&W(r),s=i?o:r;u.filterType=a.dlgDiv.querySelector("#"+s+(n.id===s+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,u.ignoreCase="string"!==e.type||!a.dlgDiv.querySelector("#"+s+"-xlflmtcase").ej2_instances[0].checked,u.filterType=t.isNullOrUndefined(u.filterType)?"equal":u.filterType},placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:l,actionComplete:function(e){var i=!t.isNullOrUndefined(r)&&_(r);e.result=e.result.filter(function(e,t,r){return r.map(function(e){return i?Ke(u.fields.value,e):e[u.fields.value]}).indexOf(i?Ke(u.fields.value,e):e[a.actObj.fields.value])===t})},text:o},h.filter.params));if(c&&"result"in c){var g=Te({requestType:"stringfilterrequest"},this.getQuery());this.parent.trigger("dataStateChange",g.state),g.deffered.promise.then(function(e){u.dataSource=new i.DataManager(e)})}u.appendTo(n),this.actObj=u},h}(bn),xn=function(){function i(e,t,i,r){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new er,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=r,this.focus=r.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}return i.prototype.updateModel=function(){var e,t={field:this.columnName,direction:this.direction},i=this.parent.groupSettings.columns,r=!1;if(this.isMultiSort)(e=this.getSortedColsIndexByField(this.columnName))>-1&&this.sortSettings.columns.splice(e,1),this.sortSettings.columns.push(t),this.sortSettings.columns=this.sortSettings.columns;else if(i.length){for(var n=[],o=0,s=i.length;o<s;o++)if(e=this.getSortedColsIndexByField(i[o],n),this.columnName===i[o])r=!0,n.push(t);else{var l=this.getSortColumnFromField(i[o]);n.push({field:l.field,direction:l.direction,isFromGroup:l.isFromGroup})}r||n.push(t),this.sortSettings.columns=n}else this.sortSettings.columns=[t];this.parent.dataBind(),this.lastSortedCol=this.columnName},i.prototype.onActionComplete=function(e){var i=this.isRemove?{requestType:"sorting",type:St}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:St};this.isRemove=!1,this.parent.trigger(St,t.extend(e,i))},i.prototype.sortColumn=function(e,t,i){var r=this.parent;return!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen()?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e}):(r.allowMultiSorting||(i=r.allowMultiSorting),this.isActionPrevent()?void r.notify(ii,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i}):(this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons(),this.updateSortedCols(e,i),void this.updateModel()))},i.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isSort)},i.prototype.backupSettings=function(){this.lastSortedCols=R(this.sortSettings.columns),this.lastCols=this.sortedColumns},i.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},i.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var i=0,r=this.sortedColumns.length;i<r;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[i])<0&&(this.sortedColumns.splice(i,1),r--,i--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){if(this.contentRefresh){var t=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:bt,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:bt,cancel:!1,target:this.currentTarget};this.parent.notify(Lt,t)}this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons()}},i.prototype.refreshSortSettings=function(){this.sortedColumns.length=0;for(var e=this.sortSettings.columns,t=0;t<e.length;t++)e[t].isFromGroup||this.sortedColumns.push(e[t].field)},i.prototype.clearSorting=function(){var e=B(this.sortSettings.columns);if(this.isActionPrevent())return void this.parent.notify(ii,{instance:this,handler:this.clearSorting});for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[t].field)},i.prototype.isActionPrevent=function(){return X(this.parent)},i.prototype.removeSortColumn=function(e){var t=this.parent,i=this.sortSettings.columns;if(!(0===i.length&&this.sortedColumns.indexOf(e)<0)){if(this.isActionPrevent())return void this.parent.notify(ii,{instance:this,handler:this.removeSortColumn,arg1:e});this.backupSettings(),this.removeSortIcons();for(var r=0,n=i.length;r<n;r++)if(i[r].field===e){if(t.allowGrouping&&t.groupSettings.columns.indexOf(i[r].field)>-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(i[r].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(Lt,{requestType:"sorting",type:bt,target:this.currentTarget});break}this.addSortIcons()}},i.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,r=0,n=i.length;r<n;r++)if(i[r].field===e)return r;return-1},i.prototype.getModuleName=function(){return"sort"},i.prototype.initialEnd=function(){if(this.parent.off(At,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=this.sortSettings.columns.length>1;for(var t=0,i=e.sortSettings.columns.slice();t<i.length;t++){var r=i[t];this.sortedColumns.indexOf(r.field)>-1&&this.sortColumn(r.field,r.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"set-fullscreen-dialog",handler:this.setFullScreenDialog},{event:At,handler:this.initialEnd},{event:"sorting-complete",handler:this.onActionComplete},{event:Nt,handler:this.onPropertyChanged},{event:Gt,handler:this.clickHandler},{event:Ht,handler:this.refreshSortIcons},{event:Vt,handler:this.keyPressed},{event:"cancel-Begin",handler:this.cancelBeginEvent}],Xe(this.parent,this.evtHandlers,!0,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||Xe(this.parent,this.evtHandlers,!1)},i.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},i.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},i.prototype.clickHandler=function(e){var i=this.parent;this.currentTarget=null,this.popUpClickHandler(e);var r=t.closest(e.target,".e-headercell");if(r&&!e.target.classList.contains("e-grptogglebtn")&&!r.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")&&!O(e.target,"e-stackedheadercell")&&!(i.allowSelection&&i.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell"))){var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));"checkbox"!==n.type&&(this.initiateSort(r,e,n),t.Browser.isDevice&&this.showPopUp(e))}if(r&&r.classList.remove("e-resized"),O(e.target,"e-excel-ascending")||O(e.target,"e-excel-descending")){var o=t.closest(e.target,".e-filter-popup").getAttribute("uid"),s=t.isNullOrUndefined(O(e.target,"e-excel-descending"))?"Ascending":"Descending";this.sortColumn(i.getColumnByUid(o).field,s,!1)}},i.prototype.keyPressed=function(e){var i=e.target;if(!this.parent.isEdit&&("enter"===e.action||"ctrlEnter"===e.action||"shiftEnter"===e.action)&&t.closest(i,".e-headercell")){var r=this.focus.getFocusedElement();if(t.isNullOrUndefined(r)||!r.classList.contains("e-headercell")||!r.querySelector(".e-headercelldiv"))return;var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));this.initiateSort(r,e,n)}},i.prototype.initiateSort=function(e,t,i){var r=this.parent,n=i.field;this.currentTarget=t.target;var o=e.getElementsByClassName("e-ascending").length?"Descending":"Ascending";t.shiftKey||this.sortSettings.allowUnsort&&e.getElementsByClassName("e-descending").length&&!(r.groupSettings.columns.indexOf(n)>-1)?this.removeSortColumn(n):this.sortColumn(n,o,t.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&t.metaKey)},i.prototype.showPopUp=function(e){var i=t.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||t.isNullOrUndefined(i)&&!this.parent.isContextMenuOpen()||z(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(this.sortedColumns.length>1?" e-spanclicked":""))},i.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains(bi)||t.closest(i,".e-gridpopup")?i.classList.contains("e-sortdirect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},i.prototype.addSortIcons=function(){for(var e,i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=0,l=n.length;s<l;s++)e=r.getColumnHeaderByField(n[s].field),-1===o.indexOf(n[s].field)||t.isNullOrUndefined(e)||(this.aria.setSort(e,n[s].direction),this.isMultiSort&&n.length>1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}),e.querySelector(".e-headertext")),i=e.querySelector(".e-sortfilterdiv"),"Ascending"===n[s].direction?t.classList(i,["e-ascending","e-icon-ascending"],[]):t.classList(i,["e-descending","e-icon-descending"],[]))},i.prototype.removeSortIcons=function(e){for(var i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=e||0,l=t.isNullOrUndefined(e)?n.length:e+1;s<l;s++)i=r.getColumnHeaderByField(n[s].field),t.isNullOrUndefined(i)||r.allowGrouping&&r.groupSettings.columns.indexOf(n[s].field)>-1&&!i.querySelector(".e-sortfilterdiv")||-1!==o.indexOf(n[s].field)&&(this.aria.setSort(i,"none"),t.classList(i.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),i.querySelector(".e-sortnumber")&&i.querySelector(".e-headercelldiv").removeChild(i.querySelector(".e-sortnumber")))},i.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;t<i;t++)if(this.sortSettings.columns[t].field===e)return this.sortSettings.columns[t];return!1},i.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,i=this.sortedColumns;t<i.length;t++){var r=i[t];if(-1!==e.indexOf(r)){var n=this.parent.getColumnHeaderByField(r);this.aria.setSort(n,this.getSortColumnFromField(r).direction)}}},i.prototype.refreshSortIcons=function(e){void 0===e&&(e={args:{isFrozen:!1}}),e.args.isFrozen||(this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr())},i.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},i}(),Fn=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},e.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.updateStyles()},e.prototype.refreshNumericLinks=function(){var e,i=this.pagerModule,r=i.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();r.innerHTML="";for(var o=1;o<=i.pageCount;o++)e=t.createElement("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{role:"link",tabindex:"-1","aria-label":"Goto Page "+o,href:"javascript:void(0);",name:"Goto page"+o}}),i.currentPage===o&&t.classList(e,["e-currentitem","e-active"],["e-pager-default"]),n.appendChild(e);r.appendChild(n),this.links=[].slice.call(r.childNodes)},e.prototype.wireEvents=function(){t.EventHandler.add(this.pagerElement,"click",this.clickHandler,this)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler)},e.prototype.destroy=function(){this.unwireEvents()},e.prototype.renderNumericContainer=function(){this.element=t.createElement("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(t.createElement("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},e.prototype.renderFirstNPrev=function(e){this.first=t.createElement("div",{className:"e-first e-icons e-icon-first",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("FirstPageTooltip"):this.pagerModule.getLocalizedLabel("firstPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("FirstPageTooltip"):this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}}),this.prev=t.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPageTooltip"):this.pagerModule.getLocalizedLabel("previousPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPageTooltip"):this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}),t.append([this.first,this.prev],e)},e.prototype.renderPrevPagerSet=function(e){var i=t.createElement("div");this.PP=t.createElement("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),role:"link","aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",name:t.isBlazor()?this.pagerModule.getLocalizedLabel("PreviousPagerTooltip"):this.pagerModule.getLocalizedLabel("previousPagerTooltip"),href:"javascript:void(0);"}}),i.appendChild(this.PP),e.appendChild(i)},e.prototype.renderNextPagerSet=function(e){var i=t.createElement("div");this.NP=t.createElement("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),role:"link","aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",name:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPagerTooltip"):this.pagerModule.getLocalizedLabel("nextPagerTooltip"),href:"javascript:void(0);"}}),i.appendChild(this.NP),e.appendChild(i)},e.prototype.renderNextNLast=function(e){this.next=t.createElement("div",{className:"e-next e-icons e-icon-next",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPageTooltip"):this.pagerModule.getLocalizedLabel("nextPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("NextPageTooltip"):this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}}),this.last=t.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:t.isBlazor()?this.pagerModule.getLocalizedLabel("LastPageTooltip"):this.pagerModule.getLocalizedLabel("lastPageTooltip"),"aria-label":t.isBlazor()?this.pagerModule.getLocalizedLabel("LastPageTooltip"):this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}),t.append([this.next,this.last],e)},e.prototype.clickHandler=function(e){var i=this.pagerModule,r=e.target;return i.previousPageNo=i.currentPage,r.classList.contains("e-disable")||t.isNullOrUndefined(r.getAttribute("index"))||(i.currentPage=parseInt(r.getAttribute("index"),10),i.dataBind()),!1},e.prototype.updateLinksHtml=function(){var e,i,r=this.pagerModule;r.currentPage=1===r.totalPages?1:r.currentPage,r.currentPage>r.totalPages&&r.totalPages&&(r.currentPage=r.totalPages),e=parseInt((r.currentPage/r.pageCount).toString(),10),r.currentPage%r.pageCount==0&&e>0&&(e-=1);for(var n=0;n<r.pageCount;n++)(i=e*r.pageCount+1+n)<=r.totalPages?(this.links[n].style.display="",this.links[n].setAttribute("index",i.toString()),this.links[n].innerHTML=r.customText?r.customText+i:i.toString(),r.currentPage!==i?this.links[n].classList.add("e-pager-default"):this.links[n].classList.remove("e-pager-default")):(this.links[n].innerHTML=r.customText?r.customText+i:i.toString(),this.links[n].style.display="none"),t.classList(this.links[n],[],["e-currentitem","e-active"]);this.first.setAttribute("index","1"),this.last.setAttribute("index",r.totalPages.toString()),this.prev.setAttribute("index",(r.currentPage-1).toString()),this.next.setAttribute("index",(r.currentPage+1).toString()),this.pagerElement.querySelector(".e-mfirst").setAttribute("index","1"),this.pagerElement.querySelector(".e-mlast").setAttribute("index",r.totalPages.toString()),this.pagerElement.querySelector(".e-mprev").setAttribute("index",(r.currentPage-1).toString()),this.pagerElement.querySelector(".e-mnext").setAttribute("index",(r.currentPage+1).toString()),this.PP.setAttribute("index",(parseInt(this.links[0].getAttribute("index"),10)-r.pageCount).toString()),this.NP.setAttribute("index",(parseInt(this.links[this.links.length-1].getAttribute("index"),10)+1).toString())},e.prototype.updateStyles=function(){this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length&&t.classList(this.links[(this.pagerModule.currentPage-1)%this.pagerModule.pageCount],["e-currentitem","e-active"],[])},e.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],i=["e-firstpagedisabled","e-disable"],r=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];this.pagerModule.totalPages>0&&this.pagerModule.currentPage>1?(t.classList(this.prev,r,n),t.classList(this.first,e,i),t.classList(this.pagerElement.querySelector(".e-mfirst"),e,i),t.classList(this.pagerElement.querySelector(".e-mprev"),r,n)):(t.classList(this.prev,n,r),t.classList(this.first,i,e),t.classList(this.pagerElement.querySelector(".e-mprev"),n,r),t.classList(this.pagerElement.querySelector(".e-mfirst"),i,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount?t.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):t.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},e.prototype.updateNextPagerSetStyles=function(){var e=this.pagerModule,i=this.links[0].innerHTML.replace(e.customText,"");!i.length||!this.links.length||parseInt(i,10)+e.pageCount>e.totalPages?t.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):t.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},e.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],i=["e-lastpagedisabled","e-disable"],r=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],o=this.pagerModule;o.currentPage===o.totalPages||0===o.totalRecordsCount?(t.classList(this.last,i,e),t.classList(this.next,n,r),t.classList(this.pagerElement.querySelector(".e-mlast"),i,e),t.classList(this.pagerElement.querySelector(".e-mnext"),n,r)):(t.classList(this.last,e,i),t.classList(this.next,r,n),t.classList(this.pagerElement.querySelector(".e-mlast"),e,i),t.classList(this.pagerElement.querySelector(".e-mnext"),r,n))},e}(),En=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=t.createElement("div",{className:"e-parentmsgbar",attrs:{"aria-label":"Pager Information"}});this.pageNoMsgElem=t.createElement("span",{className:"e-pagenomsg",styles:"textalign:right"}),this.pageCountMsgElem=t.createElement("span",{className:"e-pagecountmsg",styles:"textalign:right"}),t.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;t.isBlazor()?(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("CurrentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel("TotalItemsInfo"),[e.totalRecordsCount||0])):(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage])),this.pageNoMsgElem.parentElement.setAttribute("aria-label",this.pageNoMsgElem.textContent+this.pageCountMsgElem.textContent)},e.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},e.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},e.prototype.destroy=function(){},e.prototype.format=function(e,t){for(var i,r=0;r<t.length;r++)i=new RegExp("\\{"+r+"\\}","gm"),e=e.replace(i,t[r].toString());return e},e}(),In=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tn=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},zn=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.hasParent=!1,r.pageRefresh="pager-refresh",r}return In(i,e),i.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this]}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this]}),e},i.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager",previousPagerTooltip:"Go to previous pager",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager",PreviousPagerTooltip:"Go to previous pager",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All"},this.containerModule=new Fn(this),this.pagerMessageModule=new En(this)},i.prototype.render=function(){this.template?this.isReactTemplate()?(this.on(this.pageRefresh,this.pagerTemplate,this),this.notify(this.pageRefresh,{})):this.pagerTemplate():(this.initLocalization(),this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount}))},i.prototype.getPersistData=function(){var e=["currentPage","pageSize"];return this.addOnPersist(e)},i.prototype.destroy=function(){this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["template"])),e.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate()||(this.element.innerHTML="")},i.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},i.prototype.getModuleName=function(){return"pager"},i.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&(t.pageSize!==e.pageSize&&(this.currentPage=1),this.pagerdropdownModule.setDropDownValue("value",this.pageSize)),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}}},i.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},i.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.dataBind())},i.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},i.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},i.prototype.checkGoToPage=function(e,i){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),t.isNullOrUndefined(i)||(this.previousPageNo=i),this.previousPageNo!==e&&e>=1&&e<=this.totalPages},i.prototype.currentPageChanged=function(e,t){if(this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage!==t.currentPage||e.pageSize!==t.pageSize){var i={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1};this.trigger("click",i),i.cancel||this.refresh()}},i.prototype.pagerTemplate=function(){if(!this.isReactTemplate()||!this.hasParent){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var i={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},r=this.element.parentElement.id+"_template";this.isReactTemplate()?(this.getPagerTemplate()(i,this,"template",r,null,null,this.element),this.renderReactTemplates()):(e=t.isBlazor()?this.getPagerTemplate()(i,this,"template",r,this.isStringTemplate):this.isVue?this.getPagerTemplate()(i,this):this.getPagerTemplate()(i),q(this.element,e))}},i.prototype.updateTotalPages=function(){this.totalPages=this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},i.prototype.getPagerTemplate=function(){return this.templateFn},i.prototype.compile=function(e){if(e)try{document.querySelectorAll(e).length&&(this.templateFn=t.compile(document.querySelector(e).innerHTML.trim()))}catch(i){this.templateFn=t.compile(e)}},i.prototype.refresh=function(){this.template?this.isReactTemplate()?(this.updateTotalPages(),this.notify(this.pageRefresh,{})):(this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),this.containerModule.refresh(),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh())},i.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},i.prototype.initLocalization=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultConstants,this.locale)},i.prototype.updateQueryString=function(e){var t=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:t},"",t)},i.prototype.getUpdatedURL=function(e,t,i){var r=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(r))return e.replace(r,"$1"+t+"="+i+"$2");var n="";return-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+n},i.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:t.isBlazor()?this.getLocalizedLabel("FirstPageTooltip"):this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:t.isBlazor()?this.getLocalizedLabel("PreviousPageTooltip"):this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}))},i.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:t.isBlazor()?this.getLocalizedLabel("NextPageTooltip"):this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:t.isBlazor()?this.getLocalizedLabel("LastPageTooltip"):this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}))},i.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!t.Browser.isDevice)for(var i=0;i<e.length;i++){var r=this.element.querySelector(e[i]);r.setAttribute("aria-label",r.getAttribute("title"))}},i.prototype.isReactTemplate=function(){return this.isReact&&this.template&&"string"!=typeof this.template},Tn([t.Property(!1)],i.prototype,"enableQueryString",void 0),Tn([t.Property(!1)],i.prototype,"enableExternalMessage",void 0),Tn([t.Property(!0)],i.prototype,"enablePagerMessage",void 0),Tn([t.Property(12)],i.prototype,"pageSize",void 0),Tn([t.Property(10)],i.prototype,"pageCount",void 0),Tn([t.Property(1)],i.prototype,"currentPage",void 0),Tn([t.Property()],i.prototype,"totalRecordsCount",void 0),Tn([t.Property()],i.prototype,"externalMessage",void 0),Tn([t.Property(!1)],i.prototype,"pageSizes",void 0),Tn([t.Property()],i.prototype,"template",void 0),Tn([t.Property("")],i.prototype,"customText",void 0),Tn([t.Event()],i.prototype,"click",void 0),Tn([t.Event()],i.prototype,"dropDownChanged",void 0),Tn([t.Event()],i.prototype,"created",void 0),i=Tn([t.NotifyPropertyChanges],i)}(t.Component),Dn=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"pagerdropdown"},e.prototype.render=function(){var e=this.pagerModule;this.pagerDropDownDiv=t.createElement("div",{className:"e-pagesizes"});var i=t.createElement("div",{className:"e-pagerdropdown"}),r=t.createElement("div",{className:"e-pagerconstant"}),n=t.createElement("input",{attrs:{type:"text",tabindex:"1"}});this.pagerCons=t.createElement("span",{className:"e-constant",innerHTML:t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerDropDown"):this.pagerModule.getLocalizedLabel("pagerDropDown")}),i.appendChild(n),r.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(i),this.pagerDropDownDiv.appendChild(r),this.pagerModule.element.appendChild(this.pagerDropDownDiv);var o=this.pagerModule.pageSizes,l=o.length?this.convertValue(o):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],a=this.pagerModule.pageSize;this.dropDownListObject=new s.DropDownList({dataSource:l,value:a.toString(),change:this.onChange.bind(this),cssClass:"e-alldrop"}),this.dropDownListObject.appendTo(n),o.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=a,e.dataBind(),e.trigger("dropDownChanged",{pageSize:a}),this.addEventListener()},e.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.refresh(),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.trigger("dropDownChanged",{pageSize:parseInt(this.dropDownListObject.value,10)})},e.prototype.refresh=function(){this.pagerCons&&(this.pagerModule.pageSize===this.pagerModule.totalRecordsCount?this.pagerCons.innerHTML=t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerAllDropDown"):this.pagerModule.getLocalizedLabel("pagerAllDropDown"):this.pagerCons.innerHTML=t.isBlazor()?this.pagerModule.getLocalizedLabel("PagerDropDown"):this.pagerModule.getLocalizedLabel("pagerDropDown"))},e.prototype.beforeValueChange=function(e){if("number"==typeof e.newProp.value){var t=e.newProp.value.toString();e.newProp.value=t}},e.prototype.convertValue=function(e){for(var t=e,i=0;i<t.length;i++)t[i]=parseInt(t[i],10)?t[i].toString():""!==this.pagerModule.getLocalizedLabel(t[i])?this.pagerModule.getLocalizedLabel(t[i]):t[i];return t},e.prototype.setDropDownValue=function(e,t){this.dropDownListObject&&(this.dropDownListObject[e]=t)},e.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},e.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},e.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),t.remove(this.pagerDropDownDiv))},e}(),Mn=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"externalMessage"},e.prototype.render=function(){this.element=t.createElement("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":"Pager external message"}}),this.pagerModule.element.appendChild(this.element),this.refresh()},e.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},e.prototype.hideMessage=function(){t.isNullOrUndefined(this.element)||(this.element.style.display="none")},e.prototype.showMessage=function(){this.element.style.display=""},e.prototype.destroy=function(){t.remove(this.element)},e}(),On=function(){function e(e,t){this.isInitialRender=!0,zn.Inject(Mn,Dn),this.parent=e,this.pageSettings=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.render=function(){var e=this.parent;this.pagerDestroy(),t.isNullOrUndefined(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"});var i=E({},t.extend({},M(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:e.enableRtl,locale:e.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]);this.pagerObj=new zn(i),this.pagerObj.hasParent=!0,this.pagerObj.on("pager-refresh",this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},e.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},e.prototype.addAriaAttr=function(){if(!this.pageSettings.template){for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),r=this.element.querySelector(".e-numericcontainer"),n=r.querySelectorAll("a"),o=0;o<n.length;o++){this.parent.getContentTable()?n[o].setAttribute("aria-owns",this.parent.getContentTable().id):n[o].setAttribute("aria-owns",this.parent.element.getAttribute("id")+"_content_table");var s=this.parent.createElement("div");s.appendChild(n[o]),i.appendChild(s)}e.appendChild(i),t.replaceChild(e,r);for(var l=[".e-mfirst",".e-mprev",".e-first",".e-prev",".e-next",".e-last",".e-mnext",".e-mlast"],a=0;a<l.length;a++){var h=this.element.querySelector(l[a]);this.parent.getContentTable()&&h.setAttribute("aria-owns",this.parent.getContentTable().id)}}},e.prototype.dataReady=function(e){this.updateModel(e)},e.prototype.refresh=function(){this.pagerObj.refresh()},e.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},e.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},e.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count,this.parent.dataBind()},e.prototype.onActionComplete=function(e){this.parent.trigger(St,t.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:St}))},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,r=Object.keys(t);i<r.length;i++){var n=r[i];this.pagerObj[n]=t[n]}this.pagerObj.dataBind()}},e.prototype.clickHandler=function(e){var i=this.parent;if(this.isForceCancel||X(i)&&!i.prevPageMoving)return this.isForceCancel?this.isForceCancel=!1:(t.isNullOrUndefined(e.newProp)||t.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(i.notify(ii,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=i.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:i.pageSettings.currentPage):(i.notify(ii,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.pageSize=e.oldProp.pageSize,i.pageSettings.pageSize=e.newProp.pageSize),this.isForceCancel=!0,this.pagerObj.dataBind()),void(e.cancel=!0);i.pageSettings.pageSize=this.pagerObj.pageSize,i.prevPageMoving=!1;var r=this.pageSettings.currentPage;this.pageSettings.currentPage=e.currentPage;var n={cancel:!1,requestType:"paging",previousPage:r,currentPage:e.currentPage,type:bt};this.parent.notify(Lt,n),n.cancel&&(e.cancel=!0),this.parent.requestTypeAction="paging"},e.prototype.keyPressHandler=function(e){e.action in kn&&(e.preventDefault(),this.element.querySelector(kn[e.action]).click())},e.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},e.prototype.appendToElement=function(){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.isVue=this.parent.isVue,this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate()&&(this.pagerObj.updateTotalPages(),this.created()))},e.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler,created:this.created},this.parent.isDestroyed||(this.parent.isReact&&this.parent.addEventListener("create",this.handlers.created.bind(this)),this.evtHandlers=[{event:Mt,handler:this.handlers.load},{event:Ot,handler:this.handlers.end},{event:kt,handler:this.handlers.ready},{event:"paging-complete",handler:this.handlers.complete},{event:Bt,handler:this.handlers.updateLayout},{event:Nt,handler:this.handlers.inboundChange},{event:Vt,handler:this.handlers.keyPress}],Xe(this.parent,this.evtHandlers,!0,this))},e.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},e.prototype.isReactTemplate=function(){return this.parent.isReact&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},e.prototype.renderReactPagerTemplate=function(){if(!this.isInitialRender&&this.isReactTemplate()){this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template);var e=this.parent.pageSettings,t={currentPage:e.currentPage,pageSize:e.pageSize,pageCount:e.pageCount,totalRecordsCount:e.totalRecordsCount,totalPages:this.pagerObj.totalPages},i=this.parent.id+"_pagertemplate";this.pagerObj.templateFn(t,this.parent,"pagerTemplate",i,null,null,this.pagerObj.element),this.parent.renderTemplates()}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.isReact&&this.parent.removeEventListener("create",this.handlers.created),this.parent.off("pager-refresh",this.renderReactPagerTemplate),Xe(this.parent,this.evtHandlers,!1))},e.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},e.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),t.remove(this.element))},e}(),kn={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"},An=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bn=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-filterbarcell"}),t}return An(i,e),i.prototype.getGui=function(){return this.parent.createElement("div")},i.prototype.render=function(e,i){var r,n=this.parent.element.querySelector(".e-filterbar"),s=this.element.cloneNode(),l=this.getGui(),a=e.column;if(n.appendChild(s),s.setAttribute("e-mappinguid",a.uid),a.filterTemplate){var h={};i&&(h[a.field]=i[a.field]);if(h.column=a,a.visible){var d=this.parent.isReact&&"string"!=typeof a.filterTemplate,c=this.parent.element.id+a.uid+"filterTemplate";d?(a.getFilterTemplate()(h,this.parent,"filterTemplate",c,null,null,s),this.parent.renderTemplates()):q(s,a.getFilterTemplate()(h,this.parent,"filterTemplate",c))}else s.classList.add("e-hide")}else if("checkbox"!==a.type){if(!t.isNullOrUndefined(a.allowFiltering)&&!a.allowFiltering||t.isNullOrUndefined(a.filterBarTemplate)){t.attributes(l,{class:"e-filterdiv e-fltrinputdiv"}),r=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:a.headerText+e.attributes.title,value:i[e.column.field]?i[e.column.field]:"",role:"search"}}),l.appendChild(r);p={element:r,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.createInput(p,this.parent.createElement)}else if(s.classList.add("e-fltrtemp"),t.attributes(l,{class:"e-fltrtempdiv"}),t.isNullOrUndefined(a.filterBarTemplate.create))r=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:a.headerText}}),l.appendChild(r);else{var p={column:a,node:Element},u=a.filterBarTemplate.create;if("string"==typeof u&&(u=t.getValue(u,window)),"string"==typeof(r=u(p))){var g=this.parent.createElement("div");g.innerHTML=r,r=g.firstChild}t.attributes(l,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:a.headerText,id:a.field+"_filterBarcell"}),l.appendChild(r)}if((!1===a.allowFiltering||""===a.field||t.isNullOrUndefined(a.field))&&(r.setAttribute("disabled","true"),r.classList.add("e-disable")),a.visible||s.classList.add("e-hide"),this.appendHtml(s,l),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&t.isNullOrUndefined(a.filterTemplate)&&this.operatorIconRender(l,a,e),(t.isNullOrUndefined(a.allowFiltering)||a.allowFiltering)&&!t.isNullOrUndefined(a.filterBarTemplate)){var f=a.filterBarTemplate.write,p={element:r,column:a};"string"==typeof f&&(f=t.getValue(f,window)),f.call(this,p)}}return s},i.prototype.appendHtml=function(e,t){return e.appendChild(t),e},i.prototype.operatorIconRender=function(e,i,r){var n=this.parent,o=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:r.column.uid});e.querySelector("span").appendChild(o);var l=i.filter&&i.filter.operator?i.filter.operator:"equal";t.isNullOrUndefined(n.filterModule.operators[i.field])||(l=n.filterModule.operators[i.field]),this.dropOptr=new s.DropDownList({fields:{text:"text",value:"value"},popupHeight:"auto",value:l,width:"0px",enabled:i.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=n.filterModule.customOperators;this.dataSource=e[n.getColumnByUid(this.element.id).type+"Operator"];for(var r=0;r<this.dataSource.length;r++)i.filter&&i.filter.operator&&t.isNullOrUndefined(n.filterModule.operators[i.field])&&this.dataSource[r].value===i.filter.operator&&(this.value=i.filter.operator)}}),this.dropOptr.appendTo(o);var a=t.closest(this.dropOptr.element,"span");a.classList.add("e-filterbardropdown"),a.removeAttribute("tabindex")},i.prototype.internalEvent=function(e){var t=this.parent,i=t.getColumnByUid(e.element.getAttribute("id"));e.column=i,t.filterModule.operators[i.field]=e.value,t.notify("get-filterbar-operator",e)},i}($i),Pn=function(){function e(e,t,i,r){this.parent=e,this.serviceLocator=i,this.filterSettings=r,this.customFilterOperators=t}return e.prototype.renderOperatorUI=function(e,i,r,n,o){this.dialogObj=n;var l=r.type+"Operator";this.optrData=this.customOptr=t.isNullOrUndefined(o)?t.isNullOrUndefined(this.parent.filterSettings.operators)||t.isNullOrUndefined(this.parent.filterSettings.operators[l])?this.customFilterOperators[l]:this.parent.filterSettings.operators[l]:o;var a=this.customOptr,h=this.dropSelectedVal(r,l),d=this.parent.createElement("div",{className:"e-flm_optrdiv"});e.appendChild(d);var c=this.parent.createElement("input",{id:r.uid+"-floptr"});d.appendChild(c),this.dropOptr=new s.DropDownList({dataSource:a,fields:{text:"text",value:"value"},open:this.dropDownOpen.bind(this),cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:h}),this.dropOptr.appendTo("#"+r.uid+"-floptr")},e.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},e.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},e.prototype.dropSelectedVal=function(e,r){for(var n="",o=0,s=this.parent.filterSettings.columns;o<s.length;o++){var l=s[o];if(e.field===l.field||e.isForeignColumn()&&e.foreignKeyValue===l.field){var a=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",l.operator));n=t.isNullOrUndefined(a[0])?"":a[0].text}}if(""===n)if(e.filter.operator)for(var h=Object.keys(this.optrData).length,d=0;d<h;d++)this.optrData[d].value===e.filter.operator&&(n=this.optrData[d].text);else n=this.optrData[0].text;return n},e.prototype.getFlOperator=function(){return this.dropOptr.value},e}(),Nn=function(){function e(e,t,i){this.parent=e,this.serLocator=t,this.filterSettings=i}return e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.dialogObj=e.dialogObj,this.actObj=this.getAutoCompleteOptions(e),this.actObj.appendTo(this.instance)},e.prototype.getAutoCompleteOptions=function(e){var r,n=this,o=e.column.isForeignColumn();o&&((r=new i.Query).params=this.parent.query.params);var l=o?e.column.dataSource:this.parent.dataSource,a={value:o?e.column.foreignKeyValue:e.column.field},h=new s.AutoComplete(t.extend({dataSource:l instanceof i.DataManager?l:new i.DataManager(l),fields:a,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:o?r:this.parent.query.clone(),sortOrder:"Ascending",open:this.openPopup.bind(this),cssClass:"e-popup-flmenu",focus:function(){n.actObj.filterType=e.getOptrInstance.getFlOperator()},autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionComplete:function(e){e.result=e.result.filter(function(e,i,r){return r.map(function(e){return t.getValue(n.actObj.fields.value,e)}).indexOf(t.getValue(n.actObj.fields.value,e))===i})}},e.column.filter.params));if(l&&"result"in l){var d=Te({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new i.Query);this.parent.trigger("dataStateChange",d.state),d.deffered.promise.then(function(e){h.dataSource=new i.DataManager(e)})}return h},e.prototype.write=function(e){""===e.filteredValue||t.isNullOrUndefined(e.filteredValue)||(document.querySelector("#strui-"+e.column.uid).ej2_instances[0].value=e.filteredValue)},e.prototype.read=function(e,i,r,n){var o=document.querySelector("#strui-"+i.uid).ej2_instances[0];t.Browser.isDevice&&(o.hidePopup(),o.focusOut());var s=o.value;(t.isNullOrUndefined(s)||""===s)&&(s=null),n.filterByColumn(i.field,r,s,"and",this.parent.filterSettings.enableCaseSensitivity)},e.prototype.openPopup=function(e){te(e,this.dialogObj)},e}(),Ln=function(){function e(e,t,i){this.filterSettings=i,this.parent=e,this.serviceLocator=t}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),e.target.appendChild(this.instance),this.numericTxtObj=new o.NumericTextBox(t.extend({format:"string"==typeof e.column.format||t.isUndefined(e.column.format)?e.column.format:e.column.format.format,locale:this.parent.locale,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.instance)},e.prototype.write=function(e){var t=document.querySelector("#numberui-"+e.column.uid).ej2_instances[0];t.element.addEventListener("keydown",this.keyEventHandler),t.value=e.filteredValue},e.prototype.read=function(e,t,i,r){var n=document.querySelector("#numberui-"+t.uid).ej2_instances[0].value;r.filterByColumn(t.field,i,n,"and",!0)},e}(),qn=function(){function e(e,t,i){this.parent=e,this.serviceLocator=t,this.filterSettings=i}return e.prototype.create=function(e){var r=e.column.isForeignColumn(),n=r?e.column.dataSource:this.parent.dataSource,o=r?e.column.foreignKeyValue:e.column.field;this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.dialogObj=e.dialogObj,this.dropInstance=new s.DropDownList(t.extend({dataSource:n instanceof i.DataManager?n:new i.DataManager(n),query:(new i.Query).select(o),fields:{text:o,value:o},placeholder:e.localizeText.getConstant("SelectValue"),cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this),actionComplete:function(e){e.result=i.DataUtil.distinct(e.result,o,!0)}},e.column.filter.params)),this.dropInstance.appendTo(this.elem)},e.prototype.write=function(e){var i=document.querySelector("#bool-ui-"+e.column.uid).ej2_instances[0];t.isNullOrUndefined(e.filteredValue)||(i.text=e.filteredValue)},e.prototype.read=function(e,t,i,r){var n=document.querySelector("#bool-ui-"+t.uid).ej2_instances[0].value;r.filterByColumn(t.field,i,n,"and",!1)},e.prototype.openPopup=function(e){te(e,this.dialogObj)},e}(),Hn=function(){function e(e,t,i){this.parent=e,this.locator=t,this.fltrSettings=i}return e.prototype.create=function(e){var i=ue(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type?this.datePickerObj=new l.DatePicker(t.extend({format:i,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new l.DateTimePicker(t.extend({format:i,cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,open:this.openPopup.bind(this)},e.column.filter.params))),this.datePickerObj.appendTo(this.inputElem)},e.prototype.write=function(e){document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=t.isNullOrUndefined(e.filteredValue)?null:new Date(e.filteredValue)},e.prototype.read=function(e,i,r,n){var o=document.querySelector("#dateui-"+i.uid).ej2_instances[0].value;o=t.isNullOrUndefined(o)?null:o,n.filterByColumn(i.field,r,o,"and",!0)},e.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e}(),Un=function(){function e(e,t,i,r,n){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:Nn,number:Ln,date:Hn,boolean:qn,datetime:Hn},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=r,this.filterObj=n,this.flMuiObj=new Pn(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new bn(e)}return e.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},e.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},e.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),(t.isNullOrUndefined(this.col.filter)||t.isNullOrUndefined(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},e.prototype.closeDialog=function(e){if(this.dlgObj){this.parent.isReact&&(this.parent.destroyTemplate(["filterTemplate"]),this.parent.renderTemplates());var i=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&i){var r={cancel:!1,column:this.col,target:e,element:i};if(this.parent.notify("filter-menu-close",r),r.cancel)return;this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(di,this.actionComplete),this.isMenuCheck=!1),this.dlgObj.destroy(),t.remove(i)}this.parent.notify("filter-dialog-close",{})}},e.prototype.renderDlgContent=function(e,i){var n={requestType:"filterbeforeopen",columnName:i.field,columnType:i.type};n.filterModel=this,this.parent.trigger(bt,n);var o=this.parent.createElement("div",{className:"e-flmenu-maindiv",id:i.uid+"-flmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:i.uid+"-flmdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),this.parent.enableAdaptiveUI?document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,i),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:"e-flmenu-cancelbtn"}}],content:o,width:!t.isNullOrUndefined(O(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv)},e.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},e.prototype.dialogCreated=function(e,i){!t.Browser.isDevice&&e&&ee(e,this.dlgObj),this.renderFilterUI(e,i),this.parent.notify("filterDialogCreated",{}),this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show(),i.filterTemplate||this.writeMethod(i,this.dlgObj.element.querySelector("#"+i.uid+"-flmenu"));var r={requestType:"filterafteropen",columnName:i.field,columnType:i.type};r.filterModel=this,this.isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(St,r)},e.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},e.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},e.prototype.renderFlValueUI=function(e,i,r){var n=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),o=this.filterObj;e.appendChild(n);var s=new this.colTypes[r.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(r.filterTemplate){var l={};l[r.field]=l.value=o.values[r.field],r.foreignKeyValue&&(l[r.foreignKeyValue]=o.values[r.field],l[r.field]=void 0);l.column=r;var a=this.parent.isReact&&"string"!=typeof r.filterTemplate,h=this.parent.element.id+r.uid+"filterTemplate";if(a)r.getFilterTemplate()(l,this.parent,"filterTemplate",h,null,null,n),this.parent.renderTemplates();else{var d=r.getFilterTemplate()(l,this.parent,"filterTemplate",h);t.updateBlazorTemplate(h,"FilterTemplate",r),q(n,d)}this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(di,this.actionComplete,this),this.menuFilterBase.getAllData())}else if(t.isNullOrUndefined(r.filter)||t.isNullOrUndefined(r.filter.ui)||t.isNullOrUndefined(r.filter.ui.create))s.create({column:r,target:n,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var c=r.filter.ui.create;"string"==typeof c&&(c=t.getValue(c,window)),c({column:r,target:n,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}},e.prototype.writeMethod=function(e,i){for(var r,n=i.querySelector(".e-flmenu-valinput"),o=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),s=0,l=this.filterSettings.columns;s<l.length;s++){var a=l[s];e.uid===a.uid&&(r=a.value)}if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.write))o.write({column:e,target:n,parent:this.parent,filteredValue:r});else{var h=e.filter.ui.write;"string"==typeof h&&(h=t.getValue(h,window)),h({column:e,target:n,parent:this.parent,filteredValue:r})}},e.prototype.filterBtnClick=function(e){var i=this.dlgObj.element.querySelector(".e-flmenu-valuediv input"),r=this.flMuiObj.getFlOperator(),n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(e.filterTemplate){var o=this.dlgDiv.querySelector(".e-flmenu-valuediv"),s=void 0;if(o.children[0].value)s=o.children[0].value;else if(t.isBlazor()||t.isNullOrUndefined(o.children[0].ej2_instances)){var l=o.querySelector(".e-control");s="boolean"===e.type?l.checked:t.isNullOrUndefined(l.ej2_instances)?l.value:l.ej2_instances[0].value}else s=(this.parent.isAngular?o.children[0]:o.querySelector("input")).ej2_instances[0].value;this.filterObj.filterByColumn(e.field,r,s)}else if(t.isNullOrUndefined(e.filter)||t.isNullOrUndefined(e.filter.ui)||t.isNullOrUndefined(e.filter.ui.read))n.read(i,e,r,this.filterObj);else{var a=e.filter.ui.read;"string"==typeof a&&(a=t.getValue(a,window)),a({element:i,column:e,operator:r,fltrObj:this.filterObj})}this.closeDialog()},e.prototype.closeResponsiveDialog=function(){this.closeDialog()},e.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog();var t=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter",i=this.parent.element.querySelector('[e-mappinguid="'+e.uid+'"]').parentElement.querySelector(t);i&&i.classList.remove("e-filtered")},e.prototype.destroy=function(){this.closeDialog()},e.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},e.prototype.renderCheckBoxMenu=function(){return this.isMenuCheck=!0,this.menuFilterBase.updateModel(this.options),this.menuFilterBase.getAndSetChkElem(this.options),this.dlgObj.buttons=[{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{content:this.menuFilterBase.getLocalizedLabel("FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{cssClass:"e-flat",content:this.menuFilterBase.getLocalizedLabel("ClearButton")}}],this.menuFilterBase.dialogObj=this.dlgObj,this.menuFilterBase.dlg=this.dlgObj.element,this.menuFilterBase.dlg.classList.add("e-menucheckbox"),this.menuFilterBase.dlg.classList.remove("e-checkboxfilter"),this.maxHeight="800px",this.menuFilterBase.sBox.innerHTML},e.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(St,e)},e}(),jn=function(){function e(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new bn(e),this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},e.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},e.prototype.closeDialog=function(){this.destroy(),this.isresetFocus&&this.parent.notify("restore-Focus",{})},e.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},e.prototype.getModuleName=function(){return"checkboxFilter"},e.prototype.actionBegin=function(e){this.parent.trigger(bt,e)},e.prototype.actionComplete=function(e){this.parent.trigger(St,e)},e.prototype.actionPrevent=function(e){X(this.parent)&&(this.parent.notify(ii,e),e.cancel=!0)},e.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},e.prototype.applyCustomFilter=function(){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("cbox-filter-begin",this.actionBegin,this),this.parent.on(di,this.actionComplete,this),this.parent.on(ci,this.actionPrevent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cbox-filter-begin",this.actionBegin),this.parent.off(di,this.actionComplete),this.parent.off(ci,this.actionPrevent))},e}(),Vn=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gn=function(e){function t(t,i,r,n){var o=e.call(this,t,i,r)||this;return o.parent=t,o.isresetFocus=!0,o.excelFilterBase=new Rn(t,n),o}return Vn(t,e),t.prototype.destroy=function(){this.excelFilterBase.closeDialog()},t.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},t.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify("restore-Focus",{})},t.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},t.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},t.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},t.prototype.filterByColumn=function(e,t,i,r,n,o,s,l){this.excelFilterBase.filterByColumn(e,t,i,r,n,o,s,l)},t.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},t.prototype.getModuleName=function(){return"excelFilter"},t}(jn),_n=function(){function r(e,t,i){this.predicate="and",this.contentRefresh=!0,this.filterByMethod=!0,this.refresh=!0,this.values={},this.operators={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:Un,CheckBox:jn,Excel:Gn},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}return r.prototype.render=function(r){if(!(i.DataUtil.getObject("args.isFrozen",r)||this.parent.getFrozenMode()===Pi&&i.DataUtil.getObject("args.renderFrozenRightContent",r))){var n=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&n.columns.length){var o=this.parent.element.querySelector(".e-filterbar");o&&t.remove(o);var s=new Vi(this.serviceLocator,e.CellType.Filter,n);this.serviceLocator.getService("cellRendererFactory").addCellRenderer(e.CellType.Filter,new Bn(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),s.element=this.parent.createElement("tr",{className:"e-filterbar"});var l=this.generateRow();l.data=this.values,"Right"===n.getFrozenMode()?n.getFrozenRightHeader().querySelector("thead").appendChild(s.element):this.parent.getHeaderContent().querySelector("thead").appendChild(s.element);var a=this.parent.element.querySelector(".e-rowdragheader");this.element=s.render(l,n.getColumns(),null,null,s.element);var h=this.element.querySelector(".e-detailheadercell");h&&(h.className="e-filterbarcell e-mastercell"),a&&(a.className="e-dragheadercell e-mastercell");var d=[].slice.call(this.element.getElementsByClassName("e-grouptopleftcell"));d.length&&d[d.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(oi,{case:"filter"})}}},r.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},r.prototype.setFilterModel=function(e){var t=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[t](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},r.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator)for(var i=[].slice.call(this.element.getElementsByClassName("e-filterbaroperator")),r=0;r<i.length;r++)i[r].ej2_instances[0].destroy();if(this.element){t.remove(this.element);var n=this.parent.getHeaderContent().querySelector(".e-filterbar");this.parent.isFrozenGrid()&&n&&t.remove(n)}}},r.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,e.ResponsiveDialogAction.isFilter)},r.prototype.generateRow=function(){var e=new vi({});return e.cells=this.generateCells(),e},r.prototype.generateCells=function(){var t=[];if(this.parent.allowGrouping)for(var i=0,r=this.parent.groupSettings.columns.length;i<r;i++)t.push(this.generateCell({},e.CellType.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&t.push(this.generateCell({},e.CellType.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&t.push(this.generateCell({},e.CellType.RowDragHIcon));for(var n=0,o=this.parent.getColumns();n<o.length;n++){var s=o[n];t.push(this.generateCell(s))}return"Right"===this.parent.getFrozenMode()&&t.push(this.generateCell({},e.CellType.RowDragHIcon)),t},r.prototype.generateCell=function(t,i){var r={visible:t.visible,isDataCell:!1,rowId:"",column:t,cellType:i||e.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new Ci(r)},r.prototype.updateModel=function(){var e=this.parent.getColumnByField(this.fieldName);this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex];for(var t=Array.isArray(this.value)?this.value:[this.value],i=0,r=t.length;i<r;i++){var n=e.isForeignColumn()?e.foreignKeyValue:this.fieldName;this.currentFilterObject={field:n,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t[i],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}};var o=this.getFilteredColsIndexByField(e);o>-1&&!Array.isArray(this.value)?this.filterSettings.columns[o]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject)}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},r.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,r=t.length;i<r;i++)if(t[i].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},r.prototype.onActionComplete=function(e){var i=this.isRemove?{requestType:"filtering",type:St}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:t.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:St};this.parent.trigger(St,t.extend(e,i)),this.isRemove=!1},r.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},r.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},r.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},r.prototype.refreshFilterValue=function(){"FilterBar"===this.filterSettings.type&&this.filterSettings.columns.length&&!this.parent.getCurrentViewRecords().length&&this.parent.enablePersistence&&(this.initialEnd(),this.parent.removeEventListener("beforeDataBound",this.refreshFilterValueFn))},r.prototype.initialEnd=function(){if(this.parent.off(At,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,i=e.filterSettings.columns;t<i.length;t++){var r=i[t];this.filterByColumn(r.field,r.operator,r.value,r.predicate,r.matchCase,r.ignoreAccent,r.actualFilterValue,r.actualOperator)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(Bt,this.enableAfterRender,this),this.parent.on("filtering-complete",this.onActionComplete,this),this.parent.on(Nt,this.onPropertyChanged,this),this.parent.on(Vt,this.keyUpHandler,this),this.parent.on(Kt,this.columnPositionChanged,this),this.parent.on(Ht,this.render,this),this.parent.on(At,this.initialEnd,this),this.parent.on("filter-menu-close",this.filterMenuClose,this),this.docClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.docClickHandler,this),this.parent.on("filterOpen",this.columnMenuFilter,this),this.parent.on(Gt,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on("close-filter-dialog",this.clickHandler,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener("beforeDataBound",this.refreshFilterValueFn))},r.prototype.removeEventListener=function(){t.EventHandler.remove(document,"click",this.docClickHandler),this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off(Bt,this.enableAfterRender),this.parent.off("filtering-complete",this.onActionComplete),this.parent.off(Nt,this.onPropertyChanged),this.parent.off(Vt,this.keyUpHandler),this.parent.off(Kt,this.columnPositionChanged),this.parent.off(Ht,this.render),this.parent.off("filterOpen",this.columnMenuFilter),this.parent.off("filter-menu-close",this.filterMenuClose),this.parent.off(Gt,this.filterIconClickHandler),this.parent.off("close-filter-dialog",this.clickHandler))},r.prototype.filterMenuClose=function(){this.fltrDlgDetails.isOpen=!1},r.prototype.filterByColumn=function(e,i,r,n,o,s,l,a){var h,d=this,c=this.parent;if(this.column=c.grabColumnByFieldFromAllCols(e),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(i=this.getOperatorName(e)),this.column){if("FilterBar"===this.filterSettings.type&&(h=c.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),!t.isNullOrUndefined(this.column.allowFiltering)&&!this.column.allowFiltering)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText});if(X(c))return void c.notify(ii,{instance:this,handler:this.filterByColumn,arg1:e,arg2:i,arg3:r,arg4:n,arg5:o,arg6:s,arg7:l,arg8:a});if(this.predicate=n||(Array.isArray(r)?"or":"and"),this.value=r,this.matchCase=o||!1,this.ignoreAccent=this.ignoreAccent=t.isNullOrUndefined(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.operator=i,r=!t.isNullOrUndefined(r)&&r.toString(),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),c.getColumnHeaderByField(e).setAttribute("aria-filtered","true"),h&&"FilterBar"===this.filterSettings.type){if(r.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,r))return this.filterStatusMsg=r.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();h.value!==r&&(h.value=r)}t.isNullOrUndefined(this.column.format)?this.values[this.column.field]=r:(this.applyColumnFormat(r),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(h.value=this.values[this.column.field]));var p={field:this.fieldName,predicate:n,matchCase:o,ignoreAccent:s,operator:this.operator,value:this.value,type:this.column.type};this.parent.filterSettings.columns.filter(function(e){return e.field===d.fieldName}).length>1&&!t.isNullOrUndefined(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(p):this.actualPredicate[this.fieldName]=[p],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}},r.prototype.applyColumnFormat=function(e){var t="date"===this.column.type||"datetime"===this.column.type?new Date(e):parseFloat(e);this.values[this.column.field]=this.setFormatForFlColumn(t,this.column)},r.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),r=0;r<i.length;r++){var n=Object.keys(e[i[r]]);1===n.length&&"uid"===n[0]&&(t=!1)}return t},r.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var i=0,r=Object.keys(e.properties);i<r.length;i++){var n=r[i];switch(n){case"columns":var o={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:bt,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify(Lt,o),o.cancel)return void(t.isNullOrUndefined(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject);this.addFilteredClass(o.currentFilteringColumn),this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[n]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings()}}},r.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(n=0;n<this.filterSettings.columns.length;n++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[n].uid);var e=this.filterSettings.columns[n].value;if(e=!t.isNullOrUndefined(e)&&e.toString(),t.isNullOrUndefined(this.column.format)){var i=this.filterSettings.columns[n].field;this.values[i]=this.filterSettings.columns[n].value}else this.applyColumnFormat(e);(o=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[n].field]||t.isNullOrUndefined(this.cellText[this.filterSettings.columns[n].field])?o.value=this.filterSettings.columns[n].value:o.value=this.cellText[this.column.field])}if(0===this.filterSettings.columns.length)for(var r=this.parent.getColumns(),n=0;n<r.length;n++){var o=this.getFilterBarElement(r[n].field);o&&""!==o.value&&(o.value="",delete this.values[r[n].field])}}},r.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),t=0,i=e.length;t<i;t++)e[t].removeAttribute("aria-filtered"),e[t].classList.remove("e-filtered")},r.prototype.getFilterBarElement=function(e){var i,r="[id='"+e+"_filterBarcell']";return r&&!t.isNullOrUndefined(this.element)&&(i=this.element.querySelector(r)),i},r.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},r.prototype.clearFiltering=function(e){var i=this,r=B(this.filterSettings.columns);if(!t.isNullOrUndefined(e))return this.refresh=!1,e.forEach(function(e){i.removeFilteredColsByField(e,!1)}),this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.parent.renderModule.refresh(),void(this.refresh=!0);if(X(this.parent))return void this.parent.notify(ii,{instance:this,handler:this.clearFiltering});for(s=0;s<r.length;s++)r[s].uid=r[s].uid||this.parent.getColumnByField(r[s].field).uid;var n=r.map(function(e){return e.uid}),o=n.filter(function(e,t){return n.indexOf(e)===t});this.refresh=!1;for(var s=0,l=o.length;s<l;s++)this.removeFilteredColsByField(this.parent.getColumnByUid(o[s]).field,!1);if(this.refresh=!0,o.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var a=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),s=0,l=a.length;s<l;s++)a[0].removeAttribute("aria-filtered"),a[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()},r.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var r=i[t];if(r.field===e&&r.value===this.value&&r.operator===this.operator&&r.predicate===this.predicate)return!0}return!1},r.prototype.columnMenuFilter=function(e){this.column=e.col;var i=t.closest(e.target,"#"+e.id);e.isClose&&!i?this.filterModule.closeDialog():i&&this.filterDialogOpen(this.column,e.target)},r.prototype.filterDialogOpen=function(e,t,i,r){this.filterModule&&this.filterModule.closeDialog(),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,r))},r.prototype.createOptions=function(e,i,r,n){var o=this.parent,s=e.filter.dataSource||o.dataSource&&"result"in o.dataSource?o.dataSource:o.getDataModule().dataManager,l=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:s,format:e.format,height:800,columns:o.getColumns(),filteredColumns:o.filterSettings.columns,target:i,dataManager:o.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:o.filterSettings.ignoreAccent,parserFn:e.getParser(),query:o.query,template:e.getFilterItemTemplate(),hideSearchbox:!t.isNullOrUndefined(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:o.getLocaleConstants(),position:{X:r,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:o.localeObj,isRemote:o.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===l?this.actualPredicate[e.field][0].operator:"equal"}},r.prototype.removeFilteredColsByField=function(e,t){var i,r=this.filterSettings.columns;if(X(this.parent)){var n={instance:this,handler:this.removeFilteredColsByField,arg1:e,arg2:t};return void this.parent.notify(ii,n)}for(var o=r.map(function(e){return e.uid}),s=o.filter(function(e,t){return o.indexOf(e)===t}),l=this,a=0,h=s.length;a<h&&"break"!==function(n,o){r[n].uid=r[n].uid||l.parent.getColumnByField(r[n].field).uid;var a=r.length,h=l.parent.grabColumnByUidFromAllCols(s[n]);if(h.field===e||h.field===h.foreignKeyValue&&h.isForeignColumn()){var d=l.filterSettings.columns.filter(function(e){return e.uid===h.uid})[0];if("FilterBar"===l.filterSettings.type&&!t){var c="[id='"+h.field+"_filterBarcell']";(i=l.parent.getHeaderContent().querySelector(c))&&(i.value="",delete l.values[e])}for(;a--;)r[a].uid===h.uid&&r.splice(a,1);var p=l.parent.getColumnHeaderByField(h.field);if(p.removeAttribute("aria-filtered"),"FilterBar"!==l.filterSettings.type){var u=l.parent.showColumnMenu?".e-columnmenu":".e-icon-filter";p.querySelector(u).classList.remove("e-filtered")}return l.isRemove=!0,l.actualPredicate[e]&&delete l.actualPredicate[e],l.values[e]&&delete l.values[e],l.refresh&&l.parent.notify(Lt,{requestType:"filtering",type:bt,currentFilterObject:d,currentFilterColumn:h,action:"clearFilter"}),"break"}}(a);a++);this.updateFilterMsg()},r.prototype.getModuleName=function(){return"filter"},r.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},r.prototype.keyUpHandler=function(e){var i=this.parent,r=e.target;if(r&&t.matches(r,".e-filterbar input")){var n=t.closest(r,"th.e-filterbarcell");if(this.column=i.getColumnByUid(n.getAttribute("e-mappinguid")),!this.column)return;if("altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator){var o=t.closest(r,"span").querySelector(".e-filterbaroperator");o.ej2_instances[0].showPopup(),o.focus()}"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=r.value.trim(),this.processFilter(e))}if("altDownArrow"===e.action&&"FilterBar"!==this.filterSettings.type){var s=i.focusModule.currentInfo.element;if(s&&s.classList.contains("e-headercell")){var l=i.getColumnByUid(s.firstElementChild.getAttribute("e-mappinguid"));this.openMenuByField(l.field),this.parent.focusModule.clearIndicator()}}"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.filterModule.closeDialog(),i.notify("restore-Focus",{}))},r.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},r.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,i=void 0,r=this.filterSettings.columns,n=void 0;if(!this.filterSettings.showFilterBarStatus)return;if(r.length>0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var o=0;o<r.length;o++)if(n=e.grabColumnByUidFromAllCols(r[o].uid)||e.grabColumnByFieldFromAllCols(r[o].field),o&&(this.filterStatusMsg+=" && "),t.isNullOrUndefined(n.format))this.filterStatusMsg+=n.headerText+": "+this.values[n.field];else{var s="date"===n.type||"datetime"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),n.type):this.values[n.field];i="date"!==n.type&&"datetime"!==n.type?this.serviceLocator.getService("valueFormatter").toView(s,n.getParser()).toString():this.setFormatForFlColumn(s,n),this.filterStatusMsg+=n.headerText+": "+i}}e.allowPaging&&e.updateExternalMessage(this.filterStatusMsg),this.filterStatusMsg=""}},r.prototype.setFormatForFlColumn=function(e,t){return this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter()).toString()},r.prototype.checkForSkipInput=function(e,t){var r;if("number"===e.type)(i.DataUtil.operatorSymbols[t]||this.skipNumberInput.indexOf(t)>-1)&&(r=!0);else if("string"===e.type)for(var n=0,o=t;n<o.length;n++){var s=o[n];this.skipStringInput.indexOf(s)>-1&&(r=!0)}return r},r.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},r.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},r.prototype.stopTimer=function(){window.clearInterval(this.timer)},r.prototype.onTimerTick=function(){var e="[id='"+this.column.field+"_filterBarcell']",i=this.element.querySelector(e);!i&&this.parent.isFrozenGrid()&&(i=this.parent.getHeaderContent().querySelector(e));var r;if(this.cellText[this.column.field]=i.value,this.stopTimer(),t.isNullOrUndefined(this.column.filterBarTemplate))r=JSON.parse(JSON.stringify(i.value));else{var n=this.column.filterBarTemplate.read;"string"==typeof n&&(n=t.getValue(n,window)),t.isNullOrUndefined(n)||(this.value=n.call(this,i))}if(t.isNullOrUndefined(this.value)||""===this.value)return void this.removeFilteredColsByField(this.column.field);this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent),this.filterByMethod=!0,i.value=r,this.updateFilterMsg()},r.prototype.validateFilterValue=function(e){var i,r;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal,i=[">","<","=","!"];for(var n=0;n<e.length;n++)if(i.indexOf(e[n])>-1){r=n;break}this.getOperator(e.substring(r)),0!==r&&(this.value=e.substring(0,r)),""!==this.value&&e.length>=1&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),t.isNullOrUndefined(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,"*"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(e.length-1)?(this.value=this.value.slice(0,-1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.endsWith):this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},r.prototype.getOperator=function(e){var r=e.charAt(0),n=e.slice(0,2),o=t.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},i.DataUtil.operatorSymbols);(o.hasOwnProperty(r)||o.hasOwnProperty(n))&&(this.operator=o[r],this.value=e.substring(1),this.operator||(this.operator=o[n],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},r.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},r.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}],numberOperator:e,dateOperator:e,datetimeOperator:e,booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]}},r.prototype.openMenuByField=function(e){var t=this.parent;if(t.enableAdaptiveUI)return void this.showCustomFilter(!1);var i=t.getColumnByField(e),r=t.getColumnHeaderByField(e).querySelector(".e-filtermenudiv");if(r){var n=t.element.getBoundingClientRect(),o=r.getBoundingClientRect();this.filterDialogOpen(i,r,o.right-n.left,o.bottom-n.top)}},r.prototype.filterIconClickHandler=function(e){var t=e.target;if(t.classList.contains("e-filtermenudiv")&&("Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)){var i=this.parent.getColumnByUid(O(t,"e-headercell").firstElementChild.getAttribute("e-mappinguid"));if(this.column=i,this.fltrDlgDetails.field===i.field&&this.fltrDlgDetails.isOpen)return;this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:i.field,isOpen:!0},this.openMenuByField(i.field)}},r.prototype.clickHandler=function(e){if("FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(O(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&t.closest(e.target,"div").querySelector(".e-filterbaroperator").focus(),e.target.classList.contains("e-list-item"))){var i=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","");-1!==i.indexOf("grid-column")&&t.closest(document.getElementById(i),"div").querySelector(".e-filtertext").focus()}if("Immediate"===this.filterSettings.mode||"Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type){var r=e.target,n=r.classList.contains("e-day"),o=O(this.parent.element,"e-dialog"),s=!1,l=O(r,"e-popup"),a=this.parent.element.querySelector(".e-filter-popup");if(o&&l&&(s=o.id===l.id),a&&(O(r,"e-excel-ascending")||O(r,"e-excel-descending"))&&this.filterModule.closeDialog(r),O(r,"e-filter-popup")||r.classList.contains("e-filtermenudiv"))return;if(!this.filterModule||O(r,"e-popup-wrapper")||t.closest(r,".e-filter-item.e-menu-item")||n||(s&&!O(r,"e-filter-popup")&&!O(r,"e-popup-flmenu")||!l&&a)&&(this.filterModule.isresetFocus=O(r,"e-grid")&&O(r,"e-grid").id===this.parent.element.id,this.filterModule.closeDialog(r)),"Immediate"===this.filterSettings.mode&&r.classList.contains("e-clear-icon")){var h=r.previousElementSibling;this.removeFilteredColsByField(h.id.slice(0,-14))}}},r.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate;for(var t=new i.DataManager(this.filterSettings.columns),r=(new i.Query).where("field",this.filterOperators.equal,e.field),n=t.executeLocal(r),o=0;o<n.length;o++){for(var s=-1,l=0;l<this.filterSettings.columns.length;l++)if(n[o].field===this.filterSettings.columns[l].field){s=l;break}-1!==s&&this.filterSettings.columns.splice(s,1)}this.values[e.field]&&delete this.values[e.field];var a=this.parent.showColumnMenu?".e-columnmenu":".e-icon-filter",h=this.parent.getColumnHeaderByField(e.field).querySelector(a);"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&h&&h.classList.add("e-filtered")):(h&&h.classList.remove("e-filtered"),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},r.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[t].field)||ae(e[t].field,this.parent.getForeignKeyColumns());var i=e[t].field;this.parent.getColumnByField(e[t].field)||(i=ae(e[t].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[t].operator,e[t].value,e[t].type,e[t].predicate,e[t].matchCase,e[t].ignoreAccent,e[t].uid)}},r.prototype.refreshFilterIcon=function(e,t,i,r,n,o,s,l){var a={field:e,predicate:n,matchCase:o,ignoreAccent:s,operator:t,value:i,type:r};this.actualPredicate[e]?this.actualPredicate[e].push(a):this.actualPredicate[e]=[a];var h=l?this.parent.grabColumnByUidFromAllCols(l).field:e;this.addFilteredClass(h)},r.prototype.addFilteredClass=function(e){var t;this.parent.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):this.parent.getColumnByField(e)&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},r.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},r.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},r.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()},r}(),Wn={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},Kn=function(){function i(e){this.tapped=!1,this.isDblClk=!0,this.parent=e,this.parent.isDestroyed||(this.widthService=new Tr(e),this.addEventListener())}return i.prototype.autoFitColumns=function(e){var t=void 0===e||null===e||e.length<=0?this.parent.getColumns().map(function(e){return e.field}):"string"==typeof e?[e]:e;this.findColumn(t)},i.prototype.autoFit=function(){var e=this.parent.getColumns().filter(function(e){return!0===e.autoFit}).map(function(e){return e.field||e.headerText});e.length>0&&this.autoFitColumns(e),"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable()},i.prototype.resizeColumn=function(e,i,r){var n,o,s,l,a,h,d=this.parent,c=0,p=Ri,u=0,g=r||this.parent.getUidByColumnField(e),f=this.parent.getNormalizedColumnIndex(g),m=this.parent.getColumnIndexByField(e),y=d.getFrozenColumns()||d.getFrozenLeftColumnsCount(),v=d.getMovableColumnsCount();if(t.isNullOrUndefined(d.getFooterContent())||(s=d.getFooterContentTable()),d.isFrozenGrid()){var C=d.getColumnByField(e);C.getFreezeTableName()===Li?(n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+g+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(f+1)+")"),s&&(h=s.querySelectorAll("td:nth-child("+(f+1)+")"))):"movable"===C.getFreezeTableName()?(n=d.getHeaderContent().querySelector("."+Ii).children[0],o=d.getContent().querySelector("."+Ei).children[0],l=n.querySelector('[e-mappinguid="'+g+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(f-y+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(f-y+1)+")"))):C.getFreezeTableName()===Ni&&(n=d.getHeaderContent().querySelector(".e-frozen-right-header").children[0],o=d.getContent().querySelector(".e-frozen-right-content").children[0],l=n.querySelector('[e-mappinguid="'+g+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(f-(y+v)+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(f-(y+v)+1)+")")))}else n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+g+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(f+1)+"):not(.e-groupcaption)"),s&&(h=s.querySelectorAll("td:nth-child("+(f+1)+"):not(.e-groupcaption)"));var w=[].slice.call(n.querySelector("tr").getElementsByClassName("e-grouptopleftcell"));if(w.length>0)for(O=0;O<w.length;O++)u+=w[O].offsetWidth;var b=o.querySelector(".e-detailrowcollapse")||o.querySelector(".e-detailrowexpand");(this.parent.detailTemplate||this.parent.childGrid)&&b&&(u+=b.offsetWidth);var S=[l],R=[],x=[];if(s)for(O=0;O<h.length;O++)x[O]=h[O].cloneNode(!0);for(O=0;O<a.length;O++)R[O]=a[O].cloneNode(!0);var F=this.createTable(n,S,"e-gridheader"),E=this.createTable(o,R,p),I=null;x.length&&(I=this.createTable(s,x,"e-gridfooter"));var T=d.getColumns()[m],z=T.width=t.formatUnit(Math.max(F,E,I)),D=T.maxWidth&&parseFloat(T.maxWidth.toString());if(parseInt(z,10)>D&&(T.width=D),this.widthService.setColumnWidth(d.getColumns()[m]),!1===d.getColumns().some(function(e){return null===e.width||void 0===e.width||e.width.length<=0}))for(var M=d.getColumns(),O=0;O<M.length;O++)M[O].visible&&(c+=parseFloat(M[O].width));var k=c+u;c>0&&!d.isFrozenGrid()&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new Ct({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(k="100%"),n.style.width=t.formatUnit(k),o.style.width=t.formatUnit(k),t.isNullOrUndefined(s)||(s.style.width=t.formatUnit(k)));var A=n.offsetWidth;d.getContent().scrollWidth>A?(n.classList.add("e-tableborder"),o.classList.add("e-tableborder")):(n.classList.remove("e-tableborder"),o.classList.remove("e-tableborder")),t.isNullOrUndefined(s)||s.classList.add("e-tableborder")},i.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},i.prototype.getModuleName=function(){return"resize"},i.prototype.findColumn=function(e){for(var i=0;i<e.length;i++){var r=e[i],n=this.parent.getColumnIndexByField(r),o=this.parent.getColumns()[n];n>-1&&!t.isNullOrUndefined(o)&&!0===o.visible&&this.resizeColumn(r,n)}},i.prototype.createTable=function(e,t,i){var r=this.parent.createElement("div");r.className=this.parent.element.className,r.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.parent.createElement("div");n.className=i;var o=this.parent.createElement("table");o.className=e.className,o.classList.add("e-resizetable"),o.style.cssText="table-layout: auto;width: auto";for(var s=this.parent.createElement("tr"),l=0;l<t.length;l++){var a=s.cloneNode();a.className=e.querySelector("tr").className,a.appendChild(t[l]),o.appendChild(a)}n.appendChild(o),r.appendChild(n),document.body.appendChild(r);var h=o.getBoundingClientRect().width;return document.body.removeChild(r),Math.ceil(h)},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ht,this.refreshHeight,this),this.parent.on(Ot,this.wireEvents,this),this.parent.on(At,this.autoFit,this),this.parent.on(gi,this.refreshHeight,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.refreshHeight),this.parent.off(Ot,this.wireEvents),this.parent.off(gi,this.refreshHeight))},i.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},i.prototype.refreshHeight=function(){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)e[t].parentElement.offsetHeight>0&&(e[t].style.height=e[t].parentElement.offsetHeight+"px");this.setHandlerHeight()},i.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart,this),t.EventHandler.add(this.parent.getHeaderContent(),"dblclick",this.callAutoFit,this)},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart),t.EventHandler.remove(this.parent.getHeaderContent(),"dblclick",this.callAutoFit)},i.prototype.getResizeHandlers=function(){return this.parent.isFrozenGrid()?[].slice.call(this.parent.getHeaderContent().getElementsByClassName(Wn.root)):[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Wn.root))},i.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Wn.suppress)),t=0;t<e.length;t++)e[t].style.height=e[t].parentElement.offsetHeight+"px"},i.prototype.callAutoFit=function(e){if(e.target.classList.contains("e-rhandler")){var i=this.getTargetColumn(e);if(i.columns)return;this.resizeColumn(i.field,this.parent.getNormalizedColumnIndex(i.uid),i.uid),t.closest(e.target,Wn.header).classList.add("e-resized")}},i.prototype.touchResizeStart=function(t){if(!e.Global.timer)return e.Global.timer=setTimeout(function(){e.Global.timer=null},300),this.resizeStart(t);clearTimeout(e.Global.timer),e.Global.timer=null,this.callAutoFit(t)},i.prototype.resizeStart=function(e){var i=this;if(e.target.classList.contains("e-rhandler")){if(!this.helper){if(0===this.getScrollBarWidth()){if(this.parent.allowGrouping)for(u=0;u<this.parent.groupSettings.columns.length;u++)this.widthService.setColumnWidth(new Ct({width:"30px"}),u);for(var r=0,n=this.refreshColumnWidth();r<n.length;r++){var o=n[r];this.widthService.setColumnWidth(o)}this.widthService.setWidthToTable()}if(this.refreshStackedColumnWidth(),this.element=e.target,this.parent.getVisibleFrozenColumns()){var s=this.parent.getMovableContentTbody(),l=this.parent.getFrozenLeftContentTbody(),a=this.parent.getFrozenRightContentTbody(),h=[].slice.call(s.querySelectorAll("tr")),d=[].slice.call(l.querySelectorAll("tr")),c=[];this.parent.getFrozenMode()===Pi&&a&&(c=[].slice.call(a.querySelectorAll("tr")));for(var p=this,u=0;u<h.length;u++)!function(e){Be(p.parent,function(t,r){i.parent.rowHeight?r[e].style.height=i.parent.rowHeight+"px":r[e].style.removeProperty("height")},[d,h,c])}(u)}this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.column.getFreezeTableName()===Ni?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(t.isNullOrUndefined(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}if(t.Browser.isDevice&&!this.helper.classList.contains(Wn.icon))this.helper.classList.add(Wn.icon),t.EventHandler.add(document,t.Browser.touchStartEvent,this.removeHelper,this),t.EventHandler.add(this.helper,t.Browser.touchStartEvent,this.resizeStart,this);else{var g={e:e,column:this.column};this.parent.trigger("resizeStart",g,function(e){if(e.cancel||i.parent.isEdit)return void i.cancelResizeAction();t.EventHandler.add(document,t.Browser.touchEndEvent,i.resizeEnd,i),t.EventHandler.add(i.parent.element,t.Browser.touchMoveEvent,i.resizing,i),i.updateCursor("add")})}}},i.prototype.cancelResizeAction=function(e){e&&(t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),t.Browser.isDevice&&(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart)),t.detach(this.helper),this.refresh()},i.prototype.getWidth=function(e,t,i){return t&&e<t?t:i&&e>i?i:e},i.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[t].style.height=this.element.parentElement.offsetHeight+"px"},i.prototype.getColData=function(e,i){return{width:parseFloat(t.isNullOrUndefined(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+i,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},i.prototype.resizing=function(e){if(!t.isNullOrUndefined(this.column)){var i=0;t.isNullOrUndefined(this.column)&&(i=O(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight());var r=this.getPointX(e),n=this.parent.enableRtl?-(r-this.pageX):r-this.pageX;this.column.getFreezeTableName()===Ni&&(n=this.parent.enableRtl?r-this.pageX:this.pageX-r);var o=this.getColData(this.column,n);o.width||(o.width=t.closest(this.element,"th").offsetWidth);var s=this.getWidth(o.width,o.minWidth,o.maxWidth);if(this.parent.log("resize_min_max",{column:this.column,width:s}),this.column.getFreezeTableName()===Ni&&(this.parent.enableRtl&&this.minMove>=r||!this.parent.enableRtl&&this.minMove<=r)&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),(this.column.getFreezeTableName()!==Ni&&(!this.parent.enableRtl&&this.minMove>=r||this.parent.enableRtl&&this.minMove<=r)||this.column.getFreezeTableName()===Ni&&(this.parent.enableRtl&&this.minMove>=r||!this.parent.enableRtl&&this.minMove<=r))&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),s!==parseFloat(t.isNullOrUndefined(this.column.width)||"auto"===this.column.width?i.toString():this.column.width.toString())){this.pageX=r,this.column.width=t.formatUnit(s);var l={e:e,column:this.column};if(this.parent.trigger("resizing",l),l.cancel)return void this.cancelResizeAction(!0);var a=[this.column],h=[this.column];this.column.columns&&(a=this.getSubColumns(this.column,[]),a=this.calulateColumnsWidth(a,!1,n),h=this.calulateColumnsWidth(a,!0,n));for(var d=0,c=h;d<c.length;d++){var p=c[d];this.widthService.setColumnWidth(p,null,"resize")}this.updateHelper()}this.isDblClk=!1}},i.prototype.calulateColumnsWidth=function(e,i,r){for(var n=[],o=0,s=e;o<s.length;o++){for(var l=s[o],a=0,h=0;h<e.length;h++)a+=parseFloat(e[h].width.toString());var d=this.getColData(l,parseFloat(l.width)*r/a),c=this.getWidth(d.width,d.minWidth,d.maxWidth);c!==parseFloat(l.width.toString())&&(i&&(l.width=t.formatUnit(c<1?1:c)),n.push(l))}return n},i.prototype.getSubColumns=function(e,t){for(var i=0,r=e.columns;i<r.length;i++){var n=r[i];!1!==n.visible&&n.allowResizing&&(n.columns?this.getSubColumns(n,t):t.push(n))}return t},i.prototype.resizeEnd=function(e){if(this.helper&&!this.parent.isDestroyed){t.EventHandler.remove(this.parent.element,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove"),t.detach(this.helper);var i={e:e,column:this.column},r=this.parent.getContent().querySelector("."+Di),n=r.querySelector("."+Ei)?r.querySelector("."+Ei):r;n.scrollHeight>n.clientHeight&&(this.parent.scrollModule.setPadding(),n.style.overflowY="scroll"),this.parent.trigger("resizeStop",i),t.closest(this.element,".e-headercell").classList.add("e-resized"),O(this.element,"e-frozenheader")?this.isFrozenColResized=!0:this.isFrozenColResized=!1,this.parent.isFrozenGrid()&&this.parent.notify(oi,{case:"textwrap"}),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify("textWrapRefresh",{case:"textwrap"})),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0}},i.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].pageX:e.pageX},i.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll("th.e-headercell"));t<i.length;t++)for(var r=i[t],n=0,o=e;n<o.length;n++){var s=o[n];if(r.querySelector("[e-mappinguid]")&&r.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===s.uid&&s.visible){s.width=r.getBoundingClientRect().width;break}}return e},i.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var i=t[e];i.width=this.getStackedWidth(i,0)}},i.prototype.getStackedWidth=function(e,t){for(var i=0,r=e.columns;i<r.length;i++){var n=r[i];!1!==n.visible&&(n.columns?this.getStackedWidth(n,t):t+=n.width)}return t},i.prototype.getTargetColumn=function(e){var i=t.closest(e.target,Wn.header),r=(i=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");return this.parent.getColumnByUid(r)},i.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,r=t;i<r.length;i++)r[i].classList[e](Wn.cursor)},i.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},i.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:Wn.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},i.prototype.setHelperHeight=function(){var e=this.parent.isFrozenGrid(),i=e?this.parent.getContent().querySelector("."+Di).offsetHeight:this.parent.getContent().offsetHeight-this.getScrollBarWidth(),r=t.closest(this.element,Wn.header),n=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),o=this.parent.getFrozenRightColumnsCount();e&&(n=O(r,Ii)?[].slice.call(this.parent.getHeaderContent().querySelector("."+Ii).querySelectorAll("tr")):o&&O(r,"e-frozen-right-header")?[].slice.call(this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelectorAll("tr")):[].slice.call(this.parent.getHeaderContent().querySelector(".e-frozen-left-header").querySelectorAll("tr")));for(var s=n.indexOf(r.parentElement);s<n.length&&s>-1;s++)i+=n[s].offsetHeight;var l=this.calcPos(r);O(r,"e-frozen-right-header")?l.left+=this.parent.enableRtl?r.offsetWidth-2:-1:l.left+=this.parent.enableRtl?-1:r.offsetWidth-2,this.helper.style.cssText="height: "+i+"px; top: "+l.top+"px; left:"+Math.floor(l.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},i.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?j():0},i.prototype.removeHelper=function(e){var i=e.target.classList;i.contains(Wn.root)||i.contains(Wn.icon)||!this.helper||(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart),t.detach(this.helper),this.refresh())},i.prototype.updateHelper=function(){var e,i=t.closest(this.element,Wn.header);if((e=O(i,"e-frozen-right-header")?Math.floor(this.calcPos(i).left+(this.parent.enableRtl?i.offsetWidth-2:-1)):Math.floor(this.calcPos(i).left+(this.parent.enableRtl?-1:i.offsetWidth-2)))>this.parentElementWidth&&(e=this.parentElementWidth-2),this.parent.isFrozenGrid()){var r=t.closest(i,"."+Mi).offsetLeft;e<r&&(e=r)}this.helper.style.left=e+"px"},i.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),r=e.ownerDocument,n=O(e,"e-grid")||r.documentElement;n&&(n===r.body||n===r.documentElement)&&"static"===n.style.position;)n=n.parentNode;return n&&n!==e&&1===n.nodeType&&(t=n.getBoundingClientRect()),{top:i.top-t.top,left:i.left-t.left}},i.prototype.doubleTapEvent=function(e){var t=this;this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(function(){t.tapped=null},300))},i.prototype.getUserAgent=function(){var e=t.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},i.prototype.timeoutHandler=function(){this.tapped=null},i}(),Qn=function(){function e(e){this.parent=e,this.parent.isDestroyed||(this.parent.on(Yt,this.headerDrop,this),this.parent.on(Bt,this.enableAfterRender,this),this.parent.on(Ut,this.onActionComplete,this),this.parent.on(Ft,this.drag,this),this.parent.on(xt,this.dragStart,this),this.parent.on(Jt,this.dragStop,this),this.parent.on(Yt,this.headerDrop,this),this.parent.on(Ht,this.createReorderElement,this),this.parent.on(Vt,this.keyPressHandler,this))}return e.prototype.chkDropPosition=function(e,i){var r=this.parent.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid")),n=!r||!r.lockColumn;return(e.parentElement.isEqualNode(i.parentElement)||this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call(t.closest(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(t.closest(i,"thead").children,i.parentElement))&&this.targetParentContainerIndex(e,i)>-1&&n},e.prototype.chkDropAllCols=function(e,t){for(var i,r=this.getHeaderCells();!i&&r.length>0;)i=e!==r.pop()&&this.targetParentContainerIndex(e,t)>-1;return i},e.prototype.findColParent=function(e,t,i){i=i;for(var r=0,n=t.length;r<n;r++){if(e===t[r])return!0;if(t[r].columns){var o=i.length;if(i.push(t[r]),this.findColParent(e,t[r].columns,i))return!0;i.splice(o,i.length-o)}}return!1},e.prototype.getColumnsModel=function(e){var t=[],i=[];if(!this.parent.getFrozenColumns()&&this.parent.isFrozenGrid())return this.parent.getColumns();for(var r=0,n=e.length;r<n;r++)t.push(e[r]),e[r].columns&&(i=i.concat(e[r].columns));return i.length&&(t=t.concat(this.getColumnsModel(i))),t},e.prototype.headerDrop=function(e){var i=this.parent,r=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid"),n=i.getColumnByUid(r);if(!t.closest(e.target,"th")||!t.isNullOrUndefined(n)&&(!n.allowReordering||n.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n});var o=t.closest(e.target,".e-headercell"),s=(o.querySelector(".e-headercelldiv")||o.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");if(!t.isNullOrUndefined(s)){var l=i.getColumnByUid(s);if(t.isNullOrUndefined(l)||!l.allowReordering||l.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:l})}if(o&&this.chkDropPosition(this.element,o)&&this.chkDropAllCols(this.element,o))if(this.parent.enableColumnVirtualization){var a=this.parent.columns,h=this.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),d=null,c=this.parent.columns.filter(function(e){return e.uid===h})[0],p=o.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");a.some(function(e,t){return e.uid===p&&(d=t,e.uid===p)}),t.isNullOrUndefined(d)||this.moveColumns(d,c)}else{var u=this.targetParentContainerIndex(this.element,o),g=this.element.firstElementChild.getAttribute("e-mappinguid");if(this.destElement=o,this.parent.notify("set-reorder-destination-element",{ele:o}),g)this.moveColumns(u,this.parent.getColumnByUid(g));else{var f=this.getHeaderCells(),m=k(this.element,f),a=this.getColumnsModel(this.parent.columns);this.moveColumns(u,a[m])}}},e.prototype.isActionPrevent=function(e){return X(e)},e.prototype.moveColumns=function(e,t,i,r){var n=this.parent;if(this.isActionPrevent(n))return void n.notify(ii,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});var o=!n.getFrozenColumns()&&n.isFrozenGrid(),s=this.getColParent(t,this.parent.columns),l=s?s.columns:o?this.parent.getColumns():this.parent.columns,a=A(t,l);if((this.parent.isFrozenGrid()&&s||this.parent.lockcolPositionCount)&&!i){for(d=0;d<l.length;d++)if(l[d].field===t.field){a=d;break}var h=this.parent.getColumnByUid(this.destElement.firstElementChild.getAttribute("e-mappinguid"));if(h){for(d=0;d<l.length;d++)if(l[d].field===h.field){e=d;break}}else for(var d=0;d<l.length;d++)l[d].headerText===this.destElement.innerText.trim()&&(e=d)}if(n.allowReordering&&a!==e&&-1!==a&&-1!==e){l.splice(e,0,l.splice(a,1)[0]);var c={column:t,destIndex:e,columns:l,parent:s,cancel:!1};n.notify("refresh-frozen-columns",c),c.cancel||(n.getColumns(!0),n.notify(Kt,{fromIndex:e,toIndex:a}),!1!==r&&n.notify(Lt,{type:bt,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid}))}},e.prototype.targetParentContainerIndex=function(e,t){var i=!this.parent.getFrozenColumns()&&this.parent.isFrozenGrid()?this.parent.getColumns():this.parent.columns,r=this.getHeaderCells(),n=this.getColumnsModel(i),o=this.getColParent(n[k(e,r)],i);return i=o?o.columns:i,A(n[k(t,r)],i)},e.prototype.getHeaderCells=function(){var e=this.parent.getFrozenColumns();if(e||this.parent.lockcolPositionCount){var t=void 0,i=void 0,r=[],n=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-columnheader"));if(e)for(var o=[].slice.call(this.parent.getHeaderContent().querySelector("."+Ii).getElementsByClassName("e-columnheader")),s=0;s<n.length;s++){t=[].slice.call(n[s].getElementsByClassName("e-headercell")),i=[].slice.call(o[s].getElementsByClassName("e-headercell"));for(var l=void 0,a=0;a<t.length;a++){for(h=0;h<i.length;h++)if(i[h].innerText===t[a].innerText){l=!0;break}l||(r=r.concat([t[a]]))}for(h=0;h<i.length;h++)r.push(i[h])}else for(s=0;s<n.length;s++){i=[].slice.call(n[s].getElementsByClassName("e-headercell"));for(a=0;a<i.length;a++){for(var l=void 0,h=a+1;h<i.length;h++)if(i[h].innerText===i[a].innerText){l=!0;break}l||(r=r.concat([i[a]]))}}return r}return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},e.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},e.prototype.reorderSingleColumn=function(e,i){var r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:this.parent.getColumnByField(e),n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===i})[0]:this.parent.getColumnByField(i);if(!t.isNullOrUndefined(r)&&(!r.allowReordering||r.lockColumn)||!t.isNullOrUndefined(n)&&(!n.allowReordering||r.lockColumn))return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:r,destColumn:n});var o=n,s=this.getColParent(o,this.parent.columns),l=A(o,s?s.columns:this.parent.columns);l>-1&&this.moveColumns(l,r,!0)},e.prototype.reorderMultipleColumns=function(e,i){var r=this.parent.getColumnIndexByField(i),n=this.parent.getColumnByField(i);if(!(r<0)&&(t.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)){for(o=0;o<e.length;o++){s=this.parent.getColumnByField(e[o]);if(!t.isNullOrUndefined(s)&&(!s.allowReordering||s.lockColumn))return}for(var o=0;o<e.length;o++){var s=this.parent.getColumnByIndex(r),l=this.getColParent(s,this.parent.columns),a=A(s,l?l.columns:this.parent.columns);a>-1&&this.moveColumns(a,this.parent.getColumnByField(e[o]),!0,!0),this.parent.getColumnIndexByField(e[o+1])>=a&&r++}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[i],t)},e.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},e.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),t)},e.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},e.prototype.createReorderElement=function(e){e&&e.args.isXaxis&&this.setDisplay("none");var t=this.parent.element.querySelector("."+Fi);this.upArrow=t.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow",attrs:{style:"display:none"}})),this.downArrow=t.appendChild(this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow",attrs:{style:"display:none"}}))},e.prototype.onActionComplete=function(e){this.parent.trigger(St,t.extend(e,{type:St}));var i=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);i&&this.parent.focusModule.onClick({target:i},!0)},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(t.remove(this.upArrow),t.remove(this.downArrow),this.parent.off(Yt,this.headerDrop),this.parent.off(Bt,this.enableAfterRender),this.parent.off(Ut,this.onActionComplete),this.parent.off(Ft,this.drag),this.parent.off(xt,this.dragStart),this.parent.off(Jt,this.dragStop),this.parent.off(Ht,this.createReorderElement),this.parent.off(Vt,this.keyPressHandler))},e.prototype.keyPressHandler=function(e){var t=this.parent;switch(e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var r=t.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid")),n=t.getVisibleColumns(),o=n.indexOf(r),s="ctrlLeftArrow"===e.action?n[o-1]:n[o+1];s&&s.field&&r.field&&this.reorderColumns(r.field,s.field)}}},e.prototype.drag=function(e){var i=this.parent,r=e.target;if(e.column.allowReordering&&!e.column.lockColumn){var n=t.closest(r,".e-headercell:not(.e-stackedHeaderCell)"),o=i.element.querySelector(".e-cloneproperties"),s=i.isFrozenGrid()?i.getMovableVirtualContent():i.getContent().firstElementChild,l=this.x>N(e.event).x+s.scrollLeft;t.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),t.classList(o,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),n&&!n.isEqualNode(this.element)&&(r=n,this.chkDropPosition(this.element,r)&&this.chkDropAllCols(this.element,r)?(this.updateArrowPosition(r,l),t.classList(r,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&O(e.target,"e-groupdroparea")||t.classList(o,["e-notallowedcur"],["e-defaultcur"])),i.trigger(Ft,{target:r,draggableType:"headercell",column:e.column})}},e.prototype.updateScrollPostion=function(e){var t=this,i=N(e).x,r=this.parent.element.getBoundingClientRect(),n=r.right;if(this.parent.isFrozenGrid())this.updateFrozenScrollPosition(i,r);else{var o=r.left,s=this.parent.getContent().firstElementChild;i>o&&i<o+35?this.timer=window.setInterval(function(){t.setScrollLeft(s,!0)},50):i<n&&i>n-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(s,!1)},50))}},e.prototype.updateFrozenScrollPosition=function(e,t){var i=this,r=this.parent.getContent().querySelector("."+Ei),n=this.parent.element.querySelector("."+Ii).getBoundingClientRect(),o=this.parent.getFrozenLeftCount(),s=this.parent.getFrozenRightColumnsCount()?n.right:t.right,l=o?n.left:t.left;e>l&&e<l+35?this.timer=window.setInterval(function(){i.setScrollLeft(r,!0)},50):e<s&&e>s-35&&(this.timer=window.setInterval(function(){i.setScrollLeft(r,!1)},50))},e.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.updateArrowPosition=function(e,t){var i=e.getBoundingClientRect(),r=this.parent.element.getBoundingClientRect();if(!(t&&i.left<r.left||!t&&i.right>r.right)){if(this.parent.isFrozenGrid()&&e.classList.contains("e-headercell")){var n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount(),s=this.element.querySelector(".e-headercelldiv"),l=s?this.parent.getColumnByUid(s.getAttribute("data-uid")):null,a=this.parent.getColumnByUid(e.firstElementChild.getAttribute("e-mappinguid")),h=Math.round(this.parent.getFrozenVirtualHeader().getBoundingClientRect().right),d=Math.round(this.parent.getMovableVirtualHeader().getBoundingClientRect().right);if(a){if(n&&!o&&this.parent.getNormalizedColumnIndex(a.uid)>=n&&(t&&Math.round(i.left)<h||!t&&d<i.right))return;if(!n&&o&&l&&l.getFreezeTableName()!==a.getFreezeTableName()&&!t&&Math.round(i.right)<h)return}}this.upArrow.style.top=i.top+i.height-r.top+"px",this.downArrow.style.top=i.top-r.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=(t?i.left:i.right)-r.left-4+"px",this.setDisplay("")}},e.prototype.dragStart=function(e){var t=this.parent,i=e.target;if(this.element=i.classList.contains("e-headercell")?i:O(i,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn){var r=t.isFrozenGrid()?t.getMovableVirtualContent():t.getContent().firstElementChild;this.x=N(e.event).x+r.scrollLeft,t.trigger(xt,{target:i,draggableType:"headercell",column:e.column})}},e.prototype.dragStop=function(e){var i=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||i.trigger(Et,{target:e.target,draggableType:"headercell",column:e.column}),t.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"])},e.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},e.prototype.getModuleName=function(){return"reorder"},e}(),Xn=function(){function e(e){var i=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var r=i.parent,n=i.draggable.currentStateTarget,o=i.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone",styles:'height:"auto", z-index:2, width:'+r.element.offsetWidth}),s=i.parent.createElement("table",{styles:"width:"+r.element.offsetWidth}),l=i.parent.createElement(Ui);if(document.getElementsByClassName("e-griddragarea").length||r.rowDropSettings.targetID&&(!n.classList.contains("e-selectionbackground")&&"Single"!==r.selectionSettings.type||!O(n,"e-rowcell"))||!r.rowDropSettings.targetID&&!O(n,"e-rowdragdrop"))return!1;r.rowDropSettings.targetID&&"Row"===r.selectionSettings.mode&&"Single"===r.selectionSettings.type&&r.selectRow(parseInt(i.draggable.currentStateTarget.parentElement.getAttribute(Hi),10)),i.startedRow=t.closest(n,"tr").cloneNode(!0);var a=i.parent.isFrozenGrid();if(a){var h=parseInt(t.closest(n,"tr").getAttribute(Hi),10);i.startedRow.innerHTML="",i.startedRow.innerHTML+=r.getRowByIndex(h).innerHTML,i.startedRow.innerHTML+=r.getMovableRowByIndex(h).innerHTML,r.getFrozenMode()===Pi&&(i.startedRow.innerHTML+=r.getFrozenRightRowByIndex(h).innerHTML)}i.processArgs(n);var d={selectedRow:i.rows,dragelement:n,cloneElement:o,cancel:!1,data:i.rowData},c=r.getSelectedRows();r.trigger(It,d);if(d.cancel)return!1;P(i.startedRow,".e-indentcell"),P(i.startedRow,".e-detailrowcollapse"),P(i.startedRow,".e-detailrowexpand"),i.removeCell(i.startedRow,ki);var p=new RegExp("e-active","g");if(i.startedRow.innerHTML=i.startedRow.innerHTML.replace(p,""),l.appendChild(i.startedRow),r.getSelectedRowIndexes().length>1&&i.startedRow.hasAttribute("aria-selected")){var u=r.getFrozenMode()===Pi?3:2,g=i.parent.createElement("span",{className:"e-dropitemscount",innerHTML:a?""+c.length/u:""+c.length});o.appendChild(g)}var f=t.closest(n,"tr").querySelector(".e-icon-rowdragicon");return f&&f.classList.add("e-dragstartrow"),s.appendChild(l),o.appendChild(s),r.element.appendChild(o),o},this.dragStart=function(e){var t=i.parent;if(!document.getElementsByClassName("e-griddragarea").length){var r=e.target,n=i.parent.element.querySelector(".e-dropitemscount");i.parent.getSelectedRecords().length>1&&n&&(n.style.left=i.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),i.processArgs(r),t.trigger(Tt,{rows:i.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(i.rows[0].getAttribute(Hi),10),data:Object.keys(i.rowData[0]).length>0?i.rowData:i.currentViewData()}),i.dragStartData=i.rowData;var o=document.getElementById(t.rowDropSettings.targetID);t.rowDropSettings.targetID&&o&&o.ej2_instances&&"grid"===o.ej2_instances[0].getModuleName()&&o.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var r=i.parent;if(i.isDropGrid=i.parent,i.istargetGrid=!1,i.parent.rowDropSettings.targetID){var n=document.getElementById(r.rowDropSettings.targetID);i.isDropGrid=n.ej2_instances[0],O(e.target,"e-grid")&&(i.istargetGrid=i.parent.rowDropSettings.targetID===O(e.target,"e-grid").id)}var o=i.parent.element.querySelector(".e-cloneproperties"),s=i.getElementFromPosition(o,e.event);t.classList(o,["e-defaultcur"],["e-notallowedcur","e-movecur"]),i.isOverflowBorder=!0,i.hoverState=r.enableHover;var l=O(s,"e-grid")?t.closest(e.target,"tr"):null;if(r.enableHover=!1,e.target){i.processArgs(s);var a={rows:i.rows,target:s,draggableType:"rows",data:i.rowData,originalEvent:e,cancel:!1};if(r.trigger(zt,a),i.stopTimer(),!a.cancel){if(r.element.classList.add("e-rowdrag"),i.dragTarget=l&&O(s,"e-grid").id===o.parentElement.id?parseInt(l.getAttribute(Hi),10):parseInt(i.startedRow.getAttribute(Hi),10),r.rowDropSettings.targetID)O(s,"e-grid")&&O(o.parentElement,"e-grid").id!==O(s,"e-grid").id?t.classList(o,["e-defaultcur"],["e-notallowedcur"]):t.classList(o,["e-notallowedcur"],["e-defaultcur"]);else{var h=O(s,"e-grid");h&&h.id===o.parentElement.id?t.classList(o,["e-movecur"],["e-defaultcur"]):t.classList(o,["e-notallowedcur"],["e-movecur"])}if(O(i.isDropGrid.element,"e-grid")){if((!i.isDropGrid.groupSettings.columns.length||e.target.classList.contains("e-selectionbackground"))&&!i.isDropGrid.element.querySelector(".e-emptyrow"))if(O(s,"e-grid")&&O(s,"e-grid").id===i.isDropGrid.element.id&&i.updateScrollPostion(e.event),(i.isOverflowBorder||i.parent.frozenRows>i.dragTarget)&&(parseInt(i.startedRow.getAttribute(Hi),10)!==i.dragTarget||i.istargetGrid)||i.istargetGrid&&l&&i.isDropGrid.getRowByIndex(i.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===l.getAttribute("data-uid"))i.moveDragRows(e,i.startedRow,l);else{var d=void 0;if(i.parent.enableVirtualization)d=l&&parseInt(l.getAttribute(Hi),10)===i.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var c=i.parent.getRowByIndex(i.parent.getCurrentViewRecords().length-1).getAttribute("data-uid");d=l&&c===l.getAttribute("data-uid")&&c!==i.startedRow.getAttribute("data-uid")}if(d&&!i.parent.rowDropSettings.targetID){var p=i.parent.createElement("div",{className:"e-lastrow-dragborder"}),u=i.parent.getContent();p.style.width=i.parent.element.offsetWidth-i.getScrollWidth()+"px",i.parent.enableVirtualization&&(p.style.zIndex="1"),u.getElementsByClassName("e-lastrow-dragborder").length||(u.classList.add("e-grid-relative"),u.appendChild(p),p.style.bottom=i.getScrollWidth()+"px")}i.removeBorder(l)}if(s&&s.classList.contains(Di)&&!i.isDropGrid.element.querySelector(".e-emptyrow")&&i.istargetGrid){i.removeBorder(l);var g=i.isDropGrid.getCurrentViewRecords().length-1,f=".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse",m=[];m=[].slice.call(i.isDropGrid.getRowByIndex(g).querySelectorAll(f)),i.isDropGrid.isFrozenGrid()&&(m=i.borderRowElement(g,f)),m.length>0&&Z(m,!0,"e-dragborder")}}}}},this.dragStop=function(e){X(i.parent)?i.parent.notify(ii,{instance:i,handler:i.processDragStop,arg1:e}):i.processDragStop(e)},this.processDragStop=function(e){var r=i.parent;if(!i.parent.isDestroyed){var n=i.getElementFromPosition(e.helper,e.event),o=n&&!n.classList.contains("e-dlg-overlay")?n:e.target;r.element.classList.remove("e-rowdrag");var s=document.getElementById(r.rowDropSettings.targetID);if(r.rowDropSettings.targetID&&s&&s.ej2_instances&&"grid"===s.ej2_instances[0].getModuleName()&&s.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),O(i.isDropGrid.element,"e-grid")){i.stopTimer(),i.isDropGrid.enableHover=i.hoverState,i.isDropGrid.getContent().classList.remove("e-grid-relative"),i.removeBorder(n);var l=i.isDropGrid.element.querySelector(".e-dragstartrow");l&&l.classList.remove("e-dragstartrow")}i.processArgs(o);var a={target:o,draggableType:"rows",cancel:!1,fromIndex:parseInt(i.rows[0].getAttribute(Hi),10),dropIndex:i.dragTarget,rows:i.rows,data:Object.keys(i.dragStartData[0]).length>0?i.dragStartData:i.currentViewData()};r.trigger(Dt,a,function(){if(!(O(o,Oi)||O(o,"e-emptyrow")||O(o,Ri))||a.cancel)return i.dragTarget=null,void t.remove(e.helper);i.isRefresh=!1;var n=i.parent.getSelectedRowIndexes();r.isRowDragable()&&(!i.parent.rowDropSettings.targetID&&i.startedRow.querySelector("td.e-selectionbackground")&&n.length>1&&n.length!==i.parent.getCurrentViewRecords().length?i.reorderRows(n,a.dropIndex):i.reorderRows([parseInt(i.startedRow.getAttribute(Hi),10)],i.dragTarget),i.dragTarget=null,r.rowDropSettings.targetID||(t.remove(e.helper),r.enableVirtualization?r.refresh():i.rowOrder(a))),i.isRefresh=!0})}},this.removeCell=function(e,t){return[].slice.call(e.querySelectorAll("td")).filter(function(i){i.classList.contains(t)&&e.deleteCell(i.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(Ot,this.initializeDrag,this),this.parent.on(Et,this.columnDrop,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(Rt,this.onDataBoundFn),this.parent.on(Bt,this.enableAfterRender,this))}return e.prototype.refreshRow=function(e,t,i,r,n,o,s){var l,a,h,d,c=this.parent,p=c.isFrozenGrid(),u=c.getFrozenMode()===Pi,g=c.getContentTable().querySelector(Ui),f=c.getHeaderTable().querySelector(Ui);p&&(l=c.getMovableHeaderTbody(),a=c.getMovableContentTbody(),u&&(h=c.getFrozenRightHeaderTbody(),d=c.getFrozenRightContentTbody()));for(var m=c.getFrozenMode()===Pi?3:2,y=0,v=e.rows.length;y<v;y++)p?y%m==0?t.insertBefore(e.rows[y],n):y%m==1?i.insertBefore(e.rows[y],o):r.insertBefore(e.rows[y],s):t.insertBefore(e.rows[y],n);var C,w,b=[].slice.call(t.getElementsByClassName(Oi));if(p&&(C=[].slice.call(i.getElementsByClassName(Oi)),u&&(w=[].slice.call(r.getElementsByClassName(Oi)))),this.refreshData(b,C,w),this.parent.frozenRows)for(var S=this,y=0,v=b.length;y<v;y++)!function(e,t){e<S.parent.frozenRows?Ge(f,l,h,b,C,w,function(t,i){t.appendChild(i[e])}):Ge(g,a,d,b,C,w,function(t,i){t.appendChild(i[e])})}(y)},e.prototype.updateFrozenRowreOrder=function(e){var t,i,r,n,o=this.parent,s=this.parent.isFrozenGrid(),l=o.getFrozenMode()===Pi,a=o.getContentTable().querySelector(Ui),h=o.getHeaderTable().querySelector(Ui);s&&(t=o.getMovableHeaderTbody(),i=o.getMovableContentTbody(),l&&(r=o.getFrozenRightHeaderTbody(),n=o.getFrozenRightContentTbody()));var d,c,p=[].slice.call(h.getElementsByClassName(Oi)).concat([].slice.call(a.getElementsByClassName(Oi)));s&&(d=[].slice.call(t.getElementsByClassName(Oi)).concat([].slice.call(i.getElementsByClassName(Oi))),l&&(c=[].slice.call(r.getElementsByClassName(Oi)).concat([].slice.call(n.getElementsByClassName(Oi)))));var u=o.createElement(Ui),g=o.createElement(Ui),f=o.createElement(Ui);this.parent.clearSelection();for(var m=this.refreshRowTarget(e),y=0,v=p.length;y<v;y++)u.appendChild(p[y]),s&&(g.appendChild(d[y]),l&&f.appendChild(c[y]));this.refreshRow(e,u,g,f,m.target,m.mTarget,m.frTarget)},e.prototype.refreshRowTarget=function(e){var t,i,r=this.parent,n=parseInt(e.target.parentElement.getAttribute(Hi),10);(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)&&(n+=1);var o=r.getRowByIndex(n);return r.isFrozenGrid()&&(t=r.getMovableRowByIndex(n),r.getFrozenMode()===Pi&&(i=r.getFrozenRightRowByIndex(n))),{target:o,mTarget:t,frTarget:i}},e.prototype.updateFrozenColumnreOrder=function(e){var t,i,r=this.parent,n=this.parent.isFrozenGrid(),o=r.getContentTable().querySelector(Ui);n&&(t=r.getMovableContentTbody(),r.getFrozenMode()===Pi&&(i=r.getFrozenRightContentTbody())),this.parent.clearSelection();var s=this.refreshRowTarget(e);this.refreshRow(e,o,t,i,s.target,s.mTarget,s.frTarget)},e.prototype.refreshData=function(e,t,i){for(var r={},n={},o={},s={},l=this.parent.getRowsObject(),a=this.parent.getMovableRowsObject(),h=this.parent.getFrozenRightRowsObject(),d=this.parent.getCurrentViewRecords(),c=0,p=e.length;c<p;c++){var u=parseInt(e[c].getAttribute(Hi),10);r[c]=l[u],s[c]=d[u],this.parent.isFrozenGrid()&&(n[c]=a[u],i&&(o[c]=h[u]))}var g,f,m=this.parent.getRows();this.parent.isFrozenGrid()&&(g=this.parent.getMovableRows(),i&&(f=this.parent.getFrozenRightRows()));for(var c=0,p=e.length;c<p;c++)m[c]=e[c],l[c]=r[c],d[c]=s[c],this.parent.isFrozenGrid()&&(g[c]=t[c],a[c]=n[c],i&&(f[c]=i[c],h[c]=o[c]));Me(this.parent,l,e),this.parent.isFrozenGrid()&&(Me(this.parent,a,t),i&&Me(this.parent,h,i))},e.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)){if(this.parent.childGrid){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(Ui).children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var r=0,n=i.length;r<n&&i[r];r++)i[r].isDetailRow&&(this.parent.getRowsObject().splice(r,1),r--)}if(e.target.classList.contains("e-rowcelldrag")&&(e.target=e.target.parentElement),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),this.selectedRowColls.length>0){this.parent.selectRows(this.selectedRowColls);var o=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(var r=0,n=e.rows.length;r<n;r++)o.push(parseInt(e.rows[r].getAttribute(Hi),10));this.selectedRowColls=o}this.selectedRowColls=[]}}},e.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(Hi),10),r=0,n=e.length;r<n;r++){t[r]=this.parent.currentViewData[e[r]]}return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[i]),t},e.prototype.saveChange=function(e,i){var r=this;this.parent.getDataModule().saveChanges(e,this.parent.getPrimaryKeyFieldNames()[0],{},i).then(function(){r.parent.notify(Lt,{type:bt,requestType:"rowdraganddrop"})}).catch(function(e){t.isNullOrUndefined(e.error)||t.isNullOrUndefined(e.error.message)||(e.error=e.error.message),r.parent.trigger("actionFailure",e)})},e.prototype.reorderRows=function(e,t){for(var i=this.parent.getSelectedRowIndexes(),r=[],n=[],o=this.parent.renderModule.data.dataManager.dataSource.json,s=this.parent.allowPaging?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,l=t+s,a=e[0]+s,h=0,d=e.length;h<d;h++)n[h]=o[e[h]+s];for(var h=0,d=i.length;h<d;h++)r[h]=o[i[h]+s];for(var h=0,d=n.length;h<d;h++){if(0!==h){for(var c=0,p=o.length;c<p;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(n[h])){a=c;break}for(var c=0,p=o.length;c<p;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(n[h-1])){a>c&&(l=c+1);break}}this.reorderRow(a-s,l-s)}this.isRefresh&&this.parent.notify(Lt,{type:bt,requestType:"rowdraganddrop"});for(var h=0,d=r.length;h<d;h++)for(var c=0,p=o.length;c<p;c++)if(JSON.stringify(this.parent.renderModule.data.dataManager.dataSource.json[c])===JSON.stringify(r[h])){i[h]=c-s;break}this.selectedRowColls=i},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new t.Draggable(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle})},e.prototype.updateScrollPostion=function(e){var t=this,i=N(e).y,r=this.isDropGrid.getContent().getBoundingClientRect(),n=this.isDropGrid.getRowHeight()-15,o=this.isDropGrid.getContent().firstElementChild,s=this.parent.enableVirtualization?20:0;if(r.top>=i){var l=-this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(o,l)},200)}else if(r.top+this.isDropGrid.getContent().clientHeight-n-33-s<=i){var a=this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(o,a)},200)}},e.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,i,r){var n=this.parent.element.querySelector(".e-cloneproperties"),o=t.closest(e.target,"tr");if(O(o,"e-grid")&&(O(n.parentElement,"e-grid").id===O(o,"e-grid").id||this.istargetGrid)){var s=o||this.startedRow;this.setBorder(s,e.event,i,r)}},e.prototype.setBorder=function(e,i,r,n){var o=this.parent.element;this.istargetGrid&&(o=this.isDropGrid.element);var s=this.parent.element.querySelector(".e-cloneproperties");if(this.removeFirstRowBorder(e),this.removeLastRowBorder(e),O(e,"e-grid")&&!this.parent.rowDropSettings.targetID&&e.classList.contains(Oi)&&O(s.parentElement,"e-grid").id===O(e,"e-grid").id||this.istargetGrid){t.removeClass(o.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]);var l=[],a=parseInt(n.getAttribute(Hi),10);if(n&&0===a){var h=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),d=this.isDropGrid.getHeaderContent();d.classList.add("e-grid-relative"),h.style.width=o.offsetWidth-this.getScrollWidth()+"px",d.getElementsByClassName("e-firstrow-dragborder").length||d.appendChild(h)}else this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(r.getAttribute(Hi),10)>a?(e=this.parent.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));var c=this.parent.isFrozenGrid();if(n&&0!==a&&c){var p=parseInt(e.getAttribute(Hi),10);l=this.borderRowElement(p,".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")}l.length>0&&Z(l,!0,"e-dragborder")}},e.prototype.borderRowElement=function(e,t){var i=[];return i=[].slice.call(this.isDropGrid.getRowByIndex(e).querySelectorAll(t)).concat([].slice.call(this.isDropGrid.getMovableRowByIndex(e).querySelectorAll(t))),this.isDropGrid.getFrozenMode()===Pi&&(i=i.concat([].slice.call(this.isDropGrid.getFrozenRightRowByIndex(e).querySelectorAll(t)))),i},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Xr.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&0!==e.rowIndex&&t.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0])},e.prototype.removeLastRowBorder=function(e){var i;i=this.parent.enableVirtualization?e&&parseInt(e.getAttribute(Hi),10)!==this.parent.renderModule.data.dataManager.dataSource.json.length-1:e&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"),this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&e&&i&&t.remove(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},e.prototype.removeBorder=function(e){if(this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),e=(this.isDropGrid.isFrozenGrid()?this.isDropGrid.getMovableRows():this.isDropGrid.getRows()).filter(function(e){return e.querySelector("td.e-dragborder")})[0]){var t=[].slice.call(e.getElementsByClassName("e-dragborder"));if(this.parent.isFrozenGrid()){var i=parseInt(e.getAttribute(Hi),10);t=this.borderRowElement(i,".e-dragborder")}Z(t,!1,"e-dragborder")}},e.prototype.getElementFromPosition=function(e,t){var i=N(t);e.style.display="none";var r=document.elementFromPoint(i.x,i.y);return e.style.display="",r},e.prototype.onDataBound=function(){this.selectedRowColls.length>0&&this.parent.enableVirtualization&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(Hi),10):0},e.prototype.singleRowDrop=function(e){var i=t.closest(e.target,"tr"),r=e.droppedElement.parentElement.ej2_instances[0],n=i?i.rowIndex:r.currentViewData.length-1;this.reorderRow(this.startedRowIndex,n)},e.prototype.columnDrop=function(e){var i=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(O(e.target,Oi)||O(e.target,"e-emptyrow")||O(e.target,Ri))){var r=t.closest(e.target,"tr"),n=void 0,o=void 0;if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id===i.element.id||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==i.element.id)return;if(e.droppedElement.parentElement.id!==i.element.id)n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id!==i.element.id&&n.rowDropSettings.targetID!==i.element.id)return;var s=n.getSelectedRecords(),l=o=this.getTargetIdx(r);isNaN(l)&&(l=o=0),i.allowPaging&&(l=l+i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize),i.notify(Qt,{toIndex:l,records:s}),i.notify(Lt,{type:bt,requestType:"rowdraganddrop"});var a=n.getSelectedRowIndexes(),h=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var d=0,c=s.length;d<c;d++)this.selectedRows.push(h+a[d]);n.notify(Xt,{indexes:this.selectedRows,records:s}),n.notify(Lt,{type:bt,requestType:"rowdraganddrop"})}},e.prototype.reorderRow=function(e,t){var i=this.parent;if(!i.sortSettings.columns.length&&!i.groupSettings.columns.length&&!i.filterSettings.columns.length){var r=i.allowPaging?i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize:0;t+=r,this.selectedRows=i.getSelectedRowIndexes(),i.notify(ai,{fromIndex:e+r,toIndex:t})}},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.draggable.destroy(),this.parent.off(Ot,this.initializeDrag),this.parent.off(Et,this.columnDrop),this.parent.removeEventListener(Rt,this.onDataBoundFn),this.parent.off(Bt,this.enableAfterRender))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(Hi),10);t.getSelectedRecords().length>0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(this.parent.enableVirtualization?this.rows=[this.startedRow]:(this.rows=[this.parent.getRowByIndex(i)],t.isFrozenGrid()&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i)],t.getFrozenMode()===Pi&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i),t.getFrozenRightRowByIndex(i)]))),this.rowData=[this.parent.getRowInfo(this.startedRow.querySelector("."+bi)).rowData]):(this.rows=t.getSelectedRows(),this.rowData=t.getSelectedRecords())},e}(),Jn=function(){function e(e,i,r,n){var o=this;this.sortRequired=!0,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.reorderingColumns=[],this.visualElement=t.createElement("div",{className:"e-cloneproperties e-dragclone e-gdclone",styles:"line-height:23px",attrs:{action:"grouping"}}),this.helper=function(e){var t=o.parent,i=e.sender.target,r=i.classList.contains("e-groupheadercell")?i:O(i,"e-groupheadercell");return!(!r||!i.classList.contains("e-drag")&&o.groupSettings.allowReordering)&&(o.column=t.getColumnByField(r.firstElementChild.getAttribute("ej-mappingname")),o.visualElement.textContent=r.textContent,o.visualElement.style.width=r.offsetWidth+2+"px",o.visualElement.style.height=r.offsetHeight+2+"px",o.visualElement.setAttribute("e-mappinguid",o.column.uid),t.element.appendChild(o.visualElement),o.visualElement)},this.dragStart=function(e){o.parent.element.classList.add("e-ungroupdrag")},this.drag=function(e){o.groupSettings.allowReordering&&o.animateDropper(e);var i=e.target,r=o.parent.element.querySelector(".e-cloneproperties");o.parent.trigger(Ft,{target:i,draggableType:"headercell",column:o.column}),o.groupSettings.allowReordering||(t.classList(r,["e-defaultcur"],["e-notallowedcur"]),O(i,Ri)||O(i,"e-headercell")||t.classList(r,["e-notallowedcur"],["e-defaultcur"]))},this.dragStop=function(e){o.parent.element.classList.remove("e-ungroupdrag");var i=!(O(e.target,Ri)||O(e.target,"e-gridheader"));if(o.groupSettings.allowReordering&&i){if(t.remove(e.helper),O(e.target,"e-groupdroparea"))o.rearrangeGroup();else if(!O(e.target,"e-grid")){var r=o.parent.getColumnByUid(e.helper.getAttribute("e-mappinguid")).field;-1!==o.groupSettings.columns.indexOf(r)&&o.ungroupColumn(r)}}else if(i)return void t.remove(e.helper)},this.animateDropper=function(e){var t=o.parent.element.querySelector(".e-cloneproperties").getAttribute("e-mappinguid"),i=o.parent.getColumnByUid(t).field,r=O(e.target,"e-groupdroparea"),n=O(e.target,"e-group-animator"),s=[].slice.call(o.element.getElementsByClassName("e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("ej-mappingname")}),l=JSON.parse(JSON.stringify(s));if(n||r){if(n){var a=n.querySelector("div[ej-mappingname]").getAttribute("ej-mappingname"),h=+n.getAttribute("index");if(a!==i){var d=l.indexOf(i);-1!==d&&l.splice(d,1);var c=-1!==h&&d===h;l.splice(h+(c?1:0),0,i)}}else r&&-1===l.indexOf(i)&&l.push(i);o.element.innerHTML="",l.length&&!o.element.classList.contains("e-grouped")&&o.element.classList.add("e-grouped"),o.reorderingColumns=l;for(var p=0;p<l.length;p++)o.addColToGroupDrop(l[p])}else o.addLabel(),o.removeColFromGroupDrop(i)},this.drop=function(e){var i=o.parent,r=i.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(o.element.classList.remove("e-hover"),t.remove(e.droppedElement),o.aria.setDropTarget(o.parent.element.querySelector(".e-groupdroparea"),!1),o.aria.setGrabbed(o.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),t.isNullOrUndefined(r)||!1===r.allowGrouping||O(i.getColumnHeaderByUid(r.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return void o.parent.log("action_disabled_column",{moduleName:o.getModuleName(),columnName:r.headerText});o.groupColumn(r.field)},this.contentRefresh=!0,this.aria=new er,this.parent=e,this.groupSettings=i,this.serviceLocator=n,this.sortedColumns=r,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new Ji(this.parent)}return e.prototype.addLabel=function(){if(!this.element.getElementsByClassName("e-group-animator").length){var e=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=e,this.element.classList.remove("e-grouped")}},e.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},e.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var i=this.parent.element.querySelector(".e-cloneproperties");t.classList(i,["e-defaultcur"],["e-notallowedcur"]),O(e.target,"e-groupdroparea")||this.parent.allowReordering&&O(e.target,"e-headercell")||t.classList(i,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},e.prototype.columnDragStart=function(e){if(!e.target.classList.contains("e-stackedheadercell")){var t=this.parent.element.querySelector(".e-groupdroparea");this.aria.setDropTarget(t,e.column.allowGrouping);var i=e.target.classList.contains("e-headercell")?e.target:O(e.target,"e-headercell");this.aria.setGrabbed(i,!0,!e.column.allowGrouping)}},e.prototype.columnDrop=function(e){var i=this.parent;if("grouping"===e.droppedElement.getAttribute("action")){var r=i.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));if(t.isNullOrUndefined(r)||!1===r.allowGrouping||O(i.getColumnHeaderByUid(r.uid),"e-grid").getAttribute("id")!==i.element.getAttribute("id"))return;this.ungroupColumn(r.field)}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Bt,this.enableAfterRender,this),this.parent.on("grouping-complete",this.onActionComplete,this),this.parent.on("ungrouping-complete",this.onActionComplete,this),this.parent.on(Nt,this.onPropertyChanged,this),this.parent.on(Gt,this.clickHandler,this),this.parent.on(Ft,this.columnDrag,this),this.parent.on(xt,this.columnDragStart,this),this.parent.on(Yt,this.columnDrop,this),this.parent.on(Et,this.columnDrop,this),this.parent.on(Ht,this.refreshSortIcons,this),this.parent.on("sorting-complete",this.refreshSortIcons,this),this.parent.on(Vt,this.keyPressHandler,this),this.parent.on(At,this.initialEnd,this),this.parent.on(Pt,this.initialEnd,this),this.parent.on(Ot,this.render,this),this.parent.on("group-aggregates",this.onGroupAggregates,this),this.parent.on("blazor-action-begin",this.blazorActionBegin,this),this.parent.on("group-expand-collapse",this.updateExpand,this),this.parent.on("persist-data-changed",this.initialEnd,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ot,this.render),this.parent.off(Bt,this.enableAfterRender),this.parent.off("grouping-complete",this.onActionComplete),this.parent.off("ungrouping-complete",this.onActionComplete),this.parent.off(Nt,this.onPropertyChanged),this.parent.off(Gt,this.clickHandler),this.parent.off(Ft,this.columnDrag),this.parent.off(xt,this.columnDragStart),this.parent.off(Et,this.columnDrop),this.parent.off(Yt,this.columnDrop),this.parent.off(Ht,this.refreshSortIcons),this.parent.off("sorting-complete",this.refreshSortIcons),this.parent.off(Vt,this.keyPressHandler),this.parent.off("group-aggregates",this.onGroupAggregates),this.parent.off("blazor-action-begin",this.blazorActionBegin),this.parent.off("group-expand-collapse",this.updateExpand))},e.prototype.blazorActionBegin=function(){this.parent.allowGrouping&&!this.parent.isCollapseStateEnabled()&&this.expandAll()},e.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(At,this.initialEnd),this.parent.off(Pt,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,i=e.groupSettings.columns;t<i.length;t++){var r=i[t];this.groupColumn(r)}this.contentRefresh=!0}},e.prototype.keyPressHandler=function(e){var i=this.parent;if("ctrlSpace"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))switch(e.preventDefault(),e.action){case"altDownArrow":case"altUpArrow":var r=i.allowSelection?i.getSelectedRowIndexes():[];if(r.length){for(var n=i.getContentTable().querySelector(Ui).children,o=void 0,s=i.getDataRows()[r[r.length-1]].rowIndex;s>=0;s--)if(!n[s].classList.contains(Oi)&&!n[s].classList.contains("e-detailrow")){o=n[s];break}this.expandCollapseRows(o.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"enter":if(this.parent.isEdit||null!==t.closest(e.target,"#"+this.parent.element.id+"_searchbar"))return;var l=this.focus.getFocusedElement(),a=l?l.parentElement.querySelector('[class^="e-record"]'):null;if(!a)break;this.expandCollapseRows(a);break;case"ctrlSpace":var h=i.focusModule.currentInfo.element;if(h&&h.classList.contains("e-headercell")){var d=i.getColumnByUid(h.firstElementChild.getAttribute("e-mappinguid"));d.field&&i.groupSettings.columns.indexOf(d.field)<0?this.groupColumn(d.field):this.ungroupColumn(d.field)}}},e.prototype.clickHandler=function(e){this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname"))},e.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname")))},e.prototype.applySortFromTarget=function(e){var i=this.parent,r=t.closest(e,".e-groupheadercell");if(i.allowSorting&&r&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var n=r.firstElementChild.getAttribute("ej-mappingname");i.getColumnHeaderByField(n).getElementsByClassName("e-ascending").length?i.sortColumn(n,"Descending",!0):i.sortColumn(n,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var i=O(e,"e-recordplusexpand")||O(e,"e-recordpluscollapse");if(i){var r=i.cellIndex,n=i.parentElement.rowIndex,o=this.parent.getContentTable().querySelector(Ui).children,s=[].slice.call(o).slice(n+1,o.length),l=void 0,a=void 0,h=[],d=this.parent,c=i.parentElement.getElementsByClassName("e-indentcell").length,p=!1;if(i.classList.contains("e-recordpluscollapse")?(t.addClass([i],"e-recordplusexpand"),t.removeClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",p=!0,ce(d)&&this.updateVirtualRows(d,e,p,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionExpand(i.parentElement)):(l=!0,t.removeClass([i],"e-recordplusexpand"),t.addClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",ce(d)&&this.updateVirtualRows(d,e,!l,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionCollapse(i.parentElement)),this.aria.setExpand(i,p),!ce(d)&&!this.parent.groupSettings.enableLazyLoading){for(var u=0,g=s.length;u<g&&(s[u].querySelectorAll("td")[r]&&s[u].querySelectorAll("td")[r].classList.contains("e-indentcell")&&s);u++)l?s[u].style.display="none":s[u].getElementsByClassName("e-indentcell").length===c+1&&(s[u].style.display="",(a=s[u].querySelector(".e-recordplusexpand"))&&h.push(a),s[u].classList.contains("e-detailrow")&&s[u-1].getElementsByClassName("e-detailrowcollapse").length&&(s[u].style.display="none"));this.updateVisibleexpandCollapseRows(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})}for(var u=0,g=h.length;u<g;u++)t.removeClass([h[u]],"e-recordplusexpand"),t.addClass([h[u]],"e-recordpluscollapse"),h[u].firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",this.expandCollapseRows(h[u])}},e.prototype.updateVisibleexpandCollapseRows=function(){for(var e=this.parent.getRowsObject(),t=0,i=e.length;t<i;t++)e[t].isDataRow&&"none"===this.parent.getRowElementByUID(e[t].uid).style.display&&(e[t].visible=!1)},e.prototype.updateVirtualRows=function(e,t,i,r,n){var o=e.getRowObjectFromUID(t.closest("tr").getAttribute("data-uid"));o.isExpand=i,C(e),this.parent.notify("refresh-virtual-max-page",{}),(r=e.getDataModule().generateQuery(!1)).queries=e.getDataModule().aggregateQuery(e.getQuery().clone()).queries;var s={requestType:"virtualscroll",rowObject:o};e.getDataModule().getData(s,r.requiresCount()).then(function(t){return e.renderModule.dataManagerSuccess(t,s)})},e.prototype.expandCollapse=function(e){e||this.parent.notify("initial-collapse",e);for(var t,i=this.parent.getContentTable().querySelector(Ui).children,r=0,n=i.length;r<n;r++)i[r].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length?((t=i[r].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(t.className=e?"e-recordplusexpand":"e-recordpluscollapse",t.firstElementChild.className=e?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow"),i[r].firstElementChild.classList.contains("e-recordplusexpand")||i[r].firstElementChild.classList.contains("e-recordpluscollapse")||(i[r].style.display=e?"":"none")):i[r].style.display=e?"":"none";this.updateVisibleexpandCollapseRows(),this.parent.notify("refresh-Expand-and-Collapse",{rows:this.parent.getRowsObject()})},e.prototype.expandAll=function(){this.expandCollapse(!0)},e.prototype.collapseAll=function(){this.expandCollapse(!1)},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn()},e.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&t.remove(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.groupSettings.allowReordering&&this.element.classList.add("e-group-animate"),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea||(this.element.style.display="none")},e.prototype.updateGroupDropArea=function(e){if(this.groupSettings.showDropArea&&!this.groupSettings.columns.length){var t=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=t,this.element.classList.remove("e-grouped")}else(this.element.innerHTML===this.l10n.getConstant("GroupDropArea")&&(1===this.groupSettings.columns.length||!this.isAppliedGroup&&!this.isAppliedUnGroup)||e)&&(this.element.innerHTML=""),this.element.classList.add("e-grouped")},e.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},e.prototype.initializeGHeaderDrag=function(){new t.Draggable(this.element,{dragTarget:this.groupSettings.allowReordering?".e-drag":".e-groupheadercell",distance:this.groupSettings.allowReordering?-10:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},e.prototype.initializeGHeaderDrop=function(){new t.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.groupColumn=function(e){var i=this.parent,r=i.getColumnByField(e);return t.isNullOrUndefined(r)||!1===r.allowGrouping||this.contentRefresh&&this.groupSettings.columns.indexOf(e)>-1?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:r.headerText}):X(i)?void i.notify(ii,{instance:this,handler:this.groupColumn,arg1:e}):(r.visible=i.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),void(this.isAppliedGroup=!1))},e.prototype.ungroupColumn=function(e){var i=this.parent,r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:i.getColumnByField(e);if(!(t.isNullOrUndefined(r)||!1===r.allowGrouping||this.groupSettings.columns.indexOf(e)<0)){if(X(i))return void i.notify(ii,{instance:this,handler:this.ungroupColumn,arg1:e});r.visible=!0,this.colName=r.field;var n=JSON.parse(JSON.stringify(this.groupSettings.columns));if(n.splice(n.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var o=0,s=i.sortSettings.columns.length;o<s;o++)if(e===i.sortSettings.columns[o].field){i.sortSettings.columns.splice(o,1);break}this.groupSettings.allowReordering&&(this.reorderingColumns=n),this.groupSettings.columns=n,i.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},e.prototype.updateModel=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));e=this.reorderingColumns.length?JSON.parse(JSON.stringify(this.reorderingColumns)):e,this.sortRequired&&(-1===e.indexOf(this.colName)&&e.push(this.colName),this.groupAddSortingQuery(this.colName)),this.sortRequired=!0,this.parent.groupSettings.columns=e,this.parent.dataBind()},e.prototype.onActionComplete=function(e){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName);var i=this.groupSettings.columns.indexOf(this.colName)>-1?{columnName:this.colName,requestType:"grouping",type:St}:{requestType:"ungrouping",type:St};this.parent.trigger(St,t.extend(e,i)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[t].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[t].direction="Ascending")},e.prototype.createElement=function(e){var t=this.parent,i="Ascending",r=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),n=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),o=this.parent.createElement("div",{attrs:{"ej-mappingname":e}});_(e)&&o.setAttribute("ej-complexname",W(e));var s=this.parent.getColumnByField(e),l=t.getColumnHeaderByUid(s.uid);return this.groupSettings.allowReordering&&o.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:" ",attrs:{title:"Drag",tabindex:"-1","aria-label":"Drag the grouped column"}})),o.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:s.headerText,attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),this.groupSettings.showToggleButton&&o.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:" ",attrs:{tabindex:"-1","aria-label":"ungroup button"}})),l.querySelectorAll(".e-ascending,.e-descending").length&&(i=l.querySelector(".e-ascending")?"Ascending":"Descending"),o.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+i.toLowerCase()+" e-icon-"+i.toLowerCase(),innerHTML:" ",attrs:{tabindex:"-1","aria-label":"sort the grouped column"}})),o.appendChild(this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:" ",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":"ungroup the grouped column"},styles:this.groupSettings.showUngroupButton?"":"display:none"})),n.appendChild(o),this.groupSettings.allowReordering&&(r.appendChild(n),r.appendChild(this.createSeparator()),n=r),n},e.prototype.addColToGroupDrop=function(e){var i=_(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+W(e)+"]"):this.parent.element.querySelector(".e-groupdroparea div[ej-mappingname="+e+"]");if(!this.groupSettings.allowReordering||!i){var r=this.parent.getColumnByField(e);if(!t.isNullOrUndefined(r)){var n=this.createElement(e);if(this.groupSettings.allowReordering){var o=this.element.getElementsByClassName("e-group-animator").length;n.setAttribute("index",o.toString())}this.element.appendChild(n)}}},e.prototype.createSeparator=function(){return this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:" ",attrs:{tabindex:"-1","aria-label":"Separator for the grouped columns"},styles:this.groupSettings.showUngroupButton?"":"display:none"})},e.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var i=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),r=0,n=i.length;r<n;r++)if(!i[r].classList.contains("e-emptycell")&&!i[r].classList.contains("e-headerchkcelldiv")){var o=this.parent.getColumnByUid(i[r].getAttribute("e-mappinguid"));(!this.parent.showColumnMenu||this.parent.showColumnMenu&&!o.showColumnMenu)&&(i[r].getElementsByClassName("e-grptogglebtn").length&&t.remove(i[r].querySelectorAll(".e-grptogglebtn")[0]),e||i[r].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(this.groupSettings.columns.indexOf(o.field)>-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":"Group button"}})))}},e.prototype.removeColFromGroupDrop=function(e){if(!t.isNullOrUndefined(this.getGHeaderCell(e))){var i=this.getGHeaderCell(e);if(this.groupSettings.allowReordering){var r=O(i,"e-group-animator");t.remove(r)}else t.remove(i);this.updateGroupDropArea()}this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var r=i[t];switch(r){case"columns":var n=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)n={columnName:this.colName,requestType:"ungrouping",type:bt};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var o=0;o<this.parent.sortSettings.columns.length;o++)this.parent.sortSettings.columns[o].isFromGroup&&(this.parent.sortSettings.columns.splice(o,1),o--);for(l=0;l<this.groupSettings.columns.length;l++)this.colName=this.groupSettings.columns[l],this.parent.getColumnByField(this.colName).visible=this.parent.groupSettings.showGroupedColumn,this.groupAddSortingQuery(this.colName),l<this.groupSettings.columns.length-1&&this.addColToGroupDrop(this.groupSettings.columns[l])}n={columnName:this.colName,requestType:e.properties[r].length?"grouping":"ungrouping",type:bt}}if(!this.groupSettings.showGroupedColumn)for(var s=e.oldProperties[r],l=0;l<s.length;l++)-1===e.properties[r].indexOf(s[l])&&(this.parent.getColumnByField(s[l]).visible=!0);this.parent.notify(Lt,n)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?this.element.style.display="":this.element.style.display="none";break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(Lt,{requestType:"refresh"});break;case"showUngroupButton":this.updateButtonVisibility(this.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":this.updateButtonVisibility(this.groupSettings.showToggleButton,"e-togglegroupbutton "),this.parent.refreshHeader();break;case"enableLazyLoading":this.parent.freezeRefresh()}}},e.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[t]).visible=e},e.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.getElementsByClassName(t)),r=0;r<i.length;r++)i[r].style.display=e?"":"none"},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.parent.isDestroyed||this.parent.refreshing||this.clearGrouping(),this.removeEventListener(),this.refreshToggleBtn(!0),t.remove(this.element))},e.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,i=e.length;t<i;t++)t===i-1&&(this.contentRefresh=!0),this.ungroupColumn(e[t]);this.contentRefresh=!0},e.prototype.getModuleName=function(){return"group"},e.prototype.refreshSortIcons=function(){var e,i=this.parent,r=i.sortSettings.columns,n=i.groupSettings.columns,o=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var s=0,l=r.length;s<l;s++)-1!==o.indexOf(r[s].field)&&(e=i.getColumnHeaderByField(r[s].field),!i.allowSorting&&(this.sortedColumns.indexOf(r[s].field)>-1||this.groupSettings.columns.indexOf(r[s].field)>-1)?(t.classList(e.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),r.length>1&&e.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}))):this.getGHeaderCell(r[s].field)&&this.getGHeaderCell(r[s].field).getElementsByClassName("e-groupsort").length&&("Ascending"===r[s].direction?t.classList(this.getGHeaderCell(r[s].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):t.classList(this.getGHeaderCell(r[s].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])));for(var s=0,l=n.length;s<l;s++)-1!==o.indexOf(n[s])&&i.getColumnHeaderByField(n[s]).setAttribute("aria-grouped","true")},e.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[ej-mappingname="'+e+'"]')?this.element.querySelector('[ej-mappingname="'+e+'"]').parentElement:null},e.prototype.onGroupAggregates=function(e){var t=this.iterateGroupAggregates(e),i=this.groupGenerator.generateRows(t,{}),r=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),n=i.filter(function(e){return!e.isDataRow});this.parent.isReact&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var o=0;o<n.length;o++){var s=n[o],l={cells:s.cells.filter(function(e){return e.isDataCell}),data:s.data,dataUid:r[o]?r[o].uid:""};this.parent.notify("refresh-aggregate-cell",l)}},e.prototype.iterateGroupAggregates=function(e){var t=e instanceof Array?e:[],r=this.parent.getRowsObject(),n=this.parent.getCurrentViewRecords(),o=[],s=r.map(function(e){return"delete"===e.edit&&o.push(e.data),e.changes instanceof Object?e.changes:e.data}),l=this.parent.getPrimaryKeyFieldNames()[0];s=0===t.length?s:t;var a=n.map(function(e){var t,r=i.DataUtil.getObject(l,e);return s.some(function(e){return t=e,r===i.DataUtil.getObject(l,e)})?t:e}),h=e;if((!h.type||"cancel"!==h.type)&&o.length>0)for(var d=0;d<o.length;d++){var c=a.indexOf(o[d]);a.splice(c,1)}for(var p=[],u=this.parent.aggregates,g=0;g<u.length;g++)for(var f=u[g],m=0;m<f.columns.length;m++){var y={};y={type:f.columns[m].type.toString().toLowerCase(),field:f.columns[m].field},p.push(y)}for(var v,C,w=this.parent.groupSettings.columns,b=0;b<w.length;b++)C=v||a,v=i.DataUtil.group(C,w[b],p,null,null);return v},e.prototype.updateExpand=function(e){for(var i=e.uid,r=e.isExpand,n=this.parent.getRowsObject(),o=0;o<n.length;o++){var s=n[o];if(s.uid===i||t.isNullOrUndefined(i)){s.isExpand=r;for(var l=o+1;l<n.length&&"break"!==function(e){var r=n[e],o=void 0;if(r.parentUid!==s.uid&&(o=n.filter(function(e){return e.uid===r.parentUid})[0]),r.parentUid===s.uid?r.visible=s.isExpand:t.isNullOrUndefined(o)||r.parentUid!==o.uid||(o.isExpand&&!0===o.visible?r.visible=!0:o.isExpand&&!1===o.visible&&(r.visible=!1)),t.isNullOrUndefined(i))return"break"}(l);l++);}}this.parent.notify(At,{rows:n,args:{isFrozen:!1,rows:n}})},e}(),Yn=function(){function i(e,t){this.aria=new er,this.parent=e,this.parent.isDestroyed||(this.focus=t.getService("focus"),this.parent.on(Gt,this.clickHandler,this),this.parent.on(_t,this.destroy,this),this.parent.on(Vt,this.keyPressHandler,this),this.parent.on(li,this.expand,this),this.parent.on(Wt,this.refreshColSpan,this))}return i.prototype.clickHandler=function(e){this.toogleExpandcollapse(t.closest(e.target,"td"))},i.prototype.toogleExpandcollapse=function(i){var r,n=this.parent,o=this.parent.getContentTable(),s=this.parent.getCurrentViewRecords().length-1,l=i&&i.classList.contains("e-detailrowcollapse");if(i&&(i.classList.contains("e-detailrowcollapse")||i.classList.contains("e-detailrowexpand"))){var a=i.parentElement,h=a.getAttribute("data-uid"),d=n.getRowObjectFromUID(h),c=this.parent.getContentTable().querySelector(Ui).children[a.rowIndex+1];if(i.classList.contains("e-detailrowcollapse")){var p=d.data;if(this.isDetailRow(c))c.style.display="",n.notify("detail-state-change",{data:p,childGrid:n.childGrid,detailElement:i,isExpanded:l});else if(n.getDetailTemplate()||n.childGrid){var u=L("grid-row"),g=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":u}}),f=this.parent.createElement("td",{className:"e-detailcell"}),m=this.parent.getVisibleColumns().length;this.parent.allowRowDragAndDrop&&m++,f.setAttribute("colspan",m.toString());for(var y=new vi({isDataRow:!0,isExpand:!0,uid:u,isDetailRow:!0,cells:[new Ci({cellType:e.CellType.Indent}),new Ci({isDataCell:!0,visible:!0})]}),v=0,C=n.groupSettings.columns.length;v<C;v++)g.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),y.cells.unshift(new Ci({cellType:e.CellType.Indent}));if(g.appendChild(this.parent.createElement("td",{className:"e-detailindentcell"})),g.appendChild(f),a.parentNode.insertBefore(g,a.nextSibling),n.detailTemplate){var w=this.parent.isReact&&"string"!=typeof n.detailTemplate,b=n.element.id+"detailTemplate";w?(n.getDetailTemplate()(p,n,"detailTemplate",b,null,null,f),this.parent.renderTemplates()):q(f,n.getDetailTemplate()(p,n,"detailTemplate",b))}else{(r=new mn(this.getGridModel(n,d,n.printMode))).query&&(r.query=r.query.clone()),r.parentDetails={parentID:n.element.id,parentPrimaryKeys:n.getPrimaryKeyFieldNames(),parentKeyField:n.childGrid.queryString,parentKeyFieldValue:p[n.childGrid.queryString],parentRowData:p},r.isLegacyTemplate=n.isReact||n.isLegacyTemplate,n.isPrinting&&(r.isPrinting=!0,r.on(At,this.promiseResolve(r),this),r.on(Pt,this.promiseResolve(r),this)),d.childGrid=r;var S=r.getInjectedModules(),R=n.getInjectedModules();S&&S.length===R.length||r.setInjectedModules(R);var x=this.parent.createElement("div",{id:"child"+H(a,"e-grid").length+"_grid"+a.rowIndex+L("")});f.appendChild(x),r.appendTo(x)}g.appendChild(f),a.nextSibling?a.parentNode.insertBefore(g,a.nextSibling):a.parentNode.appendChild(g),n.getRows().splice(a.rowIndex+1,0,g),n.getRowsObject().splice(d.index+1,0,y),n.trigger("detailDataBound",{detailElement:f,data:p,childGrid:r}),n.notify("detailDataBound",{rows:n.getRowsObject()})}if(t.classList(i,["e-detailrowexpand"],["e-detailrowcollapse"]),t.classList(i.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),d.isExpand=!0,i.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>o.scrollHeight){t.removeClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell");var F=o.querySelector(Ui).getElementsByClassName("e-detailrow").length-1;t.addClass(o.querySelector(Ui).getElementsByClassName("e-detailrow")[F].childNodes,["e-lastrowcell"]),this.lastrowcell=!0}this.aria.setExpand(i,!0)}else this.isDetailRow(c)&&(c.style.display="none",n.notify("detail-state-change",{data:d.data,childGrid:n.childGrid,detailElement:i,isExpanded:l})),t.classList(i,["e-detailrowcollapse"],["e-detailrowexpand"]),t.classList(i.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(a.getAttribute(Hi),10)===s&&this.lastrowcell&&(t.addClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),d.isExpand=!1,this.aria.setExpand(i,!1)}},i.prototype.getGridModel=function(e,i,r){var n;return e.isPrinting&&i.isExpand&&e.expandedRows&&e.expandedRows[i.index]&&e.expandedRows[i.index].gridModel?(e.expandedRows[i.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,n=e.expandedRows[i.index].gridModel):(e.isPrinting&&e.childGrid.allowPaging&&(e.childGrid.allowPaging="CurrentPage"===r),n=t.extend({},{},e.childGrid,!0)),n},i.prototype.promiseResolve=function(e){var t=this;return function(){e.off(At,t.promiseResolve),e.off(Pt,t.promiseResolve),e.notify(si,{})}},i.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},i.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.parent.off(Gt,this.clickHandler),this.parent.off(_t,this.destroy),this.parent.off(Vt,this.keyPressHandler),this.parent.off(li,this.expand),this.parent.off(Wt,this.refreshColSpan))},i.prototype.getTDfromIndex=function(e,t){var i=this.parent.getDataRows()[e];return i&&i.querySelector(t)?i.querySelector(t):null},i.prototype.expand=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowcollapse")),e&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},i.prototype.collapse=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowexpand")),e&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},i.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(St,{requestType:"expandAllComplete",type:St,moduleObj:this})},i.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(St,{requestType:"collapseAllComplete",type:St,moduleObj:this})},i.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),r=0,n=i.length;r<n;r++)t=i[r].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},i.prototype.keyPressHandler=function(e){var t=this.parent;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var i=t.allowSelection?t.getSelectedRowIndexes():[];if(i.length){var r=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand");"altDownArrow"===e.action?this.expand(r):this.collapse(r)}break;case"enter":if(this.parent.isEdit)return;var n=this.focus.getFocusedElement();if(!e.target.classList.contains("e-detailrowcollapse")&&!e.target.classList.contains("e-detailrowexpand"))break;this.toogleExpandcollapse(n)}},i.prototype.refreshColSpan=function(){for(var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length,i=0;i<e.length;i++)e[i].querySelector(".e-detailcell").setAttribute("colspan",t+"")},i.prototype.getModuleName=function(){return"detailRow"},i}(),Zn=function(){function i(e,t){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return i.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization");for(var e=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"],t=this.parent.enableAdaptiveUI,i=["Edit","Delete","Update","Cancel"],r=0,n=e;r<n.length;r++){var o=n[r],s=o.toLowerCase(),l=s[0].toUpperCase()+s.slice(1);this.predefinedItems[o]={id:this.gridID+"_"+s,prefixIcon:"e-"+s,text:this.l10n.getConstant(l),tooltipText:this.l10n.getConstant(l)},t&&(this.predefinedItems[o].text="",this.predefinedItems[o].visible=-1===i.indexOf(o))}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:t?"":this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&(this.predefinedItems.responsiveFilter={id:this.gridID+"_responsivefilter",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resfilter-icon",tooltipText:this.l10n.getConstant("FilterButton")}),this.parent.allowSorting&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("Sort")})),this.parent.enableAdaptiveUI&&this.parent.toolbar.indexOf("Search")>-1&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon",visible:!1}),this.createToolbar()},i.prototype.getToolbar=function(){return this.toolbar.element},i.prototype.destroy=function(){this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.element?(this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy()):(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.unWireEvent(),this.removeEventListener(),t.remove(this.element))},i.prototype.bindSearchEvents=function(){this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},i.prototype.toolbarCreated=function(e){this.element.querySelector(".e-search-wrapper")&&(!this.parent.enableAdaptiveUI||e?this.element.querySelector(".e-search-wrapper").innerHTML='<div class="e-input-group e-search" role="search"> <input id="'+this.gridID+'_searchbar" class="e-input" name="input" type="search" placeholder= "'+this.l10n.getConstant("Search")+'"/> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" aria-label= "search"></span> </div>':this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" aria-label= "search"></span> </div>'),this.bindSearchEvents()},i.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new a.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this)}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this);this.toolbar.isStringTemplate=!0;var i="viewContainerRef";if(this.parent[i]&&(this.toolbar.registeredTemplate={},this.toolbar[i]=this.parent[i]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&this.element.classList.add("e-res-toolbar"),this.parent.toolbarTemplate)if(t.isBlazor()||"string"!=typeof this.parent.toolbarTemplate){var r=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate,n=this.parent.element.id+"toolbarTemplate";r?(x(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",n,null,null,this.element),this.parent.renderTemplates()):q(this.element,x(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate"))}else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent())},i.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},i.prototype.renderResponsiveSearch=function(i){i?(this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isSearch),this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),O(this.searchElement,"e-toolbar-right").classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox(),this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus()):this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial)},i.prototype.refreshResponsiveToolbarItems=function(t){if(t===e.ResponsiveToolbarAction.isInitial){for(var i=this.parent.element.id,r=[i+"_edit",i+"_delete"],n=this.parent.getSelectedRowIndexes(),o=[i+"_responsiveback",i+"_update",i+"_cancel"],s=0,l=this.toolbar.items;s<l.length;s++){d=l[s];(c=this.toolbar.element.querySelector("#"+d.id))&&(r.indexOf(d.id)>-1?n.length?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"):-1===o.indexOf(d.id)?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"))}this.searchElement&&(O(this.searchElement,"e-toolbar-right").classList.remove("e-responsive-right"),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0)}if(t===e.ResponsiveToolbarAction.isSearch)for(var r=[this.parent.element.id+"_responsiveback",this.parent.element.id+"_search"],a=0,h=this.toolbar.items;a<h.length;a++){var d=h[a],c=this.toolbar.element.querySelector("#"+d.id);c&&(r.indexOf(d.id)>-1?c.parentElement.classList.remove("e-hidden"):c.parentElement.classList.add("e-hidden"))}},i.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],r=[],n=t.editSettings,o=t.currentViewData&&t.currentViewData.length;n.allowAdding?i.push(this.gridID+"_add"):r.push(this.gridID+"_add"),n.allowEditing&&o?i.push(this.gridID+"_edit"):r.push(this.gridID+"_edit"),n.allowDeleting&&o?i.push(this.gridID+"_delete"):r.push(this.gridID+"_delete"),"Batch"===t.editSettings.mode?t.element.getElementsByClassName("e-updatedtd").length&&(n.allowAdding||n.allowEditing)?(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")):t.isEdit&&(n.allowAdding||n.allowEditing)?(i=[this.gridID+"_update",this.gridID+"_cancel"],r=[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")),this.enableItems(i,!0),this.enableItems(r,!1)},i.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&e.push(this.getItemObject("responsiveFilter")),this.parent.allowSorting&&e.push(this.getItemObject("responsiveSort")));for(var i=0,r=t;i<r.length;i++){var n=r[i];switch(typeof n){case"number":e.push(this.getItemObject(this.items[n]));break;case"string":e.push(this.getItemObject(n));break;default:e.push(this.getItem(n))}}return this.parent.enableAdaptiveUI&&this.parent.toolbar.indexOf("Search")>-1&&e.push(this.getItemObject("responsiveBack")),e},i.prototype.getItem=function(e){var i=this.predefinedItems[e.text];return i?t.extend(i,i,e):e},i.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.gridID+"_"+e}},i.prototype.enableItems=function(e,i){for(var r=0,n=e;r<n.length;r++){var o=n[r],s=t.select("#"+o,this.element);s&&this.toolbar.enableItems(s.parentElement,i)}},i.prototype.toolbarClickHandler=function(e){var i=this,r=this.parent,n=this.gridID;t.extend(e,{cancel:!1});var o=e,s=e.originalEvent;r.trigger("toolbarClick",o,function(e){if(e.originalEvent=e.originalEvent?e.originalEvent:s,!e.cancel)switch(!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_print":r.print();break;case n+"_edit":r.startEdit();break;case n+"_update":r.endEdit();break;case n+"_cancel":r.closeEdit();break;case n+"_add":r.addRecord();break;case n+"_delete":r.deleteRecord();break;case n+"_search":e.originalEvent.target.id===n+"_searchbutton"&&i.searchElement?i.search():!r.enableAdaptiveUI||i.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==n+"_searchbutton"||i.renderResponsiveSearch(!0);break;case n+"_columnchooser":var o=i.parent.element.querySelector(".e-ccdiv"),l=o.getBoundingClientRect().top,a=o.getBoundingClientRect().left,h=e.originalEvent.target;l=o.getBoundingClientRect().top+o.offsetTop,r.createColumnchooser(a,l,h);break;case n+"_responsivefilter":r.showResponsiveCustomFilter();break;case n+"_responsivesort":r.showResponsiveCustomSort();break;case n+"_responsiveback":i.renderResponsiveSearch(!1)}})},i.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},i.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&t.remove(this.element),this.render())},i.prototype.keyUpHandler=function(e){13===e.keyCode&&this.search()},i.prototype.search=function(){this.parent.search(this.searchElement.value)},i.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},i.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new Pr(this.searchElement),t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent())},i.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent())},i.prototype.reRenderToolbar=function(){this.element&&t.remove(this.element),this.render()},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"set-fullscreen-dialog",handler:this.reRenderToolbar},{event:Ot,handler:this.render},{event:Bt,handler:this.onPropertyChanged},{event:Nt,handler:this.updateSearchBox.bind(this)},{event:Lt,handler:this.refreshToolbarItems},{event:"toolbar-refresh",handler:this.refreshToolbarItems},{event:Nt,handler:this.modelChanged},{event:Rt,handler:this.refreshToolbarItems},{event:Gt,handler:this.removeResponsiveSearch},{event:"row-mode-change",handler:this.reRenderToolbar}],Xe(this.parent,this.evtHandlers,!0,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener("rowSelected",this.rowSelectedFunction),this.parent.addEventListener("rowDeselected",this.rowDeSelectedFunction))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(Xe(this.parent,this.evtHandlers,!1),this.parent.removeEventListener("rowSelected",this.rowSelectedFunction),this.parent.removeEventListener("rowDeselected",this.rowDeSelectedFunction))},i.prototype.removeResponsiveSearch=function(e){var t=e.target,i=t.classList.contains("e-search-icon")||t.classList.contains("e-search-wrapper");this.parent.enableAdaptiveUI&&!i&&this.searchElement&&!O(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},i.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial)},i.prototype.getModuleName=function(){return"toolbar"},i}(),$n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),eo=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.aggregates={},r.parent=t,r.locator=i,r.modelGenerator=new Wi(r.parent),r.addEventListener(),r}return $n(r,e),r.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:xi}),i=this.parent.createElement("div",{className:"e-summarycontent"}),r=i;if(this.parent.isFrozenGrid()){var n=this.parent.createElement("div",{className:"e-frozenfootercontent e-frozen-left-footercontent"}),o=this.parent.createElement("div",{className:"e-movablefootercontent"}),s=this.parent.createElement("div",{className:"e-frozenfootercontent e-frozen-right-footercontent"});(this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount())&&(i.appendChild(n),this.frozenContent=n),i.appendChild(o),this.movableContent=o,r=o,this.parent.getFrozenRightColumnsCount()&&(i.appendChild(s),this.frozenRightContent=s)}t.Browser.isDevice&&(r.style.overflowX="scroll"),e.appendChild(i),this.setPanel(e),null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},r.prototype.renderTable=function(){var e=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),i=this.createContentTable("_footer_table").querySelector("."+Mi),r=this.parent.createElement("tfoot");if(i.appendChild(r),this.parent.isFrozenGrid()){var n=i.cloneNode(!0),o=i.cloneNode(!0);if(e&&(this.frozenContent.appendChild(n),this.freezeTable=n),this.parent.getFrozenRightColumnsCount()){t.remove(o.querySelector(ji));var s=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji).cloneNode(!0);o.insertBefore(s,o.querySelector(Ui)),this.frozenRightContent.appendChild(o),this.frTable=o}this.movableContent.appendChild(i),t.remove(i.querySelector(ji));var l=this.parent.getHeaderContent().querySelector("."+Ii).querySelector(ji).cloneNode(!0);i.insertBefore(l,i.querySelector(Ui)),this.setColGroup(l)}this.setTable(i)},r.prototype.renderSummaryContent=function(e,i,r,n){var o=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData,s=this.modelGenerator.getData(),l=t.isNullOrUndefined(r)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(r,n),a=t.isNullOrUndefined(r)?this.modelGenerator.generateRows(o,e||this.aggregates):this.modelGenerator.generateRows(o,e||this.aggregates,r,n),h=document.createDocumentFragment(),d=new Vi(this.locator,null,this.parent);d.element=this.parent.createElement("TR",{className:"e-summaryrow"});for(var c=0,p=s.length;c<p;c++){var u=a[c];if(u){var g=d.render(u,l);h.appendChild(g)}}i.tFoot.appendChild(h),this.aggregates=t.isNullOrUndefined(e)?this.aggregates:e},r.prototype.refresh=function(e){var i=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),r=this.parent.getMovableColumnsCount(),n=this.parent.getFrozenRightColumnsCount();if(this.parent.isFrozenGrid()&&(t.remove(this.getPanel()),this.renderPanel(),this.renderTable(),i&&(this.freezeTable.tFoot.innerHTML="",this.renderSummaryContent(e,this.freezeTable,0,i))),this.getTable().tFoot.innerHTML="",this.renderSummaryContent(e,this.getTable(),i,n?i+r:void 0),this.parent.getFrozenRightColumnsCount()){this.frTable.tFoot.innerHTML="",this.renderSummaryContent(e,this.frTable,i+r,i+r+n);var o=[].slice.call(this.getTable().getElementsByClassName("e-lastsummarycell"));if(o.length)for(var s=0;s<o.length;s++)o[s].style.borderRight="0px"}if(this.parent.isFrozenGrid()){var l=[].slice.call(this.parent.element.querySelector(".e-movablefootercontent").getElementsByClassName("e-summaryrow")),a=void 0;if(i){a=[].slice.call(this.parent.element.querySelector(".e-frozen-left-footercontent").getElementsByClassName("e-summaryrow")),this.refreshHeight(a,l);var h=this.frozenContent;h.offsetHeight||(h.style.height=this.getTable().offsetHeight+"px")}if(n){var d=[].slice.call(this.parent.element.querySelector(".e-frozen-right-footercontent").getElementsByClassName("e-summaryrow"));this.refreshHeight(d,l),a&&this.refreshHeight(d,a);var c=this.frTable;c.offsetHeight||(c.style.height=this.getTable().offsetHeight+"px")}this.parent.allowResizing&&this.updateFooterTableWidth(this.getTable())}this.onScroll()},r.prototype.refreshHeight=function(e,t){for(var i=0;i<e.length;i++){var r=e[i].getBoundingClientRect().height,n=t[i].getBoundingClientRect().height;r<n?(e[i].classList.remove("e-hide"),e[i].style.height=n+"px"):r>n&&(t[i].classList.remove("e-hide"),t[i].style.height=r+"px")}},r.prototype.refreshCol=function(){var e,t=e=this.parent.element.querySelector("."+Si).querySelector(ji).cloneNode(!0);this.parent.getFrozenColumns()&&(this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()?e=this.parent.getMovableVirtualHeader().querySelector(ji).cloneNode(!0):(e=de(t,this.parent.getFrozenColumns(),this.parent),this.freezeTable.replaceChild(t,this.freezeTable.querySelector(ji)))),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},r.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=t.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},r.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.isFrozenGrid()?this.parent.getContent().querySelector("."+Ei).scrollLeft:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},r.prototype.getColFromIndex=function(e){var t=this.parent.getVisibleFrozenLeftCount()||this.parent.getFrozenColumns(),i=this.parent.getVisibleMovableCount(),r=this.parent.getVisibleFrozenRightCount(),n=this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()?1:0;return t&&e<t+n?this.freezeTable.querySelector(ji).children[e]:r&&e>=t+i+n?this.frTable.querySelector(ji).children[e-(t?t+i+n:t+i)]:this.getColGroup().children[e-(t?t+n:t)]},r.prototype.columnVisibilityChanged=function(){this.refresh()},r.prototype.addEventListener=function(){this.evtHandlers=[{event:qt,handler:this.refreshCol},{event:"column-width-changed",handler:this.onWidthChange},{event:"scroll",handler:this.onScroll},{event:Wt,handler:this.columnVisibilityChanged},{event:"refresh-footer-rendered",handler:this.refreshFooterRenderer}],Xe(this.parent,this.evtHandlers,!0,this)},r.prototype.removeEventListener=function(){Xe(this.parent,this.evtHandlers,!1)},r.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},r.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},r.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<t.length;r++)if(t[r][i]===e[i])return r;return-1},r.prototype.onAggregates=function(e){e=e instanceof Array?e:[];var t=this.parent.getPrimaryKeyFieldNames()[0],r=[],n=!1,o={},s=!1;!this.parent.renderModule.data.isRemote()&&this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&(s=!0);var l=this.parent.dataSource instanceof Array?s?this.parent.getFilteredRecords():this.parent.dataSource:this.parent.dataSource.dataSource.json.length?this.parent.dataSource.dataSource.json:this.parent.getCurrentViewRecords();if(this.parent.editModule&&(o=this.parent.editModule.getBatchChanges()),Object.keys(o).length){for(p=0;p<l.length;p++)n=!1,o.changedRecords.length&&this.getIndexByKey(l[p],o.changedRecords)>-1&&(n=!0,r.push(o.changedRecords[this.getIndexByKey(l[p],o.changedRecords)])),o.deletedRecords.length&&this.getIndexByKey(l[p],o.deletedRecords)>-1?n=!0:n||r.push(l[p]);if(o.addedRecords.length)for(p=0;p<o.addedRecords.length;p++)r.push(o.addedRecords[p])}else r=e.length?R(l).map(function(r){var n,o=i.DataUtil.getObject(t,r);return e.some(function(e){return n=e,o===i.DataUtil.getObject(t,e)})?n:r}):l;var a=e;a.type&&"cancel"===a.type&&(r=l);for(var h,d={},c=this.parent.aggregates,p=0;p<c.length;p++)for(var u=0;u<c[p].columns.length;u++){var g=c[p].columns[u].type.toString();h=U(g,r,c[p].columns[u],this.parent),d[c[p].columns[u].field+" - "+g.toLowerCase()]=h}return{result:r,count:r.length,aggregates:d}},r}(Yi),to=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),io=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-summarycell",attrs:{role:"gridcell",tabindex:"-1"}}),t}return to(i,e),i.prototype.getValue=function(e,i,r){var n=t.isNullOrUndefined(r.type)?r.columnName:r.field+" - "+("string"==typeof r.type?r.type.toLowerCase():"");return i[r.columnName]?i[r.columnName][n]:""},i.prototype.evaluate=function(e,i,r,n){var o=i.column;if(this.parent.on("refresh-aggregate-cell",this.refreshWithAggregate(e,i),this),!(o.footerTemplate||o.groupFooterTemplate||o.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var s=o.getTemplate(i.cellType),l=this.parent.getColumnByField(r[o.columnName].field);if(!t.isNullOrUndefined(l)&&(r[o.columnName].headerText=l.headerText,l.isForeignColumn())){var a=l.columnData.filter(function(e){return e[l.foreignKeyField]===r[o.columnName].key})[0];a&&(r[o.columnName].foreignKey=a[l.foreignKeyValue])}if(this.parent.isReact&&(o.footerTemplate?"string"!=typeof o.footerTemplate:o.groupFooterTemplate?"string"!=typeof o.groupFooterTemplate:!!o.groupCaptionTemplate&&"string"!=typeof o.groupCaptionTemplate)){var h=r[o.columnName];if("groupCaptionTemplate"===s.property||"groupFooterTemplate"===s.property){h.groupKey=h.key}s.fn(h,this.parent,s.property,"",null,null,e),this.parent.renderTemplates()}else q(e,s.fn(r[o.columnName],this.parent,s.property,""));return!1},i.prototype.refreshWithAggregate=function(e,i){var r=this,n=i;return function(i){var o=n,s=o.column.columnName?o.column.columnName:null,l=t.isNullOrUndefined(s)?null:i.cells.filter(function(e){return e.column.columnName===s})[0];e.parentElement&&e.parentElement.getAttribute("data-uid")===i.dataUid&&s&&s===l.column.columnName&&r.refreshTD(e,l,i.data)}},i}($i),ro=function(){function i(e,t){this.parent=e,this.locator=t,this.addEventListener()}return i.prototype.getModuleName=function(){return"aggregate"},i.prototype.initiateRender=function(){for(var i=this,r=this.locator.getService("cellRendererFactory"),n=new io(this.parent,this.locator),o=[e.CellType.Summary,e.CellType.CaptionSummary,e.CellType.GroupSummary],s=0;s<o.length;s++)r.addCellRenderer(o[s],n);this.footerRenderer=new eo(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var l=this.footerRenderer.getPanel();this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&l&&t.addClass([l],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer);var a=function(){i.prepareSummaryInfo(),i.parent.off(kt,a)};this.parent.on(kt,a,this),this.parent.on(kt,this.footerRenderer.refresh,this.footerRenderer)},i.prototype.prepareSummaryInfo=function(){var e=this;$e(this.parent.aggregates,function(i){var r=t.getValue("customFormat",i);if(t.isNullOrUndefined(r)||i.setPropertiesSilent({format:r}),"object"==typeof i.format){var n=new yt;i.setFormatter(n.getFormatFunction(t.extend({},i.format)))}else if("string"==typeof i.format){var o=e.locator.getService("valueFormatter");i.setFormatter(o.getFormatFunction({format:i.format}))}i.setPropertiesSilent({columnName:i.columnName||i.field})})},i.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){t.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh();var i=new Qi(this.parent);0===new Ki(this.parent).getData().length&&i.isEmpty()||this.parent.notify(Lt,{})}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ot,this.initiateRender,this),this.parent.on(Bt,this.onPropertyChanged,this),this.parent.on("refresh-aggregates",this.refresh,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(Ot,this.initiateRender),this.parent.off(kt,this.footerRenderer.refresh),this.parent.off(Bt,this.onPropertyChanged),this.parent.off("refresh-aggregates",this.refresh))},i.prototype.destroy=function(){this.removeEventListener(),t.remove(this.parent.element.querySelector("."+xi))},i.prototype.refresh=function(e){var t=e instanceof Array?e:[e];this.parent.notify("refresh-footer-rendered",t),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",t)},i}(),no=function(){function e(e,t,i){var r=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-r.containerRect.top;return t.entered=i>=0,i+r.options.pageHeight/2>=0},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=r.containerRect.bottom,i-r.options.pageHeight/2<=r.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return r.movableEle?(t.entered=i<r.movableContainerRect.right,i-r.movableContainerRect.width<=r.movableContainerRect.right):(t.entered=i<r.containerRect.right,i-r.containerRect.width<=r.containerRect.right)},axis:"X"},left:{check:function(e,t){var i=e.left;return t.entered=i>0,r.movableEle?i+r.movableContainerRect.width>=r.movableContainerRect.left:i+r.containerRect.width>=r.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}return e.prototype.observe=function(e,i){var r=this;this.containerRect=this.options.container.getBoundingClientRect(),t.EventHandler.add(this.options.container,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,i),this),this.options.movableContainer&&(this.movableContainerRect=this.options.movableContainer.getBoundingClientRect(),t.EventHandler.add(this.options.scrollbar,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.scrollbar,"scroll",this.virtualScrollHandler(e,i),this))},e.prototype.check=function(e){var t=this.sentinelInfo[e];return!this.movableContainerRect||"left"!==e&&"right"!==e?t.check(this.element.getBoundingClientRect(),t):t.check(this.movableEle.getBoundingClientRect(),t)},e.prototype.virtualScrollHandler=function(e,i){var r=this,n="chrome"===t.Browser.info.name?200:100,o=t.debounce(e,n),s=t.debounce(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var t=r.options.movableContainer?r.options.container.scrollTop:e.target.scrollTop,n=r.options.movableContainer?r.options.scrollbar.scrollLeft:e.target.scrollLeft,l=r.options.prevTop<t?"down":"up";l=r.options.prevLeft===n?l:r.options.prevLeft<n?"right":"left",r.options.prevTop=t,r.options.prevLeft=n;var a=r.sentinelInfo[l];if(-1!==r.options.axes.indexOf(a.axis)){var h=r.check(l);if(a.entered&&(!r.movableEle||"right"!==l&&"left"!==l?i(r.element,a,l,{top:t,left:n},r.fromWheel,h):i(r.movableEle,a,l,{top:t,left:n},r.fromWheel,h)),h){var d=o;"X"===a.axis&&(d=s),d({direction:l,sentinel:a,offset:{top:t,left:n},focusElement:document.activeElement})}r.fromWheel=!1}}},e.prototype.setPageHeight=function(e){this.options.pageHeight=e},e}(),oo=function(){function e(e){this.cOffsets={},this.cache={},this.movableCache={},this.frozenRightCache={},this.rowCache={},this.data={},this.groups={},this.currentInfo={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=this.parent.allowGrouping?new Ji(this.parent):new Gi(this.parent)}return e.prototype.generateRows=function(e,i){var r=this.parent.isFrozenGrid(),n=!1,o=i.virtualInfo=i.virtualInfo||this.getData(),s=o.sentinelInfo&&"X"===o.sentinelInfo.axis,l=s||!o.loadNext||o.loadSelf?o.page:o.nextInfo.page,a=[],h=this.getBlockIndexes(l),d=[];if(this.currentInfo.blockIndexes&&(h=o.blockIndexes=i.virtualInfo.blockIndexes=this.includePrevPage?this.currentInfo.blockIndexes.slice(1):this.currentInfo.blockIndexes.slice(0,this.currentInfo.blockIndexes.length-1),n=!0),(r&&this.parent.getFrozenMode()!==Pi&&!i.renderMovableContent||this.parent.getFrozenMode()===Pi&&!i.renderMovableContent&&!i.renderFrozenRightContent||!r)&&this.checkAndResetCache(i.requestType),ce(this.parent)&&this.parent.vcRows.length)return a=this.parent.vcRows;if(this.parent.enableColumnVirtualization)for(p=0;p<o.blockIndexes.length;p++)this.isBlockAvailable(o.blockIndexes[p])&&(this.cache[o.blockIndexes[p]]=this.rowModelGenerator.refreshRows(this.cache[o.blockIndexes[p]])),(i.renderMovableContent&&this.isMovableBlockAvailable(o.blockIndexes[p])||i.renderFrozenRightContent&&this.isFrozenRightBlockAvailable(o.blockIndexes[p]))&&((f=i.renderMovableContent?this.movableCache:this.frozenRightCache)[o.blockIndexes[p]]=this.rowModelGenerator.refreshRows(f[o.blockIndexes[p]]));for(var c=o.blockIndexes,p=0;p<c.length;p++){if(!this.isBlockAvailable(c[p])){var u=t.isNullOrUndefined(this.startIndex)?this.getStartIndex(c[p],e):this.startIndex,g=this.rowModelGenerator.generateRows(e,{virtualInfo:o,startIndex:u});ce(this.parent)&&!this.parent.vcRows.length&&(this.parent.vRows=g,this.parent.vcRows=g,this.parent.notify("refresh-virtual-max-page",{}));m=void 0;ce(this.parent)?(m=this.model.pageSize/2,this.isBlockAvailable(h[0])||(this.cache[h[0]]=g.slice(0,m)),this.isBlockAvailable(h[1])||(this.cache[h[1]]=g.slice(m,this.model.pageSize))):n?this.setBlockForManualRefresh(this.cache,h,g):(m=~~Math.max(g.length,this.model.pageSize)/2,this.isBlockAvailable(h[0])||(this.cache[h[0]]=g.slice(0,m)),this.isBlockAvailable(h[1])||(this.cache[h[1]]=g.slice(m)))}if(this.parent.groupSettings.columns.length&&!s&&this.cache[c[p]]&&(this.cache[c[p]]=this.updateGroupRow(this.cache[c[p]],c[p])),i.renderMovableContent&&!this.isMovableBlockAvailable(c[p])||i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(c[p])){var f=i.renderMovableContent?this.movableCache:this.frozenRightCache,u=t.isNullOrUndefined(this.startIndex)?this.getStartIndex(c[p],e):this.startIndex,g=this.rowModelGenerator.generateRows(e,{virtualInfo:o,startIndex:u});if(n)this.setBlockForManualRefresh(f,h,g);else{var m=~~Math.max(g.length,this.model.pageSize)/2;(i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(h[0])||i.renderMovableContent&&!this.isMovableBlockAvailable(h[0]))&&(f[h[0]]=g.slice(0,m)),(i.renderFrozenRightContent&&!this.isFrozenRightBlockAvailable(h[1])||i.renderMovableContent&&!this.isMovableBlockAvailable(h[1]))&&(f[h[1]]=g.slice(m))}}i.renderMovableContent||i.renderFrozenRightContent||!this.cache[c[p]]?(f=i.renderMovableContent?this.movableCache:this.frozenRightCache)[c[p]]&&a.push.apply(a,f[c[p]]):a.push.apply(a,this.cache[c[p]]),this.isBlockAvailable(c[p])&&d.push(c[p])}o.blockIndexes=d;return this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.parent.currentViewData.records=a.map(function(e){return e.data}):r?(i.renderMovableContent&&("Left"===this.parent.getFrozenMode()||"Right"===this.parent.getFrozenMode()||this.parent.getFrozenColumns())||i.renderFrozenRightContent)&&(this.parent.currentViewData=a.map(function(e){return e.data})):this.parent.currentViewData=a.map(function(e){return e.data}),a},e.prototype.setBlockForManualRefresh=function(e,t,i){var r=this.model.pageSize/2;this.includePrevPage?(e[t[0]-1]=i.slice(0,r),e[t[0]]=i.slice(r,2*r),e[t[1]]=i.slice(2*r,3*r),e[t[2]]=i.slice(3*r,4*r)):(e[t[0]]=i.slice(0,r),e[t[1]]=i.slice(r,2*r),e[t[2]]=i.slice(2*r,3*r),e[t[2]+1]=i.slice(3*r,4*r))},e.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},e.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},e.prototype.isBlockAvailable=function(e){return e in this.cache},e.prototype.isMovableBlockAvailable=function(e){return e in this.movableCache},e.prototype.isFrozenRightBlockAvailable=function(e){return e in this.frozenRightCache},e.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},e.prototype.getStartIndex=function(e,t,i){void 0===i&&(i=!0);var r=e%2==0,n=(this.getPage(e)-1)*this.model.pageSize;return i||!r?n:n+~~(this.model.pageSize/2)},e.prototype.getColumnIndexes=function(e){var i=this;void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+Fi)),this.parent.isFrozenGrid()&&(e=e.querySelector("."+Ii));var r=[],n=0|e.scrollLeft,o=Object.keys(this.cOffsets),s=e.getBoundingClientRect().width;n=Math.min(this.cOffsets[o.length-1]-s,n);var l=t.Browser.isDevice?2*s:s/2,a=n+s+(0===n?l:0);return o.some(function(e){var t=Number(e),o=i.cOffsets[e];return n-l<=o&&a+l>=o&&r.push(t),a+l<o}),this.addFrozenIndex(r),r},e.prototype.addFrozenIndex=function(e){if(this.parent.getFrozenColumns()&&this.parent.enableColumnVirtualization&&0===e[0])for(var t=0;t<this.parent.getFrozenColumns();t++)e.push(e[e.length-1]+1)},e.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete"];this.parent.getFrozenColumns()&&this.parent.frozenRows&&this.parent.enableColumnVirtualization&&"reorder"===e&&t.splice(t.indexOf(e),1);var i=t.some(function(t){return e===t});return i&&(this.cache={},this.data={},this.groups={},this.movableCache={},this.frozenRightCache={}),i},e.prototype.refreshColOffsets=function(){var e=this,t=0;this.cOffsets={};for(var i=this.parent.groupSettings.columns.length,r=this.parent.columns,n=r.length,o=this.parent.groupSettings.columns,s=0;s<o.length;s++)this.cOffsets[s]=30+(0|this.cOffsets[s-1]);for(var l=Array.apply(null,Array(n)).map(function(){return t++}),a=0;a<l.length;a++)l[a]=l[a]+i,this.cOffsets[l[a]]=(0|this.cOffsets[l[a]-1])+(function(t){return t.visible&&(e.parent.groupSettings.showGroupedColumn?t.visible:e.parent.groupSettings.columns.indexOf(t.field)<0)}(r[a])?parseInt(r[a].width,10):0)},e.prototype.updateGroupRow=function(e,t){for(var i=e[0],r=[],n=Object.keys(this.cache),o=0;o<n.length;o++)Number(n[o])<t&&(r=r.concat(this.cache[n[o]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,r)},e.prototype.iterateGroup=function(e,t){var i=e[0],r=0;return i&&i.isDataRow?e:(e.some(function(e){return t.some(function(t,i){var n=t&&void 0!==t.data.field&&t.data.field===e.data.field&&t.data.key===e.data.key;return n&&(r=i),n})})&&(e.shift(),e=this.iterateGroup(e,t.slice(r))),e)},e.prototype.getRows=function(){for(var e=[],t=Object.keys(this.cache),i=0;i<t.length;i++)e=e.concat(this.cache[t[i]]);return e},e.prototype.generateCells=function(){for(var e=[],t=this.parent.columnModel,i=0;i<t.length;i++)e.push(this.rowModelGenerator.generateCell(t[i]));return e},e}(),so=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lo=function(r){function n(e,t){var i=r.call(this,e,t)||this;return i.prevHeight=0,i.startIndex=0,i.preStartIndex=0,i.preventEvent=!1,i.actions=["filtering","searching","grouping","ungrouping"],i.offsets={},i.tmpOffsets={},i.virtualEle=new ho,i.offsetKeys=[],i.isFocused=!1,i.isSelection=!1,i.isBottom=!1,i.rndrCount=0,i.empty=void 0,i.isCancel=!1,i.requestTypes=["beginEdit","cancel","delete","add","save"],i.isNormaledit="Normal"===i.parent.editSettings.mode,i.virtualData={},i.emptyRowData={},i.vfColIndex=[],i.frzIdx=1,i.isContextMenuOpen=!1,i.isSelectionScroll=!1,i.validationCheck=!1,i.locator=t,i.eventListener("on"),i.parent.on(Wt,i.setVisible,i),i.vgenerator=i.generator,i}return so(n,r),n.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(e.RenderType.Header),r.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.content=this.getPanel().querySelector("."+Di),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.virtualEle.wrapper.style.position="absolute";var t=this.parent.dataSource instanceof i.DataManager&&!this.parent.dataSource.dataSource.offline,n={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:t,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"]};this.observer=new no(this.virtualEle.wrapper,n)},n.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.virtualEle.adjustTable(0,0)},n.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,r=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.renderMovableContent||(e.virtualInfo.columnIndexes=[]);var n=this.parent.getCurrentViewRecords().length,o=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,n),s=this.vgenerator.generateRows(o,e);return e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=r,s.splice(0,this.parent.frozenRows)},n.prototype.scrollListener=function(e){if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)return void(this.preventEvent=!1);t.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===t.closest(document.activeElement,"."+Di)||this.content===document.activeElement;var i=e.sentinel,r=this.currentInfo=this.getInfoFromView(e.direction,i,e.offset);return ce(this.parent)?"Y"===i.axis&&r.blockIndexes&&this.prevInfo.blockIndexes.toString()===r.blockIndexes.toString()&&"up"===e.direction&&2!==r.blockIndexes[r.blockIndexes.length-1]?void 0:(r.event="refresh-virtual-block",t.isNullOrUndefined(r.offsets)||(r.offsets.top=this.content.scrollTop),void this.parent.notify(r.event,{requestType:"virtualscroll",virtualInfo:r,focusElement:e.focusElement})):this.prevInfo&&("Y"===i.axis&&this.prevInfo.blockIndexes.toString()===r.blockIndexes.toString()||"X"===i.axis&&this.prevInfo.columnIndexes.toString()===r.columnIndexes.toString())?(t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void("Y"===i.axis&&this.restoreEdit())):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?r.columnIndexes:[]),this.parent.pageSettings.currentPage=r.loadNext&&!r.loadSelf?r.nextInfo.page:r.page,this.requestType="virtualscroll",void this.parent.notify(r.event,{requestType:"virtualscroll",virtualInfo:r,focusElement:e.focusElement}))},n.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},n.prototype.getInfoFromView=function(e,t,i){var r=!1,n=[],o={direction:e,sentinelInfo:t,offsets:i,startIndex:this.preStartIndex,endIndex:this.preEndIndex};o.page=this.getPageFromTop(i.top,o),o.blockIndexes=n=this.vgenerator.getBlockIndexes(o.page),o.loadSelf=!this.vgenerator.isBlockAvailable(n[o.block]);var s=this.ensureBlocks(o);if("upArrow"===this.activeKey&&o.blockIndexes.toString()!==s.toString()){var l=s[s.length-1];-1===o.blockIndexes.indexOf(l)&&(r=!0)}if(o.blockIndexes=s,o.loadNext=!s.filter(function(e){return-1===n.indexOf(e)}).every(this.block.bind(this)),o.event=o.loadNext||o.loadSelf?Lt:$t,o.nextInfo=o.loadNext?{page:Math.max(1,o.page+("down"===e?1:-1))}:{},r&&(o.blockIndexes=[o.blockIndexes[0]-1,o.blockIndexes[0],o.blockIndexes[0]+1]),"downArrow"===this.activeKey){var a=Math.ceil(this.rowIndex/this.getBlockSize());1!==a&&(o.blockIndexes[1]!==a||o.blockIndexes.length<3)&&(o.blockIndexes=[a-1,a,a+1])}return o.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(o.event=$t),o},n.prototype.setKeyboardNavIndex=function(){this.blazorDataLoad=!0,"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey||(this.blzRowIndex="downArrow"===this.activeKey?this.rowIndex+1:this.rowIndex-1,document.activeElement.blur())},n.prototype.ensureBlocks=function(e){var t,i=this,r=e.blockIndexes[e.block],n=r,o=Math.max,s="down"===e.direction?[o(r,1),++r,++r]:[o(r-1,1),r,r+1];return this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&("X"===e.sentinelInfo.axis||"Y"===e.sentinelInfo.axis&&e.page===this.prevInfo.page)&&(s=this.prevInfo.blockIndexes),s=s.filter(function(e,t){return s.indexOf(e)===t}),this.prevInfo.blockIndexes.toString()===s.toString()?s:((e.loadSelf||"down"===e.direction&&this.isEndBlock(n))&&(s=this.vgenerator.getBlockIndexes(e.page)),s.some(function(e,r){var n=e===(ce(i.parent)?i.getGroupedTotalBlocks():i.getTotalBlocks());return n&&(t=r),n}),void 0!==t&&(s=s.slice(0,t+1),0===e.block&&1===s.length&&this.vgenerator.isBlockAvailable(s[0]-1)&&(s=[s[0]-1,s[0]])),s)},n.prototype.appendContent=function(e,i,r){var n=this,o=this.parent.isFrozenGrid(),s=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),l=this.parent.enableColumnVirtualization&&o;this.checkFirstBlockColIndexes(r);var a=r.virtualInfo.sentinelInfo&&"Y"===r.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==r.virtualInfo.page?this.currentInfo:r.virtualInfo;this.prevInfo=this.prevInfo||r.virtualInfo;var h=a.columnIndexes[0]-1;l&&a.columnIndexes[0]===s&&(h=a.columnIndexes[0]-s-1);var d,c=this.getColumnOffset(h),p=a.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var u=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;if(!this.requestTypes.some(function(e){return e===n.requestType})){var g=this.getTranslateY(this.content.scrollTop,u,a);this.virtualEle.adjustTable(l?0:c,g),l&&this.virtualEle.adjustMovableTable(c,0)}if(this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(l?0:c,0),l&&this.header.virtualEle.adjustMovableTable(c,0)),this.parent.enableColumnVirtualization){var f=a.columnIndexes;d=this.getColumnOffset(f[f.length-1])-this.getColumnOffset(f[0]-1)+"",l?this.header.virtualEle.setMovableWrapperWidth(d):this.header.virtualEle.setWrapperWidth(d)}l?this.virtualEle.setMovableWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name):this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),t.isNullOrUndefined(e.parentNode)||t.remove(e);var m;if(o?r.renderFrozenRightContent?m=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(Ui):r.renderMovableContent?r.renderMovableContent&&(m=this.parent.getMovableVirtualContent().querySelector(Ui)):m=this.parent.getFrozenVirtualContent().querySelector(Ui):m=this.parent.element.querySelector("."+Di).querySelector(Ui),m&&(t.remove(m),e=null),this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:(e=this.parent.createElement(Ui)).appendChild(i),this.parent.frozenRows&&"virtualscroll"===r.requestType&&1===this.parent.pageSettings.currentPage)for(var y=0;y<this.parent.frozenRows;y++)e.children[0].remove();if(o?(r.renderFrozenRightContent?(this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("."+Mi).appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType):r.renderMovableContent?r.renderMovableContent&&(this.parent.getMovableVirtualContent().querySelector("."+Mi).appendChild(e),this.parent.getFrozenMode()!==Pi&&(this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType)):this.parent.getFrozenVirtualContent().querySelector("."+Mi).appendChild(e),this.vfColIndex.length&&(r.virtualInfo.columnIndexes=a.columnIndexes=t.extend([],this.vfColIndex),this.vfColIndex=r.renderMovableContent?[]:this.vfColIndex)):(this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType),this.parent.groupSettings.columns.length){if(!ce(this.parent)&&"up"===a.direction){var v=this.offsets[this.getTotalBlocks()]-this.prevHeight;this.preventEvent=!0;var C=this.content.scrollTop;this.content.scrollTop=C+v}this.setVirtualHeight(),this.observer.setPageHeight(this.getOffset(p[p.length-1])-this.getOffset(p[0]-1))}this.prevInfo=a,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var w=Math.ceil(this.getTotalBlocks()/2);if(this.isBottom&&(this.isBottom=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage===w&&1===p.length&&(this.isBottom=!0,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-2]),"virtualscroll"===r.requestType&&"X"===r.virtualInfo.sentinelInfo.axis&&this.parent.notify(ei,{}),this.focusCell(r),this.restoreEdit(r),this.restoreAdd(r),this.ensureSelectedRowPosition(),this.validationScrollLeft(r,o),!this.initialRowTop){var b=this.parent.element.getBoundingClientRect().top;this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-b}var S=r.tableName,R="Left-Right"===this.parent.getFrozenMode()?"frozen-right"===S:"movable"===S;o&&!R||(this.vgenerator.startIndex=null,this.vgenerator.currentInfo={},this.vgenerator.includePrevPage=null)},n.prototype.validationScrollLeft=function(e,t){var i=this.parent.getFrozenColumns(),r=this.parent.getFrozenMode(),n=!t||e&&(i||"Left"===r||"Right"===r?e.renderMovableContent:e.renderFrozenRightContent);if(this.validationCheck&&n)if(this.validationCol){var o=this.vgenerator.cOffsets[this.validationCol.index-this.parent.getVisibleFrozenColumns()-1];this.validationCol=null,this.parent.isFrozenGrid()?this.movableContent.scrollLeft=o:this.content.scrollLeft=o}else this.validationCheck=!1,this.parent.editModule.editFormValidate()},n.prototype.ensureSelectedRowPosition=function(){if(!this.isSelection&&this.isSelectionScroll&&!t.isNullOrUndefined(this.selectRowIndex)){this.isSelectionScroll=!1;var e=this.parent.getRowByIndex(this.selectRowIndex);e&&!this.isRowInView(e)&&this.rowSelected({rowIndex:this.selectRowIndex,row:e},!0)}},n.prototype.checkFirstBlockColIndexes=function(e){if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&0===e.virtualInfo.columnIndexes[0]){var i=[],r=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount();if(!e.renderMovableContent&&e.virtualInfo.columnIndexes.length>r){this.vfColIndex=e.virtualInfo.columnIndexes;for(var n=0;n<r;n++)i.push(n);e.virtualInfo.columnIndexes=i}else e.renderMovableContent&&(this.vfColIndex.length||(this.vfColIndex=t.extend([],e.virtualInfo.columnIndexes)),e.virtualInfo.columnIndexes=t.extend([],this.vfColIndex),e.virtualInfo.columnIndexes.splice(0,r))}},n.prototype.focusCell=function(e){if("upArrow"===this.activeKey||"downArrow"===this.activeKey){var t=this.parent.getRowByIndex(this.rowIndex);t.cells[this.cellIndex].focus({preventScroll:!0}),this.parent.selectRow(parseInt(t.getAttribute(Hi),10)),this.activeKey=this.empty}},n.prototype.restoreEdit=function(e){if(this.isNormaledit){var i=this.parent.getFrozenColumns(),r=e&&this.parent.isFrozenGrid(),n=this.parent.getFrozenMode(),o=e&&(i||"Left"===n||"Right"===n?e.renderMovableContent:e.renderFrozenRightContent);if((!r||r&&o)&&this.parent.editSettings.allowEditing&&this.parent.editModule&&!t.isNullOrUndefined(this.editedRowIndex)){var s=this.getRowByIndex(this.editedRowIndex),l=this.content,a=Object.keys(this.virtualData),h=e&&e.virtualInfo&&"X"===e.virtualInfo.sentinelInfo.axis;if(r&&h&&(s=this.parent.getMovableRowByIndex(this.editedRowIndex),l=this.movableContent),a.length&&s&&!l.querySelector("."+Ai)){var d=s.getBoundingClientRect().top;(h||d<this.content.offsetHeight&&d>this.parent.getRowHeight())&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(s))}if(s&&this.content.querySelector("."+Ai)&&!a.length){var c=t.extend({},this.getRowObjectByIndex(this.editedRowIndex));this.virtualData=this.getVirtualEditedData(c)}}this.restoreAdd(e)}},n.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[i],e);return e},n.prototype.restoreAdd=function(e){var t=this.parent.getFrozenColumns(),i=e&&this.parent.isFrozenGrid(),r=this.parent.getFrozenMode(),n=e&&e.virtualInfo&&e.virtualInfo.sentinelInfo&&"X"===e.virtualInfo.sentinelInfo.axis&&i?!(this.parent.getMovableVirtualHeader().querySelector("."+Bi)||this.parent.getMovableVirtualContent().querySelector("."+Bi)):!this.parent.element.querySelector("."+Bi),o=e&&(t||"Left"===r||"Right"===r?e.renderMovableContent:e.renderFrozenRightContent);if((!i||i&&o)&&this.isNormaledit&&this.isAdd&&n){var s="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),l="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage;(s||l)&&(this.parent.isEdit=!1,this.parent.addRecord())}},n.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.count=e.count,this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(e.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(t){return e.requestType===t})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(e.requestType)},n.prototype.setVirtualHeight=function(e){var t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length+this.parent.groupSettings.columns.length-1)+"px":"100%";if(this.parent.isFrozenGrid()){var i=1===this.parent.pageSettings.currentPage&&Object.keys(this.offsets).length<=2?this.offsets[1]:this.offsets[this.getTotalBlocks()-2];i=i>this.content.clientHeight?i:0,this.virtualEle.setVirtualHeight(i,t)}else{var r=this.offsets[ce(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks()];this.virtualEle.setVirtualHeight(r,t)}this.parent.enableColumnVirtualization&&(this.header.virtualEle.setVirtualHeight(1,t),this.parent.isFrozenGrid()&&(this.virtualEle.setMovableVirtualHeight(1,t),this.header.virtualEle.setMovableVirtualHeight(1,t)))},n.prototype.getPageFromTop=function(e,t){var i=this,r=ce(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),n=0;return this.offsetKeys.some(function(o){var s=Number(o),l=e<=i.offsets[o]||s===r&&e>i.offsets[o];return l&&(i.offsetKeys.length%2!=0&&s.toString()===i.offsetKeys[i.offsetKeys.length-2]&&e<=i.offsets[i.offsetKeys.length-1]&&(s+=1),t.block=s%2==0?1:0,n=Math.max(1,Math.min(i.vgenerator.getPage(s),i.maxPage))),l}),n},n.prototype.getTranslateY=function(e,t,i,r){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var n=(i.blockIndexes[0]||1)-1,o=this.getOffset(n),s=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]);r&&(i=this.prevInfo);var l=o>e?this.getOffset(n-1):s<e+t?this.getOffset(n+1):o,a=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],h=ce(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return l+a>this.offsets[h]&&(l-=l+a-this.offsets[h]),l},n.prototype.getOffset=function(e){return Math.min(0|this.offsets[e],0|this.offsets[this.maxBlock])},n.prototype.onEntered=function(){var e=this;return function(i,r,n,o,s,l){t.Browser.isIE&&!s&&l&&!e.preventEvent&&e.parent.showSpinner();var a=e.parent.enableColumnVirtualization&&e.parent.isFrozenGrid(),h="X"===r.axis,d=e.prevInfo.offsets?e.prevInfo.offsets.top:null,c=e.content.getBoundingClientRect().height,p=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(h&&!a){var u=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,g=e.vgenerator.cOffsets[u-1];p=p>g?g:p}var f=e.getTranslateY(o.top,c,h&&d===o.top?e.prevInfo:void 0,!0);e.virtualEle.adjustTable(a?0:p,Math.min(f,e.offsets[e.maxBlock])),a&&e.virtualEle.adjustMovableTable(p,0),e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(a?0:p,0),a&&e.header.virtualEle.adjustMovableTable(p,0))}},n.prototype.dataBound=function(){this.parent.notify("refresh-virtual-frozen-height",{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):this.activeKey=this.empty},n.prototype.rowSelected=function(e,t){if((this.isSelection||t)&&!this.isLastBlockRow(e.rowIndex)){var i=be(this.content.firstElementChild),r=this.parent.element.getBoundingClientRect().top,n=e.row.getBoundingClientRect().top-r,o=this.content.getBoundingClientRect().height,s=o<n,l=s?n-o:this.initialRowTop-n,a=s?i.height-l:i.height+l;this.virtualEle.adjustTable(i.width,a),this.content.querySelector("tbody").lastElementChild.getBoundingClientRect().top-r<o&&(a+=o-(e.row.getBoundingClientRect().top-r),this.virtualEle.adjustTable(i.width,a-this.parent.getRowHeight()/2))}this.isSelection=!1},n.prototype.isLastBlockRow=function(e){var t=this.parent.getContent().firstElementChild,i=Math.floor(t.offsetHeight/this.parent.getRowHeight())-1;return e>=this.maxPage*this.parent.pageSettings.pageSize-i},n.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},n.prototype.setVirtualPageQuery=function(e){var i=this.parent.getContent().querySelector(".e-row");if(i&&this.parent.isManualRefresh&&this.currentInfo.blockIndexes&&3===this.currentInfo.blockIndexes.length){this.vgenerator.startIndex=parseInt(i.getAttribute("aria-rowindex"),10),this.vgenerator.currentInfo=t.extend({},this.currentInfo),this.vgenerator.currentInfo.blockIndexes=this.currentInfo.blockIndexes.slice(),(this.vgenerator.includePrevPage=this.currentInfo.blockIndexes[0]%2==0)?(this.vgenerator.startIndex=this.vgenerator.startIndex-this.getBlockSize(),this.vgenerator.currentInfo.blockIndexes.unshift(this.currentInfo.blockIndexes[0]-1)):this.vgenerator.currentInfo.blockIndexes.push(this.currentInfo.blockIndexes[this.currentInfo.blockIndexes.length-1]+1);var r=(this.vgenerator.currentInfo.blockIndexes[0]-1)*this.getBlockSize(),n=this.vgenerator.currentInfo.blockIndexes.length*this.getBlockSize();e.query.skip(r),e.query.take(n),e.skipPage=!0}},n.prototype.eventListener=function(e){var t=this;this.parent[e](kt,this.onDataReady,this),this.parent.addEventListener(Rt,this.dataBound.bind(this)),this.parent.addEventListener(bt,this.actionBegin.bind(this)),this.parent.addEventListener(St,this.actionComplete.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelected.bind(this)),this.parent[e]($t,this.refreshContentRows,this),this.parent[e]("select-virtual-Row",this.selectVirtualRow,this),this.parent[e]("virtaul-cell-focus",this.virtualCellFocus,this),this.parent[e]("virtual-scroll-edit-action-begin",this.editActionBegin,this),this.parent[e]("virtual-scroll-add-action-begin",this.addActionBegin,this),this.parent[e]("virtual-scroll-edit",this.restoreEdit,this),this.parent[e]("virtual-scroll-edit-success",this.editSuccess,this),this.parent[e]("refresh-virtual-cache",this.refreshCache,this),this.parent[e]("edit-reset",this.resetIsedit,this),this.parent[e](pi,this.getVirtualData,this),this.parent[e]("virtual-scroll-edit-cancel",this.editCancel,this),this.parent[e]("refresh-virtual-max-page",this.refreshMaxPage,this),this.parent[e]("set-virtual-page-query",this.setVirtualPageQuery,this),this.parent[e]("select-row-on-context-open",this.selectRowOnContextOpen,this),this.parent[e]("reset-virtual-focus",this.resetVirtualFocus,this),this.parent[e]("refresh-virtual-editform-cells",this.refreshCells,this),this.parent[e]("scroll-to-edit",this.scrollToEdit,this);for(var i=this.actions,r=0;r<i.length;r++)this.parent[e](i[r]+"-begin",this.onActionBegin,this);var n=function(){t.observer.observe(function(e){return t.scrollListener(e)},t.onEntered());var e=t.parent;if(e.enablePersistence&&e.scrollPosition){t.content.scrollTop=e.scrollPosition.top;var i={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.scrollPosition,focusElement:e.element};t.scrollListener(i),e.enableColumnVirtualization&&(t.content.scrollLeft=e.scrollPosition.left)}t.parent.off(At,n)};this.parent.on(At,n,this)},n.prototype.scrollToEdit=function(e){var i=this.parent.isFrozenGrid(),r=!0;if(this.validationCheck=!0,this.isAdd&&this.content.scrollTop>0){r=!1;var n=Object.keys(this.offsets);this.content.scrollTop="Top"===this.parent.editSettings.newRowPosition?0:this.offsets[n.length-1]}var o=this.parent.getRowByIndex(this.editedRowIndex);if(!(o||t.isNullOrUndefined(this.editedRowIndex)||o&&this.isRowInView(o))){var s=this.parent.getRowHeight(),l=this.editedRowIndex*s;t.isNullOrUndefined(l)||(r=!1,this.content.scrollTop=l)}if(e&&r){var a=this.vgenerator.cOffsets[e.index-this.parent.getVisibleFrozenColumns()-1];if(!this.parent.enableColumnVirtualization){var h=this.parent.getHeaderContent().querySelector('.e-headercelldiv[e-mappinguid="'+e.uid+'"]');a=i?h.parentElement.offsetLeft-this.parent.getFrozenVirtualHeader().offsetWidth:h.parentElement.offsetLeft}i?this.parent.getMovableVirtualContent().scrollLeft=this.parent.enableRtl?-Math.abs(a):a:this.content.scrollLeft=this.parent.enableRtl?-Math.abs(a):a}e&&!r&&(this.validationCol=e)},n.prototype.refreshCells=function(e){e.cells=this.vgenerator.generateCells()},n.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},n.prototype.getVirtualData=function(e){if(this.isNormaledit){var t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData);if(e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis,t)return;this.virtualData=i.length?this.virtualData:e.virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd,e.isCancel=this.isCancel}},n.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},n.prototype.editCancel=function(e){var i=Ie(this.parent,e.data);t.isNullOrUndefined(i)||(e.data=this.parent.getCurrentViewRecords()[i])},n.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},n.prototype.updateCurrentViewData=function(e){var i=Ie(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[i]=e)},n.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel||this.parent.notify("refresh-virtual-frozenrows",e)},n.prototype.virtualCellFocus=function(e){var i=document.activeElement;if(i.classList.contains(bi)&&e&&("upArrow"===e.action||"downArrow"===e.action)){var r=parseInt(i.parentElement.getAttribute(Hi),10);if(e&&("downArrow"===e.action||"upArrow"===e.action)){var n=this.parent.getContent().firstElementChild;"downArrow"===e.action?r+=1:r-=1,this.rowIndex=r,this.cellIndex=parseInt(i.getAttribute(qi),10);var o=this.parent.getRowByIndex(r),s=this.parent.pageSettings.currentPage,l=Math.floor(n.offsetHeight/this.parent.getRowHeight())-1,a=!1;t.isNullOrUndefined(o)&&(a=!0,("downArrow"===e.action&&s===this.maxPage-1||"upArrow"===e.action&&1===s)&&(a=!1)),a||xe(o,this.parent)&&"downArrow"===e.action||Fe(o,2*this.parent.getRowHeight())&&"upArrow"===e.action?(this.activeKey=e.action,n.scrollTop="downArrow"===e.action?(r-l)*this.parent.getRowHeight():r*this.parent.getRowHeight()):this.activeKey=this.empty,this.parent.selectRow(r)}}},n.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var i=t.extend({},this.getRowObjectByIndex(e.index)),r=Object.keys(this.virtualData);e.data=r.length?this.virtualData:i,e.isScroll=0!==r.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis},n.prototype.refreshCache=function(e){var t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize()),i=this.editedRowIndex-(t-1)*this.getBlockSize();this.vgenerator.cache[t][i].data=e,this.vgenerator.movableCache[t]&&(this.vgenerator.movableCache[t][i].data=e),this.vgenerator.frozenRightCache[t]&&(this.vgenerator.frozenRightCache[t][i].data=e)},n.prototype.actionComplete=function(e){var t=["delete","save","cancel"],i=["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"];t.some(function(t){return t===e.requestType})&&(this.refreshOffsets(),this.parent.isFrozenGrid()?(this.vgenerator.refreshColOffsets(),this.parent.contentModule.virtualRenderer.virtualEle.setVirtualHeight()):this.refreshVirtualElement()),this.isNormaledit&&(i.some(function(t){return t===e.requestType})||t.some(function(t){return t===e.requestType}))&&(this.isCancel=!0,this.isAdd=!1,this.editedRowIndex=this.empty,this.virtualData={},this.parent.editModule&&(this.parent.editModule.editModule.previousData=void 0)),this.parent.enableColumnVirtualization&&"filterafteropen"===e.requestType&&this.currentInfo.columnIndexes&&this.currentInfo.columnIndexes[0]>0&&this.parent.resetFilterDlgPosition(e.columnName)},n.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},n.prototype.scrollAfterEdit=function(){if(this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")){var e=this.parent.element.querySelector("."+Ai),i=this.parent.element.querySelector("."+Bi);if(e||i){var r=e?t.extend({},this.getRowObjectByIndex(this.editedRowIndex)):t.extend({},this.emptyRowData),n=Object.keys(this.virtualData);this.virtualData=n.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(r)}}},n.prototype.createEmptyRowdata=function(){var e=this;this.parent.columnModel.filter(function(t){e.emptyRowData[t.field]=e.empty})},n.prototype.addActionBegin=function(e){if(this.isNormaledit){Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0;var t=this.parent.pageSettings.currentPage;!this.parent.frozenRows&&this.content.scrollTop>0&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t<this.maxPage-1&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.parent.setProperties({pageSettings:{currentPage:this.maxPage-1}},!0),e.startEdit=!1,this.content.scrollTop=this.offsets[this.offsetKeys.length])}},n.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!1,!0)},n.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},n.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},n.prototype.isEndBlock=function(e){var t=this.getTotalBlocks();return e>=t||e===t-1},n.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getBlockSize()<1?1:e.length/this.getBlockSize())},n.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getBlockSize())},n.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[e]},n.prototype.getModelGenerator=function(){return new oo(this.parent)},n.prototype.resetScrollPosition=function(e){this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0),"virtualscroll"!==e&&(this.isAdd=!1)},n.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},n.prototype.getRows=function(){return this.vgenerator.getRows()},n.prototype.getRowByIndex=function(e){var t;return ce(this.parent)&&(t=this.parent.getDataRows()[e]),this.prevInfo&&(t=this.getRowCollection(e,!1)),t},n.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!0)},n.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},n.prototype.getRowCollection=function(e,t,i,r){var n=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize(),o=t?this.parent.getMovableDataRows():this.parent.getDataRows();o=r?this.parent.getFrozenRightDataRows():o;var s=(i?this.parent.getCurrentViewRecords():o)[e-n];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(s=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[e].data:s:e<=this.parent.frozenRows?o[e]:o[e-n+this.parent.frozenRows]),s},n.prototype.getVirtualRowIndex=function(e){return(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize()+e},n.prototype.refreshOffsets=function(){var e=this.parent,t=0,i=this.getBlockSize(),r=ce(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[r],this.maxBlock=r%2==0?r-2:r-1,this.offsets={};for(var n=Array.apply(null,Array(r)).map(function(){return++t}),o=0;o<n.length;o++){var s=(this.vgenerator.cache[n[o]]||[]).length,l=ce(this.parent)?e.vcRows.length%i:this.count%i,a=!ce(this.parent)&&n[o]in this.vgenerator.cache?s*this.parent.getRowHeight():l&&n[o]===r?l*this.parent.getRowHeight():this.getBlockHeight();this.offsets[n[o]]=(0|this.offsets[n[o]-1])+a,this.tmpOffsets[n[o]]=0|this.offsets[n[o]-1]}this.offsetKeys=Object.keys(this.offsets),ce(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},n.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},n.prototype.setVisible=function(e){var i,r,n=this.parent,o=this.parent.getFrozenColumns();o&&(i=[].slice.call(this.parent.getFrozenVirtualContent().querySelectorAll("col")),r=[].slice.call(this.parent.getMovableVirtualContent().querySelectorAll("col")));var s,l=[];(l=this.getRows()).some(function(e){return e.isDataRow&&(s=e),e.isDataRow});var a=!0;!n.groupSettings.columns.length&&s&&(a=!1);for(var h=n.getDataRows(),d=0,c=e.length;d<c;d++){var p=e[d],u=n.getNormalizedColumnIndex(p.uid),g=!0===p.visible?"":"none",f=void 0;if(i&&r?u>=o?(f=r,h=this.parent.getMovableRows(),u-=o):f=i:f=this.getColGroup().children,-1!==u&&s&&u<s.cells.length&&t.setStyleAttribute(f[u],{display:g}),!a){var m=void 0;(m=p.visible?this.virtualEle.wrapper.offsetWidth+parseInt(p.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(p.width.toString(),10))>n.width?(this.setDisplayNone(h,u,g,l),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(m+""),this.refreshVirtualElement()):a=!0}!this.parent.invokedFromMedia&&p.hideAtMedia&&this.parent.updateMediaColumns(p),this.parent.invokedFromMedia=!1}a||o?this.refreshContentRows({requestType:"refresh"}):this.parent.notify("partial-refresh",{rows:l,args:{isFrozen:!1,rows:l}})},n.prototype.selectVirtualRow=function(e){var i=this;if(e.isAvailable=e.selectedIndex<this.count,e.isAvailable&&!this.isContextMenuOpen&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey&&!this.isSelection&&!this.requestTypes.some(function(e){return e===i.requestType})&&!this.parent.selectionModule.isInteracted){var r=this.parent.getRowByIndex(e.selectedIndex),n=this.parent.getRowHeight();if(!r||!this.isRowInView(r)){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var o=(e.selectedIndex+1)*n;if(!t.isNullOrUndefined(o)){var s=this.content.scrollTop<o?"down":"up";this.selectRowIndex=e.selectedIndex,this.content.scrollTop=o,this.isSelectionScroll=this.observer.check(s)}}}this.parent.isFrozenGrid()&&this.requestType?this.parent.getTablesCount()===this.frzIdx?(this.requestType=this.empty,this.frzIdx=1):this.frzIdx++:this.requestType=this.empty},n.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t>=this.content.getBoundingClientRect().top&&i<=this.content.getBoundingClientRect().bottom},n}(Yi),ao=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.virtualEle=new ho,r.isMovable=!1,r.gen=new oo(r.parent),r.parent.on(Wt,r.setVisible,r),r.parent.on($t,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?r.refreshUI():null},r),r}return so(i,e),i.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Fi))),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+Fi),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.virtualEle.renderPlaceHolder("absolute")},i.prototype.appendContent=function(e){this.isMovable?(this.virtualEle.movableWrapper.appendChild(e),this.isMovable=!1):this.virtualEle.wrapper.appendChild(e)},i.prototype.refreshUI=function(){this.isMovable=this.parent.isFrozenGrid(),this.setFrozenTable(this.parent.getMovableVirtualContent()),this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Fi))),e.prototype.refreshUI.call(this),this.setFrozenTable(this.parent.getFrozenVirtualContent())},i.prototype.setVisible=function(e){var i,r,n,o,s,l=this.parent,a=this.parent.getFrozenColumns();a&&(o=[].slice.call(this.parent.getFrozenVirtualHeader().querySelectorAll("col")),s=[].slice.call(this.parent.getMovableVirtualHeader().querySelectorAll("col")));for(var h=0,d=e.length;h<d;h++){var c=e[h];r=l.getNormalizedColumnIndex(c.uid),i=c.visible?"":"none";var p=void 0;if(o&&s?r>=a?(p=s,r-=a):p=o:p=this.getColGroup().children,t.setStyleAttribute(p[r],{display:i}),l.enableColumnVirtualization&&!l.groupSettings.columns.length){var u=void 0;(u=c.visible?this.virtualEle.wrapper.offsetWidth+parseInt(c.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(c.width.toString(),10))>l.width?(this.setDisplayNone(c,i),this.virtualEle.setWrapperWidth(u+""),this.gen.refreshColOffsets()):n=!0}else n=!0;n&&!a&&this.refreshUI()}a&&this.parent.notify(Kt,{})},i.prototype.setFrozenTable=function(e){this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()&&this.parent.contentModule.setTable(e.querySelector("."+Mi))},i.prototype.setDisplayNone=function(e,i){var r=this.parent.isFrozenGrid(),n=this.getTable();r&&"movable"===e.getFreezeTableName()&&(n=this.parent.getMovableVirtualHeader().querySelector("."+Mi));for(var o=0,s=[].slice.apply(n.querySelectorAll("th.e-headercell"));o<s.length;o++){var l=s[o];if(l.querySelector("[e-mappinguid]")&&l.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===e.uid){t.setStyleAttribute(l,{display:i}),""===i&&t.removeClass([l],"e-hide");break}}},i}(Zi),ho=function(){function e(){}return e.prototype.renderWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)}),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},e.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=t.createElement("div",{className:"e-virtualtrack",styles:"position:"+e}),this.content.appendChild(this.placeholder)},e.prototype.renderFrozenWrapper=function(e){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)+"; display: flex"}),this.content.appendChild(this.wrapper)},e.prototype.renderFrozenPlaceHolder=function(){this.placeholder=t.createElement("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},e.prototype.renderMovableWrapper=function(e){this.movableWrapper=t.createElement("div",{className:"e-virtualtable",styles:"min-height:"+t.formatUnit(e)}),this.movableContent.appendChild(this.movableWrapper)},e.prototype.renderMovablePlaceHolder=function(){this.movablePlaceholder=t.createElement("div",{className:"e-virtualtrack"}),this.movableContent.appendChild(this.movablePlaceholder)},e.prototype.adjustTable=function(e,t){this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.adjustMovableTable=function(e,t){this.movableWrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.setMovableWrapperWidth=function(e,t){this.movableWrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setMovableVirtualHeight=function(e,t){this.movablePlaceholder.style.height=e+"px",this.movablePlaceholder.style.width=t},e.prototype.setWrapperWidth=function(e,t){this.wrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=e+"px",this.placeholder.style.width=t},e.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""},e}(),co=function(){function i(e,t){this.parent=e,this.locator=t,this.addEventListener()}return i.prototype.getModuleName=function(){return"virtualscroll"},i.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var t=this.locator.getService("rendererFactory");this.parent.isFrozenGrid()||(this.parent.enableColumnVirtualization&&t.addRenderer(e.RenderType.Header,new ao(this.parent,this.locator)),t.addRenderer(e.RenderType.Content,new lo(this.parent,this.locator))),this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=this.parent.height.toString().indexOf("%")<0?this.parent.height:this.parent.element.getBoundingClientRect().height;this.blockSize=~~(t/e);var i=2*this.blockSize,r=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:r<i?i:r}},!0)},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Mt,this.instantiateRenderer,this),this.parent.on("column-width-changed",this.refreshVirtualElement,this),this.parent.on("create-virtual-validation-form",this.createVirtualValidationForm,this),this.parent.on("validate-virtual-form",this.virtualEditFormValidation,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Mt,this.instantiateRenderer),this.parent.off("column-width-changed",this.refreshVirtualElement),this.parent.off("create-virtual-validation-form",this.createVirtualValidationForm),this.parent.off("validate-virtual-form",this.virtualEditFormValidation))},i.prototype.getCurrentEditedData=function(e){var i={virtualData:t.extend({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify(pi,i),i.virtualData},i.prototype.createVirtualValidationForm=function(e){var i=this.parent;if(i.enableVirtualization&&"Normal"===i.editSettings.mode){var r=i.columns,n=new Vi(this.locator,null,this.parent),o=t.extend({},{},i.getRowObjectFromUID(e.uid),!0);i.notify("refresh-virtual-editform-cells",o);var s=e.argsCreator(this.getCurrentEditedData(e.prevData),{},!1);s.isCustomFormValidation=!0,s.row=n.render(o,r),e.renderer.update(s);for(var l={},a=0;a<r.length;a++)r[a].visible&&r[a].validationRules&&Ue(r[a],0,l,{},{},r.length,!0);s.form.classList.add("e-virtual-validation"),i.editModule.virtualFormObj=i.editModule.createFormObj(s.form,l)}},i.prototype.virtualEditFormValidation=function(e){var i=this.parent,r=i.element.querySelector('.e-griderror:not([style*="display: none"])');if(i.editModule.virtualFormObj)if(r&&"none"!==r.style.display){var n=r.getBoundingClientRect(),o=i.element.querySelectorAll(".e-gridform"),s=o[0],l=i.getContent().getBoundingClientRect().left;if(o.length>1&&(s="Right"!==i.getFrozenMode()?o[1]:o[0],l=i.getMovableVirtualContent().getBoundingClientRect().left),n.left<l||n.right>i.element.offsetWidth){d=s.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(d,{editIdx:e.editIdx,addIdx:e.addIdx},!0)}}else if(i.editModule.virtualFormObj&&(!r||"none"===r.style.display)){for(var a=i.editModule.virtualFormObj.element.querySelectorAll('.e-tooltip-wrap:not([style*="display: none"])'),h=0;h<a.length;h++)t.remove(a[h]);if(this.setEditedDataToValidationForm(i.editModule.virtualFormObj.element,this.getCurrentEditedData(e.prevData)),e.isValid=i.editModule.virtualFormObj.validate(),!e.isValid){var d=i.editModule.virtualFormObj.element.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(d,{editIdx:e.editIdx,addIdx:e.addIdx})}}},i.prototype.scrollToEdit=function(e,i,r){var n=this.parent;if(e){var o=n.columnModel,s=K(e.id).split("_")[0],l=n.getColumnByField(s),a=this.parent.getContent().firstElementChild.scrollTop,h=n.getRowByIndex(i.editIdx);if(r||!l||!t.isNullOrUndefined(i.addIdx)&&a>0||!t.isNullOrUndefined(i.editIdx)&&!h){for(var d=void 0,c=0;c<o.length&&!l;c++)if(o[c].field===s){d=o[c];break}r&&(d=l),this.parent.notify("scroll-to-edit",d)}}},i.prototype.setEditedDataToValidationForm=function(e,i){this.parent;for(var r=[].slice.call(e.getElementsByClassName("e-field")),n=0,o=r.length;n<o;n++){var s=Ye(this.parent,r[n].getAttribute("e-mappinguid")),l=t.getValue(s.field,i);l=t.isNullOrUndefined(l)?"":l,r[n].value=l}},i.prototype.refreshVirtualElement=function(t){this.parent.enableColumnVirtualization&&"resize"===t.module&&this.locator.getService("rendererFactory").getRenderer(e.RenderType.Content).refreshVirtualElement()},i.prototype.destroy=function(){this.removeEventListener()},i}(),po=function(){function e(e){this.parent=e}return e.prototype.addNew=function(e,t){this.isEdit=!1;var i,r=je(this.parent),n=Ve(this.parent),o=this.parent.isFrozenGrid(),s=o&&this.parent.enableColumnVirtualization&&t.isScroll;if(i=this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition?s?this.parent.getMovableHeaderTbody():this.parent.getHeaderTable().querySelector(Ui):s?this.parent.getMovableContentTbody():this.parent.getContentTable().querySelector(Ui),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),i.querySelector(".e-emptyrow")){var l=i.querySelector(".e-emptyrow");if(l.parentNode.removeChild(l),o&&!s){var a=this.parent.getContent().querySelector("."+Ei).querySelector(Ui);if(a.firstElementChild.parentNode.removeChild(a.firstElementChild),this.parent.getFrozenMode()===Pi){var h=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector(Ui);h.firstElementChild.parentNode.removeChild(h.firstElementChild)}}}if("Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.editModule.checkLastRow(t.row,t),o&&!s){var d=this.renderMovableform(t.row,t);if("Top"===this.parent.editSettings.newRowPosition?r.insertBefore(d,r.firstChild):r.appendChild(d),t.row.querySelector(".e-normaledit").setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),d.setAttribute("colspan",""+(this.parent.getVisibleColumns().length-this.parent.getVisibleFrozenColumns())),n){var c=this.renderFrozenRightForm(t.row,t);"Top"===this.parent.editSettings.newRowPosition?n.insertBefore(c,n.firstChild):n.appendChild(c);var p=this.parent.getVisibleFrozenColumns()-this.parent.getFrozenRightColumnsCount();t.row.querySelector(".e-normaledit").setAttribute("colspan",p+""),c.querySelector(".e-normaledit").setAttribute("colspan",""+this.parent.getFrozenRightColumnsCount())}"auto"===this.parent.height&&this.parent.notify("frozenHeight",{})}},e.prototype.renderFrozenRightForm=function(e,t){var i=e.cloneNode(!0),r=t.frozenRightForm=i.querySelector("form");return this.parent.editSettings.template?(r.innerHTML="",this.appendChildren(r,t.rowData,!1),i):(this.renderRightFrozen(e,i),i.querySelector(ji).innerHTML=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji).innerHTML,i)},e.prototype.renderMovableform=function(e,t){var i=e.cloneNode(!0),r=t.movableForm=i.querySelector("form");return this.parent.editSettings.template?(r.innerHTML="",this.appendChildren(r,t.rowData,!1),i):(this.renderMovable(e,i),i.querySelector(ji).innerHTML=this.parent.getHeaderContent().querySelector("."+Ii).querySelector(ji).innerHTML,i)},e.prototype.updateFreezeEdit=function(e,t){return t=t.concat([].slice.call(this.getFreezeRow(e).querySelectorAll("td.e-rowcell"))),this.parent.getFrozenMode()===Pi&&(t=t.concat([].slice.call(this.getFreezeRightRow(e).querySelectorAll("td.e-rowcell")))),t},e.prototype.getFreezeRightRow=function(e){var t=parseInt(e.getAttribute(Hi),10),i=this.parent.getFrozenLeftContentTbody(),r=this.parent.getFrozenHeaderTbody(),n=this.parent.getFrozenRightHeaderTbody(),o=this.parent.getFrozenRightContentTbody();return i.contains(e)||r.contains(e)?this.parent.getFrozenRightRowByIndex(t):o.contains(e)||n.contains(e)?this.parent.getRowByIndex(t):e},e.prototype.getFreezeRow=function(e){if(this.parent.isFrozenGrid()){var t=parseInt(e.getAttribute(Hi),10),i=this.parent.getFrozenLeftContentTbody(),r=this.parent.getMovableContentTbody(),n=this.parent.getFrozenHeaderTbody(),o=this.parent.getMovableHeaderTbody();if(i.contains(e)||n.contains(e))return this.parent.getMovableRowByIndex(t);if(r.contains(e)||o.contains(e))return this.parent.getRowByIndex(t)}return e},e.prototype.update=function(e,i){this.isEdit=!0;var r=i.isCustomFormValidation,n=i.isScroll;n||!t.closest(i.row,"."+Ei)&&!t.closest(i.row,"."+Ii)||(i.row=this.getFreezeRow(i.row)),(t.closest(i.row,".e-frozen-right-content")||t.closest(i.row,".e-frozen-right-header"))&&(i.row=this.getFreezeRightRow(i.row));var o=this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&n,s=[].slice.call(i.row.querySelectorAll("td.e-rowcell"));i.row.innerHTML="",o||r||(s=this.updateFreezeEdit(i.row,s)),i.row.appendChild(this.getEditElement(e,!0,s,i,!0)),i.row.classList.add(Ai),this.parent.editModule.checkLastRow(i.row,i),o||r||this.refreshFreezeEdit(i.row,i)},e.prototype.refreshFreezeEdit=function(e,i){var r=e.firstChild;this.parent.getVisibleFrozenColumns()&&this.parent.editSettings.template&&(r.querySelector(ji).innerHTML=this.parent.getHeaderContent().querySelector("."+zi).querySelector(ji).innerHTML);var n,o,s=parseInt(e.getAttribute(Hi),10);if(this.parent.isFrozenGrid()){s<this.parent.frozenRows?(o=this.parent.getHeaderContent(),n="."+zi):(o=this.parent.getContent(),n="."+Ti);var l=r.cloneNode(!0),a=r.cloneNode(!0),h=i.movableForm=l.querySelector("form");this.parent.editSettings.template&&this.refreshEditForm(h,i.rowData);var d=void 0,c=void 0;o.querySelector(n).contains(e)?(d=this.parent.getMovableRowByIndex(s),this.updateFrozenCont(d,r,l),this.parent.getFrozenMode()===Pi&&(i.frozenRightForm=a.querySelector("form"),this.refreshEditForm(i.frozenRightForm,i.rowData),c=this.parent.getFrozenRightRowByIndex(s),this.updateFrozenRightCont(c,r,a))):(d=this.parent.getRowByIndex(s),this.updateFrozenCont(d,l,r),this.parent.getFrozenMode()===Pi&&(i.frozenRightForm=a.querySelector("form"),this.refreshEditForm(i.frozenRightForm,i.rowData),c=this.parent.getFrozenRightRowByIndex(s),this.updateFrozenRightCont(c,a,r))),t.isBlazor()&&this.parent.isServerRendered?(i.cloneFrozen.appendChild(l),i.cloneFrozen.classList.add(Ai)):(d.appendChild(l),d.classList.add(Ai),this.parent.getFrozenMode()===Pi&&(c.appendChild(a),c.classList.add(Ai),Re(i.frozenRightForm.querySelector("td:not(.e-hide)"),i.form.querySelector("td:not(.e-hide)")))),Re(i.movableForm.querySelector("td:not(.e-hide)"),i.form.querySelector("td:not(.e-hide)"))}},e.prototype.refreshEditForm=function(e,t){this.parent.editSettings.template&&(e.innerHTML="",this.appendChildren(e,t,!1))},e.prototype.updateFrozenRightCont=function(e,t,i){e.innerHTML="",this.renderRightFrozen(t,i),i.querySelector(ji).innerHTML=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji).innerHTML,t.setAttribute("colspan",this.parent.getVisibleFrozenColumns()-this.parent.getFrozenRightColumnsCount()+""),i.setAttribute("colspan",this.parent.getFrozenRightColumnsCount()+"")},e.prototype.updateFrozenCont=function(e,t,i){e.innerHTML="",this.renderMovable(t,i),i.querySelector(ji).innerHTML=this.parent.getHeaderContent().querySelector("."+Ii).querySelector(ji).innerHTML,t.setAttribute("colspan",this.parent.getVisibleFrozenColumns()+""),i.setAttribute("colspan",this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length-this.parent.getVisibleFrozenColumns()+"")},e.prototype.renderRightFrozen=function(e,t){t.querySelector("tr").innerHTML="";for(var i=this.parent.getColumns(),r=0,n=0;n<i.length;n++,r++)if(i[n].getFreezeTableName()===Ni){var o=r-this.parent.getMovableColumnsCount();t.querySelector("tr").appendChild(e.querySelector("tr").removeChild(e.querySelector("tr").children[o])),r--}},e.prototype.renderMovable=function(e,t){t.querySelector("tr").innerHTML="";for(var i=this.parent.getColumns(),r=0,n=0;n<i.length;n++,r++)"movable"===i[n].getFreezeTableName()&&(t.querySelector("tr").appendChild(e.querySelector("tr").removeChild(e.querySelector("tr").children[r])),r--)},e.prototype.getEditElement=function(e,i,r,n,o){var s=this.parent,l=0,a=t.isNullOrUndefined(s.detailTemplate)&&t.isNullOrUndefined(s.childGrid)?0:1;s.allowGrouping&&(l=s.groupSettings.columns.length);var h=this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(s.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length-s.getVisibleFrozenColumns()+this.parent.getIndentCount()).toString()}}),d=n.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)return this.appendChildren(d,n.rowData,o),h.appendChild(d),h;var c=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25"}});c.appendChild(s.getContentTable().querySelector(ji).cloneNode(!0));var p=this.parent.createElement(Ui),u=this.parent.createElement("tr"),g=0;for(a&&u.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),u.firstChild),s.isRowDragable()&&u.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));g<l;)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),g++;var f=0;g=0;for(var m=s.isFrozenGrid()&&s.enableColumnVirtualization&&n.isScroll,y=n.isCustomFormValidation?this.parent.columnModel:s.getColumns();i&&f<r.length&&g<y.length||g<y.length;){var v=i?r[f].getAttribute("colspan"):null,C=y[g];if(m&&"movable"!==C.getFreezeTableName()||n.isCustomFormValidation&&(C.commands||C.commandsTemplate||!C.field))g++;else{var w=this.parent.createElement("td",{className:bi,attrs:{style:"text-align:"+(C.textAlign?C.textAlign:""),colspan:v||""}});C.visible?(w.appendChild(e[C.uid]),"Vertical"===this.parent.rowRenderingMode&&(F(w,{"data-cell":C.headerText}),0===g&&w.classList.add("e-responsive-editcell")),"booleanedit"===C.editType?w.classList.add("e-boolcell"):(C.commands||C.commandsTemplate)&&t.addClass([w],"e-unboundcell")):w.classList.add("e-hide"),u.appendChild(w),g=v?g+parseInt(v,10):g+1,f++}}return p.appendChild(u),c.appendChild(p),d.appendChild(c),h.appendChild(d),h},e.prototype.removeEventListener=function(){},e.prototype.appendChildren=function(e,i,r){var n=this,o=t.extend({},i,{isAdd:!this.isEdit,isFrozen:r},!0),s=this.parent.element.id+"editSettingsTemplate";this.parent.isReact&&"string"!=typeof this.parent.editSettings.template?(this.parent.getEditTemplate()(o,this.parent,"editSettingsTemplate",s,null,null,e),this.parent.renderTemplates()):q(e,this.parent.getEditTemplate()(o,this.parent,"editSettingsTemplate",s));var l=function(){for(var e=n.parent.getColumns(),t=0;t<e.length;t++)e[t].validationRules&&(n.parent.editModule.formObj.rules[e[t].field]=e[t].validationRules)};t.updateBlazorTemplate(s,"Template",this.parent.editSettings,!0,l)},e}(),uo=function(){function e(e){this.parent=e}return e.prototype.update=function(e,i){if(this.parent.isReact&&i.columnObject&&i.columnObject.template){var r=i.cell.parentElement,n=i.cell.cloneNode(!0);r.insertBefore(n,r.children[parseInt(i.cell.getAttribute(qi),10)]),n.focus(),i.cell.remove(),i.cell=n}i.cell.innerHTML="",i.cell.appendChild(this.getEditElement(e,i)),i.cell.classList.remove("e-ellipsistooltip"),i.cell.classList.add("e-editedbatchcell"),t.classList(i.row,[Ai,"e-batchrow"],[])},e.prototype.getEditElement=function(e,t){var i=this.parent,r=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return r.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),r},e.prototype.removeEventListener=function(){},e}(),go=function(){function i(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(ri,this.destroy,this),this.parent.on(_t,this.destroy,this))}return i.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},i.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},i.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},i.prototype.createDialogHeader=function(t){var i=this.parent;if(this.parent.enableAdaptiveUI){var r=new Fr(this.parent,this.serviceLocator);return r.action=this.isEdit?e.ResponsiveDialogAction.isEdit:e.ResponsiveDialogAction.isAdd,r.renderResponsiveHeader(void 0,t)}return i.editSettings.headerTemplate?this.getDialogEditTemplateElement("HeaderTemplate",t):this.isEdit?this.l10n.getConstant("EditFormTitle")+t.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},i.prototype.createDialog=function(e,i){var n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper",styles:"width: auto"}),n.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),this.dialog.setAttribute("aria-label","Dialog edit"),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialogObj=new r.Dialog(t.extend({header:this.createDialogHeader(i),isModal:!0,visible:!0,cssClass:"e-edit-dialog",content:this.getEditElement(e,i),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),created:this.dialogCreated.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:i.target?i.target:document.body,animationSettings:{effect:"None"},footerTemplate:n.editSettings.footerTemplate?this.getDialogEditTemplateElement("FooterTemplate",i):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog?n.editSettings.dialog.params||{}:{})),i.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dialogObj.appendTo(this.dialog),Se(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},i.prototype.dialogCreated=function(){We(this.parent)},i.prototype.renderResponsiveDialog=function(){var e=this;this.parent.enableAdaptiveUI&&(this.parent.adaptiveDlgTarget&&(this.dialogObj.target=this.parent.adaptiveDlgTarget),this.dialogObj.buttons=[{}],this.dialogObj.showCloseIcon=!0,this.dialogObj.visible=!1,this.dialogObj.width="100%",this.dialogObj.open=function(){e.dialogObj.element.style.maxHeight="100%"})},i.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},i.prototype.dialogClose=function(){this.parent.closeEdit()},i.prototype.destroy=function(e){for(var i=["template","headerTemplate","footerTemplate"],r=0;r<i.length;r++)if(this.parent.editSettings[i[r]]){var n=i[r].charAt(0).toUpperCase()+i[r].slice(1),o=this.parent.element.id+"editSettings"+n;t.updateBlazorTemplate(o,n,this.parent.editSettings)}this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.parent.notify("toolbar-refresh",{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),t.remove(this.dialog))},i.prototype.getDialogEditTemplateElement=function(e,i){var r=this.parent.createElement("div",{className:"e-dialog"+e}),n=t.extend({},i.rowData,{isAdd:!this.isEdit},!0),o=this.parent.element.id+"editSettings"+e;return q(r,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(n,this.parent,"editSettings"+e,o)),t.updateBlazorTemplate(o,e,this.parent.editSettings),r},i.prototype.getEditElement=function(e,i){var r=this,n=this.parent,o=this.parent.createElement("div",{className:this.isEdit?Ai:"e-insertedrow"}),s=i.form=this.parent.createElement("form",{id:n.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template){var l=this.parent.element.id+"editSettingsTemplate",a=t.extend({},i.rowData,{isAdd:!this.isEdit},!0);this.parent.isReact&&"string"!=typeof this.parent.editSettings.template?(this.parent.getEditTemplate()(a,this.parent,"editSettingsTemplate",l,null,null,s),this.parent.renderTemplates()):q(s,this.parent.getEditTemplate()(a,this.parent,"editSettingsTemplate",l));var h=function(){for(var e=r.parent.getColumns(),t=0;t<e.length;t++)e[t].validationRules&&(r.parent.editModule.formObj.rules[e[t].field]=e[t].validationRules)};return t.updateBlazorTemplate(l,"Template",this.parent.editSettings,!0,h),o.appendChild(s),o}for(var d=this.parent.createElement("table",{className:Mi,attrs:{cellspacing:"6px"}}),c=this.parent.createElement(Ui),p=n.getColumns(),u=0;u<p.length;u++)if(!(this.parent.editModule.checkColumnIsGrouped(p[u])||p[u].commands||p[u].commandsTemplate||"checkbox"===p[u].type)){var g=this.parent.createElement("tr"),f=this.parent.createElement("td",{className:bi,attrs:{style:"text-align:"+(this.parent.enableRtl?"right":"left")+";width:190px"}});e[p[u].uid].classList.remove("e-input"),f.appendChild(e[p[u].uid]),g.appendChild(f),c.appendChild(g)}return d.appendChild(c),s.appendChild(d),o.appendChild(s),o},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ri,this.destroy),this.parent.off(_t,this.destroy))},i}(),fo=function(){function i(e,t){this.editType={Inline:po,Normal:po,Batch:uo,Dialog:go},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}return i.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},i.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),e.isCustomFormValidation||(this.parent.notify("edit-form",e),this.convertWidget(e))},i.prototype.convertWidget=function(e){var i,r,n,o,s=this.parent,l=s.isFrozenGrid(),a="Right"===s.getFrozenMode()&&"Normal"===s.editSettings.mode?1:0,h="Dialog"===s.editSettings.mode?t.select("#"+s.element.id+"_dialogEdit_wrapper .e-gridform",document):s.element.getElementsByClassName("e-gridform")[a],d=l&&this.parent.enableColumnVirtualization&&e.isScroll;if(l&&"Normal"===s.editSettings.mode){var c=parseInt(e.row.getAttribute(Hi),10);s.frozenRows&&("add"===e.requestType&&"Top"===s.editSettings.newRowPosition||c<s.frozenRows)?(n=s.element.querySelector("."+Ii).querySelector(".e-gridform"),this.parent.getFrozenMode()===Pi&&(o=e.frozenRightForm)):(n=s.element.querySelector("."+Ei).querySelector(".e-gridform"),this.parent.getFrozenMode()===Pi&&(o=e.frozenRightForm))}for(var p=0,u="Batch"!==s.editSettings.mode?s.getColumns():[s.getColumnByField(e.columnName)];p<u.length;p++){var g=u[p];if(!d||"movable"===g.getFreezeTableName())if(!this.parent.editSettings.template||t.isNullOrUndefined(g.field)){if(!this.parent.editModule.checkColumnIsGrouped(g)&&!g.commands){g.valueAccessor(g.field,e.rowData,g),r="movable"===g.getFreezeTableName()&&"Normal"===s.editSettings.mode?n.querySelector("[e-mappinguid="+g.uid+"]"):o&&g.getFreezeTableName()===Ni&&"Normal"===s.editSettings.mode?o.querySelector("[e-mappinguid="+g.uid+"]"):h.querySelector("[e-mappinguid="+g.uid+"]");var f=g.edit.write;t.isNullOrUndefined(r)||("string"==typeof f?(f=pe(f,window))({rowData:e.rowData,element:r,column:g,requestType:e.requestType,row:e.row,foreignKeyData:g.isForeignColumn()&&pe(g.field,e.foreignKeyData)}):g.edit.write({rowData:e.rowData,element:r,column:g,requestType:e.requestType,row:e.row,foreignKeyData:g.isForeignColumn()&&pe(g.field,e.foreignKeyData)}),i||r.getAttribute("disabled")||O(r,"e-checkbox-disabled")||(this.focusElement(r,e.type),i=!0))}}else{var m=t.extend({},e);m.element=h.querySelector("[name="+W(g.field)+"]"),t.isNullOrUndefined(m.element)&&l&&(m.element=n.querySelector("[name="+W(g.field)+"]")),"string"==typeof g.edit.write?pe(g.edit.write,window)(m):g.edit.write(m)}}if(l&&!this.parent.allowTextWrap&&("add"===e.requestType||"beginEdit"===e.requestType)&&"Dialog"!==this.parent.editSettings.mode&&!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(n)){var y=n.querySelector("tr").children[0],v=h.querySelector("tr").children[0];if(v.offsetHeight>y.offsetHeight)y.style.height=v.offsetHeight+"px",o&&((C=n.querySelector("tr").children[0]).style.height=v.offsetHeight+"px");else if(v.style.height=y.offsetHeight+"px",o){var C=n.querySelector("tr").children[0];C.style.height=y.offsetHeight+"px"}}},i.prototype.focusElement=function(e,i){var r=this.parent.element.querySelector(".e-edit-checkselect");t.isNullOrUndefined(r)||r.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:t.closest(e,"td")},!0):!this.parent.enableVirtualization||"Normal"!==this.parent.editSettings.mode||this.parent.enableVirtualization&&"Bottom"===this.parent.editSettings.newRowPosition&&O(e,Bi)?e.focus():e.focus({preventScroll:!0}),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},i.prototype.getEditElements=function(i){var r=this.parent,n={},o="Batch"!==r.editSettings.mode?r.getColumns():[r.getColumnByField(i.columnName)];if(i.isCustomFormValidation&&(o=this.parent.columnModel),this.parent.editSettings.template)return{};for(var s=r.isFrozenGrid()&&r.enableColumnVirtualization&&i.isScroll,l=0,a=o.length;l<a;l++){var h=o[l];if(!(this.parent.editModule.checkColumnIsGrouped(h)||s&&"movable"!==o[l].getFreezeTableName()||i.isCustomFormValidation&&(h.commands||h.commandsTemplate||!h.field)))if(h.commands||h.commandsTemplate){var d=this.serviceLocator.getService("cellRendererFactory"),c=new Gi(this.parent),p=d.getCellRenderer(e.CellType.CommandColumn),u=c.generateRows(i.rowData)[0].cells.filter(function(e){return e.rowID}),g=p.render(u[l],i.rowData,{index:i.row?i.row.getAttribute(Hi):0},this.parent.enableVirtualization);(w=g.firstElementChild).setAttribute("textAlign",g.getAttribute("textAlign")),n[h.uid]=w}else{var f={column:h,value:h.valueAccessor(h.field,i.rowData,h),type:i.requestType,data:i.rowData},m=h.edit.create,y=void 0;if(h.editTemplate){y=this.parent.createElement("span",{attrs:{"e-mappinguid":h.uid}});var v=this.parent.element.id+h.uid+"editTemplate",C=me({},i.rowData,{column:h});this.parent.isReact&&"string"!=typeof h.editTemplate?(h.getEditTemplate()(t.extend({index:i.rowIndex},C),this.parent,"editTemplate",v,null,null,y),this.parent.renderTemplates()):q(y,h.getEditTemplate()(t.extend({index:i.rowIndex},C),this.parent,"editTemplate",v))}else{if("string"==typeof(y="string"==typeof m?(m=pe(m,window))(f):h.edit.create(f))){var w=this.parent.createElement("div");w.innerHTML=y,y=w.firstChild}var b="input"!==y.tagName&&y.querySelectorAll("input").length,S=W(h.field);t.attributes(b?y.querySelector("input"):y,{name:S,"e-mappinguid":h.uid,id:r.element.id+S}),t.classList(y,["e-input","e-field"],[]),"Right"===h.textAlign&&y.classList.add("e-ralign"),((h.isPrimaryKey||h.isIdentity)&&"beginEdit"===i.requestType||h.isIdentity&&"add"===i.requestType)&&y.setAttribute("disabled","")}n[h.uid]=y}}return n},i.prototype.destroy=function(){this.renderer.removeEventListener()},i}(),mo=function(){function e(e){this.parent=e}return e.prototype.create=function(e){return Je(this.parent,e.column,"e-field",{type:"text"})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),yo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vo=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return yo(i,e),i.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),Je(this.parent,e.column,t,{type:"checkbox",value:e.value})},i.prototype.read=function(e){return e.checked},i.prototype.write=function(e){var i,r;if(t.isNullOrUndefined(e.row)||(i=e.row.querySelector(".e-edit-checkselect")),pe(e.column.field,e.rowData)&&(r=JSON.parse(pe(e.column.field,e.rowData).toString().toLowerCase())),!t.isNullOrUndefined(i)&&"checkbox"===e.column.type){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var o=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));r=!!o&&o.isSelected}Z.apply(void 0,[[].slice.call(e.row.getElementsByClassName(bi)),r].concat(this.activeClasses))}this.obj=new n.CheckBox(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:r,disabled:!Q(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.checkBoxChange.bind(this)},e.column.edit.params)),this.obj.appendTo(e.element)},i.prototype.checkBoxChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),Z.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(bi)),t].concat(this.activeClasses))}},i}(mo),Co=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wo=function(e){function r(t){var i=e.call(this)||this;return i.parent=t,i.flag=!1,i}return Co(r,e),r.prototype.write=function(e){var r="Dialog"!==this.parent.editSettings.mode;this.column=e.column;var n=new i.Predicate(e.column.field,"notequal",null,!0,!1),o={};if(e.column.edit.params)for(var l=Object.keys(e.column.edit.params),a=0;a<l.length;a++)o[l[a]]="query"===l[a]?e.column.edit.params[l[a]].clone():e.column.edit.params[l[a]];this.obj=new s.DropDownList(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).where(n).select(e.column.field),enabled:Q(e.column,e.requestType,e.element),fields:{value:e.column.field},value:pe(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.ddActionComplete.bind(this),created:this.dropdownCreated.bind(this),placeholder:r?"":e.column.headerText,popupHeight:"200px",floatLabelType:r?"Never":"Always",open:this.dropDownOpen.bind(this),sortOrder:"Ascending",beforeOpen:this.dropdownBeforeOpen.bind(this)},o)),this.parent.enableVirtualization&&(this.obj.dataSource=[e.rowData]),this.obj.query.params=this.parent.query.params,this.obj.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},r.prototype.dropdownCreated=function(e){this.flag=!0},r.prototype.dropdownBeforeOpen=function(){this.parent.enableVirtualization&&(this.obj.dataSource=this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource))},r.prototype.ddActionComplete=function(e){e.result=i.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.flag&&this.column.dataSource&&("result"in this.column.dataSource?this.column.dataSource.result=e.result:this.column.dataSource instanceof i.DataManager&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},r.prototype.dropDownOpen=function(e){var i=O(this.obj.element,"e-dialog");if("Dialog"===this.parent.editSettings.mode&&!t.isNullOrUndefined(i)){var r=t.select("#"+i.id,document).ej2_instances[0];e.popup.element.style.zIndex=(r.zIndex+1).toString()}},r}(mo),bo=function(){function e(e){this.parent=e}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){return this.instances=new t.Internationalization(this.parent.locale),Je(this.parent,e.column,"e-field",{})},e.prototype.read=function(e){return this.obj.value},e.prototype.write=function(e){var i=e.column,r="Dialog"!==this.parent.editSettings.mode;this.obj=new o.NumericTextBox(t.extend({value:parseFloat(pe(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:r?"":e.column.headerText,enabled:Q(e.column,e.requestType,e.element),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale},i.edit.params)),e.element.setAttribute("name",W(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy())},e}(),So=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ro=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return So(i,e),i.prototype.create=function(e){var i={type:"text",value:t.isNullOrUndefined(e.value)?"":e.value,style:"text-align:"+e.column.textAlign};return Je(this.parent,e.column,"e-field e-input e-defaultcell",i)},i.prototype.read=function(e){return e.value},i.prototype.write=function(e){var i=e.column,r="Dialog"!==this.parent.editSettings.mode;this.obj=new o.TextBox(t.extend({element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:Q(e.column,e.requestType,e.element),placeholder:r?"":e.column.headerText},i.edit.params)),this.obj.appendTo(e.element)},i}(mo),xo=function(){function e(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}return e.prototype.clickHandler=function(e){var t=e.target,i=this.parent;(O(t,Ri)&&O(O(t,Ri),"e-grid").id===i.element.id||i.frozenRows&&O(t,Fi))&&!O(t,"e-unboundcelldiv")&&(this.rowIndex=O(t,bi)?parseInt(t.parentElement.getAttribute(Hi),10):-1,i.isEdit&&i.editModule.endEdit())},e.prototype.dblClickHandler=function(e){O(e.target,bi)&&this.parent.editSettings.allowEditOnDblClick&&this.parent.editModule.startEdit(O(e.target,Oi))},e.prototype.editComplete=function(e){this.parent.isEdit=!1;switch(e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"!==e.action&&this.parent.selectRow(0),this.parent.trigger(St,t.extend(e,{requestType:"save",type:St}));break;case"delete":this.parent.trigger(St,t.extend(e,{requestType:"delete",type:St})),this.parent.isCheckBoxSelection||this.parent.selectRow(this.editRowIndex)}},e.prototype.getEditArgs=function(e,t,i){for(var r=this.parent.getPrimaryKeyFieldNames(),n=[],o=0;o<r.length;o++)n.push(pe(r[o],e));return{primaryKey:r,primaryKeyValue:n,requestType:"beginEdit",rowData:e,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData,target:void 0,isScroll:i}},e.prototype.startEdit=function(e){var i=this,r=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(e.getAttribute(Hi),10),r.enableVirtualization||r.enableInfiniteScrolling){var n='.e-row[aria-rowindex="'+this.rowIndex+'"]';if(!this.parent.element.querySelector(n))return}var o={data:void 0,index:this.rowIndex,isScroll:!1};if(this.parent.notify("virtual-scroll-edit-action-begin",o),ce(r)){var s=r.getRowObjectFromUID(e.getAttribute("data-uid"));this.previousData=s.data}else this.previousData||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling?this.parent.enableVirtualization||(this.previousData=t.extend({},{},r.getCurrentViewRecords()[this.rowIndex],!0)):this.previousData=o.data;var l=t.extend({},{},o.data||this.previousData,!0);this.uid=e.getAttribute("data-uid");var a=r.getRowObjectFromUID(this.uid),h=this.getEditArgs(l,a,o.isScroll);h.row=e,h.isScroll?this.inlineEditHandler(h,e):(this.parent.notify("create-virtual-validation-form",{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),r.trigger("beginEdit",h,function(t){t.type="actionBegin",r.trigger(bt,t,function(t){t.cancel||i.inlineEditHandler(t,e)})}))},e.prototype.inlineEditHandler=function(e,t){var i=this.parent;i.isEdit=!0,e.row=e.row?e.row:t,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,e.row.classList.add("e-dlgeditrow")),this.renderer.update(e),this.uid=t.getAttribute("data-uid"),i.editModule.applyFormValidation(),e.type="actionComplete",i.trigger(St,e),this.args=e,this.parent.allowTextWrap&&this.parent.notify(oi,{case:"textwrap"})},e.prototype.updateRow=function(e,t){var i=this,r=this.parent;this.editRowIndex=e;var n={requestType:"save",action:"edit",type:bt,data:t,cancel:!1,previousData:r.getCurrentViewRecords()[e],row:r.getRowByIndex(e)};r.showSpinner(),r.notify(ti,n),n.promise?n.promise.then(function(){return r.refresh()}).catch(function(e){return i.edFail(e)}):r.refresh()},e.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.editFormValidate(),i={prevData:this.previousData,isValid:!0,editIdx:this.editRowIndex,addIdx:this.addedRowIndex};return e.notify("validate-virtual-form",i),t&&i.isValid},e.prototype.endEdit=function(){var e=this.parent;if(this.parent.isEdit&&this.editFormValidate()){var i=t.extend({},{},this.previousData,!0),r=t.extend(this.args,{requestType:"save",type:bt,data:i,cancel:!1,previousData:this.previousData,selectedRow:e.selectedRowIndex,foreignKeyData:{}}),n="Right"===e.getFrozenMode()?1:0,o="Dialog"===e.editSettings.mode,s=t.select("#"+e.element.id+"_dialogEdit_wrapper",document),l=o?s.querySelector(".e-gridform"):e.element.getElementsByClassName("e-gridform")[n],a={virtualData:t.extend({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0};if(this.parent.notify(pi,a),(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&"Normal"===this.parent.editSettings.mode&&Object.keys(a.virtualData).length?this.parent.isEdit&&(this.currentVirtualData=i=r.data=a.virtualData):i=e.editModule.getCurrentEditedData(l,i),e.isFrozenGrid()&&"Normal"===e.editSettings.mode){var h=e.getMovableVirtualHeader().querySelector(".e-gridform"),d=e.getMovableVirtualContent().querySelector(".e-gridform"),c=[h||d],p=void 0,u=void 0,g=[];e.getFrozenMode()===Pi&&(p=e.getFrozenRightHeader().querySelector(".e-gridform"),u=e.getFrozenRightContent().querySelector(".e-gridform"),g=[p||u]),Be(this.parent,function(t,r){for(var n=0,o=r;n<o.length;n++){var s=o[n];s&&(i=e.editModule.getCurrentEditedData(s,i))}},[[],c,g])}var f=[].slice.call(e.element.getElementsByClassName(Ai)).length;if(a.isAdd||!Object.keys(this.currentVirtualData).length||f||(f=1),o?s.getElementsByClassName(Ai).length:f)r.action="edit",e.trigger(bt,r,function(t){t.cancel||(e.showSpinner(),e.notify(ti,t))});else if(r.action="add",r.selectedRow=0,r.index=this.addedRowIndex,e.notify("virtual-scroll-edit-success",{}),e.notify(Lt,r),this.addedRowIndex=null,r.cancel)return}},e.prototype.destroyElements=function(){var e=this.parent;e.editModule.destroyWidgets(),e.editModule.destroyForm(),this.parent.notify(ri,{})},e.prototype.editHandler=function(e){var t=this;e.promise?e.promise.then(function(i){return t.edSucc(i,e)}).catch(function(e){return t.edFail(e)}):this.editSuccess(e.data,e)},e.prototype.edSucc=function(e,t){this.editSuccess(e,t)},e.prototype.edFail=function(e){this.editFailure(e)},e.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},e.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode&&"add"!==e.action&&this.parent.selectionModule&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow"))},e.prototype.editSuccess=function(e,i){if(!(t.isNullOrUndefined(e)||e instanceof Array)){i.data=t.extend({},t.extend({},i.rowData,i.data),e)}this.requestSuccess(i),this.parent.trigger("beforeDataBound",i),i.type=St,this.parent.isEdit=!1,this.refreshRow(i.data),this.parent.notify("virtual-scroll-edit-success",i),this.parent.editModule.checkLastRow(i.row),this.parent.editModule.isLastRow=!1,this.updateCurrentViewData(i.data),this.blazorTemplate(),this.editRowIndex=null,this.parent.trigger(St,i),(!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.selectionSettings.checkboxOnly)&&"Dialog"!==this.parent.editSettings.mode&&this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex),this.parent.hideSpinner()},e.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow")),this.parent.isFrozenGrid()&&this.cloneFrozen&&(this.cloneFrozen.remove(),this.frozen.classList.remove("e-hiddenrow"))},e.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&t.updateBlazorTemplate(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var i=0;i<e.length;i++){var r=e[i];r.template&&t.updateBlazorTemplate(this.parent.element.id+r.uid,"Template",r,!1),r.editTemplate&&t.updateBlazorTemplate(this.parent.element.id+r.uid+"editTemplate","EditTemplate",r)}},e.prototype.editFailure=function(e){this.parent.trigger("actionFailure",{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e})},e.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-gridform");return!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t||(e=!1),e},e.prototype.refreshRow=function(e){var t=this.parent.isFrozenGrid(),i=new Vi(this.serviceLocator,null,this.parent),r=this.parent.getRowObjectFromUID(this.uid);if(r){r.changes=e,this.parent.notify("refresh-virtual-cache",e),se(r,this.parent.getForeignKeyColumns(),r.changes),this.needRefresh()&&i.refresh(r,this.parent.getColumns(),!0);var n=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+r.index+'"]'));if(t&&n.length)for(var o=0;o<n.length;o++){var s=n[o].getAttribute("data-uid");s!==this.uid&&((r=this.parent.getRowObjectFromUID(s)).changes=e,i.refresh(r,this.parent.getColumns(),!0),this.parent.editModule.checkLastRow(n[o]))}}},e.prototype.closeEdit=function(){var e=this;if(this.parent.isEdit){var i=this.parent,r=t.extend(this.args,{requestType:"cancel",type:bt,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex});i.notify("virtual-scroll-edit-cancel",r),this.blazorTemplate(),i.trigger(bt,r,function(t){if(!t.cancel){"Dialog"===e.parent.editSettings.mode&&e.parent.notify(ri,{}),i.isEdit=!1,e.stopEditStatus(),t.type=St,"Dialog"!==i.editSettings.mode&&e.refreshRow(t.data);var r=i.groupSettings.enableLazyLoading&&i.groupSettings.columns.length&&!i.getContentTable().querySelector("tr.e-emptyrow");i.getContentTable().querySelector("tr.e-emptyrow")||i.getContentTable().querySelector("tr.e-row")||r||i.renderModule.emptyRow(),"Dialog"!==i.editSettings.mode&&i.selectRow(e.rowIndex),i.trigger(St,t)}})}},e.prototype.addRecord=function(e,r){var n=this,o=this.parent;if(this.addedRowIndex=r=t.isNullOrUndefined(r)?0:r,e)return void o.notify(Lt,{requestType:"save",type:bt,data:e,selectedRow:0,action:"add",index:r});if(!o.isEdit){this.previousData={},this.uid="";var s=o.getColumns(),l={virtualData:{},isScroll:!1};this.parent.notify(pi,l);for(var a=0;a<s.length;a++)l.isScroll&&"movable"!==s[a].getFreezeTableName()||s[a].field&&i.DataUtil.setValue(s[a].field,s[a].defaultValue,this.previousData);var h={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:bt,index:r,rowData:this.previousData,target:void 0,isScroll:l.isScroll};(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(l.virtualData).length&&(h.data=h.rowData=l.virtualData),h.isScroll?this.inlineAddHandler(h):(this.parent.notify("create-virtual-validation-form",{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),o.trigger(bt,h,function(e){e.cancel||n.inlineAddHandler(e)}))}},e.prototype.inlineAddHandler=function(e){var t=this.parent;t.isEdit=!0,"Dialog"!==t.editSettings.mode&&t.clearSelection(),this.renderer.addNew(e),t.editModule.applyFormValidation(),e.type=St,e.row=t.element.querySelector("."+Bi),t.trigger(St,e),this.args=e},e.prototype.deleteRecord=function(e,i){if(this.editRowIndex=this.parent.selectedRowIndex,i){i=i instanceof Array?i:[i];var r=this.parent,n=Object.keys(i).length;e=e||this.parent.getPrimaryKeyFieldNames()[0];for(var o=0;o<n;o++)!function(t){var n,o,s=r.currentViewData.some(function(r){return o=r,i[t]===pe(e,r)||i[t]===r});i[t]=s?o:i[t][e]?i[t]:(n={},n[e]=i[t],n)}(o)}var s={requestType:"delete",type:bt,foreignKeyData:{},data:i||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};if(t.isNullOrUndefined(this.parent.commandDelIndex)||(s.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data),this.parent.enableVirtualization&&s.data.length>1){var l=this.parent.getSelectedRows()[0].getAttribute("data-uid");s.data=[this.parent.getRowObjectFromUID(l).data]}this.parent.notify(Lt,s)},e.prototype.stopEditStatus=function(){for(var e=this.parent,i=[].slice.call(e.element.getElementsByClassName(Bi)),r=[].slice.call(e.element.getElementsByClassName(Ai)),n=0;n<i.length;n++)t.remove(i[n]);for(n=0;n<r.length;n++)r[n].classList.remove(Ai)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:"crud-Action",handler:this.editHandler},{event:"double-tap",handler:this.dblClickHandler},{event:Gt,handler:this.clickHandler},{event:"recordAdded",handler:this.requestSuccess},{event:"dblclick",handler:this.dblClickHandler},{event:"delete-complete",handler:this.editComplete},{event:"save-complete",handler:this.editComplete},{event:"row-mode-change",handler:this.closeEdit},{event:"closeinline",handler:this.closeForm}],Xe(this.parent,this.evtHandlers,!0,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||Xe(this.parent,this.evtHandlers,!1)},e.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()},e}(),Fo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eo=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.renderer=r,n}return Fo(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(xo),Io=function(){function r(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}return r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Gt,handler:this.clickHandler},{event:"dblclick",handler:this.dblClickHandler},{event:jt,handler:this.onBeforeCellFocused},{event:"cellfocused",handler:this.onCellFocused},{event:"double-tap",handler:this.dblClickHandler},{event:Vt,handler:this.keyDownHandler},{event:"editNextValCell",handler:this.editNextValCell},{event:"closebatch",handler:this.closeForm}],Xe(this.parent,this.evtHandlers,!0,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(Rt,this.dataBoundFunction),this.parent.addEventListener("batchCancel",this.batchCancelFunction))},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(Xe(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(Rt,this.dataBoundFunction),this.parent.removeEventListener("batchCancel",this.batchCancelFunction))},r.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus()},r.prototype.dataBound=function(){this.parent.notify("toolbar-refresh",{})},r.prototype.destroy=function(){this.removeEventListener()},r.prototype.clickHandler=function(e){O(e.target,this.parent.element.id+"_add",!0)||(this.parent.isEdit&&t.closest(this.form,"td")!==t.closest(e.target,"td")&&(this.saveCell(),this.editNextValCell()),O(e.target,bi)&&!this.parent.isEdit&&this.setCellIdx(e.target))},r.prototype.dblClickHandler=function(e){var i=O(e.target,bi),r=O(e.target,Oi),n=r&&parseInt(r.getAttribute(Hi),10),o=i&&parseInt(i.getAttribute(qi),10);t.isNullOrUndefined(i)||t.isNullOrUndefined(n)||isNaN(o)||i.parentElement.classList.contains(Ai)||this.editCell(n,this.parent.getColumns()[o].field,this.isAddRow(n))},r.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action)>-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},r.prototype.onCellFocused=function(e){var t=this.parent.getFrozenLeftCount(),i=this.parent.getFrozenRightColumnsCount(),r=this.parent.getContent().querySelector("."+Ei),n=this.parent.getHeaderContent().querySelector("."+Ii),o=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(!e.byKey||o)return void(this.parent.isEdit&&o&&this.saveCell());var s=e.container.indexes,l=s[0],a=s[1];if(t&&(r.contains(e.element)||this.parent.frozenRows&&n.contains(e.element))&&(a+=t),i){var h=this.parent.getHeaderContent().querySelector(".e-frozen-right-header");(this.parent.getContent().querySelector(".e-frozen-right-content").contains(e.element)||this.parent.frozenRows&&h.contains(e.element))&&(a+=t+this.parent.getMovableColumnsCount())}this.parent.frozenRows&&e.container.isContent&&(l+=this.parent.frozenRows);var d=this.parent.isEdit;if(!this.parent.element.getElementsByClassName("e-popup-open").length)switch(d=d&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var c=this.parent.getColumns()[e.indexes[1]];c&&!this.parent.isEdit&&this.editCell(e.indexes[0],c.field),(d||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(l,a);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var p={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",p),!p.cancel&&d&&this.editCell(l,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(l,a),this.focus.focus()}},r.prototype.isAddRow=function(e){return this.parent.getDataRows()[e].classList.contains("e-insertedrow")},r.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[t].field,this.isAddRow(e))},r.prototype.closeEdit=function(){var e=this,t=this.parent,i=this.parent.getRowsObject(),r={cancel:!1,batchChanges:this.getBatchChanges()};if(t.notify("before-batch-cancel",r),!r.cancel){t.isEdit&&this.saveCell(!0),this.isAdded=!1,t.clearSelection();for(var n,o=Pe(this.parent),s=this,l=0;l<i.length;l++)!function(t){var r=!1,l=i[t].isDirty;Be(s.parent,function(i,n){(r=e.removeBatchElementChanges(n[t],l))&&n.splice(t,1)},o),r&&t--,n=t}(l),l=n;t.getContentTable().querySelector("tr.e-row")||t.renderModule.renderEmptyRow();var a={requestType:"batchCancel",rows:this.parent.getRowsObject()};t.notify("batchCancel",{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new vi({isDataRow:!0,cells:[new Ci({isDataCell:!0,visible:!0})]})]}),t.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),t.notify("toolbar-refresh",{}),this.parent.notify("tooltip-destroy",{}),a={requestType:"batchCancel",rows:this.parent.getRowsObject()},t.trigger("batchCancel",a)}},r.prototype.removeBatchElementChanges=function(e,i){var r=this.parent,n=new Vi(this.serviceLocator,null,this.parent),o=!1;if(i){e.isDirty=i;var s=r.getRowElementByUID(e.uid);if(s&&(s.classList.contains("e-insertedrow")?(t.remove(s),o=!0):(se(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,t.classList(s,[],["e-hiddenrow","e-updatedtd"]),n.refresh(e,r.getColumns(),!1)),this.parent.aggregates.length>0)){var l=[];l.type="cancel",this.parent.notify("refresh-footer-rendered",l),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",l)}}return o},r.prototype.removeHideAndSelection=function(e){if(e.classList.contains("e-hiddenrow")){e.removeAttribute("aria-selected");for(var i=[].slice.call(e.getElementsByClassName("e-selectionbackground")),r=0;r<i.length;r++)t.removeClass([i[r]],["e-selectionbackground","e-active"])}t.classList(e,[],["e-hiddenrow","e-updatedtd"])},r.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),this.parent.aggregates.length>0&&(this.parent.notify("refresh-footer-rendered",{}),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",{}))},r.prototype.addRecord=function(e){this.bulkAddRow(e)},r.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},r.prototype.closeForm=function(){for(var e=0;e<Object.keys(this.originalCell).length;e++)for(var t=0;t<Object.keys(this.cloneCell).length;t++)Object.keys(this.originalCell)[e]===Object.keys(this.cloneCell)[t]&&(this.cloneCell[Object.keys(this.cloneCell)[t]].replaceWith(this.originalCell[Object.keys(this.originalCell)[e]]),this.originalCell[Object.keys(this.originalCell)[e]].classList.contains("e-selectionbackground")&&this.originalCell[Object.keys(this.originalCell)[e]].classList.remove("e-selectionbackground","e-cellselectionbackground","e-active"));this.cloneCell={},this.originalCell={}},r.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},r.prototype.batchSave=function(){var e=this.parent;if(e.isCheckBoxSelection){var i=e.element.querySelector(".e-checkselectall").parentElement;i.classList.contains("e-checkbox-disabled")&&e.pageSettings.totalRecordsCount>e.currentViewData.length&&t.removeClass([i],["e-checkbox-disabled"])}if(this.saveCell(),!(e.isEdit||this.editNextValCell()||e.isEdit)){var r=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&r.deletedRecords.length&&this.parent.selectionSettings.persistSelection&&(r.deletedRecords=this.removeSelectedData,this.removeSelectedData=[]);var n={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},o={batchChanges:r,cancel:!1};e.trigger("beforeBatchSave",o,function(t){t.cancel||(e.showSpinner(),e.notify("bulk-save",{changes:r,original:n}))})}},r.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=0,i=this.parent.getRowsObject();t<i.length;t++){var r=i[t];if(r.isDirty)switch(r.edit){case"add":e.addedRecords.push(r.changes);break;case"delete":e.deletedRecords.push(r.data);break;default:e.changedRecords.push(r.changes)}}return e},r.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,r=t.length;i<r&&t[i].uid!==e;i++);Be(this.parent,function(e,t){t.splice(i,1)},Pe(this.parent))},r.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition;Be(this.parent,function(r,n){var o=e.clone();o.cells=Ae(t,o.cells,r),i?n.unshift(o):n.push(o)},Pe(this.parent),!0)},r.prototype.bulkDelete=function(e,i){var r=this;this.removeSelectedData=[];var n=this.parent,o=n.selectedRowIndex,s=n.getSelectedRows(),l={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:o,rowData:i||n.getSelectedRecords()[0],cancel:!1};(t.isBlazor()&&!this.parent.isJsComponent||(l.row=i?n.editModule.deleteRowUid?n.getRowElementByUID(n.editModule.deleteRowUid):n.getRows()[n.getCurrentViewRecords().indexOf(i)]:i?n.getRows()[o]:s[0],l.row))&&n.trigger("beforeBatchDelete",l,function(e){if(!e.cancel){if(r.removeSelectedData=n.getSelectedRecords(),n.clearSelection(),e.row=e.row?e.row:i?n.getRows()[o]:s[0],r.parent.isFrozenGrid()){i&&(o=parseInt(e.row.getAttribute(Hi),10),(s=[]).push(n.getRowByIndex(o)),s.push(n.getMovableRowByIndex(o)),n.getFrozenMode()===Pi&&s.push(n.getFrozenRightRowByIndex(o)));for(l=0;l<s.length;l++){d=s[l].getAttribute("data-uid");s[l].classList.contains("e-insertedrow")?(r.removeRowObjectFromUID(d),t.remove(s[l])):((c=n.getRowObjectFromUID(d)).isDirty=!0,c.edit="delete",t.classList(s[l],["e-hiddenrow","e-updatedtd"],[]),n.frozenRows&&o<n.frozenRows&&n.getMovableDataRows().length>=n.frozenRows&&(n.getMovableHeaderTbody().appendChild(n.getMovableRowByIndex(n.frozenRows-1)),n.getFrozenHeaderTbody().appendChild(n.getRowByIndex(n.frozenRows-1)),n.getFrozenMode()===Pi&&n.getFrozenRightHeaderTbody().appendChild(n.getFrozenRightRowByIndex(n.frozenRows-1))),n.frozenRows&&o<n.frozenRows&&n.getDataRows().length>=n.frozenRows&&n.getHeaderTable().querySelector(Ui).appendChild(n.getRowByIndex(n.frozenRows-1))),delete s[l]}}else if(r.parent.isFrozenGrid()||1!==s.length&&!i)for(var l=0;l<s.length;l++){var a=s[l].getAttribute("data-uid");if(s[l].classList.contains("e-insertedrow"))r.removeRowObjectFromUID(a),t.remove(s[l]);else{t.classList(s[l],["e-hiddenrow","e-updatedtd"],[]);var h=n.getRowObjectFromUID(a);h.isDirty=!0,h.edit="delete",delete s[l]}}else{var d=e.row.getAttribute("data-uid");if(d=i&&r.parent.editModule.deleteRowUid?d=r.parent.editModule.deleteRowUid:d,e.row.classList.contains("e-insertedrow"))r.removeRowObjectFromUID(d),t.remove(e.row);else{var c=n.getRowObjectFromUID(d);c.isDirty=!0,c.edit="delete",t.classList(e.row,["e-hiddenrow","e-updatedtd"],[])}delete e.row}r.refreshRowIdx(),i&&(n.editModule.deleteRowUid=void 0,n.getSelectedRows().length&&(o=parseInt(n.getSelectedRows()[0].getAttribute(Hi),10))),n.isCheckBoxSelection||n.selectRow(o),n.trigger("batchDelete",e),n.notify("batchDelete",{rows:r.parent.getRowsObject()}),n.notify("toolbar-refresh",{})}})},r.prototype.refreshRowIdx=function(){for(var e,t=this.parent.getAllDataRows(!0),i=Ne(this.parent),r=Pe(this.parent),n=this,o=0,s=0,l=t.length;o<l;o++)!function(o,s,l){t[o].classList.contains(Oi)&&!t[o].classList.contains("e-hiddenrow")?(Be(n.parent,function(e,t,i){t[o].setAttribute(Hi,s.toString()),i[o].index=s},i,null,r),s++):Be(n.parent,function(e,t,i){t[o].removeAttribute(Hi),i[o].index=-1},i,null,r),e=s}(o,s),s=e},r.prototype.getIndexFromData=function(e){return A(e,this.parent.getCurrentViewRecords())},r.prototype.bulkAddRow=function(i){var r=this,n=this.parent;if(n.editSettings.allowAdding&&(n.isEdit&&(this.saveCell(),this.parent.notify("editNextValCell",{})),!n.isEdit)){this.parent.element.classList.add("e-editing");var o={defaultData:i||this.getDefaultData(),primaryKey:n.getPrimaryKeyFieldNames(),cancel:!1};n.trigger("beforeBatchAdd",o,function(o){if(!o.cancel){r.isAdded=!0,n.clearSelection();for(var s,l,a,h,d=new Vi(r.serviceLocator,null,r.parent),c=new Gi(r.parent).generateRows([o.defaultData]),p=d.render(c[0],n.getColumns()),u=0;u<r.parent.groupSettings.columns.length;u++)p.insertBefore(r.parent.createElement("td",{className:"e-indentcell"}),p.firstChild),c[0].cells.unshift(new Ci({cellType:e.CellType.Indent}));var g=n.getContentTable().querySelector(Ui);if(p.classList.add("e-insertedrow"),g.querySelector(".e-emptyrow")){var f=g.querySelector(".e-emptyrow");f.parentNode.removeChild(f),r.removeFrozenTbody()}n.isFrozenGrid()&&(l=p.cloneNode(!0),s=r.renderMovable(p,l),p="Right"===n.getFrozenMode()?l:p,r.renderFrozenAddRow(p,s,l)),g=n.frozenRows&&"Top"===n.editSettings.newRowPosition?n.getHeaderTable().querySelector(Ui):n.getContentTable().querySelector(Ui),"Top"===r.parent.editSettings.newRowPosition?g.insertBefore(p,g.firstChild):g.appendChild(p),t.addClass([].slice.call(p.getElementsByClassName(bi)),["e-updatedtd"]),c[0].isDirty=!0,c[0].changes=t.extend({},{},c[0].data,!0),c[0].edit="add",r.addRowObject(c[0]),r.refreshRowIdx(),r.focus.forgetPrevious(),n.notify("batchAdd",{rows:r.parent.getRowsObject(),args:{isFrozen:r.parent.isFrozenGrid()}});var m=r.getBatchChanges(),y=r.getBottomIndex();"Top"===r.parent.editSettings.newRowPosition?n.selectRow(0):n.selectRow(y),i||(h=r.findNextEditableCell(0,!0),a=n.getColumns()[h],"Top"===r.parent.editSettings.newRowPosition?r.editCell(0,a.field,!0):r.editCell(y,a.field,!0)),r.parent.aggregates.length>0&&(i||m.addedRecords.length)&&r.parent.notify("refresh-footer-rendered",{});var v={defaultData:o.defaultData,row:p,columnObject:a,columnIndex:h,primaryKey:o.primaryKey,cell:p.cells[h]};n.trigger("batchAdd",v),n.isFrozenGrid()&&Re(s.querySelector("td:not(.e-hide)"),p.querySelector("td:not(.e-hide)"))}})}},r.prototype.renderFrozenAddRow=function(e,i,r){var n=this.parent,o=je(this.parent),s=Ve(this.parent);"Top"===n.editSettings.newRowPosition?o.insertBefore(i,o.firstChild):o.appendChild(i),t.addClass([].slice.call(i.getElementsByClassName(bi)),["e-updatedtd"]),s&&r&&("Top"===n.editSettings.newRowPosition?s.insertBefore(r,s.firstChild):s.appendChild(r),t.addClass([].slice.call(r.getElementsByClassName(bi)),["e-updatedtd"]),Re(r.querySelector("td:not(.e-hide)"),e.querySelector("td:not(.e-hide)"))),"auto"===n.height&&n.notify("frozenHeight",{})},r.prototype.removeFrozenTbody=function(){var e=this.parent;if(e.isFrozenGrid()){var t=e.getContent().querySelector("."+Ei).querySelector(Ui);if(t.firstElementChild.parentNode.removeChild(t.firstElementChild),e.getFrozenMode()===Pi){var i=e.getContent().querySelector(".e-frozen-right-content").querySelector(Ui);i.firstElementChild.parentNode.removeChild(i.firstElementChild)}}},r.prototype.renderMovable=function(e,t){var i=e.cloneNode(!0),r=this.parent.getMovableColumnsCount(),n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount();return Le(e,0,n),Le(i,n,o?i.children.length-o:i.children.length),Le(t,n+r,t.children.length),i},r.prototype.findNextEditableCell=function(e,i,r){for(var n,o=this.parent.getColumns(),s=o.length,l=e;l<s;l++){if(n=!!r&&t.isNullOrUndefined(o[l].validationRules),!i&&this.checkNPCell(o[l]))return l;if(i&&!o[l].template&&o[l].visible&&o[l].allowEditing&&(!o[l].isIdentity||!o[l].isPrimaryKey)&&!n)return l}return-1},r.prototype.checkNPCell=function(e){return!e.template&&e.visible&&!e.isPrimaryKey&&!e.isIdentity&&e.allowEditing},r.prototype.getDefaultData=function(){for(var e={},i={number:0,string:null,boolean:!1,date:null,datetime:null},r=0,n=this.parent.columnModel;r<n.length;r++){var o=n[r];o.field&&t.setValue(o.field,Object.keys(o).indexOf("defaultValue")>=0?o.defaultValue:i[o.type],e)}return e},r.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("index"),10)},r.prototype.editCell=function(e,t,i){var r=this.parent,n=r.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var o=r.isEdit&&!(this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&this.parent.getDataRows().length-1!==e);r.editSettings.allowEditing&&(!o&&n.allowEditing?this.editCellExtend(e,t,i):o&&(this.editNext=!0,this.saveCell()))},r.prototype.editCellExtend=function(e,i,r){var n=this,o=this.parent,s=o.getColumnByField(i),l=o.getPrimaryKeyFieldNames();if(!o.isEdit){var a,h,d=t.extend({},{},this.getDataByIndex(e),!0);if("movable"===s.getFreezeTableName()||s.getFreezeTableName()===Ni?(a="movable"===s.getFreezeTableName()?o.getMovableDataRows()[e]:o.getFrozenRightDataRows()[e],h=this.parent.getRowObjectFromUID(a.getAttribute("data-uid")),d=h.changes?t.extend({},{},h.changes,!0):d):(a=o.getDataRows()[e],d=t.extend({},{},this.getDataByIndex(e),!0)),l[0]===s.field&&!a.classList.contains("e-insertedrow")||s.columns||s.isPrimaryKey&&s.isIdentity)return void(this.parent.isLastCellPrimaryKey=!0);this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing");var c=o.getRowObjectFromUID(a.getAttribute("data-uid")),p=[].slice.apply(a.cells),u={columnName:s.field,isForeignKey:!t.isNullOrUndefined(s.foreignKeyValue),primaryKey:l,rowData:d,validationRules:t.extend({},s.validationRules?s.validationRules:{}),value:pe(s.field,d),type:r?"add":"edit",cancel:!1,foreignKeyData:c&&c.foreignKeyData};(t.isBlazor()&&!this.parent.isJsComponent||(u.cell=p[this.getColIndex(p,this.getCellIdx(s.uid))],u.row=a,u.columnObject=s,u.cell))&&o.trigger("cellEdit",u,function(i){i.cancel||(i.cell=i.cell?i.cell:p[n.getColIndex(p,n.getCellIdx(s.uid))],i.row=i.row?i.row:a,i.columnObject=i.columnObject?i.columnObject:s,i.columnObject.index=t.isNullOrUndefined(i.columnObject.index)?0:i.columnObject.index,n.cellDetails={rowData:d,column:s,value:i.value,isForeignKey:i.isForeignKey,rowIndex:e,cellIndex:parseInt(i.cell.getAttribute(qi),10),foreignKeyData:i.foreignKeyData},i.cell.classList.contains("e-updatedtd")&&(n.isColored=!0,i.cell.classList.remove("e-updatedtd")),o.isEdit=!0,o.clearSelection(),o.isCheckBoxSelection&&o.isPersistSelection||o.selectRow(n.cellDetails.rowIndex,!0),n.renderer.update(i),n.parent.notify("batcheditform-rendered",i),n.form=t.select("#"+o.element.id+"EditForm",o.element),o.editModule.applyFormValidation([s]),n.parent.element.querySelector(".e-gridpopup").style.display="none")})}},r.prototype.updateCell=function(e,t,i){var r=this.parent,n=r.getColumnByField(t),o=r.getColumnIndexByField(t);if(n&&!n.isPrimaryKey&&n.allowEditing){var s=He(this.parent,n,e,o),l="movable"===n.getFreezeTableName()?this.parent.getMovableRowsObject()[e]:n.getFreezeTableName()===Ni?r.getFrozenRightRowsObject()[e]:r.getRowObjectFromUID(s.parentElement.getAttribute("data-uid"));this.refreshTD(s,n,l,i),this.parent.trigger("queryCellInfo",{cell:this.newReactTd||s,column:n,data:l.changes})}},r.prototype.setChanges=function(e,r,n){var o;if(this.parent.isFrozenGrid()){var s=this.parent.getRowElementByUID(e.uid),l=parseInt(s.getAttribute(Hi),10);(o=this.parent.getRowsObject()[l]).changes||(o.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(r)||t.setValue(r,n,o.changes);var a=this.parent.getMovableRowsObject()[l];if(a.changes=t.extend({},{},o.changes,!0),e.data[r]!==n&&(a.isDirty=!0,o.isDirty=!0),this.parent.getFrozenMode()===Pi){var h=this.parent.getFrozenRightRowsObject()[l];h.changes=t.extend({},{},o.changes,!0),e.data[r]!==n&&(h.isDirty=!0)}}else if(e.changes||(e.changes=t.extend({},{},e.data,!0)),t.isNullOrUndefined(r)||i.DataUtil.setValue(r,n,e.changes),e.data[r]!==n){var d=this.parent.getColumnByField(r).type;"date"===d||"datetime"===d?new Date(e.data[r]).toString()!==new Date(n).toString()&&(e.isDirty=!0):e.isDirty=!0}},r.prototype.updateRow=function(e,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var n=r[i];this.updateCell(e,n,t[n])}},r.prototype.getCellIdx=function(e){var i=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++,i},r.prototype.refreshTD=function(e,i,r,n){var o,s=new $i(this.parent,this.serviceLocator);n="number"!==i.type||t.isNullOrUndefined(n)?n:parseFloat(n),this.setChanges(r,i.field,n);var l=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount();l=l&&this.parent.isRowDragable()?l+1:l,se(r,this.parent.getForeignKeyColumns(),r.changes),o=l&&"movable"===i.getFreezeTableName()&&this.parent.getColumns().length===r.cells.length?r.cells.slice(l,r.cells.length):r.cells;var a,h;this.parent.isReact&&(a=e.parentElement,h=e.cellIndex);var d=0;l&&(d="movable"===i.getFreezeTableName()&&"Right"!==this.parent.getFrozenMode()?l:i.getFreezeTableName()===Ni?this.parent.getFrozenLeftColumnsCount()+this.parent.getMovableColumnsCount():d),s.refreshTD(e,o[this.getCellIdx(i.uid)-d],r.changes,{index:this.getCellIdx(i.uid)}),this.parent.isReact?(this.newReactTd=a.cells[h],a.cells[h].classList.add("e-updatedtd")):e.classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify("toolbar-refresh",{})},r.prototype.getColIndex=function(e,i){var r=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(r=this.parent.groupSettings.columns.length),t.isNullOrUndefined(this.parent.detailTemplate)&&t.isNullOrUndefined(this.parent.childGrid)||r++,this.parent.isRowDragable()&&r++;for(var n=0;n<e.length;n++)if(parseInt(e[n].getAttribute(qi),10)===i-r)return n;return-1},r.prototype.editNextValCell=function(){var e=this.parent,t=this.getBottomIndex();if(this.isAdded&&!e.isEdit){for(var i=this.cellDetails.cellIndex;i<e.getColumns().length;i++){if(e.isEdit)return;var r=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),n=e.getColumns()[r];if(n){if("Bottom"===this.parent.editSettings.newRowPosition)this.editCell(t,n.field,!0);else{var o={index:0,column:n};this.parent.notify("next-cell-index",o),this.editCell(o.index,n.field,!0)}this.saveCell()}}e.isEdit||(this.isAdded=!1)}},r.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},r.prototype.generateCellArgs=function(){var e=this.parent;this.parent.element.classList.remove("e-editing");var i=this.cellDetails.column,r={};r[i.field]=pe(i.field,this.cellDetails.rowData);var n=e.editModule.getCurrentEditedData(this.form,r),o=t.extend({},n);n=t.extend({},n,this.cellDetails.rowData);var s=pe(i.field,o);t.isNullOrUndefined(i.field)||t.isUndefined(s)||t.setValue(i.field,s,n);var l={columnName:i.field,value:pe(i.field,n),rowData:this.cellDetails.rowData,column:i,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return t.isBlazor()&&!this.parent.isJsComponent||(l.cell=this.form.parentElement,l.columnObject=i),l},r.prototype.saveCell=function(e){if(!this.preventSaveCell&&this.form){var t=this.parent;if(e||t.isEdit&&!this.validateFormObj()){this.preventSaveCell=!0;var i=this.generateCellArgs(),r=i.cell.parentElement,n=i.column;e?this.successCallBack(i,r,n)(i):(t.trigger("cellSave",i,this.successCallBack(i,r,n)),t.notify("batchedit-form",{formObj:this.form}))}}},r.prototype.successCallBack=function(e,i,r,n){var o=this;return function(e){var s=o.parent;if(e.cell=e.cell?e.cell:o.form.parentElement,e.columnObject=e.columnObject?e.columnObject:r,e.columnObject.index=t.isNullOrUndefined(e.columnObject.index)?0:e.columnObject.index,e.cancel){if(o.preventSaveCell=!1,o.editNext){if(o.editNext=!1,o.cellDetails.rowIndex===o.index&&o.cellDetails.column.field===o.field)return;o.editCellExtend(o.index,o.field,o.isAdd)}}else{s.editModule.destroyWidgets([r]),s.isEdit=!1,s.editModule.destroyForm(),o.parent.notify("tooltip-destroy",{});var l=O(e.cell,Ei)||O(e.cell,Ii)?s.getRowObjectFromUID(i.getAttribute("data-uid"),!0):s.getRowObjectFromUID(i.getAttribute("data-uid"));if(s.getFrozenMode()===Pi&&(O(e.cell,"e-frozen-right-header")||O(e.cell,"e-frozen-right-content"))&&(l=s.getRowObjectFromUID(i.getAttribute("data-uid"),!1,!0)),o.refreshTD(e.cell,r,l,e.value),o.parent.isReact&&(e.cell=o.newReactTd),t.removeClass([i],[Ai,"e-batchrow"]),t.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!t.isNullOrUndefined(e.value)&&e.value.toString()===(t.isNullOrUndefined(o.cellDetails.value)?"":o.cellDetails.value).toString()&&!o.isColored||t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(l.data[r.field])&&t.isNullOrUndefined(o.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),t.isNullOrUndefined(n)&&s.trigger("cellSaved",e),s.notify("toolbar-refresh",{}),o.isColored=!1,o.parent.aggregates.length>0&&(o.parent.notify("refresh-footer-rendered",{}),o.parent.groupSettings.columns.length>0&&!o.isAddRow(o.cellDetails.rowIndex)&&o.parent.notify("group-aggregates",{})),o.preventSaveCell=!1,o.editNext){if(o.editNext=!1,o.cellDetails.rowIndex===o.index&&o.cellDetails.column.field===o.field)return;var a=s.getColumnByField(o.field);a&&a.allowEditing&&o.editCellExtend(o.index,o.field,o.isAdd)}n&&s.notify("restore-Focus",{})}}},r.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[e].getAttribute("data-uid"));return t.changes?t.changes:t.data},r.prototype.keyDownHandler=function(e){if(("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBottomIndex(),r=O(e.target,bi);if(r){var n=r.querySelector(".e-field");if(n){var o=this.parent.getVisibleColumns();o["tab"===e.action?o.length-1:0].field===n.getAttribute("id").slice(this.parent.element.id.length)&&(this.cellDetails.rowIndex===i&&"tab"===e.action?"Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord():this.saveCell())}}}},r.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.isColored=!1)},r.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e.addedRecords.length-e.deletedRecords.length-1},r}(),To=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zo=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.renderer=r,n}return To(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(xo),Do=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Do(i,e),i.prototype.write=function(e){"datepickeredit"===e.column.editType?this.obj=new l.DatePicker(t.extend(et(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params)):"datetimepickeredit"===e.column.editType&&(this.obj=new l.DateTimePicker(t.extend(et(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params))),this.obj.appendTo(e.element)},i}(mo),Oo=function(){function e(e){this.parent=e}return e.prototype.read=function(e,t){return t},e.prototype.write=function(){},e.prototype.destroy=function(){},e}(),ko=function(){function e(e,t){this.editType={Inline:Eo,Normal:Eo,Batch:Io,Dialog:zo},this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}return e.prototype.updateColTypeObj=function(){for(var i=this.parent.columnModel,r=0;r<i.length;r++)if(this.parent.editSettings.template||i[r].editTemplate){i[r].edit=t.extend(new e.editCellType.templateedit(this.parent),i[r].edit||{})}else i[r].edit=t.extend(new e.editCellType[i[r].editType&&e.editCellType[i[r].editType]?i[r].editType:"defaultedit"](this.parent,this.serviceLocator),i[r].edit||{});this.parent.log("primary_column_missing")},e.prototype.getModuleName=function(){return"edit"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,i=0,r=Object.keys(e.properties);i<r.length;i++)switch(r[i]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"mode":this.updateEditObj(),t.isEdit=!1,t.refresh()}},e.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new fo(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},e.prototype.initialEnd=function(){this.updateColTypeObj()},e.prototype.startEdit=function(e){var t=this.parent;if(t.editSettings.allowEditing&&!t.isEdit&&"Batch"!==t.editSettings.mode){if(this.parent.element.classList.add("e-editing"),t.getSelectedRows().length)e||(e=t.getSelectedRows()[0]);else if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj);this.isLastRow=e.rowIndex===this.parent.getContent().querySelector("tr:last-child").rowIndex,"none"!==e.style.display&&(this.editModule.startEdit(e),this.refreshToolbar(),t.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{}))}},e.prototype.checkLastRow=function(e,i){var r=this.isLastRow;"auto"!==this.parent.height&&"Bottom"===this.parent.editSettings.newRowPosition&&i&&"add"===i.requestType&&this.parent.height>this.parent.getContentTable().scrollHeight?t.addClass([].slice.call(e.getElementsByClassName(bi)),"e-lastrowadded"):r&&e&&e.classList&&t.addClass([].slice.call(e.getElementsByClassName(bi)),"e-lastrowcell")},e.prototype.closeEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.getElementsByClassName("e-updatedtd").length)return void this.showDialog("CancelEdit",this.dialogObj);this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),this.refreshToolbar(),this.parent.notify("close-edit",{})},e.prototype.refreshToolbar=function(){this.parent.notify("toolbar-refresh",{})},e.prototype.addRecord=function(e,t){if(this.parent.editSettings.allowAdding){var i={startEdit:!0};e||this.parent.notify("virtual-scroll-add-action-begin",i),i.startEdit&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,t),this.refreshToolbar(),this.parent.notify("start-add",{}))}},e.prototype.deleteRecord=function(e,i){var r=this.parent;if(r.editSettings.allowDeleting)return i||r.getSelectedRecords().length||!t.isNullOrUndefined(r.commandDelIndex)?r.editSettings.showDeleteConfirmDialog?void this.showDialog("ConfirmDelete",this.dialogObj):void this.editModule.deleteRecord(e,i):void this.showDialog("DeleteOperationAlert",this.alertDObj)},e.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");var i=this.parent.getRowObjectFromUID(this.deleteRowUid);t.isNullOrUndefined(i)||this.deleteRecord(null,i.data)},e.prototype.endEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(t.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify("editNextValCell",{}),t.isNullOrUndefined(this.formObj)||this.formObj.validate()))return void this.showDialog("BatchSaveConfirm",this.dialogObj);this.endEditing()},e.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},e.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},e.prototype.batchCancel=function(){this.closeEdit()},e.prototype.batchSave=function(){this.endEdit()},e.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},e.prototype.editFormValidate=function(){var e=!this.formObj||this.formObj.validate(),t=!this.mFormObj||this.mFormObj.validate(),i=!this.frFormObj||this.frFormObj.validate();return e&&t&&i},e.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},e.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},e.prototype.saveCell=function(){this.editModule.saveCell()},e.prototype.endEditing=function(){this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show()},e.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null)}return i},e.prototype.destroyToolTip=function(){for(var e=0,i=[].slice.call(this.parent.element.getElementsByClassName("e-griderror"));e<i.length;e++){var r=i[e];t.remove(r)}this.parent.getContent().firstElementChild.style.position="relative"},e.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},e.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},e.prototype.alertClick=function(){this.alertDObj.hide()},e.prototype.dlgWidget=function(e,t){var i=this.parent.createElement("div",{id:this.parent.element.id+t});this.parent.element.appendChild(i);var n={showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"}};n.buttons=e;var o=new r.Dialog(n);return o.isStringTemplate=!0,o.appendTo(i),o},e.prototype.dlgCancel=function(){this.parent.focusModule.clearIndicator(),this.parent.focusModule.restoreFocus(),this.dialogObj.hide()},e.prototype.dlgOk=function(){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord();break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&this.editModule.addCancelWhilePaging(),this.executeAction()}this.dlgCancel()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.eventDetails=[{event:Nt,handler:this.onPropertyChanged},{event:Ot,handler:this.initialEnd},{event:Vt,handler:this.keyPressHandler},{event:ei,handler:this.updateColTypeObj},{event:"tooltip-destroy",handler:this.destroyToolTip},{event:ii,handler:this.preventBatch},{event:"destroy-form",handler:this.destroyForm}],Xe(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(bt,this.actionBeginFunction),this.parent.addEventListener(St,this.actionCompleteFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(Xe(this.parent,this.eventDetails,!1),this.parent.removeEventListener(St,this.actionCompleteFunction),this.parent.removeEventListener(bt,this.actionBeginFunction))},e.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel"].indexOf(e.requestType)<0&&(this.parent.isEdit=!1),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus(),this.refreshToolbar()},e.prototype.getCurrentEditedData=function(e,r){var n=this.parent;if(n.editSettings.template){for(var o=[].slice.call(e.elements),s=0;s<o.length;s++)if((o[s].hasAttribute("name")&&"e-multi-hidden"!==o[s].className||o[s].classList.contains("e-multiselect"))&&("hidden"!==o[s].type||!O(o[s],"e-switch-wrapper")&&!O(o[s],"e-checkbox-wrapper"))){var l=K(o[s].hasAttribute("name")?o[s].getAttribute("name"):o[s].getAttribute("id")),a=n.getColumnByField(l)||{field:l,type:o[s].getAttribute("type")},h=void 0;"checkbox"===a.type||"boolean"===a.type?h=o[s].checked:o[s].value?(h=o[s].value,o[s].ej2_instances&&o[s].ej2_instances.length&&!t.isNullOrUndefined(o[s].ej2_instances[0].value)&&(o[s].blur(),h=o[s].ej2_instances[0].value,"date"!==a.type&&"dateTime"!==a.type&&"datetime"!==a.type||!o[s].ej2_instances[0].isServerRendered||(h=o[s].value))):o[s].ej2_instances&&(h=o[s].ej2_instances[0].value),a.edit&&"string"==typeof a.edit.read?h=t.getValue(a.edit.read,window)(o[s],h):a.edit&&a.edit.read&&(h=a.edit.read(o[s],h)),h=n.editModule.getValueFromType(a,h),"radio"===o[s].type?o[s].checked&&i.DataUtil.setValue(a.field,h,r):i.DataUtil.setValue(a.field,h,r)}return r}for(var d=n.columnModel.filter(function(e){return e.editTemplate}),c=0;c<d.length;c++)if(e[W(d[c].field)]){var p=[].slice.call(e[W(d[c].field)]),u=(p=p.length?p:[e[W(d[c].field)]]).filter(function(e){return!t.isNullOrUndefined(e.ej2_instances)});0===u.length&&(u=p.filter(function(e){return e.hasAttribute("name")}));for(s=0;s<u.length;s++){h=this.getValue(d[c],u[s],r);i.DataUtil.setValue(d[c].field,h,r)}}for(var g=[].slice.call(e.getElementsByClassName("e-field")),f=0,m=g.length;f<m;f++){var y=n.getColumnByUid(g[f].getAttribute("e-mappinguid"));if(y&&y.field){h=this.getValue(y,g[f],r);i.DataUtil.setValue(y.field,h,r)}}return r},e.prototype.getValue=function(e,i,r){var n=i.ej2_instances?i.ej2_instances[0].value:i.value,o=this.parent,s=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=i.checked),"string"==typeof s?(s=t.getValue(s,window),n=o.editModule.getValueFromType(e,s(i,n))):n=o.editModule.getValueFromType(e,e.edit.read(i,n)),t.isNullOrUndefined(r[e.field])&&""===n&&(n=r[e.field]),n},e.prototype.onActionBegin=function(e){if("columnstate"===e.requestType&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode)this.closeEdit();else{var t=this.parent.element.querySelector("."+Ai),i=this.parent.element.querySelector("."+Bi);if(t&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(O(t,Oi).getAttribute(Hi),10)<this.parent.frozenRows)return;var r=-1===["filterafteropen","filterbeforeopen","filterchoicerequest","save","infiniteScroll","virtualscroll"].indexOf(e.requestType),n=this.parent.enableVirtualization&&this.formObj&&!this.formObj.isDestroyed&&(t||i||"cancel"===e.requestType)&&r;(!this.parent.enableVirtualization&&"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&r&&!e.cancel||n)&&(this.destroyWidgets(),this.destroyForm())}},e.prototype.destroyWidgets=function(e){this.parent.editSettings.template&&(this.parent.destroyTemplate(["editSettingsTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),(e=e||this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization)).some(function(e){return!t.isNullOrUndefined(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact&&this.parent.renderTemplates());for(var i=0,r=e;i<r.length;i++){var n=r[i],o=n.edit.destroy;n.edit.destroy&&("string"==typeof o?(o=t.getValue(o,window))():n.edit.destroy())}for(var s=[].slice.call(this.formObj.element.elements),l=0;l<s.length;l++)s[l].hasAttribute("name")&&s[l].ej2_instances&&s[l].ej2_instances.length&&!s[l].ej2_instances[0].isDestroyed&&s[l].ej2_instances[0].destroy()},e.prototype.destroyForm=function(){this.destroyToolTip();for(var e=[this.formObj,this.mFormObj,this.frFormObj,this.virtualFormObj],t=0;t<e.length;t++)e[t]&&e[t].element&&!e[t].isDestroyed&&e[t].destroy();this.destroyToolTip()},e.prototype.destroy=function(){var e=this.parent.element;if(e){var i=!(!e.querySelector("."+Si)||!e.querySelector("."+Ri));i&&this.destroyForm(),this.removeEventListener();var r=this.dialogObj.element;r.childElementCount>0&&(this.dialogObj.destroy(),t.remove(r)),(r=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),t.remove(r)),i&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")||document.querySelector(".e-popup-open")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":O(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(O(e.target,Ri)||this.parent.frozenRows&&O(e.target,Fi))||document.getElementsByClassName("e-popup-open").length||(e.preventDefault(),this.endEdit());break;case"escape":this.parent.isEdit&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.closeEdit())}},e.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},e.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},e.prototype.applyFormValidation=function(e){var i=this.parent,r=i.isFrozenGrid(),n="Normal"===this.parent.editSettings.mode,o="Right"===this.parent.getFrozenMode()&&n?1:0,s="Dialog"!==this.parent.editSettings.mode?i.element.getElementsByClassName("e-gridform")[o]:t.select("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),l="Right"===this.parent.getFrozenMode()&&n?0:1,a=i.element.getElementsByClassName("e-gridform")[l],h={},d={},c={};e=e||i.getColumns();for(var p=0;p<e.length;p++)(e[p].visible||"Dialog"===i.editSettings.mode&&(-1!==i.groupSettings.columns.indexOf(e[p].field)||"Dialog"!==i.editSettings.mode))&&e[p].validationRules&&Ue(e[p],l,h,d,c,e.length);if(r&&"Dialog"!==this.parent.editSettings.mode){if(this.parent.editModule.mFormObj=this.createFormObj(a,d),this.parent.getFrozenMode()===Pi){var u=i.element.getElementsByClassName("e-gridform")[2];this.parent.editModule.frFormObj=this.createFormObj(u,c)}}else h=t.extend(h,d,c);this.parent.editModule.formObj=this.createFormObj(s,h)},e.prototype.createFormObj=function(e,t){var i=this;return new o.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){i.validationComplete(e)},customPlacement:function(e,t){var r=e.getAttribute("e-mappinguid"),n={column:i.parent.getColumnByUid(r),error:t,inputElement:e,value:e.value};i.valErrorPlacement(e,t),i.parent.notify("validation-custom-placement",n)}})},e.prototype.valErrorPlacement=function(e,t){if(this.parent.isEdit){var i=t.getAttribute("for"),r=this.getElemTable(e).querySelector("#"+i+"_Error");r?r.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,"")}},e.prototype.getElemTable=function(e){var i,r,n=this.parent;if("Dialog"!==n.editSettings.mode){i=n.frozenRows&&n.frozenRows>(parseInt(t.closest(e,"."+Oi).getAttribute(Hi),10)||0);var o=e.name,s=void 0;o&&(s=Ze(this.parent,K(o))),s&&n.isFrozenGrid()?"frozen-left"===s.getFreezeTableName()?r=i?n.getFrozenVirtualHeader().querySelector("table"):n.getFrozenVirtualContent().querySelector("table"):"frozen-right"===s.getFreezeTableName()?r=i?n.getFrozenRightHeader().querySelector("table"):n.getFrozenRightContent().querySelector("table"):"movable"===s.getFreezeTableName()&&(r=i?n.getMovableVirtualHeader().querySelector("table"):n.getMovableVirtualContent().querySelector("table")):r=i?n.getHeaderTable():n.getContentTable()}else r=t.select("#"+n.element.id+"_dialogEdit_wrapper",document);return r},e.prototype.resetElemPosition=function(e,t){var i=O(t.element,bi);if(i){var r=i.getBoundingClientRect().right,n=e.getBoundingClientRect().right;if(n>r){var o=n-r;e.style.left=e.offsetLeft-o+"px"}}},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+e.inputName+"_Error");t&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")}},e.prototype.createTooltip=function(e,i,n,o){var s=this.parent.getColumnByField(n),l=this.parent.getFrozenMode()===Pi&&"Normal"===this.parent.editSettings.mode&&s.getFreezeTableName()===Ni?this.frFormObj.element:this.formObj.element,a=O(e,"e-virtual-validation");a&&(l=this.virtualFormObj.element);var h=this.parent.getContent().firstElementChild,d=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount();d&&(h=this.parent.getMovableVirtualContent());var c,p,u=h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth,g="Dialog"!==this.parent.editSettings.mode,f=t.closest(e,"."+bi),m=t.closest(e,"."+Oi),y=this.parent.getContent().querySelector("."+Ti),v=!1,C=!1,w=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,b=y?[].slice.call(this.parent.getFrozenVirtualContent().getElementsByClassName(Oi)):[].slice.call(this.parent.getContent().getElementsByClassName(Oi));if("Batch"===this.parent.editSettings.mode&&w>1&&b.length>=w&&b[b.length-1].getAttribute(Hi)===m.getAttribute(Hi)&&(C=!0),g){if(this.parent.frozenRows){var S=d?this.parent.getFrozenVirtualHeader().querySelector(Ui).children:this.parent.getHeaderTable().querySelector(Ui).children;v=(c=S.length>(parseInt(m.getAttribute(Hi),10)||0))&&parseInt(m.getAttribute(Hi),10)===S.length-1}(v||w>1&&b.length>=w&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||f.classList.contains("e-lastrowcell")&&!m.classList.contains(Bi))||C)&&(p=!0)}var R=g?c?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document),x=R.getBoundingClientRect(),F=g?this.parent.element.getBoundingClientRect().left:x.left,E=t.closest(e,"td"),I=E?E.getBoundingClientRect():e.parentElement.getBoundingClientRect(),T=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:n+"_Error",styles:"display:"+o+";top:"+((c?I.top+I.height:I.bottom-x.top-(d?y.scrollTop:0))+R.scrollTop+9)+"px;left:"+(I.left-F+R.scrollLeft+I.width/2)+"px;max-width:"+I.width+"px;text-align:center;"});g&&x.left<F&&(T.style.left=parseInt(T.style.left,10)-x.left+F+"px");var z=this.parent.createElement("div",{className:"e-tip-content"});z.appendChild(i);var D;p?((D=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),D.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((D=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),D.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),T.appendChild(z),T.appendChild(D),a||!d&&!this.parent.frozenRows||"Dialog"===this.parent.editSettings.mode?a?this.virtualFormObj.element.appendChild(T):this.formObj.element.appendChild(T):(("Normal"===this.parent.editSettings.mode?t.closest(e,".e-editcell"):t.closest(e,"."+Mi)).style.position="relative",T.style.position="absolute","Batch"===this.parent.editSettings.mode||t.closest(e,"."+Ti)||t.closest(e,"."+zi)||this.parent.frozenRows&&!d?l.appendChild(T):this.mFormObj.element.appendChild(T)),!p&&g&&h.getBoundingClientRect().bottom<I.bottom+I.height&&(h.scrollTop=h.scrollTop+T.offsetHeight+D.scrollHeight);var M=parseInt(document.defaultView.getComputedStyle(T,null).getPropertyValue("font-size"),10);if(T.getBoundingClientRect().width<I.width&&T.querySelector("label").getBoundingClientRect().height/(1.2*M)>=2&&(T.style.width=T.style.maxWidth),(d||this.parent.frozenRows)&&"Dialog"!==this.parent.editSettings.mode?T.style.left=E.offsetLeft+(E.offsetWidth/2-T.offsetWidth/2)+"px":T.style.left=parseInt(T.style.left,10)-T.offsetWidth/2+"px",g&&!u&&!this.parent.allowPaging||d||this.parent.frozenRows){h.style.position="static";var k=r.calculateRelativeBasedPosition(E,T);T.style.top=k.top+I.height+9+"px"}if(p){if(!u||d||"auto"===this.parent.height||this.parent.frozenRows||this.parent.enableVirtualization)T.style.bottom=I.height+9+"px";else{var A=h.scrollWidth>h.offsetWidth?j():0;T.style.bottom=this.parent.height-h.querySelector("table").offsetHeight-A+I.height+9+"px"}if(b.length<w&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType){var B=(this.parent.frozenRows?this.parent.frozenRows+(b.length-1):b.length-1)*this.parent.getRowHeight(),P=this.parent.getContent().clientHeight-B;T.style.bottom=P+9+"px"}T.style.top=null}},e.prototype.checkColumnIsGrouped=function(e){return!(e.visible||this.parent.groupSettings.columns.indexOf(e.field)>-1)},e.AddEditors=function(i){e.editCellType=t.extend(e.editCellType,i)},e.editCellType={dropdownedit:wo,numericedit:bo,datepickeredit:Mo,datetimepickeredit:Mo,booleanedit:vo,defaultedit:Ro,templateedit:Oo},e}(),Ao=function(){function e(e,i){this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.isDlgOpen=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.prevShowedCols=[],this.parent=e,this.serviceLocator=i,this.addEventListener(),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!0,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!0,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.removeEventListener(),this.unWireEvents(),t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||this.dlgObj.destroy())},e.prototype.rtlUpdate=function(){this.parent.enableRtl?t.addClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]):t.removeClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"])},e.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(Bt,this.enableAfterRenderEle,this),this.parent.on(Ot,this.render,this),this.parent.addEventListener(Rt,this.hideDialog.bind(this)),this.parent.on(_t,this.destroy,this),this.parent.on("rtl-updated",this.rtlUpdate,this),this.parent.on(Vt,this.keyUpHandler,this),this.parent.on("reset-columns",this.onResetColumns,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Ot,this.render),this.parent.off(_t,this.destroy),this.parent.off(Bt,this.enableAfterRenderEle),this.parent.off("rtl-updated",this.rtlUpdate),this.parent.on(Vt,this.keyUpHandler,this),this.parent.off("reset-columns",this.onResetColumns))},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},e.prototype.clickHandler=function(e){var i=e.target;if(!this.isCustomizeOpenCC){if(t.isNullOrUndefined(t.closest(i,".e-cc"))&&t.isNullOrUndefined(t.closest(i,".e-cc-toolbar")))t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.visible||i.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(i.classList.contains("e-columnchooser-btn")||i.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else i.classList.contains("e-cc-cancel")&&(i.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch(""),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.rtlUpdate()},e.prototype.hideDialog=function(){!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.dlgObj.hide(),this.isDlgOpen=!1)},e.prototype.renderColumnChooser=function(e,i,n){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{if(this.beforeOpenColumnChooserEvent().cancel)return;n&&(this.targetdlg=n),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var o=this.dlgObj.element.style.display;this.dlgObj.element.style.display="block";var s=r.calculateRelativeBasedPosition(t.closest(n,".e-toolbar-item"),this.dlgObj.element);this.dlgObj.element.style.display=o,this.dlgObj.element.style.top=s.top+t.closest(n,".e-cc-toolbar").getBoundingClientRect().height+"px";t.isNullOrUndefined(t.closest(n,".e-bigger"))||(this.dlgObj.width=258),t.Browser.isDevice?(this.dlgObj.target=document.body,this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=n.offsetLeft+"px":this.dlgObj.element.style.left=s.left-250+t.closest(n,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.dlgObj.show(),this.parent.notify("columnChooserOpened",{dialog:this.dlgObj})}this.rtlUpdate()},e.prototype.openColumnChooser=function(e,i){if(this.isCustomizeOpenCC=!0,this.dlgObj.visible)return void this.hideDialog();this.beforeOpenColumnChooserEvent().cancel||(this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.dlgObj.position={X:"center",Y:"center"},t.isNullOrUndefined(e)?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=i+"px",this.dlgObj.element.style.left=e+"px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.dlgObj.show(),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},e.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.keyUpHandler=function(e){"escape"===e.action&&this.hideDialog()},e.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},e.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},e.prototype.getColumns=function(){return this.parent.getColumns().filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},e.prototype.renderDlgContent=function(){this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("ColumnChooserDialogARIA")),this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({header:this.l10n.getConstant("ChooseColumns"),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),buttons:[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}],content:this.renderChooserList(),width:250,cssClass:"e-cc",animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),this.wireEvents()},e.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),t=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search")}}),i=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),r=this.parent.createElement("div",{className:"e-cc-contentdiv"});this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),e.appendChild(t),e.appendChild(i),this.searchBoxObj=new Pr(t);var n=this.refreshCheckboxList(this.parent.getColumns());return this.innerDiv.appendChild(n),r.appendChild(this.innerDiv),this.mainDiv.appendChild(e),this.mainDiv.appendChild(r),this.mainDiv},e.prototype.confirmDlgBtnClick=function(e){this.stateChangeColumns=[],this.changedStateColumns=[],this.changedColumns=this.changedColumns.length>0?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns);var i=this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length;t.isNullOrUndefined(e)||i<this.parent.getColumns().length&&(this.hideColumn.length&&this.columnStateChange(this.hideColumn,!1),this.showColumn.length&&this.columnStateChange(this.showColumn,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify("tooltip-destroy",{module:"edit"}),0===this.parent.getCurrentViewRecords().length&&this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString()))},e.prototype.onResetColumns=function(e){if("columnstate"===e.requestType)return void this.resetColumnState()},e.prototype.resetColumnState=function(){this.showColumn=[],this.hideColumn=[],this.hideDialog()},e.prototype.changedColumnState=function(e){for(var t=0;t<e.length;t++){var i=e[t],r=this.parent.getColumnByUid(i);this.changedStateColumns.push(r)}},e.prototype.columnStateChange=function(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=this.parent.getColumnByUid(r);"checkbox"!==n.type&&(n.visible=t),this.stateChangeColumns.push(n)}},e.prototype.clearActions=function(){this.resetColumnState(),this.addcancelIcon()},e.prototype.clearBtnClick=function(){this.clearActions(),this.parent.notify("columnChooserCancelBtnClick",{dialog:this.dlgObj})},e.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1),e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1===this.showColumn.indexOf(t)&&this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&this.hideColumn.push(t)),i?e?this.unchangedColumns.push(t):this.changedColumns.push(t):-1!==this.changedColumns.indexOf(t)?this.changedColumns.splice(this.changedColumns.indexOf(t),1):this.changedColumns.push(t)},e.prototype.columnChooserSearch=function(e){var t,r,n=!1,o=this.dlgDiv.querySelector(".e-footer-content"),s=this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;if(this.isInitialOpen=!0,o&&(r=o.querySelector(".e-btn").ej2_instances[0]),""===e?(this.removeCancelIcon(),t=this.getColumns(),n=!0):t=new i.DataManager(this.getColumns()).executeLocal((new i.Query).where("headerText",this.searchOperator,e,!0,this.parent.columnChooserSettings.ignoreAccent)),t.length)this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.innerDiv.appendChild(this.refreshCheckboxList(t)),n?r&&s&&(r.disabled=!1):(this.addcancelIcon(),this.refreshCheckboxButton());else{var l=this.parent.createElement("span",{className:"e-cc e-nmatch"});l.innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.innerDiv.appendChild(l),this.innerDiv.classList.add("e-ccnmdiv"),r&&(r.disabled=!0)}this.flag=!0,this.stopTimer()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),t.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),this.searchBoxObj.wireEvent()},e.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj.element&&t.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),t.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent())},e.prototype.checkBoxClickHandler=function(e){var t,i=O(e.target,"e-checkbox-wrapper");if(i){if(i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):ie(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check"))t=!0;else{if(!i.querySelector(".e-uncheck"))return;t=!1}this.updateIntermediateBtn();var r=O(i,"e-ccheck").getAttribute("uid"),n=this.parent.getColumns();if("grid-selectAll"===r){this.changedColumns=[],this.unchangedColumns=[];for(var o=0;o<n.length;o++)n[o].showInColumnChooser&&this.checkstatecolumn(t,n[o].uid,!0)}else this.checkstatecolumn(t,r);this.refreshCheckboxButton()}},e.prototype.updateIntermediateBtn=function(){var e=this.ulElement.children.length-1,i=[],r=this.ulElement.children[0].querySelector(".e-frame"),n=this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length,o=this.dlgObj.btnObj[0];o.disabled=!1,e===n?i=["e-check"]:n?i=["e-stop"]:(i=["e-uncheck"],o.disabled=!0),o.dataBind(),t.removeClass([r],["e-check","e-stop","e-uncheck"]),t.addClass([r],i)},e.prototype.updateSelectAll=function(e){for(var t=0,i=[].slice.call(this.ulElement.getElementsByClassName("e-frame"));t<i.length;t++)oe(i[t],e)},e.prototype.refreshCheckboxButton=function(){for(var e=this.parent.getVisibleColumns(),t=0;t<e.length;t++){a=e[t].uid;-1===this.prevShowedCols.indexOf(a)&&this.prevShowedCols.push(a)}for(t=0;t<this.hideColumn.length;t++){var i=this.prevShowedCols.indexOf(this.hideColumn[t]);-1!==i&&this.prevShowedCols.splice(i,1)}var r=0!==this.showColumn.length?1:this.prevShowedCols.length,n=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0];n.disabled=!1;for(var o=[],s=[].slice.call(this.parent.element.getElementsByClassName("e-cc-chbox")),t=0,l=s.length;t<l;t++){var a=O(s[t],"e-ccheck").getAttribute("uid");o.push(a)}var h=this.showColumn.filter(function(e){return-1!==o.indexOf(e)});0===r&&0===h.length&&(n.disabled=!0),n.dataBind()},e.prototype.refreshCheckboxList=function(e){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var t=this.l10n.getConstant("SelectAll"),i=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"}),r=this.createCheckBox(t,!1,"grid-selectAll");e.length&&(r.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),r.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(r.querySelector(".e-icons"),!0),i.appendChild(r),this.ulElement.appendChild(i));for(var n=0;n<e.length;n++){var o=e[n];this.renderCheckbox(o)}return this.ulElement},e.prototype.refreshCheckboxState=function(){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("");for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,r=t.length;i<r;i++){var n=t[i],o=void 0;o=this.parent.childGrid||this.parent.detailTemplate?O(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[i],"e-ccheck").getAttribute("uid"):O(n,"e-ccheck").getAttribute("uid");var s=e.getColumnByUid(o),l=[].slice.call(n.parentElement.getElementsByClassName("e-uncheck"));s.visible&&!l.length?(n.checked=!0,this.checkState(n.parentElement.querySelector(".e-icons"),!0)):(n.checked=!1,this.checkState(n.parentElement.querySelector(".e-icons"),!1))}},e.prototype.checkState=function(e,i){i?t.classList(e,["e-check"],["e-uncheck"]):t.classList(e,["e-uncheck"],["e-check"])},e.prototype.createCheckBox=function(e,t,i){var r=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);return r.querySelector(".e-label").innerHTML=e,ne(i,r,"e-ccheck")},e.prototype.renderCheckbox=function(e){var t,i,r;if(e.showInColumnChooser){t=this.parent.createElement("li",{className:"e-cclist e-cc",styles:"list-style:None",id:"e-ccli_"+e.uid}),i=-1!==this.hideColumn.indexOf(e.uid),r=-1!==this.showColumn.indexOf(e.uid);var n=this.createCheckBox(e.headerText,e.visible&&!i||r,e.uid);t.appendChild(n),this.ulElement.appendChild(t)}this.isInitialOpen&&this.updateIntermediateBtn()},e.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},e.prototype.startTimer=function(e){var t=this,i=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue)},i)},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.addcancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel")},e.prototype.removeCancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel")},e.prototype.mOpenDlg=function(){t.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus())},e.prototype.getModuleName=function(){return"columnChooser"},e.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,i=e.length;t<i;t++)(e[t].classList.contains("e-dialog")||this.parent.element.id+"_ccdlg"!==e[t].id)&&e[t].ej2_instances[0].hide()},e.prototype.beforeOpenColumnChooserEvent=function(){var e={requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator};return this.parent.trigger("beforeOpenColumnChooser",e),this.searchOperator=e.searchOperator,e},e}(),Bo=function(){function r(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},this.parent=e,!e.parentDetails&&t&&(this.foreignKeyData=t)}return r.getQuery=function(e,t){var i=t.generateQuery(!0).requiresCount();return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},r.prototype.getFData=function(e,t){return le(t,{},e,this.foreignKeyData[t.field])[0]},r.prototype.getGridRowModel=function(e,t,i,r){void 0===r&&(r=0);var n=[],o=t.length;if(o){for(var s=0;s<o;s++,r++){var l={isExpand:!1};l.data=t[s],l.index=r,i.childGrid&&("All"===i.hierarchyPrintMode?l.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[r]&&(l.isExpand=i.expandedRows[r].isExpand));var a=new vi(l);a.cells=this.generateCells(e,i),n.push(a)}this.processColumns(n)}return n},r.prototype.generateCells=function(t,i){var r=[];if(i.childGridLevel)for(var n=i.childGridLevel,o=0;n>o;o++)r.push(this.generateCell({},e.CellType.Indent));for(var s=0,l=t;s<l.length;s++){var a=l[s];r.push(this.generateCell(a,e.CellType.Data))}return r},r.prototype.getColumnData=function(e){var t,r=this,n=[],o=e.getForeignKeyColumns();if(o.length){for(var s=0;s<o.length;s++){var l="result"in o[s].dataSource?new i.DataManager(o[s].dataSource.result):o[s].dataSource;n.push(l.executeQuery(new i.Query))}t=Promise.all(n).then(function(e){for(var t=0;t<o.length;t++)r.foreignKeyData[o[t].field]=e[t].result})}return t},r.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=ve(e);for(var i=[],r=0;r<this.colDepth;r++)i[r]=new vi({}),i[r].cells=[];return i=this.processColumns(i),i=this.processHeaderCells(i,e),{rows:i,columns:this.generateActualColumns(e)}},r.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},r.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,r=e;i<r.length;i++){var n=r[i];n.commands||(n.columns?(n.visible||this.hideColumnInclude)&&0!==this.getCellCount(n,0)&&this.generateActualColumns(n.columns,t):(n.visible||this.hideColumnInclude)&&t.push(n))}return t},r.prototype.processHeaderCells=function(e,t){for(var i=t,r=0;r<i.length;r++)i[r].commands||(e=this.appendGridCells(i[r],e,0));return e},r.prototype.appendGridCells=function(t,i,r){if(t.columns||!1===t.visible&&!this.hideColumnInclude||t.commands){if(t.columns){var n=this.getCellCount(t,0);n&&i[r].cells.push(new Ci({cellType:e.CellType.StackedHeader,column:t,colSpan:n}));for(var o=void 0,s=0,l=t.columns.length;s<l;s++)t.columns[s].visible&&!o&&(o=!0),i=this.appendGridCells(t.columns[s],i,r+1)}}else i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,r));return i},r.prototype.generateCell=function(t,i,r,n){var o={visible:t.visible,isDataCell:i===e.CellType.Data,column:t,cellType:i,rowSpan:r,index:n};return(!o.rowSpan||o.rowSpan<2)&&delete o.rowSpan,new Ci(o)},r.prototype.processColumns=function(t){var i=this.parent,r=[];i.enableColumnVirtualization&&(r=i.getColumnIndexesInView());for(var n=0,o=t.length;n<o;n++)if(i.allowGrouping)for(var s=0,l=i.groupSettings.columns.length;s<l;s++)i.enableColumnVirtualization&&-1===r.indexOf(s)||t[n].cells.splice(0,0,this.generateCell({},e.CellType.HeaderIndent));return t},r.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[i],t);else(e.visible||this.hideColumnInclude)&&t++;return t},r.prototype.checkAndExport=function(e,t){Object.keys(e).some(function(t){return!e[t]})||t()},r.prototype.failureHandler=function(e,t,i){var r=this;return function(){e[t.id]=!0,r.checkAndExport(e,i)}},r.prototype.createChildGrid=function(e,i,r,n){var o=new mn(this.parent.detailRowModule.getGridModel(e,i,r));e.isPrinting=!1;o.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:t.getValue(o.queryString,i.data),parentRowData:i.data};var s=L("child-grid"),l=t.createElement("div",{id:s,styles:"display: none"});return document.body.appendChild(l),o.id=s,n[s]=!1,o.isExportGrid=!0,{childGrid:o,element:l}},r.prototype.getGridExportColumns=function(e){for(var t=[],i=0,r=e;i<r.length;i++)"checkbox"!==r[i].type&&t.push(r[i]);return t},r.prototype.getForeignKeyData=function(){return this.foreignKeyData},r}(),Po=function(){function e(e){this.valueFormatter=new yt(e),this.internationalization=new t.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,i){return!t.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(i)(e.value):""},e.prototype.formatCellValue=function(e,i){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,le(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return e.value||0===e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"";if("boolean"===e.column.type&&""!==e.value)return e.value?"true":"false";if("date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return(t.isNullOrUndefined(e.column.type)||t.isNullOrUndefined(e.value))&&t.isNullOrUndefined(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var r=void 0,n=e.column.format;return r="date"===e.column.type?i?{type:"date",format:n}:{type:"date",skeleton:n}:"time"===e.column.type?i?{type:"time",format:n}:{type:"time",skeleton:n}:i?{type:"dateTime",format:n}:{type:"dateTime",skeleton:n},this.returnFormattedValue(e,r)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var o=void 0;return o="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,o)},e}(),No=function(){function r(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isElementIdChanged=!1,this.gridPool={},this.sheet={},this.parent=e,this.helper=new Bo(e),this.locator=t,this.l10n=this.locator.getService("localization")}return r.prototype.getModuleName=function(){return"ExcelExport"},r.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new Po(e.locale),e.id=L("main-grid"),this.gridPool[e.id]=!1)},r.prototype.Map=function(e,i,r,n,o,s){var l=e;this.gridPool={},e.childGrid&&(t.isNullOrUndefined(i)||"None"!==i.hierarchyExportMode)&&(e.expandedRows=fe(e).expandedRows);var a={requestType:"beforeExcelExport",gridObject:l,cancel:!1,isMultipleExport:r,workbook:n,isCsv:o,isBlob:s};return l.trigger("beforeExcelExport",a),a.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new yi(l),this.isExporting=!0,this.isBlob=a.isBlob,this.isCsvExport=!!a.isCsv&&a.isCsv,y(i)&&v(i,l),this.processRecords(l,i,a.isMultipleExport,a.workbook))},r.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger("excelExportComplete",this.isBlob?{promise:this.blobPromise}:{}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book),this.sheet.images=[]},r.prototype.processRecords=function(e,r,n,o){var s=this;if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.dataSource)&&r.dataSource instanceof i.DataManager){var l=r.query?r.query:new i.Query;return(t.isNullOrUndefined(l.isCountRequired)||e.aggregates)&&(l.isCountRequired=!0),new Promise(function(t){r.dataSource.executeQuery(l).then(function(i){s.init(e),s.processInnerRecords(e,r,n,o,i).then(function(){s.exportingSuccess(t)})})})}if(t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType){var a=[];return a.push(this.data.getData({},Bo.getQuery(e,this.data))),a.push(this.helper.getColumnData(e)),new Promise(function(t,i){Promise.all(a).then(function(i){s.init(e),s.processInnerRecords(e,r,n,o,i[0]).then(function(){s.exportingSuccess(t)})}).catch(function(e){i(s.book),s.parent.trigger("actionFailure",e)})})}return new Promise(function(t){s.init(e),s.processInnerRecords(e,r,n,o,s.parent.getCurrentViewRecords()),s.exportingSuccess(t)})},r.prototype.processInnerRecords=function(e,i,r,n,o){var s=this;this.groupedColLength=e.groupSettings.columns.length;var l,a=5,d=[],c=ve(e.columns),p=!t.isNullOrUndefined(i);return p&&!t.isNullOrUndefined(i.multipleExport)&&(this.expType=t.isNullOrUndefined(i.multipleExport.type)?"AppendToSheet":i.multipleExport.type,t.isNullOrUndefined(i.multipleExport.blankRows)||(a=i.multipleExport.blankRows)),t.isNullOrUndefined(n)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[]):"NewSheet"===this.expType?(this.workSheet=n.worksheets,this.rows=[],this.columns=[],this.styles=n.styles):(this.workSheet=[],this.rows=n.worksheets[0].rows,this.columns=n.worksheets[0].columns,this.styles=n.styles,this.rowLength=this.rows[this.rows.length-1].index+a,this.rowLength++),p&&(t.isNullOrUndefined(r)?(t.isNullOrUndefined(i.header)||this.processExcelHeader(JSON.parse(JSON.stringify(i.header))),t.isNullOrUndefined(i.footer)||(this.footer=JSON.parse(JSON.stringify(i.footer)))):(t.isNullOrUndefined(i.header)||!r&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(i.header))),t.isNullOrUndefined(i.footer)||("AppendToSheet"===this.expType?r||(this.footer=JSON.parse(JSON.stringify(i.footer))):this.footer=JSON.parse(JSON.stringify(i.footer))))),this.includeHiddenColumn=!!p&&i.includeHiddenColumn,new Promise(function(t,r){e.childGridLevel=0,d=s.processGridExport(e,i,o),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){var o=[];if(s.organiseRows(d,d[0].index,o),s.rows=s.rows.concat(o),t.isNullOrUndefined(s.footer)||("AppendToSheet"===s.expType&&!r||"NewSheet"===s.expType)&&s.processExcelFooter(s.footer),s.columns.length>0&&(s.sheet.columns=s.columns),s.sheet.rows=s.rows,s.sheet.enableRtl=s.parent.enableRtl,s.parent.allowFiltering&&e.getVisibleColumns().length&&p&&i.enableFilter){var a=i.header?i.header.headerRows||i.header.rows.length:0,u={row:c+a,column:s.groupedColLength?s.groupedColLength+1:s.sheet.columns[0].index,lastRow:s.sheet.rows.length,lastColumn:s.sheet.columns.length};s.sheet.autoFilters=u}if(s.workSheet.push(s.sheet),s.book.worksheets=s.workSheet,s.book.styles=s.styles,e.notify("finalPageSetup",s.book),!r){if(s.isCsvExport){p&&!t.isNullOrUndefined(i.separator)&&","!==i.separator&&(l=i.separator);g=new h.Workbook(s.book,"csv",e.locale,e.currencyCode,l);s.isBlob?s.blobPromise=g.saveAsBlob("text/csv"):p&&i.fileName?g.save(i.fileName):g.save("Export.csv")}else{var g=new h.Workbook(s.book,"xlsx",e.locale,e.currencyCode);s.isBlob?s.blobPromise=g.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):p&&i.fileName?g.save(i.fileName):g.save("Export.xlsx")}s.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return n})},r.prototype.organiseRows=function(e,t,i){if(!e.length)return t;for(var r=0;r<e.length;r++){var n=e[r],o=n.childRows;o?(n.index=t++,delete n.childRows,i.push(n),t=this.organiseRows(o,t,i)):(n.index=t++,i.push(n))}return t},r.prototype.processGridExport=function(e,r,n){var o=[],s=this.parent.isFrozenGrid()&&!this.parent.getFrozenColumns();t.isNullOrUndefined(r)||t.isNullOrUndefined(r.theme)||(this.theme=r.theme),e.childGrid&&!t.isNullOrUndefined(r)&&(e.hierarchyPrintMode=r.hierarchyExportMode||"Expanded");var l=new Bo(e,this.helper.getForeignKeyData()),a=y(r)?T(r.columns,e.enableColumnVirtualization):l.getGridExportColumns(s?e.getColumns():e.columns),h=l.getHeaders(a,this.includeHiddenColumn),d=e.groupSettings.columns.length;return o=this.processHeaderContent(e,h,d,o),o=t.isNullOrUndefined(r)||t.isNullOrUndefined(r.dataSource)||r.dataSource instanceof i.DataManager?t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType?this.processRecordContent(e,n,h,r,void 0,o,l):this.processRecordContent(e,n,h,r,e.currentViewData,o,l):this.processRecordContent(e,n,h,r,r.dataSource,o,l),e.notify("export-DataBound",{excelRows:o,type:"excel"}),o},r.prototype.processRecordContent=function(e,i,r,n,o,s,l){var a;if(a=!t.isNullOrUndefined(o)&&o.length?o:i.result,t.isNullOrUndefined(a.level)?this.processRecordRows(e,a,r,0,0,n,s,l):this.processGroupedRows(e,a,r,a.level,0,n,s,l),!t.isNullOrUndefined(i.aggregates))if(t.isNullOrUndefined(o)){var h=i.result.GroupGuid?i.result.records:i.result;this.processAggregates(e,h,s)}else this.processAggregates(e,i.result,s,o);return s},r.prototype.processGroupedRows=function(e,i,r,n,o,s,l,a){for(var h=0,d=i;h<d.length;h++){var c=d[h],p=[],u={};u.index=1+n;var g=e.getColumnByField(c.field),f={value:c.key,column:g,style:void 0,isForeignKey:g.isForeignColumn()},m=e.getColumnByField(c.field).headerText+": "+(g.enableGroupByFormat?c.key:this.exportValueFormatter.formatCellValue(f))+" - ";c.count>1?m+=c.count+" items":m+=c.count+" item";var y={captionText:m,type:this.isCsvExport?"CSV":"Excel"};this.parent.trigger("exportGroupCaption",y),u.value=y.captionText,u.style=this.getCaptionThemeStyle(this.theme);var v=new Qi(e).generateRows(c);if(this.fillAggregates(e,v,i.level+i.childLevels,l,this.rowLength),p.push(u),l[l.length-1].cells.length>0){for(var C=i.level+i.childLevels+v[0].cells.length,w=0,b=0,S=l[l.length-1].cells;b<S.length;b++){var R=S[b];R.index<C&&(C=R.index),R.index>w&&(w=R.index),p[p.length-1].index!==R.index&&p.push(R)}for(C-u.index>1&&(u.colSpan=C-u.index);w<r.columns.length+n+i.childLevels;){var x={};x.index=w+1,x.style=this.getCaptionThemeStyle(this.theme),p.push(x),w++}}else{for(var F=0,E=0,I=r.columns;E<I.length;E++)I[E].visible&&F++;u.colSpan=i.childLevels+F}if(l[l.length-1].cells=p,this.rowLength++,this.groupedColLength<8&&n>1){var T={outlineLevel:n-1,isCollapsed:!0};l[l.length-1].grouping=T}!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0?(this.processGroupedRows(e,c.items,r,c.items.level,o,s,l,a),this.processAggregates(e,c,l,void 0,n+i.childLevels,!0)):(o=this.processRecordRows(e,c.items,r,n,o,s,l,a),this.processAggregates(e,c,l,void 0,n,!0))}},r.prototype.processRecordRows=function(i,r,n,o,s,l,a,h){for(var d=1,c=[],p=n.columns,u=0,g=h.getGridRowModel(p,r,i,s);u<g.length;u++){var f=g[u];c=[],s++,d=1;for(var m=void 0,y=0,v=f.cells.length;y<v;y++){var C=f.cells[y];if(C.cellType===e.CellType.Data){var w=C.column,b=w.field,S=t.isNullOrUndefined(b)?"":w.valueAccessor(b,f.data,w),R=t.isNullOrUndefined(S)?"":S,x=void 0;if(w.isForeignColumn&&w.isForeignColumn()&&(x=h.getFData(R,w),R=t.getValue(w.foreignKeyValue,x)),!t.isNullOrUndefined(R)){var F={},E=d+o+i.childGridLevel,I={data:f.data,column:w,foreignKeyData:x,value:R,style:void 0,colSpan:1,cell:F};if(i.trigger("excelQueryCellInfo",I),!t.isNullOrUndefined(I.image)&&!t.isNullOrUndefined(I.image.base64)){t.isNullOrUndefined(this.sheet.images)&&(this.sheet.images=[]);var T={image:I.image.base64,row:this.rowLength,column:E,lastRow:this.rowLength,lastColumn:E};this.sheet.images.push(T),m=I.image.height||50,this.columns[E-1].width=I.image.width||this.columns[E-1].width}if(t.isNullOrUndefined(I.hyperLink)||(I.cell.hyperlink={target:I.hyperLink.target},I.value=I.hyperLink.displayText||I.value),F=I.cell,F.index=E,F.value=I.value,""===I.data&&i.childGridLevel&&1===d){var z={};z.hAlign="left",I={style:z},F.colSpan=i.getVisibleColumns().length,F.value=this.l10n.getConstant("EmptyRecord")}if(I.colSpan>1&&(F.colSpan=I.colSpan),t.isNullOrUndefined(I.style))F.style={name:i.element.id+"column"+(d+o)};else{var D=this.getColumnStyle(i,d+o);F.style=this.mergeOptions(this.styles[D],I.style)}c.push(F)}d++}}var M={index:this.rowLength++,cells:c};if(t.isNullOrUndefined(m)||(M.height=m),this.groupedColLength<8&&o>0?(M.grouping={outlineLevel:o,isCollapsed:!0},a.push(M)):a.push(M),!t.isNullOrUndefined(i.childGrid)){i.isPrinting=!0;var O=!t.isNullOrUndefined(l)&&l.exportType?l.exportType:"AllPages",k=this.helper.createChildGrid(i,f,O,this.gridPool),A=k.childGrid,B=k.element;A.actionFailure=h.failureHandler(this.gridPool,A,this.globalResolve),A.childGridLevel=i.childGridLevel+1;var P={childGrid:A,row:f,exportProperties:l};this.parent.trigger("exportdetaildatabound",P),A.beforeDataBound=this.childGridCell(M,A,l,f),A.appendTo(B)}i.notify("export-RowDataBound",{rowObj:f,type:"excel",excelRows:a})}return s},r.prototype.childGridCell=function(e,i,r,n){var o=this;return function(s){i.beforeDataBound=null,s.cancel=!0,0===s.result.length&&(s.result=[""]),e.childRows=o.processGridExport(i,r,s);for(var l=o.parent.groupSettings.columns.length,a=e.childRows,h=0;h<a.length;h++)a[h].grouping={outlineLevel:l+i.childGridLevel,isCollapsed:!n.isExpand,isHidden:!n.isExpand};return i.destroy(),t.detach(i.element),o.gridPool[i.id]=!0,o.helper.checkAndExport(o.gridPool,o.globalResolve),e}},r.prototype.processAggregates=function(e,i,r,n,o,s){var l=new Wi(e),a=l.getColumns();a=a.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo();var h=void 0;if(h=t.isNullOrUndefined(n)?i:n,void 0===o&&(o=0),e.groupSettings.columns.length>0&&s){var d=new Ki(e).generateRows(h,{level:h.level});d.length>0&&(r=this.fillAggregates(e,d,o,r))}else{o=e.groupSettings.columns.length>0&&!s?e.groupSettings.columns.length:o;var c=l.generateRows(h,i.aggregates,null,null,a);c.length>0&&!s&&(r=this.fillAggregates(e,c,o,r))}return r},r.prototype.fillAggregates=function(i,r,n,o,s){for(var l=0,a=r;l<a.length;l++){for(var h=a[l],d=[],c=!0,p=0,u=0,g=h.cells;u<g.length;u++){var f=g[u],m={};if(f.cellType!==e.CellType.DetailFooterIntent&&(f.visible||this.includeHiddenColumn))if(p++,f.isDataCell){c=!1;var y=!t.isNullOrUndefined(f.column.footerTemplate),v=!t.isNullOrUndefined(f.column.groupFooterTemplate),C=!t.isNullOrUndefined(f.column.groupCaptionTemplate);if(m.index=p+n+i.childGridLevel,y)m.value=this.getAggreateValue(e.CellType.Summary,f.column.footerTemplate,f,h);else if(v)m.value=this.getAggreateValue(e.CellType.GroupSummary,f.column.groupFooterTemplate,f,h);else if(C)m.value=this.getAggreateValue(e.CellType.CaptionSummary,f.column.groupCaptionTemplate,f,h);else for(var w=0,b=Object.keys(h.data[f.column.field]);w<b.length;w++)b[w]===f.column.type&&(t.isNullOrUndefined(h.data[f.column.field].Sum)?t.isNullOrUndefined(h.data[f.column.field].Average)?t.isNullOrUndefined(h.data[f.column.field].Max)?t.isNullOrUndefined(h.data[f.column.field].Min)?t.isNullOrUndefined(h.data[f.column.field].Count)?t.isNullOrUndefined(h.data[f.column.field].TrueCount)?t.isNullOrUndefined(h.data[f.column.field].FalseCount)?t.isNullOrUndefined(h.data[f.column.field].Custom)||(m.value=h.data[f.column.field].Custom):m.value=h.data[f.column.field][f.column.field+" - falsecount"]:m.value=h.data[f.column.field][f.column.field+" - truecount"]:m.value=h.data[f.column.field][f.column.field+" - count"]:m.value=h.data[f.column.field][f.column.field+" - min"]:m.value=h.data[f.column.field][f.column.field+" - max"]:m.value=h.data[f.column.field][f.column.field+" - average"]:m.value=h.data[f.column.field][f.column.field+" - sum"]);m.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(f.column,m.style,f.column.field);var S=f.attributes.style;S.textAlign&&(m.style.hAlign=S.textAlign.toLowerCase());var R={row:h,type:y?"Footer":v?"GroupFooter":"GroupCaption",style:m};this.parent.trigger("excelAggregateQueryCellInfo",R),d.push(m)}else void 0===s&&(m.index=p+n+i.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme),d.push(m))}if(t.isNullOrUndefined(s)){var x={};if(this.groupedColLength<8&&this.groupedColLength>0){var F={outlineLevel:o[o.length-1].grouping.outlineLevel,isCollapsed:!0};x={index:this.rowLength++,cells:d,grouping:F}}else x={index:this.rowLength++,cells:d};c||o.push(x)}else o.push({index:s,cells:d})}return o},r.prototype.aggregateStyle=function(e,i,r){var n=this.parent.getColumnByField(r);if("object"==typeof e.format){var o=e.format;i.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(i.type=o.type.toLowerCase())}else i.numberFormat=e.format;!t.isNullOrUndefined(n)&&t.isNullOrUndefined(i.type)&&(i.type=n.type.toLowerCase())},r.prototype.getAggreateValue=function(i,r,n,o){var s={};s[t.getEnumValue(e.CellType,n.cellType)]=t.compile(r);var l,a=o.data[n.column.field?n.column.field:n.column.columnName];return this.parent.isReact||this.parent.isVue?(l=s[t.getEnumValue(e.CellType,n.cellType)](a,this.parent),this.parent.isReact&&this.parent.renderTemplates()):l=s[t.getEnumValue(e.CellType,n.cellType)](a),l[0].textContent},r.prototype.mergeOptions=function(e,t){for(var i={},r=Object.keys(e),n=0;n<r.length;n++)"name"!==r[n]&&(i[r[n]]=e[r[n]]);r=Object.keys(t);for(n=0;n<r.length;n++)"name"!==r[n]&&(i[r[n]]=t[r[n]]);return i},r.prototype.getColumnStyle=function(e,t){for(var i=0,r=0,n=this.styles;r<n.length;r++){if(n[r].name===e.element.id+"column"+t)return i;i++}},r.prototype.processHeaderContent=function(i,r,n,o){var s=r.rows,l=r.columns,a=[];if(n>0)for(var h=0;h!==n;)this.columns.push({index:h+1,width:30}),h++;for(var d=0;d<s.length;d++){for(var c=1+n,p=[],u=0;u<s[d].cells.length;u++){var g={},f={},m=s[d].cells[u];if(m.cellType!==e.CellType.HeaderIndent&&m.cellType!==e.CellType.DetailHeader){for(var y={contains:!0,index:1};y.contains;)if(y=this.getIndex(a,1,c),c=y.index,!y.contains){f.index=y.index+i.childGridLevel;break}if(!t.isNullOrUndefined(m.rowSpan)&&1!==m.rowSpan){f.rowSpan=m.rowSpan;for(var v=1;v<m.rowSpan+1;v++){var C={rowIndex:0,columnIndex:0};C.rowIndex=v,C.columnIndex=c,a.push(C)}}t.isNullOrUndefined(m.colSpan)||1===m.colSpan||(f.colSpan=m.colSpan,c=c+f.colSpan-1),f.value=m.column.headerText,g=this.getHeaderThemeStyle(this.theme),t.isNullOrUndefined(m.column.textAlign)||(g.hAlign=m.column.textAlign.toLowerCase()),t.isNullOrUndefined(m.column.headerTextAlign)||(g.hAlign=m.column.headerTextAlign.toLowerCase());var w={cell:f,gridCell:m,style:g};i.trigger("excelHeaderQueryCellInfo",w),f.style=w.style,p.push(f),c++}}o.push({index:this.rowLength++,cells:p})}for(var b=0;b<l.length;b++)this.parseStyles(i,l[b],this.getRecordThemeStyle(this.theme),n+b+1);return o},r.prototype.getHeaderThemeStyle=function(e){var i={};return i.fontSize=12,i.borders={color:"#E0E0E0"},i.bold=!0,t.isNullOrUndefined(e)||t.isNullOrUndefined(e.header)||(i=this.updateThemeStyle(e.header,i)),i},r.prototype.updateThemeStyle=function(e,i){return t.extend(i,e)},r.prototype.getCaptionThemeStyle=function(e){var i={};return i.fontSize=13,i.backColor="#F6F6F6",t.isNullOrUndefined(e)||t.isNullOrUndefined(e.caption)||(i=this.updateThemeStyle(e.caption,i)),i},r.prototype.getRecordThemeStyle=function(e){var i={};return i.fontSize=13,i.borders={color:"#E0E0E0"},t.isNullOrUndefined(e)||t.isNullOrUndefined(e.record)||(i=this.updateThemeStyle(e.record,i)),i},r.prototype.processExcelHeader=function(e){if(!t.isNullOrUndefined(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var i=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,i=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var r=0;r<i;r++){var n=e.rows[r];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=r+1),this.updatedCellIndex(n)}}},r.prototype.updatedCellIndex=function(e){for(var i=e.cells.length,r=0;r<i;r++){var n=e.cells[r];(null===n.index||t.isNullOrUndefined(n.index))&&(n.index=r+1)}this.rows.push(e)},r.prototype.processExcelFooter=function(e){if(!t.isNullOrUndefined(e.rows)){var i=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,i=e.rows.length):i=e.footerRows;for(var r=0;r<i;r++){var n=e.rows[r];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},r.prototype.getIndex=function(e,t,i){for(var r=0,n=e;r<n.length;r++){var o=n[r];if(o.rowIndex===t&&o.columnIndex===i)return i+=1,{contains:!0,index:i}}return{contains:!1,index:i}},r.prototype.parseStyles=function(e,i,r,n){if(!t.isNullOrUndefined(i.format))if("object"==typeof i.format){var o=i.format;r.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(r.type=o.type.toLowerCase())}else r.numberFormat=i.format,r.type=i.type;t.isNullOrUndefined(i.textAlign)||(r.hAlign=i.textAlign.toLowerCase()),Object.keys(r).length>0&&(r.name=e.element.id+"column"+n,this.styles.push(r)),t.isNullOrUndefined(i.width)||"auto"===i.width||this.columns.push({index:n+e.childGridLevel,width:"number"==typeof i.width?i.width:this.helper.getConvertedWidth(i.width)})},r.prototype.destroy=function(){},r}(),Lo=function(){function r(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new Bo(e),this.gridPool={}}return r.prototype.getModuleName=function(){return"PdfExport"},r.prototype.init=function(e){this.exportValueFormatter=new Po(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=L("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new d.PdfPageSettings},r.prototype.exportWithData=function(e,i,r,n,o,s,l){var a=this;this.init(e),t.isNullOrUndefined(i)?this.pdfDocument=new d.PdfDocument:this.pdfDocument=i,this.processExport(e,n,o,s).then(function(){a.isExporting=!1,e.trigger("pdfExportComplete",a.isBlob?{promise:a.blobPromise}:{}),a.parent.log("exporting_complete",a.getModuleName()),r(a.pdfDocument)}).catch(function(e){l(a.pdfDocument),a.parent.trigger("actionFailure",e)})},r.prototype.Map=function(e,r,n,o,s){var l=this;this.data=new yi(this.parent),this.isBlob=s,this.gridPool={};var a=new i.Query;e.childGrid&&(t.isNullOrUndefined(r)||"None"!==r.hierarchyExportMode)&&(e.expandedRows=fe(e).expandedRows);var h={requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1};h.gridObject=e;if(e.trigger("beforePdfExport",h),!0===h.cancel)return new Promise(function(e,t){return e()});if(y(r)&&v(r,e),h.generateQuery&&(a=Bo.getQuery(e,this.data)),this.headerOnPages=h.headerPageNumbers,this.drawPosition=h.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.dataSource)&&r.dataSource instanceof i.DataManager)return new Promise(function(t,i){r.dataSource.executeQuery(a).then(function(s){l.exportWithData(e,o,t,s,r,n,i)})});if(t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType){var c=[];return c.push(this.data.getData({},Bo.getQuery(e,this.data))),c.push(this.helper.getColumnData(e)),new Promise(function(i,s){Promise.all(c).then(function(a){l.init(e),t.isNullOrUndefined(o)?l.pdfDocument=new d.PdfDocument:l.pdfDocument=o,l.processExport(e,a[0],r,n).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{}),l.parent.log("exporting_complete",l.getModuleName()),i(l.pdfDocument)}).catch(function(e){s(l.pdfDocument),l.parent.trigger("actionFailure",e)})})})}return new Promise(function(t,i){l.exportWithData(e,o,t,l.parent.getCurrentViewRecords(),r,n,i)})},r.prototype.processExport=function(e,i,r,n){var o,s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,r);var a=l.pages.add();return new Promise(function(t,n){o=s.processGridExport(e,i,r),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){return o.draw(a,s.drawPosition.xPosition,s.drawPosition.yPosition),s.drawHeader(r),n||(s.isBlob?s.blobPromise=s.pdfDocument.save():!t.isNullOrUndefined(r)&&r.fileName?s.pdfDocument.save(r.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy(),delete e.expandedRows),s.pdfDocument})},r.prototype.processSectionExportProperties=function(e,i){return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)&&t.isNullOrUndefined(i.pageSize)||(this.pdfPageSettings.orientation="Landscape"===i.pageOrientation?d.PdfPageOrientation.Landscape:d.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(i.pageSize),e.setPageSettings(this.pdfPageSettings)),e},r.prototype.processGridExport=function(e,i,r){var n=!0,o=this.parent.isFrozenGrid()&&!this.parent.getFrozenColumns();t.isNullOrUndefined(r)||(this.gridTheme=r.theme,n=!!t.isNullOrUndefined(r.allowHorizontalOverflow)||r.allowHorizontalOverflow);var s=new Bo(e,this.helper.getForeignKeyData()),l=this.processExportProperties(r,i.result),a=y(r)?T(r.columns,e.enableColumnVirtualization):s.getGridExportColumns(o?e.getColumns():e.columns);a=a.filter(function(e){return t.isNullOrUndefined(e.commands)});var h=!1;e.groupSettings.columns.length&&(h=!0),e.childGrid&&!t.isNullOrUndefined(r)&&(e.hierarchyPrintMode=r.hierarchyExportMode||"Expanded");var c=new d.PdfGrid,p=this.getHeaderThemeStyle(),u=p.border,g=p.font,f=p.brush,m=s.getHeaders(a,this.hideColumnInclude),v=m.columns;c=this.processGridHeaders(e.groupSettings.columns.length,c,m.rows,v,u,g,f,e,n,a),this.setColumnProperties(v,c,s,e,n);var C=this.getSummaryCaptionThemeStyle();if(!t.isNullOrUndefined(l)&&l.length){if(h?(t.isNullOrUndefined(C.border)||(u=C.border),this.processGroupedRecords(c,l,v,e,u,0,C.font,C.brush,C.backgroundBrush,i,r,s,0)):this.processRecord(u,v,e,l,c,0,r,s,0),!t.isNullOrUndefined(i.aggregates)){var w=new Wi(e),b=void 0,S=w.getColumns();S=S.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),b=this.customDataSource?w.generateRows(l,i.aggregates):this.currentViewData?w.generateRows(this.parent.getCurrentViewRecords(),i.aggregates):h?w.generateRows(l.records,i.aggregates):w.generateRows(i.result,i.aggregates,null,null,S),this.processAggregates(b,c,u,C.font,C.brush,C.backgroundBrush,!1)}}else c.rows.addRow().style.setBorder(u);return c},r.prototype.getSummaryCaptionThemeStyle=function(){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.caption))return{font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,9.75),brush:new d.PdfSolidBrush(new d.PdfColor(0,0,0)),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246))};var e=t.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,i=t.isNullOrUndefined(this.gridTheme.caption.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),r=this.getFontStyle(this.gridTheme.caption),n=new d.PdfColor(0,0,0);if(!t.isNullOrUndefined(this.gridTheme.caption.fontColor)){var o=this.hexToRgb(this.gridTheme.caption.fontColor);n=new d.PdfColor(o.r,o.g,o.b)}var s=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,l=new d.PdfStandardFont(i,e,r);return t.isNullOrUndefined(this.gridTheme.caption.font)||(l=this.gridTheme.caption.font),{font:l,brush:new d.PdfSolidBrush(n),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246)),border:s}},r.prototype.getGridPdfFont=function(e){var i=0;if(e.header&&e.header.font){var r=e.header.font.fontFamily,n=e.header.font.fontSize,o=e.header.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[o])?0:d.PdfFontStyle[o],e.header.font.isTrueType)e.header.font=new d.PdfTrueTypeFont(r,n,i);else{var s=t.isNullOrUndefined(r)?d.PdfFontFamily.Helvetica:this.getFontFamily(r);e.header.font=new d.PdfStandardFont(s,n,i)}}if(e.caption&&e.caption.font){var l=e.caption.font.fontFamily,a=e.caption.font.fontSize,h=e.caption.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[h])?0:d.PdfFontStyle[h],e.caption.font.isTrueType)e.caption.font=new d.PdfTrueTypeFont(l,a,i);else{var c=t.isNullOrUndefined(l)?d.PdfFontFamily.Helvetica:this.getFontFamily(l);e.caption.font=new d.PdfStandardFont(c,a,i)}}if(e.record&&e.record.font){var p=e.record.font.fontFamily,u=e.record.font.fontSize,g=e.record.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[g])?0:d.PdfFontStyle[g],e.record.font.isTrueType)e.record.font=new d.PdfTrueTypeFont(p,u,i);else{var f=t.isNullOrUndefined(p)?d.PdfFontFamily.Helvetica:this.getFontFamily(p);e.record.font=new d.PdfStandardFont(f,u,i)}}},r.prototype.getHeaderThemeStyle=function(){var e=new d.PdfBorders;if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.header))return e.all=new d.PdfPen(new d.PdfColor(234,234,234)),{border:e,font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,10.5),brush:new d.PdfSolidBrush(new d.PdfColor(102,102,102))};var i=t.isNullOrUndefined(this.gridTheme.header.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),r=this.getFontStyle(this.gridTheme.header),n=t.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,o=new d.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.header.fontColor)){var s=this.hexToRgb(this.gridTheme.header.fontColor);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfStandardFont(i,n,r);return t.isNullOrUndefined(this.gridTheme.header.font)||(l=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:l,brush:new d.PdfSolidBrush(o)}},r.prototype.processGroupedRecords=function(e,i,r,n,o,s,l,a,h,c,p,u,g){for(var f=this,m=s,y=this,v=0,C=i;v<C.length;v++)!function(s){var v=e.rows.addRow(),C=n.getColumnByField(s.field),w={value:s.key,column:C,style:void 0,isForeignKey:C.isForeignColumn()},b={captionText:y.parent.getColumnByField(s.field).headerText+": "+(C.enableGroupByFormat?s.key:y.exportValueFormatter.formatCellValue(w))+" - "+s.count+(i.count>1?" items":" item"),type:"PDF"};y.parent.trigger("exportGroupCaption",b,function(y){v.cells.getCell(m).value=y.captionText,v.cells.getCell(m+1).style.stringFormat=new d.PdfStringFormat(d.PdfTextAlignment.Left),v.style.setBorder(o),v.style.setFont(l),v.style.setTextBrush(a),v.style.setBackgroundBrush(h);var C,w=new Qi(n);if(C=t.isNullOrUndefined(s.items.records)?w.generateRows(s.items,s):w.generateRows(s.items.records,s),t.isNullOrUndefined(C)||0!==C.length||(v.cells.getCell(m+1).columnSpan=e.columns.count-(m+1)),!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0)f.processAggregates(C,e,o,l,a,h,!0,v,m),f.processGroupedRecords(e,s.items,r,n,o,m+1,l,a,h,c,p,u,g),C=(b=new Ki(n)).generateRows(s.items.records,s),f.processAggregates(C,e,o,l,a,h,!1);else{f.processAggregates(C,e,o,l,a,h,!0,v,m),g=f.processRecord(o,r,n,s.items,e,m+1,p,u,g);var b=new Ki(n);C=b.generateRows(s.items,s);f.processAggregates(C,e,o,l,a,h,!1,null,null,!0)}})}(C[v])},r.prototype.processGridHeaders=function(i,r,n,o,s,l,a,h,d,c){var p=this,u=o.length+i,g=ve(c),f=c,m=0;this.parent.allowGrouping&&(m=this.parent.groupSettings.columns.length),r.columns.add(u),r.headers.add(n.length);var y=function(i,o,h,d,c){var u=r.headers.getHeader(i),g=u.cells.getCell(o),f=n[i].cells[o];t.isNullOrUndefined(h.headerTextAlign)||(g.style.stringFormat=p.getHorizontalAlignment(h.headerTextAlign)),d>0&&(g.rowSpan=d,g.style.stringFormat=p.getVerticalAlignment("Bottom",g.style.stringFormat,h.textAlign)),c>0&&(g.columnSpan=c),u.style.setBorder(s),u.style.setFont(l),u.style.setTextBrush(a),g.value=h.headerText,t.isNullOrUndefined(f)||f.cellType!==e.CellType.HeaderIndent&&f.cellType!==e.CellType.DetailHeader||(g.value="",g.width=20);var m={cell:g,gridCell:f,style:g.style};p.parent.trigger("pdfHeaderQueryCellInfo",m)},v=function(e,t,i,r,n,o){for(var s=0,l=0;l<e.length;l++)if(o&&(r=s=s+i+(0===l?0:-1),i=0),o||e[l].visible||(r-=1),e[l].columns&&e[l].columns.length){var a=v(e[l].columns,t-1,0,l+r,n+1,!1);y(n,l+r+m,e[l],0,a),i+=a,r=r+a-1}else(e[l].visible||p.hideColumnInclude)&&(i++,y(n,l+r+m,e[l],t,0));return i};return v(f,g,0,0,0,!0),r.columns.count>=6&&d&&(r.style.allowHorizontalOverflow=!0),r},r.prototype.processExportProperties=function(e,r){if(t.isNullOrUndefined(e))this.currentViewData=!1,this.customDataSource=!1;else{t.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme);var n=this.pdfPageSettings.size;if(this.drawHeader(e),!t.isNullOrUndefined(e.footer)){var o=e.footer,s=new d.PointF(0,n.width-80-.75*o.fromBottom),l=new d.SizeF(n.width-80,.75*o.height),a=new d.RectangleF(s,l);this.pdfDocument.template.bottom=this.drawPageTemplate(new d.PdfPageTemplateElement(a),o)}t.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),t.isNullOrUndefined(e.dataSource)?t.isNullOrUndefined(e.exportType)?(this.currentViewData=!1,this.customDataSource=!1):"CurrentPage"===e.exportType?(r=this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(e.dataSource instanceof i.DataManager||(r=e.dataSource),this.customDataSource=!0,this.currentViewData=!1)}return r},r.prototype.drawHeader=function(e){var i=this,r=this.pdfPageSettings.size;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.header)){var n=e.header,o=new d.PointF(0,n.fromTop),s=new d.SizeF(r.width-80,.75*n.height),l=new d.RectangleF(o,s);if(this.headerOnPages.length){var a=this.drawPageTemplate(new d.PdfPageTemplateElement(l),n);this.headerOnPages.filter(function(e){e-1>=0&&e-1<i.pdfDocument.pages.count-1&&i.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(a.template,new d.PointF(0,0))})}else this.pdfDocument.template.top=this.drawPageTemplate(new d.PdfPageTemplateElement(l),n)}},r.prototype.drawPageTemplate=function(e,t){for(var i=0,r=t.contents;i<r.length;i++){var n=r[i];switch(this.processContentValidation(n),n.type){case"Text":if(""===n.value||void 0===n.value||null===n.value||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if(void 0===n.src||null===n.src||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n);break;default:throw new Error("Please set valid content type...")}}return e},r.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},r.prototype.drawText=function(e,i){var r=this.getFont(i),n=this.getBrushFromContent(i),o=null;if(!t.isNullOrUndefined(i.style.textPenColor)){var s=this.hexToRgb(i.style.textPenColor);o=new d.PdfPen(new d.PdfColor(s.r,s.g,s.b))}null==n&&null==o&&(n=new d.PdfSolidBrush(new d.PdfColor(0,0,0)));var l=i.value.toString(),a=.75*i.position.x,h=.75*i.position.y,c=new d.PdfStringFormat,p=this.setContentFormat(i,c);null===p||t.isNullOrUndefined(p.format)||t.isNullOrUndefined(p.size)?e.graphics.drawString(l,r,o,n,a,h,c):e.graphics.drawString(l,r,o,n,a,h,p.size.width,p.size.height,p.format)},r.prototype.drawPageNumber=function(e,i){var r=this.getFont(i),n=null;if(t.isNullOrUndefined(i.style.textBrushColor))n=new d.PdfSolidBrush(new d.PdfColor(0,0,0));else{var o=this.hexToRgb(i.style.textBrushColor);n=new d.PdfSolidBrush(new d.PdfColor(o.r,o.g,o.b))}var s=new d.PdfPageNumberField(r,n);s.numberStyle=this.getPageNumberStyle(i.pageNumberType);var l,a;if(t.isNullOrUndefined(i.format))a="{0}",l=new d.PdfCompositeField(r,n,a,s);else{var h="$total";if(-1!==i.format.indexOf(h)&&-1!==i.format.indexOf("$current"))(c=new d.PdfPageCountField(r)).numberStyle=this.getPageNumberStyle(i.pageNumberType),a=i.format.indexOf(h)>i.format.indexOf("$current")?(a=i.format.replace("$current","0")).replace(h,"1"):(a=i.format.replace("$current","1")).replace(h,"0"),l=new d.PdfCompositeField(r,n,a,s,c);else if(-1!==i.format.indexOf("$current")&&-1===i.format.indexOf(h))a=i.format.replace("$current","0"),l=new d.PdfCompositeField(r,n,a,s);else{var c=new d.PdfPageCountField(r);a=i.format.replace(h,"0"),l=new d.PdfCompositeField(r,n,a,c)}}var p=.75*i.position.x,u=.75*i.position.y,g=this.setContentFormat(i,l.stringFormat);null===g||t.isNullOrUndefined(g.format)||t.isNullOrUndefined(g.size)||(l.stringFormat=g.format,l.bounds=new d.RectangleF(p,u,g.size.width,g.size.height)),l.draw(e.graphics,p,u)},r.prototype.drawImage=function(e,i){var r=.75*i.position.x,n=.75*i.position.y,o=t.isNullOrUndefined(i.size)?void 0:.75*i.size.width,s=t.isNullOrUndefined(i.size)?void 0:.75*i.size.height,l=new d.PdfBitmap(i.src);t.isNullOrUndefined(o)?e.graphics.drawImage(l,r,n):e.graphics.drawImage(l,r,n,o,s)},r.prototype.drawLine=function(e,i){var r=.75*i.points.x1,n=.75*i.points.y1,o=.75*i.points.x2,s=.75*i.points.y2,l=this.getPenFromContent(i);t.isNullOrUndefined(i.style)||null===i.style||(t.isNullOrUndefined(i.style.penSize)||null===i.style.penSize||"number"!=typeof i.style.penSize||(l.width=.75*i.style.penSize),l.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(l,r,n,o,s)},r.prototype.processAggregates=function(i,r,n,o,s,l,a,h,d,c){for(var p=0,u=i;p<u.length;p++){for(var g=u[p],f=-1,m=0,y=!0,v=[],C=0;C<r.columns.count;C++){var w=g.cells[m];if(w.cellType!==e.CellType.DetailFooterIntent){if(!this.hideColumnInclude){for(;void 0===w.visible;)if(w.cellType!==e.CellType.DetailFooterIntent){if(t.isNullOrUndefined(h))v.push("");else if(t.isNullOrUndefined(h.cells.getCell(C).value))v.push("");else{E={row:g,type:"GroupCaption",style:h.cells};this.parent.trigger("pdfAggregateQueryCellInfo",E),v.push(""),v.push(h.cells.getCell(C).value),y=!1,a||(C+=1)}C+=1,m+=1,w=g.cells[m]}for(;!t.isNullOrUndefined(w.visible)&&!w.visible;)m+=1,w=g.cells[m]}if(w.isDataCell){var b={};if(t.isNullOrUndefined(w.column.footerTemplate)&&t.isNullOrUndefined(w.column.groupCaptionTemplate)&&t.isNullOrUndefined(w.column.groupFooterTemplate)){var S=this.getSummaryWithoutTemplate(g.data[w.column.field]);t.isNullOrUndefined(S)||v.push(S)}else{b=(S=this.getTemplateFunction(b,C,f,w)).templateFunction,f=S.leastCaptionSummaryIndex;var R=void 0,x=g.data[w.column.field?w.column.field:w.column.columnName];this.parent.isReact||this.parent.isVue?(R=b[t.getEnumValue(e.CellType,w.cellType)](x,this.parent),this.parent.isReact&&this.parent.renderTemplates()):R=b[t.getEnumValue(e.CellType,w.cellType)](x),v.push(R[0].textContent),y=!1}}else v.push("");y&&""!==v[C]&&!t.isNullOrUndefined(v[C])&&null!==v[C]&&(y=!1),m+=1}else C--,m++}if(a)for(C=this.parent.groupSettings.columns.length+1;C<v.length-1;C++)v[C]=v[C+1];if(!y)if(a)for(C=0;C<r.columns.count;C++)h.cells.getCell(C).value=v[C].toString(),C===d+1&&-1!==f&&1!==f?h.cells.getCell(C).columnSpan=f-(d+1):C===d+1&&-1===f&&(h.cells.getCell(C).columnSpan=r.columns.count-(d+1));else{var F=r.rows.addRow();F.style.setBorder(n),F.style.setFont(o),F.style.setTextBrush(s),F.style.setBackgroundBrush(l);var E={row:g,type:c?"GroupFooter":"Footer",style:F.cells};this.parent.trigger("pdfAggregateQueryCellInfo",E);for(C=0;C<r.columns.count;C++)F.cells.getCell(C).value=v[C].toString()}}},r.prototype.getTemplateFunction=function(i,r,n,o){return t.isNullOrUndefined(o.column.footerTemplate)||o.cellType!==e.CellType.Summary?t.isNullOrUndefined(o.column.groupCaptionTemplate)?i[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]=t.compile(o.column.groupFooterTemplate):(-1===n&&(n=r),i[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]=t.compile(o.column.groupCaptionTemplate)):i[t.getEnumValue(e.CellType,e.CellType.Summary)]=t.compile(o.column.footerTemplate),{templateFunction:i,leastCaptionSummaryIndex:n}},r.prototype.getSummaryWithoutTemplate=function(e){return t.isNullOrUndefined(e.Sum)?t.isNullOrUndefined(e.Average)?t.isNullOrUndefined(e.Max)?t.isNullOrUndefined(e.Min)?t.isNullOrUndefined(e.Count)?t.isNullOrUndefined(e.TrueCount)?t.isNullOrUndefined(e.FalseCount)?t.isNullOrUndefined(e.Custom)?void 0:e.Custom:e.FalseCount:e.TrueCount:e.Count:e.Min:e.Max:e.Average:e.Sum},r.prototype.setColumnProperties=function(e,i,r,n,o){for(var s=n.groupSettings.columns.length,l=0;l<s;l++)i.columns.getColumn(l).width=20;for(l=0;l<e.length;l++)t.isNullOrUndefined(e[l].textAlign)||(i.columns.getColumn(l+s).format=this.getHorizontalAlignment(e[l].textAlign)),i.style.allowHorizontalOverflow&&!t.isNullOrUndefined(e[l].width)&&o&&(i.columns.getColumn(l+s).width="number"==typeof e[l].width?.75*e[l].width:.75*r.getConvertedWidth(e[l].width))},r.prototype.setRecordThemeStyle=function(e,i){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.record))e.style.setTextBrush(new d.PdfSolidBrush(new d.PdfColor(0,0,0)));else{var r=t.isNullOrUndefined(this.gridTheme.record.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=t.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,o=this.getFontStyle(this.gridTheme.record),s=new d.PdfStandardFont(r,n,o);t.isNullOrUndefined(this.gridTheme.record.font)||(s=this.gridTheme.record.font),e.style.setFont(s);var l=new d.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.record.fontColor)){var a=this.hexToRgb(this.gridTheme.record.fontColor);l=new d.PdfColor(a.r,a.g,a.b)}e.style.setTextBrush(new d.PdfSolidBrush(l))}var h=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):i;return e.style.setBorder(h),e},r.prototype.processRecord=function(i,r,n,o,s,l,a,h,c){for(var p=0,u=h.getGridRowModel(r,o,n,c);p<u.length;p++){var g=u[p];c++;for(var f=this.setRecordThemeStyle(s.rows.addRow(),i),m=g.cells.length,y=0;y<m;y++){var v=g.cells[y];if(v.cellType===e.CellType.Data){var C=v.column,w=C.field,b=t.isNullOrUndefined(w)?"":C.valueAccessor(w,g.data,C),S=t.isNullOrUndefined(b)?"":b,R=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(R=h.getFData(S,C),S=t.getValue(C.foreignKeyValue,R)),(O={data:g.data,value:S,column:C,style:void 0,colSpan:1,cell:I=f.cells.getCell(y)}).value="boolean"===O.column.type&&"string"==typeof O.value?O.value:this.exportValueFormatter.formatCellValue(O,n.isServerRendered),this.parent.trigger("pdfQueryCellInfo",O),t.isNullOrUndefined(O.image)||(O.value=new d.PdfBitmap(O.image.base64)),I.value=O.value,!t.isNullOrUndefined(O.hyperLink)){var x=new d.PdfTextWebLink;x.url=O.hyperLink.target,x.text=O.hyperLink.displayText||O.hyperLink.target,x.font=new d.PdfStandardFont(d.PdfFontFamily.Helvetica,9.75),x.brush=new d.PdfSolidBrush(new d.PdfColor(51,102,187)),I.value=x}if(t.isNullOrUndefined(O.style)||this.processCellStyle(I,O),O.colSpan>1){y+1+O.colSpan>f.cells.count&&(O.colSpan=f.cells.count-(y+1)),I.columnSpan=O.colSpan;for(var F=1;F<I.columnSpan;F++)f.cells.getCell(y+F).value="";y+=O.colSpan-1}}}if(g.isExpand){var E=this.setRecordThemeStyle(s.rows.addRow(),i),I=E.cells.getCell(l);I.columnSpan=E.cells.count-l,I.style.cellPadding=new d.PdfPaddings(10,10,10,10),n.isPrinting=!0;var T=!t.isNullOrUndefined(a)&&a.exportType?a.exportType:"AllPages",z=this.helper.createChildGrid(n,g,T,this.gridPool),D=z.childGrid,M=z.element;D.actionFailure=h.failureHandler(this.gridPool,D,this.globalResolve);var O={childGrid:D,row:g,cell:I,exportProperties:a};this.parent.trigger("exportdetaildatabound",O),D.beforeDataBound=this.childGridCell(I,D,a),D.appendTo(M)}this.parent.notify("export-RowDataBound",{type:"pdf",rowObj:g})}return c},r.prototype.childGridCell=function(e,i,r){var n=this;return function(o){return i.beforeDataBound=null,o.cancel=!0,e.value=n.processGridExport(i,o,r),i.destroy(),t.detach(i.element),n.gridPool[i.id]=!0,n.helper.checkAndExport(n.gridPool,n.globalResolve),e}},r.prototype.processCellStyle=function(e,i){if(!t.isNullOrUndefined(i.style.backgroundColor)){var r=this.hexToRgb(i.style.backgroundColor);e.style.backgroundBrush=new d.PdfSolidBrush(new d.PdfColor(r.r,r.g,r.b))}if(t.isNullOrUndefined(i.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(i.style.textAlignment)),t.isNullOrUndefined(i.style.cellPadding)||(e.style.cellPadding=i.style.cellPadding),t.isNullOrUndefined(i.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(i.style.verticalAlignment,e.style.stringFormat)),!t.isNullOrUndefined(i.style.textBrushColor)){var n=this.hexToRgb(i.style.textBrushColor);e.style.textBrush=new d.PdfSolidBrush(new d.PdfColor(n.r,n.g,n.b))}if(!t.isNullOrUndefined(i.style.textPenColor)){var o=this.hexToRgb(i.style.textPenColor);e.style.textPen=new d.PdfPen(new d.PdfColor(o.r,o.g,o.b))}if(t.isNullOrUndefined(i.style.fontFamily)&&t.isNullOrUndefined(i.style.fontSize)&&t.isNullOrUndefined(i.style.bold)&&t.isNullOrUndefined(i.style.italic)&&t.isNullOrUndefined(i.style.underline)&&t.isNullOrUndefined(i.style.strikeout)||(e.style.font=this.getFont(i)),!t.isNullOrUndefined(i.style.border)){var s=new d.PdfBorders,l=i.style.border.width,a=t.isNullOrUndefined(l)||"number"!=typeof l?void 0:.75*l,h=new d.PdfColor(196,196,196);if(!t.isNullOrUndefined(i.style.border.color)){var c=this.hexToRgb(i.style.border.color);h=new d.PdfColor(c.r,c.g,c.b)}var p=new d.PdfPen(h,a);t.isNullOrUndefined(i.style.border.dashStyle)||(p.dashStyle=this.getDashStyle(i.style.border.dashStyle)),s.all=p,e.style.borders=s}t.isNullOrUndefined(i.style.paragraphIndent)||(e.style.stringFormat=new d.PdfStringFormat,e.style.stringFormat.paragraphIndent=i.style.paragraphIndent)},r.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new d.PdfStringFormat),e){case"Right":t.alignment=d.PdfTextAlignment.Right;break;case"Center":t.alignment=d.PdfTextAlignment.Center;break;case"Justify":t.alignment=d.PdfTextAlignment.Justify;break;case"Left":t.alignment=d.PdfTextAlignment.Left}return t},r.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new d.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=d.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=d.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=d.PdfVerticalAlignment.Top}return t},r.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},r.prototype.getFont=function(e){if(e.font)return e.font;var i=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,r=t.isNullOrUndefined(e.style.fontFamily)?d.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=d.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=d.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=d.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=d.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=d.PdfFontStyle.Strikeout),new d.PdfStandardFont(r,i,n)},r.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},r.prototype.setContentFormat=function(e,i){if(!t.isNullOrUndefined(e.size)){var r=.75*e.size.width,n=.75*e.size.height;if(i=new d.PdfStringFormat(d.PdfTextAlignment.Left,d.PdfVerticalAlignment.Middle),!t.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":i.alignment=d.PdfTextAlignment.Right;break;case"Center":i.alignment=d.PdfTextAlignment.Center;break;case"Justify":i.alignment=d.PdfTextAlignment.Justify;break;default:i.alignment=d.PdfTextAlignment.Left}return t.isNullOrUndefined(e.style.vAlign)||(i=this.getVerticalAlignment(e.style.vAlign,i)),{format:i,size:new d.SizeF(r,n)}}return null},r.prototype.getPageSize=function(e){switch(e){case"Letter":return new d.SizeF(612,792);case"Note":return new d.SizeF(540,720);case"Legal":return new d.SizeF(612,1008);case"A0":return new d.SizeF(2380,3368);case"A1":return new d.SizeF(1684,2380);case"A2":return new d.SizeF(1190,1684);case"A3":return new d.SizeF(842,1190);case"A5":return new d.SizeF(421,595);case"A6":return new d.SizeF(297,421);case"A7":return new d.SizeF(210,297);case"A8":return new d.SizeF(148,210);case"A9":return new d.SizeF(105,148);case"B0":return new d.SizeF(2836,4008);case"B1":return new d.SizeF(2004,2836);case"B2":return new d.SizeF(1418,2004);case"B3":return new d.SizeF(1002,1418);case"B4":return new d.SizeF(709,1002);case"B5":return new d.SizeF(501,709);case"Archa":return new d.SizeF(648,864);case"Archb":return new d.SizeF(864,1296);case"Archc":return new d.SizeF(1296,1728);case"Archd":return new d.SizeF(1728,2592);case"Arche":return new d.SizeF(2592,3456);case"Flsa":return new d.SizeF(612,936);case"HalfLetter":return new d.SizeF(396,612);case"Letter11x17":return new d.SizeF(792,1224);case"Ledger":return new d.SizeF(1224,792);default:return new d.SizeF(595,842)}},r.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},r.prototype.getPenFromContent=function(e){var i=new d.PdfPen(new d.PdfColor(0,0,0));if(!t.isNullOrUndefined(e.style)&&null!==e.style&&!t.isNullOrUndefined(e.style.penColor)){var r=this.hexToRgb(e.style.penColor);i=new d.PdfPen(new d.PdfColor(r.r,r.g,r.b))}return i},r.prototype.getBrushFromContent=function(e){var i=null;if(!t.isNullOrUndefined(e.style.textBrushColor)){var r=this.hexToRgb(e.style.textBrushColor);i=new d.PdfSolidBrush(new d.PdfColor(r.r,r.g,r.b))}return i},r.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},r.prototype.getFontStyle=function(e){var i=d.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(i|=d.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(i|=d.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(i|=d.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(i|=d.PdfFontStyle.Strikeout),i},r.prototype.getBorderStyle=function(e){var i=new d.PdfBorders;if(t.isNullOrUndefined(e))i.all=new d.PdfPen(new d.PdfColor(234,234,234));else{var r=e.width,n=t.isNullOrUndefined(r)||"number"!=typeof r?void 0:.75*r,o=new d.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var s=this.hexToRgb(e.color);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfPen(o,n);t.isNullOrUndefined(e.dashStyle)||(l.dashStyle=this.getDashStyle(e.dashStyle)),i.all=l}return i},r.prototype.destroy=function(){},r}(),qo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ho=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.buttonElement=r.parent.createElement("button",{}),r.unbounDiv=r.parent.createElement("div",{className:"e-unboundcelldiv",styles:"display: inline-block"}),r.element=r.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{role:"gridcell",tabindex:"-1"}}),r}return qo(i,e),i.prototype.render=function(e,i,r,n){var o=this.element.cloneNode();if(o.appendChild(this.unbounDiv.cloneNode()),o.setAttribute("aria-label","is Command column column header "+e.column.headerText),e.column.commandsTemplate)if(this.parent.isReact&&"string"!=typeof e.column.commandsTemplate){var s=this.parent+"commandsTemplate";e.column.getColumnTemplate()(i,this.parent,"commandsTemplate",s,null,null,o.firstElementChild),this.parent.renderTemplates()}else q(o.firstElementChild,e.column.getColumnTemplate()(i));else for(var l=0,a=e.commands;l<a.length;l++){var h=a[l];o=this.renderButton(o,h,r.index,h.uid)}return this.setAttributes(o,e,r),!this.parent.enableVirtualization&&this.parent.isEdit||n?(t.addClass([].slice.call(o.getElementsByClassName("e-edit-delete")),"e-hide"),t.removeClass([].slice.call(o.getElementsByClassName("e-save-cancel")),"e-hide")):(t.addClass([].slice.call(o.getElementsByClassName("e-save-cancel")),"e-hide"),t.removeClass([].slice.call(o.getElementsByClassName("e-edit-delete")),"e-hide")),o},i.prototype.renderButton=function(e,i,r,o){var s=this.buttonElement.cloneNode();t.attributes(s,{id:this.parent.element.id+(i.type||"")+"_"+r+"_"+o,type:"button",title:t.isNullOrUndefined(i.title)?i.buttonOption.content||this.localizer.getConstant(i.type)||i.type:i.title,"data-uid":o}),s.onclick=i.buttonOption.click;var l=new n.Button(i.buttonOption,s);switch(l.commandType=i.type,e.firstElementChild.appendChild(l.element),i.type){case"Edit":case"Delete":t.addClass([s],["e-edit-delete","e-"+i.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":t.addClass([s],["e-save-cancel","e-"+i.type.toLowerCase()+"button"])}return e},i}($i),Uo=function(){function i(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}return i.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(e.CellType.CommandColumn,new Ho(this.parent,this.locator))},i.prototype.commandClickHandler=function(e){var i=this.parent,r=t.closest(e.target,"button");if(r&&t.closest(e.target,".e-unboundcell")){for(var n,o=r.ej2_instances[0],s=o.commandType,l=r.getAttribute("data-uid"),a=i.getRowObjectFromUID(t.closest(r,"."+Oi).getAttribute("data-uid")),h=this.parent.columnModel,d=0;d<h.length;d++)if(h[d].commands)for(var c=h[d].commands,p=0;p<c.length;p++){c[p].uid===l&&c[p].type===s&&(n=c[p])}var u={cancel:!1,target:r,commandColumn:n,rowData:t.isNullOrUndefined(a)?void 0:a.data};this.parent.trigger("commandClick",u,function(e){if(!o.disabled&&i.editModule&&!e.cancel)switch(s){case"Edit":i.editModule.endEdit(),i.editModule.startEdit(t.closest(r,"tr"));break;case"Cancel":i.editModule.closeEdit();break;case"Save":i.editModule.endEdit();break;case"Delete":"Batch"!==i.editSettings.mode&&i.editModule.endEdit(),i.commandDelIndex=parseInt(t.closest(r,"tr").getAttribute(Hi),10),i.clearSelection(),i.selectRow(i.commandDelIndex,!1),i.editModule.deleteRecord(),i.commandDelIndex=void 0}})}},i.prototype.getModuleName=function(){return"commandColumn"},i.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Gt,this.commandClickHandler),this.parent.off(Vt,this.keyPressHandler),this.parent.off(Ot,this.load))},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Gt,this.commandClickHandler,this),this.parent.on(Vt,this.keyPressHandler,this),this.parent.on(Ot,this.load,this))},i.prototype.keyPressHandler=function(e){"enter"===e.action&&t.closest(e.target,".e-unboundcelldiv")&&(this.commandClickHandler(e),e.preventDefault())},i.prototype.load=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)if(e[t].commands)for(var i=e[t].commands,r=0;r<i.length;r++)i[r].uid=L("gridcommand")},i}(),jo={header:"."+Si,content:"."+Ri,edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup"},Vo=function(){function e(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Bt,this.enableAfterRenderMenu,this),this.parent.on(Mt,this.render,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Mt,this.render),this.parent.off(Bt,this.enableAfterRenderMenu),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},e.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify("restore-Focus",{}))},e.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),t.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new a.ContextMenu({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-grid-menu"}),this.contextMenu.appendTo(this.element)},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),t.remove(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},e.prototype.getMenuItems=function(){for(var e=[],t=[],i=0,r=this.parent.contextMenuItems;i<r.length;i++){var n=r[i];"string"==typeof n&&-1!==this.getDefaultItems().indexOf(n)?-1!==n.toLocaleLowerCase().indexOf("export")?t.push(this.buildDefaultItems(n)):e.push(this.buildDefaultItems(n)):"string"!=typeof n&&e.push(n)}if(t.length>0){var o=this.buildDefaultItems("export");o.items=t,e.push(o)}return e},e.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},e.prototype.contextMenuOpen=function(){this.isOpen=!0},e.prototype.contextMenuItemClick=function(e){switch(this.getKeyFromId(e.item.id)){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute(qi),10))&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(Hi),10),this.parent.getColumns()[parseInt(this.cell.getAttribute(qi),10)].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?this.parent.editModule.deleteRow(this.row):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&this.parent.editModule.endEdit();break;case"Cancel":this.parent.editModule&&this.parent.editModule.closeEdit();break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1)}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuClick",e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&this.updateItemStatus(),this.parent.notify("select-row-on-context-open",{isOpen:!1})},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.contextMenuBeforeOpen=function(e){var i=t.closest(e.event.target,".e-grid");if(e.event&&i&&i!==this.parent.element)e.cancel=!0;else if(e.event&&(t.closest(e.event.target,"."+jo.groupHeader)||t.closest(e.event.target,"."+jo.touchPop)||t.closest(e.event.target,".e-summarycell")||t.closest(e.event.target,".e-groupcaption")||t.closest(e.event.target,".e-filterbarcell")))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),this.targetRowdata=this.parent.getRowInfo(e.event.target),t.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify("select-row-on-context-open",{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var r=[],n=[],o=0,s=e.items;o<s.length;o++){var l=s[o],a=this.getKeyFromId(l.id),h=this.defaultItems[a];if(-1!==this.getDefaultItems().indexOf(a))if(this.ensureDisabledStatus(a)&&this.disableItems.push(l.text),e.event&&(this.ensureTarget(e.event.target,jo.edit)||this.ensureTarget(e.event.target,jo.batchEdit)))"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(l.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(t.closest(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges().changedRecords.length||this.parent.editModule.getBatchChanges().addedRecords.length||this.parent.editModule.getBatchChanges().deletedRecords.length)&&("Save"===a||"Cancel"===a))continue;t.isNullOrUndefined(e.parentItem)&&e.event&&!this.ensureTarget(e.event.target,h.target)&&this.hiddenItems.push(l.text)}else l.target&&e.event&&!this.ensureTarget(e.event.target,l.target)?l.separator?r.push(l.id):this.hiddenItems.push(l.text):this.ensureTarget(e.event.target,l.target)&&l.separator&&n.push(l.id)}n.length>0&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),r.length>0&&this.contextMenu.hideItems(r,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuOpen",e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}Se(this.parent.element,this.contextMenu.element.parentElement)},e.prototype.ensureTarget=function(e,i){var r=e;return(r=!this.ensureFrozenHeader(e)||i!==jo.header&&i!==jo.content?i===jo.content||i===jo.header?O(t.closest(e,"."+Mi),i.substr(1,i.length)):t.closest(e,i):t.closest(e,i===jo.header?"thead":Ui))&&O(r,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.isFrozenGrid()&&!this.parent.frozenRows||!t.closest(e,jo.header))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(Kn)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Jn)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":(!this.parent.allowGrouping||!this.parent.ensureModuleInjected(Jn)||this.parent.ensureModuleInjected(Jn)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":0!==this.parent.getSelectedRowIndexes().length&&0!==this.parent.getCurrentViewRecords().length||(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.excelExport&&(this.parent.ensureModuleInjected(Lo)||this.parent.ensureModuleInjected(No))||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(Lo)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(No)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(xn)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(xn)&&this.parent.sortSettings.columns.length>0&&this.targetColumn)for(var i=this.parent.sortSettings.columns,r=0;r<i.length;r++)i[r].field===this.targetColumn.field&&i[r].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(On)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(On)&&1===this.parent.pageSettings.currentPage)&&(t=!0);break;case"LastPage":case"NextPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(On)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(On)&&this.parent.pageSettings.currentPage===this.getLastPage())&&(t=!0)}return t},e.prototype.getContextMenu=function(){return this.element},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.contextMenu.destroy(),t.remove(this.element),this.removeEventListener(),this.parent.element.classList.remove("e-noselect"))},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},e.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},e.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":case"AutoFit":t={target:jo.header};break;case"Group":t={target:jo.header,iconCss:jo.group};break;case"Ungroup":t={target:jo.header,iconCss:jo.ungroup};break;case"Edit":t={target:jo.content,iconCss:jo.editIcon};break;case"Delete":t={target:jo.content,iconCss:jo.delete};break;case"Save":t={target:jo.edit,iconCss:jo.save};break;case"Cancel":t={target:jo.edit,iconCss:jo.cancel};break;case"Copy":t={target:jo.content,iconCss:jo.copy};break;case"export":t={target:jo.content};break;case"PdfExport":t={target:jo.content,iconCss:jo.pdf};break;case"ExcelExport":t={target:jo.content,iconCss:jo.excel};break;case"CsvExport":t={target:jo.content,iconCss:jo.csv};break;case"SortAscending":t={target:jo.header,iconCss:jo.ascending};break;case"SortDescending":t={target:jo.header,iconCss:jo.descending};break;case"FirstPage":t={target:jo.pager,iconCss:jo.fPage};break;case"PrevPage":t={target:jo.pager,iconCss:jo.pPage};break;case"LastPage":t={target:jo.pager,iconCss:jo.lPage};break;case"NextPage":t={target:jo.pager,iconCss:jo.nPage}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[e]},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage"]},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage"}},e.prototype.getColumn=function(e){var i=t.closest(e.target,"th.e-headercell");if(i){var r=i.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(r)}return this.parent.getRowInfo(e.target).column||null},e.prototype.selectRow=function(e,i){this.cell=e.target,this.row=t.closest(e.target,"tr.e-row")||this.row,this.row&&i&&!O(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(Hi),10))},e}(),Go=function(){function e(e){this.parent=e,this.rowModelGenerator=new Gi(this.parent)}return e.prototype.generateRows=function(e,t,i){var r;if(r=t.renderFrozenRightContent||t.renderMovableContent&&!this.parent.enableVirtualization?"frozen-right":t.renderMovableContent||t.isFrozen?"movable":this.parent.getFrozenLeftCount()?"frozen-left":"frozen-right","virtualscroll"===t.requestType&&"X"===t.virtualInfo.sentinelInfo.axis&&"movable"!==r)return null;for(var n=this.parent.enableVirtualization&&!t.isFrozenRowsRender?i:this.rowModelGenerator.generateRows(e,t),o=0,s=n.length;o<s;o++)n[o].cells=Ae(this.parent,n[o].cells,r);return n},e}(),_o=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.isInitialRender=!0,r.widthService=i.getService("widthService"),r.addEventListener(),r}return _o(i,e),i.prototype.addEventListener=function(){this.parent.addEventListener(St,this.actionComplete.bind(this)),this.parent.addEventListener("batchAdd",this.batchAdd.bind(this)),this.parent.on("batchCancel",this.batchAdd.bind(this)),this.parent.addEventListener("batchDelete",this.batchAdd.bind(this)),this.parent.on("set-height-to-frozen-element",this.refreshScrollOffset),this.parent.on(Wt,this.widthService.refreshFrozenScrollbar,this)},i.prototype.batchAdd=function(e){var t="batchCancel"!==e.name&&!(this.parent.frozenRows&&"Top"===this.parent.editSettings.newRowPosition);if("auto"!==this.parent.height&&(t||"batchCancel"===e.name||"batchDelete"===e.name)){this.refreshScrollOffset();var i=this.getTable().offsetHeight;"add"===e.name&&"Bottom"===this.parent.editSettings.newRowPosition&&this.parent.getContent().firstChild.scroll(0,i)}},i.prototype.setHeightToContent=function(e){this.getFrozenContent().style.height=e.toString()+"px",this.getMovableContent().style.height=e.toString()+"px"},i.prototype.actionComplete=function(e){if("Dialog"!==this.parent.editSettings.mode&&("add"===e.requestType||"cancel"===e.requestType&&e.row.classList.contains(Bi))&&(!this.parent.frozenRows||"Bottom"===this.parent.editSettings.newRowPosition)&&"auto"!==this.parent.height){this.refreshScrollOffset();var t=this.getTable().offsetHeight;"add"===e.requestType&&"Bottom"===this.parent.editSettings.newRowPosition&&this.parent.getContent().firstChild.scroll(0,t)}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.removeEventListener(St,this.actionComplete),this.parent.removeEventListener("batchAdd",this.batchAdd),this.parent.off(Wt,this.widthService.refreshFrozenScrollbar))},i.prototype.renderPanel=function(){e.prototype.renderPanel.call(this);var i=this.parent.element.querySelector("."+Ti),r=this.parent.element.querySelector("."+Ei);t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozencontent e-frozen-left-content"}),r=this.parent.createElement("div",{className:Ei}),this.getPanel().querySelector("."+Di).appendChild(i),this.getPanel().querySelector("."+Di).appendChild(r),r.style.scrollbarWidth="none"),this.setFrozenContent(i),this.setMovableContent(r),t.Browser.userAgent.indexOf("Mac OS")>-1&&"safari"===t.Browser.info.name&&!this.parent.enableVirtualization&&this.getPanel().firstElementChild.classList.add("e-mac-safari")},i.prototype.renderFrozenRigthPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderEmpty=function(i){e.prototype.renderEmpty.call(this,i),this.getMovableContent().querySelector(Ui).innerHTML="<tr><td></td></tr>",t.addClass([this.getMovableContent().querySelector(Ui).querySelector("tr")],["e-emptyrow"]),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenColumns(),this.getFrozenContent().style.borderRightWidth="0px",this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector("."+zi).querySelector(Ui).innerHTML="",this.parent.getHeaderContent().querySelector("."+Ii).querySelector(Ui).innerHTML="")},i.prototype.renderFrozenRightEmpty=function(t){e.prototype.renderEmpty.call(this,t)},i.prototype.setFrozenContent=function(e){this.frozenContent=e},i.prototype.setMovableContent=function(e){this.movableContent=e},i.prototype.getFrozenContent=function(){return this.frozenContent},i.prototype.getMovableContent=function(){return this.movableContent},i.prototype.getModelGenerator=function(){return new Go(this.parent)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.renderTable=function(){var i;null==this.getFrozenContent().querySelector("."+Mi)?(e.prototype.renderTable.call(this),this.getFrozenContent().appendChild(this.getTable()),i=this.getTable().cloneNode(!0),this.getMovableContent().appendChild(i)):(this.setTable(this.getFrozenContent().querySelector("."+Mi)),this.setColGroup(this.parent.element.querySelector("."+Si).querySelector(ji).cloneNode(!0)),this.getFrozenContent().querySelector("."+Mi).appendChild(this.getColGroup()),i=this.getMovableContent().querySelector("."+Mi),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")),this.getMovableContent().querySelector(ji)&&t.remove(this.getMovableContent().querySelector(ji));var r=this.parent.getHeaderContent().querySelector("."+Ii).querySelector(ji).cloneNode(!0);i.insertBefore(r,i.querySelector(Ui));var n=this.parent.enableVirtualization?"":"flex";this.getPanel().firstChild.style.display=n,this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-left-scrollbar",this.getScrollbarDisplay())},i.prototype.getScrollbarDisplay=function(){var e="";return(this.parent.getFrozenColumns()&&!this.parent.getVisibleFrozenColumns()||this.parent.getFrozenLeftColumnsCount()&&!this.parent.getVisibleFrozenLeftCount())&&(e="none"),e},i.prototype.renderHorizontalScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:e,styles:"display:"+t}),n=this.parent.createElement("div",{className:"e-movablescrollbar"}),o=this.parent.createElement("div",{className:"e-movablechild"}),s=j().toString();this.setScrollbarHeight(n,s),this.setScrollbarHeight(o,s),n.appendChild(o),this.appendScrollbar(r,n,i)},i.prototype.appendScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:"e-scrollbar",styles:"display: flex"});r.appendChild(e),r.appendChild(t),this.parent.getContent().appendChild(r)},i.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},i.prototype.setIsFrozen=function(e,t){e.isFrozen=!e.isFrozen},i.prototype.setTbody=function(e,i){var r;t.isNullOrUndefined(e[0].cells[0])&&(this.getMovableContent().querySelector(Ui).innerHTML="");var n=e[0].cells[0],o=n.index;return t.isUndefined(o)&&this.parent.isRowDragable()&&(o=(n=e[0].cells[1]).index),0===o&&(this.getPanel().firstChild.style.overflowX="hidden",this.parent.enableColumnVirtualization&&(this.getMovableContent().style.overflowX="hidden")),this.parent.enableColumnVirtualization&&i.renderMovableContent&&"virtualscroll"===i.requestType&&this.getMovableContent().scrollLeft>0&&0!==i.virtualInfo.columnIndexes[0]&&(o=this.parent.getFrozenColumns()),n&&n.column&&(r=n.column.getFreezeTableName()),this.setIdx(o),i.tableName=r,r},i.prototype.splitRows=function(e){e===Li?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows},i.prototype.renderNextFrozentPart=function(e,i){var r=this.parent.enableVirtualization;i===Li&&(r&&(e.renderMovableContent=!0),this.refreshContentRows(t.extend({},e)))},i.prototype.appendContent=function(e,i,r,n){this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:e.appendChild(i),n===Li?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e)):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset(),this.widthService.refreshFrozenScrollbar()),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1)},i.prototype.refreshScrollOffset=function(){if("auto"!==this.parent.height){var e=this.getTable().offsetHeight+1;this.setHeightToContent(e)}this.parent.notify("refresh-frozen-height",{})},i.prototype.getFrozenHeader=function(e){return e===Li?this.parent.getHeaderContent().querySelector("."+zi).querySelector(Ui):this.parent.getHeaderContent().querySelector("."+Ii).querySelector(Ui)},i.prototype.refreshTbody=function(e){e.childElementCount<1&&e.appendChild(this.parent.createElement("tr").appendChild(this.parent.createElement("td")))},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(oi,{case:"refreshHeight"}),this.getFrozenContent().style.borderRightWidth="1px"},i.prototype.setIdx=function(e){this.idx=e},i.prototype.getIdx=function(){return this.idx},i.prototype.getTbody=function(e){return e===Li?this.getTable().querySelector(Ui):this.getMovableContent().querySelector(Ui)},i}(Yi),Ko=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.addEventListener(),r}return _o(i,e),i.prototype.addEventListener=function(){this.eventHandler=[{event:oi,handler:this.refreshFreeze},{event:"frozenHeight",handler:this.setFrozenHeight},{event:Bt,handler:this.enableAfterRender}],Xe(this.parent,this.eventHandler,!0,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||Xe(this.parent,this.eventHandler,!1)},i.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.renderPanel=function(){var i=this.parent.element.querySelector("."+zi),r=this.parent.element.querySelector("."+Ii);e.prototype.renderPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-left-header"}),r=this.parent.createElement("div",{className:Ii}),this.getPanel().querySelector("."+Fi).appendChild(i),this.getPanel().querySelector("."+Fi).appendChild(r)),this.setFrozenHeader(i),this.setMovableHeader(r)},i.prototype.renderFrozenRightPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.refreshUI=function(){var i=this.getMovableHeader().querySelector(Ui);t.remove(this.getMovableHeader().querySelector("table")),e.prototype.refreshUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector(Ui).innerHTML=i.innerHTML,this.updateColgroup(),this.widthService.setWidthToColumns(),this.parent.enableVirtualization||this.widthService.setWidthToTable(),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&J([].slice.call(this.movableHeader.querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor(),de(this.parent.getContentTable().querySelector(ji),this.parent.getFrozenColumns(),this.parent),this.widthService.refreshFrozenScrollbar(),this.initializeHeaderDrag(),this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.refreshFrozenLeftUI=function(){e.prototype.refreshUI.call(this)},i.prototype.rfshMovable=function(){this.getFrozenHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createHeader(void 0,"movable")),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},i.prototype.addMovableFirstCls=function(){if(this.parent.getVisibleFrozenColumns())for(var e=[].slice.call(this.parent.element.querySelector("."+Ii).querySelector("thead").getElementsByClassName("e-columnheader")),i=e.length,r=0;r<i;r++){var n=e[r].cells[0];n&&(t.addClass([n],["e-movablefirst"]),e[r].cells[0].rowSpan>1&&(r+=e[r].cells[0].rowSpan-1))}},i.prototype.refreshFreeze=function(e){if("filter"===e.case){var t=this.getTable().querySelector(".e-filterbar");if(this.parent.allowFiltering&&t&&this.getMovableHeader().querySelector("thead")){this.getMovableHeader().querySelector("thead").appendChild(this.filterRenderer(t,this.parent.getFrozenColumns()));for(var i=0,r=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));i<r.length;i++){var n={element:r[i],floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.bindInitialEvent(n)}}}else"textwrap"!==e.case&&"refreshHeight"!==e.case||(this.refreshHeight(e),this.parent.contentModule.refreshScrollOffset())},i.prototype.refreshHeight=function(e){var t,i,r=this.getFrozenHeader(),n=this.getMovableHeader(),o=this.parent.getContent(),s=this.parent.textWrapSettings.wrapMode,l=this.parent.getHeaderContent().querySelector("."+Fi).classList;"textwrap"===e.case?(("Header"!==s||e.isModeChg)&&(t=o.querySelector("."+Ti).querySelectorAll("tr"),i=o.querySelector("."+Ei).querySelectorAll("tr"),this.setWrapHeight(t,i,e.isModeChg,!0)),"Content"===s&&this.parent.allowTextWrap?l.add("e-wrap"):l.remove("e-wrap"),"Both"===s||e.isModeChg?(t=r.querySelectorAll("tr"),i=n.querySelectorAll("tr")):(i=n.querySelector("Content"===s?Ui:"thead").querySelectorAll("tr"),t=r.querySelector("Content"===s?Ui:"thead").querySelectorAll("tr")),this.parent.getHeaderContent().getElementsByClassName("e-stackedheadercell").length||this.setWrapHeight(t,i,e.isModeChg,!1,this.colDepth>1),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(this.setWrapHeight(o.querySelector("."+Ti).querySelectorAll("tr"),o.querySelector("."+Ei).querySelectorAll("tr"),e.isModeChg),this.parent.getHeaderContent().getElementsByClassName("e-stackedheadercell").length||this.setWrapHeight(r.querySelectorAll("tr"),n.querySelectorAll("tr"),e.isModeChg))},i.prototype.enableAfterRender=function(e){"scroll"===e.module&&this.setFrozenHeight()},i.prototype.updateResizeHandler=function(){for(var e=[].slice.call(this.parent.getHeaderContent().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[t].style.height=e[t].parentElement.offsetHeight+"px"},i.prototype.setWrapHeight=function(e,i,r,n,o){for(var s,l,a=this.parent.allowTextWrap,h=this.parent.textWrapSettings.wrapMode,d=this.parent.getHeaderContent().querySelector("thead"),c=this.parent.getHeaderContent().querySelector(Ui),p=[],u=[],g=0,f=e.length;g<f;g++)t.isNullOrUndefined(e[g])||t.isNullOrUndefined(i[g])||(p[g]=e[g].getBoundingClientRect().height,u[g]=i[g].getBoundingClientRect().height);for(var g=0,f=e.length;g<f;g++)(r&&("Header"===h&&n||"Content"===h&&d.contains(e[g])||"Header"===h&&c.contains(e[g]))||o)&&(e[g].style.height=null,i[g].style.height=null),s=p[g],l=u[g],!t.isNullOrUndefined(e[g])&&e[g].childElementCount&&(a&&s<l||!a&&s<l||this.parent.allowResizing&&this.parent.resizeModule&&!1===this.parent.resizeModule.isFrozenColResized)&&(e[g].style.height=l+"px"),i&&!t.isNullOrUndefined(i[g])&&i[g].childElementCount&&(a&&s>l||!a&&s>l||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[g].style.height=s+"px");a&&"auto"!==this.parent.height&&this.setFrozenHeight()},i.prototype.setFrozenHeight=function(e){void 0===e&&(e=j());var t=this.parent.element.querySelector("."+Ei).getBoundingClientRect().height,i=this.parent.element.querySelector("."+Ei),r=this.parent.element.querySelector("."+Ti),n=this.parent.getContent().scrollWidth,o=this.parent.element.querySelector(".e-movablecontent table").scrollWidth+this.parent.getContentTable().scrollWidth;i.scrollWidth-i.clientWidth?(r.style.height=t-e+"px",r.style.borderBottom=""):(r.style.height=t+"px",(r.scrollHeight<=r.clientHeight||i.scrollHeight<=i.clientHeight)&&n===o&&this.parent.scrollModule.removePadding(),r.style.borderBottom="0px")},i.prototype.refreshStackedHdrHgt=function(){for(var e,t,i=[].slice.call(this.getFrozenHeader().getElementsByClassName("e-columnheader")),r=[].slice.call(this.getMovableHeader().getElementsByClassName("e-columnheader")),n=0,o=i.length;n<o;n++)e=this.getRowSpan(i[n]),t=this.getRowSpan(r[n]),e.min>1?this.updateStackedHdrRowHgt(n,e.max,i[n],r):t.min>1&&this.updateStackedHdrRowHgt(n,t.max,r[n],i);this.parent.allowResizing&&this.updateResizeHandler()},i.prototype.getRowSpan=function(e){for(var t,i,r,n=0,o=e.childElementCount;n<o;n++)0===n&&(i=e.children[0].rowSpan),t=e.children[n].rowSpan,i=Math.min(t,i),r=Math.max(t,i);return{min:i,max:r}},i.prototype.updateStackedHdrRowHgt=function(e,t,i,r){for(var n=0,o=0;o<t;o++)n+=r[e+o].style.height?parseInt(r[e+o].style.height,10):r[e+o].offsetHeight;i.style.height=n+"px"},i.prototype.setFrozenHeader=function(e){this.frozenHeader=e},i.prototype.setMovableHeader=function(e){this.movableHeader=e},i.prototype.getFrozenHeader=function(){return this.frozenHeader},i.prototype.getMovableHeader=function(){return this.movableHeader},i.prototype.updateColgroup=function(){var e=this.getMovableHeader().querySelector("table");t.remove(this.getMovableHeader().querySelector(ji)),e.insertBefore(de(this.getFrozenHeader().querySelector(ji),this.parent.getFrozenColumns(),this.parent),e.querySelector("thead"))},i.prototype.filterRenderer=function(e,t,i){var r=e.cloneNode(!0);r.innerHTML="";for(var n=i||this.parent.getColumns().length,o=t;o<n;o++)r.appendChild(e.removeChild(e.children[t]));return r},i}(Zi),Qo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.addEventListener(),r}return Qo(i,e),i.prototype.addEventListener=function(){this.evtHandlers=[{event:oi,handler:this.refreshFreeze},{event:"refresh-frozen-columns",handler:this.refreshFrozenColumns},{event:"set-reorder-destination-element",handler:this.setReorderElement},{event:Wt,handler:this.setVisible}],Xe(this.parent,this.evtHandlers,!0,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||Xe(this.parent,this.evtHandlers,!1)},i.prototype.setReorderElement=function(e){this.destEle=e.ele},i.prototype.refreshFrozenColumns=function(e){e.parent||this.parent.setProperties({columns:e.columns},!0);var t=O(this.destEle,"e-frozen-left-header"),i=O(this.destEle,"e-frozen-right-header"),r=this.parent.getFrozenLeftColumnsCount(),n=this.parent.getFrozenRightColumnsCount();e.column.freeze=null,t?e.column.freeze="Left":i&&(e.column.freeze="Right"),this.parent.setFrozenCount(),e.cancel=r!==this.parent.getFrozenLeftColumnsCount()||n!==this.parent.getFrozenRightColumnsCount(),e.cancel&&this.parent.refreshColumns()},i.prototype.setWrapHeight=function(e,i,r,n,o,s){for(var l,a,h,d=this.parent.allowTextWrap,c=this.parent.getHeaderContent().querySelector(Ui),p=this.parent.textWrapSettings.wrapMode,u=this.parent.getHeaderContent().querySelector("thead"),g=[],f=[],m=[],y=0,v=e.length;y<v;y++)t.isNullOrUndefined(e[y])||t.isNullOrUndefined(i[y])||(s&&(m[y]=s[y].getBoundingClientRect().height),f[y]=i[y].getBoundingClientRect().height,g[y]=e[y].getBoundingClientRect().height);for(var y=0,v=e.length;y<v;y++){(r&&("Content"===p&&u.contains(e[y])||"Header"===p&&c.contains(e[y])||"Header"===p&&n)||o)&&(s[y]&&(s[y].style.height=null),e[y].style.height=null,i[y].style.height=null),l=g[y],a=f[y],h=m[y]?m[y]:0;var C=Math.max(l,a,h);!t.isNullOrUndefined(e[y])&&e[y].childElementCount&&(d&&l<C||!d&&l<C||this.parent.allowResizing&&this.parent.resizeModule&&!1===this.parent.resizeModule.isFrozenColResized)&&(e[y].style.height=C+"px"),i&&!t.isNullOrUndefined(i[y])&&i[y].childElementCount&&(d&&C>a||!d&&C>a||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[y].style.height=C+"px"),s&&!t.isNullOrUndefined(s[y])&&s[y].childElementCount&&(d&&C>h||!d&&C>h||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(s[y].style.height=C+"px")}d&&this.setFrozenHeight()},i.prototype.refreshHeight=function(e){var t,i,r,n=this.parent.getFrozenMode()===Pi,o=this.getFrozenRightHeader(),s=this.parent.getHeaderContent().querySelector("."+zi),l=this.parent.getContent(),a=this.getMovableHeader(),h=this.parent.getHeaderContent().querySelector("."+Fi).classList,d=this.parent.textWrapSettings.wrapMode;"textwrap"===e.case?(("Header"!==d||e.isModeChg)&&(n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),r=l.querySelector("."+Ei).querySelectorAll("tr"),t=l.querySelector("."+Ti).querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!0,!1,i)),"Content"===d&&this.parent.allowTextWrap?h.add("e-wrap"):h.remove("e-wrap"),"Both"===d||e.isModeChg?(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr")):(n&&(i=o.querySelector("Content"===d?Ui:"thead").querySelectorAll("tr")),t=s.querySelector("Content"===d?Ui:"thead").querySelectorAll("tr"),r=a.querySelector("Content"===d?Ui:"thead").querySelectorAll("tr")),this.parent.getHeaderContent().getElementsByClassName("e-stackedheadercell").length||this.setWrapHeight(t,r,e.isModeChg,!1,this.colDepth>1,i),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(r=l.querySelector("."+Ei).querySelectorAll("tr"),t=l.querySelector("."+Ti).querySelectorAll("tr"),n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i),this.parent.getHeaderContent().getElementsByClassName("e-stackedheadercell").length||(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i)))},i.prototype.setVisible=function(e){for(var i,r,n=this.parent,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getFrozenRightColumnsCount(),l=this.parent.getMovableColumnsCount(),a=0,h=e.length;a<h;a++){var d=e[a];if(r=n.getNormalizedColumnIndex(d.uid),i=d.visible?"":"none","Left"===d.freeze||"Right"===d.freeze){if(o&&!s){var c=n.getHeaderContent().querySelector(".e-frozen-left-header").querySelector(ji);t.setStyleAttribute(c.children[r],{display:i})}else if(!o&&s){var p=n.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji);t.setStyleAttribute(p.children[r-l],{display:i})}}else{var u=n.getHeaderContent().querySelector("."+Ii).querySelector(ji);t.setStyleAttribute(u.children[r-o],{display:i})}}this.refreshUI()},i.prototype.filterRenderer=function(t,i,r){return e.prototype.filterRenderer.call(this,t,i,r)},i.prototype.refreshUI=function(){var i,r=this.getMovableHeader().querySelector(Ui);t.remove(this.getMovableHeader().querySelector("table")),this.parent.getFrozenMode()===Pi&&(i=this.getFrozenRightHeader().querySelector(Ui),t.remove(this.getFrozenRightHeader().querySelector("table"))),e.prototype.refreshFrozenLeftUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector(Ui).innerHTML=r.innerHTML,i&&(this.getFrozenRightHeader().querySelector(Ui).innerHTML=i.innerHTML),this.updateColgroup(),this.widthService.setWidthToColumns(),this.parent.notify(qt,{}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&J([].slice.call(this.getMovableHeader().querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor();var n=this.parent.getContent().querySelector("."+Ei).querySelector("."+Mi);t.remove(n.querySelector(ji));var o=this.getMovableHeader().querySelector(ji).cloneNode(!0);if(n.insertBefore(o,n.querySelector(Ui)),i){var s=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("."+Mi);t.remove(s.querySelector(ji));var l=this.getFrozenRightHeader().querySelector(ji).cloneNode(!0);s.insertBefore(l,s.querySelector(Ui))}this.widthService.refreshFrozenScrollbar(),this.initializeHeaderDrag(),this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.refreshFreeze=function(e){var t=this.parent.getFrozenLeftColumnsCount(),i=this.parent.getFrozenRightColumnsCount(),r=this.parent.getMovableColumnsCount();if("filter"===e.case){var n=this.getTable().querySelector(".e-filterbar");if(this.parent.allowFiltering&&n&&this.getMovableHeader().querySelector("thead")){var o=this.parent.isRowDragable(),s=t?o?t+1:t:0,l=t+r+(t&&o?1:0);if(this.getMovableHeader().querySelector("thead").appendChild(this.filterRenderer(n,s,l)),this.parent.getFrozenMode()===Pi){var a=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));this.getFrozenRightHeader().querySelector("thead").appendChild(this.filterRenderer(n,s,s+i)),this.adjudtFilterBarCell(a)}var h=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));this.adjudtFilterBarCell(h)}}else"textwrap"!==e.case&&"refreshHeight"!==e.case||(this.refreshHeight(e),this.parent.contentModule.refreshScrollOffset())},i.prototype.updateFrozenColGroup=function(e,i){e&&!1===e.visible&&t.setStyleAttribute(i,{display:"none"})},i.prototype.adjudtFilterBarCell=function(e){for(var t=0,i=e;t<i.length;t++){var r={element:i[t],floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0}};o.Input.bindInitialEvent(r)}},i.prototype.renderPanel=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderPanel.call(this),this.parent.getFrozenRightColumnsCount()&&this.renderLeftWithRightFrozenPanel()):this.renderRightFrozenPanelAlone(),this.getPanel().firstChild.style.display="flex",this.getMovableHeader().style.flex="1"},i.prototype.renderTable=function(){this.parent.getFrozenLeftColumnsCount()?e.prototype.renderTable.call(this):this.renderFrozenRightTableAlone()},i.prototype.rfshMovable=function(){if(this.parent.getFrozenLeftColumnsCount()){if(e.prototype.rfshMovable.call(this),this.parent.getFrozenRightColumnsCount()){var t=this.rows;this.getFrozenRightHeader().appendChild(this.createHeader(void 0,"frozen-right")),this.refreshStackedHdrHgt(),this.parent.notify(Ht,{rows:this.rows,args:{renderFrozenRightContent:!0}}),this.rows=t}}else this.getFrozenRightHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createHeader(void 0,"movable")),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},i.prototype.refreshStackedHdrHgt=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.refreshStackedHdrHgt.call(this),this.parent.getFrozenRightColumnsCount()&&this.refreshFrozenRightStackedHdrHgt()):this.refreshFrozenRightStackedHdrHgt()},i.prototype.refreshFrozenRightStackedHdrHgt=function(){for(var e,t=[].slice.call(this.getFrozenRightHeader().getElementsByClassName("e-columnheader")),i=[].slice.call(this.getMovableHeader().getElementsByClassName("e-columnheader")),r=0,n=t.length;r<n;r++)(e=this.getRowSpan(t[r])).min>1&&this.updateStackedHdrRowHgt(r,e.max,t[r],i)},i.prototype.updateColgroup=function(){this.updateMovableColGroup(),this.parent.getFrozenLeftColumnsCount()&&this.updateFrozenLeftColGroup(),this.parent.getFrozenRightColumnsCount()&&this.updateFrozenRightColGroup()},i.prototype.renderRightFrozenPanelAlone=function(){var i=this.parent.element.querySelector("."+Ii),r=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(r)&&(i=this.parent.createElement("div",{className:Ii}),r=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector("."+Fi).appendChild(i),this.getPanel().querySelector("."+Fi).appendChild(r)),e.prototype.setMovableHeader.call(this,i),this.setFrozenRightHeader(r)},i.prototype.renderLeftWithRightFrozenPanel=function(){var i=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector("."+Fi).appendChild(i)),this.setFrozenRightHeader(i)},i.prototype.renderFrozenRightTableAlone=function(){e.prototype.renderFrozenRightTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Ht,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.updateFrozenLeftColGroup=function(){for(var e=this.getFrozenHeader().querySelector(ji).children,i=this.parent.isRowDragable()?1:0,r=this.parent.isRowDragable()?this.parent.getFrozenLeftColumnsCount()+1:this.parent.getFrozenLeftColumnsCount(),n=i;n<e.length;n++)n>=r&&(t.remove(e[n]),n--)},i.prototype.updateMovableColGroup=function(){var e=this.getMovableHeader().querySelector(ji).children;this.parent.isRowDragable()&&t.remove(e[0]);for(var i=e.length,r=this.parent.getFrozenLeftColumnsCount(),n=this.parent.getMovableColumnsCount(),o=0,s=0;s<i;s++,o++)(s<r||s>=r+n)&&(t.remove(e[o]),o--)},i.prototype.updateFrozenRightColGroup=function(){var e=this.parent.isRowDragable(),i=this.parent.getFrozenRightColumns(),r=this.getFrozenRightHeader().querySelector(ji).children;this.parent.getFrozenMode()===Pi&&e&&t.remove(r[0]);for(var n=r.length,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getMovableColumnsCount(),l=0,a=0;a<n;a++)a<o+s?t.remove(r[0]):(this.updateFrozenColGroup(i[l],r[l]),l++)},i.prototype.setFrozenRightHeader=function(e){this.frozenRightHeader=e},i.prototype.getFrozenRightHeader=function(){return this.frozenRightHeader},i}(Ko),Jo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.frzCount=0,r.isColGroupRefresh=!1,r.widthService=i.getService("widthService"),r}return Qo(i,e),i.prototype.renderPanel=function(){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderPanel.call(this),this.parent.getFrozenRightColumnsCount()&&this.renderFrozenLeftWithRightPanel()):this.renderFrozenRightPanelAlone();var t=this.parent.enableVirtualization?"":"flex";this.getPanel().firstChild.style.display=t},i.prototype.renderTable=function(){if(this.parent.getFrozenLeftColumnsCount()){if(e.prototype.renderTable.call(this),this.parent.getFrozenRightColumnsCount()){this.renderFrozenLeftWithRightTable();t=this.parent.getVisibleFrozenRightCount()?"":"none";this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-right-scrollbar",t,!0)}}else{this.renderFrozenRightTableAlone();var t=this.parent.getVisibleFrozenRightCount()?"":"none";this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-right-scrollbar",t)}this.getMovableContent().style.flex="1"},i.prototype.appendScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:"e-scrollbar",styles:"display: flex"});if(this.parent.getFrozenLeftColumnsCount()){if(i)return void this.parent.getContent().querySelector(".e-scrollbar").appendChild(e);r.appendChild(e),r.appendChild(t)}else r.appendChild(t),r.appendChild(e);this.parent.getContent().appendChild(r)},i.prototype.renderFrozenRightPanelAlone=function(){this.renderFrozenRigthPanel();var i=this.parent.element.querySelector("."+Ei),r=this.parent.element.querySelector(".e-frozen-right-content");t.isNullOrUndefined(r)&&(i=this.parent.createElement("div",{className:Ei}),r=this.parent.createElement("div",{className:"e-frozencontent e-frozen-right-content"}),this.getPanel().querySelector("."+Di).appendChild(i),this.getPanel().querySelector("."+Di).appendChild(r)),e.prototype.setMovableContent.call(this,i),this.setFrozenRightContent(r)},i.prototype.renderFrozenLeftWithRightPanel=function(){this.renderFrozenRigthPanel();var e=this.parent.element.querySelector(".e-frozen-right-content");t.isNullOrUndefined(e)&&(e=this.parent.createElement("div",{className:"e-frozencontent e-frozen-right-content"}),this.getPanel().querySelector("."+Di).appendChild(e)),this.setFrozenRightContent(e)},i.prototype.renderFrozenRightTableAlone=function(){var i;null==this.getFrozenRightContent().querySelector("."+Mi)?(e.prototype.renderFrozenRightTable.call(this),this.getFrozenRightContent().appendChild(this.getTable()),i=this.getTable().cloneNode(!0),this.getMovableContent().appendChild(i)):(this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont"),this.setTable(this.getFrozenRightContent().querySelector("."+Mi)),this.setColGroup(this.getFrozenRightHeaderColGroup()),i=this.getMovableContent().querySelector("."+Mi),this.getFrozenRightContent().querySelector("."+Mi).appendChild(this.getColGroup())),this.getMovableContent().querySelector(ji)&&t.remove(this.getMovableContent().querySelector(ji));var r=this.parent.getHeaderContent().querySelector("."+Ii).querySelector(ji).cloneNode(!0);i.insertBefore(r,i.querySelector(Ui))},i.prototype.renderFrozenLeftWithRightTable=function(){var e=this.getTable().cloneNode(!0);this.getFrozenRightContent().appendChild(e);var i=this.getFrozenRightContent().querySelector(ji);i&&t.remove(i);var r=this.getFrozenRightContent().querySelector("."+Mi);r.insertBefore(this.getFrozenRightHeaderColGroup(),r.querySelector(Ui))},i.prototype.renderFrozenRightEmptyRowAlone=function(i){e.prototype.renderFrozenRightEmpty.call(this,i),this.getMovableContent().querySelector(Ui).innerHTML="<tr><td></td></tr>",t.addClass([this.parent.getMovableContentTbody().querySelector("tr")],["e-emptyrow"]),this.getFrozenRightContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenRightCount(),this.parent.frozenRows&&(this.parent.getFrozenRightHeaderTbody().innerHTML="",this.parent.getMovableHeaderTbody().innerHTML="")},i.prototype.getFrozenHeader=function(e){return e===Li?this.parent.getHeaderContent().querySelector(".e-frozen-left-header").querySelector(Ui):"movable"===e?this.parent.getHeaderContent().querySelector("."+Ii).querySelector(Ui):this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(Ui)},i.prototype.renderFrozenLeftWithRightEmptyRow=function(){this.getFrozenRightContent().querySelector(Ui).innerHTML="<tr><td></td></tr>",t.addClass([this.getFrozenRightContent().querySelector(Ui).querySelector("tr")],["e-emptyrow"]),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(Ui).innerHTML="")},i.prototype.setFrozenRightContent=function(e){this.frozenRigthContent=e},i.prototype.getFrozenRightContent=function(){return this.frozenRigthContent},i.prototype.getHeaderColGroup=function(){var e=this.parent.element.querySelector("."+Si).querySelector(ji).cloneNode(!0);if(!this.parent.getFrozenLeftColumnsCount()){var t=this.getFrozenRightHeaderColGroup();e=t&&this.frzCount?t.cloneNode(!0):e,this.frzCount++,this.isColGroupRefresh=!0}return e},i.prototype.getFrozenRightHeaderColGroup=function(){var e=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector(ji);return e||(e=this.parent.getHeaderContent().querySelector(ji)),e.cloneNode(!0)},i.prototype.setColGroup=function(i){return this.parent.getFrozenLeftColumnsCount()?e.prototype.setColGroup.call(this,i):(i=this.isColGroupRefresh?i:this.getFrozenRightHeaderColGroup(),t.isNullOrUndefined(i)||(i.id="content-"+i.id),this.isColGroupRefresh=!1,2===this.frzCount&&(this.frzCount=0),this.colgroup=i)},i.prototype.renderEmpty=function(t){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderEmpty.call(this,t),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenLeftCount(),this.parent.getFrozenRightColumnsCount()&&this.renderFrozenLeftWithRightEmptyRow()):this.renderFrozenRightEmptyRowAlone(t),this.parent.notify(oi,{case:"refreshHeight"})},i.prototype.setHeightToContent=function(e){this.parent.getFrozenRightColumnsCount()&&(this.getFrozenRightContent().style.height=e.toString()+"px"),this.parent.getFrozenLeftColumnsCount()&&(this.getFrozenContent().style.height=e.toString()+"px"),this.getMovableContent().style.height=e.toString()+"px"},i.prototype.actionComplete=function(t){e.prototype.actionComplete.call(this,t)},i.prototype.batchAdd=function(t){e.prototype.batchAdd.call(this,t)},i.prototype.getTbody=function(e){var t;return e===Li?t=this.parent.getFrozenLeftContentTbody():"movable"===e?t=this.parent.getMovableContentTbody():e===Ni&&(t=this.parent.getFrozenRightContentTbody()),t},i.prototype.setIsFrozen=function(e,t){e.isFrozen=t===Li||"Right"===this.parent.getFrozenMode()&&t===Ni,e.renderFrozenRightContent=this.parent.getFrozenMode()===Pi&&t===Ni,e.renderMovableContent="movable"===t},i.prototype.appendContent=function(e,i,r,n){!t.isNullOrUndefined(this.parent.rowTemplate)&&this.parent.isReact?e=i:e.appendChild(i),"Left"===this.parent.getFrozenMode()?n===Li?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):"Right"===this.parent.getFrozenMode()?"movable"===n?(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):(this.isLoaded=!1,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):this.parent.getFrozenMode()===Pi&&(n===Li?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):"movable"===n?(this.refreshTbody(e),this.isLoaded=!1,this.getMovableContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.isLoaded=!0,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset())),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1),this.widthService.refreshFrozenScrollbar()},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(oi,{case:"refreshHeight"})},i.prototype.splitRows=function(e){var t=this.parent.getFrozenLeftColumnsCount(),i=this.parent.getFrozenRightColumnsCount();t&&!i?e===Li?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows:!t&&i?"movable"===e?this.movableRows=this.rows:(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):t&&i&&(e===Li?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):"movable"===e?(this.movableRows=this.rows,this.movableRowElements=this.rowElements):(this.frozenRightRows=this.rows,this.frozenRightRowElements=this.rowElements))},i.prototype.getMovableRowElements=function(){return this.parent.getFrozenMode()!==Pi?this.rowElements:this.movableRowElements},i.prototype.getFrozenRightRowElements=function(){return this.parent.getFrozenMode()!==Pi?this.freezeRowElements:this.frozenRightRowElements},i.prototype.getFrozenRightRows=function(){return this.parent.getFrozenMode()===Pi?this.parent.enableInfiniteScrolling?this.rightFreezeRows:this.frozenRightRows:this.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.parent.getFrozenRightDataRows()[e]},i.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.freezeRows},i.prototype.getRowElements=function(){return this.freezeRowElements},i}(Wo),Yo=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zo=function(t){function i(e,i){var r=t.call(this,e,i)||this;return r.frzRows=[],r.mvblRows=[],r.frRows=[],r.serviceLoc=i,r.eventListener("on"),r.rowModelGenerator=new Gi(r.parent),r}return Yo(i,t),i.prototype.eventListener=function(e){this.parent[e](pi,this.getVirtualData,this),this.parent[e]("set-freeze-selection",this.setFreezeSelection,this),this.parent[e]("refresh-virtual-frozenrows",this.refreshVirtualFrozenRows,this),this.parent.addEventListener(St,this.actionComplete.bind(this))},i.prototype.actionComplete=function(e){if("delete"===e.requestType&&this.parent.frozenRows)for(var t=0;t<this.parent.frozenRows;t++)ft(this,t)},i.prototype.refreshVirtualFrozenRows=function(e){var t=this,i=this.parent;if("delete"===e.requestType&&i.frozenRows){e.isFrozenRowsRender=!0;var r=i.renderModule.data.generateQuery(!0).clone();r.page(1,i.pageSettings.pageSize),i.renderModule.data.getData({},r).then(function(r){tt(e,r.result,i.getSelectedRowIndexes(),i,t.rowModelGenerator,t.serviceLoc,t.virtualRenderer,t)})}},i.prototype.getVirtualData=function(e){this.virtualRenderer.getVirtualData(e)},i.prototype.setFreezeSelection=function(e){nt(e,this.virtualRenderer)},i.prototype.renderTable=function(){this.freezeRowGenerator=new Go(this.parent),this.virtualRenderer=new lo(this.parent,this.serviceLoc),this.virtualRenderer.header=this.serviceLoc.getService("rendererFactory").getRenderer(e.RenderType.Header).virtualHdrRenderer,t.prototype.renderTable.call(this),this.virtualRenderer.setPanel(this.parent.getContent()),this.scrollbar=this.parent.getContent().querySelector(".e-movablescrollbar");var i=this.getMovableContent(),r=this.parent.height;if(this.virtualRenderer.virtualEle.content=this.virtualRenderer.content=this.getPanel().querySelector("."+Di),this.virtualRenderer.virtualEle.content.style.overflowX="hidden",this.virtualRenderer.virtualEle.renderFrozenWrapper(r),this.virtualRenderer.virtualEle.renderFrozenPlaceHolder(),this.parent.enableColumnVirtualization){this.virtualRenderer.virtualEle.movableContent=this.virtualRenderer.movableContent=this.getPanel().querySelector("."+Ei),this.virtualRenderer.virtualEle.renderMovableWrapper(r),this.virtualRenderer.virtualEle.renderMovablePlaceHolder();var n=i.querySelector("table");this.virtualRenderer.virtualEle.movableTable=n,this.virtualRenderer.virtualEle.movableWrapper.appendChild(n),i.appendChild(this.virtualRenderer.virtualEle.movableWrapper),i.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder)}this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent()),this.virtualRenderer.virtualEle.wrapper.appendChild(i),this.virtualRenderer.virtualEle.table=this.getTable(),mt(this.parent,this.virtualRenderer,this.scrollbar,this.getMovableContent())},i.prototype.appendContent=function(e,t,i){st(this.virtualRenderer,this.widthService,e,t,i)},i.prototype.generateRows=function(e,t){return this.firstPageRecords||(this.firstPageRecords=e),lt(this.virtualRenderer,e,t,this.freezeRowGenerator,this.parent)},i.prototype.getRowByIndex=function(e){return this.virtualRenderer.getRowByIndex(e)},i.prototype.getMovableRowByIndex=function(e){return this.virtualRenderer.getMovableVirtualRowByIndex(e)},i.prototype.collectRows=function(e){return rt(e,this.virtualRenderer,this.parent)},i.prototype.getMovableRows=function(){return this.collectRows("movable")},i.prototype.getRows=function(){return this.collectRows("frozen-left")},i.prototype.getColGroup=function(){var e=this.parent.getMovableVirtualContent();return this.isXaxis()?e.querySelector(ji):this.colgroup},i.prototype.getReorderedFrozenRows=function(e){return at(e,this.virtualRenderer,this.parent,this.freezeRowGenerator,this.firstPageRecords)},i.prototype.isXaxis=function(){return dt(this.virtualRenderer)},i.prototype.getHeaderCells=function(){return ct(this.virtualRenderer,this.parent)},i.prototype.getVirtualFreezeHeader=function(){return pt(this.virtualRenderer,this.parent)},i.prototype.ensureFrozenCols=function(e){return ut(e,this.parent)},i.prototype.getRowObjectByIndex=function(e){return this.virtualRenderer.getRowObjectByIndex(e)},i.prototype.setColGroup=function(e){return gt(e,this.virtualRenderer,this)},i}(Wo),$o=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.serviceLoc=i,r}return Yo(t,e),t.prototype.renderTable=function(){this.virtualHdrRenderer=new ao(this.parent,this.serviceLoc),this.virtualHdrRenderer.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.virtualHdrRenderer.gen.getColumnIndexes(this.getPanel().querySelector("."+Fi))),this.virtualHdrRenderer.virtualEle.content=this.getPanel().querySelector("."+Fi),this.virtualHdrRenderer.virtualEle.renderFrozenWrapper(),this.virtualHdrRenderer.virtualEle.renderFrozenPlaceHolder(),this.parent.enableColumnVirtualization&&(this.virtualHdrRenderer.virtualEle.movableContent=this.getPanel().querySelector("."+Ii),this.virtualHdrRenderer.virtualEle.renderMovableWrapper(),this.virtualHdrRenderer.virtualEle.renderMovablePlaceHolder()),e.prototype.renderTable.call(this),this.virtualHdrRenderer.setPanel(this.parent.getHeaderContent())},t.prototype.rfshMovable=function(){this.getFrozenHeader().appendChild(this.getTable()),this.virtualHdrRenderer.virtualEle.wrapper.appendChild(this.getFrozenHeader()),this.parent.enableColumnVirtualization?this.virtualHdrRenderer.virtualEle.movableWrapper.appendChild(this.createHeader(void 0,"movable")):this.getMovableHeader().appendChild(this.createTable()),this.virtualHdrRenderer.virtualEle.wrapper.appendChild(this.getMovableHeader())},t}(Ko),es=function(i){function r(e,t){var r=i.call(this,e,t)||this;return r.frRows=[],r.frzRows=[],r.mvblRows=[],r.serviceLoc=t,r.eventListener("on"),r.rowModelGenerator=new Gi(r.parent),r}return Yo(r,i),r.prototype.actionComplete=function(e){if("delete"===e.requestType&&this.parent.frozenRows)for(var t=0;t<this.parent.frozenRows;t++){if(!this.virtualRenderer.vgenerator.frozenRightCache[1]){this.virtualRenderer.vgenerator.frozenRightCache[1]=this.frRows.length?this.frRows:this.frzRows;break}this.virtualRenderer.vgenerator.frozenRightCache[1][t]=this.frRows.length?this.frRows[t]:this.frzRows[t],ft(this,t)}},r.prototype.eventListener=function(e){this.parent.addEventListener(St,this.actionComplete.bind(this)),this.parent[e]("refresh-virtual-frozenrows",this.refreshVirtualFrozenRows,this),this.parent[e](pi,this.getVirtualData,this),this.parent[e]("set-freeze-selection",this.setFreezeSelection,this)},r.prototype.refreshVirtualFrozenRows=function(e){var t=this;if("delete"===e.requestType&&this.parent.frozenRows){e.isFrozenRowsRender=!0;var i=this.parent.renderModule.data.generateQuery(!0).clone();i.page(1,this.parent.pageSettings.pageSize);var r=this.parent.getSelectedRowIndexes();this.parent.renderModule.data.getData({},i).then(function(i){tt(e,i.result,r,t.parent,t.rowModelGenerator,t.serviceLoc,t.virtualRenderer,t)})}},r.prototype.setFreezeSelection=function(e){nt(e,this.virtualRenderer)},r.prototype.getVirtualData=function(e){this.virtualRenderer.getVirtualData(e)},r.prototype.renderNextFrozentPart=function(e,i){e.renderMovableContent=this.parent.getFrozenLeftCount()?i===Li:i===Ni,e.renderFrozenRightContent=this.parent.getFrozenMode()===Pi&&"movable"===i,(e.renderMovableContent||e.renderFrozenRightContent)&&this.refreshContentRows(t.extend({},e))},r.prototype.renderTable=function(){this.virtualRenderer=new lo(this.parent,this.serviceLoc),this.virtualRenderer.header=this.serviceLoc.getService("rendererFactory").getRenderer(e.RenderType.Header).virtualHdrRenderer,this.freezeRowGenerator=new Go(this.parent),i.prototype.renderTable.call(this),this.virtualRenderer.setPanel(this.parent.getContent()),this.scrollbar=this.parent.getContent().querySelector(".e-movablescrollbar");var t=this.getFrozenRightContent(),r=this.getFrozenContent(),n=this.getMovableContent();"Right"===this.parent.getFrozenMode()&&(r=t),this.virtualRenderer.virtualEle.content=this.virtualRenderer.content=this.getPanel().querySelector("."+Di),this.virtualRenderer.virtualEle.content.style.overflowX="hidden";var o=this.parent.height;this.virtualRenderer.virtualEle.renderFrozenWrapper(o),this.virtualRenderer.virtualEle.renderFrozenPlaceHolder(),this.renderVirtualFrozenLeft(r,n),this.renderVirtualFrozenRight(r,n),this.renderVirtualFrozenLeftRight(r,n,t),this.virtualRenderer.virtualEle.table=this.getTable(),mt(this.parent,this.virtualRenderer,this.scrollbar,this.getMovableContent())},r.prototype.renderVirtualFrozenLeft=function(e,t){"Left"===this.parent.getFrozenMode()&&(this.virtualRenderer.virtualEle.wrapper.appendChild(e),this.virtualRenderer.virtualEle.wrapper.appendChild(t))},r.prototype.renderVirtualFrozenRight=function(e,t){"Right"===this.parent.getFrozenMode()&&(this.virtualRenderer.virtualEle.wrapper.appendChild(t),this.virtualRenderer.virtualEle.wrapper.appendChild(e))},r.prototype.renderVirtualFrozenLeftRight=function(e,t,i){this.parent.getFrozenMode()===Pi&&(this.virtualRenderer.virtualEle.wrapper.appendChild(e),this.virtualRenderer.virtualEle.wrapper.appendChild(t),this.virtualRenderer.virtualEle.wrapper.appendChild(i))},r.prototype.appendContent=function(e,t,i){st(this.virtualRenderer,this.widthService,e,t,i),this.refreshScrollOffset()},r.prototype.generateRows=function(e,t){return this.firstPageRecords||(this.firstPageRecords=e),lt(this.virtualRenderer,e,t,this.freezeRowGenerator,this.parent)},r.prototype.getRowByIndex=function(e){return this.virtualRenderer.getRowByIndex(e)},r.prototype.getFrozenRightRowByIndex=function(e){return this.virtualRenderer.getFrozenRightVirtualRowByIndex(e)},r.prototype.collectRows=function(e){return rt(e,this.virtualRenderer,this.parent)},r.prototype.getMovableRowByIndex=function(e){return this.virtualRenderer.getMovableVirtualRowByIndex(e)},r.prototype.getFrozenRightRows=function(){return this.collectRows("frozen-right")},r.prototype.getMovableRows=function(){return this.collectRows("movable")},r.prototype.getColGroup=function(){var e=this.parent.getMovableVirtualContent();return dt(this.virtualRenderer)?e.querySelector(ji):this.colgroup},r.prototype.getRows=function(){return this.collectRows("Right"===this.parent.getFrozenMode()?"frozen-right":"frozen-left")},r.prototype.getReorderedFrozenRows=function(e){return at(e,this.virtualRenderer,this.parent,this.freezeRowGenerator,this.firstPageRecords)},r.prototype.getHeaderCells=function(){return ct(this.virtualRenderer,this.parent)},r.prototype.isXaxis=function(){return dt(this.virtualRenderer)},r.prototype.getVirtualFreezeHeader=function(){return pt(this.virtualRenderer,this.parent)},r.prototype.getRowObjectByIndex=function(e){return this.virtualRenderer.getRowObjectByIndex(e)},r.prototype.ensureFrozenCols=function(e){return ut(e,this.parent)},r.prototype.setColGroup=function(e){return gt(e,this.virtualRenderer,this)},r}(Jo),ts=function(){function t(e,t){this.parent=e,this.locator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"freeze"},t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Mt,this.instantiateRenderer,this)},t.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName());var t=this.locator.getService("rendererFactory");this.parent.getFrozenColumns()&&(this.parent.enableColumnVirtualization?t.addRenderer(e.RenderType.Header,new $o(this.parent,this.locator)):t.addRenderer(e.RenderType.Header,new Ko(this.parent,this.locator)),this.parent.enableVirtualization?t.addRenderer(e.RenderType.Content,new Zo(this.parent,this.locator)):t.addRenderer(e.RenderType.Content,new Wo(this.parent,this.locator))),(this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount())&&(t.addRenderer(e.RenderType.Header,new Xo(this.parent,this.locator)),this.parent.enableVirtualization?t.addRenderer(e.RenderType.Content,new es(this.parent,this.locator)):t.addRenderer(e.RenderType.Content,new Jo(this.parent,this.locator)))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Mt,this.instantiateRenderer)},t.prototype.destroy=function(){this.removeEventListener()},t}(),is=function(){function e(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.CHOOSER="_chooser_",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.wireEvents=function(){for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.add(e[i],"mousedown",this.columnMenuHandlerDown,this)},e.prototype.unwireEvents=function(){for(var e=this.getColumnMenuHandlers(),i=0;i<e.length;i++)t.EventHandler.remove(e[i],"mousedown",this.columnMenuHandlerDown)},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+Si)||e.querySelector("."+Ri))&&(this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),t.remove(this.element))},e.prototype.columnMenuHandlerClick=function(e){e.target.classList.contains("e-columnmenu")&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e))},e.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},e.prototype.openColumnMenu=function(e){var i={top:0,left:0};this.element.style.cssText="display:block;visibility:hidden";var n=this.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),t.Browser.isDevice?(i.top=window.innerHeight/2-n.height/2,i.left=window.innerWidth/2-n.width/2):this.parent.enableRtl?i=r.calculatePosition(this.headerCell,"left","bottom"):(i=r.calculatePosition(this.headerCell,"right","bottom")).left-=n.width,this.columnMenu.open(i.top,i.left),e.preventDefault&&e.preventDefault(),Se(this.parent.element,this.columnMenu.element.parentElement)},e.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},e.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ht,this.wireEvents,this),this.parent.on(Bt,this.enableAfterRenderMenu,this),this.parent.on(Ot,this.render,this),this.isFilterItemAdded()&&this.parent.on("filterDialogCreated",this.filterPosition,this),this.parent.on(Gt,this.columnMenuHandlerClick,this),this.parent.on(Vt,this.keyPressHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.unwireEvents),this.parent.off(Bt,this.enableAfterRenderMenu),this.parent.off(Ot,this.render),this.isFilterItemAdded()&&this.parent.off("filterDialogCreated",this.filterPosition),this.parent.off(Gt,this.columnMenuHandlerClick),this.parent.off(Vt,this.keyPressHandler))},e.prototype.keyPressHandler=function(e){var t=this.parent;if("altDownArrow"===e.action){var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var r=t.getColumnByUid(i.firstElementChild.getAttribute("e-mappinguid"));this.openColumnMenuByField(r.field)}}},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),t.remove(this.element)),this.render())},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ColumnMenuDialogARIA")),this.parent.element.appendChild(this.element),this.columnMenu=new a.ContextMenu({cssClass:"e-grid-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.columnMenu.appendTo(this.element),this.wireFilterEvents()},e.prototype.wireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},e.prototype.unwireFilterEvents=function(){!t.Browser.isDevice&&this.isFilterItemAdded()&&t.EventHandler.remove(this.element,"mouseover",this.appendFilter)},e.prototype.beforeMenuItemRender=function(e){if(this.isChooserItem(e.item)){var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=this.parent.columnModel.filter(function(e){return e.field===t}),r=n.createCheckBox(this.parent.createElement,!1,{label:e.item.text,checked:i[0].visible});this.parent.enableRtl&&r.classList.add("e-rtl"),e.element.innerHTML="",e.element.appendChild(r)}else e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},e.prototype.columnMenuBeforeClose=function(e){var i=e.event?t.closest(e.event.target,".e-menu-item"):null;!t.isNullOrUndefined(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&i&&this.isChooserItem(i)?e.cancel=!0:e.event&&(t.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&O(e.event.currentTarget.activeElement,"e-filter-popup")||O(e.event.target,"e-popup")||O(e.event.target,"e-popup-wrapper"))&&!t.Browser.isDevice&&(e.cancel=!0)},e.prototype.isChooserItem=function(e){return e.id&&e.id.indexOf("_colmenu_")>=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},e.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger("columnMenuOpen",e);for(var t=0,i=e.items;t<i.length;t++){var r=i[t],n=this.getKeyFromId(r.id),o=this.defaultItems[n];-1!==this.getDefaultItems().indexOf(n)&&this.ensureDisabledStatus(n)&&!o.hide&&this.disableItems.push(r.text),r.hide&&this.hiddenItems.push(r.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},e.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight||this.parent.element.offsetHeight>window.innerHeight)&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto")},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Jn)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(Kn);break;case"Ungroup":(!this.parent.ensureModuleInjected(Jn)||this.parent.ensureModuleInjected(Jn)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(xn)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,r=0;r<i.length;r++)i[r].field===this.targetColumn.field&&i[r].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else(!this.parent.allowSorting||!this.parent.ensureModuleInjected(xn)||this.parent.allowSorting&&this.targetColumn&&!this.targetColumn.allowSorting)&&(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(_n)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:this.parent.ensureModuleInjected(_n)&&this.parent.allowFiltering&&this.targetColumn&&(!this.targetColumn.allowFiltering||"FilterBar"===this.parent.filterSettings.type)&&(t=!0)}return t},e.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=e.element.querySelector(".e-checkbox-wrapper .e-frame");i&&i.classList.contains("e-check")?(i.classList.remove("e-check"),this.parent.hideColumns(t,"field")):i&&(this.parent.showColumns(t,"field"),i.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger("columnMenuClick",e)},e.prototype.columnMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen()&&this.getFilter(e.element,e.element.id,!0)),this.parent.isFrozenGrid()||this.parent.notify("restore-Focus",{})},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},e.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t<i.length;t++){var r=i[t];if("string"==typeof r)if("ColumnChooser"===r){var n=this.getDefaultItem(r);n.items=this.createChooserItems(),e.push(n)}else e.push(this.getDefaultItem(r));else e.push(r)}return e},e.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER}}return this.defaultItems[e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[e]},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},e.prototype.getKeyFromId=function(e,t){return e.indexOf("_colmenu_")>0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},e.prototype.getColumnMenu=function(){return this.element},e.prototype.getModuleName=function(){return"columnMenu"},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},e.prototype.getHeaderCell=function(e){return t.closest(e.target,"th.e-headercell")},e.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)}return null},e.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var r=i[t];r.showInColumnChooser&&r.field&&e.push({id:this.generateID(r.field,this.CHOOSER),text:r.headerText?r.headerText:r.field})}return e},e.prototype.appendFilter=function(e){if(this.defaultItems.Filter){var i=this.defaultItems.Filter.id;t.closest(e.target,"#"+i)&&!this.isFilterPopupOpen()?this.getFilter(e.target,i):!t.closest(e.target,"#"+i)&&this.isFilterPopupOpen()&&this.getFilter(e.target,i,!0)}},e.prototype.getFilter=function(e,i,r){var n=this.getFilterPop();n?n.style.display=!t.Browser.isDevice&&r?"none":"block":this.parent.notify("filterOpen",{col:this.targetColumn,target:e,isClose:r,id:i})},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),r=e.getBoundingClientRect(),n=r.left-i.left,o=r.top-i.top;i.height<o?o=o-t.offsetHeight+r.height:i.height<o+t.offsetHeight&&(o=i.height-t.offsetHeight),window.innerHeight<t.offsetHeight+o+i.top&&(o=window.innerHeight-t.offsetHeight-i.top),o+i.top<0&&(o=0),n+=this.parent.enableRtl?-t.offsetWidth:r.width,i.width<=n+t.offsetWidth?(n-=r.width+t.offsetWidth,r.left<t.offsetWidth&&(n=r.left+t.offsetWidth/2)):n<0&&(n+=t.offsetWidth+r.width),t.style.top=o+"px",t.style.left=n+"px"},e.prototype.filterPosition=function(){var e=this.getFilterPop();if(e.classList.add(this.WRAP),!t.Browser.isDevice){var i=e.style.display;e.style.cssText+="display:block;visibility:hidden";var r=this.element.querySelector("."+this.FILTER);r&&(this.setPosition(r.parentElement,e),e.style.cssText+="display:"+i+";visibility:visible")}},e.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(Kn)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(Jn)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(xn)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(_n)&&e.push("Filter"),e},e.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},e.prototype.getFilterPop=function(){return t.Browser.isDevice&&null!==this.targetColumn&&"Menu"===this.parent.filterSettings.type?document.getElementById(this.targetColumn.uid+"-flmdlg"):this.parent.element.querySelector("."+this.POP)},e.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&this.parent.columnMenuItems.indexOf("Filter")>=0||!this.parent.columnMenuItems},e}(),rs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ns=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.initEvent(),r}return rs(r,e),r.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on("initForeignKeyColumn",this.initForeignKeyColumns,this),this.parent.on("getForeignKeyData",this.getForeignKeyData,this),this.parent.on("generateQuery",this.generateQueryFormData,this))},r.prototype.initForeignKeyColumns=function(e){for(var r=0;r<e.length;r++)e[r].dataSource=e[r].dataSource instanceof i.DataManager?e[r].dataSource:t.isNullOrUndefined(e[r].dataSource)?new i.DataManager:"result"in e[r].dataSource?e[r].dataSource:new i.DataManager(e[r].dataSource)},r.prototype.eventfPromise=function(e,r,n,o){var s=this.getStateEventArgument(r),l=new i.Deferred,a=new i.Deferred;s.action=e.action;var h=this.parent.getDataModule();return!t.isNullOrUndefined(e.action)&&e.action.requestType&&!1!==h.foreignKeyDataState.isDataChanged?(h.setForeignKeyDataState({isPending:!0,resolver:a.resolve}),a.promise.then(function(){l.resolve(o.dataSource)}),s.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger("columnDataStateChange",s)):(h.setForeignKeyDataState({}),l.resolve(n)),l},r.prototype.getForeignKeyData=function(e){for(var r=this,n=e.column?[e.column]:this.parent.getForeignKeyColumns(),o=[],s=this,l=0;l<n.length;l++)!function(t){var i=void 0,r=e.isComplex?s.genarateColumnQuery(n[t]):s.genarateQuery(n[t],e.result.result,!1,!0);r.params=s.parent.query.params;var l=n[t].dataSource;i=l&&"result"in l?s.eventfPromise(e,r,l,n[t]).promise:!l.ready||l.dataSource.offline?l.executeQuery(r):l.ready.then(function(){return l.executeQuery(r)}),o.push(i)}(l);Promise.all(o).then(function(r){for(var o=0;o<r.length;o++)n[o].columnData=r[o].result,"dropdownedit"===n[o].editType&&"result"in n[o].dataSource&&(n[o].edit.params=t.extend(n[o].edit.params,{dataSource:r[o].result,query:new i.Query,fields:{value:n[o].foreignKeyField||n[o].field,text:n[o].foreignKeyValue}}));e.promise.resolve(e.result)}).catch(function(t){return r.parent.log(["actionfailure","foreign_key_failure"]),e.promise&&e.promise.reject&&e.promise.reject(t),t})},r.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},r.prototype.genarateQuery=function(e,t,r,n){var o=this.parent,s=[],l=new i.Query,a=r?e.foreignKeyField:e.field;if(o.allowPaging||o.enableVirtualization||r){t=new i.DataManager(o.allowGrouping&&o.groupSettings.columns.length&&!r?t.records:t).executeLocal((new i.Query).select(a));var h=i.DataUtil.distinct(t,a,!1);a=r?e.field:e.foreignKeyField;for(var d=0;d<h.length;d++)h[d]&&h[d].getDay?s.push(he({field:a,operator:"equal",value:h[d],matchCase:!1})):s.push(new i.Predicate(a,"equal",h[d],!1))}return n?s.length?l.where(i.Predicate.or(s)):l:s.length?i.Predicate.or(s):{predicates:[]}},r.prototype.genarateColumnQuery=function(e){var t=this.parent,r=new i.Query,n=this.isFiltered(e);if(n.isTrue&&(r=this.filterQuery(r,n.column,!0)),t.searchSettings.key.length){var o=t.searchSettings;e.dataSource instanceof i.DataManager&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?r=this.searchQuery(r,e,!0):r.search(o.key,e.foreignKeyValue,o.operator,o.ignoreCase)}return r},r.prototype.isFiltered=function(e){var t=this.parent.filterSettings.columns.filter(function(t){return t.field===e.foreignKeyValue&&t.uid===e.uid});return{column:t,isTrue:!!t.length}},r.prototype.getModuleName=function(){return"foreignKey"},r.prototype.destroy=function(){this.destroyEvent()},r.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off("initForeignKeyColumn",this.initForeignKeyColumns),this.parent.off("getForeignKeyData",this.getForeignKeyData),this.parent.off("generateQuery",this.generateQueryFormData))},r}(yi),os="https://ej2.syncfusion.com/documentation/grid",ss="https://ej2.syncfusion.com/documentation/",ls="[EJ2Grid.Warning]",as="[EJ2Grid.Error]",hs="[EJ2Grid.Info]",ds=function(){function e(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}return e.prototype.getModuleName=function(){return"logger"},e.prototype.log=function(e,t){e instanceof Array||(e=[e]);for(var i=e,r=0;r<i.length;r++){var n=cs[i[r]],o=n.check(t,this.parent);o.success&&console[n.logType](n.generateMessage(t,this.parent,o.options))}},e.prototype.patchadaptor=function(){var e=this.parent.getDataModule().dataManager.adaptor,t=e.beforeSend;t&&(e.beforeSend=function(i,r,n){t.call(e,i,r,n)})},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},e}(),cs={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),r=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:r.filter(function(e){return"resize"!==e}).length>0,options:r}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),ls+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+os+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(){return{success:"undefined"==typeof Promise}},generateMessage:function(){return as+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+ss+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return ls+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+os+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return ls+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+os+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(){return{success:!0}},generateMessage:function(e,t){var i="",r=ps(e,t),n=us(e,t);return i=""!==n?n:""!==r?r:e.error,ls+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,r){var n=i.DataUtil.getObject("locale."+r.locale+".grid",t.L10n);return{success:"en-US"!==r.locale&&t.isNullOrUndefined(n)}},generateMessage:function(e,t){return ls+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+os+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,i){var r;switch(e){case"freeze":r={success:i.allowGrouping||!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||!t.isUndefined(i.rowTemplate)||i.enableVirtualization,options:{name:"freeze"}};break;case"virtualization":r={success:!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||0!==i.frozenRows||0!==i.frozenColumns,options:{name:"virtualization"}};break;default:r={success:!1}}return r},generateMessage:function(e,t,i){var r,n=i.name;switch(n){case"freeze":r="Frozen rows and columns do not support the following features:\n* Virtualization\n* Row Template\n* Details Template\n* Hierarchy Grid\n* Grouping";break;case"virtualization":r="Virtualization does not support the following features.\n* Freeze rows and columns.\n* Details Template.\n* Hierarchy Grid.\n";break;default:r=""}return ls+": "+n.toUpperCase()+" LIMITATIONS\n"+r}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof i.DataManager||t.dataSource.length)}},generateMessage:function(){return ls+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+os+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,i){return{success:t.isNullOrUndefined(i.height)||"auto"===i.height}},generateMessage:function(){return as+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+os+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(){return as+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+os+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(){return ls+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+os+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(){return hs+": RESIZING COLUMN REACHED MIN OR MAX \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e){var i;switch(e.moduleName){case"reorder":i=t.isNullOrUndefined(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn.headerText:e.column.headerText)+" column";break;case"group":i="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":i="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":i="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:i}}},generateMessage:function(e,t,i){return hs+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return hs+": EXPORTNIG INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return hs+": EXPORTNIG COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(){return{success:!0}},generateMessage:function(){return as+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+os+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e){var t;switch(e.moduleName){case"group":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return as+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t){return as+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e){return{success:t.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return as+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+ss+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof i.DataManager||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!t.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(){return ls+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},ps=function(e){var t=e.error;return t.indexOf&&0!==t.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+ss+"/base/intl.html?#supported-format-string.\nDate format: "+ss+"/base/intl.html?#manipulating-datetime.\nMessage: "+t},us=function(e){var r=i.DataUtil.getObject("error.error",e);if(t.isNullOrUndefined(r))return"";var n="";try{n=JSON.parse(r.responseText)}catch(e){n=""}return"XMLHTTPREQUEST FAILED\nUrl: "+r.responseURL+"\nStatus: "+r.status+" - "+r.statusText+"\n"+(""!==n?"Message: "+n:"")},gs=function(){function e(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.infiniteFrozenCache={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting"],this.keys=["downArrow","upArrow","PageUp","PageDown"],this.rowTop=0,this.isInitialMovableRender=!0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=this.parent.isFrozenGrid()?new Go(this.parent):new Gi(this.parent)}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(kt,this.onDataReady,this),this.parent.on(Zt,this.dataSourceModified,this),this.parent.on("infinite-page-query",this.infinitePageQuery,this),this.parent.on("infinite-scroll-handler",this.infiniteScrollHandler,this),this.parent.on(jt,this.infiniteCellFocus,this),this.parent.on("append-infinite-content",this.appendInfiniteRows,this),this.parent.on("remove-infinite-rows",this.removeInfiniteCacheRows,this),this.parent.on("reset-infinite-blocks",this.resetInfiniteBlocks,this),this.parent.on("set-infinite-cache",this.setCache,this),this.parent.on("initial-collapse",this.ensureIntialCollapse,this),this.parent.on(Vt,this.infiniteCellFocus,this),this.parent.on("infinite-show-hide",this.setDisplayNone,this),this.parent.on("virtual-scroll-edit-action-begin",this.editActionBegin,this),this.parent.on(pi,this.getVirtualInfiniteData,this),this.parent.on("edit-reset",this.resetInfiniteEdit,this),this.parent.on("virtual-scroll-edit-success",this.infiniteEditSuccess,this),this.parent.on("refresh-virtual-cache",this.refreshInfiniteCache,this),this.parent.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.on("virtual-scroll-add-action-begin",this.infiniteAddActionBegin,this),this.parent.on(Lt,this.modelChanged,this),this.parent.on("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on("delete-complete",this.deleteComplate,this),this.parent.addEventListener(bt,this.actionBeginFunction),this.parent.addEventListener(St,this.actionCompleteFunction)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(kt,this.onDataReady),this.parent.off(Zt,this.dataSourceModified),this.parent.off("infinite-page-query",this.infinitePageQuery),this.parent.off("infinite-scroll-handler",this.infiniteScrollHandler),this.parent.off(jt,this.infiniteCellFocus),this.parent.off("append-infinite-content",this.appendInfiniteRows),this.parent.off("remove-infinite-rows",this.removeInfiniteCacheRows),this.parent.off("reset-infinite-blocks",this.resetInfiniteBlocks),this.parent.off("set-infinite-cache",this.setCache),this.parent.off("initial-collapse",this.ensureIntialCollapse),this.parent.off(Vt,this.infiniteCellFocus),this.parent.off("infinite-show-hide",this.setDisplayNone),this.parent.off("virtual-scroll-edit-action-begin",this.editActionBegin),this.parent.off(pi,this.getVirtualInfiniteData),this.parent.off("edit-reset",this.resetInfiniteEdit),this.parent.off("virtual-scroll-edit-success",this.infiniteEditSuccess),this.parent.off("refresh-virtual-cache",this.refreshInfiniteCache),this.parent.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("virtual-scroll-add-action-begin",this.infiniteAddActionBegin),this.parent.off(Lt,this.modelChanged),this.parent.off("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData),this.parent.removeEventListener(bt,this.actionBeginFunction),this.parent.removeEventListener(St,this.actionCompleteFunction))},e.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length){var t=Object.keys(this.infiniteCurrentViewData);e.currentViewData=[];for(var i=e.pageSettings.currentPage,r=e.infiniteScrollSettings.enableCache,n=e.infiniteScrollSettings.maxBlocks,o=r&&(i>n||this.isUpScroll&&i>1),s=o?this.isUpScroll?i:i-n+1:1,l=o?s+n-1:r?n:t.length,a=s;a<=l;a++)this.infiniteCurrentViewData[a]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[a]))}},e.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent.pageSettings.currentPage,i=this.parent.pageSettings.pageSize,r=this.parent.infiniteScrollSettings.initialBlocks,n=Object.keys(this.infiniteCurrentViewData),o=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var s="save"===e.args.requestType,l="delete"===e.args.requestType;o||!s&&!l?r>1&&e.data.length===r*i?this.setInitialCache(e.data.slice(),{},o&&"delete"===e.args.requestType,!0):this.infiniteCurrentViewData[t]=e.data.slice():s?this.infiniteCurrentViewData[1]=e.data.concat(this.infiniteCurrentViewData[1]):this.infiniteCurrentViewData[n[n.length-1]].push(e.data[0])}},e.prototype.deleteComplate=function(){this.parent.isFrozenGrid()&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.contentModule.refreshScrollOffset()},e.prototype.modelChanged=function(e){var t=this.parent.getRows();if(t.length&&"infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)){if(this.firstIndex=parseInt(t[0].getAttribute(Hi),10),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=parseInt(t[t.length-1].getAttribute(Hi),10),"delete"===e.requestType){var i=this.parent.getRowsObject();e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:i[i.length-1].index}else e.startIndex=this.firstIndex;this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1)}},e.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.parent.pageSettings.currentPage>1&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))))},e.prototype.infiniteEditHandler=function(e){if(!this.parent.infiniteScrollSettings.enableCache&&("delete"===e.e.requestType||"save"===e.e.requestType&&"add"===this.requestType)){var i=this.parent.isFrozenGrid(),r=this.parent.getRows(),n=this.parent.getRowsObject();if(this.ensureRowAvailability(n,e.result[0])){if(r.length&&(this.resetRowIndex(n,e.e,r,"add"===this.requestType,!0),i)){var o=this.parent.getMovableRowsObject();if(this.resetRowIndex(o,e.e,this.parent.getMovableDataRows(),"add"===this.requestType),this.parent.getFrozenMode()===Pi){var s=this.parent.getFrozenRightRowsObject();this.resetRowIndex(s,e.e,this.parent.getFrozenRightRows(),"add"===this.requestType)}}if(this.isLastPage){if(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows){if(t.remove(r[this.parent.frozenRows-1]),this.createRow([n[this.parent.frozenRows-1]],e,!1,!0),i){var l=this.parent.getMovableDataRows();if(t.remove(l[this.parent.frozenRows]),this.createRow([this.parent.getMovableRowsObject()[this.parent.frozenRows-1]],e,!0,!0),this.parent.getFrozenMode()===Pi){var a=this.parent.getFrozenRightDataRows();t.remove(a[this.parent.frozenRows]),this.createRow([this.parent.getFrozenRightRowsObject()[this.parent.frozenRows-1]],e,!1,!0,!0)}}ke(this.parent)}}else this.createRow(n,e)}this.parent.hideSpinner(),"delete"===this.requestType?this.parent.notify("delete-complete",e.e):this.parent.notify("save-complete",e.e)}this.parent.notify(oi,{case:"refreshHeight"})},e.prototype.createRow=function(e,i,r,n,o){var s,l=n?e:this.generateRows(i.result,i.e),a=new Vi(this.serviceLocator,null,this.parent);s=o?this.parent.element.querySelector(".e-frozen-right-content").querySelector(Ui):this.parent.isFrozenGrid()?r?this.parent.getMovableVirtualContent().querySelector(Ui):this.parent.getFrozenVirtualContent().querySelector(Ui):this.parent.getContent().querySelector(Ui),this.parent.frozenRows&&(s=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.isFrozenGrid()?r?this.parent.getMovableVirtualHeader().querySelector(Ui):o?this.parent.element.querySelector(".e-frozen-right-header").querySelector(Ui):this.parent.getFrozenVirtualHeader().querySelector(Ui):this.parent.getHeaderContent().querySelector(Ui):s);var h={rows:e,cancel:!1,args:i,isMovable:r,isFrozenRows:n,isFrozenRight:n,row:l};if(this.parent.notify("infinite-crud-cancel",h),!h.cancel)for(var d=l.length-1;d>=0;d--)"delete"===this.requestType?s.appendChild(a.render(l[d],this.parent.getColumns())):s.insertBefore(a.render(l[d],this.parent.getColumns()),s.firstElementChild);if(!n&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)){var c=r?this.parent.getMovableDataRows():o?this.parent.getFrozenRightDataRows():this.parent.getRows(),p=(r||o)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1;t.remove(c[p]),this.createRow([e[this.parent.frozenRows-1]],i,r,!0,o)}this.parent.infiniteScrollSettings.enableCache||n||(o?(ke(this.parent),this.parent.contentModule.rightFreezeRows="add"===this.requestType?l.concat(e):e.concat(l)):!this.parent.isFrozenGrid()||r?(ke(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?l.concat(e):e.concat(l),this.parent.getFrozenMode()===Pi&&this.createRow(this.parent.getFrozenRightRowsObject(),i,!1,!1,!0)):(this.parent.contentModule.visibleFrozenRows="add"===this.requestType?l.concat(e):e.concat(l),this.createRow(this.parent.getMovableRowsObject(),i,!0)))},e.prototype.ensureRowAvailability=function(e,t){var i=!0;if(this.parent.frozenRows&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.sortSettings.columns&&"add"===this.requestType)for(var r=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<e.length;n++)if(e[n].data[r]===t[r]){i=!1;break}return i},e.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},e.prototype.resetRowIndex=function(e,i,r,n,o){var s=this,l=this.parent.getPrimaryKeyFieldNames()[0],a=!(r.length%this.parent.pageSettings.pageSize);n?a&&(o&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),t.remove(r[e.length-1]),r.splice(e.length-1,1),e.splice(e.length-1,1)):e.filter(function(n,a){if(n.data[l]===i.data[0][l]){if(o&&!s.parent.groupSettings.columns.length){var h=Math.ceil((a+1)/s.parent.pageSettings.pageSize);s.resetInfiniteCurrentViewData(h,a)}e.splice(a,1),t.remove(r[a]),r.splice(a,1)}});var h=n?1:0;Me(this.parent,e,r,h)},e.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[e].splice(t,1),this.swapCurrentViewData(e,!1)},e.prototype.swapCurrentViewData=function(e,t){for(var i=Object.keys(this.infiniteCurrentViewData),r=t?i.length+1:i.length,n=e;n<r;n++)if(this.infiniteCurrentViewData[n+1]){var o=t?n:n+1,s=t?this.infiniteCurrentViewData[n].length-1:0,l=this.infiniteCurrentViewData[o].splice(s,1);t?(this.infiniteCurrentViewData[n+1]=l.concat(this.infiniteCurrentViewData[n+1]),n+1===r-1&&this.infiniteCurrentViewData[n+1].splice(this.infiniteCurrentViewData[n+1].length-1,1)):this.infiniteCurrentViewData[n].push(l[0])}this.updateCurrentViewData()},e.prototype.setDisplayNone=function(e){if(this.parent.infiniteScrollSettings.enableCache){for(var t=this.parent.isFrozenGrid(),i=t?Object.keys(this.infiniteFrozenCache):Object.keys(this.infiniteCache),r=1;r<=i.length;r++)(t?e.isFreeze?this.infiniteFrozenCache[r][0]:this.infiniteFrozenCache[r][1]:this.infiniteCache[r]).filter(function(t){t.cells[e.index].visible=""===e.visible});this.resetContentModuleCache(t?this.infiniteFrozenCache:this.infiniteCache)}},e.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e},e.prototype.getEditedRowObject=function(){for(var e,t=this.parent.getRowsObject(),i=0;i<t.length;i++)t[i].index===this.editRowIndex&&(e=t[i]);return e},e.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=!1)},e.prototype.updateCurrentViewRecords=function(e){var i=Ie(this.parent,e);t.isNullOrUndefined(i)||(this.parent.getCurrentViewRecords()[i]=e)},e.prototype.actionBegin=function(e){"add"===e.requestType||"delete"===e.requestType?this.requestType=e.requestType:"add"===e.action&&"save"===e.requestType&&(this.requestType=e.action),(this.parent.isFrozenGrid()&&!e.cancel&&"searching"===e.requestType||"sorting"===e.requestType||"filtering"===e.requestType)&&(this.isInitialRender=!0)},e.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=!1,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},e.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},e.prototype.getVirtualInfiniteData=function(e){e.virtualData=this.virtualInfiniteData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},e.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var i=t.extend({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:i},e.prototype.dataSourceModified=function(){this.resetInfiniteBlocks({requestType:this.empty},!0)},e.prototype.onDataReady=function(e){t.isNullOrUndefined(e.count)||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},e.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},e.prototype.infiniteScrollHandler=function(e){this.restoreInfiniteEdit(),this.restoreInfiniteAdd();var i=e.target;if(i.classList.contains(Di)&&this.parent.enableInfiniteScrolling&&!e.isLeft){var r=this.parent.getContent().firstElementChild;this.prevScrollTop=r.scrollTop;var n=this.parent.getRows(),o=parseInt(n[n.length-1].getAttribute(Hi),10)+1,s=this.parent.pageSettings.currentPage,l=void 0,a=i.scrollHeight-i.scrollTop,h=Math.round(i.scrollHeight-i.scrollTop),d=(a<i.clientHeight?Math.ceil(a):Math.floor(a))===i.clientHeight||h===i.clientHeight;if(this.isScroll&&d&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)){this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0);var c=[].slice.call(r.querySelectorAll(".e-row:not(.e-addedrow)")),p=c[c.length-1],u=parseInt(p.getAttribute(Hi),10);this.parent.pageSettings.currentPage=Math.ceil(u/this.parent.pageSettings.pageSize)+1,l={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:o,direction:"down"},this.makeRequest(l)}if(this.isScroll&&this.parent.infiniteScrollSettings.enableCache&&0===i.scrollTop&&1!==this.parent.pageSettings.currentPage){this.parent.infiniteScrollSettings.enableCache&&(this.isDownScroll=!1,this.isUpScroll=!0);var p=[].slice.call(r.getElementsByClassName(Oi)),u=parseInt(p[this.parent.pageSettings.pageSize-1].getAttribute(Hi),10),g=parseInt(p[0].getAttribute(Hi),10)-this.parent.pageSettings.pageSize;this.parent.pageSettings.currentPage=Math.ceil(u/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage&&(l={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:g,direction:"up"},this.makeRequest(l))}this.parent.infiniteScrollSettings.enableCache&&!this.isScroll&&t.isNullOrUndefined(l)&&(this.isDownScroll||this.isUpScroll)&&(r.scrollTop=this.top)}},e.prototype.makeRequest=function(e){var i=this;this.parent.pageSettings.currentPage!==e.prevPage&&(this.parent.pageSettings.currentPage<=this.maxPage?(this.isInfiniteScroll=!0,t.isNullOrUndefined(this.infiniteCache[e.currentPage])?setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify("model-changed",e)},100):setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify(ui,e)},100)):this.parent.pageSettings.currentPage=this.maxPage)},e.prototype.infinitePageQuery=function(e){this.initialRender?(this.initialRender=!1,this.intialPageQuery(e)):this.isInfiniteScroll||"delete"!==this.requestType&&"add"!==this.requestType?e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e)},e.prototype.editPageQuery=function(e){var t=this.parent.infiniteScrollSettings.initialBlocks;if(this.parent.infiniteScrollSettings.enableCache)this.infiniteCache={},this.infiniteFrozenCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(t*this.parent.pageSettings.pageSize);else{"Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection();var i="delete"===this.requestType?this.lastIndex:this.firstIndex;e.skip(i),e.take(1)}},e.prototype.intialPageQuery=function(e){this.parent.infiniteScrollSettings.enableCache&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},e.prototype.infiniteCellFocus=function(e){if(!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action)"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);else{this.pressedKey=e.keyArgs.action;var t=document.activeElement,i=parseInt(t.parentElement.getAttribute(Hi),10),r=this.parent.getContent().firstElementChild;this.rowIndex="downArrow"===e.keyArgs.action?i+1:i-1,this.cellIndex=parseInt(t.getAttribute(qi),10);var n=this.parent.getRowByIndex(i),o=Math.floor(r.offsetHeight/this.parent.getRowHeight());if(!n||xe(n,this.parent)||Fe(n,this.rowTop)){var s=n?n.getBoundingClientRect().height:this.parent.getRowHeight();if(!this.parent.infiniteScrollSettings.enableCache){if("downArrow"===e.keyArgs.action&&(xe(n,this.parent)||!n)){var l=(this.rowIndex-o)*s,a=r.scrollTop+this.parent.getRowHeight();r.scrollTop=l<a?a:l}"upArrow"===e.keyArgs.action&&Fe(n,this.rowTop)&&(r.scrollTop=this.rowIndex*s)}}else this.pressedKey=this.empty}},e.prototype.createEmptyRowdata=function(){var e=this;this.parent.getColumns().filter(function(t){e.emptyRowData[t.field]=e.empty})},e.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector("."+Ai),i=this.parent.element.querySelector("."+Bi),r=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||i)){var n=e?t.extend({},this.getEditedRowObject().data):t.extend({},this.emptyRowData);this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(r,n),this.parent.isFrozenGrid()&&(this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(this.parent.getMovableVirtualContent().querySelector(".e-gridform"),n))}},e.prototype.restoreInfiniteEdit=function(){var e=this.parent.getContent().firstElementChild,i=!this.parent.frozenRows||this.editRowIndex>=this.parent.frozenRows;if(this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&i&&this.parent.editSettings.allowEditing&&!t.isNullOrUndefined(this.editRowIndex)){var r=this.parent.getRowByIndex(this.editRowIndex);if(Object.keys(this.virtualInfiniteData).length&&r&&!this.parent.getContent().querySelector("."+Ai)){var n=r.getBoundingClientRect().top;n<e.offsetHeight&&n>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(r))}}},e.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector("."+Bi)&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},e.prototype.appendInfiniteRows=function(e){var t=this.parent.isFrozenGrid(),i=this.parent.getContent().firstElementChild,r=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType,n=this.parent.getFrozenMode()===Pi&&"movable"===e.tableName;if((!r||e.args.isFrozen||n)&&r||(r&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),t)if(r)if(e.tableName===Li||"Right"===this.parent.getFrozenMode()&&e.tableName===Ni)this.frozenFrag=e.frag;else if(this.parent.getFrozenMode()===Pi&&"movable"===e.tableName)this.movableFrag=e.frag;else{var o=this.parent.getFrozenVirtualContent().querySelector(Ui);"up"===e.args.direction?o.insertBefore(this.frozenFrag,o.firstElementChild):o.appendChild(this.frozenFrag),e.tableName===Ni?(this.parent.getMovableVirtualContent().querySelector(Ui).appendChild(this.movableFrag),this.parent.element.querySelector(".e-frozen-right-content").querySelector(Ui).appendChild(e.frag)):this.parent.getMovableVirtualContent().querySelector("."+Mi).appendChild(e.tbody),this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData()}else{var s=void 0;e.tableName===Li?s=this.parent.getFrozenVirtualContent().querySelector("."+Mi):"movable"===e.tableName?(s=this.parent.getMovableVirtualContent().querySelector("."+Mi),this.parent.getFrozenMode()!==Pi&&(this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData())):(s=this.parent.element.querySelector(".e-frozen-right-content").querySelector("."+Mi),this.parent.getFrozenMode()===Pi&&(this.parent.contentModule.refreshScrollOffset(),this.updateCurrentViewData())),s.appendChild(e.tbody),this.widthService.refreshFrozenScrollbar()}else this.parent.contentModule.getTable().appendChild(e.tbody),this.updateCurrentViewData();this.isInitialRender&&!e.args.isFrozen&&(this.isInitialRender=!1,this.parent.scrollModule.setHeight()),e.args.isFrozen||(this.rowTop=this.rowTop?this.rowTop:this.parent.getRows()[0].getBoundingClientRect().top,r&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(i.scrollTop=this.top),ke(this.parent),this.selectNewRow(e.tbody,e.args.startIndex),this.pressedKey=void 0),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1},e.prototype.selectNewRow=function(e,t){var i=this,r=this.parent.getRowByIndex(this.rowIndex);if(this.keys.some(function(e){return e===i.pressedKey})){if(("downArrow"===this.pressedKey||this.parent.infiniteScrollSettings.enableCache&&"upArrow"===this.pressedKey)&&setTimeout(function(){r.cells[0].focus({preventScroll:!0}),i.parent.selectRow(i.rowIndex),i.parent.getContent().firstElementChild.scrollTop+=i.parent.getRowHeight()},0),"PageDown"===this.pressedKey){var n=this.parent.getRowByIndex(t);n&&n.cells[0].focus()}"PageUp"===this.pressedKey&&e.querySelector("."+Oi).cells[0].focus()}},e.prototype.removeInfiniteCacheRows=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;if(!e.args.isFrozen&&t&&this.parent.infiniteScrollSettings.enableCache&&this.isRemove){var i=[].slice.call(this.parent.getContentTable().getElementsByClassName(Oi));if("down"===e.args.direction){if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){n=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(n,e.args)}var r=this.parent.element.querySelector("."+Bi)?0:1;this.removeTopRows(i,this.parent.pageSettings.pageSize-r)}if("up"===e.args.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){var n=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(n,e.args)}else this.removeBottomRows(i,i.length-1,e.args);this.isScroll=!1,this.top=this.calculateScrollTop(e.args)}},e.prototype.calculateScrollTop=function(e){var i=0,r=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(i=this.captionRowHeight());var n=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),o=0;this.isInitialCollapse&&!t.isNullOrUndefined(n)&&(o=Math.round((n.length-1)/this.parent.groupSettings.columns.length));for(var s=o||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),l=0,a=0;l<r.clientHeight;)l=++a*this.parent.getRowHeight();i+=(s-(a-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)i=this.infiniteCache[this.parent.pageSettings.currentPage].length*this.parent.getRowHeight();else if(this.isInitialCollapse){for(var h=this.infiniteCache[this.parent.pageSettings.currentPage],d=0,a=0;a<h.length;a++)h[a].isCaptionRow&&d++;i+=Math.round(d/this.parent.groupSettings.columns.length)*this.parent.getRowHeight()}else i+=this.parent.pageSettings.pageSize*this.parent.getRowHeight()+j();return i},e.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},e.prototype.removeTopRows=function(e,i){for(var r=this.parent.isFrozenGrid(),n=this.parent.getFrozenMode()===Pi?[].slice.call(this.parent.element.querySelector(".e-frozen-right-content").getElementsByClassName(Oi)):null,o=r?[].slice.call(this.parent.getMovableVirtualContent().getElementsByClassName(Oi)):null,s=0;s<=i;s++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&s>i-this.parent.frozenRows||(t.remove(e[s]),o&&t.remove(o[s]),n&&t.remove(n[s]))},e.prototype.removeBottomRows=function(e,i,r){var n=0,o=this.parent.isFrozenGrid(),s=o?[].slice.call(this.parent.getMovableVirtualContent().getElementsByClassName(Oi)):null,l=this.parent.getFrozenMode()===Pi?[].slice.call(this.parent.element.querySelector(".e-frozen-right-content").getElementsByClassName(Oi)):null,a=this.parent.pageSettings.pageSize;!o&&this.infiniteCache[r.prevPage].length<a&&(n=this.parent.pageSettings.pageSize-this.infiniteCache[r.prevPage].length),o&&this.infiniteFrozenCache[r.prevPage][1].length<a&&(n=this.parent.pageSettings.pageSize-this.infiniteFrozenCache[r.prevPage][1].length);for(var h=i;n<a;h--)n++,t.remove(e[h]),s&&t.remove(s[h]),l&&t.remove(l[h])},e.prototype.removeCaptionRows=function(e,i){if("down"===i.direction)for(var r=this.parent.getRows()[this.parent.pageSettings.pageSize],n=parseInt(r.getAttribute(Hi),10)-1,o=0,s=0;o<n;s++)e[s].classList.contains(Oi)?o=parseInt(e[s].getAttribute(Hi),10):t.remove(e[s]);if("up"===i.direction){for(var l=[].slice.call(this.parent.getContent().getElementsByClassName(Oi)),a=parseInt(l[l.length-1].getAttribute(Hi),10),h=Math.ceil(a/this.parent.pageSettings.pageSize),d=0,s=this.parent.pageSettings.currentPage+1;s<h;s++)d+=this.infiniteCache[s].length;for(s=d;s<e.length;s++)t.remove(e[s])}},e.prototype.resetInfiniteBlocks=function(e,i){var r=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==e.requestType;if(!this.initialRender&&!t.isNullOrUndefined(this.parent.infiniteScrollModule)&&r&&(this.actions.some(function(t){return t===e.requestType})||i)){var n=this.parent.getContent().firstElementChild;this.initialRender=!0,n.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache=this.infiniteFrozenCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=0,this.isInitialMovableRender=!0,this.isInitialCollapse=!1,this.parent.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[]}},e.prototype.setCache=function(e){if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){var i=this.parent.isFrozenGrid(),r=e.args.isFrozen?1:0,n="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),o=this.parent.pageSettings.currentPage;(i&&this.isInitialMovableRender||!i&&!Object.keys(this.infiniteCache).length||n)&&(this.isInitialMovableRender=!e.args.isFrozen,this.setInitialCache(e.modelData,e.args,n)),!i&&t.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),i&&(0===r&&t.isNullOrUndefined(this.infiniteFrozenCache[o])||!this.infiniteFrozenCache[o][r].length)&&(this.createFrozenCache(o),this.infiniteFrozenCache[o][r]=e.modelData,1===r&&this.resetContentModuleCache(this.infiniteFrozenCache)),e.isInfiniteScroll&&!this.isRemove&&(this.isRemove=(o-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)}},e.prototype.setInitialCache=function(e,t,i,r){for(var n=this.parent.isFrozenGrid(),o=t.isFrozen?1:0,s=i?this.firstBlock:1,l=1;l<=this.parent.infiniteScrollSettings.initialBlocks;l++){var a=(l-1)*this.parent.pageSettings.pageSize,h=l*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!r?this.setInitialGroupCache(e,s,a,h):r?this.infiniteCurrentViewData[s]=e.slice(a,h):n?(this.createFrozenCache(s),this.infiniteFrozenCache[s][o]=e.slice(a,h),this.resetContentModuleCache(this.infiniteFrozenCache)):(this.infiniteCache[s]=e.slice(a,h),this.resetContentModuleCache(this.infiniteCache)),s++}},e.prototype.createFrozenCache=function(e){this.infiniteFrozenCache[e]||(this.infiniteFrozenCache[e]=[[],[]])},e.prototype.setInitialGroupCache=function(e,t,i,r){for(var n=[],o=0,s=1;s<=Object.keys(this.infiniteCache).length;s++)o+=this.infiniteCache[s].length;for(var l=i,s=o;s<e.length&&l<r&&((e[s].index<r||e[s].isCaptionRow)&&(l=e[s].isCaptionRow?l:e[s].index,n.push(e[s])),!(e[s].index>=r||e[s].index===r-1));s++);this.infiniteCache[t]=n,this.resetContentModuleCache(this.infiniteCache)},e.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},e.prototype.destroy=function(){this.removeEventListener()},e}(),fs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ms=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.childCount=0,r.scrollData=[],r.isFirstChildRow=!1,r.groupCache={},r.startIndexes={},r.captionCounts={},r.rowsByUid={},r.objIdxByUid={},r.initialGroupCaptions={},r.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete"],r.cacheMode=!1,r.cacheBlockSize=5,r.ignoreAccent=!!r.parent.allowFiltering&&r.parent.filterSettings.ignoreAccent,r.allowCaseSensitive=!1,r.locator=i,r.groupGenerator=new Ji(r.parent),r.summaryModelGen=new Ki(r.parent),r.captionModelGen=new Qi(r.parent),r.rowRenderer=new Vi(r.locator,null,r.parent),r.eventListener(),r}return fs(i,e),i.prototype.eventListener=function(){this.parent.addEventListener(bt,this.actionBegin.bind(this)),this.parent.addEventListener(St,this.actionComplete.bind(this)),this.parent.on(Ot,this.setLazyLoadPageSize,this),this.parent.on("group-cache",this.setCache,this),this.parent.on("lazy-load-scroll-handler",this.scrollHandler,this),this.parent.on(Wt,this.setVisible,this),this.parent.on("group-collapse",this.collapseShortcut,this)},i.prototype.captionExpand=function(e){var t=this,i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=!!r[o+1]&&r[o].indent<r[o+1].indent,l=r[o],a=this.getGroupKeysAndFields(o,r),h={captionRowElement:e,groupInfo:l,enableCaching:!0,cancel:!1};this.parent.trigger("lazyLoadGroupExpand",h,function(r){r.cancel||(r.keys=a.keys,r.fields=a.fields,r.rowIndex=e.rowIndex,r.makeRequest=!r.enableCaching||!s,!r.enableCaching&&s&&t.clearCache([n]),r.skip=0,r.take=t.pageSize,l.isExpand=t.rowsByUid[i][l.uid].isExpand=!0,t.captionRowExpand(r))})},i.prototype.captionCollapse=function(e){var t=this,i=this.groupCache[this.parent.pageSettings.currentPage],r=e.rowIndex,n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s={captionRowElement:e,groupInfo:i[o],cancel:!1};this.parent.trigger("lazyLoadGroupCollapse",s,function(e){e.cancel||(e.isExpand=!1,t.removeRows(o,r))})},i.prototype.setLazyLoadPageSize=function(){var e=this.parent.getContent().firstElementChild,t=Math.floor(e.offsetHeight/this.parent.getRowHeight())-1;this.pageSize=this.pageSize?this.pageSize:3*t,this.blockSize=Math.ceil(this.pageSize/2)},i.prototype.clearLazyGroupCache=function(){this.clearCache()},i.prototype.clearCache=function(e){e=e||this.getInitialCaptionIndexes();var t=this.groupCache[this.parent.pageSettings.currentPage];if(e.length)for(var i=0;i<e.length;i++){var r=this.getRowObjectIndexByUid(e[i]),n=t[r];if(n){if(this.captionCounts[this.parent.pageSettings.currentPage][n.uid])for(var o=r+1;o<t.length;o++){if(t[o].indent===n.indent||t[o].indent<n.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][n.uid];break}t[o].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[o].uid]}if(n.isExpand){var s=this.parent.getRowElementByUID(n.uid);if(!s)return;this.parent.groupModule.expandCollapseRows(s.querySelector(".e-recordplusexpand"))}var l=this.getNextChilds(r);if(l.length){var a=[];l[l.length-1].isCaptionRow&&(a=this.getChildRowsByParentIndex(t.indexOf(l[l.length-1]),!1,!1,null,!0,!0));var h=t.indexOf(l[0]),d=a.length?t.indexOf(a[a.length-1]):t.indexOf(l[l.length-1]);t.splice(h,d-(h-1)),this.refreshCaches()}}}},i.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[e];this.rowsByUid={},this.objIdxByUid={};for(var i=0;i<t.length;i++)this.maintainRows(t[i],i)},i.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[e].length;i++)t.push(this.initialGroupCaptions[e][i].uid);return t},i.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][e]},i.prototype.collapseShortcut=function(e){if(this.parent.groupSettings.columns.length&&e.target&&O(e.target,Di)&&"TR"===e.target.parentElement.tagName){if(!e.collapse&&O(e.target,Oi))return;var t=e.target.parentElement.getAttribute("data-uid");if(e.collapse){var i=this.getRowByUid(t);if((r=this.getRowByUid(i.parentUid)).isCaptionRow&&r.isExpand){n=this.getRowElementByUid(i.parentUid);this.parent.groupModule.expandCollapseRows(n.cells[i.indent-1])}}else{var r=this.getRowByUid(t);if(r.isCaptionRow&&!r.isExpand){var n=this.getRowElementByUid(t);this.parent.groupModule.expandCollapseRows(n.cells[r.indent])}}}},i.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][e]},i.prototype.actionBegin=function(e){if(!e.cancel){if(this.requestType.some(function(t){return t===e.requestType})||(this.groupCache={},this.resetRowMaintenance()),"reorder"===e.requestType&&this.parent.groupSettings.columns.length)for(var t=Object.keys(this.groupCache),i=0;i<t.length;i++)for(var r=this.groupCache[t[i]],n=0;n<r.length;n++)if(r[n].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(r[n],null,t[i]),r[n].isDataRow){var o=e.fromIndex+r[n].indent,s=e.toIndex+r[n].indent;this.moveCells(r[n].cells,o,s)}("delete"===e.requestType||"add"===e.action&&"save"===e.requestType)&&(this.groupCache={},this.resetRowMaintenance())}},i.prototype.actionComplete=function(e){e.cancel||"columnstate"===e.requestType||"beginEdit"===e.requestType||"delete"===e.requestType||"save"===e.requestType||"reorder"===e.requestType||this.scrollReset()},i.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},i.prototype.moveCells=function(e,t,i){if(t>=e.length)for(var r=t-e.length;1+r--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},i.prototype.removeRows=function(e,i){var r,n=this.parent.pageSettings.currentPage,o=this.groupCache[n],s=[].slice.call(this.parent.getContent().querySelectorAll("tr"));if(this.parent.aggregates.length){var l=this.getAggregateByCaptionIndex(e);r=l.length?l[l.length-1].uid:void 0}var a=o[e].indent;this.addClass(this.getNextChilds(e)),o[e].isExpand=this.rowsByUid[n][o[e].uid].isExpand=!1;for(var h,d=e+1;d<o.length;d++){if(o[d].indent===a||o[d].indent<a){h=o[d].uid;break}o[d].isCaptionRow&&o[d].isExpand&&this.addClass(this.getNextChilds(d))}for(d=i+1;d<s.length&&s[d].getAttribute("data-uid")!==h;d++){if(s[d].getAttribute("data-uid")===r){t.remove(s[d]);break}t.remove(s[d])}},i.prototype.addClass=function(e){var t=e[this.blockSize];t&&(t.lazyLoadCssClass="e-lazyload-middle-down")},i.prototype.getNextChilds=function(e,t){for(var i=this.groupCache[this.parent.pageSettings.currentPage],r=t||i,n=i[e].indent+1,o=[],s=t?0:e+1;s<r.length&&!(r[s].indent<n);s++)r[s].indent===n&&o.push(r[s]);return o},i.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index].getAttribute("data-uid"),i=this.getRowObjectIndexByUid(t),r=this.groupCache[this.parent.pageSettings.currentPage][i],n=e.isRowExist?e.isScroll?this.scrollData:this.getChildRowsByParentIndex(i,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(i,r),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][i],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(var o=0;o<e.data.length;o++){var s=this.groupGenerator.generateCaptionRow(e.data[o],e.level,r.parentGid,void 0,0,r.uid);n.push(s),this.parent.aggregates.length&&(n=n.concat(this.summaryModelGen.generateRows(e.data[o],{level:e.level+1,parentUid:s.uid})))}else this.groupGenerator.index=this.getStartIndex(i,e.isScroll),n=this.groupGenerator.generateDataRows(e.data,e.level,r.parentGid,0,r.uid);var l=e.isScroll?this.rowIndex:e.index,a=this.getNextChilds(i,n),h=!!e.up||this.hasLastChildRow(e.isScroll,e.count,a.length);e.isRowExist||h||(a[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),h||(a[a.length-1].lazyLoadCssClass="e-not-lazyload-end");var d=e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(i);e.up||e.isRowExist||this.refreshRowObjects(n,e.isScroll?this.rowObjectIndex:i),this.render(l,n,h,d),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=n.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0,this.childCount=0},i.prototype.setRowIndexes=function(e,t){this.captionCounts[this.parent.pageSettings.currentPage]||(this.captionCounts[this.parent.pageSettings.currentPage]={}),t.isCaptionRow&&(this.captionCounts[this.parent.pageSettings.currentPage][t.uid]=t.data.count)},i.prototype.getStartIndex=function(e,t){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i];if(t)return r[this.rowObjectIndex].index+1;var n=0,o=0,s=this.getRowByUid(r[e].parentUid);if(s&&(o=this.prevCaptionCount(s)),r[e].indent>0)for(var l=e-1;l>=0&&!(r[l].indent<r[e].indent);l--)r[l].isCaptionRow&&r[l].indent===r[e].indent&&(n+=r[l].data.count);return n+o+this.startIndexes[i][r[e].parentGid]},i.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[t],r=0,n=i.indexOf(e)-1;n>=0&&0!==i[n].indent&&!(i[n].indent<e.indent);n--)if(i[n].isCaptionRow&&i[n].indent===e.indent){var o=this.captionCounts[t][i[n].uid];r+=o||i[n].data.count}var s=this.getRowByUid(e.parentUid);return s&&(r+=this.prevCaptionCount(s)),r},i.prototype.setStartIndexes=function(){var e=this.groupCache[this.parent.pageSettings.currentPage];if(!this.startIndexes[this.parent.pageSettings.currentPage]){for(var t=[],i=void 0,r=0;r<e.length;r++)e[r].isCaptionRow&&(t.length?t.push(e[i].data.count+t[t.length-1]):t.push(0),i=r);this.startIndexes[this.parent.pageSettings.currentPage]=t}},i.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},i.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},i.prototype.render=function(e,t,i,r){var n=this.parent.getContent().querySelectorAll("tr")[e];if(n&&r.length)for(o=r.length-1;o>=0;o--)n.insertAdjacentElement("afterend",this.rowRenderer.render(r[o],this.parent.getColumns()));if(n&&t.length)for(var o=t.length-1;o>=0;o--)this.confirmRowRendering(t[o])&&n.insertAdjacentElement("afterend",this.rowRenderer.render(t[o],this.parent.getColumns()))},i.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[i]||(this.rowsByUid[i]={},this.objIdxByUid[i]={}),e.uid&&(this.rowsByUid[i][e.uid]=e),this.objIdxByUid[i][e.uid]=t},i.prototype.confirmRowRendering=function(e){var i=!0;if(t.isNullOrUndefined(e.indent)&&!e.isDataRow&&!e.isCaptionRow){var r=this.getRowByUid(e.parentUid);r.isCaptionRow&&!r.isExpand&&(i=!1)}return i},i.prototype.refreshRowObjects=function(e,i){var r=this.parent.pageSettings.currentPage,n=this.groupCache[r];this.rowsByUid[r]={},this.objIdxByUid[r]={};for(var o=[],s=0,l=0;l<n.length;l++)if(l===i){this.maintainRows(n[l],s),o.push(n[l]),s++;for(var a=0;a<e.length;a++)this.maintainRows(e[a],s),o.push(e[a]),s++}else this.maintainRows(n[l],s),o.push(n[l]),s++;this.groupCache[this.parent.pageSettings.currentPage]=t.extend([],o),this.updateCurrentViewData()},i.prototype.getAggregateByCaptionIndex=function(e){for(var i=this.groupCache[this.parent.pageSettings.currentPage],r=i[e],n=r.indent,o=r.uid,s=[],l=e+1;l<i.length&&i[l].indent!==n;l++)t.isNullOrUndefined(i[l].indent)&&i[l].parentUid===o&&s.push(i[l]);return s},i.prototype.getChildRowsByParentIndex=function(e,i,r,n,o,s){var l=n||this.groupCache[this.parent.pageSettings.currentPage],a=l[e],h=[];if(!a.isCaptionRow||a.isCaptionRow&&!a.isExpand&&!s)return[];o&&this.parent.aggregates.length&&(h=this.getAggregateByCaptionIndex(e));for(var d=a.indent,c=a.uid,p=[],u=0,g=e+1;g<l.length;g++){if(l[g].parentUid===c){if(t.isNullOrUndefined(l[g].indent))continue;if(u++,p.push(l[g]),i&&l[g].isCaptionRow&&(p=p.concat(this.getChildRowsByParentIndex(g,i,r,n,o))),r&&u===this.pageSize)break}if(l[g].indent===d)break}return p.concat(h)},i.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var r=0;r<i.length;r++)0===i[r].indent&&(t.push(i[r]),t=t.concat(this.getChildRowsByParentIndex(r,!0,!0,i,!0)));return t},i.prototype.getRenderedRowsObject=function(){for(var e=[],t=[].slice.call(this.parent.getContent().querySelectorAll("tr")),i=0;i<t.length;i++)e.push(this.getRowByUid(t[i].getAttribute("data-uid")));return e},i.prototype.getCacheRowsOnDownScroll=function(e){for(var i=[],r=this.groupCache[this.parent.pageSettings.currentPage],n=e,o=0;o<this.pageSize&&(r[n]&&!(r[n].indent<r[e].indent));o++)r[n].indent===r[e].indent&&(i.push(r[n]),r[n].isCaptionRow&&r[n].isExpand&&(i=i.concat(this.getChildRowsByParentIndex(n,!0,!0,null,!0)))),(r[n].indent>r[e].indent||t.isNullOrUndefined(r[n].indent))&&o--,n++;return i},i.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var r=[],n=this.groupCache[this.parent.pageSettings.currentPage],o=!1,s=0;s<n.length&&(!o||n[s]&&!(n[s].indent<n[i].indent)&&n[s].uid!==t);s++)o||n[s].uid!==e||(o=!0),o&&n[s].indent===n[i].indent&&(r.push(n[s]),n[s].isCaptionRow&&n[s].isExpand&&(r=r.concat(this.getChildRowsByParentIndex(s,!0,!0,null,!0))));return r},i.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-down")),r=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-up")),n=[].slice.call(this.parent.getContent().getElementsByClassName("e-not-lazyload-end")),o=!1,s=!1,l=!1;if(e.scrollDown&&i.length&&(t=(c=this.findRowElements(i)).tr,o=c.entered),!e.scrollDown&&n)for(var a=0;a<n.length;a++){var h=n[a].getBoundingClientRect().top,d=this.parent.getContent().scrollHeight;if(h>0&&h<d){t=n[a],l=!0,this.rowIndex=t.rowIndex;break}}if(!e.scrollDown&&r.length&&!l){var c=this.findRowElements(r);t=c.tr,s=c.entered}t&&(o&&e.scrollDown&&o&&t&&this.scrollDownHandler(t),!e.scrollDown&&l&&t&&this.scrollUpEndRowHandler(t),this.cacheMode&&!e.scrollDown&&!l&&s&&t&&this.scrollUpHandler(t))}},i.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[t],r=e.getAttribute("data-uid"),n=this.rowObjectIndex=this.getRowObjectIndexByUid(r),o=n,s=i[n],l=this.getRowByUid(s.parentUid),a=this.getRowObjectIndexByUid(l.uid),h=this.parent.getContent().querySelector("tr[data-uid="+l.uid+"]").rowIndex,d=this.getChildRowsByParentIndex(a).indexOf(s),c=Math.ceil(d/this.pageSize);if(1!==c)if(this.childCount=c*this.pageSize,n=this.getCurrentBlockEndIndex(s,n),this.childCount<l.data.count){e.classList.remove("e-not-lazyload-end"),s.lazyLoadCssClass="";var p=!!i[n+1]&&s.indent===i[n+1].indent;this.scrollData=p?this.getCacheRowsOnDownScroll(n+1):[];var u=this.getGroupKeysAndFields(a,i),g={rowIndex:h,makeRequest:!p,groupInfo:l,fields:u.fields,keys:u.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount>=this.pageSize*this.cacheBlockSize){var f=this.getChildRowsByParentIndex(a),m=Math.ceil(f.indexOf(i[o])/this.pageSize)-(this.cacheBlockSize-1);this.removeBlock(r,p,m,f),g.cachedRowIndex=m*this.pageSize}this.captionRowExpand(g)}else this.childCount=0},i.prototype.scrollDownHandler=function(e){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=o,l=r[o],a=this.getRowByUid(l.parentUid),h=this.getRowObjectIndexByUid(a.uid),d=this.getRowElementByUid(a.uid).rowIndex,c=this.getChildRowsByParentIndex(h),p=c.indexOf(l),u=Math.ceil(p/this.pageSize);this.childCount=u*this.pageSize;var g=r[o=this.rowObjectIndex=this.getRowObjectIndexByUid(c[this.childCount-1].uid)],f=this.getRowElementByUid(g.uid);if(this.rowIndex=f.rowIndex,o=this.getCurrentBlockEndIndex(g,o),this.childCount<a.data.count){var m=!!r[o+1]&&l.indent===r[o+1].indent;if(m&&!t.isNullOrUndefined(this.getRowElementByUid(r[o+1].uid)))return void(this.childCount=0);(u>1||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),f.classList.remove("e-not-lazyload-end"),g.lazyLoadCssClass=""),this.scrollData=m?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[];var y=this.getGroupKeysAndFields(h,r),v={rowIndex:d,makeRequest:!m,groupInfo:a,fields:y.fields,keys:y.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize){var C=this.getChildRowsByParentIndex(h),w=Math.ceil(C.indexOf(r[s])/this.pageSize)-1-(this.cacheBlockSize-1)+1;this.removeBlock(n,m,w,C,g),v.cachedRowIndex=w*this.pageSize}this.captionRowExpand(v)}else this.childCount=0},i.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i];if(e.isCaptionRow){if(e.isExpand){var n=this.getChildRowsByParentIndex(t,!0).length;this.rowIndex=this.rowIndex+n}var o=this.getAggregateByCaptionIndex(t);this.rowObjectIndex=this.rowObjectIndex+o.length;for(var s=t,l=s+1;l<r.length;l++){if(r[l].indent===r[t].indent||r[l].indent<r[t].indent){t=s;break}s++}}return t},i.prototype.removeBlock=function(e,t,i,r,n){var o=this.parent.pageSettings.currentPage,s=this.groupCache[o],l=r[(i+1)*this.pageSize-1-this.blockSize].uid,a=r[i*this.pageSize-this.pageSize].uid,h=r[i*this.pageSize].uid;s[this.getRowObjectIndexByUid(l)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(l).classList.add("e-lazyload-middle-up"),n&&(this.getRowElementByUid(h).classList.add("e-not-lazyload-first"),this.getRowByUid(h).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(a).lazyLoadCssClass=""),t?this.removeTopRows(n?n.uid:e,a,h):(this.uid1=a,this.uid2=h,this.uid3=n?n.uid:e)},i.prototype.scrollUpHandler=function(e){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowByUid(n),s=this.rowObjectIndex=this.getRowObjectIndexByUid(n),l=this.getRowByUid(o.parentUid),a=this.rowIndex=this.getRowObjectIndexByUid(l.uid),h=this.parent.getRowElementByUID(l.uid).rowIndex,d=this.getChildRowsByParentIndex(a),c=d.indexOf(r[s]),p=Math.floor(c/this.pageSize),u=this.blockSize;2*this.blockSize>this.pageSize&&(u=2*this.blockSize-this.pageSize,u=this.blockSize-u);var g=d[c-(u-1)-this.pageSize].uid,f=d[c-(u-1)].uid;this.scrollData=this.getCacheRowsOnUpScroll(g,f,s-(u-1)),this.isFirstChildRow=p>1,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(f).lazyLoadCssClass="",this.getRowElementByUid(f).classList.remove("e-not-lazyload-first");var m=p+this.cacheBlockSize;if(d.length!==l.data.count&&m*this.pageSize>d.length)return this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",void this.getRowElementByUid(f).classList.add("e-not-lazyload-first");var y=m*this.pageSize>l.data.count?l.data.count:m*this.pageSize,v=m*this.pageSize>l.data.count?this.pageSize-(this.pageSize*m-l.data.count):this.pageSize,C=this.getChildRowsByParentIndex(r.indexOf(d[y-1]),!0,!1,null,!0),w=C.length?C[C.length-1].uid:d[y-1].uid,b=d[y-v].uid,S=d[y-v-1].uid,R=this.objIdxByUid[i][b]-u;if("e-lazyload-middle-down"===r[R].lazyLoadCssClass){var x=this.getRowElementByUid(r[R].uid);x&&x.classList.add("e-lazyload-middle-down")}if(this.getRowByUid(w).lazyLoadCssClass="",this.getRowByUid(S).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(S).classList.add("e-not-lazyload-end"),this.removeBottomRows(w,b,S),this.rowIndex=e.rowIndex-u,e.classList.length>1?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),!t.isNullOrUndefined(this.getRowElementByUid(g)))return this.childCount=0,void(this.scrollData=[]);var F=this.getGroupKeysAndFields(this.getRowObjectIndexByUid(l.uid),r),E={rowIndex:h,makeRequest:!1,groupInfo:l,fields:F.fields,keys:F.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0};this.captionRowExpand(E)},i.prototype.findRowElements=function(e){for(var t,i=!1,r=0;r<e.length;r++){var n=e[r].rowIndex;if(Ee(n,this.parent)){i=!0,this.rowIndex=n,t=e[r];break}}return{entered:i,tr:t}},i.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},i.prototype.removeTopRows=function(e,i,r){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=!1,s=0;s<n.length;s++){if(n[s].getAttribute("data-uid")===r){var l=this.parent.getContent().querySelector("tr[data-uid="+e+"]");l&&(this.rowIndex=l.rowIndex);break}n[s].getAttribute("data-uid")===i&&(o=!0),o&&t.remove(n[s])}},i.prototype.removeBottomRows=function(e,i,r){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=!1,s=0;s<n.length&&(n[s].getAttribute("data-uid")===i&&(o=!0),!o||(t.remove(n[s]),n[s].getAttribute("data-uid")!==e));s++);},i.prototype.setCache=function(e){var i=this.parent.pageSettings.currentPage;this.groupCache[i]=this.initialGroupCaptions[i]=t.extend([],e.data)},i.prototype.getGroupKeysAndFields=function(e,t){for(var i=[],r=[],n=e;n>=0&&(!t[n].isCaptionRow||-1!==i.indexOf(t[n].data.field)||!(t[n].indent<t[e].indent||n===e)||(i.push(t[n].data.field),r.push(t[n].data.key),0!==t[n].indent));n--);return{fields:i,keys:r}},i.prototype.generateExpandPredicates=function(e,i){for(var r=[],n=0;n<e.length;n++){var o=this.parent.getColumnByField(e[n]),s="null"===i[n]?null:i[n],l={field:e[n],predicate:"or",uid:o.uid,operator:"equal",type:o.type,matchCase:this.allowCaseSensitive,ignoreAccent:this.ignoreAccent};""===s||t.isNullOrUndefined(s)?r=r.concat(bn.generateNullValuePredicates(l)):r.push(t.extend({},{value:s},l))}return bn.getPredicate(r)},i.prototype.getPredicates=function(e){for(var t=[],i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];t.push(e[n])}return t},i.prototype.captionRowExpand=function(e){var t=this,i=e.groupInfo,r=this.parent.groupSettings.columns.indexOf(i.data.field)+1,n=this.generateExpandPredicates(e.fields,e.keys),o=this.getPredicates(n),s={level:r,skip:e.skip,take:e.take,where:o};if(e.makeRequest){var l=this.parent.renderModule.data.generateQuery(!0);l.isCountRequired||(l.isCountRequired=!0),l.lazyLoad.push({key:"onDemandGroupInfo",value:s}),this.parent.showSpinner(),this.parent.renderModule.data.getData({},l).then(function(i){t.parent.hideSpinner(),0!==i.result.length&&(t.cacheMode&&t.uid1&&t.uid2&&(t.removeTopRows(t.uid3,t.uid1,t.uid2),t.uid1=t.uid2=t.uid3=void 0),t.lazyLoadHandler({data:i.result,count:i.count,level:r,index:e.rowIndex,isRowExist:!1,isScroll:e.isScroll,up:!1,rowIndex:e.cachedRowIndex}))}).catch(function(e){return t.parent.renderModule.dataManagerFailure(e,{requestType:"grouping"})})}else this.lazyLoadHandler({data:null,count:e.groupInfo.data.count,level:r,index:e.rowIndex,isRowExist:!0,isScroll:e.isScroll,up:e.scrollUp,rowIndex:e.cachedRowIndex})},i.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},i.prototype.updateCurrentViewData=function(){var e=[];this.getRows().filter(function(t){t.isDataRow&&(e[t.index]=t.data)}),this.parent.currentViewData=e.length?e:this.parent.currentViewData},i.prototype.getGroupCache=function(){return this.groupCache},i.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},i.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().getElementsByClassName(Oi))},i.prototype.getRowByIndex=function(e){for(var i,r=[].slice.call(this.parent.getContent().getElementsByClassName(Oi)),n=0;!t.isNullOrUndefined(e)&&n<r.length;n++)if(r[n].getAttribute(Hi)===e.toString()){i=r[n];break}return i},i.prototype.setVisible=function(e){var i,r=this.parent;this.getRows().some(function(e){return e.isDataRow&&(i=e),e.isDataRow});for(var n=this.getRows().filter(function(e){return!e.isDetailRow}),o=0;o<e.length;o++){var s=e[o],l=this.parent.getNormalizedColumnIndex(s.uid),a=this.parent.getColumnIndexByUid(s.uid),h=!0===s.visible?"":"none";-1!==l&&i&&l<i.cells.length&&t.setStyleAttribute(this.getColGroup().childNodes[l],{display:h}),this.setDisplayNone(r.getDataRows(),a,h,n,l),!this.parent.invokedFromMedia&&s.hideAtMedia&&this.parent.updateMediaColumns(s),this.parent.invokedFromMedia=!1}},i.prototype.setDisplayNone=function(e,i,r,n,o){if(this.parent.groupSettings.columns.length)for(var s=Object.keys(this.groupCache),l=0;l<s.length;l++)for(var a=this.rowsByUid[s[l]],h=Object.keys(a),d=0;d<h.length;d++){var c=this.parent.getContent().querySelector("tr[data-uid="+h[d]+"]"),p=a[h[d]];p.isCaptionRow&&(this.captionModelGen.isEmpty()?(p.cells[p.indent+1].colSpan=""===r?p.cells[p.indent+1].colSpan+1:p.cells[p.indent+1].colSpan-1,c&&(c.cells[p.indent+1].colSpan=p.cells[p.indent+1].colSpan)):this.changeCaptionRow(p,c,s[l])),p.isDataRow&&(this.showAndHideCells(c,i,r,!1),p.cells[o].visible=""===r),p.isCaptionRow||p.isDataRow||!t.isNullOrUndefined(p.indent)||(p.cells[o].visible=""===r,p.visible=p.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(c,i,r,!0,p))}else Qe(e,i,r,n)},i.prototype.changeCaptionRow=function(e,t,i){var r=e,n=e.data,o=this.groupGenerator.generateCaptionRow(n,r.indent,r.parentGid,void 0,r.tIndex,r.parentUid);o.uid=e.uid,o.isExpand=e.isExpand,o.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[i][e.uid]=o,this.groupCache[i][this.objIdxByUid[i][e.uid]]=o,t&&this.parent.getContentTable().querySelector(Ui).replaceChild(this.rowRenderer.render(o,this.parent.getColumns()),t)},i.prototype.showAndHideCells=function(e,i,r,n,o){if(e){var s=n?"td.e-summarycell":"td.e-rowcell";t.setStyleAttribute(e.querySelectorAll(s)[i],{display:r}),e.querySelectorAll(s)[i].classList.contains("e-hide")&&t.removeClass([e.querySelectorAll(s)[i]],["e-hide"]),n&&(o.visible&&e.classList.contains("e-hide")?t.removeClass([e],["e-hide"]):o.visible||t.addClass([e],["e-hide"]))}},i}(Yi),ys=function(){function t(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}return t.prototype.getModuleName=function(){return"lazyLoadGroup"},t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Mt,this.instantiateRenderer,this)},t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Mt,this.instantiateRenderer)},t.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var t=this.serviceLocator.getService("rendererFactory");this.parent.groupSettings.enableLazyLoading&&t.addRenderer(e.RenderType.Content,new ms(this.parent,this.serviceLocator))},t.prototype.destroy=function(){this.removeEventListener()},t}(),vs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cs=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return vs(r,e),r.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode;this.object=new s.AutoComplete(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).select(e.column.field),enabled:Q(e.column,e.requestType,e.element),fields:{value:e.column.field},value:pe(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:r?"":e.column.headerText,floatLabelType:r?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},r.prototype.selectedValues=function(e){e.result=i.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},r}(mo),ws=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bs=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return ws(r,e),r.prototype.write=function(e){this.column=e.column;var r="Dialog"!==this.parent.editSettings.mode;this.obj=new s.ComboBox(t.extend({dataSource:this.parent.dataSource instanceof i.DataManager?this.parent.dataSource:new i.DataManager(this.parent.dataSource),query:(new i.Query).select(e.column.field),fields:{value:e.column.field},value:pe(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:r?"":e.column.headerText,floatLabelType:r?"Never":"Always",enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},r.prototype.finalValue=function(e){e.result=i.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},r}(mo),Ss=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ss(i,e),i.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new s.MultiSelect(t.extend({fields:{text:e.column.field,value:e.column.field},value:t.getValue(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,popupHeight:"200px",floatLabelType:i?"Never":"Always"},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",W(e.column.field))},i}(mo),xs=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return xs(i,e),i.prototype.write=function(e){var i="Dialog"!==this.parent.editSettings.mode,r=pe(e.column.field,e.rowData);r=r?new Date(r):null,this.obj=new l.TimePicker(t.extend({floatLabelType:i?"Never":"Always",value:r,placeholder:i?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},i}(mo),Es=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Is=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return Es(i,e),i.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),Je(this.parent,e.column,t,{type:"checkbox",value:e.value})},i.prototype.read=function(e){return e.checked},i.prototype.write=function(e){var i=!t.isNullOrUndefined(e.row)&&e.row.querySelector(".e-edit-checkselect"),r=pe(e.column.field,e.rowData),o=r&&JSON.parse(r.toString().toLowerCase());if(!t.isNullOrUndefined(i)){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var s=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));o=!!s&&s.isSelected}Z.apply(void 0,[[].slice.call(e.row.getElementsByClassName(bi)),o].concat(this.activeClasses))}this.obj=new n.Switch(t.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:o,disabled:!Q(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this)},e.column.edit.params)),this.obj.appendTo(e.element)},i.prototype.switchModeChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),Z.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(bi)),t].concat(this.activeClasses))}},i}(mo),Ts=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ts(i,e),i.prototype.write=function(e){this.column=e.column;var i="Dialog"!==this.parent.editSettings.mode;this.obj=new o.MaskedTextBox(t.extend({fields:{value:e.column.field},value:pe(e.column.field,e.rowData),floatLabelType:i?"Never":"Always",mask:"000-000-0000",enabled:Q(e.column,e.requestType,e.element)},e.column.edit.params)),this.obj.appendTo(e.element)},i}(mo);return mn.Inject(_n,On,Wr,xn,Jn,Qn,Xn,Yn,Zn,ro,Kr,co,ko,Kn,No,Lo,Uo,Vo,ts,is,Ao,ns,gs,ys),e.CheckBoxFilterBase=bn,e.ExcelFilterBase=Rn,e.SortDescriptor=nn,e.SortSettings=on,e.Predicate=sn,e.InfiniteScrollSettings=ln,e.FilterSettings=an,e.SelectionSettings=hn,e.SearchSettings=dn,e.RowDropSettings=cn,e.TextWrapSettings=pn,e.ResizeSettings=un,e.GroupSettings=gn,e.EditSettings=fn,e.Grid=mn,e.doesImplementInterface=u,e.valueAccessor=g,e.headerValueAccessor=f,e.getUpdateUsingRaf=m,e.isExportColumns=y,e.updateColumnTypeForExportColumns=v,e.updatecloneRow=C,e.getCollapsedRowsCount=w,e.recursive=b,e.iterateArrayOrObject=S,e.iterateExtend=R,e.templateCompiler=x,e.setStyleAndAttributes=F,e.extend=E,e.setColumnIndex=I,e.prepareColumns=T,e.setCssInGridPopUp=z,e.getActualProperties=M,e.parentsUntil=O,e.getElementIndex=k,e.inArray=A,e.getActualPropFromColl=B,e.removeElement=P,e.getPosition=N,e.getUid=L,e.appendChildren=q,e.parents=H,e.calculateAggregate=U,e.getScrollBarWidth=j,e.getRowHeight=V,e.getActualRowHeight=G,e.isComplexField=_,e.getComplexFieldID=W,e.setComplexFieldID=K,e.isEditable=Q,e.isActionPrevent=X,e.wrap=J,e.setFormatter=Y,e.addRemoveActiveClasses=Z,e.distinctStringValues=$,e.getFilterMenuPostion=ee,e.getZIndexCalcualtion=te,e.toogleCheckbox=ie,e.setChecked=re,e.createCboxWithWrap=ne,e.removeAddCboxClasses=oe,e.refreshForeignData=se,e.getForeignData=le,e.getColumnByForeignKeyValue=ae,e.getDatePredicate=he,e.renderMovable=de,e.isGroupAdaptive=ce,e.getObject=pe,e.getCustomDateFormat=ue,e.getExpandedState=ge,e.getPrintGridModel=fe,e.extendObjWithFn=me,e.measureColumnDepth=ve,e.checkDepth=Ce,e.refreshFilteredColsUid=we,e.getTransformValues=be,e.applyBiggerTheme=Se,e.alignFrozenEditForm=Re,e.ensureLastRow=xe,e.ensureFirstRow=Fe,e.isRowEnteredInGrid=Ee,e.getEditedDataIndex=Ie,e.eventPromise=Te,e.getStateEventArgument=ze,e.ispercentageWidth=De,e.resetRowIndex=Me,e.compareChanges=Oe,e.setRowElements=ke,e.splitFrozenRowObjectCells=Ae,e.gridActionHandler=Be,e.getGridRowObjects=Pe,e.getGridRowElements=Ne,e.sliceElements=Le,e.getCellsByTableName=qe,e.getCellByColAndRowIndex=He,e.setValidationRuels=Ue,e.getMovableTbody=je,e.getFrozenRightTbody=Ve,e.setRowsInTbody=Ge,e.getNumberFormat=_e,e.addBiggerDialog=We,e.performComplexDataOperation=Ke,e.setDisplayValue=Qe,e.addRemoveEventListener=Xe,e.createEditElement=Je,e.getColumnModelByUid=Ye,e.getColumnModelByFieldName=Ze,e.created="create",e.destroyed="destroy",e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.headerCellInfo="headerCellInfo",e.actionBegin=bt,e.actionComplete=St,e.actionFailure="actionFailure",e.dataBound=Rt,e.rowSelecting="rowSelecting",e.rowSelected="rowSelected",e.rowDeselecting="rowDeselecting",e.rowDeselected="rowDeselected",e.cellSelecting="cellSelecting",e.cellSelected="cellSelected",e.cellDeselecting="cellDeselecting",e.cellDeselected="cellDeselected",e.columnSelecting="columnSelecting",e.columnSelected="columnSelected",e.columnDeselecting="columnDeselecting",e.columnDeselected="columnDeselected",e.columnDragStart=xt,e.columnDrag=Ft,e.columnDrop=Et,e.rowDragStartHelper=It,e.rowDragStart=Tt,e.rowDrag=zt,e.rowDrop=Dt,e.beforePrint="beforePrint",e.printComplete="printComplete",e.detailDataBound="detailDataBound",e.toolbarClick="toolbarClick",e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchDelete="batchDelete",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beginEdit="beginEdit",e.cellEdit="cellEdit",e.cellSave="cellSave",e.cellSaved="cellSaved",e.endAdd="endAdd",e.endDelete="endDelete",e.endEdit="endEdit",e.recordDoubleClick="recordDoubleClick",e.recordClick="recordClick",e.beforeDataBound="beforeDataBound",e.beforeOpenColumnChooser="beforeOpenColumnChooser",e.beforeOpenAdaptiveDialog="beforeOpenAdaptiveDialog",e.resizeStart="resizeStart",e.onResize="resizing",e.resizeStop="resizeStop",e.checkBoxChange="checkBoxChange",e.beforeCopy="beforeCopy",e.beforePaste="beforePaste",e.beforeAutoFill="beforeAutoFill",e.filterChoiceRequest="filterchoicerequest",e.filterAfterOpen="filterafteropen",e.filterBeforeOpen="filterbeforeopen",e.filterSearchBegin="filtersearchbegin",e.commandClick="commandClick",e.exportGroupCaption="exportGroupCaption",e.lazyLoadGroupExpand="lazyLoadGroupExpand",e.lazyLoadGroupCollapse="lazyLoadGroupCollapse",e.initialLoad=Mt,e.initialEnd=Ot,e.dataReady=kt,e.contentReady=At,e.uiUpdate=Bt,e.onEmpty=Pt,e.inBoundModelChanged=Nt,e.modelChanged=Lt,e.colGroupRefresh=qt,e.headerRefreshed=Ht,e.pageBegin="paging-begin",e.pageComplete="paging-complete",e.sortBegin="sorting-begin",e.sortComplete="sorting-complete",e.filterBegin="filtering-begin",e.filterComplete="filtering-complete",e.searchBegin="searching-begin",e.searchComplete="searching-complete",e.reorderBegin="reorder-begin",e.reorderComplete=Ut,e.rowDragAndDropBegin="rowdraganddrop-begin",e.rowDragAndDropComplete="rowdraganddrop-complete",e.groupBegin="grouping-begin",e.groupComplete="grouping-complete",e.ungroupBegin="ungrouping-begin",e.ungroupComplete="ungrouping-complete",e.groupAggregates="group-aggregates",e.refreshFooterRenderer="refresh-footer-rendered",e.refreshAggregateCell="refresh-aggregate-cell",e.refreshAggregates="refresh-aggregates",e.rowSelectionBegin="rowselecting",e.rowSelectionComplete="rowselected",e.columnSelectionBegin="columnselecting",e.columnSelectionComplete="columnselected",e.cellSelectionBegin="cellselecting",e.cellSelectionComplete="cellselected",e.beforeCellFocused=jt,e.cellFocused="cellfocused",e.keyPressed=Vt,e.click=Gt,e.destroy=_t,e.columnVisibilityChanged=Wt,e.scroll="scroll",e.columnWidthChanged="column-width-changed",e.columnPositionChanged=Kt,e.rowDragAndDrop="row-drag-and-drop",e.rowsAdded=Qt,e.rowsRemoved=Xt,e.columnDragStop=Jt,e.headerDrop=Yt,e.dataSourceModified=Zt,e.refreshComplete="refresh-complete",e.refreshVirtualBlock=$t,e.dblclick="dblclick",e.toolbarRefresh="toolbar-refresh",e.bulkSave="bulk-save",e.autoCol=ei,e.tooltipDestroy="tooltip-destroy",e.updateData=ti,e.editBegin="edit-begin",e.editComplete="edit-complete",e.addBegin="add-begin",e.addComplete="add-complete",e.saveComplete="save-complete",e.deleteBegin="delete-begin",e.deleteComplete="delete-complete",e.preventBatch=ii,e.dialogDestroy=ri,e.crudAction="crud-Action",e.addDeleteAction=ni,e.destroyForm="destroy-form",e.doubleTap="double-tap",e.beforeExcelExport="beforeExcelExport",e.excelExportComplete="excelExportComplete",e.excelQueryCellInfo="excelQueryCellInfo",e.excelHeaderQueryCellInfo="excelHeaderQueryCellInfo",e.exportDetailDataBound="exportdetaildatabound",e.beforePdfExport="beforePdfExport",e.pdfExportComplete="pdfExportComplete",e.pdfQueryCellInfo="pdfQueryCellInfo",e.pdfHeaderQueryCellInfo="pdfHeaderQueryCellInfo",e.accessPredicate="access-predicate",e.contextMenuClick="contextMenuClick",e.freezeRender=oi,e.freezeRefresh="freezerefresh",e.contextMenuOpen="contextMenuOpen",e.columnMenuClick="columnMenuClick",e.columnMenuOpen="columnMenuOpen",e.filterOpen="filterOpen",e.filterDialogCreated="filterDialogCreated",e.filterMenuClose="filter-menu-close",e.initForeignKeyColumn="initForeignKeyColumn",e.getForeignKeyData="getForeignKeyData",e.generateQuery="generateQuery",e.showEmptyGrid="showEmptyGrid",e.foreignKeyData="foreignKeyData",e.columnDataStateChange="columnDataStateChange",e.dataStateChange="dataStateChange",e.dataSourceChanged="dataSourceChanged",e.rtlUpdated="rtl-updated",e.beforeFragAppend="beforeFragAppend",e.frozenHeight="frozenHeight",e.textWrapRefresh="textWrapRefresh",e.recordAdded="recordAdded",e.cancelBegin="cancel-Begin",e.editNextValCell="editNextValCell",e.hierarchyPrint=si,e.expandChildGrid=li,e.printGridInit="printGrid-Init",e.exportRowDataBound="export-RowDataBound",e.exportDataBound="export-DataBound",e.rowPositionChanged=ai,e.columnChooserOpened="columnChooserOpened",e.batchForm="batchedit-form",e.beforeStartEdit="edit-form",e.beforeBatchCancel="before-batch-cancel",e.batchEditFormRendered="batcheditform-rendered",e.partialRefresh="partial-refresh",e.beforeCustomFilterOpen="beforeCustomFilterOpen",e.selectVirtualRow="select-virtual-Row",e.columnsPrepared=hi,e.cBoxFltrBegin="cbox-filter-begin",e.cBoxFltrComplete=di,e.fltrPrevent=ci,e.beforeFltrcMenuOpen="before-filter-cmenu-open",e.valCustomPlacement="validation-custom-placement",e.filterCboxValue="filter-cbox-value",e.componentRendered="component-rendered",e.restoreFocus="restore-Focus",e.detailStateChange="detail-state-change",e.detailIndentCellInfo="detail-indentcell-info",e.virtaulKeyHandler="virtaul-key-handler",e.virtaulCellFocus="virtaul-cell-focus",e.virtualScrollEditActionBegin="virtual-scroll-edit-action-begin",e.virtualScrollEditSuccess="virtual-scroll-edit-success",e.virtualScrollEditCancel="virtual-scroll-edit-cancel",e.virtualScrollEdit="virtual-scroll-edit",e.refreshVirtualCache="refresh-virtual-cache",e.editReset="edit-reset",e.virtualScrollAddActionBegin="virtual-scroll-add-action-begin",e.getVirtualData=pi,e.refreshInfiniteModeBlocks=ui,e.resetInfiniteBlocks="reset-infinite-blocks",e.infiniteScrollHandler="infinite-scroll-handler",e.infinitePageQuery="infinite-page-query",e.infiniteShowHide="infinite-show-hide",e.appendInfiniteContent="append-infinite-content",e.removeInfiniteRows="remove-infinite-rows",e.setInfiniteCache="set-infinite-cache",e.infiniteEditHandler="infinite-edit-handler",e.initialCollapse="initial-collapse",e.getAggregateQuery="get-aggregate-query",e.closeFilterDialog="close-filter-dialog",e.columnChooserCancelBtnClick="columnChooserCancelBtnClick",e.getFilterBarOperator="get-filterbar-operator",e.resetColumns="reset-columns",e.pdfAggregateQueryCellInfo="pdfAggregateQueryCellInfo",e.excelAggregateQueryCellInfo="excelAggregateQueryCellInfo",e.setGroupCache="group-cache",e.lazyLoadScrollHandler="lazy-load-scroll-handler",e.groupCollapse="group-collapse",e.beforeCheckboxRenderer="beforeCheckboxRenderer",e.refreshHandlers=gi,e.refreshFrozenColumns="refresh-frozen-columns",e.setReorderDestinationElement="set-reorder-destination-element",e.refreshVirtualFrozenHeight="refresh-virtual-frozen-height",e.setFreezeSelection="set-freeze-selection",e.setInfiniteFrozenHeight="set-infinite-frozen-height",e.setInfiniteColFrozenHeight="set-infinite-col-frozen-height",e.beforeRefreshOnDataChange="before-refresh-on-data-change",e.immutableBatchCancel="immutable-batch-cancel",e.refreshVirtualFrozenRows="refresh-virtual-frozenrows",e.checkScrollReset="check-scroll-reset",e.refreshFrozenHeight="refresh-frozen-height",e.setHeightToFrozenElement="set-height-to-frozen-element",e.preventFrozenScrollRefresh="prevent-frozen-scroll-refresh",e.nextCellIndex="next-cell-index",e.refreshInfiniteCurrentViewData="refresh-infinite-current-view-data",e.infiniteCrudCancel="infinite-crud-cancel",e.filterDialogClose="filter-dialog-close",e.refreshCustomFilterOkBtn="refresh-cutsom-filter-ok-button",e.refreshCustomFilterClearBtn="refresh-cutsom-filter-clear-button",e.renderResponsiveCmenu="render-responsive-cmenu",e.filterCmenuSelect="filter-cmenu-select",e.customFilterClose="custom-filter-close",e.setFullScreenDialog="set-fullscreen-dialog",e.refreshExpandandCollapse="refresh-Expand-and-Collapse",e.rowModeChange="row-mode-change",e.enterKeyHandler="enter-key-handler",e.refreshVirtualMaxPage="refresh-virtual-max-page",e.setVirtualPageQuery="set-virtual-page-query",e.selectRowOnContextOpen="select-row-on-context-open",e.pagerRefresh="pager-refresh",e.closeInline="closeinline",e.closeBatch="closebatch",e.closeEdit="close-edit",e.resetVirtualFocus="reset-virtual-focus",e.afterContentRender="after-content-renderer",e.refreshVirtualEditFormCells="refresh-virtual-editform-cells",e.scrollToEdit="scroll-to-edit",e.beforeCheckboxRendererQuery="before-checkbox-renderer-query",e.createVirtualValidationForm="create-virtual-validation-form",e.validateVirtualForm="validate-virtual-form",e.rowCell=bi,e.gridHeader=Si,e.gridContent=Ri,e.gridFooter=xi,e.headerContent=Fi,e.movableContent=Ei,e.movableHeader=Ii,e.frozenContent=Ti,e.frozenHeader=zi,e.content=Di,e.table=Mi,e.row=Oi,e.gridChkBox=ki,e.editedRow=Ai,e.addedRow=Bi,e.changedRecords="changedRecords",e.addedRecords="addedRecords",e.deletedRecords="deletedRecords",e.leftRight=Pi,e.frozenRight=Ni,e.frozenLeft=Li,e.ariaColIndex=qi,e.ariaRowIndex=Hi,e.tbody=Ui,e.colGroup=ji,e.Data=yi,e.Sort=xn,e.Page=On,e.Selection=Wr,e.Filter=_n,e.Search=Kr,e.Scroll=Xr,e.resizeClassList=Wn,e.Resize=Kn,e.Reorder=Qn,e.RowDD=Xn,e.Group=Jn,e.getCloneProperties=p,e.Print=yn,e.DetailRow=Yn,e.Toolbar=Zn,e.Aggregate=ro,e.summaryIterator=$e,e.VirtualScroll=co,e.Edit=ko,e.BatchEdit=Io,e.InlineEdit=Eo,e.NormalEdit=xo,e.DialogEdit=zo,e.ColumnChooser=Ao,e.ExcelExport=No,e.PdfExport=Lo,e.ExportHelper=Bo,e.ExportValueFormatter=Po,e.Clipboard=en,e.CommandColumn=Uo,e.CheckBoxFilter=jn,e.menuClass=jo,e.ContextMenu=Vo,e.Freeze=ts,e.ColumnMenu=is,e.ExcelFilter=Gn,e.ForeignKey=ns,e.Logger=ds,e.detailLists=cs,e.InfiniteScroll=gs,e.LazyLoadGroup=ys,e.Column=Ct,e.CommandColumnModel=wt,e.Row=vi,e.Cell=Ci,e.HeaderRender=Zi,e.ContentRender=Yi,e.RowRenderer=Vi,e.CellRenderer=$i,e.HeaderCellRenderer=rr,e.FilterCellRenderer=Bn,e.StackedHeaderCellRenderer=or,e.Render=Rr,e.IndentCellRenderer=lr,e.GroupCaptionCellRenderer=hr,e.GroupCaptionEmptyCellRenderer=dr,e.BatchEditRender=uo,e.DialogEditRender=go,e.InlineEditRender=po,e.EditRender=fo,e.BooleanEditCell=vo,e.DefaultEditCell=Ro,e.DropDownEditCell=wo,e.NumericEditCell=bo,e.DatePickerEditCell=Mo,e.CommandColumnRenderer=Ho,e.FreezeContentRender=Wo,e.FreezeRender=Ko,e.StringFilterUI=Nn,e.NumberFilterUI=Ln,e.DateFilterUI=Hn,e.BooleanFilterUI=qn,e.FlMenuOptrUI=Pn,e.AutoCompleteEditCell=Cs,e.ComboboxEditCell=bs,e.MultiSelectEditCell=Rs,e.TimePickerEditCell=Fs,e.ToggleEditCell=Is,e.MaskedTextBoxCellEdit=zs,e.VirtualContentRenderer=lo,e.VirtualHeaderRenderer=ao,e.VirtualElementHandler=ho,e.GroupLazyLoadRenderer=ms,e.ColumnFreezeHeaderRenderer=Xo,e.ColumnFreezeContentRenderer=Jo,e.ResponsiveDialogRenderer=Fr,e.EditCellBase=mo,e.CellRendererFactory=xr,e.ServiceLocator=Er,e.RowModelGenerator=Gi,e.GroupModelGenerator=Ji,e.FreezeRowModelGenerator=Go,e.ValueFormatter=yt,e.VirtualRowModelGenerator=oo,e.InterSectionObserver=no,e.Pager=zn,e.ExternalMessage=Mn,e.NumericContainer=Fn,e.PagerMessage=En,e.PagerDropDown=Dn,e}({},ej.base,ej.data,ej.popups,ej.buttons,ej.inputs,ej.dropdowns,ej.calendars,ej.navigations,ej.excelexport,ej.pdfexport),this.ejs=ej;
- /*!
- * filename: ej2-dropdowns.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.dropdowns=function(e,t,i,s,l,o,r,n){"use strict";function a(e,t,i,s,l,o){C+=String.fromCharCode(e),setTimeout(function(){C=""},1e3);var r;if(C=s?C.toLowerCase():C,x===l&&b===C){for(p=0;p<S.length;p++)if(S[p].classList.contains(E)){r=p;break}return r+=1,S[r]}var n=t,a=C.length,h=void 0,p=i=i?i+1:0;S=[];do{p===n.length&&(p=-1),h=n[r=-1===p?0:p],(o?s?h.textContent.trim().toLowerCase():h.textContent.trim():s?h.innerText.toLowerCase():h.innerText).substr(0,a)===C&&S.push(n[r]),p++}while(p!==i);return b=C,x=l,S[0]}function h(e,t,i,s){var l=t;s=void 0===s||null===s||s;var o={item:null,index:null};if(e&&e.length){for(var r=e.length,n=s?e.toLocaleLowerCase():e,a=0,h=l;a<h.length;a++){var p=h[a],u=(s?p.textContent.toLocaleLowerCase():p.textContent).replace(/^\s+|\s+$/g,"");if("Equal"===i&&u===n||"StartsWith"===i&&u.substr(0,r)===n)return o.item=p,o.index=a,{item:p,index:a}}return o}return o}function p(e,t,i,s,l){if(""!==t){var o=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var r="StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")";u(e,new RegExp(r,o),l)}}function u(e,t,i){for(var s=0;e.childNodes&&s<e.childNodes.length;s++){if(3===e.childNodes[s].nodeType&&""!==e.childNodes[s].textContent.trim()){if(e=i&&e.classList.contains("e-highlight")?e.parentElement:e,i&&e.getAttribute("data-value"))e.innerHTML=e.getAttribute("data-value").replace(t,'<span class="e-highlight">$1</span>');else{var l=e.childNodes[s].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[s].nodeValue="",e.innerHTML=e.innerHTML.trim()+l}break}u(e.childNodes[s],t,i)}}function c(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}function d(e,i,s,l,o,r,n){var a=t.createElement("span",{className:ee}),h=t.createElement("label",{className:te});t.isNullOrUndefined(s.id)||""===s.id||(h.id="label_"+s.id.replace(/ /g,"_"),t.attributes(s,{"aria-labelledby":h.id})),t.isNullOrUndefined(l.placeholder)||""===l.placeholder||(h.innerText=t.SanitizeHtmlHelper.sanitize(l.placeholder),l.removeAttribute("placeholder")),h.innerText=t.SanitizeHtmlHelper.sanitize(n),i.appendChild(a),i.appendChild(h),e.classList.add("e-float-input"),m(o,h),"Always"===r&&(h.classList.contains(se)&&t.removeClass([h],se),t.addClass([h],ie))}function m(e,i){e&&e.length>0?(t.addClass([i],ie),t.removeClass([i],se)):(t.removeClass([i],ie),t.addClass([i],se))}function f(e,i,s,l,o,r,n){var a,h=i.querySelector("."+te),p=i.querySelector("."+ee);t.isNullOrUndefined(h)?v(o,l,a=null!==n?n:""):(a=h.innerText,t.detach(s.querySelector("."+te)),v(o,l,a),t.isNullOrUndefined(p)||t.detach(s.querySelector("."+ee))),e.classList.remove("e-float-input")}function v(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function y(e,i){e.classList.add("e-input-focus");var s=i.querySelector("."+te);t.isNullOrUndefined(s)||(t.addClass([s],ie),s.classList.contains(se)&&t.removeClass([s],se))}function g(e,i,s,l,o){e.classList.remove("e-input-focus");var r=i.querySelector("."+te);s&&s.length<=0&&"Auto"===l&&!t.isNullOrUndefined(r)&&(r.classList.contains(ie)&&t.removeClass([r],ie),t.addClass([r],se))}var C="",b="",S=[],E="e-active",x="",w=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),O=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return w(i,e),O([t.Property()],i.prototype,"text",void 0),O([t.Property()],i.prototype,"value",void 0),O([t.Property()],i.prototype,"iconCss",void 0),O([t.Property()],i.prototype,"groupBy",void 0),O([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),k={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group"},B=function(e){function l(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isAngular=!1,s.isPreventChange=!1,s}return w(l,e),l.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,o=function(e){return e};s[o(e)]=t[o(e)],l[o(e)]=i[o(e)];var r=new Object;return r.newProperty=s,r.oldProperty=l,r},l.prototype.getValueByText=function(e,i,s){var l=null;return t.isNullOrUndefined(this.listData)||(l=i?this.checkValueCase(e,!0,s):this.checkValueCase(e,!1,s)),l},l.prototype.checkValueCase=function(e,i,s,l){var o=this,r=null;l&&(r=e);var n=this.listData,a=this.fields,h=this.typeOfData(n).typeof;if("string"===h||"number"===h||"boolean"===h)for(var p=0,u=n;p<u.length;p++){var c=u[p];t.isNullOrUndefined(c)||(s?r=this.checkingAccent(String(c),e,i):i?this.checkIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i)):this.checkNonIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i,l)))}else i?n.filter(function(i){var s=t.getValue(a.value,i);!t.isNullOrUndefined(s)&&o.checkIgnoreCase(t.getValue(a.text,i).toString(),e)&&(r=t.getValue(a.value,i))}):l?n.filter(function(e){var i=t.getValue(a.value,e);t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||i.toString()!==r.toString()||(r=t.getValue(a.text,e))}):n.filter(function(i){o.checkNonIgnoreCase(t.getValue(a.text,i),e)&&(r=t.getValue(a.value,i))});return r},l.prototype.checkingAccent=function(e,t,s){var l=i.DataUtil.ignoreDiacritics(String(e)),o=i.DataUtil.ignoreDiacritics(t.toString()),r=null;return s?this.checkIgnoreCase(l,o)&&(r=this.getItemValue(String(e),t,s)):this.checkNonIgnoreCase(String(e),t)&&(r=this.getItemValue(String(e),t,s)),r},l.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},l.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},l.prototype.getItemValue=function(e,t,i,s){var l=this.listData,o=this.typeOfData(l).typeof;return s?e.toString():i?"string"===o?String(e):this.getFormattedValue(String(e)):"string"===o?t:this.getFormattedValue(t)},l.prototype.templateCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},l.prototype.l10nUpdate=function(e){var i="listbox"===this.getModuleName()?this.ulElement:this.list;if("No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){this.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0);var s=e?this.actionFailureTemplate:this.noRecordsTemplate,l=void 0,o=e?this.actionFailureTemplateId:this.noRecordsTemplateId;i.innerHTML="";var r=(l=this.templateCompiler(s)?t.compile(t.select(s,document).innerHTML.trim()):t.compile(s))({},this,e?"actionFailureTemplate":"noRecordsTemplate",o,this.isStringTemplate,null,i);if(r&&r.length>0)for(var n=0;n<r.length;n++)i.appendChild(r[n]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!e,e,!1,!1,!1,!1)}else{var a={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},h=new t.L10n(this.getLocaleName(),{},this.locale);""!==h.getConstant("actionFailureTemplate")?this.l10n=h:this.l10n=new t.L10n("listbox"===this.getModuleName()?"listbox":"dropdowns",a,this.locale);var p=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName()){var u=this.createElement("li");u.textContent=p,i.appendChild(u),u.classList.add("e-list-nrt")}else i.innerHTML=p}},l.prototype.getLocaleName=function(){return"drop-down-base"},l.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},l.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var i=this.typeOfData(this.listData);if(t.isBlazor()&&t.isNullOrUndefined(e)||"null"===e)return null;if("number"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"number"===i.typeof)return parseFloat(e);if("boolean"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"boolean"===i.typeof)return"true"===e||""+e=="true"}return e},l.prototype.setEnableRtl=function(){this.list&&this.enableRtlElements.push(this.list),this.enableRtl?t.addClass(this.enableRtlElements,k.rtl):t.removeClass(this.enableRtlElements,k.rtl)},l.prototype.initialize=function(){if(this.bindEvent=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var e=s.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(e,this.fields)}else"SELECT"===this.element.tagName?(this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource))||this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query)},l.prototype.DropDownBaseupdateBlazorTemplates=function(e,i,s,l,o,r,n,a){this.isStringTemplate||(this.itemTemplate&&e&&t.updateBlazorTemplate(this.itemTemplateId,"ItemTemplate",this,a),this.groupTemplate&&i&&t.updateBlazorTemplate(this.groupTemplateId,"GroupTemplate",this,a),this.noRecordsTemplate&&s&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,a),this.actionFailureTemplate&&l&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,a),o&&t.updateBlazorTemplate(this.valueTemplateId,"ValueTemplate",this,a),r&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),n&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},l.prototype.DropDownBaseresetBlazorTemplates=function(e,i,s,l,o,r,n){this.isStringTemplate||(this.itemTemplate&&e&&t.resetBlazorTemplate(this.itemTemplateId,"ItemTemplate"),this.groupTemplate&&i&&t.resetBlazorTemplate(this.groupTemplateId,"GroupTemplate"),this.noRecordsTemplate&&s&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&l&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),o&&t.resetBlazorTemplate(this.valueTemplateId,"ValueTemplate"),r&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),n&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l.prototype.updateDataAttribute=function(e){for(var i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1!==i.indexOf(this.element.attributes[l].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[l].name||(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},l.prototype.renderItemsBySelect=function(){var e=this.element,t={value:"value",text:"text"},i=[],s=e.querySelectorAll("select>optgroup"),l=e.querySelectorAll("select>option");if(this.getJSONfromOption(i,l,t),s.length){for(var o=0;o<s.length;o++){var r=s[o],n={};n[t.text]=r.label,n.isHeader=!0;var a=r.querySelectorAll("option");i.push(n),this.getJSONfromOption(i,a,t)}e.querySelectorAll("select>option")}this.updateFields(t.text,t.value,this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss),this.resetList(i,t)},l.prototype.updateFields=function(e,i,s,l,o){var r={fields:{text:e,value:i,groupBy:t.isNullOrUndefined(s)?this.fields&&this.fields.groupBy:s,htmlAttributes:t.isNullOrUndefined(l)?this.fields&&this.fields.htmlAttributes:l,iconCss:t.isNullOrUndefined(o)?this.fields&&this.fields.iconCss:o}};this.setProperties(r,!0)},l.prototype.getJSONfromOption=function(e,i,s){for(var l=0,o=i;l<o.length;l++){var r=o[l],n={};n[s.text]=r.innerText,n[s.value]=t.isNullOrUndefined(r.getAttribute(s.value))?r.innerText:r.getAttribute(s.value),e.push(n)}},l.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},l.prototype.setListData=function(e,t,s){var l=this;t=t||this.fields;var o;this.isActive=!0;var r={cancel:!1,data:e,query:s};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.trigger("actionBegin",r,function(s){if(!s.cancel)if(l.showSpinner(),e instanceof i.DataManager){if(l.isRequested=!0,l.isDataFetched)return void l.emptyDataRequest(t);s.data.executeQuery(l.getQuery(s.query)).then(function(e){l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",e,function(e){if(!e.cancel){var i=e.result;0===i.length&&(l.isDataFetched=!0),o=l.renderItems(i,t),l.onActionComplete(o,i,e),l.groupTemplate&&l.renderGroupTemplate(o),l.isRequested=!1,l.bindChildItems(i,o,t,e)}})}).catch(function(e){l.isRequested=!1,l.onActionFailure(e),l.hideSpinner()})}else{var r=new i.DataManager(s.data),n={cancel:!1,result:l.getQuery(s.query).executeLocal(r)};l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",n,function(e){e.cancel||(o=l.renderItems(e.result,t),l.onActionComplete(o,e.result),l.groupTemplate&&l.renderGroupTemplate(o),l.bindChildItems(e.result,o,t))})}})},l.prototype.bindChildItems=function(e,i,s,l){var o=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout(function(){var r=o.remainingItems(o.sortedData,s);t.append(r,i),o.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),o.liCollections=o.list.querySelectorAll("."+k.li),o.updateListValues(),o.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},l.prototype.updateListValues=function(){},l.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var o=[].slice.call(e.querySelectorAll(t)),r=0;r<o.length;r++)if(o[r].getAttribute(i)===s+""){l=o[r];break}return l},l.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},l.prototype.remainingItems=function(e,t){var l=new i.DataManager(e).executeLocal((new i.Query).skip(100));if(this.itemTemplate){var o=this.templateListItem(l,t);return[].slice.call(o.childNodes)}var r=this.typeOfData(l).typeof;return"string"===r||"number"===r||"boolean"===r?s.ListBase.createListItemFromArray(this.createElement,l,!0,this.listOption(l,t),this):s.ListBase.createListItemFromJson(this.createElement,l,this.listOption(l,t),1,!0,this)},l.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.hideSpinner()},l.prototype.showSpinner=function(){},l.prototype.hideSpinner=function(){},l.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.list],k.noData)},l.prototype.onActionComplete=function(e,i,s){this.listData=i,t.isBlazor()&&this.isServerRendered&&"listbox"===this.getModuleName()?(t.remove(this.list.querySelector(".e-list-parent")),t.remove(this.list.querySelector(".e-hidden-select"))):(this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.list.innerHTML=""),this.fixedHeaderElement=t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null,this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+k.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,i,this.bindEvent)},l.prototype.postRender=function(e,i,s){var l=e.querySelector("."+k.li),o=e.querySelector("."+k.selected);l&&!o&&l.classList.add(k.focus),i.length<=0?(this.l10nUpdate(),t.addClass([e],k.noData)):e.classList.remove(k.noData)},l.prototype.getQuery=function(e){return e||(this.query?this.query:new i.Query)},l.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+k.group)){var i=this.dataSource,l={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},o=e.querySelectorAll("."+k.group);if(this.templateCompiler(this.groupTemplate)){var r=t.select(this.groupTemplate,document).innerHTML.trim();s.ListBase.renderGroupTemplate(r,i,this.fields.properties,o,l,this)}else s.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,o,l,this);this.DropDownBaseupdateBlazorTemplates(!1,!0,!1,!1,!1,!1,!1,!1)}},l.prototype.createListItems=function(e,l){e&&l.groupBy||this.element.querySelector("optgroup")?(l.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=s.ListBase.groupDataSource(e,l.properties,this.sortOrder)),t.addClass([this.list],k.grouping)):e=this.getSortedDataSource(e);var o=this.listOption(e,l),r=e.length>100?new i.DataManager(e).executeLocal((new i.Query).take(100)):e;return this.sortedData=e,s.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?r:e,o,!0,this)},l.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties,o=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return t.extend({},o,i,!0)},l.prototype.setFloatingHeader=function(e){t.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:k.fixedHead}),this.list.querySelector("li").classList.contains(k.group)||(this.fixedHeaderElement.style.display="none"),t.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),t.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e)},l.prototype.scrollStop=function(e){for(var i=t.isNullOrUndefined(e)?this.list:e.target,s=parseInt(getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),10),l=Math.round(i.scrollTop/s),o=this.list.querySelectorAll("li:not(.e-hide-listitem)"),r=l;r>-1;r--){if(!t.isNullOrUndefined(o[r])&&o[r].classList.contains(k.group)){var n=o[r];this.fixedHeaderElement.innerHTML=n.innerHTML,this.fixedHeaderElement.style.top=i.scrollTop+"px",this.fixedHeaderElement.style.display="block";break}this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none"}},l.prototype.getValidLi=function(){return this.liCollections[0]},l.prototype.renderItems=function(e,t){var l;if(this.itemTemplate&&e){var o=e;o&&t.groupBy?("None"!==this.sortOrder&&(o=this.getSortedDataSource(o)),o=s.ListBase.groupDataSource(o,t.properties,this.sortOrder)):o=this.getSortedDataSource(o),this.sortedData=o;var r=o.length>100?new i.DataManager(o).executeLocal((new i.Query).take(100)):o;l=this.templateListItem("autocomplete"===this.getModuleName()?r:o,t);var n="listbox"===this.getModuleName();this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,n)}else l=this.createListItems(e,t);return l},l.prototype.templateListItem=function(e,i){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var l=this.listOption(e,i);if(l.templateID=this.itemTemplateId,l.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate)){var o=t.select(this.itemTemplate,document).innerHTML.trim();return s.ListBase.renderContentTemplate(this.createElement,o,e,i.properties,l,this)}return s.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,i.properties,l,this)},l.prototype.typeOfData=function(e){for(var i={typeof:null,item:null},s=0;!t.isNullOrUndefined(e)&&s<e.length;s++)if(!t.isNullOrUndefined(e[s])&&!("string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t.isNullOrUndefined(e[s]):t.isNullOrUndefined(t.getValue(this.fields.value?this.fields.value:"value",e[s]))))return i={typeof:typeof e[s],item:e[s]};return i},l.prototype.setFixedHeader=function(){this.list.parentElement.style.display="block";var e=0;this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)));var i=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=i.toString()+"px",t.setStyleAttribute(this.fixedHeaderElement,{zIndex:10});var s=this.ulElement.querySelector("."+k.group+":not(.e-hide-listitem)");this.fixedHeaderElement.innerHTML=s.innerHTML},l.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=s.ListBase.getDataSource(e,s.ListBase.addSorting(this.sortOrder,t))}return e},l.prototype.getIndexByValue=function(e){for(var i,s=this.getItems(),l=0;l<s.length;l++)if(!t.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},l.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i)},l.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||this.updateFields("text","text")},l.prototype.resetList=function(e,i,s){this.list&&(("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)&&!(e instanceof Array?e.length>0:!t.isNullOrUndefined(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData),this.setListData(e,i,s))},l.prototype.updateSelectElementData=function(e){e&&t.isNullOrUndefined(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},l.prototype.updateSelection=function(){},l.prototype.renderList=function(){this.render()},l.prototype.updateDataSource=function(e){this.resetList(this.dataSource)},l.prototype.setUpdateInitial=function(e,t){this.isDataFetched=!1;for(var i={},s=0;e.length>s;s++)t[e[s]]&&"fields"===e[s]?(this.setFields(),i[e[s]]=t[e[s]]):t[e[s]]&&(i[e[s]]=t[e[s]]);Object.keys(i).length>0&&(-1===Object.keys(i).indexOf("dataSource")&&(i.dataSource=this.dataSource),this.updateDataSource(i))},l.prototype.onPropertyChanged=function(e,i){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnabled();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var o=this.ulElement.querySelector("."+k.group);this.fixedHeaderElement.innerHTML=o.innerHTML}break;case"locale":this.list&&!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},l.prototype.render=function(e){this.list=this.createElement("div",{className:k.content,attrs:{tabindex:"0"}}),this.list.classList.add(k.root),this.setFields();var i={duration:300,selector:"."+k.li};this.rippleFun=t.rippleEffect(this.list,i);var s=this.element.querySelector("select>optgroup");if(!this.fields.groupBy&&t.isNullOrUndefined(s)||this.isGroupChecking||t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),"dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),t.removeClass([this.element],k.root),this.element.style.display="none";var l=this.createElement("div");this.element.parentElement.insertBefore(l,this.element),l.appendChild(this.element),l.appendChild(this.list)}this.setEnableRtl(),this.setEnabled(),e||this.initialize()},l.prototype.getModuleName=function(){return"dropdownbase"},l.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+k.li)},l.prototype.addItem=function(e,i){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&t.isNullOrUndefined(i)){var l=[].slice.call(this.listData);l.push(e),l=this.getSortedDataSource(l),i=this.fields.groupBy?(l=s.ListBase.groupDataSource(l,this.fields.properties,this.sortOrder)).indexOf(e):l.indexOf(e)}this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var o=this.getItems().length,r=this.list.querySelector("."+k.selected);e=e instanceof Array?e:[e];var n;n=t.isNullOrUndefined(i)||i<0||i>o-1?o:i;var a=this.fields;e&&a.groupBy&&(e=s.ListBase.groupDataSource(e,a.properties));for(var h=[],p=0;p<e.length;p++){var u=e[p],c=u.isHeader,d=this.createElement("li",{className:c?k.group:k.li,id:"option-add-"+p}),m=u instanceof Object?t.getValue(a.text,u):u;if(c&&(d.innerText=m),this.itemTemplate&&!c){var f=t.compile(this.itemTemplate)(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d);f&&t.append(f,d),this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1)}else c||d.appendChild(document.createTextNode(m));d.setAttribute("data-value",u instanceof Object?t.getValue(a.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),h.push(d),this.listData.push(u),"None"===this.sortOrder&&t.isNullOrUndefined(i)&&0===n&&(n=null),this.updateActionCompleteData(d,u,n),this.trigger("beforeItemRender",{element:d,item:u})}if(0===o&&t.isNullOrUndefined(this.list.querySelector("ul")))this.list.innerHTML="",this.list.classList.remove(k.noData),this.list.appendChild(this.ulElement),this.liCollections=h,t.append(h,this.ulElement),this.updateAddItemList(this.list,o);else{"listbox"===this.getModuleName()&&0===o&&(this.ulElement.innerHTML="");for(var v=[],p=0;p<e.length;p++){for(var y=this.ulElement.querySelectorAll(".e-list-group-item"),g=0;g<y.length;g++)v[g]=y[g].innerText;if(v.indexOf(h[p].innerText)>-1&&a.groupBy){for(g=0;g<y.length;g++)if(v[g]===h[p].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(h[p+1],y[g+1]):this.ulElement.insertBefore(h[p+1],this.ulElement.childNodes[i]),p+=1;break}}else this.liCollections[n]?this.liCollections[n].parentNode.insertBefore(h[p],this.liCollections[n]):this.ulElement.appendChild(h[p]);var C=[].slice.call(this.liCollections);C.splice(n,0,h[p]),this.liCollections=C,n+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}(r||0===i)&&this.updateSelection()},l.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var o=e.getAttribute(s[l]);t.setAttribute(s[l],o),e.removeAttribute(s[l])}},l.prototype.setZIndex=function(){},l.prototype.updateActionCompleteData=function(e,t,i){},l.prototype.updateAddItemList=function(e,t){},l.prototype.updateDataList=function(){},l.prototype.getDataByValue=function(e){if(!t.isNullOrUndefined(this.listData)){var i=this.typeOfData(this.listData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.listData;s<l.length;s++){n=l[s];if(!t.isNullOrUndefined(n)&&n===e)return n}else for(var o=0,r=this.listData;o<r.length;o++){var n=r[o];if(!t.isNullOrUndefined(n)&&t.getValue(this.fields.value?this.fields.value:"value",n)===e)return n}}return null},l.prototype.destroy=function(){document.body.contains(this.list)&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.isNullOrUndefined(this.rippleFun)||this.rippleFun(),t.detach(this.list)),e.prototype.destroy.call(this)},O([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],l.prototype,"fields",void 0),O([t.Property(!1)],l.prototype,"enablePersistence",void 0),O([t.Property(null)],l.prototype,"itemTemplate",void 0),O([t.Property(null)],l.prototype,"groupTemplate",void 0),O([t.Property("No records found")],l.prototype,"noRecordsTemplate",void 0),O([t.Property("Request failed")],l.prototype,"actionFailureTemplate",void 0),O([t.Property("None")],l.prototype,"sortOrder",void 0),O([t.Property(!0)],l.prototype,"enabled",void 0),O([t.Property([])],l.prototype,"dataSource",void 0),O([t.Property(null)],l.prototype,"query",void 0),O([t.Property("StartsWith")],l.prototype,"filterType",void 0),O([t.Property(!0)],l.prototype,"ignoreCase",void 0),O([t.Property(1e3)],l.prototype,"zIndex",void 0),O([t.Property(!1)],l.prototype,"ignoreAccent",void 0),O([t.Property()],l.prototype,"locale",void 0),O([t.Event()],l.prototype,"actionBegin",void 0),O([t.Event()],l.prototype,"actionComplete",void 0),O([t.Event()],l.prototype,"actionFailure",void 0),O([t.Event()],l.prototype,"select",void 0),O([t.Event()],l.prototype,"dataBound",void 0),O([t.Event()],l.prototype,"created",void 0),O([t.Event()],l.prototype,"destroyed",void 0),l=O([t.NotifyPropertyChanges],l)}(t.Component),D=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),T=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},I={root:"e-dropdownlist",hover:k.hover,selected:k.selected,rtl:k.rtl,li:k.li,disable:k.disabled,base:k.root,focus:k.focus,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden"},L={container:null,buttons:[]},N=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isAngular=!1,s}return D(s,e),s.prototype.preRender=function(){var i=t.isBlazor()&&this.isServerRendered;this.isServerBlazor=!!i,this.valueTempElement=null,this.isServerBlazor?this.initializeData():(this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this)),this.activeIndex=this.index,this.queryString=""},s.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"}},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.renderList=function(t){this.isServerBlazor?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):(e.prototype.render.call(this,t),this.unWireListEvents(),this.wireListEvents())},s.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");""!==this.inputElement.value||this.isInteracted?t.classList(e,["e-label-top"],["e-label-bottom"]):t.classList(e,["e-label-bottom"],["e-label-top"])}},s.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e)},s.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.ulElement)){var e=this.ulElement.querySelector("."+I.li);e&&e.classList.add(I.focus)}},s.prototype.clearAll=function(e,s){!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s.dataSource)&&(s.dataSource instanceof i.DataManager||0!==s.dataSource.length))||(this.isActive=!0,this.resetSelection(s));var l=this.getItemData();this.previousValue!==l.value&&this.onChangeEvent(e)},s.prototype.resetSelection=function(e){this.list&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)?(!this.allowFiltering||"autocomplete"===this.getModuleName()||t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),this.isServerBlazor||(this.hiddenElement.innerHTML=""),this.inputElement.value="",this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s){var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&t.addClass([this.inputWrapper.container],l.split(" "))}else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.enabled=!1,this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[s]);else{var r=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],n=["name","required"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||r.push("tabindex"),n.indexOf(s)>-1||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputElement):this.inputElement.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},s.prototype.setEnableRtl=function(){o.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(t.removeClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex)):(this.hidePopup(),t.addClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.getLocaleName=function(){return"drop-down-list"},s.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},s.prototype.targetElement=function(){return this.inputWrapper.container},s.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},s.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.initValue=function(){this.renderList(),this.dataSource instanceof i.DataManager?this.initRemoteRender=!0:this.updateValues()},s.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(t.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else this.setSelection(this.getElementByValue(this.value),null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onBlur=function(e){if(this.enabled){var i=e.relatedTarget,s=e.target,l=this.isPreventBlur;if(this.isPreventBlur=!1,l&&!this.isDocumentClick&&this.isPopupOpen&&(!t.isNullOrUndefined(s)||!this.isFilterLayout()&&t.isNullOrUndefined(i)))return void("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus());if(this.isDocumentClick||!t.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(I.mobileFilter))return void(this.beforePopupOpen||(this.isDocumentClick=!1));("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&i!==this.inputElement&&(document.activeElement!==i||document.activeElement===i&&s.classList.contains(I.inputFocus))||t.isNullOrUndefined(i)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&s!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(i)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1)}},s.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut()},s.prototype.onFocusOut=function(){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(null)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&t.addClass([this.inputWrapper.clearButton],I.clearIconHide),this.trigger("blur"))},s.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),this.bindCommonEvent()},s.prototype.bindCommonEvent=function(){t.EventHandler.add(this.targetElement(),"blur",this.onBlur,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.Browser.isDevice?this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},s.prototype.unBindCommonEvent=function(){this.targetElement()&&t.EventHandler.remove(this.targetElement(),"blur",this.onBlur);var e=this.inputElement&&t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},s.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?t.addClass([this.inputWrapper.clearButton],I.clearIconHide):t.removeClass([this.inputWrapper.clearButton],I.clearIconHide))},s.prototype.wireListEvents=function(){t.EventHandler.add(this.list,"click",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&(this.isServerBlazor?(this.isServerIncrementalSearch=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1)):this.renderList()),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},s.prototype.onServerIncrementalSearch=function(e){this.isRequested||t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},s.prototype.onMouseClick=function(e){var i=e.target,s=t.closest(i,"."+k.li);if(this.isValidLI(s))if(this.setSelection(s,e),t.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100)}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);this.setHover(i)},s.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(k.hover)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.removeHover=function(){if(this.list){var e=this.isServerBlazor&&this.popupObj&&this.popupObj.element?this.popupObj.element.querySelectorAll("."+k.hover):this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.incrementalSearch=function(e){if(this.liCollections.length>0){var i=a(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id,this.isServerBlazor);t.isNullOrUndefined(i)||(this.setSelection(i,e),this.setScrollPosition())}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=t.Browser.isDevice&&!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},s.prototype.keyActionHandler=function(e){if(this.enabled){var i="pageUp"===e.action||"pageDown"===e.action,s="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var l="down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action,o="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||i||s)||this.isPopupOpen)&&!this.readonly){var r="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||r||"escape"===e.action||(this.searchKeyEvent=e,this.renderList()),((!this.isServerBlazor||"open"!==e.action&&"space"!==e.action)&&t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&o&&0===this.liCollections.length||this.isRequested)&&(!this.isServerBlazor||!l))return;switch((r&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!o&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||this.showPopup());break;case"open":this.showPopup();break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},s.prototype.updateUpDownAction=function(e){if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=this.list.querySelector("."+I.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else{var s="down"===e.action?this.activeIndex+1:this.activeIndex-1,l=0;"autocomplete"===this.getModuleName()&&(l="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,s=s<0?this.liCollections.length-1:s===this.liCollections.length?0:s);var o=t.isNullOrUndefined(this.activeIndex)?this.liCollections[l]:this.liCollections[s];t.isNullOrUndefined(o)||this.setSelection(o,e)}e.preventDefault()}},s.prototype.updateHomeEndAction=function(e){if("dropdownlist"===this.getModuleName())if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=0;if(i="home"===e.action?0:this.getItems().length-1,e.preventDefault(),this.activeIndex===i)return;this.setSelection(this.liCollections[i],e)}},s.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},s.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},s.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+I.focus);t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(),this.focusDropDown(e)}else this.showPopup()},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.getPageCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.getBoundingClientRect().height/parseInt(e,10))},s.prototype.pageUpSelection=function(e,t){var i=e>=0?this.liCollections[e+1]:this.liCollections[0];this.setSelection(i,t)},s.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=e<=i.length?this.liCollections[e-1]:this.liCollections[i.length-1];this.setSelection(s,t)},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),t.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),t.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),this.unBindCommonEvent()},s.prototype.unWireListEvents=function(){t.EventHandler.remove(this.list,"click",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},s.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},s.prototype.onDocumentClick=function(e){var i=e.target;if(!t.isNullOrUndefined(this.popupObj)&&t.closest(i,this.checkSelector(this.popupObj.element.id))||this.inputWrapper.container.contains(e.target))i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&t.Browser.isDevice&&i===this.inputWrapper.buttons[0]||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(I.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var s=this.isRequested;this.isInteracted=!1,this.hidePopup(e),s||(this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))}},s.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))},s.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},s.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&!this.targetElement().classList.contains(I.disable)&&this.inputWrapper.clearButton!==e.target){var i=e.target;if(i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen?(this.hidePopup(),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup());var s=this,l=t.isBlazor()?1e3:this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout(function(){s.cloneElements(),s.isSecondClick=!0},l)}}},s.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},s.prototype.updateSelectedItem=function(e,i,s,l){var o=this;this.removeSelection(),e.classList.add(k.selected),this.removeHover();var r=this.getFormattedValue(e.getAttribute("data-value")),n=this.getDataByValue(r);if(this.initial||s||t.isNullOrUndefined(i))this.selectEventCallback(e,i,s,n,r),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerItemData",this.itemData),l&&this.setSelectOptions(e,i);else{var a=this.detachChanges(n);this.isSelected=!0;var h={e:i,item:e,itemData:a,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?e.classList.remove(k.selected):(o.selectEventCallback(e,i,s,n,r),o.isServerBlazor&&o.interopAdaptor.invokeMethodAsync("OnServerItemData",o.itemData),l&&o.setSelectOptions(e,i))})}},s.prototype.selectEventCallback=function(e,i,s,l,o){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=l;var r=this.list.querySelector("."+k.focus);r&&t.removeClass([r],k.focus),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(o)},s.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(k.selected)&&(this.removeSelection(),e.classList.add(k.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},s.prototype.setValue=function(e){var i=this.getItemData();null===i.value?t.isBlazor()&&null!==i.text||""!==i.text?o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerValueTemplate",i),this.valueTemplate&&null!==this.itemData&&!this.isServerBlazor?(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!0),this.setValueTemplate()):this.inputElement.previousSibling===this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block");var s=I.clearIcon,l=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+s);return this.isFiltering()&&l&&l.style.removeProperty("visibility"),this.previousValue===i.value?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},s.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(k.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(k.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(i)||(this.isPopupOpen&&(t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null}),this.isFilterLayout()&&this.filterInput&&t.attributes(this.filterInput,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})),(!this.isPopupOpen&&!t.isNullOrUndefined(e)||this.isPopupOpen&&!t.isNullOrUndefined(i)&&("keydown"!==i.type||"keydown"===i.type&&"enter"===i.action))&&(this.isSelectCustom=!1,this.onChangeEvent(i)),!this.isPopupOpen||t.isNullOrUndefined(this.selectedLI)||null===this.itemData||i&&"click"===i.type||this.setScrollPosition(i),"mozilla"!==t.Browser.info.name&&(t.attributes(this.inputElement,{"aria-label":this.inputElement.value}),t.attributes(this.targetElement(),{"aria-describedby":this.inputElement.id}),this.targetElement().removeAttribute("aria-live")))},s.prototype.dropdownCompiler=function(e){var t=!1;if(e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},s.prototype.setValueTemplate=function(){var e;this.isReact&&this.clearTemplate(["valueTemplate"]),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:I.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.valueTempElement.innerHTML="";var i=t.isBlazor()?JSON.parse(JSON.stringify(this.itemData)):this.itemData,s=(e=this.dropdownCompiler(this.valueTemplate)?t.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):t.compile(this.valueTemplate))(i,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.valueTempElement.appendChild(s[l]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!0,!0)},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+k.selected);e.length&&(t.removeClass(e,k.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.onChangeEvent=function(e){var t=this.getItemData(),i=this.isSelectCustom?null:this.activeIndex;this.setProperties({index:i,text:t.text,value:t.value},!0),this.detachChangeEvent(e)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.index,this.typedString=t.isNullOrUndefined(this.text)?"":this.text,!this.initial){var i=this.detachChanges(this.itemData),s=void 0;s="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var l={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:s,isInteracted:!!e,value:this.value,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",l),this.isServerBlazor&&this.enablePersistence&&this.interopAdaptor.invokeMethodAsync("ServerChange")}!t.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||t.removeClass([this.inputWrapper.container],"e-valid-input")},s.prototype.setHiddenValue=function(){if(t.isNullOrUndefined(this.value))this.isServerBlazor||(this.hiddenElement.innerHTML="");else if(this.isServerBlazor&&this.hiddenElement.querySelector("option"))(e=this.hiddenElement.querySelector("option")).textContent=this.text,e.setAttribute("value",this.value.toString());else if(!this.isServerBlazor){this.hiddenElement.innerHTML="<option selected>"+this.text+"</option>";var e=this.hiddenElement.querySelector("option");e.setAttribute("value",this.value.toString())}},s.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.searchLists(e)}},s.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},s.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},s.prototype.getQuery=function(e){var t;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){t=e?e.clone():this.query?this.query.clone():new i.Query;var s=""===this.typedString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t=e?e.clone():this.query?this.query.clone():new i.Query;return t},s.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},s.prototype.searchLists=function(e){var t=this;if(this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+I.clearIcon)&&(this.filterInput.parentElement.querySelector("."+I.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering())if(this.isServerBlazor)this.beforePopupOpen="combobox"===this.getModuleName()&&this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,""===this.filterInput.value&&"dropdownlist"!==this.getModuleName()?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value);else{var i={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)})}},s.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},s.prototype.filteringAction=function(e,i,s){t.isNullOrUndefined(this.filterInput)||(this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value),""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,i=""===this.filterInput.value.trim()?null:i,this.resetList(e,s,i)):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list),this.isTyped=!0,t.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.renderReactTemplates())},s.prototype.setSearchBox=function(e){if(this.isFiltering()){var i=e.querySelector("."+I.filterParent)?e.querySelector("."+I.filterParent):this.createElement("span",{className:I.filterParent});this.isServerBlazor&&(i.innerHTML=""),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:I.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var s=!1;return t.Browser.isDevice&&(s=!0),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:s?[I.backIcon,I.filterBarClearIcon]:[I.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],i),t.prepend([i],e),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":this.selectedLI?this.selectedLI.id:null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+I.clearIcon),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.Browser.isDevice?this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return L},s.prototype.onInput=function(e){this.isValidKey=!0,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.typedString=t.filterInput.value,t.searchLists(e)})},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},s.prototype.onActionComplete=function(s,l,o,r){var n=this;if(this.isNotSearchList)return void(this.isNotSearchList=!1);if(this.isActive){var a=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.list.scrollTop=0,t.isNullOrUndefined(s)||t.attributes(s,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"}),this.initRemoteRender&&(this.initial=!0,this.activeIndex=this.index,this.updateValues(),this.initRemoteRender=!1,this.initial=!1,this.value&&this.dataSource instanceof i.DataManager)){var h=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value;l.some(function(e){return e[h]===n.value})||this.dataSource.executeQuery(this.getQuery(this.query).where(new i.Predicate(h,"equal",this.value))).then(function(e){e.result.length>0&&(n.addItem(e.result,l.length),n.updateValues())})}"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped&&((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||t.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof i.DataManager||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){n.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l)),this.addNewItem(l,a),t.isNullOrUndefined(this.itemData)||this.focusIndexItem()),this.beforePopupOpen&&this.renderPopup()}},s.prototype.updateActionCompleteDataValues=function(e,i){this.actionCompleteData={ulElement:e.cloneNode(!0),list:i,isUpdated:!0},t.isNullOrUndefined(this.actionData.ulElement)&&t.isNullOrUndefined(this.actionData.list)&&(this.actionData=this.actionCompleteData)},s.prototype.addNewItem=function(e,i){var s=this;if(!t.isNullOrUndefined(this.itemData)&&!t.isNullOrUndefined(i)){var l=this.getItemData().value;e.some(function(e){return("string"==typeof e||"number"==typeof e)&&e===l||t.getValue(s.fields.value,e)===l})||this.addItem(this.itemData)}},s.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},s.prototype.actionCompleteDataUpdate=function(e,t,i){null!=i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},s.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.getIndexByValue(e);var t=this.findListElement(this.list,"li","data-value",e);this.selectedLI=t,this.activeItem(t),this.removeFocus()},s.prototype.updateSelection=function(){var e=this.list.querySelector("."+k.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+k.li).classList.add(I.focus))},s.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+I.focus);e&&e.length&&t.removeClass(e,I.focus)},s.prototype.renderPopup=function(){var e=this;if(this.popupObj&&document.body.contains(this.popupObj.element))return void this.refreshPopup();var i={cancel:!1};this.trigger("beforeOpen",i,function(i){if(i.cancel)e.beforePopupOpen=!1;else{var s=e.serverPopupEle?e.serverPopupEle:e.createElement("div",{id:e.element.id+"_popup",className:"e-ddl e-popup "+(null!=e.cssClass?e.cssClass:"")}),l=e.setSearchBox(s);if(e.listHeight=t.formatUnit(e.popupHeight),e.headerTemplate&&!e.isServerBlazor&&e.setHeaderTemplate(s),t.append([e.list],s),e.footerTemplate&&!e.isServerBlazor&&e.setFooterTemplate(s),e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")&&s.appendChild(s.querySelector(".e-ddl-footer")),document.body.appendChild(s),e.updateServerPopup(s),s.style.visibility="hidden","auto"!==e.popupHeight){if(e.searchBoxHeight=0,t.isNullOrUndefined(l.container)||(e.searchBoxHeight=l.container.parentElement.getBoundingClientRect().height,e.listHeight=(parseInt(e.listHeight,10)-e.searchBoxHeight).toString()+"px"),e.headerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-header")){e.header=e.header?e.header:s.querySelector(".e-ddl-header");o=Math.round(e.header.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}if(e.footerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")){e.footer=e.footer?e.footer:s.querySelector(".e-ddl-footer");var o=Math.round(e.footer.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}e.list.style.maxHeight=(parseInt(e.listHeight,10)-2).toString()+"px",s.style.maxHeight=t.formatUnit(e.popupHeight)}else s.style.height="auto";var r=0,n=void 0;if(!t.isNullOrUndefined(e.selectedLI)&&!t.isNullOrUndefined(e.activeIndex)&&e.activeIndex>=0?e.setScrollPosition():e.list.scrollTop=0,t.Browser.isDevice&&!e.allowFiltering&&("dropdownlist"===e.getModuleName()||e.isDropDownClick&&"combobox"===e.getModuleName())){r=e.getOffsetValue(s);var a=e.isEmptyList()?e.list:e.liCollections[0];n=-(parseInt(getComputedStyle(a).textIndent,10)-parseInt(getComputedStyle(e.inputElement).paddingLeft,10)+parseInt(getComputedStyle(e.inputElement.parentElement).borderLeftWidth,10))}e.getFocusElement(),e.createPopup(s,r,n),e.checkCollision(s),t.Browser.isDevice&&(e.popupObj.element.classList.add(I.device),("dropdownlist"===e.getModuleName()||"combobox"===e.getModuleName()&&!e.allowFiltering&&e.isDropDownClick)&&(e.popupObj.collision={X:"fit",Y:"fit"}),e.isFilterLayout()&&(e.popupObj.element.classList.add(I.mobileFilter),e.popupObj.position={X:0,Y:0},e.popupObj.dataBind(),t.attributes(e.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,e.popupObj.element],I.popupFullScreen),e.setSearchBoxPosition(),e.backIconElement=l.container.querySelector(".e-back-icon"),e.clearIconElement=l.container.querySelector("."+I.clearIcon),t.EventHandler.add(e.backIconElement,"click",e.clickOnBackIcon,e),t.EventHandler.add(e.clearIconElement,"click",e.clearText,e))),s.style.visibility="visible",t.addClass([s],"e-popup-close");for(var h=0,p=e.popupObj.getScrollableParent(e.inputWrapper.container);h<p.length;h++){var u=p[h];t.EventHandler.add(u,"scroll",e.scrollHandler,e)}t.Browser.isDevice&&e.isFilterLayout()&&t.EventHandler.add(e.list,"scroll",e.listScroll,e),t.isNullOrUndefined(e.list)||(e.unWireListEvents(),e.wireListEvents()),t.attributes(e.targetElement(),{"aria-expanded":"true"});var c=e.isFiltering()?e.filterInput.parentElement:e.inputWrapper.container;t.addClass([c],[I.inputFocus]);var d={name:"FadeIn",duration:100};e.beforePopupOpen=!0;var m={popup:t.isBlazor()&&e.isServerRendered?null:e.popupObj,cancel:!1,animation:d};e.trigger("open",m,function(i){i.cancel?(e.beforePopupOpen=!1,e.destroyPopup()):(e.serverBlazorUpdateSelection(),e.bindServerScrollEvent(),t.addClass([e.inputWrapper.container],[I.iconAnimation]),e.renderReactTemplates(),e.popupObj.show(new t.Animation(i.animation),1e3===e.zIndex?e.element:null))})}})},s.prototype.checkCollision=function(e){(!t.Browser.isDevice||t.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&(l.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.serverBlazorUpdateSelection=function(){(this.isServerBlazor&&(null!==this.value||null!==this.index||null!==this.text)||"dropdownlist"!==this.getModuleName()&&!this.isTyped)&&("dropdownlist"===this.getModuleName()&&(this.removeSelection(),this.removeFocus(),this.removeHover(),this.updateValues()),"combobox"===this.getModuleName()&&this.ulElement&&this.findListElement(this.ulElement,"li","data-value",this.value)&&!this.isTyped&&this.updateValues(),this.isServerBlazor&&"dropdownlist"!==this.getModuleName()&&(""===this.text||null===this.text)&&this.ulElement&&(this.ulElement.querySelector("li").classList.contains(k.hover)||t.addClass([this.ulElement.querySelector("li")],k.hover)))},s.prototype.bindServerScrollEvent=function(){this.isServerBlazor&&this.list&&this.fields.groupBy&&!this.isGroupChecking&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this))},s.prototype.updateServerPopup=function(e){this.isServerBlazor&&(e&&e.querySelector("li")&&t.removeClass([e.querySelector(".e-content")],["e-nodata"]),this.initial=!1,e.removeAttribute("style"))},s.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},s.prototype.createPopup=function(e,i,s){var o=this;this.popupObj=new l.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){o.isDocumentClick||o.focusDropDown(),o.isReact&&o.clearTemplate(["headerTemplate","footerTemplate"]);var e="autocomplete"===o.getModuleName();o.DropDownBaseresetBlazorTemplates(e,e,!0,!0,!1,!0,!0),o.isNotSearchList=!1,o.isDocumentClick=!1,o.destroyPopup(),o.isFiltering()&&o.actionCompleteData.list&&o.actionCompleteData.list[0]&&(o.isActive=!0,o.onActionComplete(o.actionCompleteData.ulElement,o.actionCompleteData.list,null,!0))},open:function(){t.EventHandler.add(document,"mousedown",o.onDocumentClick,o),o.isPopupOpen=!0;var e=o.actionCompleteData&&o.actionCompleteData.ulElement&&o.actionCompleteData.ulElement.querySelector("li"),i=o.list.querySelector("ul li");o.isFiltering()&&o.itemTemplate&&o.element.tagName===o.getNgDirective()&&e&&i&&e.textContent!==i.textContent&&"EJS-COMBOBOX"!==o.element.tagName&&o.cloneElements(),o.isFilterLayout()&&(t.removeClass([o.inputWrapper.container],[I.inputFocus]),o.isFilterFocus=!0,o.filterInput.focus(),o.inputWrapper.clearButton&&t.addClass([o.inputWrapper.clearButton],I.clearIconHide)),o.activeStateChange()},targetExitViewport:function(){t.Browser.isDevice||o.hidePopup()}})},s.prototype.isEmptyList=function(){return!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},s.prototype.getFocusElement=function(){},s.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},s.prototype.scrollHandler=function(){t.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.hidePopup()},s.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var i=this.filterInput.parentElement.querySelector("."+I.clearIcon);t.detach(this.filterInput),i.parentElement.insertBefore(this.filterInput,i)},s.prototype.setPopupPosition=function(e){var i,s=e,l=this.list.querySelector("."+I.focus)||this.selectedLI,o=this.isEmptyList()?this.list:this.liCollections[0],r=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],n=o.getBoundingClientRect().height,a=this.list.offsetHeight/2,h=t.isNullOrUndefined(l)?o.offsetTop:l.offsetTop;if(r.offsetTop-a<h&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0&&!t.isNullOrUndefined(l)){var p=this.list.offsetHeight/n,u=parseInt(getComputedStyle(this.list).paddingBottom,10);i=(p-(this.liCollections.length-this.activeIndex))*n-s+u,this.list.scrollTop=l.offsetTop}else h>a?(i=a-n/2,this.list.scrollTop=h-a+n/2):i=h;return-(i=i+n+s-(n-this.inputWrapper.container.offsetHeight)/2)},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);if(e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),t.Browser.isDevice&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var i=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(i).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},s.prototype.scrollBottom=function(e){if(!t.isNullOrUndefined(this.selectedLI)){var i=this.list.offsetHeight,s=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,l=this.list.scrollTop+s-i;l=e?l+2*parseInt(getComputedStyle(this.list).paddingTop,10):l;var o=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;o=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?o-this.fixedHeaderElement.offsetHeight:o,0===this.activeIndex?this.list.scrollTop=0:(s>i||!(o>0&&this.list.offsetHeight>o))&&(this.list.scrollTop=l)}},s.prototype.scrollTop=function(){if(!t.isNullOrUndefined(this.selectedLI)){var e=this.selectedLI.offsetTop-this.list.scrollTop;e=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?e-this.fixedHeaderElement.offsetHeight:e;var i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:i>0&&this.list.offsetHeight>i||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))}},s.prototype.isEditTextBox=function(){return!1},s.prototype.isFiltering=function(){return this.allowFiltering},s.prototype.isPopupButton=function(){return!0},s.prototype.setScrollPosition=function(e){if(t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},s.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null)},s.prototype.listScroll=function(){this.filterInput.blur()},s.prototype.setEleWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.closePopup=function(e){var i=this;if(this.isTyped=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.filterInputObj=null,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var s=0,l=this.popupObj.getScrollableParent(this.inputWrapper.container);s<l.length;s++){var o=l[s];t.EventHandler.remove(o,"scroll",this.scrollHandler)}t.Browser.isDevice&&this.isFilterLayout()&&(t.removeClass([document.body,this.popupObj.element],I.popupFullScreen),t.EventHandler.remove(this.list,"scroll",this.listScroll)),this.isFilterLayout()&&(t.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(t.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),t.EventHandler.remove(this.filterInput,"input",this.onInput),t.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),t.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),t.EventHandler.remove(this.filterInput,"blur",this.onBlur),t.EventHandler.remove(this.filterInput,"paste",this.pasteHandler),this.filterInput=null),t.attributes(this.targetElement(),{"aria-expanded":"false","aria-activedescendant":null}),this.inputWrapper.container.classList.remove(I.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.beforePopupOpen=!1;var r={name:"FadeOut",duration:100,delay:e||0},n={popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,cancel:!1,animation:r};this.trigger("close",n,function(e){if(!t.isNullOrUndefined(i.popupObj)&&!t.isNullOrUndefined(i.popupObj.element.querySelector(".e-fixed-head"))){var s=i.popupObj.element.querySelector(".e-fixed-head");s.parentNode.removeChild(s),i.fixedHeaderElement=null}e.cancel||("autocomplete"!==i.getModuleName()||i.isServerBlazor||i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new t.Animation(e.animation)):i.destroyPopup())})}},s.prototype.destroyPopup=function(){var e=t.select("#"+this.element.id+"_popup_holder",document);this.isServerBlazor&&this.serverPopupEle&&e&&(e.appendChild(this.serverPopupEle),this.interopAdaptor.invokeMethodAsync("OnServerClosePopup")),this.isPopupOpen=!1,this.isFilterFocus=!1,this.popupObj.destroy(),t.detach(this.popupObj.element)},s.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},s.prototype.render=function(){if(this.isServerBlazor)this.inputElement=this.element,this.inputWrapper={container:this.element.parentElement},this.hiddenElement=this.inputWrapper.container.querySelector("select"),this.inputWrapper.buttons=[this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon")],this.showClearButton&&(this.inputWrapper.clearButton=this.inputWrapper.container.querySelector(".e-clear-icon"),o.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),"Auto"===this.floatLabelType&&o.Input.wireFloatingEvents(this.element),o.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties}),this.setFields(),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.enabled||(this.targetElement().tabIndex=-1),this.element.hasAttribute("autofocus")&&this.focusIn(),this.initial=!1;else{"INPUT"===this.element.tagName?(this.inputElement=this.element,t.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text")):(this.inputElement=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=o.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[I.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:I.hiddenElement}}),t.prepend([this.hiddenElement],this.inputWrapper.container),this.validationAttribute(this.element,this.hiddenElement),this.setFields(),this.inputWrapper.container.style.width=t.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var i=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");if(this.element.id=i,this.hiddenElement.id=i+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),t.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),null!==this.value||null!==this.activeIndex||null!==this.text)this.initValue();else if("SELECT"===this.element.tagName&&this.element.options[0]){var s=this.element;this.value=s.options[s.selectedIndex].value,this.text=t.isNullOrUndefined(this.value)?null:s.options[s.selectedIndex].textContent,this.initValue()}this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),t.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text)}this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.setFooterTemplate=function(e){var i;this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],I.footer));var s=(i=this.dropdownCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.footer.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],e)},s.prototype.setHeaderTemplate=function(e){var i;this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],I.header));var s=(i=this.dropdownCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(s&&s.length)for(var l=0;l<s.length;l++)this.header.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1);var o=e.querySelector("div.e-content");e.insertBefore(this.header,o)},s.prototype.setOldText=function(e){this.text=e},s.prototype.setOldValue=function(e){this.value=e},s.prototype.refreshPopup=function(){t.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||t.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(t.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},s.prototype.checkData=function(e){!e.dataSource||t.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof i.DataManager||(this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var s=-1!==Object.keys(e).indexOf("value")&&t.isNullOrUndefined(e.value),l=-1!==Object.keys(e).indexOf("text")&&t.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(s||l)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!t.isNullOrUndefined(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!t.isNullOrUndefined(Object.keys(e.query))&&(this.actionData=this.actionCompleteData)},s.prototype.updateDataSource=function(e){""===this.inputElement.value&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)||e.dataSource!==[])&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},s.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.setProperties({value:e.value,text:e.text})},s.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onPropertyChanged=function(s,l){"dropdownlist"===this.getModuleName()&&(this.isServerBlazor||(this.checkData(s),this.setUpdateInitial(["fields","query","dataSource"],s)));for(var r=0,n=Object.keys(s);r<n.length;r++){var a=n[r];switch(a){case"query":case"dataSource":break;case"htmlAttributes":this.setHTMLAttributes();break;case"width":this.setEleWidth(s.width);break;case"placeholder":o.Input.setPlaceholder(s.placeholder,this.inputElement);break;case"filterBarPlaceholder":this.filterInput&&o.Input.setPlaceholder(s.filterBarPlaceholder,this.filterInput);break;case"readonly":"dropdownlist"!==this.getModuleName()&&o.Input.setReadonly(s.readonly,this.inputElement);break;case"cssClass":this.setCssClass(s.cssClass,l.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnable();break;case"text":if(null===s.text){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var h=this.getElementByText(s.text);this.checkValidLi(h)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.text,l.text,"text"):this.isServerBlazor||this.setOldText(l.text)),this.updateInputFields()}break;case"value":if(null===s.value){this.clearAll();break}if(this.notify("beforeValueChange",{newProp:s}),this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var p=this.getElementByValue(s.value);this.checkValidLi(p)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.value,l.value,"value"):this.isServerBlazor||this.setOldValue(l.value)),this.updateInputFields(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange}break;case"index":if(null===s.index){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender&&this.liCollections){var u=this.liCollections[s.index];this.checkValidLi(u)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.index,l.index,"index"):this.isServerBlazor||(this.index=l.index)),this.updateInputFields()}break;case"footerTemplate":this.popupObj&&this.setFooterTemplate(this.popupObj.element);break;case"headerTemplate":this.popupObj&&this.setHeaderTemplate(this.popupObj.element);break;case"valueTemplate":t.isNullOrUndefined(this.itemData)||null==this.valueTemplate||this.setValueTemplate();break;case"allowFiltering":this.allowFiltering&&(this.actionCompleteData={ulElement:this.ulElement,list:this.listData,isUpdated:!0},this.actionData=this.actionCompleteData,this.updateSelectElementData(this.allowFiltering));break;case"floatLabelType":o.Input.removeFloating(this.inputWrapper),o.Input.addFloating(this.inputElement,s.floatLabelType,this.placeholder,this.createElement);break;case"showClearButton":o.Input.setClearButton(s.showClearButton,this.inputElement,this.inputWrapper,null,this.createElement),this.bindClearEvent();break;default:var c=this.getPropObject(a,s,l);e.prototype.onPropertyChanged.call(this,c.newProperty,c.oldProperty)}}},s.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},s.prototype.setSelectionData=function(e,t,i){var s,l=this;this.updateListValues=function(){"text"===i?(s=l.getElementByText(e),l.checkValidLi(s)||l.setOldText(t)):"value"===i?(s=l.getElementByValue(e),l.checkValidLi(s)||l.setOldValue(t)):"index"===i&&(s=l.liCollections[e],l.checkValidLi(s)||(l.index=t))}},s.prototype.setCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),o.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupObj&&o.Input.setCssClass(e,[this.popupObj.element],i)},s.prototype.getModuleName=function(){return"dropdownlist"},s.prototype.showPopup=function(){if(this.enabled){if(t.isBlazor()&&this.itemTemplate&&this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),this.isFiltering()&&this.dataSource instanceof i.DataManager&&this.actionData.list!=this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):t.isNullOrUndefined(this.list)||!t.isUndefined(this.list)&&(this.list.classList.contains(k.noData)||this.list.querySelectorAll("."+k.li).length<=0)?this.renderList():this.isFiltering()&&this.isServerBlazor&&this.renderList(),this.isServerBlazor||this.invokeRenderPopup();var e=!this.isFiltering()||t.select("#"+this.element.id+"_popup_holder",document),s="dropdownlist"===this.getModuleName()||!this.isFiltering();this.isServerBlazor&&e&&!t.isNullOrUndefined(this.list)&&s&&this.invokeRenderPopup()}},s.prototype.invokeRenderPopup=function(){if(t.Browser.isDevice&&this.isFilterLayout()){var e=this;window.onpopstate=function(){e.hidePopup()},history.pushState({},"")}t.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(k.noData)||this.renderPopup(),t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})},s.prototype.clientRenderPopup=function(e,i){i?(this.serverPopupEle=i,this.list=i.querySelector(".e-dropdownbase.e-content")?i.querySelector(".e-dropdownbase.e-content"):this.list,this.ulElement=this.list.querySelector("ul"),t.isNullOrUndefined(this.ulElement)&&!this.list.classList.contains(k.noData)&&t.addClass([this.list],[k.noData]),this.liCollections=this.ulElement?this.ulElement.querySelectorAll("."+k.li):[],this.listData=e,"autocomplete"===this.getModuleName()&&this.liCollections.length>0&&this.renderHightSearch(),this.initRemoteRender=!1,this.isPopupOpen||this.serverBlazorUpdateSelection(),this.unWireListEvents(),this.wireListEvents(),this.isServerIncrementalSearch&&this.searchKeyEvent&&(this.isServerIncrementalSearch=!1,this.initial=!1,this.onServerIncrementalSearch(this.searchKeyEvent)),this.isServerNavigation&&this.searchKeyEvent&&("down"===this.searchKeyEvent.action||"up"===this.searchKeyEvent.action?(this.isServerNavigation=!1,this.updateUpDownAction(this.searchKeyEvent)):"home"!==this.searchKeyEvent.action&&"end"!==this.searchKeyEvent.action||(this.isServerNavigation=!1,this.updateHomeEndAction(this.searchKeyEvent))),this.beforePopupOpen&&this.invokeRenderPopup(),"dropdownlist"!==this.getModuleName()&&this.onActionComplete(this.ulElement,this.listData)):null!=e&&this.listData!==e&&(this.listData=e,this.initRemoteRender=!1)},s.prototype.renderHightSearch=function(){},s.prototype.updateclientItemData=function(e){this.listData=e},s.prototype.initValueItemData=function(e){this.itemData=e,this.previousValue=this.value,this.initial=!1},s.prototype.serverUpdateListElement=function(e,t){this.listData=e,this.ulElement&&(this.liCollections=this.ulElement.querySelectorAll("."+k.li))},s.prototype.hidePopup=function(e){var i=!!this.headerTemplate,s=!!this.headerTemplate;if(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!1,i,s),this.isEscapeKey&&"dropdownlist"===this.getModuleName())if(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,t.isNullOrUndefined(this.index))this.resetSelection();else{var l=this.findListElement(this.ulElement,"li","data-value",this.value);this.selectedLI=this.liCollections[this.index]||l,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.closePopup();var r=this.getItemData(),n=this.isServerBlazor?!t.isNullOrUndefined(this.value):!t.isNullOrUndefined(this.selectedLI);this.inputElement&&""===this.inputElement.value.trim()&&!this.isInteracted&&(this.isSelectCustom||n&&this.inputElement.value!==r.text)&&(this.isSelectCustom=!1,this.clearAll(e))},s.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(I.disable)){var i=!1;this.preventFocus&&t.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,i=!0),i||this.targetElement().focus(),t.addClass([this.inputWrapper.container],[I.inputFocus]),this.onFocus(e)}},s.prototype.focusOut=function(e){this.enabled&&(this.isTyped=!0,this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),t.removeClass([this.inputWrapper.container],[I.inputFocus]))},s.prototype.destroy=function(){if(this.isActive=!1,this.isReact&&this.clearTemplate(),(!this.isServerBlazor||this.popupObj&&document.body.contains(this.popupObj.element))&&this.hidePopup(),this.unWireEvent(),this.list&&(this.unWireListEvents(),this.isServerBlazor&&this.fields.groupBy&&!this.isGroupChecking&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)),!this.isServerBlazor){if(this.element&&!this.element.classList.contains("e-"+this.getModuleName()))return;if(this.inputElement){for(var i=["readonly","aria-disabled","aria-placeholder","placeholder","aria-owns","aria-labelledby","aria-haspopup","aria-expanded","aria-activedescendant","autocomplete","aria-readonly","autocorrect","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],s=0;s<i.length;s++)this.inputElement.removeAttribute(i[s]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container.parentElement.tagName===this.getNgDirective()?t.detach(this.inputWrapper.container):(this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),t.detach(this.inputWrapper.container)),e.prototype.destroy.call(this)}},s.prototype.getItems=function(){return this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.clear=function(){this.value=null},T([t.Property(null)],s.prototype,"cssClass",void 0),T([t.Property("100%")],s.prototype,"width",void 0),T([t.Property("300px")],s.prototype,"popupHeight",void 0),T([t.Property("100%")],s.prototype,"popupWidth",void 0),T([t.Property(null)],s.prototype,"placeholder",void 0),T([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),T([t.Property({})],s.prototype,"htmlAttributes",void 0),T([t.Property(null)],s.prototype,"query",void 0),T([t.Property(null)],s.prototype,"valueTemplate",void 0),T([t.Property(null)],s.prototype,"headerTemplate",void 0),T([t.Property(null)],s.prototype,"footerTemplate",void 0),T([t.Property(!1)],s.prototype,"allowFiltering",void 0),T([t.Property(!1)],s.prototype,"readonly",void 0),T([t.Property(null)],s.prototype,"text",void 0),T([t.Property(null)],s.prototype,"value",void 0),T([t.Property(null)],s.prototype,"index",void 0),T([t.Property("Never")],s.prototype,"floatLabelType",void 0),T([t.Property(!1)],s.prototype,"showClearButton",void 0),T([t.Event()],s.prototype,"filtering",void 0),T([t.Event()],s.prototype,"change",void 0),T([t.Event()],s.prototype,"beforeOpen",void 0),T([t.Event()],s.prototype,"open",void 0),T([t.Event()],s.prototype,"close",void 0),T([t.Event()],s.prototype,"blur",void 0),T([t.Event()],s.prototype,"focus",void 0),s=T([t.NotifyPropertyChanges],s)}(B),P=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),F=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},W="e-input-group-icon e-ddt-icon e-icons",H="e-show-chip",V="e-show-clear",U="e-chip-input",M="e-input-focus",j="e-icon-hide",R="e-check",q="e-no-data",z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property("child")],i.prototype,"child",void 0),F([t.Property([])],i.prototype,"dataSource",void 0),F([t.Property("expanded")],i.prototype,"expanded",void 0),F([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),F([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),F([t.Property("iconCss")],i.prototype,"iconCss",void 0),F([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),F([t.Property("parentValue")],i.prototype,"parentValue",void 0),F([t.Property(null)],i.prototype,"query",void 0),F([t.Property("selected")],i.prototype,"selected",void 0),F([t.Property(null)],i.prototype,"tableName",void 0),F([t.Property("text")],i.prototype,"text",void 0),F([t.Property("tooltip")],i.prototype,"tooltip",void 0),F([t.Property("value")],i.prototype,"value",void 0),i}(t.ChildProperty),K=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property(!1)],i.prototype,"autoCheck",void 0),F([t.Property("Auto")],i.prototype,"expandOn",void 0),F([t.Property(!1)],i.prototype,"loadOnDemand",void 0),i}(t.ChildProperty),_=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s}return P(s,e),s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.getLocaleName=function(){return"drop-down-tree"},s.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.isBlazorPlatForm=t.isBlazor(),this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},s.prototype.render=function(){this.ensureAutoCheck(),"INPUT"===this.element.tagName?(this.inputEle=this.element,t.isNullOrUndefined(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=o.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[W]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains("e-input-group")||this.inputWrapper.classList.add("e-input-group"),this.showDropDownIcon&&this.inputWrapper.classList.add("e-show-dd-icon"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.setAttributes(),this.updateDataAttribute(),this.setHTMLAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content",attrs:{tabindex:"0"}}),this.popupDiv.classList.add("e-dropdown"),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),document.body.appendChild(this.popupDiv),this.wireTreeEvents(),this.popupDiv.style.display="none",this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof i.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&t.addClass([this.overFlowWrapper],"e-show-text"))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var e=t.select(".e-list-parent",this.treeObj.element);e&&e.getAttribute("aria-multiselectable")&&e.removeAttribute("aria-multiselectable"),this.oldValue=this.value,this.isInitialized=!0,this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate,this.renderComplete()},s.prototype.ensureAutoCheck=function(){this.allowFiltering&&this.treeSettings.autoCheck&&this.setProperties({treeSettings:{autoCheck:!1}},!0)},s.prototype.hideCheckAll=function(e){var i=t.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector(".e-selectall-parent");t.isNullOrUndefined(i)||(e&&!i.classList.contains("e-hide-selectall")?t.addClass([i],"e-hide-selectall"):!e&&i.classList.contains("e-hide-selectall")&&t.removeClass([i],"e-hide-selectall"))},s.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:"e-filter-wrap"});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),t.prepend([this.filterContainer],this.popupEle),this.filterObj=new o.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter")},s.prototype.filterChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){i.filterHandler(e.value,e.event)},this.filterDelayTime))},s.prototype.filterHandler=function(e,t){var s=this;this.isFilteredData||(this.treeData=this.treeObj.getTreeData());var l=this.cloneFields(this.fields),o={cancel:!1,preventDefaultAction:!1,event:t,text:e,fields:l};this.trigger("filtering",o,function(t){if(!t.cancel){var l=!1,o=void 0;if(s.isFilteredData=!0,""===e?(s.isFilteredData=!1,s.isFilterRestore=!0,o=s.cloneFields(s.fields)):t.preventDefaultAction?o=t.fields:1===s.treeDataType?o=s.selfReferencefilter(e,t.fields):s.fields.dataSource instanceof i.DataManager?l=!0:o=s.nestedFilter(e,t.fields),s.hideCheckAll(s.isFilteredData),l)return;s.treeObj.fields=s.getTreeFields(o),s.treeObj.dataBind()}})},s.prototype.nestedFilter=function(e,i){for(var s=[],l=0;l<this.treeData.length;l++){var o=this.nestedChildFilter(e,this.treeData[l]);t.isNullOrUndefined(o)||s.push(o)}return i.dataSource=s,i},s.prototype.nestedChildFilter=function(e,i){var s=i[this.fields.child];if(t.isNullOrUndefined(s))return this.isMatchedNode(e,i)?i:null;for(var l=[],o=0;o<s.length;o++){var r=this.nestedChildFilter(e,s[o]);t.isNullOrUndefined(r)||l.push(r)}return 0!==l.length?(i[this.fields.child]=l,i):(i[this.fields.child]=null,this.isMatchedNode(e,i)?i:null)},s.prototype.selfReferencefilter=function(e,i){for(var s=[],l=[],o=0;o<this.treeData.length;o++)this.isMatchedNode(e,this.treeData[o])&&s.push(this.treeData[o]);for(o=0;o<s.length;o++)if(-1===l.indexOf(s[o])){l.push(s[o]);for(var r=s[o][this.fields.parentValue];!t.isNullOrUndefined(r);){for(var n=null,a=0;a<this.treeData.length;a++){var h=this.treeData[a][this.fields.value];if(!t.isNullOrUndefined(h)&&h===r){n=this.treeData[a];break}}if(t.isNullOrUndefined(n)||-1!==l.indexOf(n))break;l.push(n),r=n[this.fields.parentValue]}}return i.dataSource=l,i},s.prototype.isMatchedNode=function(e,t){var s=t[this.fields.text];return this.ignoreCase&&(s=s.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(s=i.DataUtil.ignoreDiacritics(s),e=i.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?s.slice(0,e.length)===e:"EndsWith"===this.filterType?s.slice(-e.length)===e:-1!==s.indexOf(e)},s.prototype.wireEvents=function(){t.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),t.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),t.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(window,"resize",this.windowResize,this);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new t.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireTreeEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),t.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),t.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),t.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(window,"resize",this.windowResize);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler)},s.prototype.dropDownClick=function(e){if(this.enabled&&!this.readonly){if(this.isClearButtonClick)return void(this.isClearButtonClick=!1);!this.wrapText&&e.target.classList.contains("e-chips-close")&&this.removeChip(e),this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()}},s.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},s.prototype.onMouseLeave=function(){this.inputFocus||(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V))},s.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},s.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!t.Browser.isIE&&"edge"!==t.Browser.info.name||e.target!==this.inputWrapper)){var i=e.relatedTarget;i===this.inputEle||!t.isNullOrUndefined(i)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},s.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=t.select(".e-clear-icon",this.inputWrapper).offsetWidth,t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),t.removeClass([this.inputWrapper],[M]),this.allowMultiSelection||this.showCheckBox){var i=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),!this.wrapText&&i&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.oldValue=this.value,this.trigger("blur")},s.prototype.updateView=function(){(this.showCheckBox||this.allowMultiSelection)&&("Box"!==this.mode?t.addClass([this.inputWrapper,this.overFlowWrapper],"e-show-text"):t.addClass([this.inputWrapper],H),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],j),t.addClass([this.inputEle],U),this.updateOverFlowView(),this.ensurePlaceHolder()))},s.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.oldValue=this.value}},s.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return null===e?t===e:0===e.length&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},s.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,t.addClass([this.inputWrapper],[M]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(t.removeClass([this.chipWrapper],j),t.addClass([this.inputEle],U)),t.addClass([this.inputWrapper],H),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||(this.inputWrapper.contains(this.overFlowWrapper)&&t.addClass([this.overFlowWrapper],j),"Delimiter"===this.mode?(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)):t.addClass([this.inputWrapper],H),t.removeClass([this.inputWrapper],"e-show-text"),this.ensurePlaceHolder()));var i={isInteracted:!!e,event:e};this.trigger("focus",i)}},s.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":case"shiftTab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}})},s.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":case"shiftTab":case"tab":t.isPopupOpen&&t.hidePopup();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus()}})},s.prototype.checkAllAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"space":t.clickHandler(e);break;case"moveDown":t.treeObj.element.focus()}})},s.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputWrapper,"form");i&&e.target===i&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},s.prototype.getAriaAttributes=function(){return{"aria-disabled":this.enabled?"false":"true","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-labelledby":this.hiddenElement.id}},s.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove("e-total-count"),t.removeClass([this.overFlowWrapper],j),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=void 0,o=1,r=void 0,n=void 0,a=0;this.overFlowWrapper.innerHTML="";var h={overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"};this.l10n=new t.L10n(this.getLocaleName(),h,this.locale);var p=this.l10n.getConstant("overflowCountTemplate"),u=this.createElement("span",{className:"e-remain"}),c=t.compile(p),d=t.compile(this.l10n.getConstant("totalCountTemplate"));u.appendChild(c({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),this.overFlowWrapper.appendChild(u);var m=u.offsetWidth;if(t.remove(u),this.showDropDownIcon&&(a=t.select(".e-ddt-icon",this.inputWrapper).offsetWidth),!t.isNullOrUndefined(this.value))if("Box"!==this.mode)for(var f=0;!t.isNullOrUndefined(this.value[f]);f++){if(e+=0===f?"":this.delimiterChar+" ",s=this.getOverflowVal(f),e+=s,s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.innerHTML=e,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,f=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-f,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;){var v=this.overFlowWrapper.innerHTML.split(this.delimiterChar);v.pop(),this.overFlowWrapper.innerHTML=v.join(this.delimiterChar),n++,r=this.overFlowWrapper.offsetWidth}break}r+m+a+this.clearIconWidth<=i?(l=e,o=f):0===f&&(l="",o=-1)}else{t.addClass([this.chipWrapper],j);for(var y=this.chipWrapper.cloneNode(!0),g=t.selectAll(".e-chips",y),C=0;C<g.length;C++){if(s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(g[C]),e=this.overFlowWrapper.innerHTML,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,C=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-C,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),n++,r=this.overFlowWrapper.offsetWidth;break}r+m+a+this.clearIconWidth<=i?(l=e,o=C):0===C&&(l="",o=-1)}}n>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(u,n,c,d)),"Box"!==this.mode||this.overFlowWrapper.classList.contains("e-total-count")||t.addClass([u],"e-wrap-count")}else this.overFlowWrapper.innerHTML="",t.addClass([this.overFlowWrapper],j);this.updateDelimMode()},s.prototype.updateRemainTemplate=function(e,i,s,l){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.appendChild(!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate)[0]:s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(t.addClass([this.overFlowWrapper],"e-total-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.removeClass([this.overFlowWrapper],"e-total-count"),e},s.prototype.getOverflowVal=function(e){var i=this.getSelectedData(this.value[e]);return t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",i)},s.prototype.updateDelimMode=function(){"Box"!==this.mode?t.select(".e-remain",this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains("e-total-count")?(t.addClass([this.overFlowWrapper],"e-wrap-count"),t.addClass([this.overFlowWrapper],"e-show-text")):(this.overFlowWrapper.classList.remove("e-wrap-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.select(".e-remain",this.overFlowWrapper)&&this.overFlowWrapper.classList.remove("e-wrap-count")},s.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-ddt-hidden",tabindex:"-1",multiple:""}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-ddt-hidden"}}),t.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},s.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},s.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),t.addClass([this.inputWrapper],H),this.getValidMode()&&null!==this.value?t.addClass([this.inputEle],U):null===this.value&&t.addClass([this.chipWrapper],j))},s.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},s.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:"e-selectall-parent",attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="";var e=t.closest(this.element,".e-bigger"),i=t.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=r.createCheckBox(this.createElement,!0,{cssClass:i}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),t.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},s.prototype.clickHandler=function(e){var i;if(i=e.currentTarget&&e.currentTarget.classList.contains("e-selectall-parent")?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=t.closest(i,".e-checkbox-wrapper"),!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.changeState(this.checkWrapper,s.classList.contains(R)?"uncheck":"check",e)}e.preventDefault()},s.prototype.changeState=function(e,i,s){var l,o=e.getElementsByClassName("e-frame")[0];"check"!==i||o.classList.contains(R)?"uncheck"===i&&o.classList.contains(R)&&(o.classList.remove(R),l="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!1)):(o.classList.add(R),l="true",this.isReverseUpdate||(this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),l="check"===i?"true":"false",t.isNullOrUndefined(l)||e.setAttribute("aria-checked",l)},s.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var i=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var s=0,l=t.compile(i)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);s<l.length;s++){var o=l[s];this.selectAllSpan.textContent=o.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},s.prototype.setAttributes=function(){this.element.removeAttribute("tabindex");var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex","0"),t.attributes(this.inputWrapper,this.getAriaAttributes())},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s)this.inputWrapper.classList.add(this.htmlAttributes[s]);else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.setAttribute("style",this.htmlAttributes[s]);else{var l=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],r=["name","required"];0===s.indexOf("data")||r.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):l.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputEle):this.inputEle.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.setAttribute(s,this.htmlAttributes[s])}else this.setProperties({readonly:!0},!0),this.dataBind()}},s.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1===i.indexOf(this.element.attributes[l].name)&&"readonly"!==this.element.attributes[l].name&&(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},s.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)))},s.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var i=0;i<this.value.length;i++)e=this.treeObj.getTreeData(this.value[i])[0],t.isNullOrUndefined(e)&&this.value.splice(this.value.indexOf(this.value[i]),1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],t.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},s.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,i=[];if(this.showCheckBox||this.allowMultiSelection){for(var s=this.text.split(this.delimiterChar),l=0;l<s.length;l++)e=this.getItems(s[l]),t.isNullOrUndefined(e)||i.push(e[this.fields.value].toString());0!==i.length?(this.oldValue=this.value,this.setProperties({value:i},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),t.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.oldValue=this.value,this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},s.prototype.setSelectedValue=function(){null==this.value&&(this.isInitialized||(this.oldValue=this.value,this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value))},s.prototype.setValidValue=function(){if(this.showCheckBox||this.allowMultiSelection)this.showCheckBox?(this.treeObj.checkedNodes=this.value.slice(),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind();else{o.Input.setValue(this.text,this.inputEle,this.floatLabelType);var e=this.value[0].toString();this.treeObj.selectedNodes[0]!==e&&t.setValue("selectedNodes",[e],this.treeObj)}this.currentText=this.text,this.currentValue=this.value,this.isInitialized&&this.triggerChangeEvent()},s.prototype.getItems=function(e){var i;if(1===this.treeDataType)for(var s=0;s<this.treeItems.length;s++){var l=t.getValue(this.fields.text,this.treeItems[s]);if(!t.isNullOrUndefined(this.treeItems[s])&&!t.isNullOrUndefined(l)&&l===e){i=this.treeItems[s];break}}else i=this.getNestedItems(this.treeItems,this.fields,e);return i},s.prototype.getNestedItems=function(e,s,l){for(var o,r=0,n=e.length;r<n;r++){var a=t.getValue(this.fields.text,e[r]);if(e[r]&&a&&a.toString()===l)return e[r];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[r]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){if(void 0!==(o=this.getNestedItems(t.getValue("child",e[r]),this.getChildType(s),l)))break}}else{var h=t.getValue(s.child,e[r]);if(void 0!==(o=this.getNestedItems(h,this.getChildType(s),l)))break}}return o},s.prototype.getChildType=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.renderTree=function(){this.treeObj=new n.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate}),this.treeObj.appendTo("#"+this.tree.id)},s.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var i=!1,s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(s.cancel?i=!0:(t.addClass([e.inputWrapper],["e-icon-anim"]),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_popup",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):e.popupEle=e.popupObj.element),e.isFirstRender&&!i&&(t.prepend([e.popupDiv],e.popupEle),e.popupDiv.style.display="block",e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains(q)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.portals=e.portals.concat(e.treeObj.portals),e.renderReactTemplates())),!i){if(t.attributes(e.inputWrapper,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),e.popupEle.style.display="block",e.updatePopupHeight(),e.popupObj.refreshPosition(),e.showCheckBox&&e.showSelectAll||e.popupDiv.classList.contains(q)||!(e.treeItems.length>0)||e.treeObj.element.focus(),e.checkSelectAll&&e.checkBoxElement){var l=t.closest(e.checkBoxElement,".e-checkbox-wrapper");e.changeState(l,"check"),e.checkSelectAll=!1}e.allowFiltering&&(t.removeClass([e.inputWrapper],[M]),e.filterObj.element.focus());var o={popup:e.popupObj};e.trigger("open",o)}})},s.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){i=Math.round(this.filterContainer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.headerTemplate){i=Math.round(this.header.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.showCheckBox&&this.showSelectAll){i=Math.round(this.checkAllParent.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.footerTemplate){var i=Math.round(this.footer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}var s=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);s+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=t.formatUnit(parseInt(e,10)-s+"px"),this.popupDiv.style.maxHeight=e}},s.prototype.createPopup=function(e){var i=this;this.isFirstRender&&(this.popupObj=new l.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){i.isPopupOpen=!1},open:function(){t.EventHandler.add(document,"mousedown",i.onDocumentClick,i),i.isPopupOpen=!0},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}))},s.prototype.setElementWidth=function(e){var i=this.inputWrapper;t.isNullOrUndefined(e)||("number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},s.prototype.getHeight=function(){var e=t.formatUnit(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},s.prototype.onDocumentClick=function(e){var i=e.target,s=t.closest(i,".e-list-parent"),l=t.closest(i,".e-filter-wrap"),o=!!i.classList.contains("e-dropdown")||(t.matches(i,".e-ddt .e-popup")||t.matches(i,".e-ddt .e-treeview"));this.isPopupOpen&&(this.inputWrapper.contains(i)||s||l||o)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&i.classList.contains("e-chips-close")||this.isPopupOpen&&(i.classList.contains("e-selectall-parent")||i.classList.contains("e-all-text")||i.classList.contains("e-frame")))?(this.isDocumentClick=!1,e.preventDefault()):!this.inputWrapper.contains(i)&&this.inputFocus&&this.focusOut(e)},s.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.popupDiv],q)},s.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),t.addClass([this.popupDiv],q),this.hideCheckAll(!0)):this.popupDiv.classList.contains(q)&&this.treeItems.length>=1&&(t.removeClass([this.popupDiv],q),this.hideCheckAll(!1)),this.treeDataType=this.getTreeDataType(this.treeItems,this.fields),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus());var i={data:e.data};this.trigger("dataBound",i),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.isFilterRestore=!1)},s.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value?this.value:[]:this.treeObj.selectedNodes=this.value?this.value:[]},s.prototype.setCssClass=function(e,i){var s=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];t.isNullOrUndefined(i)||""===i||t.removeClass(s,i.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(s,e.split(" "))},s.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add("e-rtl"):this.inputWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(t.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),t.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains(M)&&t.removeClass([this.inputWrapper],[M]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},s.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!t.isNullOrUndefined(e)){var i=e=this.getActualProperties(e);return e.value&&(i.id=e.value),e.parentValue&&(i.parentID=e.parentValue),e.child&&(i.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(i.isChecked=e.selected),i}return null},s.prototype.getTreeDataType=function(e,s){if(this.fields.dataSource instanceof i.DataManager){for(l=0;l<e.length;l++)if("string"==typeof s.child&&t.isNullOrUndefined(t.getValue(s.child,e[l])))return 1;return 2}for(var l=0,o=e.length;l<o;l++){if("string"==typeof s.child&&!t.isNullOrUndefined(t.getValue(s.child,e[l])))return 2;if(!t.isNullOrUndefined(t.getValue(s.parentValue,e[l]))||!t.isNullOrUndefined(t.getValue(s.hasChildren,e[l])))return 1}return 1},s.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.treeObj.dataBind()},s.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},s.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value,null===this.value&&this.setProperties({value:[]},!0))},s.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},s.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var i;if(e.isInteracted){var s=t.getValue("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[s]},!0),i=this.itemTemplate?t.getValue("text",this.treeObj.getNode(s)):t.getValue("text",e.nodeData).toString(),o.Input.setValue(i,this.inputEle,this.floatLabelType),this.setProperties({text:i},!0),this.currentText=this.text,this.currentValue=this.value,t.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),t.attributes(this.inputWrapper,{"aria-activedescendant":s.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}var l=this.getEventArgs(e);this.trigger("select",l),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},s.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&("true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},s.prototype.onNodeChecked=function(e){var i=this.getEventArgs(e);if(this.trigger("select",i),this.isFilteredData&&"uncheck"===e.action){var s=t.getValue("id",e.data[0]).toString();this.removeSelectedData(s,!0)}if(!this.isChipDelete&&e.isInteracted&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var l=this.treeObj.element.querySelectorAll("li"),o=this.treeObj.element.querySelectorAll("li .e-checkbox-wrapper[aria-checked=true]"),r=t.closest(this.checkBoxElement,".e-checkbox-wrapper");r&&"uncheck"===e.action?(this.isReverseUpdate=!0,this.changeState(r,"uncheck"),this.isReverseUpdate=!1):r&&"check"===e.action&&o.length===l.length&&(this.isReverseUpdate=!0,this.changeState(r,"check"),this.isReverseUpdate=!1)}},s.prototype.beforeCheck=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value)},s.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var i=t.selectAll(".e-chips-close",this.chipWrapper),s=0;s<i.length;s++)e?t.removeClass([i[s]],j):t.addClass([i[s]],j)},s.prototype.updateDropDownIconState=function(e){var i=t.select(".e-ddt-icon",this.inputWrapper);e?(i?t.removeClass([i],j):o.Input.appendSpan(W,this.inputWrapper,this.createElement),t.addClass([this.inputWrapper],"e-show-dd-icon")):(t.addClass([i],j),t.removeClass([this.inputWrapper],"e-show-dd-icon"))},s.prototype.updateMode=function(){if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(j)&&e?(t.removeClass([this.chipWrapper],j),t.addClass([this.inputWrapper],H)):e||(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H));var i=null!==this.value&&0!==this.value.length;e&&i?t.addClass([this.inputEle],U):t.removeClass([this.inputEle],U)}else this.inputEle.classList.contains(U)&&(t.removeClass([this.inputEle],U),this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)))},s.prototype.ensurePlaceHolder=function(){this.value&&0===this.value.length&&(t.removeClass([this.inputEle],U),this.chipWrapper&&t.addClass([this.chipWrapper],j))},s.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.setMultiSelectValue=function(e){if(this.isFilteredData){for(var i=t.isNullOrUndefined(this.value)?[]:this.value,s=0;s<e.length;s++)(t.isNullOrUndefined(this.value)||-1===this.value.indexOf(e[s]))&&i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:e},!0),e&&0!==e.length&&!this.showCheckBox&&(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},s.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var i=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!i&&(t.removeClass([this.inputEle],U),t.detach(this.chipWrapper)),this.getValidMode()&&null!==this.value&&(t.addClass([this.inputEle],U),this.chipWrapper&&t.removeClass([this.chipWrapper],j));var s=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!s&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputEle],U)),this.updateSelectedValues()},s.prototype.getSelectedData=function(e){var i=null;if(this.isFilteredData)for(var s=0;s<this.selectedData.length;s++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){i=this.selectedData[s];break}return t.isNullOrUndefined(i)&&(i=this.treeSettings.loadOnDemand?this.treeObj.getTreeData(e)[0]:this.treeObj.getNode(e),t.isNullOrUndefined(i)||this.selectedData.push(i)),i},s.prototype.removeSelectedData=function(e,i){var s=t.isNullOrUndefined(this.value)?[]:this.value.slice();s.splice(s.indexOf(e),1),this.setProperties({value:s},i);for(var l=0;l<this.selectedData.length;l++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[l]).toString()===e){this.selectedData.splice(l,1);break}},s.prototype.updateSelectedValues=function(){this.dataValue="";var e,i,s,l="";if(this.hiddenElement.innerHTML="",this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!t.isNullOrUndefined(this.value))for(var r=0,n=this.value.length;r<n;r++)s=this.getSelectedData(this.value[r]),i=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",s),this.selectedText.push(i),e=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+e,l+=","+e,this.setProperties({text:l},!0)):(this.dataValue+=e,l+=e),"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[r]),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[r]+'">'+this.selectedText[this.selectedText.length-1]+"</option>";var a=this.getValidMode();"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||a||this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)),o.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===l?this.setProperties({text:null},!0):this.setProperties({text:l},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value},s.prototype.setChipValues=function(e,i){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var s=this.createElement("span",{className:"e-chips",attrs:{"data-value":i}}),l=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:"e-chips-close e-icons"});l.innerHTML=e,s.appendChild(l),this.chipCollection.appendChild(s),this.showClearButton&&(s.appendChild(o),t.EventHandler.add(o,"mousedown",this.removeChip,this))},s.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(t.detach(this.checkAllParent),this.checkAllParent=null))},s.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],"e-ddt-header"));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),t.append(e,this.header)),this.ddtupdateBlazorTemplates(!1,!1,!0,!1),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},s.prototype.templateComplier=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}return t.compile(e)},s.prototype.setFooterTemplate=function(){this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddt-footer"));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),t.append(e,this.footer)),this.ddtupdateBlazorTemplates(!1,!1,!1,!0),t.append([this.footer],this.popupEle)},s.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},s.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){var i=e.target.parentElement,s=i.getAttribute("data-value");this.chipCollection&&i&&t.remove(i),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(s,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([s]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},s.prototype.resetValue=function(e){o.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.oldValue=this.value,this.setProperties({value:[]},!0)),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],t.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder())},s.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},s.prototype.selectAllItems=function(e){if(this.showCheckBox)e?this.treeObj.checkAll():this.treeObj.uncheckAll(),this.checkSelectAll=!0;else if(this.allowMultiSelection)if(e){for(var i=t.selectAll("li",this.treeObj.element),s=void 0,l=[],o=0;o<i.length;o++)s=i[o].getAttribute("data-uid").toString(),l.push(s);this.treeObj.selectedNodes=l}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},s.prototype.updateTreeSettings=function(e){var t=Object.keys(e.treeSettings)[0];if("autoCheck"===t)this.ensureAutoCheck(),this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===t)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else if("expandOn"===t)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},s.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},s.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},s.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":(this.noRecord=this.createElement("div"),t.addClass([this.noRecord],"e-ddt-nodata"),t.prepend([this.noRecord],this.popupDiv)),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=e?this.actionFailureTemplateId:this.noRecordsTemplateId,l=e?"actionFailureTemplate":"noRecordsTemplate",o=this.templateComplier(i)({},this,l,s,this.isStringTemplate,void 0,this.noRecord);o&&(o=Array.prototype.slice.call(o),t.append(o,this.noRecord)),this.ddtupdateBlazorTemplates(!e,e)}else{var r={noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"};this.l10n=new t.L10n(this.getLocaleName(),r,this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}},s.prototype.ddtupdateBlazorTemplates=function(e,i,s,l,o){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,o),this.actionFailureTemplate&&i&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,o),s&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),l&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},s.prototype.ddtresetBlazorTemplates=function(e,i,s,l){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&i&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),s&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),l&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},s.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},s.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},s.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},s.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter()),this.ensureAutoCheck()},s.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},s.prototype.updateValue=function(e){this.isDynamicChange=!0,t.isNullOrUndefined(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},s.prototype.updateText=function(e){t.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},s.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=t.select(".e-overflow",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),t.addClass([this.inputEle],U),"Box"===this.mode?t.removeClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"):t.addClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"))}},s.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},s.prototype.onPropertyChanged=function(e,i){for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":o.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,i.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":o.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":this.oldValue=i.value,this.updateValue(e.value);break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":this.updateModelMode();break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":this.updateTreeSettings(e);break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.updateValue(this.value),this.treeObj.dataBind();break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(t.addClass([this.overFlowWrapper],j),this.chipWrapper&&"Box"===this.mode?t.removeClass([this.chipWrapper],j):(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),this.ensurePlaceHolder()):this.updateView()}},s.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},s.prototype.destroy=function(){this.ddtresetBlazorTemplates(!0,!0,!0,!0),this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.resetValue(),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),t.detach(this.inputWrapper),t.detach(this.popupDiv),this.element.classList.remove("e-input"),e.prototype.destroy.call(this)},s.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),t.detach(this.filterObj.element),t.detach(this.filterContainer),this.filterObj=null)},s.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},s.prototype.getData=function(e){return this.treeObj.getTreeData(e)},s.prototype.hidePopup=function(){var e={popup:this.popupObj};this.inputWrapper.classList.remove("e-icon-anim"),this.popupEle&&(this.popupEle.style.display="none"),t.attributes(this.inputWrapper,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&t.addClass([this.inputWrapper],[M])),this.trigger("close",e))},s.prototype.selectAll=function(e){this.selectAllItems(e)},s.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},s.prototype.getModuleName=function(){return"dropdowntree"},F([t.Property("The Request Failed")],s.prototype,"actionFailureTemplate",void 0),F([t.Property(!1)],s.prototype,"allowFiltering",void 0),F([t.Property(!1)],s.prototype,"allowMultiSelection",void 0),F([t.Property(!0)],s.prototype,"changeOnBlur",void 0),F([t.Property("")],s.prototype,"cssClass",void 0),F([t.Property(",")],s.prototype,"delimiterChar",void 0),F([t.Property(!0)],s.prototype,"enabled",void 0),F([t.Complex({},z)],s.prototype,"fields",void 0),F([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),F([t.Property("StartsWith")],s.prototype,"filterType",void 0),F([t.Property("Never")],s.prototype,"floatLabelType",void 0),F([t.Property(null)],s.prototype,"footerTemplate",void 0),F([t.Property(!1)],s.prototype,"ignoreAccent",void 0),F([t.Property(!0)],s.prototype,"ignoreCase",void 0),F([t.Property(null)],s.prototype,"headerTemplate",void 0),F([t.Property({})],s.prototype,"htmlAttributes",void 0),F([t.Property(null)],s.prototype,"itemTemplate",void 0),F([t.Property("Default")],s.prototype,"mode",void 0),F([t.Property("No Records Found")],s.prototype,"noRecordsTemplate",void 0),F([t.Property(null)],s.prototype,"placeholder",void 0),F([t.Property("300px")],s.prototype,"popupHeight",void 0),F([t.Property("100%")],s.prototype,"popupWidth",void 0),F([t.Property(!1)],s.prototype,"readonly",void 0),F([t.Property(!1)],s.prototype,"showSelectAll",void 0),F([t.Property("Select All")],s.prototype,"selectAllText",void 0),F([t.Property(!1)],s.prototype,"showCheckBox",void 0),F([t.Property(!0)],s.prototype,"showClearButton",void 0),F([t.Property(!0)],s.prototype,"showDropDownIcon",void 0),F([t.Property("None")],s.prototype,"sortOrder",void 0),F([t.Property(null)],s.prototype,"text",void 0),F([t.Complex({},K)],s.prototype,"treeSettings",void 0),F([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),F([t.Property(null)],s.prototype,"value",void 0),F([t.Property("100%")],s.prototype,"width",void 0),F([t.Property(1e3)],s.prototype,"zIndex",void 0),F([t.Property(!1)],s.prototype,"wrapText",void 0),F([t.Event()],s.prototype,"actionFailure",void 0),F([t.Event()],s.prototype,"beforeOpen",void 0),F([t.Event()],s.prototype,"change",void 0),F([t.Event()],s.prototype,"close",void 0),F([t.Event()],s.prototype,"blur",void 0),F([t.Event()],s.prototype,"created",void 0),F([t.Event()],s.prototype,"dataBound",void 0),F([t.Event()],s.prototype,"destroyed",void 0),F([t.Event()],s.prototype,"filtering",void 0),F([t.Event()],s.prototype,"focus",void 0),F([t.Event()],s.prototype,"keyPress",void 0),F([t.Event()],s.prototype,"open",void 0),F([t.Event()],s.prototype,"select",void 0),s=F([t.NotifyPropertyChanges],s)}(t.Component),G=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Q=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-combobox";var J={container:null,buttons:[]},X=function(e){function i(t,i){return e.call(this,t,i)||this}return G(i,e),i.prototype.preRender=function(){e.prototype.preRender.call(this)},i.prototype.getLocaleName=function(){return"combo-box"},i.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),t.EventHandler.add(this.inputWrapper.container,"blur",this.onBlur,this)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)),this.bindCommonEvent()},i.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(I.input)||!t.Browser.isDevice)&&t.Browser.isDevice||e.preventDefault()},i.prototype.onBlur=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;t.isNullOrUndefined(this.listData)||t.isNullOrUndefined(s)||s===this.text||this.customValue(i),e.prototype.onBlur.call(this,i)},i.prototype.targetElement=function(){return this.inputElement},i.prototype.setOldText=function(e){o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},i.prototype.setOldValue=function(e){this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},i.prototype.valueMuteChange=function(e){var i=t.isNullOrUndefined(e)?null:e.toString();o.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:e,text:e,index:null},!0),this.activeIndex=this.index;var s=this.fields,l={};l[s.text]=t.isNullOrUndefined(e)?null:e.toString(),l[s.value]=t.isNullOrUndefined(e)?null:e.toString(),this.itemData=l,this.item=null,this.previousValue!==this.value&&this.detachChangeEvent(null)},i.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);e?this.setSelection(e,null):(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue())}else this.setSelection(this.liCollections[this.activeIndex],null);else(e=this.getElementByValue(this.value))?this.setSelection(e,null):this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},i.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?t.removeClass([this.inputWrapper.clearButton],I.clearIconHide):t.addClass([this.inputWrapper.clearButton],I.clearIconHide))},i.prototype.getAriaAttributes=function(){return{"aria-owns":this.element.id+"_options",role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-hasPopup":"true","aria-expanded":"false","aria-readonly":this.readonly.toString(),autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}},i.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+I.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+I.li)),this.incrementalSearch(t))},i.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},i.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()?this.inputWrapper:J},i.prototype.onActionComplete=function(t,i,s,l){this.isServerBlazor||e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),!this.preventAutoFill&&"combobox"===this.getModuleName()&&this.isTyped&&this.inlineSearch()},i.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),i=this.list.querySelector("."+I.selected);if(e.text===this.inputElement.value&&!t.isNullOrUndefined(i))return i;if((t.Browser.isDevice&&!this.isDropDownClick||!t.Browser.isDevice)&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0){var s=h(this.inputElement.value,this.liCollections,"StartsWith",!0).item;if(t.isNullOrUndefined(s))this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.list.scrollTop=0);else{var l=this.getIndexByValue(s.getAttribute("data-value"))-1,o=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(o)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var r=this.fields.groupBy?this.liCollections[0].offsetHeight:0;this.list.scrollTop=l*o+r,t.addClass([s],I.focus)}}return s}return null},i.prototype.setValue=function(t){return t&&"keydown"===t.type&&"enter"===t.action&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},i.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.allowCustom&&t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(e.text)||this.setProperties({value:e.value,text:e.text},!this.allowCustom)},i.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||o.Input.appendSpan("e-input-group-icon e-atc-spinner-icon",this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},i.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.classList.contains("e-atc-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},i.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(this.isSelected||this.previousValue===s?this.updateSelectedItem(e,null,!0):(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.getFormattedValue(e.getAttribute("data-value")))),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i)}},i.prototype.isAndroidAutoFill=function(e){if(t.Browser.isAndroid){var i=this.getSelectionPoints(),s=this.prevSelectPoints.end,l=i.end,o=this.prevSelectPoints.start,r=i.start;return 0!==s&&(s===e.length&&o===e.length||o>r&&s>l||s===l&&o===r)}return!1},i.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&(e.prototype.clearAll.call(this,i),this.isServerBlazor&&this.isFiltering()&&this.isPopupOpen&&i&&this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!0)),this.isFiltering()&&!t.isNullOrUndefined(i)&&i.target===this.inputWrapper.clearButton&&this.searchLists(i)},i.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},i.prototype.inlineSearch=function(e){var i=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),s=i?this.liCollections[this.activeIndex]:this.getFocusElement();if(t.isNullOrUndefined(s))if(""===this.inputElement.value){this.activeIndex=null,this.list.scrollTop=0;var l=this.list.querySelector("."+I.li);this.setHoverList(l)}else this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length<0&&this.removeFocus();else{if(!i){var o=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(o),this.activeIndex=t.isNullOrUndefined(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(s,i)}},i.prototype.incrementalSearch=function(e){this.showPopup(),t.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},i.prototype.setAutoFillSelection=function(e){var t=this.getSelectionPoints(),i=this.inputElement.value.substr(0,t.start);if(i&&i.toLowerCase()===e.substr(0,t.start).toLowerCase()){var s=i+e.substr(i.length,e.length);o.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(t.start,this.inputElement.value.length)}else o.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length)},i.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},i.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),t.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlur)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(t.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler))),this.unBindCommonEvent()},i.prototype.setSelection=function(i,s){e.prototype.setSelection.call(this,i,s),t.isNullOrUndefined(i)||this.autofill||this.isDropDownClick||this.removeFocus()},i.prototype.selectCurrentItem=function(e){var i;this.isPopupOpen&&((i=this.isSelected?this.list.querySelector("."+I.selected):this.list.querySelector("."+I.focus))&&(this.setSelection(i,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))),"enter"===e.action&&""===this.inputElement.value.trim()?this.clearAll(e):this.isTyped&&!this.isSelected&&t.isNullOrUndefined(i)&&this.customValue(e),this.hidePopup()},i.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(I.selected)&&(this.removeFocus(),e.classList.add(I.focus))},i.prototype.targetFocus=function(e){t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e)},i.prototype.dropDownClick=function(i){i.preventDefault(),t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,i)},i.prototype.customValue=function(e){var i=this,s=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value.trim()){var l=this.value;if(t.isNullOrUndefined(s)){var r=""===this.inputElement.value?null:this.inputElement.value,n={text:r,item:{}};this.initial?this.updateCustomValueCallback(r,n,l):this.trigger("customValueSpecifier",n,function(t){i.updateCustomValueCallback(r,t,l,e)})}else this.isSelectCustom=!1,this.setProperties({value:s}),l!==this.value&&this.onChangeEvent(e)}else this.allowCustom&&(this.isSelectCustom=!0);else{var a=this.previousValue,h=this.value;this.setProperties({value:s}),t.isNullOrUndefined(this.value)&&o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&a===this.value&&h!==this.value&&this.onChangeEvent(null)}},i.prototype.updateCustomValueCallback=function(e,i,s,l){var o=this.fields,r=i.item,n={};r&&t.getValue(o.text,r)&&t.getValue(o.value,r)?n=r:(t.setValue(o.text,e,n),t.setValue(o.value,e,n)),this.itemData=n;var a={text:t.getValue(o.text,this.itemData),value:t.getValue(o.value,this.itemData),index:null};this.setProperties(a,!0),this.setSelection(null,null),this.isSelectCustom=!0,s!==this.value&&this.onChangeEvent(l)},i.prototype.onPropertyChanged=function(i,s){"combobox"===this.getModuleName()&&(this.checkData(i),this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"readonly":o.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this));break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var a=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty),this.isFiltering()&&"dataSource"===n&&t.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},i.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this),this.renderComplete()},i.prototype.getModuleName=function(){return"combobox"},i.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},i.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},i.prototype.showPopup=function(){e.prototype.showPopup.call(this)},i.prototype.hidePopup=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!t.isNullOrUndefined(this.listData)){var l=this.isEscapeKey;this.isEscapeKey&&(o.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var r=this.isSelectCustom?{text:""}:this.getItemData(),n=this.list.querySelector("."+I.selected);if(this.inputElement&&r.text===this.inputElement.value&&!t.isNullOrUndefined(n))return this.isSelected&&(this.onChangeEvent(i),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,i);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var a=h(this.inputElement.value,this.liCollections,"Equal",!0);this.selectedLI=a.item,t.isNullOrUndefined(a.index)&&(a.index=h(this.inputElement.value,this.liCollections,"StartsWith",!0).index),this.activeIndex=a.index,t.isNullOrUndefined(this.selectedLI)?l&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(i)}t.isNullOrUndefined(this.listData)&&this.allowCustom&&!t.isNullOrUndefined(s)&&s!==this.value&&this.customValue(),e.prototype.hidePopup.call(this,i)},i.prototype.focusIn=function(){this.enabled&&(t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},i.prototype.clear=function(){this.value=null},i.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},i.prototype.getItems=function(){return e.prototype.getItems.call(this)},i.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},i.prototype.renderHightSearch=function(){},Q([t.Property(!1)],i.prototype,"autofill",void 0),Q([t.Property(!0)],i.prototype,"allowCustom",void 0),Q([t.Property({})],i.prototype,"htmlAttributes",void 0),Q([t.Property(!1)],i.prototype,"allowFiltering",void 0),Q([t.Property(null)],i.prototype,"query",void 0),Q([t.Property(null)],i.prototype,"index",void 0),Q([t.Property(!0)],i.prototype,"showClearButton",void 0),Q([t.Property(!1)],i.prototype,"enableRtl",void 0),Q([t.Event()],i.prototype,"customValueSpecifier",void 0),Q([t.Event()],i.prototype,"filtering",void 0),Q([t.Property(null)],i.prototype,"valueTemplate",void 0),Q([t.Property("Never")],i.prototype,"floatLabelType",void 0),Q([t.Property(null)],i.prototype,"filterBarPlaceholder",void 0),Q([t.Property(null)],i.prototype,"cssClass",void 0),Q([t.Property(null)],i.prototype,"headerTemplate",void 0),Q([t.Property(null)],i.prototype,"footerTemplate",void 0),Q([t.Property(null)],i.prototype,"placeholder",void 0),Q([t.Property("100%")],i.prototype,"width",void 0),Q([t.Property("300px")],i.prototype,"popupHeight",void 0),Q([t.Property("100%")],i.prototype,"popupWidth",void 0),Q([t.Property(!1)],i.prototype,"readonly",void 0),Q([t.Property(null)],i.prototype,"text",void 0),Q([t.Property(null)],i.prototype,"value",void 0),i=Q([t.NotifyPropertyChanges],i)}(N),$=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Y=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-autocomplete",I.icon="e-input-group-icon e-ddl-icon e-search-icon";var Z=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return $(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"auto-complete"},s.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=""!==this.queryString||t.isNullOrUndefined(this.value)?this.filterType:"equal",o=""!==this.queryString||t.isNullOrUndefined(this.value)?this.queryString:this.value;if(this.isFiltered)return s;if(null!==this.queryString&&""!==this.queryString){var r=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==r)&&"number"!==r){var n=t.isNullOrUndefined(this.fields.value)?"":this.fields.value;s.where(n,l,o,this.ignoreCase,this.ignoreAccent)}else s.where("",l,o,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)){if(20!==this.suggestionCount)for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&s.queries.splice(a,1);s.take(this.suggestionCount)}return s},s.prototype.searchLists=function(i){var s=this;if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.isServerBlazor)this.beforePopupOpen=this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,this.queryString=this.filterInput.value,""!==this.queryString&&this.queryString.length>=this.minLength?this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value):this.hidePopup();else{if(t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this,!0),this.queryString=this.filterInput.value,"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null;var l={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,t,i){l.cancel||(s.isFiltered=!0,s.filterAction(e,t,i))},cancel:!1};this.trigger("filtering",l,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.searchList=!0,s.filterAction(s.dataSource,null,s.fields))})}},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},s.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,""!==this.queryString&&this.queryString.length>=this.minLength?this.resetList(e,i,t):(this.hidePopup(),this.beforePopupOpen=!1),this.renderReactTemplates()},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&e.prototype.clearAll.call(this,i),this.beforePopupOpen&&this.hidePopup()},s.prototype.onActionComplete=function(i,s,l,o){this.fixedHeaderElement=null,e.prototype.onActionComplete.call(this,i,s,l);var r=this.list.querySelector("."+I.li);t.isNullOrUndefined(r)||t.removeClass([r],I.focus),this.postBackAction()},s.prototype.postBackAction=function(){if(this.autofill&&!t.isNullOrUndefined(this.liCollections[0])&&this.searchList){var i=[this.liCollections[0]],s=h(this.inputElement.value,i,"StartsWith",this.ignoreCase);this.searchList=!1,t.isNullOrUndefined(s.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},s.prototype.setSelection=function(i,s){if(this.isValidLI(i))if(!t.isNullOrUndefined(s)&&"keydown"===s.type&&"enter"!==s.action&&"tab"!==s.action&&this.isValidLI(i)){var l=this.getFormattedValue(i.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l),this.isServerBlazor&&this.removeHover(),this.setHoverList(i),this.selectedLI=i,this.setScrollPosition(s),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,e.prototype.setAutoFill.call(this,i)),t.attributes(this.inputElement,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})}else e.prototype.setSelection.call(this,i,s)},s.prototype.listOption=function(i,s){var l=this,o=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(o.itemCreated))o.itemCreated=function(e){l.highlight&&(l.element.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){p(e.item,l.queryString,l.ignoreCase,l.filterType)},0):p(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var r=o.itemCreated;o.itemCreated=function(e){l.highlight&&p(e.item,l.queryString,l.ignoreCase,l.filterType),r.apply(l,[e])}}return o},s.prototype.isFiltering=function(){return!0},s.prototype.renderPopup=function(){this.list.scrollTop=0,e.prototype.renderPopup.call(this)},s.prototype.isEditTextBox=function(){return""!==this.inputElement.value.trim()},s.prototype.isPopupButton=function(){return this.showPopupButton},s.prototype.isSelectFocusItem=function(e){return!1},s.prototype.showPopup=function(){if(this.enabled){if(this.beforePopupOpen&&!this.isServerBlazor)return void this.refreshPopup();this.beforePopupOpen=!0,this.preventAutoFill=!0,t.isNullOrUndefined(this.list)||this.isServerBlazor?this.renderList():this.resetList(this.dataSource,this.fields)}},s.prototype.hidePopup=function(){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1),e.prototype.hidePopup.call(this),this.activeIndex=-1},s.prototype.onPropertyChanged=function(i,s){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],i);for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"showPopupButton":if(this.showPopupButton){if(this.isServerBlazor){if(this.inputWrapper&&this.inputWrapper.container){a=this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon");this.inputWrapper.buttons[0]=a}}else{var a=o.Input.appendSpan(I.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=a}this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&t.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else this.isServerBlazor||(t.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null);break;default:var h=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,h.newProperty,h.oldProperty)}}},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(c(this.liCollections[e]),p(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType,this.isServerBlazor))},s.prototype.getModuleName=function(){return"autocomplete"},s.prototype.render=function(){e.prototype.render.call(this)},Y([t.Complex({value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),Y([t.Property(!0)],s.prototype,"ignoreCase",void 0),Y([t.Property(!1)],s.prototype,"showPopupButton",void 0),Y([t.Property(!1)],s.prototype,"highlight",void 0),Y([t.Property(20)],s.prototype,"suggestionCount",void 0),Y([t.Property({})],s.prototype,"htmlAttributes",void 0),Y([t.Property(null)],s.prototype,"query",void 0),Y([t.Property(1)],s.prototype,"minLength",void 0),Y([t.Property("Contains")],s.prototype,"filterType",void 0),Y([t.Event()],s.prototype,"filtering",void 0),Y([t.Property(null)],s.prototype,"index",void 0),Y([t.Property("Never")],s.prototype,"floatLabelType",void 0),Y([t.Property(null)],s.prototype,"valueTemplate",void 0),Y([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),Y([t.Property(!1)],s.prototype,"allowFiltering",void 0),Y([t.Property(null)],s.prototype,"text",void 0),s=Y([t.NotifyPropertyChanges],s)}(X),ee="e-float-line",te="e-float-text",ie="e-label-top",se="e-label-bottom",le=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),oe=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},re="e-input-focus",ne="e-hide-listitem",ae="e-chips",he=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.isDynamicDataChange=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return le(s,e),s.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},s.prototype.requiredModules=function(){var e=[];if("CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},s.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];switch(s){case"class":var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&(t.addClass([this.overAllWrapper],l.split(" ")),t.addClass([this.popupWrapper],l.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(s,this.htmlAttributes[s]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:var o=["name","required","aria-required","form"],r=["title","role","style","class"];["id"].indexOf(s)>-1?this.element.setAttribute(s,this.htmlAttributes[s]):0===s.indexOf("data")||o.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?this.overAllWrapper.setAttribute(s,this.htmlAttributes[s]):this.inputElement.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.updateReadonly=function(e){e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly")},s.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove("e-close-icon-hide")):(this.overAllClear.style.display="none",this.componentWrapper.classList.add("e-close-icon-hide"))},s.prototype.updateCssClass=function(){if(!t.isNullOrUndefined(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(t.addClass([this.overAllWrapper],e.split(" ")),t.addClass([this.popupWrapper],e.split(" ")))}},s.prototype.updateOldPropCssClass=function(e){t.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(t.removeClass([this.overAllWrapper],e.split(" ")),t.removeClass([this.popupWrapper],e.split(" ")))},s.prototype.onPopupShown=function(){var e=this;if(t.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var i=this;window.onpopstate=function(){i.hidePopup(),i.inputElement.focus()},history.pushState({},"")}var s={name:"FadeIn",duration:100},l={popup:this.popupObj,cancel:!1,animation:s};this.trigger("open",l,function(i){i.cancel||(e.focusAtFirstListItem(),document.body.appendChild(e.popupObj.element),"CheckBox"===e.mode&&e.enableGroupCheckBox&&!t.isNullOrUndefined(e.fields.groupBy)&&e.updateListItems(e.list.querySelectorAll("li.e-list-item"),e.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===e.mode||e.showDropDownIcon)&&t.addClass([e.overAllWrapper],["e-icon-anim"]),e.refreshPopup(),e.renderReactTemplates(),e.popupObj.show(i.animation,1e3===e.zIndex?e.element:null),t.attributes(e.inputElement,{"aria-expanded":"true"}),e.isFirstClick&&e.loadTemplate())})},s.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},s.prototype.loadTemplate=function(){var e=this;"CheckBox"===this.mode&&this.itemTemplate&&t.isBlazor()&&this.isServerRendered&&this.mainData&&this.mainData.length>0?setTimeout(function(){e.refreshListItems(null),"CheckBox"===e.mode&&e.removeFocus(),e.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,e:e})},this.mainData.length<100?100:this.mainData.length):(this.refreshListItems(null),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))},s.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!t.isNullOrUndefined(this.value)&&this.value.length>0){var e=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",this.value[this.value.length-1]);t.isNullOrUndefined(e)||this.scrollBottom(e)}},s.prototype.focusAtFirstListItem=function(){if(this.ulElement&&this.ulElement.querySelector("li."+k.li)){var e=void 0;if("CheckBox"===this.mode)return void this.removeFocus();null!==(e=this.ulElement.querySelector("li."+k.li+":not(."+ne+")"))&&(this.removeFocus(),this.addListFocus(e))}},s.prototype.focusAtLastListItem=function(e){var t;e?t=h(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?h(this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null,t&&null!==t.item&&(this.addListFocus(t.item),this.scrollBottom(t.item,t.index))},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-multiselectable":"true","aria-activedescendant":"null","aria-haspopup":"true","aria-expanded":"false"}},s.prototype.updateListARIA=function(){t.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"});var e=!!this.inputElement.disabled;t.attributes(this.inputElement,this.getAriaAttributes()),e&&t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},s.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var i=this.htmlAttributes;t.extend(i,{"aria-disabled":e},i),this.setProperties({htmlAttributes:i},!0)}},s.prototype.removelastSelection=function(e){var i=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),s=i[i.length-1].getAttribute("data-value");t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice());var l=this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!t.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeValue(l,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},s.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},s.prototype.getForQuery=function(e){for(var s,l=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,o=0;o<e.length;o++)s=0===o?new i.Predicate(l,"equal",e[o]):s.or(l,"equal",e[o]);return this.getQuery(this.query).where(s)},s.prototype.onActionComplete=function(s,l,o,r){e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering);var n=this;if(t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&null!==this.value&&this.value.length>0){for(var a=[],h=0;h<this.value.length;h++){var p=this.getDataByValue(this.value[h]);p&&a.push(p[this.fields.value])}0===a.length&&this.setProperties({value:null})}if(!t.isNullOrUndefined(this.value)&&!this.allowCustomValue)for(var u=0;u<this.value.length;u++)this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:s,"li","data-value",n.value[u])||(this.value.splice(u,1),u-=1);this.updateActionList(s,l,o),t.isBlazor()&&this.isServerRendered&&this.allowFiltering&&"CheckBox"===this.mode&&this.removeFocus(),t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&this.value&&this.value.length>0&&(this.updateVal(this.value,null,"value"),this.addValidInputClass(),this.isDynamicDataChange=!1),!(this.dataSource instanceof i.DataManager&&"CheckBox"===this.mode&&this.allowFiltering)||t.isBlazor()&&this.isServerRendered||this.removeFocus()},s.prototype.updateActionList=function(e,s,l,o){if("CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?t.isNullOrUndefined(this.mainData)||0!==this.mainData.length||(this.mainData=s):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=s,this.mainListCollection=this.liCollections),(this.remoteCustomValue||s.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value)return void this.checkForCustomValue(this.tempQuery,this.fields);this.value&&this.value.length&&("CheckBox"!==this.mode&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof i.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),t.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),t.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown())},s.prototype.refreshSelection=function(){var e,i,s=this.hideSelectedItem?ne:k.selected;if(!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(e=this.value[l],i=this.findListElement(this.list,"li","data-value",e)){if(t.addClass([i],s),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(k.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(k.group))&&t.addClass([i.previousElementSibling],s),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(ne)&&this.hideGroupItem(e),this.hideSelectedItem&&i.classList.contains(k.focus)){t.removeClass([i],k.focus);var o=i.parentElement.querySelectorAll("."+k.li+":not(."+ne+")");o.length>0?t.addClass([o[0]],k.focus):(this.ulElement=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement,this.l10nUpdate(),t.addClass([this.list],k.noData))}if(i.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&i.classList.contains("e-active")){var r=i.firstElementChild.getAttribute("aria-checked");if(t.isNullOrUndefined(r)||"false"===r){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null};this.notify("updatelist",n)}}}this.checkSelectAll(),this.checkMaxSelection()},s.prototype.hideGroupItem=function(e){var i,s,l=this.hideSelectedItem?ne:k.selected;s=i=this.findListElement(this.ulElement,"li","data-value",e);var o=0,r=0,n=!0,a=!0;do{i&&i.previousElementSibling&&!i.previousElementSibling.classList.contains(ne)&&i.previousElementSibling.classList.contains(k.li)&&(n=!1),!n||!i||i.previousElementSibling&&i.previousElementSibling.classList.contains(k.group)?o=10:i=i.previousElementSibling,s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(ne)&&s.nextElementSibling.classList.contains(k.li)&&(a=!1),!a||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(k.group)?r=10:s=s.nextElementSibling}while(o<10||r<10);n&&a&&!i.previousElementSibling.classList.contains(ne)?t.addClass([i.previousElementSibling],l):n&&a&&i.previousElementSibling.classList.contains(ne)&&t.removeClass([i.previousElementSibling],l)},s.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+k.li+":not(."+ne+")");return t.isNullOrUndefined(e)?this.liCollections[0]:e},s.prototype.checkSelectAll=function(){var e=this.list.querySelectorAll("li.e-list-group-item.e-active").length,i=this.list.querySelectorAll("li.e-list-item"),s=this.list.querySelectorAll("li."+k.li).length,l=this.list.querySelectorAll("li."+k.selected).length;if(this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(l-=e),s!==l&&l!==this.maximumSelectionLength||"CheckBox"!==this.mode||!this.showSelectAll?s!==l&&"CheckBox"===this.mode&&this.showSelectAll&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}):this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var o=0;o<i.length;o++)this.findGroupStart(i[o]);this.deselectHeader()}},s.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup()},s.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var i=String.fromCharCode(e.keyCode).match(/\w/);t.isNullOrUndefined(i)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query;if(this.filterAction){if(null!==this.targetElement()){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields;s.where(t.isNullOrUndefined(o.text)?"":o.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}else s.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return s}return e||(this.query?this.query:new i.Query)},s.prototype.dataUpdater=function(e,t,s){if(this.isDataFetched=!1,""===this.targetElement().trim()){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.backCommand&&(this.remoteCustomValue=!1,this.onActionComplete(l,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))}else this.resetList(e,s,t),this.allowCustomValue&&(e instanceof i.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,s));this.refreshPopup(),"CheckBox"===this.mode&&this.removeFocus()},s.prototype.checkForCustomValue=function(e,i){var s=!this.getValueByText(this.inputElement.value,this.ignoreCase);if(this.allowCustomValue&&s){var l=this.inputElement.value,o=i||this.fields,r=!t.isNullOrUndefined(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r){var n={};t.setValue(o.text,l,n),"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)?t.setValue(o.value,Math.random(),n):t.setValue(o.value,l,n),(a=JSON.parse(JSON.stringify(this.listData))).splice(0,0,n),this.resetList(a,o,e)}else{var a=[this.inputElement.value];a[0]="number"!=typeof r||isNaN(parseFloat(a[0]))?a[0]:parseFloat(a[0]),a[0]="boolean"==typeof r?"true"===a[0]||"false"!==a[0]&&a[0]:a[0],this.resetList(a,o)}}this.value&&this.value.length&&this.refreshSelection()},s.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},s.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.enabled){if(e.target===this.overAllClear)return void e.preventDefault();if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf("e-chips-close"))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&"e-input-group-icon e-ddl-icon"===e.target.className)?this.showPopup():(this.hidePopup(),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}},s.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove("e-disabled"),this.inputElement.removeAttribute("disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add("e-disabled"),this.inputElement.setAttribute("disabled","true"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},s.prototype.onBlur=function(e,i){var s;return t.isNullOrUndefined(e)||(s=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(s)?void("CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&t.addClass([this.overAllWrapper],"e-valid-input")):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&t.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!t.Browser.isIE||t.isNullOrUndefined(e)||i?this.scrollFocusStatus?(t.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1)):(this.inputFocus=!1,this.overAllWrapper.classList.remove(re),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&(this.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0,!1,!0,!0),this.hidePopup()),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,t.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),g(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!t.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),void this.checkPlaceholderSize()):(this.inputFocus=!1,void this.overAllWrapper.classList.remove(re)))},s.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else t.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},s.prototype.setPlaceholderSize=function(e){t.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":t.addClass([this.searchWrapper],"e-search-custom-width"):t.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),t.removeClass([this.searchWrapper],"e-search-custom-width"))},s.prototype.refreshInputHight=function(){this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add("e-zero-size"):this.searchWrapper.classList.remove("e-zero-size")},s.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},s.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var o={e:e,oldValue:i,value:t,isInteracted:!!e,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",o),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}},s.prototype.updateTempValue=function(){this.value?this.tempValues=this.value.slice():this.tempValues=this.value},s.prototype.getPagingCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.offsetHeight/parseInt(e,10))},s.prototype.pageUpSelection=function(e){var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e>=0?t[e+1]:t[0];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.pageDownSelection=function(e){this.getItems();var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e<=t.length?t[e-1]:t[t.length-1];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+k.li).length>0?this.ulElement.querySelectorAll("."+k.li+":not(."+ne+")"):[]},s.prototype.focusInHandler=function(e){if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove("e-zero-size"),this.checkPlaceholderSize(),this.focused){var t={isInteracted:!!e,event:e};this.trigger("focus",t),this.focused=!1}return this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re),y(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),!0}return!1},s.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add("e-delimiter")},s.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove("e-delimiter")},s.prototype.expandTextbox=function(){var e=5;this.placeholder&&(e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length),this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},s.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},s.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},s.prototype.checkTextLength=function(){return this.targetElement().length<1},s.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(),e.preventDefault())}},s.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+k.focus);t.isNullOrUndefined(e)||this.inputElement.setAttribute("aria-activedescendant",e.id)},s.prototype.homeNavigation=function(e){this.removeFocus();var t=this.ulElement.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");if(t.length>0){var i=t[e?0:t.length-1];i.classList.add(k.focus),this.scrollBottom(i)}},s.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124))){if(e.altKey)return void this.popupKeyActions(e);if(this.isPopupOpen()){var t=this.list.querySelector("."+k.focus);switch(e.keyCode){case 36:case 35:this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(void 0-this.getPagingCount()),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(void 0+this.getPagingCount()),this.updateAriaAttribute()));case 38:this.arrowUp(e);break;case 40:this.arrowDown(e);break;case 27:return e.preventDefault(),this.hidePopup(),void("CheckBox"===this.mode&&this.inputElement.focus());case 13:return e.preventDefault(),"CheckBox"!==this.mode&&this.selectByKey(e),void this.checkPlaceholderSize();case 32:return void this.spaceKeySelection(e);case 9:e.preventDefault(),this.hidePopup(),this.inputElement.focus(),this.overAllWrapper.classList.add(re)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&this.checkBackCommand(e),this.expandTextbox(),this.refreshPopup()}},s.prototype.arrowDown=function(e){e.preventDefault(),this.moveByList(1),this.keyAction=!0,(document.activeElement.classList.contains("e-input-filter")||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&(this.list.focus(),t.EventHandler.add(this.list,"keydown",this.onKeyDown,this)),this.updateAriaAttribute()},s.prototype.arrowUp=function(e){e.preventDefault(),this.keyAction=!0;var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.focus);Array.prototype.slice.call(i).indexOf(s)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1),this.updateAriaAttribute()},s.prototype.spaceKeySelection=function(e){"CheckBox"===this.mode&&(document.activeElement.classList.contains("e-input-filter")||(e.preventDefault(),this.keyAction=!0,this.list.focus()),this.selectByKey(e)),this.checkPlaceholderSize()},s.prototype.checkBackCommand=function(e){8===e.keyCode&&""===this.targetElement()?this.backCommand=!1:this.backCommand=!0},s.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var t=this.value[this.value.length-1];this.removeValue(t,e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t)}},s.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},s.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},s.prototype.scrollBottom=function(e,i){var s=this.list.offsetHeight,l=e.offsetTop+e.offsetHeight-this.list.scrollTop,o=this.list.scrollTop+l-s,r=e.offsetTop+e.offsetHeight-this.list.scrollTop;r=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r,0===i?this.list.scrollTop=0:l>s?this.list.scrollTop=o:r>0&&this.list.offsetHeight>r||(this.list.scrollTop=o)},s.prototype.scrollTop=function(e,i){var s=e.offsetTop-this.list.scrollTop;s=this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s;var l=e.offsetTop+e.offsetHeight-this.list.scrollTop;0===i?this.list.scrollTop=0:s<0?this.list.scrollTop=this.list.scrollTop+s:l>0&&this.list.offsetHeight>l||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))},s.prototype.selectListByKey=function(e){var i,s=this.list.querySelector("li."+k.focus),l=this.value&&this.value.length?this.value.length:0;null!==s&&(s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength?(this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=s.firstElementChild.lastElementChild,this.findGroupStart(i),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(s)&&l<this.maximumSelectionLength&&((i=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s)),this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup()),this.refreshPlaceHolder()},s.prototype.refreshListItems=function(e){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var t=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(t,this.mainData),this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}},s.prototype.removeSelectedChip=function(e){var i,s=this.chipCollectionWrapper.querySelector("span.e-chip-selected");null!==s&&(t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice()),null!==(i=s.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e)),this.removeValue(s.getAttribute("data-value"),e),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(),this.checkPlaceholderSize()},s.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+k.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},s.prototype.moveByList=function(e){if(this.list){var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.focus),l=-1;if(i.length){for(var o=0;o<i.length;o++)if(i[o]===s){l=o;break}e>0?l<i.length-1&&(this.removeFocus(),this.addListFocus(i[++l]),this.updateCheck(i[l]),this.scrollBottom(i[l],l)):l>0&&(this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l))}}},s.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},s.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),l=this.chipCollectionWrapper.querySelector("span.e-chip-selected");null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},s.prototype.chipClick=function(e){if(this.enabled){var i=t.closest(e.target,".e-chips");this.removeChipSelection(),this.addChipSelection(i,e)}},s.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},s.prototype.addChipSelection=function(e,i){t.addClass([e],"e-chip-selected"),this.trigger("chipSelection",i)},s.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var i=e.target.parentElement.getAttribute("data-value"),s=this.getFormattedValue(i);if(this.allowCustomValue&&("false"!==i&&!1===s||!t.isNullOrUndefined(s)&&"NaN"===s.toString())&&(s=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(),this.inputFocus||this.inputElement.focus(),this.removeValue(s,e),t.isNullOrUndefined(this.findListElement(this.list,"li","data-value",s))&&this.mainList&&this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},s.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},s.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=this.placeholder:this.setFloatLabelType(),this.expandTextbox()},s.prototype.removeValue=function(i,s,l,o){var r=this,n=this.value.indexOf(this.getFormattedValue(i));-1===n&&this.allowCustomValue&&!t.isNullOrUndefined(i)&&(n=this.value.indexOf(i.toString()));var a=s&&s.target;o=!!(o||a&&a.classList.contains("e-close-hooker"))||null;var h=this.hideSelectedItem?ne:k.selected;if(-1!==n){var p=this.findListElement(this.list,"li","data-value",i),u=this.getDataByValue(i),c={e:s,item:p,itemData:u,isInteracted:!!s,cancel:!1};this.trigger("removing",c,function(a){if(a.cancel)r.removeIndex++;else{var c=r.value.slice(0);if(c.splice(n,1),t.isBlazor()&&r.isServerRendered){var d=[].concat([],c);r.setProperties({value:0===d.length?null:d},!0)}else r.setProperties({value:[].concat([],c)},!0);if(null!==p){var m=r.findListElement(r.mainList,"li","data-value",i);p.setAttribute("aria-selected","false"),t.removeClass([p],h),m&&(m.setAttribute("aria-selected","false"),t.removeClass([p,m],h)),r.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:p,e:r,index:n}),r.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:p,e:s}),t.attributes(r.inputElement,{"aria-activedescendant":p.id}),r.value&&r.value.length!==r.mainData.length&&"CheckBox"===r.mode&&r.showSelectAll&&!r.isSelectAll&&!o&&r.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,value:"uncheck"})}if(r.hideSelectedItem&&r.fields.groupBy&&r.hideGroupItem(i),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&r.isPopupOpen()&&e.prototype.scrollStop.call(r),r.updateMainList(!0,i),r.removeChip(i),r.updateChipStatus(),(r.value&&r.value.length?r.value.length:0)<r.maximumSelectionLength){var f=r.list.querySelectorAll("li."+k.li+":not(.e-active)");t.removeClass(f,"e-disable")}r.trigger("removed",a);var v=s&&s.currentTarget,y=!(!v||!v.classList.contains("e-selectall-parent"))||null;if(r.changeOnBlur||o||!s||!l||y||r.updateValueState(s,r.value,r.tempValues),l&&(r.selectAllEventData.push(u),r.selectAllEventEle.push(p)),1===l){r.changeOnBlur||r.updateValueState(s,r.value,r.tempValues);var g={event:s,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!s,isChecked:!1};r.trigger("selectedAll",g),r.selectAllEventData=[],r.selectAllEventEle=[]}!o||1!==l&&null!==l||r.clearAllCallback(s,o),t.isBlazor()&&r.isServerRendered&&(t.isNullOrUndefined(r.value)||0===r.value.length)&&r.updatedataValueItems(s)}})}},s.prototype.updateMainList=function(e,i){if(this.allowFiltering||"CheckBox"===this.mode){var s=this.findListElement(this.mainList,"li","data-value",i);s&&(e?(s.setAttribute("aria-selected","false"),t.removeClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","false"),t.removeClass([s.firstElementChild.lastElementChild],"e-check"))):(s.setAttribute("aria-selected","true"),t.addClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","true"),t.addClass([s.firstElementChild.lastElementChild],"e-check"))))}},s.prototype.removeChip=function(e){if(this.chipCollectionWrapper){var i=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);i&&t.remove(i)}},s.prototype.setWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=t.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.updateChipStatus=function(){this.value&&this.value.length?(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},s.prototype.addValue=function(e,t,i){this.value||(this.value=[]),this.value.indexOf(e)<0&&this.setProperties({value:[].concat([],this.value,[e])},!0);var s=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),s&&(this.addListFocus(s),this.addListSelection(s)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},s.prototype.checkMaxSelection=function(){if((this.value&&this.value.length?this.value.length:0)===this.maximumSelectionLength){var e=this.list.querySelectorAll("li."+k.li+":not(.e-active)");t.addClass(e,"e-disable")}},s.prototype.dispatchSelect=function(t,i,s,l,o){var r=this,n=this.listData;if(this.initStatus&&!l){var a=this.getDataByValue(t),h={e:i,item:s,itemData:a,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(l){if(!l.cancel){if(o&&(r.selectAllEventData.push(a),r.selectAllEventEle.push(s)),1===o){var h={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0};r.trigger("selectedAll",h),r.selectAllEventData=[]}r.allowCustomValue&&r.isServerRendered&&r.listData!==n&&(r.listData=n),r.updateListSelectEventCallback(t,s,i),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&e.prototype.scrollStop.call(r)}})}},s.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},s.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),i=this.chipCollectionWrapper.querySelectorAll("span."+"e-chips-close".split(" ")[0]);if(t.removeClass(e,"e-chip-selected"),t.Browser.isDevice)for(var s=0;s<i.length;s++)i[s].style.display="none"},s.prototype.onMobileChipInteraction=function(e){var i=t.closest(e.target,".e-chips"),s=i.querySelector("span."+"e-chips-close".split(" ")[0]);this.enabled&&!this.readonly&&(i.classList.contains("e-chip-selected")||(this.removeChipFocus(),s.style.display="",i.classList.add("e-chip-selected")),this.refreshPopup(),e.preventDefault())},s.prototype.multiCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},s.prototype.getChip=function(e,i,s){var l,o=this,r={text:i,value:i},n=this.createElement("span",{className:ae,attrs:{"data-value":i,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),h=this.createElement("span",{className:"e-chips-close"});if(this.mainData&&(r=t.isBlazor()&&this.isServerRendered?JSON.parse(JSON.stringify(this.getDataByValue(i))):this.getDataByValue(i)),this.valueTemplate&&!t.isNullOrUndefined(r)){var p=(l=this.multiCompiler(this.valueTemplate)?t.compile(t.select(this.valueTemplate,document).innerHTML.trim()):t.compile(this.valueTemplate))(r,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a);if(p&&p.length>0)for(var u=0;u<p.length;u++)a.appendChild(p[u]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!1,!1,!1)}else this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=e;n.appendChild(a);var c={isInteracted:!!s,itemData:r,e:s,setClass:function(e){t.addClass([n],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",c,function(e){e.cancel||(e.setClass&&"string"==typeof e.setClass&&t.isBlazor()&&o.isServerRendered&&t.addClass([n],e.setClass),t.Browser.isDevice?(n.classList.add("e-mob-chip"),t.append([h],n),h.style.display="none",t.EventHandler.add(n,"click",o.onMobileChipInteraction,o)):(t.EventHandler.add(n,"mousedown",o.chipClick,o),o.showClearButton&&n.appendChild(h)),t.EventHandler.add(h,"mousedown",o.onChipRemove,o),o.chipCollectionWrapper.appendChild(n),!o.changeOnBlur&&s&&o.updateValueState(s,o.value,o.tempValues))})},s.prototype.calcPopupWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px"),e},s.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},s.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},s.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties;return this.listCurrentOptions=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t.extend(this.listCurrentOptions,this.listCurrentOptions,i,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:l}),this.listCurrentOptions},s.prototype.renderPopup=function(){var i=this;if(this.list||e.prototype.render.call(this),!this.popupObj){document.body.appendChild(this.popupWrapper);var s=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&s&&this.filterParent&&(s.remove(),this.filterParent=null);var o=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),o-=this.header.offsetHeight),t.append([this.list],this.popupWrapper),this.footerTemplate&&(this.setFooterTemplate(),o-=this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(o-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(o-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var r={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",r),o-=this.searchBoxHeight),t.addClass([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(o),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight),this.popupObj=new l.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),t.detach(i.popupObj.element))},open:function(){if(i.popupObj.resolveCollision(),!i.isFirstClick){var e=i.list.querySelector("ul");e&&(i.itemTemplate&&t.isBlazor()&&i.isServerRendered?setTimeout(function(){i.mainList=i.ulElement},0):"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||(i.mainList=e.cloneNode?e.cloneNode(!0):e)),i.isFirstClick=!0}i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||i.loadTemplate(),i.setScrollPosition(),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"})},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}),"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.popupObj.close(),this.popupWrapper.style.visibility=""}},s.prototype.setHeaderTemplate=function(){var e;this.header&&this.header.remove(),this.header=this.createElement("div"),t.addClass([this.header],"e-ddl-header");var i=(e=this.multiCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.header.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1),"CheckBox"===this.mode&&this.showSelectAll?t.prepend([this.header],this.popupWrapper):t.append([this.header],this.popupWrapper),t.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},s.prototype.setFooterTemplate=function(){var e;this.footer&&this.footer.remove(),this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddl-footer");var i=(e=this.multiCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.footer.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],this.popupWrapper),t.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},s.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var i=void 0;if(this.value&&this.value.length>0){var s=this.list&&this.list.querySelectorAll("li.e-list-item");if(s&&s.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,i=this.value[this.removeIndex];this.removeIndex<this.value.length&&(this.removeValue(i,e,null,!0),null!==this.value||!t.isBlazor()||!this.isServerRendered);i=this.value[this.removeIndex]);}else this.clearAllCallback(e)}},s.prototype.clearAllCallback=function(e,i){var s=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&i&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!i||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},s.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),t.EventHandler.add(window,"resize",this.windowResize,this),t.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),t.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),t.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"blur",this.onBlur,this),t.EventHandler.add(this.componentWrapper,"mousemove",this.mouseIn,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),t.EventHandler.add(this.overAllClear,"mouseup",this.clearAll,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},s.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&this.search(e)},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},s.prototype.search=function(e){var s=this;if(t.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(),this.openClick(e),!this.checkTextLength()||this.allowFiltering||t.isNullOrUndefined(e)||8===e.keyCode){var l=this.targetElement();if(this.allowFiltering){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.filterAction=!0,s.dataUpdater(s.dataSource,null,s.fields))})}else if(this.allowCustomValue){var r=new i.Query;r=""!==l?r.where(this.fields.text,"startswith",l,this.ignoreCase,this.ignoreAccent):r,this.dataUpdater(this.mainData,r,this.fields)}else{var n=this.list.querySelectorAll("li."+k.li+":not(.e-hide-listitem)"),a=h(this.targetElement(),n,"StartsWith",this.ignoreCase);a&&null!==a.item?(this.addListFocus(a.item),this.list.scrollTop=a.item.offsetHeight*a.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem()},s.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"multi-select"},s.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0},s.prototype.updateData=function(e,i){var s,l="",o="Delimiter"===this.mode||"CheckBox"===this.mode,r=[],n=this.listData;if(this.listData=this.mainData,this.hiddenElement.innerHTML="",!t.isNullOrUndefined(this.value))for(var a=0;!t.isNullOrUndefined(this.value[a]);a++){var h=this.findListElement(t.isNullOrUndefined(this.mainList)?this.ulElement:this.mainList,"li","data-value",this.value[a]);t.isBlazor()&&this.isServerRendered||!t.isNullOrUndefined(h)||this.allowCustomValue?(l+=(s=this.listData?this.getTextByValue(this.value[a]):this.value[a])+e+" ",r.push(s)):(this.value.splice(a,1),a-=1),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[a]+'">'+a+"</option>"}this.setProperties({text:r.toString()},!0),o&&(this.updateWrapperText(this.delimiterWrapper,l),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.delimiterWrapper.id));var p=i&&i.target,u=!(!p||!p.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&i&&!u||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(i,this.value,this.tempValues)),this.listData=n,this.addValidInputClass()},s.prototype.initialTextUpdate=function(){if(t.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);t.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}i&&i.length&&this.setProperties({value:i},!0)}},s.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,t),this.unwireListEvents(),this.wireListEvents()},s.prototype.initialValueUpdate=function(){if(this.list){var e=void 0,i=void 0,s=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(s=this.value[l],i=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",s),e=this.getTextByValue(s),i&&"true"!==i.getAttribute("aria-selected")||i&&"true"===i.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode))this.addChip(e,s),this.addListSelection(i);else if(s&&this.allowCustomValue){var o=this.listData.length,r={};t.setValue(this.fields.text,s,r),t.setValue(this.fields.value,s,r);var n=this.popupWrapper.querySelector("."+k.noData);this.addItem(r,o),this.popupWrapper.contains(n)&&(this.list.setAttribute("style",n.getAttribute("style")),this.popupWrapper.replaceChild(this.list,n),this.wireListEvents()),this.addChip(e,s),this.addListSelection(i)}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar),"CheckBox"!==this.mode||!this.showSelectAll||!t.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},s.prototype.updateActionCompleteData=function(e,i){this.value&&this.value.indexOf(e.getAttribute("data-value"))>-1&&(this.mainList=this.ulElement,t.addClass([e],ne))},s.prototype.updateAddItemList=function(e,i){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+k.noData)&&e&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),t.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup())},s.prototype.updateDataList=function(){this.mainList&&this.ulElement&&this.mainList.childElementCount<this.ulElement.childElementCount&&(this.mainList=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement)},s.prototype.isValidLI=function(e){return e&&!e.classList.contains(k.disabled)&&!e.classList.contains(k.group)&&e.classList.contains(k.li)},s.prototype.updateListSelection=function(e,i,s){var l=e.getAttribute("data-value"),o=this.getFormattedValue(l);this.allowCustomValue&&("false"!==l&&!1===o||!t.isNullOrUndefined(o)&&"NaN"===o.toString())&&(o=l),this.removeHover(),this.value&&-1!==this.value.indexOf(o)?this.removeValue(o,i,s):this.dispatchSelect(o,i,e,"true"===e.getAttribute("aria-selected"),s)},s.prototype.updateListSelectEventCallback=function(e,i,s){var l=this,o=this.getTextByValue(e);if(!this.allowCustomValue&&!this.allowFiltering||this.findListElement(this.mainList,"li","data-value",e))this.remoteCustomValue=!1,this.addValue(e,o,s);else{var r=i.cloneNode(!0),n=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof t.getValue(n,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var a=this.getDataByValue(e),h={newData:a,cancel:!1};this.trigger("customValueSelection",h,function(i){i.cancel||(t.append([r],l.mainList),l.mainData.push(a),l.remoteCustomValue=!1,l.addValue(e,o,s),t.isBlazor()&&l.isServerRendered&&(l.checkPlaceholderSize(),l.makeTextBoxEmpty()))})}t.isBlazor()&&this.isServerRendered&&this.value&&this.list&&(this.value.length===this.list.querySelectorAll("li.e-list-item").length||this.value.length===this.maximumSelectionLength)&&(this.updatedataValueItems(s),this.checkPlaceholderSize()),t.isBlazor()&&this.isServerRendered&&(this.checkPlaceholderSize(),this.makeTextBoxEmpty())},s.prototype.removeListSelection=function(){var e=this.hideSelectedItem?ne:k.selected,i=this.list.querySelectorAll("."+e),s=i.length;if(i&&i.length)for(t.removeClass(i,e);s>0;)i[s-1].setAttribute("aria-selected","false"),s--;if(!t.isNullOrUndefined(this.mainList)){var l=this.mainList.querySelectorAll("."+e),o=l.length;if(l&&l.length)for(t.removeClass(l,e);o>0;)l[o-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(i&&i.length>o-1&&(i[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([i[o-1].firstElementChild.lastElementChild],"e-check")),l[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([l[o-1].firstElementChild.lastElementChild],"e-check")),o--}},s.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)},s.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+k.focus),i=this.mainList.querySelectorAll("."+k.focus);e&&e.length&&(t.removeClass(e,k.focus),t.removeClass(i,k.focus))}},s.prototype.addListHover=function(e){this.enabled&&this.isValidLI(e)?(this.removeHover(),t.addClass([e],k.hover)):null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.addListFocus=function(e){this.enabled&&this.isValidLI(e)?(this.removeFocus(),t.addClass([e],k.focus)):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&t.addClass([e],k.focus)},s.prototype.addListSelection=function(e){var i=this.hideSelectedItem?ne:k.selected;if(this.isValidLI(e)&&!e.classList.contains(k.hover)){if(t.addClass([e],i),this.updateMainList(!1,e.getAttribute("data-value")),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode){var s=e.firstElementChild.getAttribute("aria-checked");("false"===s||t.isNullOrUndefined(s))&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this})}this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),t.attributes(this.inputElement,{"aria-activedescendant":e.id})}},s.prototype.updateDelimeter=function(e,t){this.updateData(e,t)},s.prototype.onMouseClick=function(e){var i=this;this.keyCode=null,this.scrollFocusStatus=!1;var s=e.target,l=t.closest(s,"."+k.li);if(t.closest(s,"."+k.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(s=s.classList.contains("e-list-group-item")?s.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),s.classList.remove("e-check"),s.classList.remove("e-stop"),t.closest(s,".e-list-group-item").classList.remove("e-active"),s.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),s.classList.remove("e-stop"),s.classList.add("e-check"),t.closest(s,".e-list-group-item").classList.add("e-active"),s.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(l)){var o=this.value&&this.value.length?this.value.length:0;l.classList.contains("e-active")&&(o-=1),o<this.maximumSelectionLength&&(this.updateListSelection(l,e),this.checkPlaceholderSize(),this.addListFocus(l),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(l.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout(function(){i.updateDelimeter(i.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup():e.preventDefault(),this.makeTextBoxEmpty(),this.findGroupStart(s)}else e.preventDefault();"CheckBox"!==this.mode&&this.refreshListItems(t.isNullOrUndefined(l)?null:l.textContent),this.refreshPlaceHolder(),this.deselectHeader()}},s.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var i=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),i=this.findGroupAttrtibutes(e,0,0,0,0),i=this.findGroupAttrtibutes(e,i[0],i[1],i[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,i[0],i[1],i[2])}},s.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++,null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},s.prototype.updateCheckBox=function(e,i,s,l){if(null!==e){var o=e.getElementsByClassName("e-frame")[0];l===i?(o.classList.remove("e-stop"),o.classList.add("e-check"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):l===s?(o.classList.remove("e-check"),o.classList.remove("e-stop"),t.closest(o,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===i-1?(o.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),t.closest(o,".e-list-group-item").classList.add("e-active"),o.classList.add("e-check")):(o.classList.remove("e-check"),o.classList.add("e-stop"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},s.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,i=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&t.removeClass(i,"e-disable"),e===this.maximumSelectionLength&&t.addClass(i,"e-disable")},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);null===i&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(i=t.closest(e.target,"."+k.group)),this.addListHover(i)},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},s.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},s.prototype.wireListEvents=function(){t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),t.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),t.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.unwireListEvents=function(){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(t.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),t.EventHandler.remove(this.list,"mouseup",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},s.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},s.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&("none"!==this.overAllClear.style.display?this.spinnerElement=this.overAllClear:(this.spinnerElement=this.createElement("span",{className:"e-chips-close e-close-hooker e-ms-spinner-icon"}),this.componentWrapper.appendChild(this.spinnerElement)),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),t.addClass([this.spinnerElement],"e-ddl-disable-icon"),l.showSpinner(this.spinnerElement))},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],"e-ddl-disable-icon"),this.spinnerElement.classList.contains("e-ms-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.updateWrapperText=function(e,i){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=i:e.innerText=t.SanitizeHtmlHelper.sanitize(i)},s.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove("e-delim-total"),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=1,o=void 0,r=void 0,n=0,a=void 0;this.updateWrapperText(this.viewWrapper,e);var h={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},p=new t.L10n(this.getLocaleName(),h,this.locale);""===p.getConstant("actionFailureTemplate")&&(p=new t.L10n("dropdowns",h,this.locale)),""===p.getConstant("noRecordsTemplate")&&(p=new t.L10n("dropdowns",h,this.locale));var u=p.getConstant("overflowCountTemplate"),c=this.createElement("span",{className:"e-remain"}),d=t.compile(u),m=t.compile(p.getConstant("totalCountTemplate")),f=d({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate,null,c);f&&f.length>0&&c.appendChild(f[0]),this.viewWrapper.appendChild(c),this.renderReactTemplates();var v=c.offsetWidth;if(t.remove(c),this.showDropDownIcon&&(n=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!t.isNullOrUndefined(this.value))for(var y=0;!t.isNullOrUndefined(this.value[y]);y++){if(e+=0===y?"":this.delimiterChar+" ",i=this.getOverflowVal(y),e+=i,i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e),o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),a=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),o+n+this.clearIconWidth>a){for(void 0!==s&&""!==s&&(i=s,y=l+1),this.updateWrapperText(this.viewWrapper,i),r=this.value.length-y,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);o+v+n+this.clearIconWidth>a&&0!==o&&""!==this.viewWrapper.innerHTML;){var g=this.viewWrapper.innerHTML.split(this.delimiterChar);g.pop(),this.viewWrapper.innerHTML=g.join(this.delimiterChar),r++,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)}break}o+v+n+this.clearIconWidth<=a?(s=e,l=y):0===y&&(s="",l=-1)}if(r>0){var C=a-n-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(c,this.viewWrapper,r,d,m,C)),this.updateRemainWidth(this.viewWrapper,C),this.updateRemainingText(c,n,r,d,m)}}else this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none"},s.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},s.prototype.updateRemainWidth=function(e,t){e.classList.contains("e-delim-total")&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},s.prototype.updateRemainTemplate=function(e,t,i,s,l,o){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var r=s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate,null,e),n=l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate,null,e);return e.appendChild(t.firstChild&&3===t.firstChild.nodeType?r&&r[0]:n&&n[0]),t.firstChild&&3===t.firstChild.nodeType?t.classList.remove("e-delim-total"):(t.classList.add("e-delim-total"),this.updateRemainWidth(t,o)),e},s.prototype.updateRemainingText=function(e,t,i,s,l){var o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),r=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(r+t>=o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;r+t>o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var n=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);n.pop(),this.viewWrapper.firstChild.nodeValue=n.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,r=this.viewWrapper.offsetWidth}var a=o-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,a)}},s.prototype.getOverflowVal=function(e){var t;if(this.mainData&&this.mainData.length)if("CheckBox"===this.mode){var i=this.listData;this.listData=this.mainData,t=this.getTextByValue(this.value[e]),this.listData=i}else t=this.getTextByValue(this.value[e]);else t=this.value[e];return t},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),t.EventHandler.remove(window,"resize",this.windowResize),t.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),t.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.EventHandler.remove(this.inputElement,"blur",this.onBlur),t.EventHandler.remove(this.componentWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},s.prototype.selectAllItem=function(e,i,s){var l;if(l=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)'),this.value&&this.value.length&&i&&i.target&&t.closest(i.target,".e-close-hooker")&&this.allowFiltering&&(l=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var o=i?i.target:null;if(o=i&&32===i.keyCode?s:o,(o=o&&o.classList.contains("e-frame")?o.parentElement.parentElement:o)&&o.classList.contains("e-list-group-item")){var r=o.nextElementSibling;if(t.isNullOrUndefined(r))return;for(;r.classList.contains("e-list-item");){if(e){if(!r.firstElementChild.lastElementChild.classList.contains("e-check")){var n=this.value&&this.value.length?this.value.length:0;r.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&this.updateListSelection(r,i)}}else r.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(r,i);if(null==(r=r.nextElementSibling))break}if(o.classList.contains("e-list-group-item")){var a=this.list.getElementsByClassName("e-item-focus")[0];a&&a.classList.remove("e-item-focus"),e?o.classList.add("e-active"):o.classList.remove("e-active"),o.classList.add("e-item-focus")}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&i&&this.updateValueState(i,this.value,this.tempValues)}else this.updateValue(i,l,e)}else this.updateValue(i,l,e)},s.prototype.updateValue=function(e,i,s){var l=this,o=i.length;if(i&&i.length){var r=0,n=0;for(n=this.enableGroupCheckBox?s?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:s?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;r<o&&r<=50&&r<n;)this.updateListSelection(i[r],e,o-r),this.enableGroupCheckBox&&this.findGroupStart(i[r]),r++;o>50&&setTimeout(function(){for(;r<o&&r<n;)l.updateListSelection(i[r],e,o-r),l.enableGroupCheckBox&&l.findGroupStart(i[r]),r++;t.isBlazor()&&l.isServerRendered||(l.updatedataValueItems(e),l.changeOnBlur||(l.updateValueState(e,l.value,l.tempValues),l.isSelectAll=l.isSelectAll?!l.isSelectAll:l.isSelectAll),l.updateHiddenElement())},0)}t.isBlazor()&&this.isServerRendered||(this.updatedataValueItems(e),this.checkPlaceholderSize(),o<=50&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement()))},s.prototype.updateHiddenElement=function(){var e=this,i="",s="",l="",o=[];"CheckBox"===this.mode&&(this.value.map(function(t,r){i+='<option selected value ="'+t+'">'+r+"</option>",l=e.listData?e.getTextByValue(t):t,s+=l+e.delimiterChar+" ",o.push(l)}),this.hiddenElement.innerHTML=i,this.updateWrapperText(this.delimiterWrapper,s),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.delimiterWrapper.id),this.setProperties({text:o.toString()},!0),this.refreshInputHight(),this.refreshPlaceHolder())},s.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},s.prototype.textboxValueUpdate=function(e){var i=e&&e.target&&(t.closest(e.target,".e-selectall-parent")||t.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||i)?this.searchWrapper.classList.remove("e-zero-size"):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),i||this.isSelectAll||this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.updateDataSource=function(e){t.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),!this.value||!this.value.length||t.isBlazor()&&this.isServerRendered||(this.setProperties({value:this.value}),this.refreshSelection())},s.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},s.prototype.selectAllItems=function(i,s){var l=this;if(t.isNullOrUndefined(this.list))this.selectAllAction=function(){if("CheckBox"===l.mode&&l.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===l.mode,value:i?"check":"uncheck"};l.notify("checkSelectAll",e)}l.selectAllItem(i,s),l.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var o={value:i?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",o)}this.selectAllItem(i,s)}},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){(i.dataSource&&!t.isNullOrUndefined(Object.keys(i.dataSource))||i.query&&!t.isNullOrUndefined(Object.keys(i.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,o=Object.keys(i);l<o.length;l++){var r=o[l];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(t.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(i.showClearButton);break;case"text":this.updateVal(this.value,this.value,"text");break;case"value":this.updateVal(this.value,s.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(i.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:i.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(i.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(s.cssClass),this.updateCssClass();break;case"enableRtl":this.enableRTL(i.enableRtl),e.prototype.onPropertyChanged.call(this,i,s);break;case"readonly":this.updateReadonly(i.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(i.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass();break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;default:var n=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,n.newProperty,n.oldProperty)}}},s.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},s.prototype.updateVal=function(e,s,l){this.list&&(!(this.dataSource instanceof i.DataManager)||this.listData&&this.mainList&&this.mainData)?("text"===l&&(this.initialTextUpdate(),e=this.value),(t.isNullOrUndefined(this.value)||0===this.value.length)&&(this.tempValues=s),this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,s),this.checkPlaceholderSize()):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,e,s)},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.hidePopup=function(){var e=this;if(this.isPopupOpen()){var i={name:"FadeOut",duration:100,delay:100},s={popup:this.popupObj,cancel:!1,animation:i};this.trigger("close",s,function(i){i.cancel||(e.fields.groupBy&&"CheckBox"!==e.mode&&e.fixedHeaderElement&&(t.remove(e.fixedHeaderElement),e.fixedHeaderElement=null),e.beforePopupOpen=!1,e.overAllWrapper.classList.remove("e-icon-anim"),e.popupObj.hide(new t.Animation(i.animation)),t.attributes(e.inputElement,{"aria-expanded":"false"}),e.allowFiltering&&e.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,value:"clear"}),e.popupObj.hide(),t.removeClass([document.body,e.popupObj.element],"e-popup-full-page"),t.EventHandler.remove(e.list,"keydown",e.onKeyDown))})}},s.prototype.showPopup=function(){var i=this;if(this.enabled){var s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(!s.cancel){if(t.isBlazor()&&i.isServerRendered&&i.itemTemplate&&(i.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,!1),"CheckBox"!==i.mode&&i.list&&i.refreshSelection()),!i.ulElement)return i.beforePopupOpen=!0,e.prototype.render.call(i),void("CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode}));"CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode});var l=i.ulElement.querySelectorAll("li.e-list-item").length,o=i.ulElement.querySelectorAll("li."+k.li+"."+ne).length;if(l>0&&l===o&&o===i.mainData.length)return void(i.beforePopupOpen=!1);i.onPopupShown()}})}},s.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},s.prototype.getModuleName=function(){return"multiselect"},s.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){e.setProperties({value:null},!0)},0):this.setProperties({value:null},!0)},s.prototype.render=function(){this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view e-delim-values",styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:"e-chips-close e-close-hooker",styles:"display:none;"}),this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&t.addClass([this.overAllWrapper],"e-checkbox"),t.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:"e-delim-values",styles:"display:none"}),this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection",styles:"display:none"}),"Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!t.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add("e-close-icon-hide"),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0"}}),"Default"!==this.mode&&"Box"!==this.mode||(this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.chipCollectionWrapper.id)),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?d(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.checkInitialValue=function(){var e=this,s=this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource);if((!this.value||!this.value.length)&&t.isNullOrUndefined(this.text)&&!s&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var l=this.element.options,o=[],r="",n=0,a=l.length;n<a;n++){var h=l[n];t.isNullOrUndefined(h.getAttribute("selected"))||(h.getAttribute("value")?o.push(h.getAttribute("value")):r+=h.text+this.delimiterChar)}o.length>0?this.setProperties({value:o},!0):""!==r&&this.setProperties({text:r},!0),(o.length>0||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}(this.value&&this.value.length||!t.isNullOrUndefined(this.text))&&this.renderPopup(),t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length?(this.dataSource instanceof i.DataManager?this.setInitialValue=function(){e.initStatus=!1,e.initialValueUpdate(),e.initialUpdate(),e.setInitialValue=null,e.initStatus=!0}:(this.initialValueUpdate(),this.initialUpdate()),this.updateTempValue()):this.initialUpdate(),this.initStatus=!0,this.checkAutoFocus(),t.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},s.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},s.prototype.setFloatLabelType=function(){f(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&d(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},s.prototype.addValidInputClass=function(){!t.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?t.addClass([this.overAllWrapper],"e-valid-input"):t.removeClass([this.overAllWrapper],"e-valid-input")},s.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:"e-input-group-icon e-ddl-icon"}),this.componentWrapper.appendChild(this.dropIcon),t.addClass([this.componentWrapper],["e-down-icon"])):t.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),t.removeClass([this.componentWrapper],["e-down-icon"]))},s.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},s.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.popupObj&&this.popupObj.hide(),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent(),this.list=null,this.popupObj=null,this.mainList=null,this.mainData=null,this.filterParent=null,this.ulElement=null,e.prototype.destroy.call(this);for(var i=["readonly","aria-disabled","aria-placeholder","placeholder"],s=i.length;s>0;)this.inputElement.removeAttribute(i[s-1]),s--;this.element.removeAttribute("data-initial-value"),this.element.style.display="block",this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()?t.remove(this.overAllWrapper):(this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),t.remove(this.overAllWrapper)))},oe([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),oe([t.Property(!1)],s.prototype,"enablePersistence",void 0),oe([t.Property(null)],s.prototype,"groupTemplate",void 0),oe([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),oe([t.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),oe([t.Property("None")],s.prototype,"sortOrder",void 0),oe([t.Property(!0)],s.prototype,"enabled",void 0),oe([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),oe([t.Property([])],s.prototype,"dataSource",void 0),oe([t.Property(null)],s.prototype,"query",void 0),oe([t.Property("StartsWith")],s.prototype,"filterType",void 0),oe([t.Property(1e3)],s.prototype,"zIndex",void 0),oe([t.Property(!1)],s.prototype,"ignoreAccent",void 0),oe([t.Property()],s.prototype,"locale",void 0),oe([t.Property(!1)],s.prototype,"enableGroupCheckBox",void 0),oe([t.Property(null)],s.prototype,"cssClass",void 0),oe([t.Property("100%")],s.prototype,"width",void 0),oe([t.Property("300px")],s.prototype,"popupHeight",void 0),oe([t.Property("100%")],s.prototype,"popupWidth",void 0),oe([t.Property(null)],s.prototype,"placeholder",void 0),oe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),oe([t.Property({})],s.prototype,"htmlAttributes",void 0),oe([t.Property(null)],s.prototype,"valueTemplate",void 0),oe([t.Property(null)],s.prototype,"headerTemplate",void 0),oe([t.Property(null)],s.prototype,"footerTemplate",void 0),oe([t.Property(null)],s.prototype,"itemTemplate",void 0),oe([t.Property(null)],s.prototype,"allowFiltering",void 0),oe([t.Property(!0)],s.prototype,"changeOnBlur",void 0),oe([t.Property(!1)],s.prototype,"allowCustomValue",void 0),oe([t.Property(!0)],s.prototype,"showClearButton",void 0),oe([t.Property(1e3)],s.prototype,"maximumSelectionLength",void 0),oe([t.Property(!1)],s.prototype,"readonly",void 0),oe([t.Property(null)],s.prototype,"text",void 0),oe([t.Property(null)],s.prototype,"value",void 0),oe([t.Property(!0)],s.prototype,"hideSelectedItem",void 0),oe([t.Property(!0)],s.prototype,"closePopupOnSelect",void 0),oe([t.Property("Default")],s.prototype,"mode",void 0),oe([t.Property(",")],s.prototype,"delimiterChar",void 0),oe([t.Property(!0)],s.prototype,"ignoreCase",void 0),oe([t.Property(!1)],s.prototype,"showDropDownIcon",void 0),oe([t.Property("Never")],s.prototype,"floatLabelType",void 0),oe([t.Property(!1)],s.prototype,"showSelectAll",void 0),oe([t.Property("Select All")],s.prototype,"selectAllText",void 0),oe([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),oe([t.Property(!0)],s.prototype,"enableSelectionOrder",void 0),oe([t.Property(!0)],s.prototype,"openOnClick",void 0),oe([t.Event()],s.prototype,"change",void 0),oe([t.Event()],s.prototype,"removing",void 0),oe([t.Event()],s.prototype,"removed",void 0),oe([t.Event()],s.prototype,"selectedAll",void 0),oe([t.Event()],s.prototype,"beforeOpen",void 0),oe([t.Event()],s.prototype,"open",void 0),oe([t.Event()],s.prototype,"close",void 0),oe([t.Event()],s.prototype,"blur",void 0),oe([t.Event()],s.prototype,"focus",void 0),oe([t.Event()],s.prototype,"chipSelection",void 0),oe([t.Event()],s.prototype,"filtering",void 0),oe([t.Event()],s.prototype,"tagging",void 0),oe([t.Event()],s.prototype,"customValueSelection",void 0),s=oe([t.NotifyPropertyChanges],s)}(B),pe=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlur,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlur),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var i=this;if(t.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)};else{var s=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),s.apply(i,[e])}}},e.prototype.setPlaceholder=function(e){o.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var i;if(i=t.isNullOrUndefined(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==i.className&&"e-list-group-item"!==i.className){var s=r.createCheckBox(this.parent.createElement,!0),l=t.select("div.e-icons",i);return i.insertBefore(s,i.childNodes[t.isNullOrUndefined(l)?0:1]),t.select(".e-frame",s),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),i}return i},e.prototype.setSelectAll=function(){this.parent.showSelectAll?(t.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(t.isNullOrUndefined(this.parent.filterParent)?t.append([this.checkAllParent],this.parent.popupWrapper):t.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(t.isNullOrUndefined(this.parent.filterParent)?t.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),t.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&(!this.parent.isDynamicDataChange||!t.isBlazor())||this.parent.isDynamicDataChange&&!t.isNullOrUndefined(this.parent.value)&&this.parent.value.length<=1&&t.isBlazor()?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):t.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),t.EventHandler.remove(document,"mousedown",this.onDocumentClick)},e.prototype.listSelection=function(e){var i,s=t.isBlazor()&&e.module&&"listbox"===e.module;if(t.isNullOrUndefined(e.e)){var l=e.li.querySelector(".e-checkbox-wrapper");i=l?s?l.querySelector(".e-frame"):l.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{var o=e.li.querySelector(".e-checkbox-wrapper .e-frame");i=t.isNullOrUndefined(e.e.target)?s?o:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:s?o:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(i=e.li.firstElementChild.childNodes[1]),t.isNullOrUndefined(i)||(this.checkWrapper=t.closest(i,".e-checkbox-wrapper")),!t.isNullOrUndefined(this.checkWrapper)){var r=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,r.classList.contains("e-check"),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var i;i=e.currentTarget.classList.contains(this.checkAllParent.className)?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=t.closest(i,".e-checkbox-wrapper");if(!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains("e-check"),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,i,s,l,o){var r,n=e.getElementsByClassName("e-frame")[0];"check"!==i||n.classList.contains("e-check")?"uncheck"===i&&(n.classList.contains("e-check")||n.classList.contains("e-stop"))?(t.removeClass([n],["e-check","e-stop"]),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):"indeterminate"!==i||n.classList.contains("e-stop")||(t.removeClass([n],["e-check"]),n.classList.add("e-stop"),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):(n.classList.remove("e-stop"),n.classList.add("e-check"),r="true",o&&(this.parent.selectAllItems(!0,s),this.setLocale(!0))),r="check"===i?"true":"uncheck"===i?"false":r,t.isNullOrUndefined(r)||e.setAttribute("aria-checked",r)},e.prototype.setSearchBox=function(e){if(t.isNullOrUndefined(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var i=!1;return t.Browser.isDevice&&(i=!0,this.parent.mobFilter=!1),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:i?["e-input-group-icon e-back-icon e-icons","e-input-group-icon e-clear-icon e-icons"]:["e-input-group-icon e-clear-icon e-icons"],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),t.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],this.parent.filterParent),t.prepend([this.parent.filterParent],e.popupElement),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.parent.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector(".e-clear-icon"),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),t.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),t.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),t.removeClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshPopup(),this.parent.refreshListItems(null),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),this.setReorder(e),e.preventDefault()},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector(".e-clear-icon"),this.clearIconElement.style.visibility="hidden",t.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),t.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,i=0;this.checkAllParent&&(i=this.checkAllParent.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-i+"px",this.parent.list.style.height=window.innerHeight-e-i+"px";var s=this.filterInput.parentElement.querySelector(".e-clear-icon");t.detach(this.filterInput),s.parentElement.insertBefore(this.filterInput,s)},e.prototype.setPopupFullScreen=function(){t.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%"},e.prototype.targetElement=function(){return t.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlur=function(e){if(!this.parent.element.classList.contains("e-listbox")){var i=void 0;if(this.parent.keyAction)return;if(t.Browser.isIE&&(i=!t.isNullOrUndefined(e)&&e.target),t.Browser.isIE||(i=!t.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(i)&&!t.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!t.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var i=e.target;!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(k.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlur(e,!0),this.parent.focused=!0),this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(t.Browser.isIE?this.parent.onBlur():this.parent.onBlur(e)),this.filterInput===i&&this.filterInput.focus()}},e.prototype.getFocus=function(e){if(this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value)return void(this.parent.keyAction=!1);"focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),t.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden")},e.prototype.checkSelectAll=function(e){"check"===e.value&&"true"!==this.checkAllParent.getAttribute("aria-checked")&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var i=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var s=t.compile(i),l=e?"unSelectAllText":"selectAllText",o=0,r=s({},this.parent,l,null,!this.parent.isStringTemplate);o<r.length;o++){var n=r[o];this.selectAllSpan.textContent=n.textContent}}else{var a={selectAllText:"Select All",unSelectAllText:"Unselect All"},h=new t.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===h.getConstant("selectAllText")&&(h=new t.L10n("dropdowns",a,this.parent.locale)),this.selectAllSpan.textContent=e?h.getConstant("unSelectAllText"):h.getConstant("selectAllText")}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!t.isNullOrUndefined(this.parent.value)){var i=this.parent.ulElement.querySelectorAll("li.e-active").length,s=void 0,l=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});i>0&&(t.append(this.parent.ulElement.querySelectorAll("li.e-active"),l),s=this.parent.ulElement.querySelectorAll("li.e-active"),t.addClass(s,"e-reorder-hide"),t.prepend([l],this.parent.list)),this.parent.focusAtFirstListItem()}},e}(),ue=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ce=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property("Multiple")],i.prototype,"mode",void 0),ce([t.Property(!1)],i.prototype,"showCheckbox",void 0),ce([t.Property(!1)],i.prototype,"showSelectAll",void 0),ce([t.Property("Left")],i.prototype,"checkboxPosition",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property([])],i.prototype,"items",void 0),ce([t.Property("Right")],i.prototype,"position",void 0),i}(t.ChildProperty),fe=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}ue(n,e),a=n,n.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.render=function(){this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,t.isBlazor()&&this.isServerRendered?(this.list=this.element.parentElement,this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.setSelection(this.value),this.allowFiltering&&this.setFiltering(),this.initToolbarAndStyles(),this.updateSelectionSettings(),this.wireEvents(),this.initDraggable(),this.initLoad=!1):e.prototype.render.call(this),this.renderComplete()},n.prototype.updateBlazorListData=function(e,i,l){i&&(this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.allowDragAndDrop&&!this.ulElement.classList.contains("e-sortable")&&this.initDraggable(),l&&this.selectItems(this.listData,!1)),t.isNullOrUndefined(e)||(this.sortedData=this.jsonData=this.listData=e)},n.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});this.list.classList.add("e-listbox-wrapper"),this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(k.focus),this.itemTemplate&&this.renderReactTemplates(),t.removeClass([this.list],[k.content,k.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),t.attributes(this.list,{role:"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},n.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{})}},n.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new s.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",dragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var o=e.getItems()[0];return i.style.width=o.offsetWidth+"px",i.style.height=o.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=l.getZindexPartial(e.element)+"",i}})},n.prototype.updateActionCompleteData=function(e,t){this.jsonData.push(t)},n.prototype.initToolbar=function(){var e=this.toolbarSettings.position,i=this.element.getAttribute("data-value");if(this.toolbarSettings.items.length){var s=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),l=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(l,this.list),l.appendChild("Right"===e?this.list:s),l.appendChild("Right"===e?s:this.list),this.createButtons(s),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var o=this.element.getAttribute("data-value");i&&o&&i!==o?(this.tBListBox=t.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):o&&(this.tBListBox=t.getComponent(document.getElementById(o),this.getModuleName()),this.tBListBox.updateToolBarState())},n.prototype.createButtons=function(e){var i,s,l,o=this,n=new t.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(t){l=n.getConstant(t),s=o.createElement("button",{attrs:{type:"button","data-value":t,title:l,"aria-label":l}}),e.appendChild(s),(i=new r.Button({iconCss:"e-icons e-"+t.toLowerCase()},s)).createElement=o.createElement})},n.prototype.validationAttribute=function(t,i){e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},n.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=t.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?t.addClass([this.list],"e-filter-list"):t.removeClass([this.list],"e-filter-list")},n.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&t.addClass([e],"e-rtl")},n.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?t.removeClass([e],s.cssClass.disabled):(t.addClass([e],s.cssClass.disabled),t.isBlazor()&&this.isServerRendered&&this.toolbarSettings.items.length&&t.removeClass([this.list],s.cssClass.disabled))},n.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=t.formatUnit(this.height),this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),l.createSpinner({target:this.spinner},this.createElement),l.showSpinner(this.spinner)},n.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&l.hideSpinner(this.spinner),this.spinner.parentElement&&t.detach(this.spinner)},n.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},n.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},n.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+ve.clearIcon)&&(this.filterInput.parentElement.querySelector("."+ve.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},n.prototype.onActionComplete=function(i,s,l){var o;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(o=t.isBlazor()&&this.isServerRendered?this.list.getElementsByClassName("e-filter-parent")[0]:this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===s.length){var r=i.getElementsByClassName("e-list-nrt")[0];r&&i.removeChild(r)}if(e.prototype.onActionComplete.call(this,i,s,l),this.allowFiltering&&!t.isNullOrUndefined(o)&&(this.list.insertBefore(o,this.list.firstElementChild),t.isBlazor()||this.isServerRendered||(this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(o))),this.initWrapper(),this.setSelection(),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],t.extend(this.jsonData,s,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],t.extend(this.jsonData,s,[]),this.isDataSourceUpdate=!1),this.allowFiltering){var n=this.list.getElementsByClassName("e-input-filter")[0],a=this.filterInput.value.length;n.selectionStart=a,n.selectionEnd=a,n.focus()}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!t.isNullOrUndefined(l)){var h=this.scope.replace("#","");t.getComponent(document.getElementById(h),this.getModuleName()).initToolbar()}this.initLoad=!1},n.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},n.prototype.triggerDragStart=function(e){var i,s=this;e=t.extend(this.getDragArgs(e),{dragSelected:!0}),t.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",e,function(l){s.allowDragAll=l.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&t.detach(i),t.isBlazor()&&e.bindEvents(e.dragElement)})},n.prototype.triggerDrag=function(e){this.trigger("drag",this.getDragArgs(e));var t=this.getComponent(e.target);if(t&&0===t.listData.length){var i=t.ulElement.getElementsByClassName("e-list-nrt")[0];i&&t.ulElement.removeChild(i)}},n.prototype.beforeDragEnd=function(e){var t=this.getFormattedValue(e.droppedElement.getAttribute("data-value"));this.value.indexOf(t)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([t]),this.trigger("beforeDrop",e)},n.prototype.dragEnd=function(e){var i,l,o,r,n,a,h=this,p=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),u=this.getComponent(e.droppedElement),c=this.getDragArgs({target:e.droppedElement},!0),d={previousData:this.dataSource},m={previousData:u.dataSource},f=t.extend({},c,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(u!==this){T=t.extend(d,{currentData:this.listData});f=t.extend(f,{source:T,destination:m})}if(t.Browser.isIos&&(this.list.style.overflow=""),u===this){var v=this.ulElement;i=[].slice.call(this.listData),l=[].slice.call(this.liCollections),o=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData);var y=e.currentIndex,g=e.currentIndex=this.getCurIdx(this,e.currentIndex),C=i.indexOf(this.getDataByValue(p)),b=o.indexOf(this.getDataByValue(p)),S=a.indexOf(this.getDataByValue(p));if(i.splice(g,0,i.splice(C,1)[0]),a.splice(y,0,a.splice(S,1)[0]),o.splice(g,0,o.splice(b,1)[0]),t.isBlazor()||l.splice(g,0,l.splice(C,1)[0]),this.allowDragAll&&(n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1?this.value:[p]).forEach(function(r){if(r!==p){var n=i.indexOf(h.getDataByValue(r)),u=o.indexOf(h.getDataByValue(r)),c=a.indexOf(h.getDataByValue(r));n>g&&g++,o.splice(g,0,o.splice(u,1)[0]),i.splice(g,0,i.splice(n,1)[0]),a.splice(y,0,a.splice(c,1)[0]),t.isBlazor()||(l.splice(g,0,l.splice(n,1)[0]),v.insertBefore(h.getItems()[h.getIndexByValue(r)],v.getElementsByClassName("e-placeholder")[0]))}else if(t.isBlazor()){var d=[].slice.call(h.ulElement.getElementsByClassName(s.cssClass.li)),m=h.ulElement.removeChild(d[e.currentIndex]);d.splice(e.currentIndex,1),h.ulElement.insertBefore(m,d[e.previousIndex])}}),this.listData=i,this.jsonData=o,this.sortedData=a,this.liCollections=l,t.isBlazor()){var E=this.value;this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateBlazorListData(null,!0),h.selectItems(h.listData,!1),h.selectItems(E)})}}else{var x,w=[].slice.call(this.liCollections),O=e.currentIndex=this.getCurIdx(u,e.currentIndex),A=u.ulElement;i=[].slice.call(u.listData),l=[].slice.call(u.liCollections),o=[].slice.call(u.jsonData),a=[].slice.call(u.sortedData),n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1&&this.allowDragAll?this.value:[p];var k=[].slice.call(this.listData),B=[].slice.call(this.sortedData);if(n.forEach(function(n,u){r=h.getDataByValue(n);var c=h.listData.indexOf(r),d=h.jsonData.indexOf(r),m=h.sortedData.indexOf(r);k.splice(c,1),h.jsonData.splice(d,1),B.splice(m,1),h.listData=k,h.sortedData=B;var f=n===p?e.currentIndex:O;if(i.splice(f,0,r),o.splice(f,0,r),a.splice(f,0,r),t.isBlazor()||l.splice(f,0,w.splice(c,1)[0]),n)x=h.getItems()[h.getIndexByValue(n)];else for(var v=h.getItems(),y=0;y<v.length;y++)if(null===v[y].getAttribute("data-value")&&v[y].classList.contains("e-list-item")){x=v[y];break}x||(x=e.helper),h.removeSelected(h,n===p?[e.droppedElement]:[x]),t.isBlazor()?0===u&&h.ulElement.insertBefore(A.getElementsByClassName(s.cssClass.li)[e.currentIndex],h.ulElement.getElementsByClassName(s.cssClass.li)[e.previousIndex]):A.insertBefore(x,A.getElementsByClassName("e-placeholder")[0]),O++}),t.isBlazor())this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateSelectedOptions(),h.fields.groupBy&&h.setSelection(),h.updateBlazorListData(null,!0,null==h.value||!h.value.length)}),u.interopAdaptor.invokeMethodAsync("UpdateListData",i).then(function(){("None"!==u.sortOrder||h.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy)&&u.setSelection(),u.updateBlazorListData(null,!0,null==u.value||!u.value.length)});else{if(this.fields.groupBy&&(this.ulElement.innerHTML=this.renderItems(this.listData,this.fields).innerHTML,this.setSelection()),"None"!==u.sortOrder||this.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy||u.itemTemplate||this.itemTemplate){var D=t.getComponent(A,"sortable");A.innerHTML=u.renderItems(i,u.fields).innerHTML,D.placeHolderElement&&A.appendChild(D.placeHolderElement),A.appendChild(e.helper),u.setSelection()}this.liCollections=w,u.liCollections=l}u.jsonData=t.extend([],[],o,!1),u.listData=t.extend([],[],i,!1),u.sortedData=t.extend([],[],a,!1),0===this.listData.length&&this.l10nUpdate()}if(this===u){var T=t.extend(d,{currentData:i});f=t.extend(f,{source:T})}else{var I=t.extend(m,{currentData:i});f=t.extend(f,{destination:I})}this.trigger("drop",f)},n.prototype.removeSelected=function(e,i){e.selectionSettings.showCheckbox?i.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):t.removeClass(i,s.cssClass.selected)},n.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter(function(e){return e.classList.contains(s.cssClass.group)}).length),t},n.prototype.getComponent=function(e){var i,s="EJS-LISTBOX"===this.element.tagName?t.closest(e,".e-listbox"):t.closest(e,".e-listbox-wrapper")&&t.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return s&&(i=t.getComponent(s,this.getModuleName())),i},n.prototype.listOption=function(i,s){return this.listCurrentOptions=e.prototype.listOption.call(this,i,s),this.listCurrentOptions=t.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},n.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},n.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},n.prototype.enableItems=function(e,i,l){var o=this;void 0===i&&(i=!0);var r;e.forEach(function(e){var n;if(t.isBlazor()&&"object"==typeof e){if(n=t.getValue(l?o.fields.value:o.fields.text,e),t.isNullOrUndefined(n))return}else n=e;(r=o.findListElement(o.list,"li","data-value",l?n:o.getValueByText(n)))&&(i?(t.removeClass([r],s.cssClass.disabled),r.removeAttribute("aria-disabled")):(t.addClass([r],s.cssClass.disabled),r.setAttribute("aria-disabled","true")))})},n.prototype.selectItems=function(e,t,i){void 0===t&&(t=!0),this.setSelection(e,t,!i),this.updateSelectedOptions()},n.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},n.prototype.addItems=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.removeItems=function(e,t){this.removeItem(e,t)},n.prototype.removeItem=function(e,i){var s=[],l=this.list.querySelectorAll("."+k.li);if(e){e=e instanceof Array?e:[e];var o=this.fields,r=void 0,n=[],a=void 0;t.extend(n,[],this.listData);for(var h=[],p=[],u=0;u<e.length;u++){r=e[u]instanceof Object?t.getValue(o.value,e[u]):e[u].toString();for(var c=0,d=n.length;c<d;c++)(n[c]instanceof Object?t.getValue(o.value,n[c]):n[c].toString())===r&&(a=this.getIndexByValue(r),s.push(l[a]),h.push(c),p.push(a))}for(m=h.length-1;m>=0;m--)this.listData.splice(h[m],1);for(var m=p.length-1;m>=0;m--)this.updateLiCollection(p[m])}else i=i||0,s.push(l[i]),this.listData.splice(i,1),this.updateLiCollection(i);for(c=0;c<s.length;c++)this.ulElement.removeChild(s[c]);0===this.listData.length&&this.l10nUpdate()},n.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},n.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},n.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},n.prototype.moveTo=function(e,i,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),o=s?t.getComponent(s,a):this.getScopedListBox();this.moveData(this,o,!1,l,i)},n.prototype.moveAllTo=function(e,i){if(this.listData.length>0){var s=e?t.getComponent(e,a):this.getScopedListBox();this.moveAllData(this,s,!1,i)}},n.prototype.getDataList=function(){return this.jsonData},n.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},n.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},n.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},n.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach(function(t){if(!t.classList.contains(s.cssClass.disabled))if(i.selectionSettings.showCheckbox){var l=t.getElementsByClassName("e-check")[0];(!l&&e||l&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(s.cssClass.selected):t.classList.remove(s.cssClass.selected)}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),o=0;if(e){var r=this;for(o=0;o<l.length;o++)!function(){var e=r.getFormattedValue(l[o].getAttribute("data-value"));r.value.some(function(t){return t===e})||r.value.push(r.getFormattedValue(l[o].getAttribute("data-value")))}()}else{var n=this;for(o=0;o<l.length;o++)!function(){var e=n.getFormattedValue(l[o].getAttribute("data-value"));n.value=n.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},n.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s){var l=0,o=0,r=0;for(l;l<i;){if(this.value)for(o;o<this.value.length;o++)e[l].getAttribute("data-value")===this.value[o]&&r++;!r&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&r&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,r=0,o=0}}},n.prototype.wireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.add(this.list,"click",this.clickHandler,this),t.EventHandler.add(i,"keydown",this.keyDownHandler,this),t.EventHandler.add(i,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&t.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&t.EventHandler.add(e,"reset",this.formResetHandler,this)},n.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&t.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},n.prototype.unwireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.remove(this.list,"click",this.clickHandler),t.EventHandler.remove(i,"keydown",this.keyDownHandler),t.EventHandler.remove(i,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&t.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&t.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&t.EventHandler.remove(e,"reset",this.formResetHandler)},n.prototype.clickHandler=function(e){this.selectHandler(e)},n.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+k.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},n.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new i.Query;if(this.allowFiltering){var s=""===this.inputString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},n.prototype.setFiltering=function(){var e;if(this.initLoad||t.isNullOrUndefined(this.filterParent))return t.isBlazor()&&this.isServerRendered?(this.filterParent=this.list.querySelector(".e-filter-parent"),this.filterInput=this.list.querySelector(".e-input-filter")):(this.filterParent=this.createElement("span",{className:ve.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:ve.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=o.Input.createInput({element:this.filterInput,buttons:[ve.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.append([e.container],this.filterParent),t.prepend([this.filterParent],this.list),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),this.height.toString().indexOf("%")<0&&t.addClass([this.list],"e-filter-list"),this.inputString=this.filterInput.value,this.filterWireEvents(),e},n.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+ve.clearIcon),this.clearFilterIconElem&&(t.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},n.prototype.selectHandler=function(e,i){var l,o=!0,r=t.closest(e.target,".e-list-item"),n=[r];if(r&&r.parentElement){if(l=[].slice.call(r.parentElement.children).indexOf(r),this.selectionSettings.showCheckbox?o=!r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||t.Browser.isDevice)&&this.isSelected(r)?(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"),o=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||t.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),t.removeClass(this.getSelectedItems(),s.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?n=[].slice.call(r.parentElement.children).slice(Math.min(l,this.prevSelIdx),Math.max(l,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(r.parentElement.children).indexOf(r),o&&(this.selectionSettings.showCheckbox||t.addClass(n,s.cssClass.selected),n.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",r.id)),i||!(this.maximumSelectionLength>(this.value&&this.value.length))&&o||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&o||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:r,e:e,module:"listbox"}),this.allowFiltering&&!i){var a=this.getFormattedValue(r.getAttribute("data-value"));if(o){var h=[];t.extend(h,this.value),h.push(a),this.value=h}else this.value=this.value.filter(function(e){return e!==a});document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.checkMaxSelection()}},n.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},n.prototype.getDataByElems=function(e){for(var t=[],i=0,s=e.length;i<s;i++)t.push(this.getDataByValue(this.getFormattedValue(e[i].getAttribute("data-value"))));return t},n.prototype.getDataByElements=function(e){var i,s=[],l=0;if(!t.isNullOrUndefined(this.listData)){var o=this.typeOfData(this.listData).typeof;if("string"===o||"number"===o||"boolean"===o)for(var r=0,n=this.listData;r<n.length;r++){for(var a=n[r],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&a===i){l=h,s.push(a);break}if(e.length===s.length)break}else for(var u=0,c=this.listData;u<c.length;u++){for(var a=c[u],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&t.getValue(this.fields.value?this.fields.value:"value",a)===i){l=h,s.push(a);break}if(e.length===s.length)break}return s}return null},n.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox){var t=0,i=this.list.getElementsByClassName("e-list-item");for(t;t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))}},n.prototype.toolbarClickHandler=function(e){var i=t.closest(e.target,"button");if(i){if(this.toolbarAction=i.getAttribute("data-value"),i.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},n.prototype.moveUpDown=function(e,t,i){var l=this,o=this.getSelectedItems();if(i&&(o=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var r=this.getDataByElems(o),n={cancel:!1,items:r,eventName:this.toolbarAction};this.trigger("actionBegin",n),n.cancel||((e?o:o.reverse()).forEach(function(t){var i=Array.prototype.indexOf.call(l.ulElement.querySelectorAll(".e-list-item"),t),o=Array.prototype.indexOf.call(l.ulElement.children,t);s.moveTo(l.ulElement,l.ulElement,[o],e?o-1:o+2),l.changeData(o,e?o-1:o+1,e?i-1:i+1,t)}),this.trigger("actionComplete",{items:r,eventName:this.toolbarAction}),o[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},n.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},n.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},n.prototype.moveData=function(e,i,l,o,r){var n=this,a=[],h=[],p=[],u=[],c=[].slice.call(e.listData),d=[].slice.call(i.listData),m=[].slice.call(e.sortedData),f=[].slice.call(i.sortedData),v=[].slice.call(e.liCollections),y=[],g=[].slice.call(i.liCollections),C=[],b=[],S=e.getSelectedItems();o&&(S=o);var E="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;if(e.value=[],S.length){this.removeSelected(e,S),S.forEach(function(t){a.push(Array.prototype.indexOf.call(e.ulElement.children,t)),y.push(Array.prototype.indexOf.call(e.ulElement.querySelectorAll(".e-list-item"),t)),h.push(Array.prototype.indexOf.call(e.listData,e.getDataByElems([t])[0])),u.push(Array.prototype.indexOf.call(e.sortedData,e.getDataByElems([t])[0])),p.push(Array.prototype.indexOf.call(e.jsonData,e.getDataByElems([t])[0]))}),"None"!==this.sortOrder?u.forEach(function(t){C.push(e.sortedData[t])}):p.forEach(function(t){C.push(e.jsonData[t])});var x={cancel:!1,items:C,eventName:this.toolbarAction};if(e.trigger("actionBegin",x),x.cancel)return;if(!t.isBlazor()){var w=[];if(y.sort(function(e,t){return e-t}).reverse().forEach(function(e){w.push(v.splice(e,1)[0])}),e.liCollections=v,r){var O=g.splice(0,r);i.liCollections=O.concat(w.reverse()).concat(g)}else i.liCollections=g.concat(w.reverse());if(0===i.listData.length){var A=i.ulElement.getElementsByClassName("e-list-nrt")[0];A&&i.ulElement.removeChild(A)}}h.sort(function(e,t){return t-e}).forEach(function(e){c.splice(e,1)[0]}),u.sort(function(e,t){return t-e}).forEach(function(e){m.splice(e,1)[0]}),p.slice().reverse().forEach(function(t){b.push(e.jsonData.splice(t,1)[0])}),t.isBlazor()||(E?e.fields.groupBy?e.ulElement.innerHTML=e.renderItems(c,e.fields).innerHTML:S.forEach(function(e){t.detach(e)}):(s.moveTo(e.ulElement,i.ulElement,a,r),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),i.mainList.childElementCount!==i.jsonData.length&&(i.mainList=i.ulElement),e.updateMainList());var k=[].slice.call(i.jsonData);f=[].slice.call(i.sortedData),t.isBlazor()||this.selectNextList(S,y,h,e),l&&this.list.focus(),e.listData=c,e.sortedData=m,r=r||d.length;for(var B=C.length-1;B>=0;B--)d.splice(r,0,C[B]),k.splice(r,0,C[B]),f.splice(r,0,C[B]);i.listData=d,i.jsonData=k,i.sortedData=f,t.isBlazor()?(e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),n.selectNextList(S,y,h,e),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){E&&i.setSelection(),i.updateBlazorListData(null,!0),e.trigger("actionComplete",{items:C,eventName:n.toolbarAction})})):(E&&(i.ulElement.innerHTML=i.renderItems(d,i.fields).innerHTML,i.setSelection(),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value")))},n.prototype.selectNextList=function(e,t,i,l){var o,r,n=l.ulElement.querySelectorAll(".e-list-item").length,a=-1;1===e.length&&n&&!l.selectionSettings.showCheckbox&&(r=n<=t[0]?n-1:t[0],o=l.ulElement.querySelectorAll(".e-list-item")[r],(a=l.getValidIndex(o,r,n===i[0]?38:40))>-1&&l.ulElement.querySelectorAll(".e-list-item")[a].classList.add(s.cssClass.selected))},n.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},n.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},n.prototype.moveAllData=function(e,i,l,o){var r=this,n=[].slice.call(i.listData),a=[].slice.call(i.jsonData),h="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;this.removeSelected(e,e.getSelectedItems());var p=[].slice.call(e.jsonData),u={cancel:!1,items:p,eventName:this.toolbarAction};if(e.trigger("actionBegin",u),!u.cancel){if(!t.isBlazor()){if(0===i.listData.length&&(c=i.ulElement.getElementsByClassName("e-list-nrt")[0])&&i.ulElement.removeChild(c),h){var c=e.ulElement.getElementsByClassName("e-list-nrt")[0];c&&e.ulElement.removeChild(c)}s.moveTo(e.ulElement,i.ulElement,Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number),o),this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})}l&&this.list.focus(),o=o||n.length;for(d=0;d<e.listData.length;d++)n.splice(o+d,0,e.listData[d]);for(var d=0;d<e.jsonData.length;d++)a.splice(o+d,0,e.jsonData[d]);if(!t.isBlazor()){var m=[].slice.call(e.liCollections),f=[].slice.call(i.liCollections);if(e.liCollections=[],o){var v=f.splice(0,o);i.liCollections=v.concat(m).concat(f)}else i.liCollections=f.concat(m)}e.value=[],n=n.filter(function(e){return!0!==e.isHeader}),i.listData=n,i.jsonData=a,e.listData=e.sortedData=e.jsonData=[],t.isBlazor()?(h||(i.sortedData=n),e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){i.updateBlazorListData(null,!0),e.updateSelectedOptions(),e.trigger("actionComplete",{items:p,eventName:r.toolbarAction})})):(h?(i.ulElement.innerHTML=i.renderItems(n,i.fields).innerHTML,this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})):i.sortedData=n,e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}},n.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),o=[].slice.call(this.jsonData),r=[].slice.call(this.sortedData),n=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),a=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),o.splice(i,0,o.splice(n,1)[0]),r.splice(t,0,r.splice(a,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=o,this.liCollections=h,this.sortedData=r},n.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(i){e.push(t.closest(i,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(s.cssClass.selected)),e},n.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(s){t.getComponent(s,i.getModuleName())&&(e=t.getComponent(s,i.getModuleName()))}),e},n.prototype.getGrabbedItems=function(){return Array.prototype.slice.call(this.element.querySelectorAll(".e-grabbed"))},n.prototype.getDragArgs=function(e,i){var s=this.getGrabbedItems();return s.length?i&&s.push(e.target):s=[e.target],t.isBlazor()?{elements:s,items:this.getDataByElems(s),bindEvents:e.bindEvents,dragElement:e.dragElement}:{elements:s,items:this.getDataByElems(s)}},n.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},n.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&!this.allowFiltering){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},n.prototype.upDownKeyHandler=function(e){var i=this.ulElement,l=40===e.keyCode||36===e.keyCode?0:i.childElementCount-1,o=i.getElementsByClassName("e-focused")[0]||i.getElementsByClassName(s.cssClass.selected)[0];if(o){if(35!==e.keyCode&&36!==e.keyCode&&(l=Array.prototype.indexOf.call(i.children,o),40===e.keyCode?l++:l--,l<0||l>i.childElementCount-1))return;t.removeClass([o],"e-focused")}var r=i.children[l];if(r){if(-1===(l=this.getValidIndex(r,l,e.keyCode)))return void t.addClass([o],"e-focused");i.children[l].focus(),i.children[l].classList.add("e-focused"),e.ctrlKey||this.selectHandler({target:i.children[l],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0)}},n.prototype.KeyUp=function(e){var s=this,l=String.fromCharCode(e.keyCode).match(/\w/);if(t.isNullOrUndefined(l)||(this.isValidKey=!0),this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){s.isDataFetched=!1,e.cancel||""!==s.filterInput.value&&s.isFiltered||(e.cancel||s.isCustomFiltering||e.preventDefaultAction||(s.inputString=s.filterInput.value,s.filteringAction(s.jsonData,new i.Query,s.fields)),s.isFiltered||s.isCustomFiltering||e.preventDefaultAction||s.dataUpdater(s.jsonData,new i.Query,s.fields))})}},n.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},n.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},n.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],this.targetInputElement.value},n.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;if(""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},n.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},n.prototype.getValidIndex=function(e,t,i){var l=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===l.childElementCount?-1:(((e=l.querySelectorAll(".e-list-item")[t]).classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},n.prototype.updateSelectedOptions=function(){var e=this,i=[],s=[];if(t.extend(s,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var l=0;l<i.length;l++)s.indexOf(i[l])>-1||s.push(i[l]);this.setProperties({value:s},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},n.prototype.clearSelection=function(e){var t=this;if(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox){var i;this.getSelectedItems().forEach(function(s){i=t.getFormattedValue(s.getAttribute("data-value")),e.indexOf(i)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.getElementsByClassName("e-checkbox-wrapper")[0].removeAttribute("aria-checked"),s.removeAttribute("aria-selected"))})}},n.prototype.setSelection=function(e,i,l){var o=this;void 0===e&&(e=this.value),void 0===i&&(i=!0),void 0===l&&(l=!1);var r,n;e&&e.forEach(function(e){var a;if(l)if(t.isBlazor()&&"object"==typeof e){if(a=e[o.fields.text||"text"],t.isNullOrUndefined(a))return;a=o.getValueByText(a)}else a=o.getValueByText(e);else a=e;(r=o.list.querySelector('[data-value="'+a+'"]'))&&(n=o.selectionSettings.showCheckbox?r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):r.classList.contains("e-selected"),(!i&&n||i&&!n&&r)&&(o.selectionSettings.showCheckbox?o.notify("updatelist",{li:r,module:"listbox"}):i?(r.classList.add(s.cssClass.selected),r.setAttribute("aria-selected","true")):(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"))))}),this.updateSelectTag()},n.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+='<option selected value="'+this.value[i]+'"></option>';e.innerHTML+=t}this.checkSelectAll()},n.prototype.checkDisabledState=function(e){return 0===e.ulElement.querySelectorAll("."+s.cssClass.li).length},n.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach(function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}})}},n.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},n.prototype.showCheckbox=function(e){var i=0,s=this.list.lastElementChild.querySelectorAll("li"),l=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(t.isBlazor()||(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement)),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var o=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=o.getConstant("selectAllText"),this.unSelectAllText=o.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else if(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]),!t.isBlazor()){for(i;i<l;i++)s[i].classList.contains("e-list-item")&&s[i].removeChild(s[i].getElementsByClassName("e-checkbox-wrapper")[0]),s[i].hasAttribute("aria-selected")&&s[i].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},n.prototype.isSelected=function(e){return!t.isNullOrUndefined(e)&&(e.classList.contains(s.cssClass.selected)||null!==e.querySelector(".e-check"))},n.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},n.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},n.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},n.prototype.getModuleName=function(){return"listbox"},n.prototype.getPersistData=function(){return this.addOnPersist(["value"])},n.prototype.getLocaleName=function(){return"listbox"},n.prototype.destroy=function(){this.itemTemplate&&t.resetBlazorTemplate(this.element.id+"ItemTemplate","ItemTemplate"),this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),t.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&e.prototype.destroy.call(this),this.itemTemplate&&this.clearTemplate()},n.prototype.onPropertyChanged=function(i,l){var r=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,i,l),this.setUpdateInitial(["fields","query","dataSource"],i);for(var n=0,a=Object.keys(i);n<a.length;n++)switch(a[n]){case"cssClass":l.cssClass&&t.removeClass([r],l.cssClass.split(" ")),i.cssClass&&t.addClass([r],i.cssClass.split(" "));break;case"enableRtl":i.enableRtl?r.classList.add("e-rtl"):r.classList.remove("e-rtl");break;case"value":t.removeClass(this.list.querySelectorAll("."+s.cssClass.selected),s.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":i.allowDragAndDrop?this.initDraggable():t.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,t.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&o.Input.setPlaceholder(i.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(t.getComponent(this.ulElement,"sortable").scope=i.scope),this.toolbarSettings.items.length&&(l.scope&&(t.getComponent(document.querySelector(l.scope),this.getModuleName()).tBListBox=null),i.scope&&(t.getComponent(document.querySelector(i.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var h=void 0,p=i.toolbarSettings.position,u=this.getToolElem();p&&(t.removeClass([r],["e-right","e-left"]),r.classList.add("e-"+p.toLowerCase()),"Left"===p?r.insertBefore(u,this.list):r.appendChild(u)),i.toolbarSettings.items&&(l.toolbarSettings.items.length&&((h=this.list.parentElement).parentElement.insertBefore(this.list,h),t.detach(h)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var c=i.selectionSettings.showSelectAll,d=i.selectionSettings.showCheckbox;if(!t.isNullOrUndefined(c)){if(this.showSelectAll=c,this.showSelectAll){var m=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=m.getConstant("selectAllText"),this.unSelectAllText=m.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}t.isNullOrUndefined(d)||this.showCheckbox(d),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}};var a;return ce([t.Property("")],n.prototype,"cssClass",void 0),ce([t.Property([])],n.prototype,"value",void 0),ce([t.Property("")],n.prototype,"height",void 0),ce([t.Property(!1)],n.prototype,"allowDragAndDrop",void 0),ce([t.Property(1e3)],n.prototype,"maximumSelectionLength",void 0),ce([t.Property(!1)],n.prototype,"allowFiltering",void 0),ce([t.Property("")],n.prototype,"scope",void 0),ce([t.Property(!0)],n.prototype,"ignoreCase",void 0),ce([t.Property(null)],n.prototype,"filterBarPlaceholder",void 0),ce([t.Event()],n.prototype,"beforeItemRender",void 0),ce([t.Event()],n.prototype,"filtering",void 0),ce([t.Event()],n.prototype,"select",void 0),ce([t.Event()],n.prototype,"change",void 0),ce([t.Event()],n.prototype,"beforeDrop",void 0),ce([t.Event()],n.prototype,"dragStart",void 0),ce([t.Event()],n.prototype,"drag",void 0),ce([t.Event()],n.prototype,"drop",void 0),ce([t.Event()],n.prototype,"dataBound",void 0),ce([t.Property(null)],n.prototype,"groupTemplate",void 0),ce([t.Property("No records found")],n.prototype,"noRecordsTemplate",void 0),ce([t.Property("Request failed")],n.prototype,"actionFailureTemplate",void 0),ce([t.Property(1e3)],n.prototype,"zIndex",void 0),ce([t.Property(!1)],n.prototype,"ignoreAccent",void 0),ce([t.Complex({},me)],n.prototype,"toolbarSettings",void 0),ce([t.Complex({},de)],n.prototype,"selectionSettings",void 0),n=a=ce([t.NotifyPropertyChanges],n)}(B),ve={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"};return he.Inject(pe),fe.Inject(pe),e.incrementalSearch=a,e.Search=h,e.highlightSearch=p,e.revertHighlightSearch=c,e.FieldSettings=A,e.dropDownBaseClasses=k,e.DropDownBase=B,e.dropDownListClasses=I,e.DropDownList=N,e.Fields=z,e.TreeSettings=K,e.DropDownTree=_,e.ComboBox=X,e.AutoComplete=Z,e.MultiSelect=he,e.CheckBoxSelection=pe,e.createFloatLabel=d,e.updateFloatLabelState=m,e.removeFloating=f,e.setPlaceHolder=v,e.floatLabelFocus=y,e.floatLabelBlur=g,e.SelectionSettings=de,e.ToolbarSettings=me,e.ListBox=fe,e}({},ej.base,ej.data,ej.lists,ej.popups,ej.inputs,ej.buttons,ej.navigations),this.ejs=ej;
- /*!
- * filename: ej2-spreadsheet.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.spreadsheet=function(e,t,r,n,i,a,o,s,l,h,d,p){"use strict";function c(e){var t,r=[];return e=e.indexOf("!")>-1?e.split("!")[1]:e,(e=-1===e.indexOf(":")?e+":"+e:e).split(":").forEach(function(e){t=u(e),r.push(t[0]),r.push(t[1])}),r}function u(e){return[parseInt(e.match(/\d+/)[0],10)-1,f(e.match(/[A-Z]+/i)[0].toUpperCase())]}function f(e){for(var t=0,r=(e=e.split("").reverse().join("")).length-1;r>=0;r--)t+=(e[r].charCodeAt(0)-64)*Math.pow(26,r);return t-1}function g(e,t){return v(t+1)+(e+1)}function m(e){return g(e[0],e[1])+":"+(t.isNullOrUndefined(e[2])?g(e[0],e[1]):g(e[2],e[3]))}function v(e){return e/26>1?v(e%26==0?e/26-1:Math.floor(e/26))+String.fromCharCode(e%26==0?"Z".charCodeAt(0):64+e%26):String.fromCharCode(64+e)}function y(e){return c(C(e))}function C(e){return e.split("!")[1]||e}function b(e){return e.name+"!"+e.selectedRange}function x(e,t){var r;return r=t.indexOf("!")>-1?se(e,he(t)):e.activeSheetIndex,{sheetIndex:r,indices:y(t)}}function S(e){var t=e.slice();return e[0]>e[2]&&w(t,0,2),e[1]>e[3]&&w(t,1,3),t}function w(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function I(e){return e[0]===e[2]&&e[1]===e[3]}function E(e,t,r,n,i){return new kt(e,t,r,n,i)}function R(e){var t=e.toString();if(e===parseInt(t,10))return parseInt(t,10)+" ";var r=t.indexOf(".")>-1?t.split(".")[1]:0,n=Math.pow(10,r.toString().replace("-","").length),i=Math.abs(k(r,n));return r/i+"/"+n/i}function k(e,t){return e=Number(e),t=Number(t),t?k(t,e%t):e}function A(e){(e=(e=Number(e))>0&&e<1?1+e:0===e?1:e)>60&&(e-=1);var t=new Date("01/01/1900"),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return new Date(new Date(864e5*(e-1)+r).toUTCString().replace(" GMT",""))}function T(e,t,r){var n=new Date("01/01/1900"),i=F(e)?e:new Date(e),a=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),o=(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())-a)/864e5;return(t?o:parseInt(o.toString(),10))+(r?0:o>60?2:1)}function F(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function L(e){return e-parseFloat(e)>=0}function N(e,r,n,i){var a=t.IntlBase.getDependables(t.cldrData,n,null).dateObject,o=a.dateTimeFormats.availableFormats,s={dateObj:null,isCustom:!1,type:""};if("string"==typeof e&&(e=e.toUpperCase()),i&&(s.dateObj=r.parseDate(e,{format:i}),s.dateObj&&(s.type=e.toString().indexOf(":")>-1?"time":"datetime",s.isCustom=!0)),t.isNullOrUndefined(s.dateObj)){for(var l=0,h=Object.keys(a.dateFormats);l<h.length;l++){f=h[l];if(s.dateObj=r.parseDate(e,{format:a.dateFormats[f],skeleton:f}),s.dateObj){s.type="date",s.isCustom=!1;break}}if(t.isNullOrUndefined(s.dateObj))for(var d=0,p=Object.keys(o);d<p.length;d++){f=p[d];if(s.dateObj=r.parseDate(e,{format:o[f],skeleton:f}),s.dateObj){if(s.type=e.toString().indexOf(":")>-1?"time":"datetime","time"===s.type){g=s.dateObj.toLocaleTimeString();s.dateObj=new Date("01/01/1900 "+g)}s.isCustom=!0;break}}if(t.isNullOrUndefined(s.dateObj))for(var c=0,u=Object.keys(a.timeFormats);c<u.length;c++){var f=u[c];if(s.dateObj=r.parseDate(e,{format:a.timeFormats[f],skeleton:f}),s.dateObj){var g=s.dateObj.toLocaleTimeString();s.dateObj=new Date("01/01/1900 "+g),s.type="time",s.isCustom=!1;break}}}return"#DIV/0!"===e||s.dateObj||"Invalid Date"===new Date(e).toString()||(s.dateObj=new Date(e)),s}function D(e){return e&&/^\d*\.?\d*$/.test(e)?parseFloat(e):e}function O(e){var t="General";switch(e.split(" ").join("")){case"Number":t="0.00";break;case"Currency":t="$#,##0.00";break;case"Accounting":t='_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';break;case"ShortDate":t="mm-dd-yyyy";break;case"LongDate":t="dddd, mmmm dd, yyyy";break;case"Time":t="h:mm:ss AM/PM";break;case"Percentage":t="0.00%";break;case"Fraction":t="# ?/?";break;case"Scientific":t="0.00E+00";break;case"Text":t="@"}return t}function H(e){var t="General";switch(e){case"0.00":case'_-* #,##0.00_-;-* #,##0.00_-;_-* "-"_-;_-@_-':case'_-* #,##0_-;-* #,##0_-;_-* "-"_-;_-@_-':t="Number";break;case"$#,##0.00":case"$#,##0_);[Red]($#,##0)":case"$#,##0.00_);[Red]($#,##0.00)":case"$#,##0.00_);($#,##0.00)":case"$#,##0_);($#,##0)":t="Currency";break;case'_($*#,##0.00_);_($*(#,##0.00);_($*"-"??_);_(@_)':case'_($*#,##0.00_);_($* (#,##0.00);_($*"-"??_);_(@_)':case'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)':case'_ $ * #,##0.00_ ;_ $ * -#,##0.00_ ;_ $ * "-"??_ ;_ @_ ':t="Accounting";break;case"mm-dd-yyyy":case"dd-mm-yyyy":case"dd-mm-yy":case"mm-dd-yy":case"dd/MM/yyyy":case"yyyy-MM-dd":t="ShortDate";break;case"dddd, mmmm dd, yyyy":t="LongDate";break;case"h:mm:ss AM/PM":t="Time";break;case"0.00%":case"0%":t="Percentage";break;case"# ?/?":case"# ??/??":case"# ???/???":t="Fraction";break;case"0.00E+00":t="Scientific";break;case"@":t="Text";break;default:e&&e.indexOf("[$")>-1&&(t=e.indexOf("* ")>-1?"Accounting":"Currency")}return t}function B(e){return void 0===e}function M(e){switch(e){case"dd-MMM-yyyy":case"dd MMM yyyy":e="medium";break;case"MMM-yyyy":case"MMM yyyy":e="yMMM";break;case"MM-dd-yyyy":case"dd-MM-yyyy":case"dd-MM-yy":case"MM/dd/yyyy":case"dd/MM/yyyy":case"dd/MM/yy":e="short";break;case"dddd MMMM dd yyyy":case"dd MMMM yyyy":e="long";break;case"d MMMM yyyy":e="yMMMd";break;case"yyyy":e="y";break;case"h:mm":e="Hm";break;case"h:mm tt":e="hm";break;case"h":e="H";break;case"h tt":e="h";break;case"dddd":e="E";break;case"h:mm:ss tt":e="hms";break;case"h:mm:ss":e="Hms";break;case"d":e="d";break;case"d dddd":e="Ed";break;case"M":e="M";break;case"Md":e="Md";break;case"MMM":e="MMM";break;case"ddd MMM d":e="MMMEd";break;case"MMM d":e="MMMd";break;case"M/yyyy":e="yM";break;default:e=""}return e}function P(e){var t=[];return e.includeBasicFormulas&&t.push({member:"basic-formulas",args:[e]}),t}function _(e,r){for(var n=r,i=e.replace(/\[/g,".").replace(/\]/g,"").split("."),a=0;a<i.length&&!t.isUndefined(n);a++)n=n[i[a]];return n}function U(e,r,n){var i,a,o=e.replace(/\[/g,".").replace(/\]/g,"").split("."),s=n||{},l=s,h=o.length;for(i=0;i<h;i++)a=o[i],i+1===h?l[a]=void 0===r?{}:r:t.isNullOrUndefined(l[a])&&(l[a]={}),l=l[a];return s}function V(e){for(var t=[],r=0;e>0&&r<9;){e--;var n="A".charCodeAt(0);t[r]=String.fromCharCode(e%26+n),e=parseInt((e/26).toString(),10),r++}for(var i=[],a=0;a<r;a++)i[r-a-1]=t[a];return i.join("")}function z(e,t){return void 0===t&&(t=[]),t.push({member:"workbookBasic",args:[]}),t.push({member:"workbookAll",args:[]}),t.push({member:"dataBind",args:[e]}),t.push({member:"workbookProtectSheet",args:[e]}),e.allowSave&&t.push({member:"workbookSave",args:[e]}),e.allowOpen&&t.push({member:"workbookOpen",args:[e]}),e.allowEditing&&(t.push({member:"workbookEdit",args:[e]}),t.push({member:"workbookFormula",args:[e]})),e.allowNumberFormatting&&t.push({member:"workbookNumberFormat",args:[e]}),e.allowCellFormatting&&t.push({member:"workbookcellformat",args:[e]}),e.allowSorting&&t.push({member:"workbookSort",args:[e]}),e.allowHyperlink&&t.push({member:"workbookHyperlink",args:[e]}),e.allowFiltering&&t.push({member:"workbookFilter",args:[e]}),e.allowFindAndReplace&&t.push({member:"workbookfindAndReplace",args:[e]}),e.allowInsert&&t.push({member:"workbookinsert",args:[e]}),e.allowDelete&&t.push({member:"workbookdelete",args:[e]}),e.allowDataValidation&&t.push({member:"workbookDataValidation",args:[e]}),e.allowMerge&&t.push({member:"workbookmerge",args:[e]}),e.allowDataValidation&&t.push({member:"workbookConditionalFormatting",args:[e]}),e.allowImage&&t.push({member:"workbookImage",args:[e]}),e.allowChart&&t.push({member:"workbookChart",args:[e]}),t}function q(e,t){return e&&"="===e[0]&&(e.length>1||t)}function j(e){var t=e;if((t=t.split("$").join("")).indexOf(":")>-1){var r=t.split(":");if(K(r[0])&&K(r[1]))return!0}else if(t.indexOf(":")<0&&K(t))return!0;return!1}function W(e){return e.charCodeAt(0)>=65&&e.charCodeAt(0)<=90||e.charCodeAt(0)>=97&&e.charCodeAt(0)<=122}function G(e,t,r){return e&&t>=e[0]&&t<=e[2]&&r>=e[1]&&r<=e[3]}function Y(e,t,r){var n=e[0]<=t[0]&&e[2]>=t[2]&&e[1]<=t[1]&&e[3]>=t[3];if(n)return!0;if(r){if(t[0]<e[0]&&t[2]<e[0]||t[0]>e[2]&&t[2]>e[2])return!1;if(t[0]<e[0]&&t[2]>e[0]&&(t[0]=e[0],n=!0),t[2]>e[2]&&(t[2]=e[2],n=!0),t[1]<e[1]&&t[3]<e[1]||t[1]>e[3]&&t[3]>e[3])return!1;t[1]<e[1]&&t[3]>e[1]&&(t[1]=e[1],n=!0),t[3]>e[3]&&(t[3]=e[3],n=!0)}return n}function X(e,t){return e||(e={}),!!e.isLocked||!1!==e.isLocked&&(!(!t||!t.isLocked)||!(e.isLocked||!t||!1===t.isLocked))}function K(e){for(var t=e,r=0,n=0,i=[89,71,69],a="",o=t.length,s=0;s<o;s++)W(t[s])&&r++;var l=(a=t.substring(0,r)).length;if(l!==o&&l<4&&1!==o&&isNaN(parseInt(t,10))){for(;n<l;){if(!(a[n]&&a[n].charCodeAt(0)<i[n])){if(!a[n]&&n>0)break;return!1}n++}var h=parseFloat(t.substring(r,o));if(h>0&&h<1048577)return!0}return!1}function $(e,t,r,n){var i,a;if(t&&(i=(a=n||J(t[0],t[1],r,!1,!0)).formula?a.formula.toUpperCase():""),i){0===i.indexOf("=")&&(i=i.slice(1));for(var o=["+","-","*","/",">=","<=","<>",">","<","=","%"],s=void 0,l=i=i.split("(").join(",").split(")").join(","),h=0;h<o.length;h++)l=(s=l.split(o[h])).join(",");s=l.split(",");for(var d=[],p=void 0,u=void 0,f=0;f<s.length;f++)if(j(s[f])){var m=c(s[f]),v=[e[0]-(t[0]-m[0]),e[1]-(t[1]-m[1]),e[0]-(t[0]-m[2]),e[1]-(t[1]-m[3])];v[0]<0||v[1]<0||v[2]<0||v[3]<0?p="#REF!":(p=g(v[0],v[1]),s[f].includes(":")&&(p+=":"+g(v[2],v[3])),p=j(p)?p:"#REF!"),(u={})[s[f]]=p,s[f].includes(":")?d.splice(0,0,u):d.push(u)}var y=void 0;i=a.formula;for(f=0;f<d.length;f++)y=Object.keys(d[f])[0],i=i.replace(new RegExp(y,"gi"),d[f][y].toUpperCase());return i}return null}function Z(e,t,r){for(var n,i,a,o,s,l,h=e,d=e,p=t,c=t,u=1;!o&&J(e+u,t,r,null,!0).value?d=e+u:o=!0,!a&&J(e-u,t,r,null,!0).value?h=e-u:a=!0,!a||!o;u++);for(var f=1;;f++){n=p,i=c;for(u=h;u<=d;u++)if(!s&&J(u,p-1,r,null,!0).value&&(p=n-1),!l&&J(u,c+1,r,null,!0).value&&(c=i+1),u===d&&(p===n&&(s=!0),c===i&&(l=!0)),l&&s)return[h,p,d,c]}}function J(e,t,r,n,i){var a=we(r,e);if(!a||!a.cells){if(!n)return i?{}:null;a?r.rows[e].cells=[]:r.rows[e]={cells:[]}}return r.rows[e].cells[t]||(i?{}:null)}function Q(e,r,n,i,a){n.rows[e]?n.rows[e].cells||(n.rows[e].cells=[]):n.rows[e]={cells:[]},a&&n.rows[e].cells[r]?t.extend(n.rows[e].cells[r],i,null,!0):n.rows[e].cells[r]=i}function ee(e,t){var r={fontFamily:"Calibri",verticalAlign:"bottom",textIndent:"0pt",backgroundColor:"#ffffff",color:"#000000",textAlign:"left",fontSize:"11pt",fontWeight:"normal",fontStyle:"normal",textDecoration:"none",border:"",borderLeft:"",borderTop:"",borderRight:"",borderBottom:""},n={};return Object.keys(t?r:e).forEach(function(t){e[t]!==r[t]&&(n[t]=e[t])}),n}function te(e,t,r){void 0===t&&(t=!0);for(var n=r.getAddressInfo(e),i=n.indices,a=fe(r,n.sheetIndex),o=i[0];o<=i[2];o++)for(var s=i[1];s<=i[3];s++)Q(o,s,a,{wrap:t},!0);r.setProperties({sheets:r.sheets},!0),n.sheetIndex===r.activeSheetIndex&&r.notify(Ot,{range:i,wrap:t,sheet:a})}function re(e,t,r,n,i,a,o,s,l){return void 0===l&&(l=!0),new Promise(function(h,d){h(function(){var h,d,p=new Map,c=t.indexOf("!")>-1?se(e,he(t)):e.activeSheetIndex,u=fe(e,c),f=y(t),m=f[0],C=0,b={sheet:u,indexes:f,formulaCellRef:o,sheetIndex:s,promise:new Promise(function(e,t){e(void 0)})};return e.notify(At,b),b.promise.then(function(){for(var t=e.frozenRowCount(u),o=e.frozenColCount(u);m<=f[2];){var s={};for(d=we(u,m),h=f[1];h<=f[3];){if(r){if(l&&Ee(u,m)&&!a){m++;continue}p instanceof Map&&(p=[]);var y=v(h+1);s[y]=n?d?ne(e,m,h,c,u):"":d?J(m,h,u):null,f[3]<h+1&&(s.__rowIndex=(m+1).toString()),p[C.toString()]=s}else{var b={};if(Object.assign(b,d?J(m,h,u):null),b.colSpan>1&&b.rowSpan>1)for(var x=void 0,S=m,w=m+b.rowSpan;S<w;S++)for(var I=h,E=h+b.colSpan;I<E;I++)S===m&&I===h||(x=new Object,S!==m&&(x.rowSpan=m-S),I!==h&&(x.colSpan=h-I),u.rows[S]&&u.rows[S].cells&&u.rows[S].cells[I]&&(delete u.rows[S].cells[I].value,delete u.rows[S].cells[I].formula),Q(S,I,u,x,!0));else if(b.colSpan>1)for(var S=h+1,w=h+b.colSpan;S<w;S++)Q(m,S,u,{colSpan:h-S},!0),u.rows[m]&&u.rows[m].cells&&u.rows[m].cells[S]&&(delete u.rows[m].cells[S].value,delete u.rows[m].cells[S].formula);else if(b.rowSpan>1)for(var S=m+1,w=m+b.rowSpan;S<w;S++)Q(S,h,u,{rowSpan:m-S},!0),u.rows[S]&&u.rows[S].cells&&u.rows[S].cells[h]&&(delete u.rows[S].cells[h].value,delete u.rows[S].cells[h].formula);if(!n&&Ee(u,m)){m++;continue}if(!n&&De(u,h)){h++;continue}if(!n&&i&&i.length){if(m>=t&&m<i[0]){m++;continue}if(h>=o&&h<i[1]){h++;continue}}if(b.style){var R={};Object.assign(R,b.style),b.style=R}var k={cell:b,address:g(m,h)};e.trigger(Ut,k),p.set(k.address,k.cell)}h++}m++,C++}return p})}())})}function ne(e,t,r,n,i){var a=J(t,r,i);if(a){if(a.format){var o={value:e.getDisplayText(a),rowIndex:t,colIndex:r,sheetIndex:n,dateObj:"",isDate:!1,isTime:!1};return e.notify(Nt,o),o.isDate?o.dateObj:a.value}return a.value}return""}function ie(e,r){var n,i,a;if(t.isUndefined(e[r])||!e[r]||e[r].index!==r)for(var o=0;o<=r;o++)if(e&&e[o]){if((n=e[o].index-o)>0){for(e.forEach(function(e,t){e&&e.index&&(a=e.index,i=1),e&&!e.index&&0!==t&&(e.index=a+i),i++});n--;)e.splice(o,0,null);o+=n}}else e?e[o]=null:e=[];return e[r]}function ae(e,r,n){for(var i,a,o,s=0,l=e.length,h=0;h<l;h++)!function(h){if(t.isNullOrUndefined(e[h])||t.isUndefined(e[h].index)||(a=s=e[h].index-h,delete e[h].index),s>0){for(i=0;s--;)r?(n.createSheet(h+i),i++):e.splice(h,0,null);h+=a,l+=a}if(r){e[h].id<1&&(e[h].id=me(n.sheets),e[h].properties&&(e[h].properties.id=e[h].id)),e[h].name||n.setSheetPropertyOnMute(e[h],"name","Sheet"+ge(n));var d=0;e[h].rows.forEach(function(e){d=Math.max(d,e&&e.cells&&e.cells.length-1||0)}),n.setSheetPropertyOnMute(e[h],"usedRange",{rowIndex:e[h].rows.length?e[h].rows.length-1:0,colIndex:d})}o=h}(h),h=o}function oe(e,r,n,i){var a,o,s,l=fe(e,n),h=y(r),d=h[0],p=h[2];for(d;d<=p;d++)for(a=h[1],o=h[3],a;a<=o;a++){var c=J(d,a,l);s=c&&c.value,e.notify(jt,{rowIdx:d,colIdx:a}),!t.isNullOrUndefined(c)&&i&&(delete c.value,t.isNullOrUndefined(c.formula)||delete c.formula,t.isNullOrUndefined(c.hyperlink)||delete c.hyperlink),t.isNullOrUndefined(s)||""===s||e.notify(Lt,{action:"refreshCalculate",rowIndex:d,colIndex:a})}}function se(e,t){for(var r,n=0;n<e.sheets.length;n++)if(e.sheets[n].name.toLowerCase()===t.toLowerCase()){r=n;break}return r}function le(e,t){for(var r,n=0;n<e.sheets.length;n++)if(e.sheets[n].id===t){r=n;break}return r}function he(e){return e.split("!")[0].replace(/\'/gi,"")}function de(e,t,r){for(var n=r.length,i=0;i<n;i++)if(r[i].sheet.toUpperCase()===t.toUpperCase())return r[i].index;return-1}function pe(e,t,r,n){void 0===r&&(r={}),e.setSheetPropertyOnMute(r,"selectedRange",n?r.selectedRange+" "+t:t)}function ce(e){return e&&e.selectedRange||"A1"}function ue(e){return e.selectedRange.split(" ")[0]}function fe(e,t){return e.sheets[t]}function ge(e){var t=[];e.sheets.forEach(function(e){t.push(e.name.toLowerCase())});for(var r=0;r<t.length;r++){if(!(t.indexOf("sheet"+e.sheetNameCount)>-1))return e.sheetNameCount++;e.sheetNameCount++}return e.sheetNameCount++}function me(e){var t=0;return e.forEach(function(e){t=Math.max(e.id,t)}),t+1}function ve(e,r){var n=r||e.sheets;n.forEach(function(r){if(r.id=r.id||0,r.name=r.name||"",r.rowCount=t.isUndefined(r.rowCount)?100:r.rowCount,r.colCount=t.isUndefined(r.colCount)?100:r.colCount,r.topLeftCell=r.topLeftCell||"A1",r.activeCell=r.activeCell||"A1",r.selectedRange=r.selectedRange||"A1:A1",r.usedRange=r.usedRange||{rowIndex:0,colIndex:0},e.setSheetPropertyOnMute(r,"ranges",r.ranges?r.ranges:[]),e.setSheetPropertyOnMute(r,"rows",r.rows&&t.extend([],r.rows,null,!0)||[]),e.setSheetPropertyOnMute(r,"columns",r.columns||[]),r.showHeaders=!!t.isUndefined(r.showHeaders)||r.showHeaders,r.showGridLines=!!t.isUndefined(r.showGridLines)||r.showGridLines,r.state=r.state||"Visible",r.maxHgts=[],r.protectSettings=r.protectSettings||{selectCells:!1,formatCells:!1,formatRows:!1,formatColumns:!1,insertLink:!1},r.isProtected=r.isProtected||!1,!r.paneTopLeftCell||"A1"===r.paneTopLeftCell){r.frozenRows=r.frozenRows?r.frozenRows:0,r.frozenColumns=r.frozenColumns?r.frozenColumns:0;var n=u(r.topLeftCell);e.setSheetPropertyOnMute(r,"paneTopLeftCell",g(r.frozenRows?n[0]+r.frozenRows:n[0],r.frozenColumns?n[1]+r.frozenColumns:n[1]))}ae(r.columns),ye(r.rows)}),ae(n,!0,e)}function ye(e){e.forEach(function(e){e&&e.cells&&ae(e.cells)}),ae(e)}function Ce(e,t){return void 0===t&&(t=e.activeSheetIndex),fe(e,t).name}function be(e,t,r,n){var i=!!r;r=r||[e.activeSheetIndex];var a={action:"moveSheet",position:t=Se(e.sheets,t,e.activeSheetIndex>t),sheetIndexes:r,cancel:!1};n&&e.trigger("actionBegin",a),a.cancel||(r.forEach(function(r,n){e.sheets.splice(t+n,0,e.sheets.splice(r+(t>r?-1*n:0),1)[0])}),e.setProperties({activeSheetIndex:t>r[0]?t-(r.length-1):t},!0),e.notify(Xt,{refresh:i}),n&&(delete a.cancel,e.trigger("actionComplete",a)))}function xe(e,r,n){var i={action:"duplicateSheet",sheetIndex:r=t.isUndefined(r)?e.activeSheetIndex:r,cancel:!1};if(n&&e.trigger("actionBegin",i),!i.cancel){var a=fe(e,r),o=t.extend({},a.properties?a.properties:a,!0);o.id=me(e.sheets);var s=o.name;/^\(\d+\)$/.test("("+s.split(" (")[1])&&(s=s.split(" (")[0]);var l=[];e.sheets.forEach(function(e){l.push(e.name)});for(var h=2;;h++)if(-1===l.indexOf(s+" ("+h+")")){o.name=s+" ("+h+")";break}e.createSheet(r+1,[o]),e.notify(Lt,{action:"addSheet",sheetName:"Sheet"+o.id,visibleName:o.name}),e.setProperties({activeSheetIndex:r+1},!0),e.notify(Xt,{refresh:!0,isDuplicate:!0}),n&&(delete i.cancel,e.trigger("actionComplete",i))}}function Se(e,t,r){for(var n=t;r?n>=0:n<e.length;r?n--:n++)if("Hidden"!==e[n].state&&"VeryHidden"!==e[n].state){t=n;break}return t}function we(e,t){return e.rows[t]}function Ie(e,t,r){e.rows[t]||(e.rows[t]={}),Object.keys(r).forEach(function(n){e.rows[t][n]=r[n]})}function Ee(e,t){return e.rows[t]&&e.rows[t].hidden}function Re(e,t,r){var n;if(e&&e.rows&&e.rows[t]){if(e.rows[t].hidden)return 0;n=void 0===e.rows[t].height?20:e.rows[t].height}else n=20;if(r&&window.devicePixelRatio%1>0){var i=n*window.devicePixelRatio%1;return n+(i?(i>.5?1-i:-1*i)/window.devicePixelRatio:0)}return n}function ke(e,t,r){e&&e.rows&&(e.rows[t]||(e.rows[t]={}),e.rows[t].height=r)}function Ae(e,t,r,n){void 0===r&&(r=t);var i,a=0;t>r&&(i=t,t=r,r=i);for(var o=t;o<=r;o++)a+=Re(e,o,n);return a}function Te(e,t){return e.columns?e.columns[t]||(e.columns[t]={}):(e.columns=[],e.columns[t]={}),e.columns[t]}function Fe(e,t,r){var n=Te(e,t);Object.keys(r).forEach(function(e){n[e]=r[e]})}function Le(e,t,r,n){var i;if(e&&e.columns&&e.columns[t]){if(!r&&e.columns[t].hidden)return 0;i=e.columns[t].width||e.columns[t].customWidth?e.columns[t].width:64}else i=64;if(n&&window.devicePixelRatio%1>0){var a=i*window.devicePixelRatio%1;return i+(a?(a>.5?1-a:-1*a)/window.devicePixelRatio:0)}return i}function Ne(e,t,r,n){void 0===r&&(r=t);var i=0;if(t>r){var a=t;t=r,r=a}for(var o=t;o<=r;o++)i+=Le(e,o,null,n);return i}function De(e,t){return e.columns[t]&&e.columns[t].hidden}function Oe(e){var t=[];return He(e,t),z(e,t),t}function He(e,t){t.push({member:"basic",args:[]}),t.push({member:"all",args:[]}),e.showRibbon&&t.push({member:"ribbon",args:[e]}),e.showFormulaBar&&t.push({member:"formulaBar",args:[e]}),e.showSheetTabs&&t.push({member:"sheetTabs",args:[e]}),e.allowEditing&&(t.push({member:"edit",args:[e]}),t.push({member:"formula",args:[e]}),t.push({member:"workbookFormula",args:[e]}),t.push({member:"workbookEdit",args:[e]})),e.allowOpen&&t.push({member:"open",args:[e]}),e.allowSave&&t.push({member:"save",args:[e]}),e.enableContextMenu&&t.push({member:"contextMenu",args:[e]}),"None"!==e.selectionSettings.mode&&t.push({member:"selection",args:[e]}),e.enableKeyboardNavigation&&t.push({member:"keyboardNavigation",args:[e]}),e.allowNumberFormatting&&t.push({member:"numberFormat",args:[e]}),e.enableKeyboardShortcut&&t.push({member:"keyboardShortcut",args:[e]}),e.enableClipboard&&t.push({member:"clipboard",args:[e]}),e.allowCellFormatting&&t.push({member:"cellformat",args:[e]}),e.allowSorting&&t.push({member:"sort",args:[e]}),e.allowResizing&&t.push({member:"resize",args:[e]}),t.push({member:"collaborativeEditing",args:[e]}),t.push({member:"protectSheet",args:[e]}),e.allowHyperlink&&t.push({member:"spreadsheetHyperlink",args:[e]}),e.allowUndoRedo&&t.push({member:"undoredo",args:[e]}),e.allowFiltering&&t.push({member:"filter",args:[e]}),e.allowWrap&&t.push({member:"wrapText",args:[e]}),e.allowInsert&&t.push({member:"insert",args:[e]}),e.allowDelete&&t.push({member:"delete",args:[e]}),e.allowDataValidation&&t.push({member:"dataValidation",args:[e]}),e.allowFindAndReplace&&t.push({member:"findAndReplace",args:[e]}),e.allowMerge&&t.push({member:"merge",args:[e]}),e.allowConditionalFormat&&t.push({member:"conditionalFormatting",args:[e]}),e.allowImage&&t.push({member:"spreadsheetImage",args:[e]}),e.allowChart&&t.push({member:"spreadsheetChart",args:[e]})}function Be(e){requestAnimationFrame(function(){e()})}function Me(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Pe(e){var t=30;return e.toString().length>3&&(t=10*e.toString().length),t}function _e(){if(null!==_n)return _n;var e=document.createElement("div"),t=0;return e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),_n=t}function Ue(e,t){return void 0===t&&(t=Un),Ve(e,"previous",t)+Ve(e,"next",t)}function Ve(e,t,r){for(var n=e[t+"ElementSibling"],i=0;n;)r.some(function(e){return n.classList.contains(e)})&&(i+=n.offsetHeight),n=n[t+"ElementSibling"];return i}function ze(e,t,r){if(e.scrollSettings.enableVirtualization){var n=e.viewport.topIndex,i=e.viewport.leftIndex,a=n+e.viewport.rowCount+2*e.getThreshold("row"),o=i+e.viewport.colCount+2*e.getThreshold("col"),s=n<=t[0]&&a>=t[2]&&i<=t[1]&&o>=t[3];if(s)return!0;if(r){if(t[0]<n&&t[2]<n||t[0]>a&&t[2]>a)return!1;if(t[0]<n&&t[2]>n&&(t[0]=n,s=!0),t[2]>a&&(t[2]=a,s=!0),t[1]<i&&t[3]<i||t[1]>o&&t[3]>o)return!1;t[1]<i&&t[3]>i&&(t[1]=i,s=!0),t[3]>o&&(t[3]=o,s=!0)}return s}return!0}function qe(e,t,r,n,i,a,o){var s,l={left:{idx:0,size:0},top:{idx:0,size:0}},h=l.top.size,d=l.left.size;for(s=l.top.idx;s<t[0];s++)r&&r-1<t[0]&&s<r||(h+=Re(e,s,!0));for(s=l.left.idx;s<t[1];s++)n&&n-1<t[1]&&s<n||(d+=Le(e,s,null,!0));return r&&t[0]<r&&(e.showHeaders&&(h+=30),i&&(h-=i)),n&&t[1]<n&&(e.showHeaders&&(d+=o||30),a&&(d-=a)),{top:h,left:d}}function je(e,r,n,i){void 0===i&&(i="e-selection");var a=e.getActiveSheet();if(a.frozenRows||a.frozenColumns){var o,s=e.frozenRowCount(a),l=e.frozenColCount(a);if("e-active-cell"===i){if(n[0]<s||n[1]<l){r.style.display="none";var h=(o=n[0]<s&&n[1]<l?e.getSelectAllContent():n[0]<s?e.getColumnHeaderContent():e.getRowHeaderContent()).querySelector("."+i);h||(h=r.cloneNode(!0),o.appendChild(h)),Ge(r=h,n,a,e.enableRtl,s,l,!0,e.viewport.beforeFreezeHeight,e.viewport.beforeFreezeWidth,e.sheetModule.colGroupWidth)}else Ge(r,n,a,e.enableRtl,s,l);r.style.display&&(r.style.display=""),We(e.getSelectAllContent(),o,!0),We(e.getColumnHeaderContent(),o,!0),We(e.getRowHeaderContent(),o,!0)}else{var d=S(n);if(d[0]<s||d[1]<l){r.classList.add("e-hide");var p=[];d[0]<s&&d[1]<l?d[2]<s&&d[3]<l?(p.push(n),We(e.getColumnHeaderContent(),o,!1),We(e.getRowHeaderContent(),o,!1)):d[2]>s-1?d[3]<l?(We(e.getColumnHeaderContent(),o,!1),p.push([d[0],d[1],s-1,d[3]]),p.push([s,d[1],d[2],d[3]])):(p.push([d[0],d[1],s-1,l-1]),p.push([s,d[1],d[2],l-1]),p.push([d[0],l,s-1,d[3]]),p.push([s,l,d[2],d[3]])):d[2]<s?(p.push([d[0],d[1],d[2],l-1]),p.push([d[0],l,d[2],d[3]]),We(e.getRowHeaderContent(),o,!1)):(p.push([s,d[1],d[2],l-1]),p.push([d[0],d[1],s-1,l-1]),p.push([s,l,d[2],d[3]]),p.push([d[0],l,s-1,d[3]])):d[0]<s?d[2]<s?p.push(n):(p.push([d[0],d[1],s-1,d[3]]),p.push([s,d[1],d[2],d[3]]),We(e.getSelectAllContent(),o,!1),We(e.getRowHeaderContent(),o,!1)):d[3]<l?p.push(n):(p.push([d[0],d[1],d[2],l-1]),p.push([d[0],l,d[2],d[3]]),We(e.getSelectAllContent(),o,!1),We(e.getColumnHeaderContent(),o,!1));var c;p.forEach(function(n){o=n[2]<s&&n[3]<l?e.getSelectAllContent():n[2]<s?e.getColumnHeaderContent():n[3]<l?e.getRowHeaderContent():e.getMainContent();var h;"e-copy-indicator"===i||"e-range-indicator"===i?(h=r.cloneNode(!0),o.appendChild(h),s&&(n[2]+1===s&&p.forEach(function(e){e!==n&&(c=h.getElementsByClassName("e-bottom")[0])&&e[0]===s&&t.detach(c)}),n[0]===s&&o.parentElement.classList.contains("e-main-panel")&&p.forEach(function(e){e!==n&&(c=h.getElementsByClassName("e-top")[0])&&e[2]+1===s&&t.detach(c)})),l&&(n[3]+1===l&&p.forEach(function(e){e!==n&&(c=h.getElementsByClassName("e-right")[0])&&e[1]===l&&t.detach(c)}),n[1]===l&&(o.classList.contains("e-sheet-content")||o.classList.contains("e-column-header"))&&p.forEach(function(e){e!==n&&(c=h.getElementsByClassName("e-left")[0])&&e[3]+1===l&&t.detach(c)}))):(h=o.querySelector("."+i))||(h=r.cloneNode(!0),o.appendChild(h)),Ge(h,n,a,e.enableRtl,s,l,!1,e.viewport.beforeFreezeHeight,e.viewport.beforeFreezeWidth,e.sheetModule.colGroupWidth),h.classList.contains("e-hide")&&h.classList.remove("e-hide")})}else We(e.getSelectAllContent(),null,!1),We(e.getColumnHeaderContent(),null,!1),We(e.getRowHeaderContent(),null,!1),Ge(r,n,a,e.enableRtl,s,l),"e-range-indicator"!==i&&e.getMainContent().querySelector("."+i)||e.getMainContent().appendChild(r)}}else Ge(r,n,a,e.enableRtl,0,0),r&&!e.getMainContent().querySelector("."+i)&&e.getMainContent().appendChild(r)}function We(e,r,n){var i;n?e!==r&&(i=e.querySelector(".e-active-cell"))&&t.detach(i):(i=e.querySelector(".e-selection"))&&t.detach(i)}function Ge(e,t,r,n,i,a,o,s,l,h){var d=S(t),p=qe(r,d,i,a,s,l,h),c=[It(r,0,!0),It(r,0,!0,"columns")],u=Ae(r,t[0],t[2],!0),f=Ne(r,t[1],t[3],!0),g={top:(d[0]===c[0]?p.top:p.top-at(1))+"px",height:u&&u+(d[0]===c[0]?0:at(1))+"px",width:f&&f+(d[1]===c[1]?0:at(1))+(o&&a&&d[1]<a&&d[3]>=a?1:0)+"px"};g[n?"right":"left"]=(d[1]===c[1]?p.left:p.left-1)+"px",e&&Ye([{element:e,attrs:g}])}function Ye(e){requestAnimationFrame(function(){e.forEach(function(e){t.setStyleAttribute(e.element,e.attrs)})})}function Xe(){return t.Browser.isPointer?"pointerdown":"mousedown touchstart"}function Ke(){return t.Browser.isPointer?"pointermove":"mousemove touchmove"}function $e(){return t.Browser.isPointer?"pointerup":"mouseup touchend"}function Ze(e){return"touchstart"===e.type||"pointerdown"===e.type&&"touch"===e.pointerType}function Je(e){return"touchmove"===e.type||"pointermove"===e.type&&"touch"===e.pointerType}function Qe(e){return"touchend"===e.type||"pointerup"===e.type&&"touch"===e.pointerType}function et(e){return e&&("mousedown"===e.type||"pointerdown"===e.type)}function tt(e){return e&&("mousemove"===e.type||"pointermove"===e.type)}function rt(e){return e&&("mouseup"===e.type||"pointerup"===e.type)}function nt(e){return e.changedTouches?e.changedTouches[0].clientX:e.clientX}function it(e){return e.changedTouches?e.changedTouches[0].clientY:e.clientY}function at(e,t){if(window.devicePixelRatio%1>0){var r=e*window.devicePixelRatio%1;return e+(r?(r>.5||t?1-r:-1*r)/window.devicePixelRatio:0)}return e}function ot(e,t){Object.keys(t).forEach(function(r){e&&e.setAttribute(Vn[r],t[r])})}function st(e,r){if(e){var n=t.getComponent(e,r);n&&n.destroy()}}function lt(e,t,r,n,i){var a,o,s,l,h,d,p,c,u,f=i.getActiveSheet(),g=i.frozenRowCount(f),m=i.frozenColCount(f);if(n){var v=e<m?i.getSelectAllContent():i.getColumnHeaderContent();a=v.getElementsByTagName("th")[t],o=v.getElementsByTagName("col")[t],s=(e<m?i.getRowHeaderContent():i.getMainContent()).getElementsByTagName("col")[t]}else{a=o=g||m?i.getRow(e,null,m-1):i.getRow(e,i.getRowHeaderTable()),o.style.height=parseInt(r,10)>0?at(parseInt(r,10))+"px":"2px",(s=i.getRow(e,null,m)).style.height=parseInt(r,10)>0?at(parseInt(r,10))+"px":"0px";var y=void 0;if(f.showHeaders){var C=i.getRowHeaderContent().getElementsByClassName("e-row"),b=[];b[0]=C[t].getElementsByTagName("td")[0].cloneNode(!0),y=dt(i.getRowHeaderTable(),b,!1,i)+1}for(var x=i.getMainContent().getElementsByClassName("e-row"),S=[],w=0;w<x[t].getElementsByTagName("td").length;w++)S[w]=x[t].getElementsByTagName("td")[w].cloneNode(!0);var I=dt(i.getContentTable(),S,!1,i)+1,E=y>=I?y:I;parseInt(s.style.height,10)<E||a&&a.classList.contains("e-reach-fntsize")&&parseInt(s.style.height,10)===E?(f.showHeaders&&(a.classList.add("e-reach-fntsize"),o.style.lineHeight=parseInt(r,10)>=4?parseInt(r,10)-4+"px":parseInt(r,10)>0?parseInt(r,10)-1+"px":"0px"),s.style.lineHeight=parseInt(r,10)>0?parseInt(r,10)-1+"px":"0px"):(o&&o.style.removeProperty("line-height"),s.style.removeProperty("line-height"),a&&a.classList.contains("e-reach-fntsize")&&a.classList.remove("e-reach-fntsize"))}if(d=s.previousElementSibling,u=s.nextElementSibling,d&&(f.showHeaders&&(l=a.previousElementSibling,h=o.previousElementSibling),d=s.previousElementSibling),u&&(f.showHeaders&&(p=a.nextElementSibling,c=o.nextElementSibling),u=s.nextElementSibling),parseInt(r,10)<=0&&!s.classList.contains("e-zero")&&!s.classList.contains("e-zero-start")){if(d&&u)if(n?(f.showHeaders&&(o.style.width="2px"),s.style.width="0px"):(f.showHeaders&&(o.style.height="2px"),s.style.height="0px"),d.classList.contains("e-zero-start")?(f.showHeaders&&a.classList.add("e-zero-start"),s.classList.add("e-zero-start")):(f.showHeaders&&a.classList.add("e-zero"),s.classList.add("e-zero")),!p||p.classList.contains("e-zero")||p.classList.contains("e-zero-last")||(f.showHeaders&&a.classList.add("e-zero-last"),s.classList.add("e-zero-last")),d.classList.contains("e-zero-last")&&(f.showHeaders&&l.classList.remove("e-zero-last"),d.classList.remove("e-zero-last")),f.showHeaders&&l.classList.contains("e-zero")?(a.classList.contains("e-zero-end"),ht(h,-2,n)):f.showHeaders&&ht(h,-1,n),f.showHeaders&&l.classList.contains("e-zero-start")&&ht(o,-1,n),f.showHeaders&&p.classList.contains("e-zero"))if(a.classList.contains("e-zero-start"))for(;p;){if(p.classList.contains("e-zero")&&0!==parseInt(c.style.height,10)&&!n||0!==parseInt(c.style.width,10)&&n){n?(o.style.width=parseInt(o.style.width,10)-1+"px",c.style.width=parseInt(c.style.width,10)-1+"px"):(o.style.height=parseInt(o.style.height,10)-1+"px",c.style.height=parseInt(c.style.height,10)-1+"px"),p.classList.remove("e-zero"),p.classList.add("e-zero-start");break}R=void 0;p.classList.remove("e-zero"),p.classList.add("e-zero-start"),n?(R=parseInt(p.getAttribute("aria-colindex"),10)-1,p=i.getColHeaderTable().getElementsByTagName("th")[R+1],c=i.getColHeaderTable().getElementsByTagName("col")[R+1]):(R=parseInt(p.getAttribute("aria-rowindex"),10)-1,p=i.getRowHeaderTable().getElementsByTagName("tr")[R+1],c=i.getRowHeaderTable().getElementsByTagName("tr")[R+1])}else ht(o,-2,n);else f.showHeaders&&(p.classList.contains("e-zero-end")?n?o.style.width="0px":o.style.height="0px":ht(c,-1,n));else if(d)n?(f.showHeaders&&(o.style.width="1px"),s.style.width="0px"):(f.showHeaders&&(o.style.height="1px"),s.style.height="0px"),f.showHeaders&&a.classList.add("e-zero-end"),s.classList.add("e-zero-end"),f.showHeaders&&a.classList.add("e-zero-last"),s.classList.add("e-zero-last"),f.showHeaders&&l.classList.contains("e-zero")?ht(h,-2,n):ht(h,-1,n);else if(p)if(a.classList.add("e-zero-start"),s.classList.add("e-zero-start"),p.classList.contains("e-zero")||(a.classList.add("e-zero-last"),s.classList.add("e-zero-last")),n?(o.style.width="1px",s.style.width="0px"):(o.style.height="1px",s.style.height="0px"),f.showHeaders&&p.classList.contains("e-zero"))for(;p;){if(p.classList.contains("e-zero")&&0!==parseInt(c.style.width,10)&&n||0!==parseInt(c.style.height,10)&&!n){n?(c.style.width=parseInt(c.style.width,10)-1+"px",o.style.width=parseInt(o.style.width,10)-1+"px"):(c.style.height=parseInt(c.style.height,10)-1+"px",o.style.height=parseInt(o.style.height,10)-1+"px"),p.classList.add("e-zero-start"),p.classList.remove("e-zero");break}var R=void 0;p.classList.add("e-zero-start"),p.classList.remove("e-zero"),n?(R=parseInt(p.getAttribute("aria-colindex"),10)-1,c=i.getColHeaderTable().getElementsByTagName("col")[R+1],p=i.getColHeaderTable().getElementsByTagName("th")[R+1]):(R=parseInt(p.getAttribute("aria-rowindex"),10)-1,c=i.getRowHeaderTable().getElementsByTagName("tr")[R+1],p=i.getRowHeaderTable().getElementsByTagName("tr")[R+1])}else f.showHeaders&&ht(c,-1,n)}else if(parseInt(r,10)>0){var k=at(parseInt(r,10))+"px";n?(o.style.width=k,s.style.width=k):(o.style.height=k,s.style.height=k),f.showHeaders&&l&&p?(l.classList.contains("e-zero")?a.classList.contains("e-zero")?n?(h.style.width=parseInt(h.style.width,10)+2+"px",o.style.width=parseInt(o.style.width,10)-1+"px"):(h.style.height=parseInt(h.style.height,10)+2+"px",o.style.height=parseInt(o.style.height,10)-1+"px"):ht(o,-1,n):a.classList.contains("e-zero")?ht(h,1,n):a.classList.contains("e-zero-start")&&(n?(h.style.width=parseInt(h.style.width,10)+1+"px",o.style.width=parseInt(o.style.width,10)-1+"px"):(h.style.height=parseInt(h.style.height,10)+1+"px",o.style.height=parseInt(o.style.height,10)-1+"px")),p.classList.contains("e-zero")?ht(o,-1,n):(a.classList.contains("e-zero")||a.classList.contains("e-zero-start"))&&ht(c,1,n),a.classList.contains("e-zero")&&a.classList.remove("e-zero"),a.classList.contains("e-zero-start")&&a.classList.remove("e-zero-start"),s.classList.contains("e-zero")&&s.classList.remove("e-zero"),s.classList.contains("e-zero-start")&&s.classList.remove("e-zero-start"),a.classList.contains("e-zero-last")&&a.classList.remove("e-zero-last"),s.classList.contains("e-zero-last")&&s.classList.remove("e-zero-last"),(l.classList.contains("e-zero")||l.classList.contains("e-zero-start"))&&(l.classList.add("e-zero-last"),d.classList.add("e-zero-last"))):f.showHeaders&&l?(l.classList.contains("e-zero")?a.classList.contains("e-zero")?n?(o.style.width=parseInt(o.style.width,10)-1+"px",h.style.width=parseInt(h.style.width,10)+2+"px"):(o.style.height=parseInt(o.style.height,10)-1+"px",h.style.height=parseInt(h.style.height,10)+2+"px"):ht(o,-1,n):a.classList.contains("e-zero")?ht(h,1,n):ht(o,-1,n),a.classList.contains("e-zero")&&a.classList.remove("e-zero"),a.classList.contains("e-zero-end")&&a.classList.remove("e-zero-end"),s.classList.contains("e-zero")&&s.classList.remove("e-zero"),s.classList.contains("e-zero-end")&&s.classList.remove("e-zero-end")):f.showHeaders&&p&&(p.classList.contains("e-zero")?ht(o,-1,n):a.classList.contains("e-zero-start")&&(ht(c,1,n),a.classList.remove("e-zero-start")),a.classList.contains("e-zero")&&a.classList.remove("e-zero"),s.classList.contains("e-zero")&&s.classList.remove("e-zero"),a.classList.contains("e-zero-start")&&a.classList.remove("e-zero-start"),s.classList.contains("e-zero-start")&&s.classList.remove("e-zero-start"))}}function ht(e,t,r){r?e.style.width=parseInt(e.style.width,10)+t+"px":e.style.height=parseInt(e.style.height,10)+t+"px"}function dt(e,t,r,n,i,a){var o=n.createElement("div",{className:n.element.className,styles:"display: block"}),s=n.createElement("table",{className:e.className+"e-resizetable",styles:"width: auto;height: auto"}),l=n.createElement("tr");r?t.forEach(function(e){var t=l.cloneNode();t.appendChild(e),s.appendChild(t)}):(t.forEach(function(e){l.appendChild(e.cloneNode(!0))}),s.appendChild(l)),o.appendChild(s),document.body.appendChild(o);var h,d,p=s.getBoundingClientRect().width,c=s.getBoundingClientRect().height;return a?(h=r&&parseInt(i,10)>p?p:parseInt(i,10),d=!r&&parseInt(i,10)>c?c:parseInt(i,10)):(d=c,h=p),document.body.removeChild(o),r?Math.ceil(h):Math.ceil(d)}function pt(e,r,n,i){var a,o,s,l,h,d,p=e.eventArgs;switch(e.action){case"sorting":s={args:{range:e.eventArgs.range,sortOptions:e.eventArgs.sortOptions,cancel:!1},promise:new Promise(function(e,t){e(void 0)})},r.notify(Dt,s),s.promise.then(function(e){r.serviceLocator.getService("cell").refreshRange(y(e.range))});break;case"cellSave":l=e.eventArgs,h=p.formula?n?{value:l.formula}:{formula:l.formula}:{value:l.value},r.updateCell(h,l.address);break;case"cellDelete":r.clearRange(e.eventArgs.address,null,!0),r.serviceLocator.getService("cell").refreshRange(c(e.eventArgs.address));break;case"format":if("CellFormat"===p.requestType)if(p.style&&p.style.border&&!t.isNullOrUndefined(p.borderType)){var u={};Object.assign(u,p.style,null,!0),p.style.border=void 0,r.cellFormat(p.style,p.range),p.style.border=u.border,r.setBorder(p.style,p.range,p.borderType),p.style=u}else r.cellFormat(p.style,p.range);else r.numberFormat(p.format,p.range);break;case"clipboard":if(p.copiedInfo.isCut&&!n)return;(p.copiedInfo.isCut?r.cut(p.copiedRange):r.copy(p.copiedRange)).then(function(){r.paste(p.pastedRange,p.type)});break;case"gridLines":r.setSheetPropertyOnMute(r.sheets[p.sheetIdx],"showGridLines",p.isShow);break;case"headers":r.setSheetPropertyOnMute(r.sheets[p.sheetIdx],"showHeaders",p.isShow);break;case"resize":case"resizeToFit":p.isCol?void 0===p.hide?r.setColWidth(p.width,p.index,p.sheetIdx):r.hideColumn(p.index,p.index,p.hide):void 0===p.hide?r.setRowHeight(p.height,p.index,p.sheetIdx+1):r.hideRow(p.index,p.index,p.hide);break;case"renameSheet":r.setSheetPropertyOnMute(r.sheets[p.index-1],"name",p.value);break;case"removeSheet":r.notify(ir,{index:p.index,isAction:!0,count:p.sheetCount,clicked:!0});break;case"wrap":te(e.eventArgs.address,e.eventArgs.wrap,r);break;case"hideShow":p.isCol?r.hideColumn(p.startIndex,p.endIndex,p.hide):r.hideRow(p.startIndex,p.endIndex,p.hide);break;case"replace":r.updateCell({value:p.compareVal},p.address);break;case"filter":r.notify(dr,{predicates:null,range:p.range,sIdx:p.index,isCut:!0});break;case"insert":!1===n?r.delete(e.eventArgs.index,e.eventArgs.index+(e.eventArgs.model.length-1),e.eventArgs.modelType):r.notify(Ht,{model:"Sheet"===e.eventArgs.modelType?r:r.getActiveSheet(),start:e.eventArgs.index,end:e.eventArgs.index+(e.eventArgs.model.length-1),modelType:e.eventArgs.modelType,isAction:!1,checkCount:e.eventArgs.sheetCount,activeSheetIndex:e.eventArgs.activeSheetIndex});break;case"delete":!1===n?r.notify(Ht,{model:"Sheet"===e.eventArgs.modelType?r:r.getActiveSheet(),start:e.eventArgs.deletedModel,modelType:e.eventArgs.modelType,isAction:!1,columnCellsModel:e.eventArgs.deletedCellsModel}):r.delete(e.eventArgs.startIndex,e.eventArgs.endIndex,e.eventArgs.modelType);break;case"validation":if(n){var f={type:p.type,operator:p.operator,value1:p.value1,value2:p.value2,ignoreBlank:p.ignoreBlank,inCellDropDown:p.inCellDropDown};r.notify(Bt,{rules:f,range:p.range})}else r.notify(_t,{range:p.range});break;case"merge":e.eventArgs.isAction=!1,d=[];for(var g=0,m=p.model.length;g<m;g++){d.push({cells:[]});for(var v=0,C=p.model[g].cells.length;v<C;v++)d[g].cells[v]={},Object.assign(d[g].cells[v],p.model[g].cells[v])}r.notify(Vt,e.eventArgs),p.model=d;break;case"clear":r.notify(mr,{options:e.eventArgs,isPublic:!0});break;case"conditionalFormat":if(n){x={type:p.type,cFColor:p.cFColor,value:p.value,range:p.range};r.notify(zt,{conditionalFormat:x,sheetIdx:p.sheetIdx,isUndoRedo:!0})}else{r.notify(qt,{range:p.range,sheetIdx:p.sheetIdx,isUndoRedo:!0});for(var b=0;b<i.length;b++)if("conditionalFormat"===i[b].action){var x={type:i[b].eventArgs.type,cFColor:i[b].eventArgs.cFColor,value:i[b].eventArgs.value,range:i[b].eventArgs.range};r.notify(Kt,{conditionalFormat:x,sheetIdx:i[b].eventArgs.sheetIdx})}}break;case"clearCF":n?r.notify(qt,{range:p.selectedRange,sheetIdx:p.sheetIdx,isClearCF:!0,isUndoRedo:!0}):r.notify(Wt,{conditionalFormats:p.cFormats,oldRange:p.oldRange,selectedRange:p.selectedRange});break;case"insertImage":n?r.notify(yr,{options:{src:e.eventArgs.imageData,height:e.eventArgs.imageHeight,width:e.eventArgs.imageWidth,imageId:e.eventArgs.id},range:e.eventArgs.range,isPublic:!1,isUndoRedo:!0}):r.notify(Cr,{id:e.eventArgs.id,sheetIdx:e.eventArgs.sheetIndex+1,range:e.eventArgs.range});break;case"imageRefresh":o=document.getElementById(e.eventArgs.id),n?(e.eventArgs.isUndoRedo=!0,r.notify(vr,e.eventArgs)):r.notify(vr,{prevTop:e.eventArgs.currentTop,prevLeft:e.eventArgs.currentLeft,currentTop:e.eventArgs.prevTop,currentLeft:e.eventArgs.prevLeft,id:e.eventArgs.id,currentHeight:e.eventArgs.prevHeight,currentWidth:e.eventArgs.prevWidth,requestType:"imageRefresh",prevHeight:e.eventArgs.currentHeight,prevWidth:e.eventArgs.currentWidth,isUndoRedo:!0}),o.style.height=n?e.eventArgs.currentHeight+"px":e.eventArgs.prevHeight+"px",o.style.width=n?e.eventArgs.currentWidth+"px":e.eventArgs.prevWidth+"px",o.style.top=n?e.eventArgs.currentTop+"px":e.eventArgs.prevTop+"px",o.style.left=n?e.eventArgs.currentLeft+"px":e.eventArgs.prevLeft+"px";break;case"insertChart":if(n){var S=[{type:p.type,theme:p.theme,isSeriesInRows:p.isSeriesInRows,range:p.range,id:p.id,height:p.height,width:p.width}];r.notify(Gt,{chart:S,isInitCell:p.isInitCell,isUndoRedo:!1,range:p.posRange})}else r.notify(br,{id:p.id,isUndoRedo:!0});break;case"deleteChart":if(n)r.notify(br,{id:p.id});else{var w=[{type:p.type,theme:p.theme,isSeriesInRows:p.isSeriesInRows,range:p.range,id:p.id,height:p.height,width:p.width,top:p.top,left:p.left}];r.notify(Gt,{chart:w,isInitCell:p.isInitCell,isUndoRedo:!1,range:p.posRange})}break;case"chartRefresh":(a=document.getElementById(e.eventArgs.id))&&(a.style.height=n?e.eventArgs.currentHeight+"px":e.eventArgs.prevHeight+"px",a.style.width=n?e.eventArgs.currentWidth+"px":e.eventArgs.prevWidth+"px",a.style.top=n?e.eventArgs.currentTop+"px":e.eventArgs.prevTop+"px",a.style.left=n?e.eventArgs.currentLeft+"px":e.eventArgs.prevLeft+"px"),n?(e.eventArgs.isUndoRedo=!0,r.notify(Yt,{height:a.style.height,width:a.style.width,overlayEle:a})):r.notify(Yt,{height:a.style.height,width:a.style.width,overlayEle:a})}}function ct(e,t,r,n){for(var i,a=e.sheets[n].ranges,o=0,s=a.length;o<s;o++)if(a[o].template&&(i=c(a[o].address.length?a[o].address:a[o].startCell))[0]<=t&&i[1]<=r&&i[2]>=t&&i[3]>=r)return!0;return!1}function ut(e,t,r,n,i,a,o){void 0===o&&(o=!0);var s=Re(t,n,!0),l=e.frozenColCount(t),h=at(r);(i=i||(t.frozenRows?e.getRow(n,null,l):e.getRow(n)))&&(i.style.height=h+"px"),(a=a||(t.frozenColumns?e.getRow(n,null,l-1):e.getRow(n,e.getRowHeaderTable())))&&(a.style.height=h+"px"),ke(t,n,r),e.setProperties({sheets:e.sheets},!0),o&&e.notify(sr,{rowIdx:n,threshold:h-s})}function ft(e,t,r){void 0===r&&(r=1);var n=t&&t.fontSize||e.cellStyle.fontSize,i=(n.indexOf("pt")>-1?1.33*parseInt(n,10):parseInt(n,10))*gt(t)*r;return Math.ceil(i%1>.9?i+1:i)}function gt(e){var t=1.24;return e&&("Arial Black"===e.fontFamily?t=1.44:'"Segoe UI", sans-serif'===e.fontFamily&&(t=1.36)),t}function mt(e,t,r){t||(t=r);var n=document.createElement("canvas").getContext("2d");return n.font=(t.fontStyle||r.fontStyle)+" "+(t.fontWeight||r.fontWeight)+" "+(t.fontSize||r.fontSize)+" "+(t.fontFamily||r.fontFamily),at(n.measureText(e).width,!0)}function vt(e,t,r,n){var i,a,o=0,s=e.toString().split(" "),l=mt(" ",r,n),h=0;return s.forEach(function(e){var d=0,p=0;i=mt(e,r,n),s[s.length-1]!==e&&(i+=l),(a=(o+i)/t)>=1?(o&&h++,i/t>=1?(e.split("").forEach(function(e){p=mt(e,r,n),(d+=p)>t&&(h++,d=p)}),o=d+l):o=i):o+=i}),o&&(h+=Math.ceil((o-l)/t)),h}function yt(e,t,r){var n=0,i=J(e,t,r,null,!0),a=J(e,t+1,r,null,!0);return i.style&&(i.style.border?n=(0===t?2:1)*parseFloat(i.style.border.split("px")[0]):(0===t&&i.style.borderLeft&&(n=parseFloat(i.style.borderLeft.split("px")[0])),i.style.borderRight&&(n+=parseFloat(i.style.borderRight.split("px")[0])))),i.style&&(i.style.border||i.style.borderRight)||!a.style||!a.style.borderLeft||(n+=parseFloat(a.style.borderLeft.split("px")[0])),n}function Ct(e,t,r){var n=0,i=J(e,t,r,null,!0),a=J(e+1,t,r,null,!0);return i.style&&(i.style.border?n=(0===e?2:1)*parseFloat(i.style.border.split("px")[0]):(0===e&&i.style.borderTop&&(n=parseFloat(i.style.borderTop.split("px")[0])),i.style.borderBottom&&(n+=parseFloat(i.style.borderBottom.split("px")[0])))),i.style&&(i.style.border||i.style.borderBottom)||!a.style||!a.style.borderTop||(n+=parseFloat(a.style.borderTop.split("px")[0])),n}function bt(e,t,r,n){return void 0===n&&(n=r),Ne(e,r,n,!0)-at(4+yt(t,r,e))}function xt(e,t,r,n,i,a){return ft(e,i,a)+(Ct(t,r,n)||1)}function St(e,t,r,n){e.maxHgts[t]||(e.maxHgts[t]={}),e.maxHgts[t][r]=n}function wt(e,t){var r=0,n=e.maxHgts[t];return n&&Object.keys(n).forEach(function(e){n[e]>r&&(r=n[e])}),r}function It(e,t,r,n){return void 0===n&&(n="rows"),t<0&&(t=-1),e[n][t]&&e[n][t].hidden&&(r?t++:t--,t=It(e,t,r,n)),t}function Et(e){if(!document.activeElement.classList.contains("e-text-findNext-short"))if(t.Browser.isIE){var r=window.scrollX,n=window.scrollY;e.focus(),window.scrollTo(r,n)}else e.focus({preventScroll:!0})}function Rt(e,r){for(var n,i=e.getActiveSheet(),a=t.isNullOrUndefined(r)?S(c(i.selectedRange)):r,o=a[0];o<=a[2];o++)for(var s=a[1];s<=a[3];s++)if(X(J(o,s,i),Te(i,s))){n=!0;break}return n}var kt=function(){function e(e,t,r,n,i){this.preventCallback=!1,this.context=e,this.workerTask=t,this.defaultListener=r,this.workerData=n,i&&(this.preventCallback=!0),this.initWorker()}return e.prototype.terminate=function(){this.worker.terminate(),URL.revokeObjectURL(this.workerUrl)},e.prototype.initWorker=function(){var e=new Blob([this.getFnCode()],{type:"text/javascript"});this.workerUrl=URL.createObjectURL(e),this.worker=new Worker(this.workerUrl),this.worker.onmessage=this.messageFromWorker.bind(this),this.worker.onerror=this.onError.bind(this),this.worker.postMessage(this.workerData)},e.prototype.messageFromWorker=function(e){this.terminate(),this.defaultListener.apply(this.context,[e.data])},e.prototype.onError=function(e){throw this.terminate(),e.message||e},e.prototype.getFnCode=function(){var e,t,r="",n="",i=!1;if("function"==typeof this.workerTask)this.workerTask.toString().indexOf("function")<0?n="function "+this.workerTask.toString():(n=this.workerTask.toString(),i=!0),r+="self.workerTask = "+n+"; \n";else if("object"==typeof this.workerTask)for(t=Object.keys(this.workerTask),e=0;e<t.length;e++)this.workerTask[t[e]].toString().indexOf("function")<0?n="function "+this.workerTask[t[e]].toString():(n=this.workerTask[t[e]].toString(),i=!0),r+=(0===e?"self.workerTask":t[e])+"= "+n+"; \n";return r+="self.onmessage = "+(i?"":" function ")+(this.preventCallback?this.getMessageFn.toString():this.getCallbackMessageFn.toString())+"; \n"},e.prototype.getCallbackMessageFn=function(e){postMessage(this.workerTask.apply(this,e.data))},e.prototype.getMessageFn=function(e){this.workerTask.apply(this,e.data)},e}(),At="updateSheetFromDataSource",Tt="setCellFormat",Ft="applyCellFormat",Lt="workbookFormulaOperation",Nt="checkDateFormat",Dt="initiateSort",Ot="wrapText",Ht="insertModel",Bt="setValidation",Mt="gotoHandler",Pt="ShowDialog",_t="removeValidation",Ut="queryCellInfo",Vt="setMerge",zt="setCFRule",qt="clearCFRule",jt="cFDelete",Wt="clearCells",Gt="setChart",Yt="refreshChartSize",Xt="moveOrDuplicateSheet",Kt="cFUndo",$t=function(){function e(e){this.parent=e,this.localeObj=t.getNumericObject(this.parent.locale),this.decimalSep=this.localeObj.decimal,this.groupSep=this.localeObj.group,this.addEventListener()}return e.prototype.numberFormatting=function(e){var t=this.parent.activeSheetIndex;e.range&&e.range.indexOf("!")>-1&&(t=se(this.parent,e.range.split("!")[0]));for(var r,n=this.parent.sheets[t],i=c(e.range?e.range.indexOf("!")>-1?e.range.split("!")[1]:e.range:n.selectedRange),a=i[0];a<=i[2];a++)for(var o=i[1];o<=i[3];o++)Q(a,o,n,{format:e.format},!0),r=J(a,o,n,!0),this.getFormattedCell({type:H(r.format),value:r.value,format:r.format,rowIndex:a,colIndex:o,sheetIndex:t,cell:r})},e.prototype.getFormattedCell=function(e){var r=t.isNullOrUndefined(e.value)?"":e.value,n=this.parent.sheets[t.isNullOrUndefined(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex],i=c(n.activeCell),a=Number(e.sheetIndex)?Number(e.sheetIndex):this.parent.activeSheetIndex,o=e.cell?e.cell:J(i[0],i[1],n),s=e.cell&&!t.isNullOrUndefined(e.rowIdx)?e.rowIdx:i[0],l=e.cell&&!t.isNullOrUndefined(e.colIdx)?e.colIdx:i[1],h=!1,d={},p=new t.Internationalization;p.getNumberFormat(d);var u=t.getNumberDependable(this.parent.locale,d.currency);if(""===e.format||"General"===e.format){o=o||{};var f={value:e.value,rowIndex:s,colIndex:l,sheetIndex:this.parent.activeSheetIndex,updatedVal:e.value,isDate:!1,isTime:!1};this.checkDateFormat(f),f.isDate?(h=!0,o.value=e.value=f.updatedVal,o.format=e.format=O("ShortDate")):f.isTime&&(h=!0,o.value=e.value=f.updatedVal,o.format=e.format=O("Time"))}e.type=e.format?H(e.format):"General";var g=this.processFormats(e,r,h,o,p,u,d.currency);return this.parent.getActiveSheet().id-1===a&&this.parent.notify("refreshCellElem",{isRightAlign:g.rightAlign,result:g.fResult||e.value,rowIndex:e.rowIndex,colIndex:e.colIndex,sheetIndex:e.sheetIndex,type:e.type,curSymbol:u,value:e.value||""}),!e.onLoad&&(e.rowIndex>n.usedRange.rowIndex||e.colIndex>n.usedRange.colIndex)&&this.parent.setUsedRange(e.rowIndex,e.colIndex),e.formattedText=g.fResult||e.value,e.isRightAlign=g.rightAlign,e.curSymbol=u,e.formattedText},e.prototype.processFormats=function(e,t,r,n,i,a,o){var s;if(e.format=e.format?e.format:"General",""!==t)switch(e.type){case"General":t=(s=this.autoDetectGeneralFormat({args:e,currencySymbol:a,fResult:t,intl:i,isRightAlign:r,curCode:o,cell:n,rowIdx:Number(e.rowIdx),colIdx:Number(e.colIdx)})).fResult,r=s.isRightAlign;break;case"Number":L(t)&&(t=this.applyNumberFormat(e,i),r=!0);break;case"Currency":L(t)&&(t=this.currencyFormat(e,i,o),r=!0);break;case"Percentage":L(t)&&(t=this.percentageFormat(e,i),r=!0);break;case"Accounting":L(t)&&(t=this.accountingFormat(e,i,a,o),r=!0);break;case"ShortDate":r=!!(t=this.shortDateFormat(e,i));break;case"LongDate":r=!!(t=this.longDateFormat(e,i));break;case"Time":r=!!(t=this.timeFormat(e,i));break;case"Fraction":L(t)&&(t=this.fractionFormat(e),r=!0);break;case"Scientific":L(t)&&(t=this.scientificFormat(e),r=!0);break;case"Text":r=!1}return{fResult:t,rightAlign:r}},e.prototype.autoDetectGeneralFormat=function(e){if(L(e.fResult)&&(e.args.format&&""!==e.args.format&&(e.args.format.toString().indexOf("%")>-1?e.fResult=this.percentageFormat(e.args,e.intl):e.args.format.toString().indexOf(e.currencySymbol)>-1?e.fResult=this.currencyFormat(e.args,e.intl,e.curCode):e.fResult=this.applyNumberFormat(e.args,e.intl)),"General"===e.args.format&&e.fResult&&e.fResult.toString().split(this.decimalSep)[0].length>11&&(e.fResult=this.scientificFormat(e.args)),e.isRightAlign=!0),!t.isNullOrUndefined(e.fResult)){var r=e.fResult.toString();r.indexOf("%")>-1&&""!==r.split("%")[0]&&""===r.split("%")[1].trim()&&"NaN"!==Number(r.split("%")[0].split(this.groupSep).join("")).toString()?(e.args.value=Number(r.split("%")[0].split(this.groupSep).join(""))/100,e.cell.format=e.args.format=this.getPercentageFormat(r),e.fResult=this.percentageFormat(e.args,e.intl),e.cell.value=e.args.value.toString(),e.isRightAlign=!0):r.indexOf(e.currencySymbol)>-1&&""!==r.split(e.currencySymbol)[1]&&"NaN"!==Number(r.split(e.currencySymbol)[1].split(this.groupSep).join("")).toString()&&(e.args.value=Number(r.split(e.currencySymbol)[1].split(this.groupSep).join("")),e.cell.format=e.args.format=O("Currency"),e.fResult=this.currencyFormat(e.args,e.intl,e.curCode),e.cell.value=e.args.value.toString(),Q(e.rowIdx,e.colIdx,this.parent.getActiveSheet(),e.cell,!0),e.isRightAlign=!0)}return{isRightAlign:e.isRightAlign,fResult:e.fResult}},e.prototype.getPercentageFormat=function(e){return e.indexOf(this.decimalSep)>-1?O("Percentage"):"0%"},e.prototype.findSuffix=function(e,t){var r=e.length-t.length;return e.substr(0,r<0?0:r)+t},e.prototype.applyNumberFormat=function(e,r){e.format=this.isCustomFormat(e.format.toString());var n=e.format.toString().split(";");if(Number(e.value)>0)e.format=n[0];else if(0===Number(e.value)){if(e.format=n[2]?n[2]:n[0],e.format.indexOf('"')>-1&&-1===e.format.indexOf("#"))return e.format=e.format.split("_").join(" ").split("*").join(" ").split("?").join(" ").split('"').join(""),e.format}else if(Number(e.value)<0)e.format=t.isNullOrUndefined(n[1])?n[0]:n[1].split("*").join(" "),e.format.indexOf("-")>-1&&(e.value=e.value.toString().split("-").join(""));else if(e.format=n[3]?n[3]:n[0],e.format=e.format.split("_").join(" ").split("*").join(" ").split("?").join(" "),e.format.indexOf("@")>-1)return e.format.split("@").join(e.value.toString());if(e.format=e.format.split("_").join(" ").split("*").join(" ").split('"').join(""),e.format.indexOf("?")>-1&&e.format.indexOf(this.decimalSep)>-1){var i=e.format.split(this.decimalSep)[1].length,a="";Number(e.value)%1&&(a=i>e.value.toString().split(".")[1].length?" ":"0"),e.format=e.format.split("?").join(a)}else e.format=e.format.split("?").join(" ");return Number(e.value)<0&&e.cell&&(e.format=e.cell.format),r.formatNumber(Number(e.value),{format:e.format})},e.prototype.isCustomFormat=function(e){return'_-* #,##0.00_-;-* #,##0.00_-;_-* "-"_-;_-@_-'!==e&&'_-* #,##0_-;-* #,##0_-;_-* "-"_-;_-@_-'!==e||(e=""),e=""===e?O("Number"):e,e=e.toString().split("_)").join(" ").split("_(").join(" ").split("[Red]").join("")},e.prototype.currencyFormat=function(e,r,n){e.format=""===e.format?O("Currency"):e.format,e.format=e.format.toString().split("_(").join(" ").split("_)").join(" ").split("[Red]").join("");var i=e.format.toString().split(";");return Number(e.value)>=0?e.format=i[0]:e.format=t.isNullOrUndefined(i[1])?i[0]:i[1].split("*").join(" "),e.format=this.getFormatForOtherCurrency(e.format),r.formatNumber(Number(e.value),{format:e.format,currency:n})},e.prototype.percentageFormat=function(e,t){return e.format=""===e.format?O("Percentage"):e.format,t.formatNumber(Number(e.value),{format:e.format})},e.prototype.accountingFormat=function(e,t,r,n){e.format=""===e.format?O("Accounting"):e.format,e.format=e.format.split("_(").join(" ").split("_)").join(" ").split("[Red]").join("").split("_").join("");var i=e.format.split(";");return Number(e.value)>=0?e.format=i[0]:e.format=i[1].split("*").join(" "),e.format=this.getFormatForOtherCurrency(e.format),0===Number(e.value)?r+"- ":t.formatNumber(Number(e.value),{format:e.format,currency:n}).split("-").join("")},e.prototype.getFormatForOtherCurrency=function(e){if(e.indexOf("[$")>-1){var t=e.split("]")[0].split("[$")[1].split("-")[0];e=e.indexOf("0")>e.indexOf("[$")?t+e.slice(e.indexOf("]")+1,e.length):e.slice(0,e.indexOf("[$"))+t}return e},e.prototype.shortDateFormat=function(e,t){var r,n=A(e.value),i=""===e.format||"General"===e.format?O("ShortDate"):e.format.toString();return i===O("ShortDate")?(i="M/d/yy",r={type:"date",skeleton:"yMd"}):r={type:"date",format:i},t.formatDate(n,r)},e.prototype.longDateFormat=function(e,t){var r=A(e.value),n=""===e.format||"General"===e.format?O("LongDate"):e.format.toString();return n===O("LongDate")&&(n="EEEE, MMMM d, y"),t.formatDate(r,{type:"date",format:n})},e.prototype.timeFormat=function(e,r){if(t.isNullOrUndefined(e.value))return"";t.isNullOrUndefined(e.value.toString().split(this.decimalSep)[1])||(e.value=parseFloat("1"+this.decimalSep+e.value.toString().split(this.decimalSep)[1])||e.value);var n=A(e.value),i=""===e.format||"General"===e.format?O("Time"):e.format.toString();return i===O("Time")&&(i="h:mm:ss a"),r.formatDate(n,{type:"time",skeleton:"medium",format:i})},e.prototype.scientificFormat=function(e){e.format=""===e.format?O("Scientific"):e.format;var t=e.format.split("+")[1],r=this.findDecimalPlaces(e.format,"Scientific"),n=Number(e.value).toExponential(r);return n.indexOf("e+")>-1?n=n.split("e+")[0]+"E+"+this.findSuffix(t,n.split("e+")[1]):n.indexOf("e-")>-1&&(n=n.split("e-")[0]+"E-"+ +this.findSuffix(t,n.split("e-")[1])),n},e.prototype.fractionFormat=function(e){e.format=""===e.format?O("Fraction"):e.format;var t,r="";return e.value.toString().indexOf(this.decimalSep)>-1&&L(e.value)?(r=e.value.toString().split(this.decimalSep)[0],t=R(Number(e.value)),0===Number(r)?" "+t:r+" "+t):r},e.prototype.findDecimalPlaces=function(e,t){var r,n;switch(t){case"Scientific":if(r=e.toUpperCase().indexOf("E"),n=e.indexOf(this.decimalSep),r>-1)return e.substring(n+1,r).length}return 2},e.prototype.checkDateFormat=function(e){var r,n=new t.Internationalization,i=t.isNullOrUndefined(e.value)?"":e.value.toString(),a=J(e.rowIndex,e.colIndex,fe(this.parent,t.isNullOrUndefined(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex)),o=this.checkCustomDateFormat(i);i&&(i.indexOf("/")>-1||i.indexOf("-")>0||i.indexOf(":")>-1)&&"Invalid"!==o&&(((i=o)&&i.indexOf("/")>-1||i.indexOf("-")>0||i.indexOf(":")>-1)&&(r=N(i,n,this.parent.locale,a&&a.format),t.isNullOrUndefined(r.dateObj)||"Invalid Date"===r.dateObj.toString()||(a=a||{},i=T(r.dateObj,i.indexOf(":")>-1,r.type&&"time"===r.type).toString(),a.format&&""!==a.format||("time"===r.type?a.format=O("Time"):a.format=O("ShortDate")),e.isDate="date"===r.type||"datetime"===r.type,e.isTime="time"===r.type,e.dateObj=r.dateObj)),e.updatedVal=i)},e.prototype.checkCustomDateFormat=function(e){var t=e.indexOf("/")>-1?e.split("/"):e.indexOf("-")>0?e.split("-"):"",r=["jan","feb","mar","apr","may","jun","jul","aug","sep","sept","oct","nov","dec"];return 2===t.length?r.indexOf(t[0].toLowerCase())>-1&&Number(t[1])<=31?"01-"+t[0]+"-"+t[1]:r.indexOf(t[1].toLowerCase())>-1&&Number(t[0])<=31?t[0]+"-"+t[1]+"-"+(new Date).getFullYear():Number(t[0])<=31&&Number(t[1])<=12?t[0]+"-"+t[1]+"-"+(new Date).getFullYear():Number(t[1])<=31&&Number(t[0])<=12?t[0]+"-"+t[1]+"-"+(new Date).getFullYear():Number(t[0])<=12&&Number(t[1])<=9999&&Number(t[1])>=1900?"01-"+t[0]+"-"+t[1]:"Invalid":e},e.prototype.formattedBarText=function(e){var r=H(e.cell?e.cell.format:""),n=new t.Internationalization,i=e.value,a="ShortDate"===r&&e.cell&&e.cell.format?e.cell.format:O("ShortDate"),o=O("Time");switch(r){case"ShortDate":case"LongDate":e.value=this.shortDateFormat({type:r,value:e.value,format:a},n);break;case"Time":e.value=this.shortDateFormat({type:r,value:e.value,format:a},n)+" "+this.timeFormat({type:r,value:e.value,format:o},n)}(!e.value||e.value&&e.value.toString().indexOf("null")>-1)&&(e.value=i)},e.prototype.addEventListener=function(){this.parent.on("applyNumber",this.numberFormatting,this),this.parent.on("getFormattedCell",this.getFormattedCell,this),this.parent.on(Nt,this.checkDateFormat,this),this.parent.on("getFormattedBarText",this.formattedBarText,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("applyNumber",this.numberFormatting),this.parent.off("getFormattedCell",this.getFormattedCell),this.parent.off(Nt,this.checkDateFormat),this.parent.off("getFormattedBarText",this.formattedBarText))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"workbookNumberFormat"},e}(),Zt=function(){function e(e){this.parent=e,this.requestedInfo=[],this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(At,this.updateSheetFromDataSourceHandler,this),this.parent.on("dataSourceChanged",this.dataSourceChangedHandler,this),this.parent.on("dataChanged",this.dataChangedHandler,this),this.parent.on("triggerDataChange",this.triggerDataChangeHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(At,this.updateSheetFromDataSourceHandler),this.parent.off("dataSourceChanged",this.dataSourceChangedHandler),this.parent.off("dataChanged",this.dataChangedHandler))},e.prototype.updateSheetFromDataSourceHandler=function(e){var t,n,i,a,o,s,l,h,d,p,u=this,f=[],g=[],m=new r.Deferred;if(e.promise=m.promise,e.sheet&&e.sheet.ranges.length)for(var v=this,y=e.sheet.ranges.length-1;y>=0;y--)!function(y){var C=e.indexes[0],b=e.indexes[2],x=e.sheet.ranges[y];h=c(x.startCell)[0],s=x.dataSource instanceof r.DataManager?x.dataSource:x.dataSource?new r.DataManager(x.dataSource):new r.DataManager,o=o||s.dataSource.url,e.sheet.isLocalData=!s.dataSource.url,h<=C?C-=h:h<=b?(b-=h,C=0):C=-1,x.showFieldAsHeader&&0!==C&&(C-=1);var S=!1,w=0;v.initRangeInfo(x);var I=v.getMaxCount(x);if(p=v.getLoadedInfo(C,b,x),C=p.unloadedRange[0],b=p.unloadedRange[1],x.info.insertRowRange&&(x.info.insertRowRange.forEach(function(e){w+=e[1]-e[0]+1}),C-=w,b-=w),C>I?S=!0:b>I&&(b=I),v.requestedInfo.push({deferred:m,indexes:e.indexes,isNotLoaded:p.isNotLoaded}),C>=0&&p.isNotLoaded&&!S){g[y]=C,f[y]=!1;var E=(x.query?x.query:new r.Query).clone();s.executeQuery(E.range(C,b>=I?b:b+1).requiresCount()).then(function(r){if(u.parent&&!u.parent.isDestroyed){if(a=r.result&&r.result.result?r.result.result:r.result,i=c(x.startCell),h=i[0],d=i[1],a&&a.length){if(x.info.count||(I=r.count,x.info.count=r.count),n=Object.keys(a[0]),x.info.fldLen||(x.info.fldLen=n.length,x.info.flds=n),x.info.insertColumnRange){var o=0;x.info.insertColumnRange.forEach(function(e){for(var t=e[0];t<=e[1];t++)t<=d?n.splice(0,0,"emptyCell"+o):n.splice(t-d,0,"emptyCell"+o),o++})}0===g[y]&&x.showFieldAsHeader&&(l=h+g[y]+w,n.forEach(function(r,n){(t=J(l,d+n,e.sheet,!0))?t.value||r.includes("emptyCell")||(t.value=r):e.sheet.rows[h+g[y]].cells[d+n]=r.includes("emptyCell")?{}:{value:r}})),a.forEach(function(r,i){l=h+g[y]+i+(x.showFieldAsHeader?1:0)+w;for(var a=0;a<n.length;a++)(t=J(l,d+a,e.sheet,!0))?t.value||n[a].includes("emptyCell")||Q(l,d+a,e.sheet,u.getCellDataFromProp(r[n[a]]),!0):e.sheet.rows[l].cells[d+a]=n[a].includes("emptyCell")?{}:u.getCellDataFromProp(r[n[a]]),u.checkDataForFormat({args:e,cell:t,colIndex:d+a,rowIndex:l,i:i,j:a,k:y,range:x,sRanges:g,value:r[n[a]]})})}else n=[];if(e.sheet.usedRange.rowIndex=Math.max(h+(I||r.count)+(x.showFieldAsHeader?1:0)+w-1,e.sheet.usedRange.rowIndex),e.sheet.usedRange.colIndex=Math.max(d+n.length-1,e.sheet.usedRange.colIndex),w?(p=u.getLoadedInfo(C,b,x),C=p.unloadedRange[0],b=p.unloadedRange[1],C>I&&(p.isNotLoaded=!1),p.isNotLoaded&&(b>I&&(b=I),x.info.loadedRange.push([C,b]))):x.info.loadedRange.push([C,b]),f[y]=!0,-1===f.indexOf(!1)){if(b+h<h+x.info.count){e.rangeSettingCount||(e.rangeSettingCount=[]),e.rangeSettingCount.push(y);var s={sheet:e.sheet,indexes:[0,0,e.sheet.usedRange.rowIndex,e.sheet.usedRange.colIndex],promise:new Promise(function(e,t){e(void 0)}),rangeSettingCount:e.rangeSettingCount};u.updateSheetFromDataSourceHandler(s),s.promise.then(function(){"workbook"!==u.parent.getModuleName()&&(e.rangeSettingCount.pop(),e.rangeSettingCount.length||u.parent.notify("created",null),e.formulaCellRef&&u.notfyFormulaCellRefresh(e.formulaCellRef,e.sheetIndex))})}else e.formulaCellRef&&u.notfyFormulaCellRefresh(e.formulaCellRef,e.sheetIndex);u.checkResolve(e.indexes)}}})}else 0===y&&-1===f.indexOf(!1)&&v.checkResolve(e.indexes)}(y);else m.resolve()},e.prototype.notfyFormulaCellRefresh=function(e,t){this.parent.formulaRefCell=null,this.parent.notify("updateView",{indexes:c(e),sheetIndex:t,refreshing:!0})},e.prototype.checkResolve=function(e){var t,r,n=0;this.requestedInfo.forEach(function(i,a){((r=JSON.stringify(i.indexes)===JSON.stringify(e))||t)&&(0===a?(i.deferred.resolve(),n++,t=!0):!t||!i.isLoaded&&i.isNotLoaded?r&&t?(i.deferred.resolve(),n++):r?i.isLoaded=!0:t=!1:(i.deferred.resolve(),n++))}),this.requestedInfo.splice(0,n)},e.prototype.getCellDataFromProp=function(e){var t={};return"[object Object]"===Object.prototype.toString.call(e)?e.formula?t.formula=e.formula:e.value&&("string"==typeof e.value&&(0===e.value.indexOf("http://")||0===e.value.indexOf("https://")||0===e.value.indexOf("ftp://")||0===e.value.indexOf("www."))?t.hyperlink=e.value:t.value=e.value):q(e)?t.formula=e:"string"==typeof e&&(0===e.indexOf("http://")||0===e.indexOf("https://")||0===e.indexOf("ftp://")||0===e.indexOf("www."))?t.hyperlink=e:t.value=e,t},e.prototype.checkDataForFormat=function(e){if(""!==e.value){var t={value:e.value,rowIndex:e.rowIndex,colIndex:e.colIndex,isDate:!1,updatedVal:e.value,isTime:!1};this.parent.notify(Nt,t),t.isDate?e.cell?(e.cell.format=O("ShortDate"),e.cell.value=t.updatedVal):(e.args.sheet.rows[e.rowIndex].cells[e.colIndex].format=O("ShortDate"),e.args.sheet.rows[e.rowIndex].cells[e.colIndex].value=t.updatedVal):t.isTime&&(e.cell?(e.cell.format=O("Time"),e.cell.value=t.updatedVal):(e.args.sheet.rows[e.rowIndex].cells[e.colIndex].format=O("Time"),e.args.sheet.rows[e.rowIndex].cells[e.colIndex].value=t.updatedVal))}},e.prototype.getLoadedInfo=function(e,t,r){var n=!0;return r.info.loadedRange.forEach(function(r){r[0]<=e&&e<=r[1]?r[0]<=t&&t<=r[1]?n=!1:e=r[1]+1:r[0]<=t&&t<=r[1]&&(t=r[0]-1)}),{isNotLoaded:n,unloadedRange:[e,t]}},e.prototype.getMaxCount=function(e){if(e.query)for(var t=e.query.queries,r=0;r<t.length;r++)if("onTake"===t[r].fn)return Math.min(t[r].e.nos,e.info.count||t[r].e.nos);return e.info.count},e.prototype.initRangeInfo=function(e){e.info||(e.info={loadedRange:[]})},e.prototype.dataSourceChangedHandler=function(e){var t,r=this,n=this.parent.sheets[e.sheetIdx],i=n.ranges[e.rangeIdx];if(i&&(this.checkRangeHasChanges(n,e.rangeIdx)||!i.info)){var a=i.showFieldAsHeader,o=u(i.startCell);i.info&&(i.info.loadedRange.forEach(function(e){for(var r=e[0];r<=e[1]&&r<i.info.count+(a?1:0);r++)if(t=n.rows[r+o[0]])for(var s=o[1];s<o[1]+i.info.fldLen;s++)t.cells&&t.cells[s]&&delete t.cells[s]}),i.info=null);var s=this.parent.viewport,l=[s.topIndex,s.leftIndex,s.bottomIndex,s.rightIndex],h={sheet:n,indexes:l,promise:new Promise(function(e,t){e(void 0)})};this.updateSheetFromDataSourceHandler(h),h.promise.then(function(){r.parent.notify("updateView",{indexes:l})})}},e.prototype.checkRangeHasChanges=function(e,t){if(this.parent.isAngular){return e.changedRangeIdx===parseInt(t,10)&&(delete e.changedRangeIdx,!0)}return!0},e.prototype.dataChangedHandler=function(e){var t,r,n,i,a,o,s,l,h,d=this,p=[{}],f=this.parent.activeSheetIndex,m=this.parent.sheets[f];m.ranges.forEach(function(v,y){if(v.dataSource){var C=void 0;if(i=u(v.startCell),n=i.concat([i[0]+v.info.count+(v.showFieldAsHeader?0:-1),i[1]+v.info.fldLen-1]),"Row"===e.modelType)e.insertType?(a=(v.showFieldAsHeader||"above"!==e.insertType?n[0]<e.index:n[0]<=e.index)&&n[2]>=e.index,l=[e.index],a?(C=!0,v.info.count+=e.model.length):n[2]+1===e.index&&"below"===e.insertType?(C=!0,v.info.count+=e.model.length):n[0]>=e.index&&(v.startCell=g(i[0]+e.model.length,i[1]))):(a=n[0]<=e.startIndex&&n[2]>=e.startIndex,t="delete");else{l=c("paste"===e.requestType?e.pastedRange.split("!")[1]:e.sheetIdx>-1?e.address:(e.address||e.range).split("!")[1]);var b=[v.showFieldAsHeader?n[0]+1:n[0]].concat(n.slice(1,4));a=Y(b,l,!0),"paste"===e.requestType&&e.copiedInfo.isCut&&(h=[].slice.call(e.copiedInfo.range),o=Y(b,h,!0))}if(a||C||o){if("Row"!==e.modelType||e.insertType){t=C?"add":"edit";var x=0;if(o){x=h[2]-h[0]+1;for(S=0;S<x;S++)!function(e){p[e]={},v.info.flds.forEach(function(t,n){r=J(h[0]+e,i[1]+n,m),p[e][t]=r&&r.value||null})}(S)}if(a||C)for(var S=0;S<(C?e.model.length:l[2]-l[0]+1||1);S++)!function(e){p[e+x]={},v.info.flds.forEach(function(t,n){r=J(l[0]+e,i[1]+n,m),p[e+x][t]=r&&r.value||null})}(S)}else e.deletedModel.forEach(function(e,t){p[t]={},v.info.flds.forEach(function(n,a){e.cells?(r=e.cells[i[1]+a],p[t][n]=r&&r.value||null):p[t][n]=null}),v.info.count-=1}),s={count:e.deletedModel.length,index:e.endIndex};d.parent.trigger("dataSourceChanged",{data:p,action:t,rangeIndex:y,sheetIndex:f})}else s&&s.count&&n[0]>s.index&&(v.startCell=g(i[0]-s.count,i[1]))}})},e.prototype.triggerDataChangeHandler=function(e){var t=["insert","delete","edit","cellDelete","cellSave","clipboard","clear"],r=!0;("delete"===e.action||"insert"===e.action)&&["Column","Sheet"].indexOf(e.eventArgs.modelType)>-1?r=!1:"clear"===e.action&&["Clear Formats","Clear Hyperlinks"].indexOf(e.eventArgs.type)>-1?r=!1:"clipboard"===e.action&&"Formats"===e.eventArgs.requestType&&(r=!1),!e.isUndo||"delete"!==e.action&&"insert"!==e.action||("delete"===e.action?(e.eventArgs.index=e.eventArgs.startIndex,e.eventArgs.model=e.eventArgs.deletedModel,e.eventArgs.insertType="below"):(e.eventArgs.startIndex=e.eventArgs.index,e.eventArgs.endIndex=e.eventArgs.index+e.eventArgs.model.length-1,e.eventArgs.deletedModel=e.eventArgs.model,delete e.eventArgs.insertType)),r&&t.indexOf(e.action)>-1&&this.parent.notify("dataChanged",e.eventArgs)},e.prototype.getModuleName=function(){return"dataBind"},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null,this.requestedInfo=[]},e}(),Jt="initialLoad",Qt="editOperation",er="click",tr="keyUp",rr="keyDown",nr="contextmenuBeforeOpen",ir="removeSheetTab",ar="cut",or="paste",sr="rowHeightChanged",lr="hideShow",hr="autoFitRowsColumns",dr="initiateFilterUI",pr="actionComplete",cr="actionBegin",ur="renderGotoDlgt",fr="renderFindDlg",gr="replaceHandler",mr="clearViewer",vr="refreshImgCellObj",yr="createImageElement",Cr="deleteImage",br="deleteChart",xr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.open=function(e){var t=this;if(this.parent.allowOpen){if(e.jsonObject)return void this.fetchSuccess(e.jsonObject,null);var r=new FormData;if(!e.file)return void(this.parent.isOpen=!1);r.append("file",e.file);var n={passWord:""};e.password&&e.password.length&&(n.passWord=e.password),n.passWord&&n.passWord.length&&(e.password=n.passWord),e.password&&r.append("password",e.password);var i={file:e.file||null,cancel:!1,requestData:{method:"POST",body:r},password:n.passWord};this.parent.trigger("beforeOpen",i),this.parent.notify(cr,{eventArgs:i,action:"beforeOpen"}),i.cancel||fetch(this.parent.openUrl,i.requestData).then(function(e){return e.ok?e.json():Promise.reject({status:e.status,statusText:e.statusText,url:e.url})}).then(function(e){return t.fetchSuccess(e,i)}).catch(function(e){return t.fetchFailure(e)})}},e.prototype.fetchFailure=function(e){t.isUndefined(e.status)&&t.isUndefined(e.statusText)&&(e.statusText="Improper response"),this.parent.notify("openFailure",e),this.parent.isOpen=!1},e.prototype.fetchSuccess=function(e,t){var r=["UnsupportedFile","InvalidUrl","NeedPassword","InCorrectPassword"],n=e,i=(n="string"==typeof e?JSON.parse(e):e).Workbook;if(r.indexOf(i)>-1)return void this.parent.notify("openSuccess",{context:this,data:i,eventArgs:t});this.updateModel(i),this.parent.notify("openSuccess",{context:this,data:i}),this.parent.isOpen=!1,t&&t.password&&t.password.length>0&&(this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled")),this.parent.password="")},e.prototype.updateModel=function(e){this.parent.notify(Lt,{action:"unRegisterSheet"}),this.parent.sheetNameCount=1,this.parent.sheets=[],this.parent.notify("sheetsDestroyed",{}),e.activeSheetIndex=e.activeSheetIndex||0,this.setSelectAllRange(e.sheets),this.parent.setProperties({sheets:e.sheets,activeSheetIndex:e.activeSheetIndex,definedNames:e.definedNames||[],filterCollection:e.filterCollection||[],sortCollection:e.sortCollection||[]},!0),ve(this.parent),this.parent.notify("sheetCreated",null),this.parent.notify(Lt,{action:"registerSheet",isImport:!0}),this.parent.notify(Lt,{action:"initiateDefinedNames"}),this.parent.notify("protectSheet",null),this.parent.notify("updateFilter",{isOpen:!0})},e.prototype.setSelectAllRange=function(e){e.forEach(function(e){if(e.selectedRange){var r=c(e.selectedRange),n=(t.isUndefined(e.rowCount)?100:e.rowCount)-1,i=(t.isUndefined(e.colCount)?100:e.colCount)-1;65535===r[2]&&(r[2]=n),255===r[3]&&(r[3]=i),65535===r[0]&&(r[0]=n),255===r[1]&&(r[1]=i),e.selectedRange=m(r)}})},e.prototype.addEventListener=function(){this.parent.on("workbookOpen",this.open.bind(this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("workbookOpen",this.open.bind(this))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"workbookOpen"},e}(),Sr=function(){function e(e){this.parent=e}return e.prototype.processSheet=function(e,t){return[t,JSON.parse(e,function(e,t){if(!Array.isArray(t)&&"string"!=typeof t||t.length)return t})]},e.prototype.processSave=function(e,t,r){var n,i=new FormData,a=Object.keys(t);for(i.append("JSONData",JSON.stringify(e)),n=0;n<a.length;n++)i.append(a[n],t[a[n]]);for(a=Object.keys(r),n=0;n<a.length;n++)i.append(a[n],r[a[n]]);fetch(t.url,{method:"POST",body:i}).then(function(e){return e.ok?e.blob():Promise.reject({message:e.statusText})}).then(function(e){new Promise(function(t){var r=new FileReader;r.onload=function(){var n=r.result.toString();if(n.indexOf("data:text/plain;base64,")>-1||n.indexOf("data:text/html;base64,")>-1||n.indexOf("data:application/json;base64,")>-1){var i=void 0;if(n=n.replace("data:text/plain;base64,",""),n=n.replace("data:text/html;base64,",""),n.indexOf("data:application/json;base64,")>-1?(n=n.replace("data:application/json;base64,",""),i=atob(n).split(".")):i=atob(n).split(/(\r\n|\n|\r)/gm),i.length){var a=i[0].length>1&&'"'===i[0][0]?i[0].split('"')[1]+".":i[0];postMessage({dialog:a})}}else postMessage(e);t(r.result)},r.readAsDataURL(e)})}).catch(function(e){postMessage({error:e.message})})},e}(),wr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ir=function(e){function r(t){var r=e.call(this,t)||this;return r.isProcessCompleted=!1,r.saveJSON={},r.isFullPost=!1,r.needBlobData=!1,r.customParams=null,r.addEventListener(),r}return wr(r,e),r.prototype.getModuleName=function(){return"workbookSave"},r.prototype.destroy=function(){this.removeEventListener(),this.parent=null},r.prototype.addEventListener=function(){this.parent.on("beginSave",this.initiateSave,this)},r.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("beginSave",this.initiateSave)},r.prototype.initiateSave=function(e){var t=e.saveSettings;this.parent.notify("getFilteredCollection",null),this.saveSettings={saveType:t.saveType,url:t.url,fileName:t.fileName||"Sample"},this.isFullPost=e.isFullPost,this.needBlobData=e.needBlobData,this.needBlobData&&(this.isFullPost=!1),this.customParams=e.customParams,this.updateBasicSettings(),this.processSheets()},r.prototype.updateBasicSettings=function(){var e=this.getStringifyObject(this.parent,["sheets","_isScalar","observers","closed","isStopped","hasError","__isAsync","beforeCellFormat","beforeCellRender","beforeDataBound","beforeOpen","beforeSave","beforeSelect","beforeSort","cellEdit","cellEditing","cellSave","beforeCellSave","contextMenuItemSelect","contextMenuBeforeClose","contextMenuBeforeOpen","created","dataBound","fileMenuItemSelect","fileMenuBeforeClose","fileMenuBeforeOpen","saveComplete","sortComplete","select","actionBegin","actionComplete","afterHyperlinkClick","afterHyperlinkCreate","beforeHyperlinkClick","beforeHyperlinkCreate","openComplete","openFailure","queryCellInfo","dialogBeforeOpen","dataSourceChanged"]),t=JSON.parse(e);this.parent.sheets.length&&(t.sheets=[]),this.saveJSON=t},r.prototype.processSheets=function(){for(var e=0,t=this.parent.sheets.length,r=["dataSource","startCell","query","showFieldAsHeader"];e<t;)E(this,this.processSheet,this.updateSheet,[this.getStringifyObject(this.parent.sheets[e],r),e]),e++},r.prototype.updateSheet=function(e){this.saveJSON.sheets[e[0]]=e[1],this.isProcessCompleted=this.getSheetLength(this.saveJSON.sheets)===this.parent.sheets.length,this.isProcessCompleted&&this.save(this.saveSettings)},r.prototype.getSheetLength=function(e){var t=0;return e.forEach(function(e){e&&t++}),t},r.prototype.save=function(e){var t={cancel:!1,jsonObject:this.saveJSON};this.parent.notify("onSave",t),t.cancel||(this.isFullPost?this.initiateFullPostSave():E(this,{workerTask:this.processSave},this.updateSaveResult,[this.saveJSON,e,this.customParams],!0)),this.saveJSON={}},r.prototype.updateSaveResult=function(e){var t={status:"Success",message:"",url:this.saveSettings.url,fileName:this.saveSettings.fileName,saveType:this.saveSettings.saveType,blobData:null};"object"==typeof e&&e.error?(t.status="Failure",t.message=e.error.toString()):"object"==typeof e&&e.dialog?this.parent.notify("saveError",{content:e.dialog}):this.needBlobData?t.blobData=e:this.ClientFileDownload(e),this.parent.trigger("saveComplete",t),this.parent.notify("saveCompleted",t)},r.prototype.ClientFileDownload=function(e){var t=this.parent.createElement("a",{attrs:{download:this.getFileNameWithExtension()}}),r=URL.createObjectURL(e);t.href=r,document.body.appendChild(t),t.click(),URL.revokeObjectURL(r),document.body.removeChild(t)},r.prototype.initiateFullPostSave=function(){var e,r=Object.keys(this.saveSettings),n=this.parent.createElement("form",{attrs:{method:"POST",action:this.saveSettings.url}}),i=this.parent.createElement("input",{attrs:{type:"hidden",name:"JSONData"}});for(i.value=JSON.stringify(this.saveJSON),n.appendChild(i),e=0;e<r.length;e++)(i=this.parent.createElement("input",{attrs:{type:"hidden",name:r[e]}})).value=this.saveSettings[r[e]],n.appendChild(i);for(r=Object.keys(this.customParams),e=0;e<r.length;e++)(i=this.parent.createElement("input",{attrs:{type:"hidden",name:r[e]}})).value=this.customParams[r[e]],n.appendChild(i);document.body.appendChild(n),n.submit(),t.detach(n),this.parent.notify("saveCompleted",{})},r.prototype.getStringifyObject=function(e,t){return void 0===t&&(t=[]),JSON.stringify(e,function(e,r){return t.indexOf(e)>-1?void 0:r&&"object"==typeof r&&r.hasOwnProperty("properties")?r.properties:null!==r?r:void 0})},r.prototype.getFileNameWithExtension=function(e){e||(e=this.saveSettings.fileName);var t=this.getFileExtension(),r=e.lastIndexOf(".");return r>-1&&(e=e.substr(0,r)),e+t},r.prototype.getFileExtension=function(){return"."+this.saveSettings.saveType.toLowerCase()},r}(Sr),Er=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"calc-common"},e}(),Rr=function(){function e(e){this.loadedModules=[],this.parent=e}return e.prototype.inject=function(e,t){var r=e.length;if(0===r)return void this.clean();this.loadedModules.length&&this.clearUnusedModule(e);for(var n=0;n<r;n++)for(var i=e[n],a=0,o=t;a<o.length;a++){var s=o[a],l=i.member;if(s.prototype.getModuleName()===i.member&&!this.isModuleLoaded(l)){var h=this.createInstance(s,i.args),d=this.getMemberName(l);i.isProperty?U(d,s,this.parent):U(d,h,this.parent);var p=i;p.member=d,this.loadedModules.push(p)}}},e.prototype.createInstance=function(e,t){var r=t;return r.unshift(void 0),new(Function.prototype.bind.apply(e,r))},e.prototype.clean=function(){for(var e=0,t=this.loadedModules;e<t.length;e++){var r=t[e];r.isProperty||_(r.member,this.parent).destroy()}this.loadedModules=[]},e.prototype.clearUnusedModule=function(e){for(var t=this,r=e.map(function(e){return t.getMemberName(e.member)}),n=0,i=this.loadedModules.filter(function(e){return-1===r.indexOf(e.member)});n<i.length;n++){var a=i[n];a.isProperty||_(a.member,this.parent).destroy(),this.loadedModules.splice(this.loadedModules.indexOf(a),1),this.deleteObject(this.parent,a.member)}},e.prototype.getMemberName=function(e){return e[0].toLowerCase()+e.substring(1)+"Module"},e.prototype.deleteObject=function(e,t){delete e[t]},e.prototype.isModuleLoaded=function(e){for(var t=0,r=this.loadedModules;t<r.length;t++)if(r[t].member===this.getMemberName(e))return!0;return!1},e}();!function(e){e[e.na=0]="na",e[e.value=1]="value",e[e.ref=2]="ref",e[e.divzero=3]="divzero",e[e.num=4]="num",e[e.name=5]="name",e[e.null=6]="null"}(e.CommonErrors||(e.CommonErrors={})),function(e){e[e.operators_cannot_start_with_expression=0]="operators_cannot_start_with_expression",e[e.reservedWord_And=1]="reservedWord_And",e[e.reservedWord_Xor=2]="reservedWord_Xor",e[e.reservedWord_If=3]="reservedWord_If",e[e.number_contains_2_decimal_points=4]="number_contains_2_decimal_points",e[e.reservedWord_Else=5]="reservedWord_Else",e[e.reservedWord_Not=6]="reservedWord_Not",e[e.invalid_char_in_number=7]="invalid_char_in_number",e[e.invalid_characters_following_with_operator=6]="invalid_characters_following_with_operator",e[e.mismatched_parentheses=8]="mismatched_parentheses",e[e.unknown_formula_name=9]="unknown_formula_name",e[e.requires_a_single_argument=10]="requires_a_single_argument",e[e.requires_3_args=11]="requires_3_args",e[e.invalid_Math_argument=12]="invalid_Math_argument",e[e.requires_2_args=13]="requires_2_args",e[e.bad_index=14]="bad_index",e[e.too_complex=15]="too_complex",e[e.circular_reference=16]="circular_reference",e[e.missing_formula=17]="missing_formula",e[e.improper_formula=18]="improper_formula",e[e.invalid_expression=19]="invalid_expression",e[e.cell_empty=20]="cell_empty",e[e.bad_formula=21]="bad_formula",e[e.empty_expression=22]="empty_expression",e[e.virtual_mode_required=23]="virtual_mode_required",e[e.mismatched_tics=24]="mismatched_tics",e[e.wrong_number_arguments=25]="wrong_number_arguments",e[e.invalid_arguments=26]="invalid_arguments",e[e.iterations_do_not_converge=27]="iterations_do_not_converge",e[e.calculation_overflow=29]="calculation_overflow",e[e.already_registered=28]="already_registered",e[e.missing_sheet=30]="missing_sheet",e[e.cannot_parse=31]="cannot_parse",e[e.expression_cannot_end_with_an_operator=32]="expression_cannot_end_with_an_operator"}(e.FormulasErrorsStrings||(e.FormulasErrorsStrings={}));var kr=function(){function n(e){this.formulas=[{formulaName:"SUM",category:"Math & Trig",description:"Sums individual values, cell references or ranges."},{formulaName:"SUMIFS",category:"Math & Trig",description:"Sums the cells specified by a given set of conditionsor criteria."},{formulaName:"SUMPRODUCT",category:"Math & Trig",description:"Returns sum of the product of given ranges of arrays."},{formulaName:"ABS",category:"Math & Trig",description:"Returns the absolute value of a number."},{formulaName:"RAND",category:"Math & Trig",description:"Return a random number between 0 and 1."},{formulaName:"FLOOR",category:"Math & Trig",description:"Returns the round a number down to the nearest integer."},{formulaName:"CEILING",category:"Math & Trig",description:"Returns a number rounded up to a multiple of another number."},{formulaName:"SUMIF",category:"Math & Trig",description:"It will sum up cells that meet the given criteria."},{formulaName:"PRODUCT",category:"Math & Trig",description:"Multiplies all the numbers given as arguments and returns the product."},{formulaName:"AVERAGE",category:"Statistical",description:"The sum of the numbers divided by how many numbers are being averaged."},{formulaName:"AVERAGEIF",category:"Statistical",description:"Computes the average of the numbers in a range that meet the supplied criteria."},{formulaName:"COUNT",category:"Statistical",description:"Counts the numbers in the list of arguments, exclude text entries."},{formulaName:"COUNTA",category:"Statistical",description:"Counts the non-empty values in the list of arguments."},{formulaName:"COUNTIF",category:"Statistical",description:"Counts the number of cells in a range that meet a specified condition."},{formulaName:"COUNTIFS",category:"Statistical",description:"Counts the number of times each cells in all the ranges that meet the specific conditions."},{formulaName:"AVERAGEA",category:"Statistical",description:"Calculates the average of values in the list of arguments.Arguments can be numbers, names, arrays or references."},{formulaName:"AVERAGEIFS",category:"Statistical",description:"Conditionally returns the average of the contents of cells for the set of ranges."},{formulaName:"MIN",category:"Statistical",description:"Returns the smaller number in set of arguments."},{formulaName:"MAX",category:"Statistical",description:"Returns the largest number in set of arguments."},{formulaName:"DATE",category:"Date",description:"Returns the date, given the year, month and day of the month."},{formulaName:"DAY",category:"Date",description:"Returns the day of a given date."},{formulaName:"TODAY",category:"Date",description:"Returns the current date as date value."},{formulaName:"DAYS",category:"Date",description:"Returns the number of days between two dates."},{formulaName:"IF",category:"Logical",description:"Returns one value if a logical expression is TRUE and another if it is FALSE"},{formulaName:"AND",category:"Logical",description:"Returns TRUE if all the arguments are considered TRUE, and FALSE otherwise."},{formulaName:"IFS",category:"Logical",description:"Checks multiple conditions and returns a value corresponding to the first TRUE result."},{formulaName:"IFERROR",category:"Logical",description:"Returns a value you specify if a formula evaluates to an error; otherwise, it returns the result of the formula."},{formulaName:"CHOOSE",category:"Lookup & Reference",description:"Returns a value from a list, given an index number."},{formulaName:"INDEX",category:"Lookup & Reference",description:"Returns a value from a table, given a row and column number."},{formulaName:"FIND",category:"Text",description:"Returns the position of a string of text within another string."},{formulaName:"CONCATENATE",category:"Text",description:" Used to join two or more strings together."},{formulaName:"CONCAT",category:"Text",description:"Concatenates a list or range of text strings."},{formulaName:"SUBTOTAL",category:"Lookup & Reference",description:"Returns a subtotal in a list or database."},{formulaName:"RADIANS",category:"Math & Trig",description:"Converts degrees to radians."},{formulaName:"OR",category:"Logical",description:"Returns TRUE if any arguments considered TRUE, and all the arguments are FALSE it will return FALSE."},{formulaName:"MATCH",category:"Lookup & Reference",description:"Returns the relative position of an checked item in range that matches a specified value in a specified order"},{formulaName:"RANDBETWEEN",category:"Math & Trig",description:"Returns an integer random number in a specified range."},{formulaName:"SLOPE",category:"Statistical",description:"Returns the slope of the line from linear regression of the data points."},{formulaName:"INTERCEPT",category:"Statistical",description:"Calculates the point of the Y-intercept line via linear regression."},{formulaName:"ROUNDUP",category:"Math & Trig",description:"Rounds a number away from zero."},{formulaName:"INT",category:"Math & Trig",description:"Returns a number to the nearest integer."},{formulaName:"LN",category:"Math & Trig",description:"Returns the natural logarithm of a number."},{formulaName:"ISNUMBER",category:"Information",description:"Returns TRUE, if the argument is number and FALSE otherwise."},{formulaName:"ROUND",category:"Math & Trig",description:"Rounds a number to a specified number of digits."},{formulaName:"LOG",category:"Math & Trig",description:"Returns the logarithm of a number to the base that you specify."},{formulaName:"POWER",category:"Math & Trig",description:"Returns the result of a number raised to power."},{formulaName:"TRUNC",category:"Math & Trig",description:"Returns the truncated value of a number to a specified number of decimal places."},{formulaName:"EXP",category:"Math & Trig",description:"Returns e raised to the power of the given number."},{formulaName:"GEOMEAN",category:"Statistical",description:"Returns the geometric mean of an array or range of positive data."},{formulaName:"TEXT",category:"Lookup & Reference",description:"Converts a value to text in specified number format."},{formulaName:"SORT",category:"Lookup & Reference",description:"Sorts a range of an array."}],this.isConcat=!1,this.parent=e,this.init()}return n.prototype.init=function(){for(var e,r=0;r<this.formulas.length;r++)e=t.getValue("Compute"+this.formulas[r].formulaName,this).bind(this),this.addFormulaCollection(this.formulas[r].formulaName.toUpperCase(),e,this.formulas[r].category,this.formulas[r].description)},n.prototype.addFormulaCollection=function(e,t,r,n){this.parent.libraryFormulas={fName:e,handler:t,category:r,description:n}},n.prototype.ComputeSUM=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];var i,a,o=0;if(!t.isNullOrUndefined(r))for(var s=r,l=0;l<s.length;l++){var h=s[l].toString();if(h.indexOf(":")>-1&&this.parent.isCellReference(h))for(var d=this.parent.getCellCollection(h.split(this.parent.tic).join("")),p=0;p<d.length;p++){if(i=this.parent.getValueFromArg(d[p]),this.parent.getErrorStrings().indexOf(i)>-1)return i;t.isNullOrUndefined(i[0])||isNaN(this.parent.parseFloat(i))||(o+=this.parent.parseFloat(i))}else{if(s[l].split(this.parent.tic).join("")===this.parent.trueValue&&(s[l]="1"),s[l].split(this.parent.tic).join("")===this.parent.falseValue&&(s[l]="0"),a=this.parent.getValueFromArg(s[l].split(this.parent.tic).join("")),this.parent.getErrorStrings().indexOf(a)>-1)return a;if(t.isNullOrUndefined(a)||isNaN(this.parent.parseFloat(a)))continue;a.length>0&&(o+=this.parent.parseFloat(a+""))}}return o},n.prototype.ComputeINT=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,a,o;return(!t.isNullOrUndefined(r)&&1!==r.length||""===r[0])&&(i=this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments]),""!==r[0]&&1===r.length&&(o=(i=r[0]).indexOf('"'),i=(i=i.indexOf('"')>-1?i.replace('"',""):i).indexOf('"')>-1?i.replace('"',""):i,i="TRUE"===(i=this.parent.getValueFromArg(i)).toUpperCase()?"1":"FALSE"===i?"0":i,a=this.parent.parseFloat(i),a=Math.floor(a)),isNaN(a)&&(i=o>-1?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.getErrorStrings()[e.CommonErrors.name]),a||i},n.prototype.ComputeTODAY=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n;if(t&&""!==t[0])n=this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];else{var i=new Date(Date.now());n=i.getFullYear()+"/"+this.parent.calculateDate((i.getMonth()+1).toString())+"/"+this.parent.calculateDate(i.getDate().toString())}return n},n.prototype.ComputeSUMPRODUCT=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n,i=0,a=0,o=null,s=t,l=0;l<s.length;++l){var h=s[l];if(h.startsWith(this.parent.tic)||!this.parent.isCellReference(h)){var d=this.parent.getValueFromArg(h);return n=d.indexOf('"'),this.parent.getErrorStrings().indexOf(d)>-1?d:n>-1?0:this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments]}var p=h.indexOf(":"),c=this.parent.rowIndex(h.substr(0,p)),u=this.parent.rowIndex(h.substr(p+1));if(!(-1!==c||-1===u)==(-1===c||-1!==u))return this.parent.getErrorStrings()[e.CommonErrors.name];var f=this.parent.colIndex(h.substr(0,p)),g=this.parent.colIndex(h.substr(p+1));if(null===o)for(a=(u-c+1)*(g-f+1),o=[],p=0;p<a;++p)o[p]=1;p=0;for(var m=c;m<=u;++m)for(var v=f;v<=g;++v){var y=this.getSheetReference(h)+this.parent.convertAlpha(v)+m,C=this.parent.getValueFromArg(y);if(isNaN(parseFloat(C)))o[p]=0;else{if(isNaN(o[p]))return this.parent.getErrorStrings()[e.CommonErrors.name];o[p]=o[p]*parseFloat(C)}p++}}for(p=0;p<a;++p)i+=o[p];return i},n.prototype.ComputeROUNDUP=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,a,o,s,l,h=r.length;if(!t.isNullOrUndefined(r)&&h>2&&(i=this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments]),1===h&&""!==r[0])l=r[0].indexOf('"'),o="TRUE"===(o=(o=r[0].indexOf('"')>-1?r[0].replace('"',""):r[0]).indexOf('"')>-1?o.replace('"',""):o).toUpperCase()?"1":"FALSE"===o?"0":o,o=this.parent.getValueFromArg(o),(a=this.parent.parseFloat(o))>0?a+=.4999999999:a<0&&(a-=.4999999999),i=(a=this.parent.parseFloat(a.toFixed(0))).toString();else if(2===h&&""!==r[0]&&""!==r[1]){l=r[0].indexOf('"')>-1?r[0].indexOf('"'):r[1].indexOf('"')>-1?r[1].indexOf('"'):-1,o=(o=r[0].indexOf('"')>-1?r[0].replace('"',""):r[0]).indexOf('"')>-1?o.replace('"',""):o,s=(s=r[1].indexOf('"')>-1?r[1].replace('"',""):r[1]).indexOf('"')>-1?s.replace('"',""):s,o="TRUE"===o.toUpperCase()?"1":"FALSE"===o?"0":o,s="TRUE"===s.toUpperCase()?"1":"FALSE"===s?"0":s,o=this.parent.getValueFromArg(o),s=this.parent.getValueFromArg(s);var d=Math.ceil(this.parent.parseFloat(s));a=this.parent.parseFloat(o),d>0?(a>0?a+=.4999999999/Math.pow(10,d):a<0&&(a-=.4999999999/Math.pow(10,d)),i=(a=this.parent.parseFloat(a.toFixed(d))).toFixed(d),isNaN(a)&&(i=d.toString().indexOf('"')>-1?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.getErrorStrings()[e.CommonErrors.name])):(a>0?a=a/Math.pow(10,-d)+.49999:a<0&&(a=a/Math.pow(10,-d)-.49999),i=(a=this.parent.parseFloat(a.toFixed(0))*Math.pow(10,-d)).toString(),isNaN(a)&&(i=d.toString().indexOf('"')>-1?this.parent.getErrorStrings()[e.CommonErrors.value]:i=this.parent.getErrorStrings()[e.CommonErrors.name]))}else i=l>-1?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];return i},n.prototype.ComputeCOUNT=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var i,a,o,s=r,l=0,h=0;h<s.length;h++)if((i=s[h]).indexOf(":")>-1&&this.parent.isCellReference(i)){a=this.parent.getCellCollection(i.split(this.parent.tic).join(""));for(var d=0;d<a.length;d++)o=this.parent.getValueFromArg(a[d]),isNaN(this.parent.parseFloat(o))||i.length>0&&""!==i&&" "!==i&&l++}else i=i.split(this.parent.tic).join(""),isNaN(this.parent.parseFloat(this.parent.getValueFromArg(i)))||i.length>0&&""!==i&&" "!==i&&l++;return l},n.prototype.ComputeDATE=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=r;if(3!==i.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var a=0;a<i.length;++a)i[a]=this.parent.getValueFromArg(i[a]);i[0]="TRUE"===i[0].split(this.parent.tic).join("")?"1":"FALSE"===i[0].split(this.parent.tic).join("")?"0":i[0],i[1]="TRUE"===i[1].split(this.parent.tic).join("")?"1":"FALSE"===i[1].split(this.parent.tic).join("")?"0":i[1],i[2]="TRUE"===i[2].split(this.parent.tic).join("")?"1":"FALSE"===i[2].split(this.parent.tic).join("")?"0":i[2];var o=this.parent.parseFloat(i[0].split(this.parent.tic).join("")),s=this.parent.parseFloat(i[1].split(this.parent.tic).join("")),l=this.parent.parseFloat(i[2].split(this.parent.tic).join("")),h=0;if(isNaN(o)||isNaN(s)||isNaN(l))return this.parent.getErrorStrings()[e.CommonErrors.value].toString();if(o<0)return this.parent.getErrorStrings()[e.CommonErrors.num].toString();for(;s>12;)s-=12,o++;if(0===(h=this.parent.getSerialDateFromDate(o,s,l)))return this.parent.getErrorStrings()[e.CommonErrors.num].toString();var d=this.parent.fromOADate(h);return"Invalid Date"!==d.toString()?d.getFullYear()+"/"+this.parent.calculateDate((d.getMonth()+1).toString())+"/"+this.parent.calculateDate(d.getDate().toString()):h.toString()},n.prototype.ComputeFLOOR=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];var i,a,o=r,s=o.length,l=o[1].split(this.parent.tic).join(""),h=[];if(2!==s)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(h.push(i=this.parent.parseFloat(this.parent.getValueFromArg(o[0].split(this.parent.tic).join("")))),o[1]=l===this.parent.trueValue?"1":l===this.parent.falseValue?"0":o[1],h.push(a=this.parent.parseFloat(this.parent.getValueFromArg(o[1].split(this.parent.tic).join("")))),i>0&&a<0)return this.parent.getErrorStrings()[e.CommonErrors.num];if(i>0&&0===a)return this.parent.getErrorStrings()[e.CommonErrors.divzero];for(var d=0;d<o.length;d++)if(o[d].indexOf(this.parent.tic)>-1)return this.parent.getErrorStrings()[e.CommonErrors.value];return isNaN(i)?this.parent.getErrorStrings()[e.CommonErrors.name]:Math.floor(i/a)*a},n.prototype.ComputeCEILING=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];var i,a,o=r,s=[],l=o.length,h=o[1].split(this.parent.tic).join("");if(2!==l)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(s.push(i=this.parent.parseFloat(this.parent.getValueFromArg(o[0].split(this.parent.tic).join("")))),o[1]=h===this.parent.trueValue?"1":h===this.parent.falseValue?"0":o[1],s.push(a=this.parent.parseFloat(this.parent.getValueFromArg(o[1].split(this.parent.tic).join("")))),i>0&&a<0)return this.parent.getErrorStrings()[e.CommonErrors.num];for(var d=0;d<o.length;d++)if(o[d].indexOf(this.parent.tic)>-1)return this.parent.getErrorStrings()[e.CommonErrors.value];return isNaN(i)?this.parent.getErrorStrings()[e.CommonErrors.name]:0===a?0:Math.ceil(i/a)*a},n.prototype.ComputeDAY=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,a=r;if(t.isNullOrUndefined(a)||1===a.length&&""===a[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];if(a.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var o=this.parent.getValueFromArg(a[0].split(this.parent.tic).join(""));return isNaN(this.parent.parseFloat(o))?(i=this.parent.parseDate(o),"[object Date]"===Object.prototype.toString.call(i)&&(i=i.getDate()),i):this.parent.getErrorStrings()[e.CommonErrors.name]},n.prototype.ComputeIF=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];if(this.parent.getErrorStrings().indexOf(r[0])>0)return r[0];var i,a=r;4===a.length&&"nestedFormulaTrue"===a[3]&&(i=!0,a.pop());var o,s;if(a.length>3||1===a.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(a.length<=3){if(o=this.parent.getValueFromArg(a[0]),this.parent.getErrorStrings().indexOf(o)>-1)return o;if(o===this.parent.trueValue||this.parent.parseFloat(o)>0||this.parent.parseFloat(o)<0)s=this.parent.getValueFromArg(a[1]);else{if(o!==this.parent.falseValue&&0!==this.parent.parseFloat(o))return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.requires_3_args];if(t.isNullOrUndefined(a[2]))return this.parent.falseValue;s=this.parent.getValueFromArg(a[2])}}return!i&&s.indexOf(this.parent.tic)>-1?s.split(this.parent.tic).join(""):s},n.prototype.ComputeIFERROR=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];var i,a=r;return 2!==a.length?this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments]:(i=this.parent.getValueFromArg(a[0]))===this.parent.trueValue||i===this.parent.falseValue?i:(i[0]===this.parent.arithMarker&&(i=i.replace(this.parent.arithMarker," ")),i=this.parent.getValueFromArg(i).toUpperCase().split(this.parent.tic).join(""),"#"===i[0]||i.indexOf("Infinity")>-1||this.parent.getErrorStrings().indexOf(i)>-1?this.parent.getValueFromArg(a[1]).split(this.parent.tic).join(""):i)},n.prototype.ComputePRODUCT=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];var i,a,o,s=1,l=!0;if(!t.isNullOrUndefined(r))for(var h=r,d=0;d<h.length;d++){var p=h[d];if(p.indexOf(":")>-1&&this.parent.isCellReference(p))for(var c=this.parent.getCellCollection(p),u=0;u<c.length;u++){if(i=this.parent.getValueFromArg(c[u].split(this.parent.tic).join("")),this.parent.getErrorStrings().indexOf(i)>-1)return i;i="TRUE"===i.split(this.parent.tic).join("")?"1":"FALSE"===i.split(this.parent.tic).join("")?"0":i,o=this.parent.parseFloat(i),isNaN(o)||i.length>0&&(s*=o,l=!1)}else{if(a=this.parent.getValueFromArg(h[d].split(this.parent.tic).join("")),this.parent.getErrorStrings().indexOf(a)>-1)return a;if(a="TRUE"===a.split(this.parent.tic).join("")?"1":"FALSE"===a.split(this.parent.tic).join("")?"0":a,o=this.parent.parseFloat(a),isNaN(o)||a.length>0&&(s*=o,l=!1),this.parent.getErrorStrings().indexOf(a)>-1)return a}}return l?"0":s.toString()},n.prototype.ComputeDAYS=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i;if(t.isNullOrUndefined(r)&&1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];if(2!==r.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a=r;a[0].split(this.parent.tic).join("")===this.parent.trueValue&&(a[0]="1"),a[0].split(this.parent.tic).join("")===this.parent.falseValue&&(a[0]="0");var o=this.parent.getValueFromArg(a[0].split(this.parent.tic).join("")),s=this.parent.getValueFromArg(a[1].split(this.parent.tic).join(""));if(s=""===s||null==s?new Date(Date.parse("1899-12-31")).toDateString():s,"#"===(o=""===o||null==o?new Date(Date.parse("1899-12-31")).toDateString():o)[0])return o;if("#"===s[0])return s;var l=this.parent.intToDate(o),h=this.parent.intToDate(s);return"#"===l.toString()[0]?l.toString():"#"===h.toString()[0]?h.toString():"[object Date]"!==Object.prototype.toString.call(l)||"[object Date]"!==Object.prototype.toString.call(h)?this.parent.getErrorStrings()[e.CommonErrors.value]:(i=Math.ceil(l.getTime()-h.getTime())/864e5,Math.round(i))},n.prototype.ComputeCHOOSE=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];if(r.length<2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=r;if(i[0].indexOf(":")>-1&&this.parent.isCellReference(i[0])){if(1!==(l=this.parent.getCellCollection(i[0])).length)return this.parent.getErrorStrings()[e.CommonErrors.value];i[0]=l[0]}var a=this.parent.getValueFromArg(i[0]);if(this.parent.getErrorStrings().indexOf(a)>-1)return a;var o=this.parent.parseFloat(this.parent.getValueFromArg(i[0].split(this.parent.tic).join("")));if(o<1)return this.parent.getErrorStrings()[e.CommonErrors.value];o=Math.floor(o);var s;if(t.isNullOrUndefined(i[o]))return this.parent.getErrorStrings()[e.CommonErrors.value];if(""===(s=i[o])&&(s="0"),s.indexOf(":")>-1&&this.parent.isCellReference(s)){var l=this.parent.getCellCollection(i[0].split(this.parent.tic).join(""));if(1!==l.length)return this.parent.getErrorStrings()[e.CommonErrors.value];i[0]=l[0]}return this.parent.getValueFromArg(s).split(this.parent.tic).join("")},n.prototype.ComputeSUMIF=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(n[0].indexOf(":")<0&&!this.parent.isCellReference(n[0])||n[2]&&n[2].indexOf(":")<0&&!this.parent.isCellReference(n[2]))return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];if(n.length>3||n.length<2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=this.parent.computeSumIfAndAvgIf(t);return"string"==typeof i&&(this.parent.formulaErrorStrings.indexOf(i)||this.parent.getErrorStrings().indexOf(i))?i:i[0]},n.prototype.ComputeABS=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i=t,a="";if(0===t.length||t.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(""===i[0].toString().split(this.parent.tic).join("").trim()||i[0].indexOf(this.parent.tic)>-1)return this.parent.getErrorStrings()[e.CommonErrors.value];if(this.parent.isCellReference(i[0])){if(""===(a=this.parent.getValueFromArg(i[0])))return this.parent.getErrorStrings()[e.CommonErrors.name];if(n=this.parent.parseFloat(a),isNaN(n))return this.parent.getErrorStrings()[e.CommonErrors.value]}else if(n=this.parent.parseFloat(i[0]),isNaN(n))return this.parent.getErrorStrings()[e.CommonErrors.name];return Math.abs(n)},n.prototype.ComputeAVERAGE=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];for(var i=r,a=0;a<i.length;a++)if(i[a].indexOf(":")>-1&&i[a].indexOf(this.parent.tic)>-1)return this.parent.getErrorStrings()[e.CommonErrors.value];return this.parent.calculateAvg(i)},n.prototype.ComputeAVERAGEIF=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(n[0].indexOf(":")<0&&!this.parent.isCellReference(n[0]))return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];var i=this.parent.computeSumIfAndAvgIf(t);return"string"==typeof i&&(this.parent.formulaErrorStrings.indexOf(i)||this.parent.getErrorStrings().indexOf(i))?i:this.parent.parseFloat(i[0])/this.parent.parseFloat(i[1])},n.prototype.ComputeCONCATENATE=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_arguments];for(var i=r,a="",o="",s=0;s<i.length;s++){if(i[s].indexOf(":")>-1&&this.parent.isCellReference(i[s])){if(!this.isConcat)return this.parent.getErrorStrings()[e.CommonErrors.value];for(var l=this.parent.getCellCollection(i[s]),h=0;h<l.length;h++)a+=o=this.parent.getValueFromArg(l[h])}else{if(1===i.length&&i[0].indexOf(this.parent.tic)<0)return this.parent.getErrorStrings()[e.CommonErrors.name];a+=o=this.parent.getValueFromArg(i[s])}if(this.parent.getErrorStrings().indexOf(o)>-1)return o}return a.split(this.parent.tic).join("")},n.prototype.ComputeCONCAT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.isConcat=!0,this.ComputeCONCATENATE.apply(this,e)},n.prototype.ComputeMAX=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeMinMax(e,"max")},n.prototype.ComputeMIN=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeMinMax(e,"min")},n.prototype.ComputeRAND=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1===t.length&&""===t[0]&&(t.length=0),t.length>0?this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments]:Math.random().toString()},n.prototype.ComputeAND=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeAndOr(e,"and")},n.prototype.ComputeOR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeAndOr(e,"or")},n.prototype.ComputeFIND=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=r;if(i.length>3)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a=this.parent.removeTics(this.parent.getValueFromArg(i[0])),o=this.parent.removeTics(this.parent.getValueFromArg(i[1]));if(this.parent.getErrorStrings().indexOf(a)>-1||this.parent.getErrorStrings().indexOf(o)>-1)return this.parent.getErrorStrings()[e.CommonErrors.name];var s=1;if(3===i.length){if(s=this.parent.removeTics(this.parent.getValueFromArg(i[2])),this.parent.getErrorStrings().indexOf(s)>-1)return s;s=this.parent.parseFloat(s),isNaN(s)&&(s=1)}if(s<=0||s>o.length)return this.parent.getErrorStrings()[e.CommonErrors.value];var l=o.indexOf(a,s-1);return l<0?this.parent.getErrorStrings()[e.CommonErrors.value]:(Number(l)+Number(1)).toString()},n.prototype.ComputeINDEX=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r,a=i.length;if(t.isNullOrUndefined(r)||1===i.length&&""===i[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(a>3)return this.parent.getErrorStrings()[e.CommonErrors.ref];var o="",s=[];if(a>2)for(var l=0;l<a;l++){if(this.parent.isCellReference(i[l])&&i[l].indexOf(":")<0)return this.parent.getErrorStrings()[e.CommonErrors.ref];this.parent.isCellReference(i[l])&&(s[l]=i[l])}if(o=i[0],i[1]=""===i[1]?"1":i[1],i[1]=this.parent.getValueFromArg(i[1]),this.parent.getErrorStrings().indexOf(i[1])>-1)return i[1];if(!t.isNullOrUndefined(i[2])){if(i[2]=""===i[2]?"1":i[2],i[2]=this.parent.getValueFromArg(i[2]),this.parent.getErrorStrings().indexOf(i[2])>-1)return i[2];if("0"===i[2])return this.parent.getErrorStrings()[e.CommonErrors.value]}var h=parseFloat(i[1]);h=isNaN(h)?-1:h;var d=parseFloat(i[2]?i[2]:"1");if(d=isNaN(d)?-1:d,-1===h||-1===d)return this.parent.getErrorStrings()[e.CommonErrors.value];var p=i[0].indexOf(":"),c=this.parent.rowIndex(o.substring(0,p)),u=this.parent.rowIndex(o.substring(p+1)),f=this.parent.colIndex(o.substring(0,p)),g=this.parent.colIndex(o.substring(p+1));if(h>u-c+1||d>g-f+1)return this.parent.getErrorStrings()[e.CommonErrors.ref];h=c+h-1,d=f+d-1;var m=this.getSheetReference(o)+this.parent.convertAlpha(d)+h,v=this.parent.getValueFromArg(m);return""===v?0:v},n.prototype.getSheetReference=function(e){return 0===e.indexOf(this.parent.sheetToken)&&e.lastIndexOf(this.parent.sheetToken)>e.indexOf(this.parent.sheetToken)?e.substring(0,e.lastIndexOf(this.parent.sheetToken)+1):""},n.prototype.ComputeIFS=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r;if(t.isNullOrUndefined(r)||1===i.length&&""===i[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var a="",o="",s=0;s<i.length;s++){if((a=this.parent.getValueFromArg(i[s]))!==this.parent.trueValue&&a!==this.parent.falseValue)return this.parent.getErrorStrings()[e.CommonErrors.value];if(a===this.parent.trueValue)return i[s+1].indexOf(this.parent.arithMarker)>-1?this.parent.trueValue:(o=this.parent.isCellReference(i[s+1].split(this.parent.tic).join(""))?this.parent.getValueFromArg(i[s+1]):i[s+1].indexOf(this.parent.tic)>-1?i[s+1].split(this.parent.tic).join(""):this.parent.getErrorStrings()[e.CommonErrors.name],s+=1,o);a===this.parent.falseValue&&(s+=1)}return this.parent.getErrorStrings()[e.CommonErrors.na]},n.prototype.ComputeCOUNTA=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var i,a=r,o=0,s=0;s<a.length;s++)if(a[s].indexOf(":")>-1&&this.parent.isCellReference(a[s])){i=this.parent.getCellCollection(a[s].split(this.parent.tic).join(""));for(var l=0;l<i.length;l++)this.parent.getValueFromArg(i[l]).length>0&&o++}else this.parent.getValueFromArg(a[s].split(this.parent.tic).join("")).length>0&&o++;return o},n.prototype.ComputeAVERAGEA=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t.isNullOrUndefined(r)||1===r.length&&""===r[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var i,a,o,s=r,l=0,h=0,d=0;d<s.length;d++){if(s[d].indexOf(":")>-1&&this.parent.isCellReference(s[d])){i=this.parent.getCellCollection(s[d].split(this.parent.tic).join(""));for(var p=0;p<i.length;p++)if((a=this.parent.getValueFromArg(i[p])).toUpperCase()===this.parent.trueValue)a="1";else if(a.toUpperCase()===this.parent.falseValue||""===a)a="0";else{if(this.parent.getErrorStrings().indexOf(a)>-1)return a;a.length>0&&(o=parseFloat(a),l+=a=isNaN(o)?0:o,h+=1)}h=i.length}else{if(s[d]===this.parent.trueValue&&(s[d]="1"),s[d]!==this.parent.falseValue&&""!==s[d]||(s[d]="0"),a=this.parent.getValueFromArg(s[d].split(this.parent.tic).join("")),this.parent.getErrorStrings().indexOf(a)>-1)return a;a.length>0&&(o=parseFloat(a),l+=a=isNaN(o)?0:o,h+=1)}if(0===h)return this.parent.getErrorStrings()[e.CommonErrors.divzero]}return l/h},n.prototype.ComputeSORT=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a,o=n;if(t.isNullOrUndefined(n)||""===n[0]||o.length>4)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];o[1]=o[1]?o[1]:"1",o[2]=o[2]?o[2]:"1";var s="1"===o[2]?"Ascending":"Descending";o[3]=o[3]?o[3].toUpperCase():"FALSE",o[0]=o[0].split("$").join("");var l,h=[];if(o[0].indexOf(":")>-1){var d=o[0].split(":");if(this.parent.isCellReference(d[0])&&this.parent.isCellReference(d[1])){var p=o[0].indexOf(":"),c=void 0,u=this.parent.rowIndex(this.parent.substring(o[0],0,p)),f=this.parent.colIndex(this.parent.substring(o[0],0,p)),g=this.parent.rowIndex(this.parent.substring(o[0],p+1,p+o[0].length-p-1)),m=this.parent.colIndex(this.parent.substring(o[0],p+1,p+o[0].length-p-1));if(u>g&&(c=g,g=u,u=c),f>m&&(c=m,m=f,f=c),o[2]=this.parent.getValueFromArg(o[2]),"1"!==o[2]&&"-1"!==o[2])return this.parent.getErrorStrings()[e.CommonErrors.value];if(!isNaN(this.parseDouble(o[1]))&&this.parseDouble(o[1])<1)return this.parent.getErrorStrings()[e.CommonErrors.value];if(o[3].toUpperCase()!==this.parent.trueValue&&o[3].toUpperCase()!==this.parent.falseValue)return this.parent.getErrorStrings()[e.CommonErrors.value];var v="";0===o[0].indexOf("!")&&(v=(v=(v=o[0]).replace("!","")).indexOf("!"),v=o[0].substring(0,v+2)),o[0]=v+V(f)+u+":"+V(m)+g,l=this.parent.getCellCollection(o[0]);for(b=0;b<l.length;b++)h.push(this.parent.getValueFromArg(l[b]));var y=[],C=m-f+1;if("TRUE"===o[3])for(b=0;b<C;b++)h[b+(this.parseDouble(o[1])-1)*C]&&y.push(isNaN(this.parseDouble(h[b+(this.parseDouble(o[1])-1)*C]))?h[b+(this.parseDouble(o[1])-1)*C]:this.parseDouble(h[b+(this.parseDouble(o[1])-1)*C]));if("FALSE"===o[3])for(var b=0;b<h.length;b++)h[b*C+this.parseDouble(o[1])-1]&&y.push(isNaN(this.parseDouble(h[b*C+this.parseDouble(o[1])-1]))?h[b*C+this.parseDouble(o[1])-1]:this.parseDouble(h[b*C+this.parseDouble(o[1])-1]));for(var x=r.DataUtil.sort(y,null,r.DataUtil.fnSort(s)),S=[],w=0;w<x.length;w++)for(var I=0;I<y.length;I++)JSON.stringify(x[w])===JSON.stringify(y[I])&&-1===S.indexOf(I)&&S.push(I);if("TRUE"===o[3]){for(var E=u,R=0;E<=g;E++,R++)for(var w=0,k=0;w<S.length;w++,k++){var A=this.parent.getValueFromArg(v+V(S[w]+f)+E),T=this.parent.actCell,F=this.parent.rowIndex(T),L=this.parent.colIndex(T);this.parent.parentObject.setValueRowCol(this.parent.getSheetID(this.parent.grid)+1,A,F+R,L+k)}a=this.parent.getValueFromArg(v+V(S[0]+f)+u)}if("FALSE"===o[3]){for(var w=0,R=0;w<S.length;w++,R++)for(var N=f,k=0;N<=m;N++,k++){var D=this.parent.getValueFromArg(v+V(N)+(S[w]+u)),T=this.parent.actCell,F=this.parent.rowIndex(T),L=this.parent.colIndex(T);this.parent.parentObject.setValueRowCol(this.parent.getSheetID(this.parent.grid)+1,D,F+R,L+k)}a=this.parent.getValueFromArg(v+V(f)+(S[0]+u))}}}return a},n.prototype.ComputeCOUNTIF=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r;if(t.isNullOrUndefined(r)||""===r[0]||2!==i.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a,o,s=0,l=[],h="equal",d=i[1].split(this.parent.tic).join("");if(d.startsWith("<=")?(h="lessEq",d=d.substring(2)):d.startsWith(">=")?(h="greaterEq",d=d.substring(2)):d.startsWith("<>")?(h="notEq",d=d.substring(2)):d.startsWith("<")?(h="less",d=d.substring(1)):d.startsWith(">")?(h="greater",d=d.substring(1)):d.startsWith("=")&&(h="equal",d=d.substring(1)),i[0].indexOf(":")>-1&&this.parent.isCellReference(i[0])){a=this.parent.getCellCollection(i[0].split(this.parent.tic).join(""));for(var p=0;p<a.length;p++)o=this.parent.getValueFromArg(a[p]),(d.indexOf("*")>-1||d.indexOf("?")>-1)&&(o=this.parent.findWildCardValue(d,o)),l.push(o),l.push(d),this.parent.processLogical(l,h)===this.parent.trueValue&&s++}return s},n.prototype.ComputeSUMIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeIfsFormulas(e,this.parent.falseValue)},n.prototype.ComputeTEXT=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var i,a=r.length,o=0;o<a;o++)i=t.isNullOrUndefined(i)?r[o]:i+","+r[o];var s=i.indexOf(","),l=i.slice(0,s),h=i.slice(i.indexOf('"')+1,i.length),d=h.indexOf('"');if(s>-1&&d!==h.length-1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var p=l,c=h.slice(0,h.length-1),u=new Date(1900,0,1,0,0,0),f=p+","+c,g=new t.Internationalization;if(this.parent.getErrorStrings().indexOf(f)>-1)return f;if(p=this.parent.getValueFromArg(p),""===(c=c.split(this.parent.tic).join("")))return"";""===p&&(c.length>0&&(c.toUpperCase().indexOf("M")>-1||c.toUpperCase().indexOf("D")>-1||c.toUpperCase().indexOf("Y")>-1||c.toUpperCase().indexOf("S")>-1||c.toUpperCase().indexOf("T")>-1)||c.toUpperCase().indexOf("H")>-1)&&(p=u.toString());var m=this.parseDouble(p);if(isNaN(m)&&null!==this.parent.isDate(new Date(p))&&(m=this.parent.toOADate(new Date(p))),u=Date.parse(p.split(this.parent.tic).join("")),!isNaN(m)||!isNaN(u)){if("["===c[0])return this.parent.tic+p+this.parent.tic;if(c.length>0&&(c.toUpperCase().indexOf("M")>-1||c.toUpperCase().indexOf("D")>-1||c.toUpperCase().indexOf("Y")>-1||c.toUpperCase().indexOf("S")>-1||c.toUpperCase().indexOf("T")>-1)||c.toUpperCase().indexOf("H")>-1){var v=(c=(c=c.split("Y").join("y").split("D").join("d").split("H").join("h")).split("S").join("s").split("m").join("M").split("AM/PM").join("tt")).split(""),y=!1,C=!1,o=0,b=0,x=0;for(o=0;o<v.length;){var S=v[o];"s"===S&&"M"===v[b]&&(v[b]="m","M"===v[b-1]&&(v[b-1]="m")),this.parent.isChar(S)?(b=o,"M"===S&&x++):x>1&&x++,"M"===S&&y&&(v[o]="m",C=!0),"h"===S?y=!0:this.parent.isChar(S)&&"M"!==S&&"h"!==S&&!C&&(y=!1,C=!1),o++}c=(c=String(v)).split(",").join("").split("\n").join(" ");var w=this.parent.fromOADate(m);0===m&&(w=u);var I=M(c);if(""===I)return this.parent.getErrorStrings()[e.CommonErrors.name];p=g.getDateFormat({skeleton:I,type:"date"})(new Date(w.toString()))}else p=g.formatNumber(m,{format:c})}return p},n.prototype.ComputeCOUNTIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeIfsFormulas(e,this.parent.trueValue)},n.prototype.ComputeAVERAGEIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeIfsFormulas(e,this.parent.falseValue,this.parent.trueValue)},n.prototype.ComputeMATCH=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r;if(t.isNullOrUndefined(i)||1===i.length&&""===i[0]||i.length<2||i.length>3)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a,o=[],s=i[0].split(this.parent.tic).join("");if(this.parent.isCellReference(s)&&(s=this.parent.getValueFromArg(s)),!s.toString().length)return this.parent.getErrorStrings()[e.CommonErrors.na];i[2]=t.isNullOrUndefined(i[2])?"1":i[2].split(this.parent.tic).join(""),i[2].split(this.parent.tic).join("")===this.parent.trueValue&&(i[2]="1"),i[2].split(this.parent.tic).join("")===this.parent.falseValue&&(i[2]="0");var l=parseFloat(i[2]);if(-1!==l&&0!==l&&1!==l)return this.parent.getErrorStrings()[e.CommonErrors.na];var h=0,d="";if(i[1].indexOf(":")>-1||this.parent.isCellReference(i[1])){a=this.parent.getCellCollection(i[1].split(this.parent.tic).join(""));for(var p=0;p<a.length;p++)o[p]=this.parent.getValueFromArg(a[p]).split(this.parent.tic).join("");for(var c=0;c<o.length;c++)if(o[c].toString().length)if(1===l){if(s===o[c])return c+1;s>o[c]&&(d?o[c]>d&&(h=c+1,d=o[c]):(h=c+1,d=o[c]))}else if(0===l){if((s.indexOf("*")>-1||s.indexOf("?")>-1)&&(o[c]=this.parent.findWildCardValue(s,o[c])),s===o[c])return c+1;if(this.parent.parseFloat(s)===this.parent.parseFloat(o[c]))return c+1}else if(-1===l){if(s===o[c])return c+1;s<o[c]&&(d?o[c]<d&&(h=c+1,d=o[c]):(h=c+1,d=o[c]))}}return h||this.parent.getErrorStrings()[e.CommonErrors.na]},n.prototype.ComputeSUBTOTAL=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t,i="";if(n.length<2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a=this.parent.parseFloat(this.parent.getValueFromArg(n[0].split(this.parent.tic).join(""))),o=n.slice(1,n.length);switch(a){case 1:case 101:i=this.ComputeAVERAGE.apply(this,o);break;case 2:case 102:i=this.ComputeCOUNT.apply(this,o);break;case 3:case 103:i=this.ComputeCOUNTA.apply(this,o);break;case 4:case 104:i=this.ComputeMAX.apply(this,o);break;case 5:case 105:i=this.ComputeMIN.apply(this,o);break;case 6:case 106:i=this.ComputePRODUCT.apply(this,o);break;case 7:case 107:i=this.ComputeDAY.apply(this,o);break;case 8:case 108:i=this.ComputeCONCAT.apply(this,o);break;case 9:case 109:i=this.ComputeSUM.apply(this,o);break;case 10:case 110:i=this.ComputeAVERAGEA.apply(this,o);break;case 11:case 111:i=this.ComputeABS.apply(this,o);break;default:i=this.parent.getErrorStrings()[e.CommonErrors.value]}return i},n.prototype.ComputeRADIANS=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(""===n[0]||n.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(n[0].indexOf(":")>-1||""===n[0].split(this.parent.tic).join(""))return this.parent.getErrorStrings()[e.CommonErrors.value];var i=n[0].split(this.parent.tic).join("");n[0]=isNaN(this.parent.parseFloat(i))?n[0]:i;var a=this.parent.getValueFromArg(n[0]),o=this.parent.parseFloat(a);return isNaN(o)?a.indexOf(this.parent.tic)>-1?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.getErrorStrings()[e.CommonErrors.name]:Math.PI*o/180},n.prototype.ComputeRANDBETWEEN=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a,o=t.length;if(2!==o)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var s=0;s<o;s++){if(""===t[s])return this.parent.getErrorStrings()[e.CommonErrors.na];if(t[s].indexOf(this.parent.tic)>-1){if(isNaN(parseFloat(t[s].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[e.CommonErrors.value];t[s]=t[s].split(this.parent.tic).join("")}if(a=parseFloat(this.parent.getValueFromArg(t[s])),this.parent.isCellReference(t[s])){if(a=""===this.parent.getValueFromArg(t[s])?0:a,0===s?n=a:i=a,0===n&&0===i)return"0";if(isNaN(a))return this.parent.getErrorStrings()[e.CommonErrors.value]}else{if(isNaN(a))return this.parent.getErrorStrings()[e.CommonErrors.name];0===s?n=a:i=a}}return i<n?this.parent.getErrorStrings()[e.CommonErrors.num]:0===n?Math.floor(Math.random()*(i-(n-1)))+n:i-n==1?Math.round(Math.random()*(i-n)+n):Math.floor(Math.random()*(i-(n-1)))+n},n.prototype.ComputeSLOPE=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(2!==n.length||""===n[0])return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=this.parent.getCellCollection(n[1].split(this.parent.tic).join("")),a=this.parent.getCellCollection(n[0].split(this.parent.tic).join(""));if(a.length!==i.length)return this.parent.getErrorStrings()[e.CommonErrors.na];var o=this.getDataCollection(a),s=this.getDataCollection(i);if(s.indexOf("#NAME?")>-1||o.indexOf("#NAME?")>-1)return this.parent.getErrorStrings()[e.CommonErrors.name];for(var l=0,h=0,d=0,p=0,c=0,u=s.length;c<u;++c)"NaN"!==Number(s[c]).toString()&&"NaN"!==Number(o[c]).toString()&&(l+=Number(s[c])*Number(o[c]),d+=Number(s[c]),p+=Number(o[c]),h+=Number(s[c])*Number(s[c]));var f=((l-d*p/s.length)/(h-d*d/s.length)).toString();return"NaN"===f?this.parent.getErrorStrings()[e.CommonErrors.divzero]:f},n.prototype.ComputeINTERCEPT=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(""===n[0]||2!==n.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=this.parent.getCellCollection(n[0].split(this.parent.tic).join("")),a=this.parent.getCellCollection(n[1].split(this.parent.tic).join(""));if(i.length!==a.length)return this.parent.getErrorStrings()[e.CommonErrors.na];var o=this.getDataCollection(a),s=this.getDataCollection(i);if(o.indexOf("#NAME?")>-1||s.indexOf("#NAME?")>-1)return this.parent.getErrorStrings()[e.CommonErrors.name];for(var l=0,h=0,d=0,p=o.length;d<p;++d)l+=Number(o[d]),h+=Number(s[d]);l/=o.length,h/=o.length;for(var c,u=0,f=0,d=0,p=o.length;d<p;++d)u+=(c=Number(o[d])-l)*(Number(s[d])-h),f+=c*c;var g=(h-u/f*l).toString();return"NaN"===g?this.parent.getErrorStrings()[e.CommonErrors.divzero]:g},n.prototype.ComputeLN=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a=t,o="";if(0===t.length||t.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(this.parent.isCellReference(a[0])){if(o=this.parent.getValueFromArg(a[0]),(n=this.parent.parseFloat(o))<=0||""===o)return this.parent.getErrorStrings()[e.CommonErrors.num];if(isNaN(n))return this.parent.getErrorStrings()[e.CommonErrors.value]}else{if(i=this.parent.getValueFromArg(a[0].split(this.parent.tic).join("")),(n=this.parent.parseFloat(i))<=0||""===n.toString())return this.parent.getErrorStrings()[e.CommonErrors.num];if(isNaN(n))return this.parent.getErrorStrings()[e.CommonErrors.value]}return Math.log(n)},n.prototype.ComputeISNUMBER=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t;if(0===t.length||t.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var i=this.parent.isCellReference(n[0])?this.parent.getValueFromArg(n[0]):this.parent.getValueFromArg(n[0].split(this.parent.tic).join(""));if(""===i.toString())return!1;var a=this.parent.parseFloat(i);return!isNaN(a)},n.prototype.ComputeROUND=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a,o,s,l=t,h=0,d=0;return 0===t.length||t.length>2?this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments]:1===t.length?(n="TRUE"===l[0].split(this.parent.tic).join("")?"1":"FALSE"===l[0].split(this.parent.tic).join("")?"0":l[0],Math.round(this.parent.parseFloat(n)).toString()):(a=this.parent.getValueFromArg(l[0]),o=""===l[1].split(this.parent.tic).join("")?"0":this.parent.getValueFromArg(l[1].split(this.parent.tic).join("")),a="TRUE"===a.split(this.parent.tic).join("")?"1":"FALSE"===a.split(this.parent.tic).join("")?"0":a,o="TRUE"===o.split(this.parent.tic).join("")?"1":"FALSE"===o.split(this.parent.tic).join("")?"0":o,""!==a&&""!==o&&(h=this.parent.parseFloat(a),d=this.parent.parseFloat(o),!isNaN(d)&&!isNaN(h)&&d>0?i=h.toFixed(d):(s=Math.pow(10,-d),i=Math.round(h/s)*s)),i.toString())},n.prototype.ComputePOWER=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a=t;if(0===t.length||t.length>2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];n=this.parent.getValueFromArg(a[0]),i=this.parent.getValueFromArg(a[1]),n="TRUE"===n.split(this.parent.tic).join("")?"1":"FALSE"===n.split(this.parent.tic).join("")?"0":n,i="TRUE"===i.split(this.parent.tic).join("")?"1":"FALSE"===i.split(this.parent.tic).join("")?"0":i;var o=this.parent.parseFloat(n),s=this.parent.parseFloat(i);return isNaN(o)||isNaN(s)?this.parent.getErrorStrings()[e.CommonErrors.value]:0===o&&s<0?this.parent.getErrorStrings()[e.CommonErrors.divzero]:0===o&&0===s?this.parent.getErrorStrings()[e.CommonErrors.num]:Math.pow(o,s).toString()},n.prototype.ComputeLOG=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a=t;if(0===t.length||t.length>2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];if(n=this.parent.getValueFromArg(a[0]),i=2===t.length?this.parent.getValueFromArg(a[1]):"10",""===n||null===n||""===i||null===i)return this.parent.getErrorStrings()[e.CommonErrors.num];n="TRUE"===n.split(this.parent.tic).join("")?"1":"FALSE"===n.split(this.parent.tic).join("")?"0":n,i="TRUE"===i.split(this.parent.tic).join("")?"1":"FALSE"===i.split(this.parent.tic).join("")?"0":i;var o=this.parent.parseFloat(n),s=this.parent.parseFloat(i);return o<=0||s<=0?this.parent.getErrorStrings()[e.CommonErrors.num]:1===s?this.parent.getErrorStrings()[e.CommonErrors.divzero]:isNaN(o)||isNaN(s)?this.parent.getErrorStrings()[e.CommonErrors.value]:(Math.log(o)/Math.LN10/(Math.log(s)/Math.LN10)).toString()},n.prototype.ComputeTRUNC=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i=t,a=0;if(0===t.length||t.length>2)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];2===t.length&&(a="TRUE"===(a=this.parent.getValueFromArg(i[1])).split(this.parent.tic).join("")?"1":"FALSE"===a.split(this.parent.tic).join("")?"0":a,a=this.parent.parseFloat(a)),n="TRUE"===(n=this.parent.getValueFromArg(i[0])).split(this.parent.tic).join("")?"1":"FALSE"===n.split(this.parent.tic).join("")?"0":n;var o=this.parent.parseFloat(n.split(this.parent.tic).join(""));if(isNaN(o)||isNaN(a))return i[0]===this.parent.tic||this.parent.isCellReference(i[0])||i[1]===this.parent.tic||this.parent.isCellReference(i[1])?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.getErrorStrings()[e.CommonErrors.name];var s=Math.pow(10,a);return((o<0?-1:1)*Math.floor(s*Math.abs(o))/s).toString()},n.prototype.ComputeEXP=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i=t;if(0===t.length||t.length>1)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];""===(n="TRUE"===(n=this.parent.getValueFromArg(i[0])).split(this.parent.tic).join("")?"1":"FALSE"===n.split(this.parent.tic).join("")?"0":n)&&(n="0");var a=this.parent.parseFloat(n);return a>709?this.parent.getErrorStrings()[e.CommonErrors.num]:isNaN(a)?i[0]===this.parent.tic||this.parent.isCellReference(i[0])?this.parent.getErrorStrings()[e.CommonErrors.value]:this.parent.getErrorStrings()[e.CommonErrors.name]:Math.exp(a).toString()},n.prototype.ComputeGEOMEAN=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n,i,a,o,s=t,l=1,h=0,d=0;if(0===t.length)return this.parent.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(i=0;i<s.length;i++)if(s[i].indexOf(":")>-1){if(s[0]===this.parent.tic)return this.parent.getErrorStrings()[e.CommonErrors.value];for(o=this.parent.getCellCollection(s[i].split(this.parent.tic).join("")),a=0;a<o.length;a++){if(d=this.parent.getValueFromArg(o[a]),d="TRUE"===d.split(this.parent.tic).join("")?"1":"FALSE"===d.split(this.parent.tic).join("")?"0":d,(n=this.parent.parseFloat(d))<=0)return this.parent.getErrorStrings()[e.CommonErrors.num];isNaN(n)||(h++,l*=n)}}else if((d=this.parent.getValueFromArg(s[i])).length>0){if(d="TRUE"===d.split(this.parent.tic).join("")?"1":"FALSE"===d.split(this.parent.tic).join("")?"0":d,!this.parent.isCellReference(s[i])&&isNaN(this.parent.parseFloat(d)))return this.parent.getErrorStrings()[e.CommonErrors.name];if((n=this.parent.parseFloat(d))<=0)return this.parent.getErrorStrings()[e.CommonErrors.num];isNaN(n)||(h++,l*=n)}return h>0&&(l=Math.pow(l,1/h)),l.toString()},n.prototype.getDataCollection=function(e){for(var t=[],r=0,n=e.length;r<n;r++)t.push(this.parent.getValueFromArg(e[r]));return t},n.prototype.parseDouble=function(e){var t=this.parent.parseFloat(e.toString());return isNaN(t)?NaN:t},n.prototype.getModuleName=function(){return"basic-formulas"},n}(),Ar=function(){function r(e){this.emptyStr="",this.storedStringText=this.emptyStr,this.sheetToken="!",this.tokenAdd="a",this.tokenSubtract="s",this.tokenMultiply="m",this.tokenDivide="d",this.tokenLess="l",this.charEm="r",this.charEp="x",this.tokenGreater="g",this.tokenEqual="e",this.tokenLessEq="k",this.tokenGreaterEq="j",this.tokenNotEqual="o",this.tokenAnd="c",this.tokenEm="v",this.tokenEp="t",this.tokenOr=String.fromCharCode(126),this.charAnd="i",this.charLess="<",this.charGreater=">",this.charEqual="=",this.charLessEq="f",this.charGreaterEq="h",this.charNoEqual="z",this.stringGreaterEq=">=",this.stringLessEq="<=",this.stringNoEqual="<>",this.stringAnd="&",this.stringOr="^",this.charOr="w",this.charAdd="+",this.charSubtract="-",this.charMultiply="*",this.charDivide="/",this.fixedReference="$",this.spaceString=" ",this.ignoreBracet=!1,this.isError=!1,this.isFormulaParsed=!1,this.findNamedRange=!1,this.stringsColl=new Map,this.tokens=[this.tokenAdd,this.tokenSubtract,this.tokenMultiply,this.tokenDivide,this.tokenLess,this.tokenGreater,this.tokenEqual,this.tokenLessEq,this.tokenGreaterEq,this.tokenNotEqual,this.tokenAnd,this.tokenOr],this.charNOTop=String.fromCharCode(167),this.specialSym=["~","@","#","?"],this.isFailureTriggered=!1,this.parent=e}return r.prototype.parse=function(r,n){if(this.parent.isTextEmpty(r))return r;this.parent.getFormulaCharacter()!==String.fromCharCode(0)&&this.parent.getFormulaCharacter()===r[0]&&(r=r.substring(1)),(this.parent.namedRanges.size>0||this.parent.storedData.size>0)&&(r=this.checkForNamedRangeAndKeyValue(r),this.findNamedRange=!1),r=(r=(r=(r=r.split("-+").join("-")).split("--").join("+")).split("+-").join("-")).split("-(-").join("(");var i=this.storeStrings(r);r=this.storedStringText;var a=0;if(t.isNullOrUndefined(i)&&(r=r.split(" ").join("")),r=r.split("=>").join(">="),(r=r.split("=<").join("<="))[r.length-1]===this.parent.arithMarker&&this.indexOfAny(r,this.tokens)===r.length-2||(r=r.toUpperCase()),r.indexOf(this.sheetToken)>-1){var o=this.parent.getSheetFamilyItem(this.parent.grid);if(null!=o.sheetNameToParentObject&&o.sheetNameToParentObject.size>0){r[0]!==this.sheetToken.toString()&&(r=this.parent.setTokensForSheets(r));var s=this.parent.getSheetToken(r.split(this.parent.tic).join(this.emptyStr)),l=this.checkScopedRange(r.split('"').join(this.emptyStr).split(this.sheetToken).join(""));t.isNullOrUndefined(s)&&""!==s&&this.parent.namedRanges.size>0&&""!==l&&(r=l)}}r=this.markLibraryFormulas(r);try{r=this.formulaAutoCorrection(r)}catch(t){if(!(p={message:t.message,exception:t,isForceCalculable:t.formulaCorrection,computeForceCalculate:!1}).isForceCalculable)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_expression];if(this.isFailureTriggered||(this.parent.trigger("onFailure",p),this.isFailureTriggered=!0),!p.isForceCalculable||!p.computeForceCalculate)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_expression];r=this.formulaAutoCorrection(r,p),this.parent.storedData.get(n).formulaText="="+r}if(!this.ignoreBracet)for(a=r.indexOf(")");a>-1;){var h=r.substring(0,a).lastIndexOf("(");if(-1===h)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.mismatched_parentheses]);if(h===a-1)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.empty_expression]);var d=this.emptyStr;d=this.ignoreBracet?this.parent.substring(r,h,a-h+1):this.parent.substring(r,h+1,a-h-1);try{r=r.substring(0,h)+this.parseSimple(d)+r.substring(a+1)}catch(e){var p=this.exceptionArgs(e);this.isFailureTriggered||(this.parent.trigger("onFailure",p),this.isFailureTriggered=!0);var c="string"==typeof p.exception?p.exception:p.message;return(this.parent.getErrorLine(e)?"":"#"+this.parent.getErrorLine(e)+": ")+c}a=r.indexOf(")")}if(!this.ignoreBracet&&r.indexOf("(")>-1)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.mismatched_parentheses]);return r=this.parseSimple(r),null!==i&&i.size>0&&(r=this.setStrings(r,i)),r},r.prototype.exceptionArgs=function(e){return{message:e.message,exception:e,isForceCalculable:e.formulaCorrection,computeForceCalculate:!1}},r.prototype.formulaAutoCorrection=function(r,n){var i=["*","+","-","/","^","&"],a=[">","=","<"],o=0,s="",l="",h="",d="",p="",c="",u="",f=0;if(this.parent.formulaErrorStrings.indexOf(r)>-1)return r;if(this.indexOfAny(r,this.specialSym)>-1)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_expression],!1);for(;o<r.length;)if(((r=r.split("-*").join("-").split("/*").join("/").split("*/").join("*").split("-/").join("-").split("*+").join("*").split("+*").join("+")).indexOf("*-")>-1||r.indexOf("/-")>-1)&&(r="-"+r.split("*-").join("*").split("/-").join("/")),this.parent.isDigit(r[o])&&r.length>o+1&&this.indexOfAny(r[o+1],i)>-1&&r.length>o+2&&!t.isNullOrUndefined(r[o+2])&&this.indexOfAny(r[o+2],i)>-1){if(t.isNullOrUndefined(n))throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.invalid_expression],!0);if(!n.computeForceCalculate)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];this.parent.isDigit(r[o])?(f<1?(c=r[o],h=r[o+1],t.isNullOrUndefined(h)&&(h=this.emptyStr),f+=1,s=s+c+(h="&"===h?"":h)):f<2&&(u=r[o],d=r[o-1],p=r[o+1],f=0,s="-"===d?s+d+u+(p="&"===(p=t.isNullOrUndefined(p)?this.emptyStr:p)?"":p):s+u+(p=t.isNullOrUndefined(p)?this.emptyStr:p)),o+=2):(s="-"===r[o]?s+r[o]:s,o+=1)}else if((this.parent.isDigit(r[o])||r[o]===this.parent.rightBracket||this.parent.storedData.has(r[o].toUpperCase()))&&(t.isNullOrUndefined(r[o+1])||this.indexOfAny(r[o+1],i))>-1)l="&"===(l=t.isNullOrUndefined(r[o+1])?this.emptyStr:r[o+1])?"":l,s="-"===r[o-1]?s+r[o-1]+r[o]+l:s+r[o]+l,o+=2;else if(this.indexOfAny(r[o],a)>-1&&!t.isNullOrUndefined(r[o-1])&&!t.isNullOrUndefined(r[o+1]))s+=r[o],o+=1;else if("q"===r[o])for(;r[o]!==this.parent.leftBracket;)s+=r[o],o+=1;else r[o]===this.parent.leftBracket||r[o]===this.parent.rightBracket||"{"===r[o]||"}"===r[o]||"("===r[o]||")"===r[o]?(s+=r[o],o+=1):this.parent.isUpperChar(r[o])||r[o].indexOf(":")>-1||r[o]===this.parent.getParseArgumentSeparator()||"%"===r[o]&&this.parent.isDigit(r[o-1])?(s+=r[o],o+=1):r[o]===this.parent.tic||" "===r[o]||"."===r[o]||r[o]===this.sheetToken||"$"===r[o]?(s+=r[o],o+=1):(this.parent.isDigit(r[o])&&(s="-"===r[o-1]?s+r[o-1]+r[o]:s+r[o]),"-"!==r[o]&&"+"!==r[o]||(s=(s+=r[o]).split("++").join("+").split("+-").join("-").split("-+").join("-")),"/"!==r[o]&&"*"!==r[o]||(s+=r[o]),o+=1);return s=s===this.emptyStr?r:s,this.indexOfAny(s[s.length-1],i)>-1&&(s=s.substring(0,s.length-1)),s=s.split("--").join("-").split("-+").join("-").split("+-").join("-")},r.prototype.checkScopedRange=function(e){var r=this,n=this.emptyStr,i="NaN",a=this.parent.getSheetID(this.parent.grid),o=this.parent.getSheetFamilyItem(this.parent.grid);if(e[0]===this.sheetToken.toString()){var s=e.indexOf(this.sheetToken,1),l=parseInt(e.substr(1,s-1),10);s>1&&!this.parent.isNaN(l)&&(e=e.substring(s+1),a=l)}var h="!"+a.toString()+"!";return null===o||null==o.sheetNameToToken?i:(o.sheetNameToToken.forEach(function(a,s){if(o.sheetNameToToken.get(s).toString()===h){var l=r.emptyStr;r.parent.namedRanges.forEach(function(a,s){l=t.isNullOrUndefined(r.parent.parentObject)?o.sheetNameToToken.get(s).toUpperCase():(r.parent.parentObject.getActiveSheet().name+r.sheetToken+e).toUpperCase(),r.parent.getNamedRanges().has(l)&&(n=r.parent.getNamedRanges().get(l).toUpperCase(),i=n)})}}),i)},r.prototype.storeStrings=function(t){var r,n=0,i=0,a=0,o="",s=null;if(t.indexOf(this.parent.tic)>-1)for(n=t.indexOf(this.parent.tic);n>-1&&t.length>0;){if(null===s&&(s=this.stringsColl),-1===(i=n+1<t.length?t.indexOf(this.parent.tic,n+1):-1))throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.mismatched_tics]);r=this.parent.substring(t,n,i-n+1),o=this.parent.tic+this.spaceString+a.toString()+this.parent.tic,s=s.set(o,r),t=t.substring(0,n)+o+t.substring(i+1),(n+=o.length)<=t.length&&(n=t.indexOf(this.parent.tic,n)),a++}return this.storedStringText=t,s},r.prototype.setStrings=function(e,t){for(var r=0;r<t.size;r++)t.forEach(function(t,r){e=e.split(r).join(t)});return e},r.prototype.parseSimple=function(e){var t=e;if(t.length>0&&"+"===t[0]&&(t=t.substring(1)),"#DIV/0!"===t)return"#DIV/0!";if("#NAME?"===t)return"#NAME?";if(""===t)return t;if(this.parent.formulaErrorStrings.indexOf(t)>-1)return t;t=(t=(t=(t=(t=(t=t.split(this.stringLessEq).join(this.charLessEq)).split(this.stringGreaterEq).join(this.charGreaterEq)).split(this.stringNoEqual).join(this.charNoEqual)).split(this.stringAnd).join(this.charAnd)).split(this.stringOr).join(this.charOr)).split(this.fixedReference).join(this.emptyStr);var r=[this.tokenEp,this.tokenEm],n=[this.tokenMultiply,this.tokenDivide],i=[this.tokenAdd,this.tokenSubtract],a=[this.charMultiply,this.charDivide],o=[this.charAdd,this.charSubtract],s=[this.tokenLess,this.tokenGreater,this.tokenEqual,this.tokenLessEq,this.tokenGreaterEq,this.tokenNotEqual],l=[this.charLess,this.charGreater,this.charEqual,this.charLessEq,this.charGreaterEq,this.charNoEqual],h=[this.charEp,this.charEm],d=[this.tokenAnd],p=[this.charAnd],c=[this.charOr],u=[this.tokenOr];return t=this.parseSimpleOperators(t,r,h),t=this.parseSimpleOperators(t,u,c),t=this.parseSimpleOperators(t,n,a),t=this.parseSimpleOperators(t,i,o),t=this.parseSimpleOperators(t,s,l),t=this.parseSimpleOperators(t,d,p)},r.prototype.parseSimpleOperators=function(t,r,n){if(this.parent.getErrorStrings().indexOf(t)>-1)return t;for(var i=t,a=0,o="",s=0;s<n.length;s++)o+=n[s];(i=(i=i.split("---").join("-").split("--").join("+").split(this.parent.getParseArgumentSeparator()+"-").join(this.parent.getParseArgumentSeparator()+"u").split(this.parent.leftBracket+"-").join(this.parent.leftBracket+"u").split("=-").join("=u")).split(",+").join(",").split(this.parent.leftBracket+"+").join(this.parent.leftBracket).split("=+").join("=").split(">+").join(">").split("<+").join("<").split("/+").join("/").split("*+").join("*").split("++").join("+").split("*-").join("*u").toString()).length>0&&"-"===i[0]?(i="0-"+(i=i.substring(1).split("-").join(this.tokenOr)),i=(i=this.parseSimpleOperators(i,[this.tokenSubtract],[this.charSubtract])).split(this.tokenOr).join("-")):i.length>0&&"+"===i[0]?i=i.substring(1):i.length>0&&"+"===i[i.length-1]&&(i=i.substring(0,i.length-1));try{if(this.indexOfAny(i,n)>-1)for(a=this.indexOfAny(i,n);a>-1;){var l="",h="",d=0,p=0,c=0;if(i[a]===this.charNOTop)d=a;else if(c=a-1,i[c]===this.parent.arithMarker){if((f=this.findLeftMarker(i.substring(0,c-1)))<0)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse]);l=this.parent.substring(i,f+1,c-f-1),d=f+1}else if(i[c]===this.parent.rightBracket){for(var u=0,f=c-1;f>0&&("q"!==i[f]||0!==u);)"q"===i[f]?u--:i[f]===this.parent.rightBracket&&u++,f--;if(f<0)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse]);l=this.parent.substring(i,f,c-f+1),d=f}else if(i[c]===this.parent.tic[0]){var g=i.substring(0,c-1).lastIndexOf(this.parent.tic);if(g<0)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse]);l=this.parent.substring(i,g,c-g+1),d=g}else{for(v=!1;c>-1&&(this.parent.isDigit(i[c])||!v&&i[c]===this.parent.getParseDecimalSeparator());)i[c]===this.parent.getParseDecimalSeparator()&&(v=!0),c-=1;if(c>-1&&v&&i[c]===this.parent.getParseDecimalSeparator())throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.number_contains_2_decimal_points]);if(0===(c+=1)||c>0&&!this.parent.isUpperChar(i[c-1]))l="n"+this.parent.substring(i,c,a-c),d=c;else{for(c-=1;c>-1&&(this.parent.isUpperChar(i[c])||this.parent.isDigit(i[c]));)c-=1;if(c>-1&&i[c]===this.sheetToken){for(c-=1;c>-1&&i[c]!==this.sheetToken;)c-=1;c>-1&&i[c]===this.sheetToken&&(c-=1)}if(c>-1&&":"===i[c]){for(c-=1;c>-1&&this.parent.isDigit(i[c]);)c-=1;for(;c>-1&&this.parent.isUpperChar(i[c]);)c-=1;if(c>-1&&i[c]===this.sheetToken){for(c--;c>-1&&i[c]!==this.sheetToken;)c--;c>-1&&i[c]===this.sheetToken&&c--}c+=1,l=this.parent.substring(i,c,a-c),l=this.parent.getCellFrom(l)}else c+=1,l=this.parent.substring(i,c,a-c);this.parent.updateDependentCell(l),d=c}(this.parent.namedRanges.size>0&&this.parent.namedRanges.has(l.toUpperCase())||this.parent.storedData.has(l.toUpperCase()))&&(l="n"+this.checkForNamedRangeAndKeyValue(l))}if(a===i.length-1)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.expression_cannot_end_with_an_operator]);var m="u"===i[c=a+1];if(m&&(c+=1),i[c]===this.parent.tic[0]){if((f=i.substring(c+1).indexOf(this.parent.tic))<0)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse];h=this.parent.substring(i,c,f+2),p=f+c+2}else if(i[c]===this.parent.arithMarker){if((f=this.findRightMarker(i.substring(c+1)))<0)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse]);h=this.parent.substring(i,c+1,f),p=f+c+2}else if("q"===i[c]){for(var u=0,f=c+1;f<i.length&&(i[f]!==this.parent.rightBracket||0!==u);)i[f]===this.parent.rightBracket?u++:"q"===i[f]&&u--,f++;if(f===i.length)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.cannot_parse];h=this.parent.substring(i,c,f-c+1),m&&(h="u"+h),p=f+1}else if(this.parent.isDigit(i[c])||i[c]===this.parent.getParseDecimalSeparator()){var v=i[c]===this.parent.getParseDecimalSeparator();for(c+=1;c<i.length&&(this.parent.isDigit(i[c])||!v&&i[c]===this.parent.getParseDecimalSeparator());)i[c]===this.parent.getParseDecimalSeparator()&&(v=!0),c+=1;if(c<i.length&&"%"===i[c]&&(c+=1),v&&c<i.length&&i[c]===this.parent.getParseDecimalSeparator())throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.number_contains_2_decimal_points];h="n"+this.parent.substring(i,a+1,c-a-1),p=c}else if(this.parent.isUpperChar(i[c])||i[c]===this.sheetToken||"u"===i[c]){if(i[c]===this.sheetToken)for(c+=1;c<i.length&&i[c]!==this.sheetToken;)c+=1;c+=1;for(var y=0,C=!1;c<i.length&&(this.parent.isUpperChar(i[c])||"_"===i[c]||"."===i[c]||"["===i[c]||"]"===i[c]||"#"===i[c]||" "===i[c]||"%"===i[c]||i[c]===this.parent.getParseDecimalSeparator()&&C);)c!==i.length-1&&"["===i[c]&&"["===i[c+1]&&(C=!0),c!==i.length-1&&"]"===i[c]&&"]"===i[c+1]&&(C=!1),c++,y++;var b=c===i.length||!this.parent.isDigit(i[c]);if(y>1){for(;c<i.length&&(this.parent.isUpperChar(i[c])||this.parent.isDigit(i[c])||" "===i[c]||"_"===i[c]);)c++;b=!0}for(;c<i.length&&this.parent.isDigit(i[c]);)c+=1;if(c<i.length&&":"===i[c]){if((c+=1)<i.length&&i[c]===this.sheetToken){for(c++;c<i.length&&i[c]!==this.sheetToken;)c+=1;c<i.length&&i[c]===this.sheetToken&&c++}for(;c<i.length&&this.parent.isUpperChar(i[c]);)c+=1;for(;c<i.length&&this.parent.isDigit(i[c]);)c+=1;c-=1,h=this.parent.substring(i,a+1,c-a),h=this.parent.getCellFrom(h)}else c-=1,h=this.parent.substring(i,a+1,c-a),(m="u"===i[c])&&(h="u"+h);b&&h.startsWith(this.sheetToken)&&(b=!this.parent.isCellReference(h)),b||this.parent.updateDependentCell(h),(this.parent.namedRanges.size>0&&this.parent.namedRanges.has(h.toUpperCase())||this.parent.storedData.has(h.toUpperCase()))&&(h="n"+this.checkForNamedRangeAndKeyValue(h)),p=c+1}var x=o.indexOf(i[a]),S=this.parent.arithMarker+l+h+r[x]+this.parent.arithMarker;d>0&&(S=i.substring(0,d)+S),p<i.length&&(S+=i.substring(p)),i=S=S.split(this.parent.arithMarker2).join(this.parent.arithMarker.toString()),a=this.indexOfAny(i,n)}else if(i.length>0&&(this.parent.isUpperChar(i[0])||i[0]===this.sheetToken)){for(var w=!0,I=!0,E=!1,R=i.length,f=0;f<R;++f)if(i[f]===this.sheetToken){if(f>0&&!E)throw this.parent.getErrorStrings()[e.CommonErrors.ref];for(E=!0,f++;f<R&&this.parent.isDigit(i[f]);)f++;if(f===R||i[f]!==this.sheetToken){w=!1;break}}else{if(!I&&this.parent.isChar(i[f])){w=!1;break}if(!this.parent.isChar(i[f])&&!this.parent.isDigit(i[f])&&i[f]!==this.sheetToken){w=!1;break}I=this.parent.isUpperChar(i[f])}w&&this.parent.updateDependentCell(i)}return i}catch(e){return e}},r.prototype.indexOfAny=function(e,t){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>-1)return r;return-1},r.prototype.findLeftMarker=function(e){var t=-1;if(e.indexOf(this.parent.arithMarker)>-1)for(var r=0,n=e.length-1;n>=0;--n)if(e[n]===this.parent.rightBracket)r--;else if(e[n]===this.parent.leftBracket)r++;else if(e[n]===this.parent.arithMarker&&0===r){t=n;break}return t},r.prototype.findRightMarker=function(e){var t=-1;if(e.indexOf(this.parent.arithMarker)>-1)for(var r=0,n=0;n<e.length;++n)if(e[n]===this.parent.rightBracket)r--;else if(e[n]===this.parent.leftBracket)r++;else if(e[n]===this.parent.arithMarker&&0===r){t=n;break}return t},r.prototype.parseFormula=function(r,n){if(r.length>0&&r[0]===this.parent.getFormulaCharacter()&&(r=r.substring(1)),r.indexOf("#REF!")>-1)return this.parent.getErrorStrings()[e.CommonErrors.ref];r.length>0&&"+"===r[0]&&(r=r.substring(1));try{this.isFailureTriggered=!1,this.isError=!1,r=this.parse(r.trim(),n),this.isFormulaParsed=!0}catch(e){var i=this.exceptionArgs(e);this.isFailureTriggered||(this.parent.trigger("onFailure",i),this.isFailureTriggered=!0);var a="string"==typeof i.exception?i.exception:i.message;r=(t.isNullOrUndefined(this.parent.getErrorLine(e))?"":"#"+this.parent.getErrorLine(e)+": ")+a,this.isError=!0}return r},r.prototype.markLibraryFormulas=function(r){var n=0,i=r.indexOf(")");if(-1===i)r=this.markNamedRanges(r);else for(;i>-1;){for(var a=0,o=i-1;o>-1&&("("!==r[o]||0!==a);)")"===r[o]&&a++,o--;if(-1===o)throw new Nr(this.parent.formulaErrorStrings[e.FormulasErrorsStrings.mismatched_parentheses]);for(var s=o-1;s>-1&&this.parent.isChar(r[s]);)s--;var l=o-s-1,h=this.parent.substring(r,s+1,l);if(l>0&&!t.isNullOrUndefined(this.parent.getFunction(h))){"AREAS"===this.parent.substring(r,s+1,l)?this.ignoreBracet=!0:this.ignoreBracet=!1;var d=this.parent.substring(r,o,i-o+1);try{var p=void 0;d=d.split("(").join("").split(")").join(""),d="("+this.formulaAutoCorrection(d,p)+")"}catch(t){if(!(p={message:t.message,exception:t,isForceCalculable:t.formulaCorrection,computeForceCalculate:!1}).isForceCalculable)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];if(this.isFailureTriggered||(this.parent.trigger("onFailure",p),this.isFailureTriggered=!0,n+=1),p.computeForceCalculate=n>0||p.computeForceCalculate,!p.isForceCalculable)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];if(!p.computeForceCalculate)throw this.parent.formulaErrorStrings[e.FormulasErrorsStrings.improper_formula];d=d.split("(").join("").split(")").join(""),d="("+this.formulaAutoCorrection(d,p)+")"}d=this.markNamedRanges(d),d=this.swapInnerParens(d),-1===(d=this.addParensToArgs(d)).lastIndexOf(this.parent.getParseArgumentSeparator())&&d.length>2&&"("===d[0]&&")"===d[d.length-1]&&"{"!==d[1]&&"("!==d[1]&&(d=(d=d.substring(0,d.length-1)+"}"+d.substring(d.length-1))[0]+"{"+d.substring(1)),r=r.substring(0,s+1)+"q"+this.parent.substring(r,s+1,l)+d.split("(").join(this.parent.leftBracket).split(")").join(this.parent.rightBracket)+r.substring(i+1)}else{if(l>0)return this.parent.getErrorStrings()[e.CommonErrors.name];var c=this.emptyStr;o>0&&(c=r.substring(0,o)),c=c+"{"+this.parent.substring(r,o+1,i-o-1)+"}",i<r.length&&(c+=r.substring(i+1)),r=c=this.markNamedRanges(c)}i=r.indexOf(")")}return r=r.split("{").join("(").split("}").join(")")},r.prototype.swapInnerParens=function(e){return e.length>2&&(e=e[0]+e.substr(1,e.length-2).split("(").join("{").split(")").join("}")+e[e.length-1]),e},r.prototype.addParensToArgs=function(e){if(0===e.length)return this.emptyStr;var t=[];t.push(this.parent.getParseArgumentSeparator()),t.push(this.parent.rightBracket);var r=e.lastIndexOf(this.parent.getParseArgumentSeparator()),n=0;if(-1===r){if(e.length>2&&"("===e[0]&&")"===e[e.length-1])if("{"!==e[1]&&"("!==e[1])e=(e=e.substring(0,e.length-1)+"}"+e.substring(e.length-1))[0]+"{"+e.substring(1);else{var i=["+","-","*","/"];r=this.lastIndexOfAny(e,i),0===n&&")"===e[e.length-1]&&(n=e.length-1),n>0&&"{"!==e[r+1]&&"}"===e[r-1]&&(e=(e=e.substr(0,n)+"}"+e.substr(n)).substr(0,r+1)+"{"+e.substr(r+1))}}else for(var a=!0;r>-1;){var o=this.indexOfAny(e.substring(r+1,e.length),t);o>=0?o=r+o+1:-1===o&&")"===e[e.length-1]&&(o=e.length-1),o>0&&"{"!==e[r+1]&&"}"!==e[o-1]&&(e=(e=e.substr(0,o)+"}"+e.substr(o)).substr(0,r+1)+"{"+e.substr(r+1)),r=e.substr(0,r).lastIndexOf(this.parent.getParseArgumentSeparator()),a&&-1===r&&"("===e[0]&&(r=0,a=!1)}return e=e.split("{}").join(this.emptyStr)},r.prototype.lastIndexOfAny=function(e,t){for(var r=e.length-1;r>-1;r--)if(t.indexOf(e[r])>-1)return r;return-1},r.prototype.markNamedRanges=function(e){var r=[")",this.parent.getParseArgumentSeparator(),"}","+","-","*","/","<",">","=","&"],n=e.length>0&&("("===e[0]||"{"===e[0])?1:0;e.indexOf("#N/A")>-1&&(e=e.split("#N/A").join("#N~A")),e.indexOf("#DIV/0!")>-1&&(e=e.split("#DIV/0!").join("#DIV~0!"));for(var i=this.indexOfAny(e.substring(n),r);i>-1&&i+n<e.length;){var a=this.emptyStr,o=null;if(this.parent.substring(e,n,i).indexOf("[")>-1?o=this.getTableRange(this.parent.substring(e,n,i)):this.parent.storedData.has(this.parent.substring(e,n,i))?o=this.checkForNamedRangeAndKeyValue(this.parent.substring(e,n,i)):this.parent.namedRanges.has(this.parent.substring(e,n,i))&&(o=this.checkForNamedRangeAndKeyValue(this.parent.substring(e,n,i))),t.isNullOrUndefined(o)&&("NaN"!==(a=this.checkScopedRange(this.parent.substring(e,n,i)))?(this.findNamedRange=!0,o=a):this.parent.substring(e,n,i).startsWith(this.sheetToken.toString()),!t.isNullOrUndefined(o)&&this.findNamedRange&&o.indexOf(this.fixedReference)>-1&&(o=o.split(this.fixedReference).join(this.emptyStr))),t.isNullOrUndefined(o)||(o=o.toUpperCase(),o=this.parent.setTokensForSheets(o),o=this.markLibraryFormulas(o)),t.isNullOrUndefined(o)||o===this.emptyStr)for(n+=i+1;n<e.length&&!this.parent.isUpperChar(e[n])&&e[n]!==this.sheetToken;)n++;else e=e.substring(0,n)+o+e.substring(n+i),n+=o.length+1;for(i=n,n<e.length-1&&"{"===e[n]&&(n+=1),i=this.indexOfAny(e.substring(n),r);0===i&&n<e.length-1;)n++,i=this.indexOfAny(e.substring(n),r);if((-1===i||e.substring(n).indexOf("[")>-1)&&n<e.length){if(o=e.substring(n).indexOf("[")>-1?this.getTableRange(e.substring(n)):this.parent.storedData.has(e.substring(n))?this.parent.storedData.size>0?this.checkForNamedRangeAndKeyValue(e.substring(n)):o:this.parent.namedRanges.size>0?this.checkForNamedRangeAndKeyValue(e.substring(n)):o,t.isNullOrUndefined(o)&&"NaN"!==(a=this.checkScopedRange(e.substring(n)))&&(o=a),!t.isNullOrUndefined(o)&&o!==this.emptyStr&&(o=o.toUpperCase(),o=this.parent.setTokensForSheets(o),null!=(o=this.markLibraryFormulas(o)))){var s=e.substring(n);e=")"===s[s.length-1]?e.substring(0,n)+o+")":e.substring(0,n)+o,n+=o.toString().length+1}i=n<e.length?this.indexOfAny(e.substring(n),r):-1}}return e.indexOf("#N~A")>-1&&(e=e.split("#N~A").join("#N/A")),e.indexOf("#DIV~0!")>-1&&(e=e.split("#DIV~0!").join("#DIV/0!")),e},r.prototype.checkForNamedRangeAndKeyValue=function(e){var r=this.emptyStr;if(e.indexOf("[")>-1){var n=this.getTableRange(e);t.isNullOrUndefined(n)||(this.findNamedRange=!0,e=n)}if("NaN"!==(r=this.checkScopedRange(e)))this.findNamedRange=!0,e=r;else{if(e.indexOf(this.sheetToken)>-1){var i=this.parent.getSheetFamilyItem(this.parent.grid),a=e.split('"').join(this.emptyStr);if(a=a.substr(0,a.indexOf(this.sheetToken)),i.sheetNameToToken.has(a.toUpperCase()))parseInt(i.sheetNameToToken.get(a.toUpperCase()).split(this.sheetToken).join(this.emptyStr))}this.parent.storedData.size>0&&this.parent.storedData.has(e)&&(e="A"+this.parent.colIndex(e)),this.parent.namedRanges.size>0&&this.parent.namedRanges.has(e.toUpperCase())&&(t.isNullOrUndefined(this.parent.parentObject)?(e=this.parse(this.parent.namedRanges.get(e.toUpperCase())),(e=this.parent.setTokensForSheets(e)).indexOf(this.fixedReference)>-1&&e.split(this.fixedReference).join(this.emptyStr),this.findNamedRange=!0):e=this.parse(this.parent.namedRanges.get(e.toUpperCase()))),this.findNamedRange&&"!"!==e[0]&&"q"!==e[0]&&"bq"!==e[0]&&(e=this.parent.setTokensForSheets(e)).indexOf(this.fixedReference)>-1&&(e=e.split(this.fixedReference).join(this.emptyStr))}return e},r.prototype.getTableRange=function(e){var t=(e=e.replace(" ",this.emptyStr).toUpperCase()).replace("]",this.emptyStr).replace("#DATA",this.emptyStr);t.indexOf(this.parent.getParseArgumentSeparator())>-1&&(t.substring(0,t.indexOf(this.parent.getParseArgumentSeparator())).replace("[",this.emptyStr),t=t.replace("[",this.emptyStr).replace(this.parent.getParseArgumentSeparator(),"_"));this.emptyStr;return t.toUpperCase()},r.prototype.findNextEndIndex=function(e,t){for(var r=0,n=t,i=!1;!i&&t<e.length;)"["===e[n]?r++:"]"===e[n]&&0===--r&&(i=!0),t++;return t-=n},r}(),Tr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fr=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Lr=function(r){function n(e){var n=r.call(this,null,null)||this;n.lFormulas=new Map,n.storedData=new Map,n.keyToRowsMap=new Map,n.rowsToKeyMap=new Map,n.rightBracket=String.fromCharCode(161),n.leftBracket=String.fromCharCode(162),n.sheetToken="!",n.emptyString="",n.leftBrace="{",n.rightBrace="}",n.cell=n.emptyString,n.cellPrefix="!0!A",n.treatEmptyStringAsZero=!1,n.tic='"',n.singleTic="'",n.trueValue="TRUE",n.falseValue="FALSE",n.parseDecimalSeparator=".",n.arithMarker=String.fromCharCode(180),n.arithMarker2=n.arithMarker+n.arithMarker,n.dependentCells=null,n.dependentFormulaCells=null,n.minValue=Number.MIN_SAFE_INTEGER,n.maxValue=Number.MAX_SAFE_INTEGER,n.categoryCollection=["All"],n.dependencyLevel=0,n.refreshedCells=new Map,n.computedValues=null,n.randomValues=new Map,n.isRandomVal=!1,n.randCollection=[],n.formulaErrorStrings=["binary operators cannot start an expression","cannot parse","bad library","invalid char in front of","number contains 2 decimal points","expression cannot end with an operator","invalid characters following an operator","invalid character in number","mismatched parentheses","unknown formula name","requires a single argument","requires 3 arguments","invalid Math argument","requires 2 arguments","#NAME?","too complex","circular reference: ","missing formula","improper formula","invalid expression","cell empty","bad formula","empty expression","","mismatched string quotes","wrong number of arguments","invalid arguments","iterations do not converge","Control is already registered","Calculation overflow","Missing sheet","cannot_parse","expression_cannot_end_with_an_operator"],n.errorStrings=null,n.parseArgumentSeparator=",",n.dateTime1900=new Date(1900,0,1,0,0,0),n.isParseDecimalSeparatorChanged=!1,n.isArgumentSeparatorChanged=!1,n.sheetFamilyID=0,n.defaultFamilyItem=null,n.sheetFamiliesList=null,n.modelToSheetID=null,n.tokenCount=0,n.sortedSheetNames=null,n.tempSheetPlaceHolder=String.fromCharCode(133),n.namedRanges=new Map,n.formulaInfoTable=null,n.oaDate=new Date(1899,11,30),n.millisecondsOfaDay=864e5,n.parseDateTimeSeparator="/";var a=new Rr(n);return n.includeBasicFormulas&&i.Inject(kr),n.injectedModules&&n.injectedModules.length&&a.inject(n.requiredModules(),n.injectedModules),n.parentObject=t.isNullOrUndefined(e)?n:e,n.grid=n.parentObject,n.parser=new Ar(n),n}Tr(n,r),i=n,Object.defineProperty(n.prototype,"libraryFormulas",{get:function(){return this.lFormulas},set:function(e){this.lFormulas.set(e.fName,{handler:e.handler,category:e.category,description:e.description})},enumerable:!0,configurable:!0}),n.prototype.getParseArgumentSeparator=function(){return this.isArgumentSeparatorChanged||","===this.parseArgumentSeparator||(this.parseArgumentSeparator=","),this.parseArgumentSeparator},n.prototype.setParseArgumentSeparator=function(e){this.parseArgumentSeparator=e,this.isArgumentSeparatorChanged=!0},n.prototype.getParseDateTimeSeparator=function(){return this.parseDateTimeSeparator},n.prototype.setTreatEmptyStringAsZero=function(e){this.treatEmptyStringAsZero=e},n.prototype.getTreatEmptyStringAsZero=function(){return this.treatEmptyStringAsZero},n.prototype.setParseDateTimeSeparator=function(e){this.parseDateTimeSeparator=e},n.prototype.requiredModules=function(){return P(this)},n.Inject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.prototype.injectedModules||(this.prototype.injectedModules=[]);for(var r=0;r<e.length;r++)-1===this.prototype.injectedModules.indexOf(e[r])&&this.prototype.injectedModules.push(e[r])},n.prototype.getInjectedModules=function(){return this.injectedModules},n.prototype.onPropertyChanged=function(e,t){},n.prototype.getModuleName=function(){return"calculate"},n.prototype.getFormulaCharacter=function(){return"="},n.prototype.isUpperChar=function(e){var t=e.charCodeAt(0);return t>64&&t<91},n.prototype.resetKeys=function(){this.storedData.clear(),this.keyToRowsMap.clear(),this.rowsToKeyMap.clear()},n.prototype.updateDependentCell=function(e){var t=this.getSheetFamilyItem(this.grid),r=this.cell;if(r!==this.emptyString){if(null!==t.sheetNameToParentObject){var n=t.parentObjectToToken.get(this.grid);-1===r.indexOf(this.sheetToken)&&(r=n+r),-1===e.indexOf(this.sheetToken)&&(e=n+e)}if(this.getDependentCells().has(e)){var i=this.getDependentCells().get(e);i.indexOf(r)<0&&i.push(r)}else this.getDependentCells().set(e,[r]);this.addToFormulaDependentCells(e)}},n.prototype.addToFormulaDependentCells=function(e){var t=this.cell,r=this.getSheetFamilyItem(this.grid);null!=r.sheetNameToParentObject&&-1===t.indexOf(this.sheetToken)&&(t=r.parentObjectToToken.get(this.grid)+t),this.getDependentFormulaCells().has(t)?this.getDependentFormulaCells().get(t).has(e)||this.getDependentFormulaCells().get(t).set(e,e):(this.getDependentFormulaCells().set(t,new Map),this.getDependentFormulaCells().get(t).set(e,e))},n.prototype.getDependentCells=function(){if(this.isSheetMember()){var e=this.getSheetFamilyItem(this.grid);return null==e.sheetDependentCells&&(e.sheetDependentCells=new Map),e.sheetDependentCells}return null==this.dependentCells&&(this.dependentCells=new Map),this.dependentCells},n.prototype.getDependentFormulaCells=function(){if(this.isSheetMember()){var e=this.getSheetFamilyItem(this.grid);return null==e.sheetDependentFormulaCells&&(e.sheetDependentFormulaCells=new Map),e.sheetDependentFormulaCells}return null==this.dependentFormulaCells&&(this.dependentFormulaCells=new Map),this.dependentFormulaCells},n.prototype.getLibraryFormulas=function(){return this.lFormulas},n.prototype.getFunction=function(e){return this.getLibraryFormulas().has(e.toUpperCase())?this.getLibraryFormulas().get(e.toUpperCase()).handler:null},n.prototype.intToDate=function(e){var t=Number(e);return(t=t>0&&t<1?1+t:0===t?1:t)>60&&(t-=1),new Date(864e5*(t-1)+new Date("01/01/1900").getTime())},n.prototype.getFormulaInfoTable=function(){if(this.isSheetMember()){var e=this.getSheetFamilyItem(this.grid);return null===e.sheetFormulaInfotable&&(e.sheetFormulaInfotable=new Map),e.sheetFormulaInfotable}return null===this.formulaInfoTable&&(this.formulaInfoTable=new Map),this.formulaInfoTable},n.prototype.getFormula=function(e){return e=e.toUpperCase(),this.storedData.has(e)?this.storedData.get(e).getFormulaText():""},n.prototype.getParseDecimalSeparator=function(){return this.isParseDecimalSeparatorChanged||"."===this.parseDecimalSeparator||(this.parseDecimalSeparator="."),this.parseDecimalSeparator},n.prototype.setParseDecimalSeparator=function(e){this.parseDecimalSeparator=e,this.isParseDecimalSeparatorChanged=!0},n.prototype.getSheetToken=function(t){var r=0,n=this.emptyString;if(r<t.length&&t[r]===this.sheetToken){for(r++;r<t.length&&t[r]!==this.sheetToken;)r++;n=t.substring(0,r+1)}if(r<t.length)return n;throw this.formulaErrorStrings[e.FormulasErrorsStrings.bad_index]},n.prototype.getSheetID=function(e){var t=this.getSheetFamilyItem(e);if(null!=t.sheetNameToParentObject&&t.sheetNameToParentObject.size>0){var r=t.parentObjectToToken.get(e);if(r){r=r.split(this.sheetToken).join(this.emptyString);var n=this.parseFloat(r);if(!this.isNaN(n))return n}}return-1},n.prototype.parseFloat=function(e){return Number(e)},n.prototype.rowIndex=function(t){var r=0,n=!1;if(r<t.length&&t[r]===this.sheetToken){for(r++;r<t.length&&t[r]!==this.sheetToken;)r++;r++}for(;r<t.length&&this.isChar(t[r]);)n=!0,r++;var i=parseInt(t.substring(r),10);if(r<t.length&&!this.isNaN(i))return i;if(n)return-1;throw this.formulaErrorStrings[e.FormulasErrorsStrings.bad_index]},n.prototype.colIndex=function(e){var t=0,r=0;if(e=e.toUpperCase(),t<e.length&&e[t]===this.sheetToken){for(t++;t<e.length&&e[t]!==this.sheetToken;)t++;t++}for(;t<e.length&&this.isChar(e[t]);)r=26*r+e[t].charCodeAt(0)-64,t++;return 0===r?-1:r},n.prototype.getErrorStrings=function(){return null===this.errorStrings&&(this.errorStrings=["#N/A","#VALUE!","#REF!","#DIV/0!","#NUM!","#NAME?","#NULL!"]),this.errorStrings},n.prototype.substring=function(e,t,r){return e.substring(t,r+t)},n.prototype.isChar=function(e){return e.charCodeAt(0)>=65&&e.charCodeAt(0)<=90||e.charCodeAt(0)>=97&&e.charCodeAt(0)<=122},n.prototype.getSheetFamilyItem=function(e){if(0===this.sheetFamilyID)return null==this.defaultFamilyItem&&(this.defaultFamilyItem=new Or),this.defaultFamilyItem;null==this.sheetFamiliesList&&(this.sheetFamiliesList=new Map);var t=this.modelToSheetID.get(e);return this.sheetFamiliesList.has(t)||this.sheetFamiliesList.set(t,new Or),this.sheetFamiliesList.get(t)},n.prototype.setKeyValue=function(e,t){e=e.toUpperCase();var r=t.toString().trim();this.storedData.get(e)&&0!==r.indexOf(this.leftBrace)||(this.storedData.set(e,new Dr),this.keyToRowsMap.set(e,this.keyToRowsMap.size+1),this.rowsToKeyMap.set(this.rowsToKeyMap.size+1,e));var n=this.storedData.get(e);if(null!=n.getFormulaText()&&n.getFormulaText().length>0&&n.getFormulaText()!==r){var i=this.cellPrefix+this.keyToRowsMap.get(e).toString();null!=this.getDependentFormulaCells().get(i)&&this.clearFormulaDependentCells(i)}r.length>0&&r[0]===this.getFormulaCharacter()?n.setFormulaText(r):n.getFormulaValue()!==r&&(n.setFormulaText(""),n.setParsedFormula(""),n.setFormulaValue(r))},n.prototype.clearFormulaDependentCells=function(e){var t=this,r=this.getDependentFormulaCells().get(e);null!=r&&(r.forEach(function(r,n){var i=n,a=t.getDependentCells().get(i);t.arrayRemove(a,e),0===a.length&&t.getDependentCells().delete(i)}),this.getDependentFormulaCells().delete(e))},n.prototype.arrayRemove=function(e,t){var r=e.indexOf(t);return-1!==r&&e.splice(r,1),e},n.prototype.getKeyValue=function(e){if(e=e.toUpperCase(),null!==this.storedData.has(e)){var r=this.storedData.get(e),n=r.getFormulaText();if(n.length>0&&n[0]===this.getFormulaCharacter()){this.cell=this.cellPrefix+this.keyToRowsMap.get(e).toString(),n=n.substring(1);try{r.setParsedFormula(this.parser.parseFormula(n,e))}catch(t){i={message:t.message,exception:t,isForceCalculable:!1,computeForceCalculate:!1};return this.trigger("onFailure",i),r.setFormulaValue(i.message),this.storedData.get(e).getFormulaValue()}try{r.setFormulaValue(this.computeFormula(r.getParsedFormula()))}catch(e){var i={message:e.message,exception:e,isForceCalculable:!1,computeForceCalculate:!1};this.trigger("onFailure",i);var a="string"==typeof i.exception?i.exception:i.message;return(t.isNullOrUndefined(this.getErrorLine(e))?"":"#"+this.getErrorLine(e)+": ")+a}}return this.storedData.get(e).getFormulaValue()}return this.emptyString},n.prototype.getNamedRanges=function(){return this.namedRanges},n.prototype.addNamedRange=function(e,t){var r=e.split(this.sheetToken);if(r.length>1){if(!this.getSheetFamilyItem(this.grid).parentObjectToToken.get(r[0]))return!1;e=r[0]+this.sheetToken+r[1].toUpperCase()}else e=e.toUpperCase();return this.namedRanges.set(e,t),!0},n.prototype.removeNamedRange=function(e){return e=e.toUpperCase(),null!=this.namedRanges.get(e)&&(this.namedRanges.delete(e),!0)},n.prototype.convertAlpha=function(e){for(var t=[],r=0;e>0;){e--;var n="A".charCodeAt(0);t[r]=String.fromCharCode(e%26+n),e=parseInt((e/26).toString(),10),r++}for(var i=[],a=0;a<r;a++)i[r-a-1]=t[a];return i.join("")},n.prototype.getCellCollection=function(e){if(e.indexOf(":")<0){if(!this.isCellReference(e))return e.split(this.getParseArgumentSeparator());e=e+":"+e}var t=this.emptyString,r=e.indexOf(this.sheetToken);if(r>-1)for(var n=r+1;n<e.length;){if(e[n]===this.sheetToken){t=e.substr(0,n+1);break}n++}var i,a,o,s,l=e.indexOf(":");if(l>0&&this.isChar(e[l-1]))for(var h=l-2;h>=0&&this.isDigit(e[h]);)h--;i=this.rowIndex(this.substring(e,0,l)),a=this.rowIndex(this.substring(e,l+1,l+e.length-l-1)),o=this.colIndex(this.substring(e,0,l)),s=this.colIndex(this.substring(e,l+1,l+e.length-l-1)),i>a&&(l=a,a=i,i=l),o>s&&(l=s,s=o,o=l);var d,p=[],c=0;for(l=i;l<=a;l++)for(d=o;d<=s;d++)p[c]=t+this.emptyString+this.convertAlpha(d)+l.toString(),c++;return p},n.prototype.computeFormula=function(e){return this.calculateFormula(e,!1)},n.prototype.calculateFormula=function(r,n){var i,a,o,s,l=!1;if(this.parser.isError)return r;i=this.parser.isFormulaParsed?r:this.parser.parseFormula(r),this.parser.isFormulaParsed=!1;try{if((a=this.findLastIndexOfq(i))>0&&(l=!0),i!==this.emptyString&&a>-1)for(var h=a+1;h>-1;)if(i[h]===this.rightBracket){var d=i.substring(a,h+1),p=d.split(this.leftBracket)[0].split("q").join(this.emptyString),c=void 0;if(this.getLibraryFormulas().get(p.toUpperCase()).isCustom){c=d.substring(d.indexOf(this.leftBracket)+1,d.indexOf(this.rightBracket)).split(this.getParseArgumentSeparator());var u=0,f=[];for(u=0;u<c.length;u++)f.push(this.getValueFromArg(c[u]));c=f}else{if(c=d.substring(d.indexOf(this.leftBracket)+1,d.indexOf(this.rightBracket)).replace(",n",",").split(this.getParseArgumentSeparator()),d.includes(this.getParseArgumentSeparator()+this.tic))for(var g=null,m=0;m<c.length;m++)c[m]&&c[m][0]===this.tic&&c[m][c[m].length-1]!==this.tic&&(g=m),null!==g&&g===m-1&&c[m][0]!=this.tic&&c[m][c[m].length-1]===this.tic&&(c[g]=c[g]+this.getParseArgumentSeparator()+c[m],c.splice(m,1),g=null);l&&p&&"IF"===p&&c.push("nestedFormulaTrue")}if(o=t.isNullOrUndefined(this.getFunction(p))?this.getErrorStrings()[e.CommonErrors.name]:this.getFunction(p).apply(void 0,c),!l)break;s=this.processNestedFormula(i,d,o);var v=this.findLastIndexOfq(s);0===v&&(l=!1),-1===v&&(o=this.computeValue(s,n)),a=h=v,i=s}else h++;else this.formulaErrorStrings.indexOf(i)>-1?o=i:i!==this.emptyString&&-1===a&&(o=this.computeValue(i,n))}catch(e){c={message:e.message,exception:e,isForceCalculable:!1,computeForceCalculate:!1};this.trigger("onFailure",c);var y="string"==typeof c.exception?c.exception:c.message;o=(t.isNullOrUndefined(this.getErrorLine(e))?"":"#"+this.getErrorLine(e)+": ")+y}return o},n.prototype.computeSumIfAndAvgIf=function(r){if(t.isNullOrUndefined(r)||r[0]===this.emptyString||0===r.length)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var n=r,i=0;i<n.length;i++)if(this.isCellReference(n[i])&&t.isNullOrUndefined(n[i].match(/[0-9]/))&&n[i].indexOf("!")<0){var a=n[i].split(":");n[i]=a[0]+"1:"+a[1]+this.spreadSheetUsedRange[0]}var o=n.length;if(2!==o&&3!==o&&0===o)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var s=n[0],l=n[1].trim();if((l=l.split(this.tic).join(this.emptyString)).length>255)return this.getErrorStrings()[e.CommonErrors.value];var h=l.includes("*"),d=h?l.replace(/\*/g,"").trim():l;d=this.isCellReference(d)?this.getValueFromArg(d):l,h&&("*"===l[0]&&(d="*"+d),"*"===l[l.length-1]&&(d+="*")),l=d;var p=this.parser.tokenEqual;l.startsWith("<=")?(p=this.parser.tokenLessEq,l=l.substring(2)):l.startsWith(">=")?(p=this.parser.tokenGreaterEq,l=l.substring(2)):l.startsWith("<>")?(p=this.parser.tokenNotEqual,l=l.substring(2)):l.startsWith("<")?(p=this.parser.tokenLess,l=l.substring(1)):l.startsWith(">")?(p=this.parser.tokenGreater,l=l.substring(1)):l.startsWith("=")&&(p=this.parser.tokenEqual,l=l.substring(1));var c=this.parseFloat(l),u=n[0],f=this.getCellCollection(o>2?n[2]:s),g=this.getCellCollection(u),m=this.getComputeSumIfValue(g,f,l,c,p,h);return[m[0],m[1]]},n.prototype.findWildCardValue=function(e,t){var r="";if(e.indexOf("?")>-1){var n=e[(o=e.indexOf("?"))-1],i=e[o+1];if(t.indexOf(n)>-1&&t.indexOf(i)>-1){var a=t.indexOf(n);r=t[a]===n&&t[a+2]===i?e:t}else r=t}else if(e.indexOf("*")>-1){for(var o=e.indexOf("*"),s="",l="",h=this.falseValue,d=this.falseValue,p=o-1;p>=0;p--)s+=e[p],d=this.trueValue;for(p=o+1;p<e.length;p++)l+=e[p],h=this.trueValue;var c=""===s?-1:t.indexOf(s.split("").reverse().join("")),u=""===l?-1:t.indexOf(l);c>-1||u>-1?d===this.trueValue?r=s.split("").reverse().join("")===t.substr(0,s.length)?e:t:h===this.trueValue&&(r=l===t.substring(t.length-l.length,t.length)?e:t):r=t}return r},n.prototype.getComputeSumIfValue=function(e,t,r,n,i,a){var o=0,s=0;a&&r&&r[0];switch(i){case this.parser.tokenEqual:for(var l=a?r.replace(/\*/g,""):r,h=0;h<e.length;h++){var d=this.getValueFromArg(e[h].split(this.tic).join("")),p=this.parseFloat(d);if(d===r&&p===n){c=this.getValueFromArg(t[h].split(this.tic).join(""));o+=u=this.parseFloat(c),s+=1}else d===r?(o+=this.getValueFromRange(t,h),s+=1):a&&l&&d&&("*"===r[0]&&l.length<=d.length&&l===d.slice(0,l.length)&&(o+=this.getValueFromRange(t,h),s+=1),"*"===r[r.length-1]&&l.length<=d.length&&l===d.slice(d.length-l.length,d.length)&&(o+=this.getValueFromRange(t,h),s+=1))}break;case this.parser.tokenLess:for(h=0;h<e.length;h++){d=this.getValueFromArg(e[h].split(this.tic).join(""));if((p=this.parseFloat(d))<n){c=this.getValueFromArg(t[h].split(this.tic).join(""));o+=u=this.parseFloat(c),s+=1}}break;case this.parser.tokenGreater:for(h=0;h<e.length;h++){d=this.getValueFromArg(e[h].split(this.tic).join(""));if((p=this.parseFloat(d))>n){c=this.getValueFromArg(t[h].split(this.tic).join(""));o+=u=this.parseFloat(c),s+=1}}break;case this.parser.tokenLessEq:for(h=0;h<e.length;h++){d=this.getValueFromArg(e[h].split(this.tic).join(""));if((p=this.parseFloat(d))<=n){c=this.getValueFromArg(t[h].split(this.tic).join(""));o+=u=this.parseFloat(c),s+=1}}break;case this.parser.tokenGreaterEq:for(h=0;h<e.length;h++){d=this.getValueFromArg(e[h].split(this.tic).join(""));if((p=this.parseFloat(d))>=n){c=this.getValueFromArg(t[h].split(this.tic).join(""));o+=u=this.parseFloat(c),s+=1}}break;case this.parser.tokenNotEqual:for(h=0;h<e.length;h++){var d=this.getValueFromArg(e[h].split(this.tic).join("")),p=this.parseFloat(d);if(d!==r&&p!==n){var c=this.getValueFromArg(t[h].split(this.tic).join("")),u=this.parseFloat(c);o+=u,s+=1}}}return[o,s]},n.prototype.getValueFromRange=function(e,t){var r=e[t];return r=this.getValueFromArg(r),this.parseFloat(r.toString())},n.prototype.computeAndOr=function(t,r){var n,i,a="and"===r;if(0===t.length)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var o=0,s=t.length;o<s;o++)if(t[o].split(this.tic).join("").trim()===this.emptyString)return this.getErrorStrings()[e.CommonErrors.value];for(var l=t,h=0;h<l.length;h++){if(l[h]===this.tic)return this.getErrorStrings()[e.CommonErrors.value];if(l[h].indexOf(":")>-1&&this.isCellReference(l[h]))for(var d=this.getCellCollection(l[h]),p=0;p<d.length;p++){if(this.getErrorStrings().indexOf(d[p])>-1)return d[p];if(d[p][0]===this.tic)return this.getErrorStrings()[e.CommonErrors.name];if(""===(n=this.getValueFromArg(d[p]))&&(n=this.trueValue),this.getErrorStrings().indexOf(n)>-1)return n;i=this.parseFloat(n)}else{if(n=this.getValueFromArg(l[h]).split(this.tic).join("").toUpperCase(),this.getErrorStrings().indexOf(n)>-1)return n;var c=Date.parse(n.split(this.tic).join(""));if(isNaN(c)){if(n!==this.trueValue&&n!==this.falseValue)return this.getErrorStrings()[e.CommonErrors.value].toString()}else a=!0;i=this.parseFloat(n)}a="and"===r?a&&(n===this.trueValue||!isNaN(i)):a||n===this.trueValue||!isNaN(i)}return a?this.trueValue:this.falseValue},n.prototype.removeTics=function(e){return e.length>1&&e[0]===this.tic[0]&&e[e.length-1]===this.tic[0]&&(e=this.substring(e,1,e.length-2)),e},n.prototype.getCellFrom=function(e){var t,r="",n=e.indexOf(":")>-1?e.split(":"):[e],i=n.length-1,a=this.rowIndex(n[0]);if(a===this.rowIndex(n[i])){var o=this.colIndex(n[0]),s=this.colIndex(n[i]),l=this.colIndex(this.cell);l>=o&&l<=s&&(r=V(l).toString()+a.toString())}else if(this.colIndex(n[0])===this.colIndex(n[i])){t=this.colIndex(n[0]);var h=this.rowIndex(n[i]),d=this.rowIndex(this.cell);d>=a&&d<=h&&(r=V(t).toString()+d.toString())}return r},n.prototype.computeValue=function(t,r){try{var n=[],i=0,a="";for(n.length=0;i<t.length;){var o="u"===t[i];if(t[i]!==this.arithMarker){if(this.isDigit(t[i])){for(s=this.emptyString;i<t.length&&(this.isDigit(t[i])||t[i]===this.parseDecimalSeparator);)s+=t[i],i+=1;if(n.push(s),!t[i])return n.toString()}if(t[i]===this.sheetToken){for(a=t[i],i+=1;i<t.length&&t[i]!==this.sheetToken;)a+=t[i],i+=1;i<t.length&&(a+=t[i],i+=1)}else if(this.isUpperChar(t[i])){for(var s=this.emptyString,l="";i<t.length&&this.isUpperChar(t[i]);)s+=t[i],i+=1;for(;i<t.length&&this.isDigit(t[i]);)s+=t[i],i+=1;if(i<t.length&&":"===t[i]){if(s+=t[i],(i+=1)<t.length&&t[i]===this.sheetToken)for(s+=t[i],i+=1;i<t.length&&t[i]!==this.sheetToken;)s+=t[i],i+=1;for(;i<t.length&&this.isUpperChar(t[i]);)s+=t[i],i+=1;for(;i<t.length&&this.isDigit(t[i]);)s+=t[i],i+=1;s=a+this.getCellFrom(s)}else s=a+s;if(l=this.getParentObjectCellValue(s,r).toString(),a="","string"==typeof l&&this.getErrorStrings().indexOf(l)>-1)return l;n.push(l)}else if("q"===t[i]){var h=t.substring(i+1).indexOf(this.leftBracket),d=t.substring(i+h+1).indexOf(this.rightBracket);t=this.substring(t,i+h+2,d-1)}else if(t[i]===this.tic[0]){s=t[i].toString();for(i+=1;i<t.length&&t[i]!==this.tic[0];)s+=t[i],i+=1;n.push(s.split(this.tic).join(this.emptyString)),i+=1}else if("%"===t[i]&&n.length>0){var p=n[0],c=this.parseFloat(p);this.isNaN(c)||(n.pop(),n.push((c/100).toString())),i+=1}else if(0===t.substring(i).indexOf(this.trueValue))n.push(this.trueValue),i+=this.trueValue.length;else if(0===t.substring(i).indexOf(this.falseValue))n.push(this.falseValue),i+=this.falseValue.length;else if(t[i]===this.tic[0]||"|"===t[i]){s=t[i].toString();for(i++;i<t.length&&t[i]!==this.tic[0];)s+=t[i],i+=1;n.push(s+this.tic),i+=1}else switch(t[i]){case"#":var u=0;this.getErrorStrings().indexOf(t.substring(i))>-1?(u=-1===t.indexOf("!")||-1===t.substring(i).indexOf("!")?t.indexOf("#N/A")>-1?t.indexOf("#N/A")+4+i:t.indexOf("?")+1+i:t.indexOf("!")+1+i,n.push(this.substring(t,i,u-i))):(u=i+1,n.push(this.substring(t,i,u-i))),i=u;break;case"n":i+=1;s="";if(0===t.substring(i).indexOf("Infinity"))i+=(s="Infinity").length;else{for(("u"===t[i]||o||"-"===t[i])&&(s="-",o?o=!1:i+=1);i<t.length&&this.isDigit(t[i])||t[i]===this.getParseDecimalSeparator();)s+=t[i],i+=1;if(i<t.length&&"%"===t[i])if(i+=1,""===s){if(n.length>0){var p=n[0],c=this.parseFloat(p);this.isNaN(c)||(n.pop(),n.push((c/100).toString()))}}else s=(this.parseFloat(s)/100).toString()}n.push(s);break;case this.parser.tokenAdd:this.getValArithmetic(n,"add"),i+=1;break;case this.parser.tokenSubtract:this.getValArithmetic(n,"sub"),i+=1;break;case this.parser.tokenMultiply:this.getValArithmetic(n,"mul"),i+=1;break;case this.parser.tokenDivide:this.getValArithmetic(n,"div"),i+=1;break;case this.parser.tokenLess:this.processLogical(n,"less"),i+=1;break;case this.parser.tokenGreater:this.processLogical(n,"greater"),i+=1;break;case this.parser.tokenGreaterEq:this.processLogical(n,"greaterEq"),i+=1;break;case this.parser.tokenLessEq:this.processLogical(n,"lessEq"),i+=1;break;case this.parser.tokenNotEqual:this.processLogical(n,"notEq"),i+=1;break;case this.parser.tokenOr:this.processLogical(n,"or"),i+=1;break;case this.parser.tokenAnd:this.processLogical(n,"and"),i+=1;break;case this.parser.tokenEqual:this.processLogical(n,"equal"),i+=1;break;default:return this.getErrorStrings()[e.CommonErrors.value]}}else i+=1}if(0===n.length)return this.emptyString;for(var s=this.emptyString,f=n.length;f>0;){if((s=n.pop()+s)===this.emptyString&&this.isCellReference(t)&&this.getTreatEmptyStringAsZero())return"0";f--}return s}catch(t){if(this.getErrorStrings().indexOf(t)>-1||this.formulaErrorStrings.indexOf(t)>-1)throw t;throw new Nr(this.formulaErrorStrings[e.FormulasErrorsStrings.invalid_expression])}},n.prototype.getValArithmetic=function(t,r){var n=t.pop();n=n===this.emptyString?"0":n;var i=Number(n);if(isNaN(i))throw n===this.getErrorStrings()[e.CommonErrors.divzero]?this.getErrorStrings()[e.CommonErrors.divzero]:this.getErrorStrings()[e.CommonErrors.value];var a=t.pop();if(a=a===this.emptyString?t.length?t.pop():"0":a,i=Number(a),isNaN(i))throw n===this.getErrorStrings()[e.CommonErrors.divzero]?this.getErrorStrings()[e.CommonErrors.divzero]:this.getErrorStrings()[e.CommonErrors.value];"add"===r&&t.push((Number(a)+Number(n)).toString()),"sub"===r&&t.push((Number(a)-Number(n)).toString()),"mul"===r&&t.push((Number(a)*Number(n)).toString()),"div"===r&&(this.isNaN(this.parseFloat(n))||this.isNaN(this.parseFloat(a))?t.push(this.getErrorStrings()[e.CommonErrors.value]):0===this.parseFloat(n)?t.push(this.getErrorStrings()[e.CommonErrors.divzero]):t.push((Number(a)/Number(n)).toString()))},n.prototype.processLogical=function(e,t){var r,n,i,a;"and"!==t&&"equal"!==t&&(r=e.pop(),n=e.pop(),i=r.indexOf(this.tic)>-1?r:this.parseFloat(r),a=n.indexOf(this.tic)>-1?n:this.parseFloat(n));var o;return"less"===t&&(o=this.isNaN(i)||this.isNaN(a)?n.toUpperCase().split(this.tic).join("").localeCompare(r.toUpperCase().split(this.tic).join(""))<0?this.trueValue:this.falseValue:a<i?this.trueValue:this.falseValue),"greater"===t&&(o=this.isNaN(i)||this.isNaN(a)?n.toUpperCase().split(this.tic).join("").localeCompare(r.toUpperCase().split(this.tic).join(""))>0?this.trueValue:this.falseValue:a>i?this.trueValue:this.falseValue),"lessEq"===t&&(o=this.isNaN(i)||this.isNaN(a)?n.toUpperCase().split(this.tic).join("").localeCompare(r.toUpperCase().split(this.tic).join(""))<=0?this.trueValue:this.falseValue:a<=i?this.trueValue:this.falseValue),"greaterEq"===t&&(o=this.isNaN(i)||this.isNaN(a)?n.toUpperCase().split(this.tic).join("").localeCompare(r.toUpperCase().split(this.tic).join(""))>=0?this.trueValue:this.falseValue:a>=i?this.trueValue:this.falseValue),"notEq"===t&&(o=n!==r?this.trueValue:this.falseValue),"and"===t&&(r=e.pop().toString(),n="",e.length>0&&(n=e.pop().toString()),o=(o=this.emptyString+n+r+this.emptyString).split(this.tic).join("")),"equal"===t&&(r=e.pop().toString(),""===(n=e.pop().toString())&&""!==r&&(n="0"),o=r===n?this.trueValue:this.falseValue),"or"===t&&(o=Math.pow(this.parseFloat(a),this.parseFloat(i)).toString()),e.push(o),o},n.prototype.computeStoreCells=function(e){for(var t=e.cellValue,r=e.cellRange,n=e.criteria,i=e.argArray,a=e.isCriteria,o=e.storedCells,s=e.isCountIfS,l=e.countVal,h=a===this.trueValue?o:t,d=[],p=0;p<h.length;p++){var c=[],u=this.getValueFromArg(t[p]),f=void 0,g="";if(f=i[2].split(this.tic).join(this.emptyString),f=this.isCellReference(f)?this.getValueFromArg(f):f,(a=s===this.trueValue?this.trueValue:a)===this.trueValue){var m="",v=0,y=0;for(o[p]=s===this.trueValue&&0===l?t[p]:o[p],m=o[p];!this.isDigit(m[v]);)v+=1;if(this.isCellReference(r[l])&&r[l].indexOf(":")>-1){var C=r[l].indexOf(":");for(g=this.substring(r[l],C);!this.isDigit(g[y]);)y+=1}var b=this.substring(m,v),x=this.substring(g,y);g=o[p].split(b).join(x),u=this.getValueFromArg(g),f=s===this.trueValue?n[l].split(this.tic).join(this.emptyString):n[l-1].split(this.tic).join(this.emptyString)}var S="equal";f.startsWith("<=")?(S="lessEq",f=f.substring(2)):f.startsWith(">=")?(S="greaterEq",f=f.substring(2)):f.startsWith("<>")?(S="notEq",f=f.substring(2)):f.startsWith("<")?(S="less",f=f.substring(1)):f.startsWith(">")?(S="greater",f=f.substring(1)):f.startsWith("=")&&(S="equal",f=f.substring(1)),(f.indexOf("*")>-1||f.indexOf("?")>-1)&&(u=this.findWildCardValue(f,u)),c.push(u.toLowerCase()),c.push(f.toLowerCase()),this.processLogical(c,S)===this.trueValue&&(a===this.falseValue?d.push(t[p]):d.push(g))}return o=d,d=[],o},n.prototype.computeIfsFormulas=function(r,n,i){if(t.isNullOrUndefined(r)||""===r[0]||0===r.length)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];var a=r,o=a.length;if(o<2||o>127)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var s=[],l=[],h=[],d=0,p=0;p<a.length;p++)a[p].indexOf(":")>-1&&this.isCellReference(a[p])?s.push(a[p]):l.push(a[p]);s=(s=s.toString().split(",,").join(",")).split(this.getParseArgumentSeparator());for(var c=[],p=0;p<s.length;p++)c.push(this.getCellCollection(s[p]).length);for(v=0;v<c.length;v++)if(c[v]&&c[v+1]&&c[v]!==c[v+1])return this.getErrorStrings()[e.CommonErrors.value];var u,f;if(n===this.falseValue){f=this.falseValue;g={cellValue:u=this.getCellCollection(s[1]),cellRange:s,criteria:l,argArray:a,isCriteria:f,storedCells:h,isCountIfS:n};if(h=this.computeStoreCells(g),0===h.length)return i===this.trueValue?this.getErrorStrings()[e.CommonErrors.divzero]:0}for(p=n===this.trueValue?0:2;p<s.length;p++){f=this.trueValue,f=n===this.trueValue&&0===p?this.falseValue:this.trueValue;var g={cellValue:u=this.getCellCollection(s[p]),cellRange:s,criteria:l,argArray:a,isCriteria:f,storedCells:h,isCountIfS:n,countVal:p};if(h=this.computeStoreCells(g),0===h.length)return 0}for(var m=0,v=0;v<h.length;v++){var y="",C="",b=0,x=0;for(y=h[v];!this.isDigit(y[b]);)b+=1;if(this.isCellReference(s[0])&&s[0].indexOf(":")>-1){var S=s[0].indexOf(":");for(C=this.substring(s[0],S);!this.isDigit(C[x]);)x+=1}var w=this.substring(y,b),I=this.substring(C,x);if(u=h[v].split(w).join(I),n===this.trueValue)d+=1;else{m++;var E=this.getValueFromArg(u);d+=parseFloat(""===E?"0":E)}}return i===this.trueValue&&(d/=m),d},n.prototype.processNestedFormula=function(e,t,r){return e.split(t).join("n"+r)},n.prototype.isNaN=function(e){return"NaN"===e.toString()||"string"==typeof e},n.prototype.fromOADate=function(e){var t=new Date;return t.setTime(e*this.millisecondsOfaDay+Date.parse(this.oaDate.toString())),t},n.prototype.getSerialDateFromDate=function(e,t,r){var n=0;e<1900&&(e+=1900);for(var i=!1;!i;){for(;t>12;)e++,t-=12;i=!0;for(var a=new Date(e,t,1,-1).getDate();r>a;)a=new Date(e,t,1,-1).getDate(),t++,r-=a,i=!1;r<1&&(t--,r=(a=new Date(e,t,1,-1).getDate())-r)}var o=Date.parse(e.toString()+this.getParseDateTimeSeparator()+t.toString()+this.getParseDateTimeSeparator()+r.toString());return this.isNaN(o)||(n=this.toOADate(new Date(o))),n},n.prototype.toOADate=function(e){return(e.getTime()-Date.parse(this.oaDate.toString()))/this.millisecondsOfaDay},n.prototype.calculateDate=function(e){return this.parseFloat(e)<10?"0"+e:e},n.prototype.isTextEmpty=function(e){return null===e||""===e},n.prototype.isDigit=function(e){var t=e.charCodeAt(0);return t>47&&t<58},n.prototype.findLastIndexOfq=function(e){return e.lastIndexOf("q")},n.prototype.getValueFromArg=function(r){var n=r=r.trim(),i=this.dateTime1900,a=n;if(t.isNullOrUndefined(n)||this.isTextEmpty(n))return n;if(r[0]===this.tic||r[0]===this.singleTic)return i=this.isDate(r.split(this.tic).join("")),this.isNaN(this.parseFloat(r.split(this.tic).join("")))&&!t.isNullOrUndefined(i)&&!this.isNaN(i.getDate())&&this.dateTime1900<=i?this.toOADate(i).toString():r;if(r=r.split("u").join("-"),!this.isUpperChar(n[0])&&(this.isDigit(n[0])||n[0]===this.getParseDecimalSeparator()||"-"===n[0]||"n"===n[0]))return"n"===n[0]&&(n=n.substring(1)).indexOf('"n')>-1&&(n=n.replace('"n','"')),n;var o=["+","-","/","*",")",")","{"];if(-1===this.parser.indexOfAny(n,o)&&this.isUpperChar(n[0])||n[0]===this.sheetToken){if(n!==this.trueValue&&n!==this.falseValue&&this.isCellReference(n)){var s=this.getSheetFamilyItem(this.grid);null!==s.sheetNameToParentObject&&s.sheetNameToParentObject.size>0&&-1===n.indexOf(this.sheetToken)&&(n=s.parentObjectToToken.get(this.grid)+n)}if(n===this.cell){var l=this.getDependentCells().get(n);throw null!=l&&l.indexOf(n)>-1&&this.arrayRemove(l,n),this.getDependentFormulaCells().has(this.cell)||this.clearFormulaDependentCells(this.cell),this.formulaErrorStrings[e.FormulasErrorsStrings.circular_reference]+n}return a=this.getParentObjectCellValue(n,!1),this.updateDependentCell(n),a.toString()}return this.getErrorStrings().indexOf(r)>-1?r:this.computeValue(a.toString(),!1)},n.prototype.isDate=function(e){if("object"==typeof e||null!==Date.parse(e)){var t=new Date(Date.parse(e));return t>=this.dateTime1900?t:null}return null},n.prototype.isValidCellReference=function(e){var r=0,n=0,i=[89,71,69],a=this.emptyString;if(this.namedRanges.has(e))return!1;for(var o=0;o<e.length;o++)this.isChar(e[o])&&r++;if((a=e.substring(0,r)).length<4){for(;n<a.length;){if(t.isNullOrUndefined(a[n])||!(a[n].charCodeAt(0)<i[n])){if(t.isNullOrUndefined(a[n])&&n>0)break;return!1}n++}if(this.parseFloat(e.substring(r,e.length))<1048576)return!0}return!1},n.prototype.parseDate=function(t){if(!this.isNaN(t)){if(t instanceof Date)return new Date(t);var r=parseInt(t,10);return r<0?this.getErrorStrings()[e.CommonErrors.num]:r<=60?new Date(this.dateTime1900.getTime()+864e5*(r-1)):new Date(this.dateTime1900.getTime()+864e5*(r-2))}return"string"!=typeof t||(t=new Date(t),this.isNaN(t))?this.getErrorStrings()[e.CommonErrors.value]:t},n.prototype.isCellReference=function(e){if(e===this.emptyString)return!1;e=e.trim(),e=this.setTokensForSheets(e);var t=this.getSheetToken(e),r=!1;""!==t&&(e=e.split(t).join(this.emptyString));var n=!1,i=!1;if(e.indexOf(":")!==e.lastIndexOf(":"))return!1;for(var a=e.split("").join(this.getParseArgumentSeparator()).split(this.getParseArgumentSeparator()),o=0;o<a.length;o++)if(this.isChar(a[o]))n=!0;else if(this.isDigit(a[o]))i=!0;else{if(":"!==a[o])return!1;n&&i&&(r=!0),n=!1,i=!1}return e.indexOf(":")>-1&&-1===e.indexOf(this.tic)?!!(r&&n&&i)||!(!(n&&!i||!n&&i)||r):!(!n||!i||-1!==e.indexOf(this.tic))},n.prototype.setTokensForSheets=function(e){var t=this.getSheetFamilyItem(this.grid),r=this.getSortedSheetNames();if(null!=r)for(var n=0;n<r.length;n++){var i=t.sheetNameToToken.get(r[n]);i=i.split(this.sheetToken).join(this.tempSheetPlaceHolder);var a=this.singleTic+"SHEET"+r[n]+this.singleTic+this.sheetToken;-1===e.indexOf(a)&&(a="SHEET"+r[n]+this.sheetToken),e=e.split(a).join(i),a=r[n]+this.sheetToken,e=e.split(a).join(i)}if((e=e.split(this.tempSheetPlaceHolder).join(this.sheetToken)).indexOf("!!")>-1){var o=(e=e.replace("!!","!")).split("");o[1]=(parseInt(o[1],10)+1).toString(),e=o.join("")}return e},n.prototype.getParentObjectCellValue=function(t,r){if(t===this.trueValue||t===this.falseValue)return t;var n=t.lastIndexOf(this.sheetToken),i=0,a=0,o=this.grid,s=this.getSheetFamilyItem(o);if(n>-1&&null!==s.tokenToParentObject)this.grid=s.tokenToParentObject.get(t.substring(0,n+1)),i=this.rowIndex(t),a=this.colIndex(t);else if(-1===n){for(var l=0;l<t.length&&this.isChar(t[l]);)l++;if(l===t.length)return t=t.toLowerCase(),""===t?this.getErrorStrings()[e.CommonErrors.value]:this.getErrorStrings()[e.CommonErrors.name];i=this.rowIndex(t),a=this.colIndex(t),s.isSheetMember&&null!=s.parentObjectToToken&&(t=s.parentObjectToToken.get(this.grid)+t)}var h=""===this.cell||null===this.cell?"":this.cell;if(this.cell=t,h===this.cell)throw this.formulaErrorStrings[e.FormulasErrorsStrings.circular_reference];var d=this.getParentCellValue(i,a,this.grid,h,o,r);return this.grid=o,this.cell=h,d},n.prototype.getParentCellValue=function(e,r,n,i,a,o){var s;return void 0!==this.parentObject.getValueRowCol?(i&&(i=a===n?"":i+this.getSheetID(a)),s=this.parentObject.getValueRowCol(this.getSheetID(n),e,r,i,o),t.isNullOrUndefined(s)?this.emptyString:s.toString()):(""!==(s=this.getValueRowCol(this.getSheetID(n),e,r))&&void 0!==s||(s=""),s)},n.prototype.getValueRowCol=function(e,t,r){var n=this.rowsToKeyMap.get(t).toString(),i=this.getKeyValue(n).toString();if(null!=i&&"%"===i[i.length-1]&&i.length>1){var a=this.parseFloat(i.substring(0,i.length-1));this.isNaN(a)&&(i=(Number(a)/100).toString())}return i},n.prototype.defineFunction=function(e,r){"string"==typeof r&&(r=t.getValue(r,window)),e=e.toUpperCase(),this.libraryFormulas.set(e,{handler:r,isCustom:!0})},n.prototype.valueChanged=function(e,r,n,i){var a=e;this.spreadSheetUsedRange=i,this.grid=e;var o=!0,s=!0,l=this.getSheetFamilyItem(a),h=V(r.getColIndex())+r.getRowIndex().toString();this.actCell=h,null!==l.sheetNameToParentObject&&l.sheetNameToParentObject.size>0&&(h=l.parentObjectToToken.get(a)+h);var d=r.getValue().toUpperCase();if(d.indexOf("=RAND()")>-1||d.indexOf("RAND()")>-1||d.indexOf("=RANDBETWEEN(")>-1||d.indexOf("RANDBETWEEN(")>-1||this.randomValues.has(h)){var p=this.randCollection.toString();this.randomValues.has(h)?this.randomValues.has(h)&&(d.indexOf("=RAND()")>-1||d.indexOf("RAND()")>-1||d.indexOf("=RANDBETWEEN(")>-1||d.indexOf("RANDBETWEEN(")>-1?this.randomValues.set(h,r.getValue()):r.getValue().toUpperCase()!==this.randomValues.get(h.toUpperCase())&&(this.randomValues.delete(h),p=p.split(h+this.parseArgumentSeparator).join("").split(this.parseArgumentSeparator+h).join("").split(h).join(""),this.randCollection=p.split(this.parseArgumentSeparator)),0===this.randomValues.size&&this.randCollection.length&&(this.isRandomVal=!1,this.randomValues.clear(),this.randCollection=[])):(this.randomValues.set(h,r.getValue()),this.randCollection.push(h),this.isRandomVal=!0)}if(r.getValue()&&r.getValue()[0]===this.getFormulaCharacter()){this.cell=h;var c=void 0;if(t.isNullOrUndefined(s)||(s=n),this.getFormulaInfoTable().has(h)){if(c=this.getFormulaInfoTable().get(h),r.getValue()!==c.getFormulaText()||null==c.getParsedFormula()){c.setFormulaText(r.getValue()),this.getDependentFormulaCells().has(this.cell)&&this.clearFormulaDependentCells(this.cell);try{c.setParsedFormula(this.parser.parseFormula(r.getValue()))}catch(e){c.setFormulaValue(e),s=!1}}if(s){this.parser.isFormulaParsed=!0;var u=this.computeFormula(c.getParsedFormula());o=u!==c.getFormulaValue(),c.setFormulaValue(u)}}else{(c=new Dr).setFormulaText(r.getValue()),this.getDependentFormulaCells().has(h)||this.getDependentFormulaCells().set(h,new Map);try{c.setParsedFormula(this.parser.parseFormula(r.getValue()))}catch(e){c.setFormulaValue(e),s=!1}s&&c.setFormulaValue(this.computeFormula(c.getParsedFormula())),this.getFormulaInfoTable().has(h),this.getFormulaInfoTable().set(h,c)}s&&(void 0===this.parentObject.setValueRowCol?this.setValueRowCol(this.getSheetID(a)+1,c.getFormulaValue(),r.getRowIndex(),r.getColIndex()):this.parentObject.setValueRowCol(this.getSheetID(a)+1,c.getFormulaValue(),r.getRowIndex(),r.getColIndex()))}else this.getFormulaInfoTable().has(h)&&(this.getFormulaInfoTable().delete(h),this.getDependentFormulaCells().has(h)&&this.clearFormulaDependentCells(h));s&&o&&this.getDependentCells().has(h)&&this.getDependentCells().get(h).toString()!==h&&(this.getComputedValue().clear(),this.refresh(h))},n.prototype.getComputedValue=function(){return null===this.computedValues&&(this.computedValues=new Map),this.computedValues},n.prototype.setValueRowCol=function(e,t,r,n){},n.prototype.getSortedSheetNames=function(){var e=this.getSheetFamilyItem(this.grid);if(null!=e&&null!=e.sheetNameToToken){var t=[];e.sheetNameToToken.forEach(function(e,r){t.push(r),t.sort()}),this.sortedSheetNames=t,this.sortedSheetNames.sort(),this.sortedSheetNames.length>9&&this.sortedSheetNames[0].includes("1")&&this.sortedSheetNames[1].includes("10")&&(this.sortedSheetNames.splice(this.sortedSheetNames.indexOf("2"),0,this.sortedSheetNames[0]),this.sortedSheetNames.splice(0,1))}return this.sortedSheetNames},n.prototype.getErrorLine=function(e){var t=e.stack?e.stack.split("\n")[1].split(":"):null;return t?t[t.length-2]:null},n.prototype.createSheetFamilyID=function(){return this.sheetFamilyID===Number.MAX_SAFE_INTEGER&&(this.sheetFamilyID=Number.MIN_SAFE_INTEGER),this.sheetFamilyID++},n.prototype.computeMinMax=function(r,n){var i,a,o=0;if(t.isNullOrUndefined(r)||0===r.length)return this.formulaErrorStrings[e.FormulasErrorsStrings.wrong_number_arguments];for(var s=0,l=r.length;s<l;s++)if(r[s].split(this.tic).join("").trim()===this.emptyString)return this.getErrorStrings()[e.CommonErrors.value];i="max"===n?this.minValue:this.maxValue;var h=r;if(h.length>255)return this.getErrorStrings()[e.CommonErrors.value];for(var d=0;d<h.length;d++)if(h[d].indexOf(":")>-1&&this.isCellReference(h[d]))for(var p=this.getCellCollection(h[d]),c=0;c<p.length;c++){if(a=this.getValueFromArg(p[c]),this.getErrorStrings().indexOf(a)>-1)return a;f=this.parseFloat(a);""===a||this.isNaN(this.parseFloat(f))?(o+=1)===p.length&&(i=0):i="max"===n?Math.max(i,f):Math.min(i,f)}else{var u=this.getValueFromArg(h[d]);if(this.getErrorStrings().indexOf(u)>-1)return u;var f=this.parseFloat(u);if(""===u||this.isNaN(this.parseFloat(f))){(o+=1)===a.length&&(i=0);continue}i="max"===n?Math.max(i,f):Math.min(i,f)}return i.toString()},n.prototype.calculateAvg=function(r){for(var n=0,i=r,a=[],o=0,s=0,l=0;l<i.length;l++)if(i[l].indexOf(":")>-1&&this.isCellReference(i[l])){s=0,a=this.getCellCollection(i[l]),o=0;for(var h=0;h<a.length;h++){d=this.getValueFromArg(a[h]);t.isNullOrUndefined(d)||isNaN(this.parseFloat(d))||(o+=this.parseFloat(d),s+=1)}if(0===s)return this.getErrorStrings()[e.CommonErrors.divzero];n=(o/=s)+n}else{if(i[l].indexOf(this.tic)>-1&&isNaN(parseFloat(i[l].split(this.tic).join(""))))return this.getErrorStrings()[e.CommonErrors.value];0===i[l].length&&(i[l]="1");var d=this.getValueFromArg(i[l].split(this.tic).join(""));if(t.isNullOrUndefined(d)||isNaN(this.parseFloat(d)))return this.getErrorStrings()[e.CommonErrors.name];n+=this.parseFloat(d)}return(n/(i.length-0)).toString()},n.prototype.registerGridAsSheet=function(e,r,n){t.isNullOrUndefined(this.modelToSheetID)&&(this.modelToSheetID=new Map),t.isNullOrUndefined(this.modelToSheetID.get(r))&&this.modelToSheetID.set(r,n);var i=this.getSheetFamilyItem(r);i.isSheetMember=!0;var a=e.toUpperCase();if(0===i.parentObjectToToken.size&&(i.parentObjectToToken=new Map),0===i.sheetNameToParentObject.size&&(i.sheetNameToParentObject=new Map),0===i.sheetNameToToken.size&&(i.sheetNameToToken=new Map),0===i.tokenToParentObject.size&&(i.tokenToParentObject=new Map),t.isUndefined(i.sheetNameToParentObject.get(a))){o=this.sheetToken+this.tokenCount.toString()+this.sheetToken;this.tokenCount++,i.tokenToParentObject.set(o,r),i.parentObjectToToken.set(r,o),i.sheetNameToToken.set(a,o),i.sheetNameToParentObject.set(a,r)}else{var o=i.sheetNameToToken.get(a);i.tokenToParentObject.set(o,r),i.parentObjectToToken.set(r,o)}return e},n.prototype.unregisterGridAsSheet=function(e,r,n){var i=this,a=[r];n&&(a=[],t.isNullOrUndefined(this.modelToSheetID)||this.modelToSheetID.forEach(function(e,t){a.push(t)})),a.forEach(function(t){var r=i.getSheetFamilyItem(t),a=(n?t:e).toUpperCase();if(null!=r.sheetNameToParentObject&&r.sheetNameToParentObject.has(a)){r.sheetNameToParentObject.delete(a);var o=r.sheetNameToToken.get(a);r.sheetNameToToken.delete(a),r.tokenToParentObject.delete(o),r.parentObjectToToken.delete(t),n&&(r.sheetDependentCells=new Map)}})},n.prototype.computeExpression=function(e){var t=this.parser.parseFormula(e);return this.computeFormula(t)},n.prototype.isSheetMember=function(){var e=this.getSheetFamilyItem(this.grid);return!t.isNullOrUndefined(e)&&e.isSheetMember},n.prototype.dispose=function(){this.resetKeys(),this.namedRanges.clear(),this.lFormulas.clear()},n.prototype.refreshRandValues=function(e){var t,r,n,i,a="",o=this.randCollection.toString();this.randomValues.has(e)&&(this.randomValues.delete(e),o=o.split(e+this.parseArgumentSeparator).join("").split(this.parseArgumentSeparator+e).join("").split(e).join(""),0===this.randomValues.size&&""===o?(this.randomValues.clear(),this.randCollection=[]):this.randCollection=o.split(this.parseArgumentSeparator));for(var s=0;s<this.randomValues.size;s++)t=this.rowIndex(this.randCollection[s]),r=this.colIndex(this.randCollection[s]),a=(parseFloat(this.getSheetToken(this.randCollection[s]).split(this.sheetToken).join(""))+1).toString(),i=this.getSheetFamilyItem(a),this.grid=i.sheetNameToParentObject.get(a),n=this.randomValues.get(this.randCollection[s]),n=this.computeFormula(n),void 0===this.parentObject.setValueRowCol?this.setValueRowCol(this.getSheetID(this.grid)+1,n,t,r):this.parentObject.setValueRowCol(this.getSheetID(this.grid)+1,n,t,r)},n.prototype.refresh=function(e){if(0===this.dependencyLevel&&this.refreshedCells.clear(),this.getDependentCells().has(e)&&null!==this.getDependentCells().get(e)){var t=this.getSheetFamilyItem(this.grid);this.dependencyLevel=this.dependencyLevel+1;try{var r=this.getDependentCells().get(e),n=void 0;for(n=0;n<r.length;n++){var i=r[n],a=this.getSheetToken(i);a.length&&(this.grid=t.tokenToParentObject.get(a));try{var o=this.rowIndex(i),s=this.colIndex(i),l=this.getFormulaInfoTable().get(i),h=void 0;l&&(this.cell=i,this.getComputedValue().has(i)?h=this.getComputedValue().get(i):(this.parser.isFormulaParsed=!0,h=this.calculateFormula(l.getParsedFormula(),!0),this.computedValues.set(i,h)),l.setFormulaValue(h)),void 0===this.parentObject.setValueRowCol?this.setValueRowCol(this.getSheetID(this.grid)+1,l.getFormulaValue(),o,s):this.parentObject.setValueRowCol(this.getSheetID(this.grid)+1,l.getFormulaValue(),o,s),this.refreshedCells.has(i)||(this.refreshedCells.set(i,[]),this.refresh(i))}catch(e){continue}}}finally{this.grid=t.tokenToParentObject.get(this.getSheetToken(e)),0===--this.dependencyLevel&&this.refreshedCells.clear()}}};var i;return Fr([t.Property(!0)],n.prototype,"includeBasicFormulas",void 0),Fr([t.Event()],n.prototype,"onFailure",void 0),n=i=Fr([t.NotifyPropertyChanges],n)}(t.Base),Nr=function(){function e(e,t){this.formulaCorrection=!1,this.message=e,this.formulaCorrection=t}return e}(),Dr=function(){function e(){this.calcID=Number.MIN_VALUE+1,this.calcID1=Number.MIN_VALUE+1}return e.prototype.getFormulaText=function(){return this.formulaText},e.prototype.setFormulaText=function(e){this.formulaText=e},e.prototype.getFormulaValue=function(){return this.formulaValue},e.prototype.setFormulaValue=function(e){this.formulaValue=e},e.prototype.getParsedFormula=function(){return this.parsedFormula},e.prototype.setParsedFormula=function(e){this.parsedFormula=e},e}(),Or=function(){function e(){this.isSheetMember=!1,this.parentObjectToToken=new Map,this.sheetDependentCells=new Map,this.sheetDependentFormulaCells=new Map,this.sheetNameToParentObject=new Map,this.sheetNameToToken=new Map,this.tokenToParentObject=new Map,this.sheetFormulaInfotable=new Map}return e}(),Hr=function(){function e(e,t,r){return this.row=e,this.col=t,this.value=r,this.getRowIndex=function(){return e},this.setRowIndex=function(t){e=t},this.getColIndex=function(){return t},this.setColIndex=function(e){t=e},this.getValue=function(){return r},this}return e}(),Br=function(){function r(e){this.uniqueOBracket=String.fromCharCode(129),this.uniqueCBracket=String.fromCharCode(130),this.uniqueCSeparator=String.fromCharCode(131),this.uniqueCOperator=String.fromCharCode(132),this.uniquePOperator=String.fromCharCode(133),this.uniqueSOperator=String.fromCharCode(134),this.uniqueMOperator=String.fromCharCode(135),this.uniqueDOperator=String.fromCharCode(136),this.uniqueModOperator=String.fromCharCode(137),this.uniqueConcateOperator=String.fromCharCode(138),this.uniqueEqualOperator=String.fromCharCode(139),this.uniqueExpOperator=String.fromCharCode(140),this.uniqueGTOperator=String.fromCharCode(141),this.uniqueLTOperator=String.fromCharCode(142),this.sheetInfo=[],this.parent=e,this.init()}return r.prototype.init=function(){this.addEventListener(),this.initCalculate(),this.registerSheet()},r.prototype.destroy=function(){this.removeEventListener(),this.calculateInstance.dispose(),this.calculateInstance=null,this.parent=null},r.prototype.addEventListener=function(){this.parent.on(Lt,this.performFormulaOperation,this),this.parent.on("aggregateComputation",this.aggregateComputation,this)},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Lt,this.performFormulaOperation),this.parent.off("aggregateComputation",this.aggregateComputation))},r.prototype.getModuleName=function(){return"workbookFormula"},r.prototype.initCalculate=function(){this.calculateInstance=new Lr(this.parent),this.calcID=this.calculateInstance.createSheetFamilyID(),this.calculateInstance.setTreatEmptyStringAsZero(!0),this.calculateInstance.grid=this.parent.getActiveSheet().id.toString()},r.prototype.performFormulaOperation=function(e){var t,r,n=e.action,i=this.calculateInstance.getLibraryFormulas(),a=Array.from(i.values());switch(n){case"getLibraryFormulas":e.formulaCollection=Array.from(i.keys());break;case"getFormulaCategory":t=["All"];for(o=1;o<Array.from(i.values()).length;o++)t.indexOf(a[o].category)<0&&t.push(a[o].category);e.categoryCollection=t;break;case"dropDownSelectFormulas":for(o=0;o<Array.from(i.values()).length;o++)e.selectCategory===a[o].category&&(e.formulaCollection[o]=Array.from(i.keys())[o]);break;case"getFormulaDescription":for(o=0;o<Array.from(i.values()).length;o++)e.selectedList===Array.from(i.keys())[o]&&(e.description=a[o].description);break;case"registerSheet":this.registerSheet(e.sheetIndex,e.sheetCount),e.isImport&&this.updateSheetInfo();break;case"unRegisterSheet":this.unRegisterSheet(e.sheetIndex,e.sheetCount,e.propertyChange);break;case"refreshCalculate":e.isFormula&&(e.value=this.autoCorrectFormula(e.value,e.rowIndex,e.colIndex,e.sheetIndex)),this.refreshCalculate(e.rowIndex,e.colIndex,e.value,e.isFormula,e.sheetIndex),e.value=e.value?e.value.toString().split("-*").join("-").split("/*").join("/").split("*/").join("*").split("-/").join("-").split("*+").join("*").split("+*").join("+"):e.value;break;case"getArgumentSeparator":e.argumentSeparator=this.calculateInstance.getParseArgumentSeparator();break;case"addDefinedName":e.isAdded=this.addDefinedName(e.definedName);break;case"removeDefinedName":e.isRemoved=this.removeDefinedName(e.definedName,e.scope);break;case"initiateDefinedNames":this.initiateDefinedNames();break;case"renameUpdation":this.renameUpdation(e.value,e.sheetId);break;case"addSheet":this.sheetInfo.push({visibleName:e.visibleName,sheet:e.sheetName,index:e.index});break;case"getSheetInfo":e.sheetInfo=this.sheetInfo;break;case"deleteSheetTab":r=this.sheetInfo.length;for(var o=0;o<r;o++)if(this.sheetInfo[o].index===e.index){e.sheetName=this.sheetInfo[o].sheet,this.sheetInfo.splice(o,1);break}this.calculateInstance.unregisterGridAsSheet((e.index-1).toString(),e.index),this.calculateInstance.tokenCount=this.calculateInstance.tokenCount-1,this.sheetDeletion(e.sheetName,e.index,e.index);break;case"getReferenceError":e.refError=this.referenceError();break;case"getAlpha":e.col=V(e.col);break;case"addCustomFunction":this.addCustomFunction(e.functionHandler,e.functionName);break;case"computeExpression":e.calcValue=this.calculateInstance.computeExpression(e.formula);break;case"registerGridInCalc":this.calculateInstance.grid=e.sheetID;break;case"refreshInsDelFormula":this.refreshInsDelFormula(e.insertArgs);break;case"refreshNamedRange":this.refreshNamedRange(e.insertArgs)}},r.prototype.referenceError=function(){return this.calculateInstance.getErrorStrings()[e.CommonErrors.ref]},r.prototype.getSheetInfo=function(){return this.sheetInfo},r.prototype.addCustomFunction=function(e,t){this.calculateInstance.defineFunction(t,e)},r.prototype.updateSheetInfo=function(){var e=this;this.sheetInfo=[],this.parent.sheets.forEach(function(t,r){e.sheetInfo.push({visibleName:t.name,sheet:"Sheet"+t.id,index:r})})},r.prototype.sheetDeletion=function(e,r,n){var i,a,o=[],s=null,l="";this.calculateInstance.getDependentCells().forEach(function(e,t){o.push(t)}),this.removeSheetTokenIndex(l,n);for(var h=0;h<o.length;h++)for(var d=this.calculateInstance.getDependentCells().get(o[h]),p=0;p<d.length;p++)s=this.calculateInstance.getFormulaInfoTable().get(d[p]),r=parseInt(d[p].split("!")[1],10)+1,!t.isNullOrUndefined(s)&&r>-1&&(l=s.formulaText).toUpperCase().indexOf(e.toUpperCase())>-1&&(l=l.toUpperCase().split(e.toUpperCase()+this.calculateInstance.sheetToken).join(this.referenceError()),i=this.calculateInstance.rowIndex(d[p]),a=this.calculateInstance.colIndex(d[p]),this.updateDataContainer([i-1,a-1],{value:l,sheetId:r,visible:!1}),this.calculateInstance.refresh(s.getParsedFormula())),e.split("Sheet")[1]===o[h].split("!")[1]&&(this.calculateInstance.getFormulaInfoTable().delete(o[h]),this.calculateInstance.clearFormulaDependentCells(o[h]))},r.prototype.removeSheetTokenIndex=function(e,t){var r=this.calculateInstance.getSheetFamilyItem(this.calculateInstance.grid);return r.sheetNameToToken.delete(t.toString()),r.sheetNameToParentObject.delete(t.toString()),r.parentObjectToToken.delete(t.toString()),r.tokenToParentObject.delete("!"+(t-1).toString()+"!"),e},r.prototype.renameUpdation=function(e,t){var r,n,i,a=[],o="",s=[],l=!1;this.calculateInstance.getDependentCells().forEach(function(e,t){a.push(t)});for(d=0;d<this.sheetInfo.length;d++)if(this.sheetInfo[d].index===t){this.sheetInfo[d].visibleName=e;break}for(var h=this.sheetInfo,d=0;d<a.length;d++)for(var p=this.calculateInstance.getDependentCells().get(a[d]),c=0;c<p.length;c++){o=this.calculateInstance.getFormulaInfoTable().get(p[c]).formulaText;for(var u=0;u<h.length;u++)if(h[u].visibleName!==h[u].sheet){var f=h[u].sheet.toUpperCase();o.toUpperCase().indexOf(f)>-1&&(o=o.toUpperCase().split(f).join(u+"/"),s.push(u),l=!0)}if(l){for(var g=0;g<s.length;g++)o=o.split(s[g].toString()+"/").join(h[s[g]].visibleName);r=this.calculateInstance.rowIndex(p[c]),n=this.calculateInstance.colIndex(p[c]),i=de(this.parent,"Sheet"+(parseInt(p[c].split("!")[1],10)+1),this.sheetInfo),this.updateDataContainer([r-1,n-1],{value:o,sheetId:i,visible:!0})}}},r.prototype.updateDataContainer=function(e,r){for(var n,i,a,o=e[0],s=e[1],l=this.parent.sheets.length,h=0;h<l;h++)if(this.parent.sheets[h].id===r.sheetId){n=this.parent.sheets[h].rows;break}t.isNullOrUndefined(r)||(o in n?s in(i=n[o]).cells?((a=i.cells[s]).formula=r.value,a.value=r.visible?a.value:this.referenceError()):i.cells[s]=a={}:(i=n[o]={})[s]=a={})},r.prototype.parseSheetRef=function(e){var t,r=new RegExp("[!@#$%^&()+=';,.{}|\":<>~_-]","g"),n=0,i=this.parent.sheets.length,a=[];a.length=0;var o,s,l,h,d,p=this.getSheetInfo(),c='(?=[\'!])(?=[^"]*(?:"[^"]*"[^"]*)*$)';for(n=0;n<i;n++)if(p[n].sheet!==p[n].visibleName&&(t=new RegExp(p[n].visibleName.replace(r,"\\$&")+c,"gi"),l=n,e.match(t))){for(var u=n+1;u<i;u++)o=new RegExp(p[u].visibleName.replace(r,"\\$&")+c,"gi"),s=e.search(o),h=e.search(t),s>-1&&(s<h||s===h&&p[u].visibleName.length>p[n].visibleName.length)&&(d=new RegExp("Sheet","gi"),0!==p[u].visibleName.search(d)&&(t=o,l=u));e=e.replace(t,l+"/"),a.push(l)}for(n=0;n<a.length;)t=new RegExp(a[n]+"/"+c,"gi"),e=e.replace(t,p[a[n]].sheet),n++;return e},r.prototype.registerSheet=function(e,t){void 0===e&&(e=0),void 0===t&&(t=this.parent.sheets.length);for(var r;e<t;)r=fe(this.parent,e).id+"",this.calculateInstance.registerGridAsSheet(r,r,this.calcID),e++},r.prototype.unRegisterSheet=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=this.parent.sheets.length);var n;if(this.calculateInstance.tokenCount=0,r)this.calculateInstance.unregisterGridAsSheet(n,n,r);else for(;e<t;)n=fe(this.parent,e).id+"",this.calculateInstance.unregisterGridAsSheet(n,n),e++},r.prototype.refreshCalculate=function(e,r,n,i,a){var o=t.isNullOrUndefined(a)?this.parent.getActiveSheet():fe(this.parent,a),s=o.id+"";if(i){n=this.parseSheetRef(n);var l=new Hr(e+1,r+1,n),h=[o.usedRange.rowIndex,o.usedRange.colIndex];this.calculateInstance.valueChanged(s,l,!0,h);var d=this.calculateInstance.randCollection;if(!0===this.calculateInstance.isRandomVal){var p=void 0,u=void 0,f="";if(this.calculateInstance.randomValues.size>1&&this.calculateInstance.randomValues.size===d.length)for(var g=0;g<this.calculateInstance.randomValues.size;g++){p=this.calculateInstance.rowIndex(d[g]),u=this.calculateInstance.colIndex(d[g]),f=this.calculateInstance.randomValues.get(d[g]),s=(parseFloat(this.calculateInstance.getSheetToken(d[g]).split(this.calculateInstance.sheetToken).join(""))+1).toString();var m=new Hr(p,u,f);this.calculateInstance.valueChanged(s,m,!0)}}}else{var y=this.calculateInstance.getSheetFamilyItem(s),C=v(r+1)+(e+1);y.isSheetMember&&!t.isNullOrUndefined(y.parentObjectToToken)&&(C=y.parentObjectToToken.get(s)+C),this.calculateInstance.getFormulaInfoTable().has(C)&&(this.calculateInstance.getFormulaInfoTable().delete(C),this.calculateInstance.getDependentCells().has(C)&&this.calculateInstance.clearFormulaDependentCells(C)),this.calculateInstance.getComputedValue().clear(),this.calculateInstance.refresh(C),this.calculateInstance.refreshRandValues(C)}this.calculateInstance.cell="";var b=J(e,r,this.parent.getActiveSheet());if(b&&n&&0===n.toString().toUpperCase().indexOf("=SUM(")){var x=["#N/A","#VALUE!","#REF!","#DIV/0!","#NUM!","#NAME?","#NULL!","invalid arguments"],S=n.toString().toUpperCase().replace("=SUM","").replace("(","").replace(")","").split(":")[0];if(j(S)){var w=c(S),I=J(w[0],w[1],this.parent.getActiveSheet());I&&I.value&&I.format&&x.indexOf(b.value)<0&&x.indexOf(I.value)<0&&(b.format=I.format)}}},r.prototype.autoCorrectFormula=function(e,r,n,i){if(!t.isNullOrUndefined(e)){2===(e=e.toString()).split("(").length&&e.indexOf(")")<0&&(e+=")");var a=void 0;0===e.indexOf("=")&&(e=e.slice(1),a=!0);var o=e.match(/</g),s=e.match(/>/g),l=e.match(/=/g);if(o){for(var h="",d=0;d<o.length;d++)h+=o[d];e=e.replace(h,"<")}if(s){for(var p="",c=0;c<s.length;c++)p+=s[c];e=e.replace(p,">")}if(l){for(var u="",f=0;f<l.length;f++)u+=l[f];e=e.split(u).join("=")}e=a?"="+e:e,(o||s||l)&&(J(r,n,t.isNullOrUndefined(i)?this.parent.getActiveSheet():fe(this.parent,i)).formula=e)}return e},r.prototype.initiateDefinedNames=function(){for(var e=this.parent.definedNames,t=0;t<e.length;){var r=e[t],n=this.parseSheetRef(r.refersTo),i=C(n),a=!1,o=n.indexOf("http:")>-1||n.indexOf("https:")>-1;if(i=i.split("$").join(""),(i=i.split("=").join("")).indexOf(":")>-1){var s=i.split(":");j(s[0])&&j(s[1])&&(a=!0)}else i.indexOf(":")<0&&j(i)&&(a=!0);o&&(a=!1),a?this.addDefinedName(r,!0):(this.removeDefinedName(r.name,r.scope),t--),t++}},r.prototype.addDefinedName=function(e,t){var r,n=!0,i=e.name;if(e.refersTo.indexOf("!")<0){var a=Ce(this.parent);a=-1!==a.indexOf(" ")?"'"+a+"'":a,e.refersTo=a+"!"+(e.refersTo.indexOf("=")<0?e.refersTo:e.refersTo.split("=")[1])}var o=e.refersTo,s=this.parseSheetRef(e.refersTo);return e.scope?(r=se(this.parent,e.scope))>-1&&(i=Ce(this.parent,r)+"!"+i):e.scope="",e.comment||(e.comment=""),!t&&this.checkIsNameExist(e.name,e.scope)?n=!1:(this.calculateInstance.addNamedRange(i,"="===s[0]?s.substr(1):s),"="!==s[0]&&(e.refersTo="="+o),this.parent.definedNames.indexOf(e)<0&&this.parent.definedNames.push(e)),n},r.prototype.removeDefinedName=function(e,t){var r=!1,n=this.getIndexFromNameColl(e,t);if(n>-1){var i=e;if(t){var a=se(this.parent,t);a&&(i=Ce(this.parent,a)+"!"+e)}this.calculateInstance.removeNamedRange(i),this.parent.definedNames.splice(n,1),r=!0}return r},r.prototype.checkIsNameExist=function(e,t){return this.parent.definedNames.some(function(r){return r.name===e&&(t?r.scope===t:""===r.scope)})},r.prototype.getIndexFromNameColl=function(e,t){void 0===t&&(t="");var r=-1;return this.parent.definedNames.filter(function(n,i){n.name===e&&n.scope===t&&(r=i)}),r},r.prototype.toFixed=function(e){var t=Number(e);return Math.round(t)!==t&&(e=t.toFixed(2)),e},r.prototype.aggregateComputation=function(e){var t,r,n=this.parent.getActiveSheet(),i=ue(n),a=c(i.split(":")[1]),o=["SUM","AVERAGE","MIN","MAX"],s=[];a[0]+1===n.rowCount&&a[1]+1===n.colCount&&(i="A1:"+g(n.usedRange.rowIndex,n.usedRange.colIndex));var l,h=c(n.activeCell),d=n.rows[h[0]]&&n.rows[h[0]].cells?n.rows[h[0]].cells[h[1]]:{},p=d?d.format:"",u=this.calculateInstance.getCellCollection(i);for(t=0;t<u.length;t++)if(l=this.calculateInstance.getValueFromArg(u[t]),L(l)){e.countOnly=!1;break}if(e.Count=this.calculateInstance.getFunction("COUNTA")(i),e.Count&&!e.countOnly){for(t=0;t<4;t++){var f={formattedText:r=this.toFixed(this.calculateInstance.getFunction(o[t])(i)),value:r,format:p,onLoad:!0};p&&(this.parent.notify("getFormattedCell",f),r=f.formattedText),s.push(r)}e.Sum=s[0],e.Avg=s[1],e.Min=s[2],e.Max=s[3]}},r.prototype.clearFormula=function(e){this.parent.activeSheetIndex===e.sheetIdx&&(e.rowIdx="Row"===e.type?"insert"===e.status?e.rowIdx>=e.startIdx?e.rowIdx-e.count:e.rowIdx:e.rowIdx+e.count:e.rowIdx,e.colIdx="Column"===e.type?"insert"===e.status?e.colIdx>=e.startIdx?e.colIdx-e.count:e.colIdx:e.colIdx+e.count:e.colIdx);var t="!"+e.sheetIdx+"!"+V(-1===e.colIdx?e.colIdx+2:e.colIdx+1)+(-1===e.rowIdx?e.rowIdx+2:e.rowIdx+1);this.calculateInstance.getFormulaInfoTable().delete(t),this.calculateInstance.clearFormulaDependentCells(t)},r.prototype.refreshFormula=function(e,t,r,n,i,a){var o,s,l,h,d,p,u,f=e,g=[],v=this.parent.getActiveSheet(),y=[],C=[];if(q(f)){if("delete"===r)for(h=1;h<=t;h++)y.push(i+h);for(C=this.parseFormula(f),h=0;h<C.length;h++)if(d=C[h].trim(),this.calculateInstance.isCellReference(d)){if((u=h&&C[h-1].trim())&&"!"===u[u.length-1]){if((u=u.replace(/['!]/g,""))!==v.name)continue}else if(0===parseInt(u,10)&&void 0===u[u.length-1]&&v.id-1!==a)continue;g=c(d),o="Column"===n?"insert"===r?g[3]+t:g[3]-t:"insert"===r?g[2]+t:g[2]-t,s="Column"===n?"insert"===r?g[1]+t:g[1]-t:"insert"===r?g[0]+t:g[0]-t,s="Column"===n?i>g[1]?g[1]:s:i>g[0]?g[0]:s,o="Column"===n?i>g[3]?g[3]:o:i>g[2]?g[2]:o,l=s>-1?"Column"===n?m([g[0],s,g[2],o]).split(":")[0]:m([s,g[1],o,g[3]]).split(":")[0]:"#REF!","delete"===r&&(p=parseInt("Row"===n?d.replace(/[A-Z]/g,""):d.replace(/[0-9]/g,""),10),y.indexOf(p)>-1&&(l="#REF!")),C[h]=l}f="="+C.join("")}return f},r.prototype.refreshInsDelFormula=function(e){var r,n,i=this.parent.sheets.length;t.isNullOrUndefined(e.activeSheetIndex)&&(e.activeSheetIndex=this.parent.activeSheetIndex);var a,o,s,l,h=this.parent.sheets[e.activeSheetIndex].name;for(s=0;s<i;s++){r=e.model.length;for(var d=(a=[0,0,(n=this.parent.sheets[s]).usedRange.rowIndex,n.usedRange.colIndex])[2];d>=a[0];d--)for(var p=a[1];p<=a[3];p++)if((o=J(d,p,n))&&o.formula&&q(o.formula)){if(e.activeSheetIndex!==s&&!o.formula.includes(h))continue;this.clearFormula({rowIdx:d,colIdx:p,sheetIdx:s,count:r,status:e.name,type:e.modelType,startIdx:e.startIndex}),l=this.refreshFormula(o.formula,r,e.name,e.modelType,e.startIndex,s),this.parent.notify("workbookEditOperation",{action:"updateCellValue",address:[d,p,d,p],value:l,sheetIndex:s})}}},r.prototype.parseFormula=function(e){for(var t,r,n=0,i=[],a=[],o=(a=(a=this.markSpecialChar(e.replace("=",""))).split(/\(|\)|=|\^|>|<|,|:|\+|-|\*|\/|%|&/g)).length;n<o;)(t=a[n])?(1===t.length?i.push(this.isUniqueChar(t)?this.getUniqueCharVal(t):t):(r=t[0],t.indexOf("!")>0?(this.isUniqueChar(r)&&(i.push(this.getUniqueCharVal(r)),t=t.substr(1)),r=t.indexOf("!")+1,i.push(t.substr(0,r)),i.push(t.substr(r))):this.isUniqueChar(r)?(i.push(this.getUniqueCharVal(r)),i.push(t.substr(1))):i.push(t)),n++):n++;return i},r.prototype.getUniqueCharVal=function(e){switch(e){case this.uniqueOBracket:return"(";case this.uniqueCBracket:return")";case this.uniqueCSeparator:return",";case this.uniqueCOperator:return":";case this.uniquePOperator:return"+";case this.uniqueSOperator:return"-";case this.uniqueMOperator:return"*";case this.uniqueDOperator:return"/";case this.uniqueModOperator:return"%";case this.uniqueConcateOperator:return"&";case this.uniqueEqualOperator:return"=";case this.uniqueExpOperator:return"^";case this.uniqueGTOperator:return">";case this.uniqueLTOperator:return"<"}return""},r.prototype.isUniqueChar=function(e){var t=e.charCodeAt(e);return t>=129&&t<=142},r.prototype.markSpecialChar=function(e){return e=e.replace(/\(/g,"("+this.uniqueOBracket).replace(/\)/g,")"+this.uniqueCBracket),e=e.replace(/,/g,","+this.uniqueCSeparator).replace(/:/g,":"+this.uniqueCOperator),e=e.replace(/\+/g,"+"+this.uniquePOperator).replace(/-/g,"-"+this.uniqueSOperator),e=e.replace(/\*/g,"*"+this.uniqueMOperator).replace(/\//g,"/"+this.uniqueDOperator),e=e.replace(/&/g,"&"+this.uniqueConcateOperator),e=e.replace(/=/g,"="+this.uniqueEqualOperator),e=e.replace(/\^/g,"^"+this.uniqueExpOperator),(e=e.replace(/>/g,">"+this.uniqueGTOperator).replace(/</g,"<"+this.uniqueLTOperator)).replace(/%/g,"%"+this.uniqueModOperator)},r.prototype.refreshNamedRange=function(e){for(var t,r,n,i,a,o,s,l,h,d=!1,p=this.parent.definedNames,u=Object.assign({},p),f=p.length,g=0;g<f;g++){if(t=u[g],r=u[g].refersTo.split("!")[1],n=c(r),h=t.refersTo.split("!")[0].split("=")[1],se(this.parent,h.replace(/'/g,""))===this.parent.activeSheetIndex&&("insert"===e.name?(i=e.model.length,a=e.index,o=e.index+i,"Row"===e.modelType?n[0]>=o||n[0]>=a&&n[2]>=o?(s=[n[0]+i,n[1],n[2]+i,n[3]],d=!0):(n[0]<=a&&n[2]>=a||n[2]>=o)&&(s=[n[0],n[1],n[2]+i,n[3]],d=!0):"Column"===e.modelType&&(n[1]>=o||n[1]>=a&&n[3]>=o?(s=[n[0],n[1]+i,n[2],n[3]+i],d=!0):(n[1]<=a&&n[3]>=a||n[3]>=o)&&(s=[n[0],n[1],n[2],n[3]+i],d=!0))):(i=e.deletedModel.length,a=e.startIndex,o=e.endIndex,"Row"===e.modelType?n[0]>=o||n[0]>=a&&n[2]>=o?(s=[n[0]-i,n[1],n[2]-i,n[3]],d=!0):(n[0]<=a&&n[2]>=a||n[2]>=o)&&(s=[n[0],n[1],n[2]-i,n[3]],d=!0):"Column"===e.modelType&&(n[1]>=o||n[1]>=a&&n[3]>=o?(s=[n[0],n[1]-i,n[2],n[3]-i],d=!0):(n[1]<=a&&n[3]>=a||n[3]>=o)&&(s=[n[0],n[1],n[2],n[3]-i],d=!0))),d)){l=m(s),t.refersTo=h+"!"+l,this.parent.removeDefinedName(t.name,t.scope);var v={action:"addDefinedName",definedName:t,isAdded:!1};this.parent.notify(Lt,v)}p=u}},r}(),Mr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on(Dt,this.initiateSortHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Dt,this.initiateSortHandler)},e.prototype.initiateSortHandler=function(e){var n=this,i=e.args,a=new r.Deferred,o=this.parent.getActiveSheet(),s=S(y(i.range)),l=i.sortOptions||{sortDescriptors:{},containsHeader:!0},h=!1;if(e.promise=a.promise,s[0]>o.usedRange.rowIndex||s[1]>o.usedRange.colIndex)return void a.reject(this.parent.serviceLocator.getService(yn).getConstant("SortOutOfRangeError"));var d=l.containsHeader;s[0]===s[2]&&(s=Z(s[0],s[1],o),h=!0,t.isNullOrUndefined(l.containsHeader)&&(d=typeof J(s[0],s[1],o,null,!0).value!=typeof J(s[0]+1,s[1],o,null,!0).value||!this.isSameStyle(J(s[0],s[1],o,null,!0).style,J(s[0]+1,s[1],o,null,!0).style))),!t.isNullOrUndefined(i.sortOptions)&&!t.isNullOrUndefined(i.sortOptions.containsHeader)||h||t.isNullOrUndefined(J(s[0],s[1],o))||t.isNullOrUndefined(J(s[0]+1,s[1],o))||(d=typeof J(s[0],s[1],o).value!=typeof J(s[0]+1,s[1],o).value);var p,c,f=s[0]=d?s[0]+1:s[0],g=v(u(o.activeCell)[1]+1),C=l.sortDescriptors,b=m(s);re(this.parent,o.name+"!"+b,!0).then(function(e){var t=new r.DataManager(e),h=new r.Query;if(Array.isArray(C)){C&&0!==C.length||(C=[{field:g}]);for(var d=C.length,u=d-1;u>-1;u--)if(C[d-1].field||(C[d-1].field=g),C[u].field){m=C[u].sortComparer||n.sortComparer.bind(n,C[u],l.caseSensitive);h.sortBy(C[u].field,m)}}else{C||(C={field:g}),C.field||(C.field=g);var m=C.sortComparer||n.sortComparer.bind(n,C,l.caseSensitive);h.sortBy(C.field,m)}t.executeQuery(h).then(function(t){var r,n={};Array.prototype.forEach.call(t.result,function(t,i){if(t)for(p=s[1],c=s[3],f=parseInt(e[i].__rowIndex,10)-1,p;p<=c;p++)r=v(p+1),(n=t[r])&&n.formula&&(n.formula=$([f,p],[parseInt(t.__rowIndex,10)-1,p],o,n)),Q(f,p,o,n)});var l={range:o.name+"!"+b,sortOptions:i.sortOptions};a.resolve(l)})})},e.prototype.isSameStyle=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});for(var r=!0,n=Object.keys(e),i=0;i<n.length;i++){if(e[n[i]]!==t[n[i]]&&this.parent.cellStyle[n[i]]!==e[n[i]]){r=!1;break}r=!0}return r},e.prototype.sortComparer=function(e,n,i,a){var o=e.order||"",s=r.DataUtil.fnSort(o),l={sensitivity:n?"case":"base"};if(i&&a&&("string"==typeof i.value||"string"==typeof a.value)){L(i.value)&&(i.value=D(i.value)),L(a.value)&&(a.value=D(a.value));var h=new Intl.Collator(this.parent.locale,l);return o&&"ascending"!==o.toLowerCase()?-1*h.compare(i.value,a.value):h.compare(i.value,a.value)}return null!==i&&!t.isNullOrUndefined(i.value)||null!==a&&!t.isNullOrUndefined(a.value)?null===i||t.isNullOrUndefined(i.value)?1:null===a||t.isNullOrUndefined(a.value)?-1:s(i?i.value:i,a?a.value:a):-1},e.prototype.getModuleName=function(){return"workbookSort"},e}(),Pr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.filterRange=null,this.parent=null},e.prototype.addEventListener=function(){this.parent.on("initiateFilter",this.initiateFilterHandler,this),this.parent.on("clearAllFilter",this.clearAllFilterHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiateFilter",this.initiateFilterHandler),this.parent.off("clearAllFilter",this.clearAllFilterHandler))},e.prototype.initiateFilterHandler=function(e){var t=this,n=e.args,i=new r.Deferred,a=this.parent.getActiveSheet(),o=n.filterOptions||{};if(e.promise=i.promise,this.filterRange=n.range,o.datasource){this.setFilter(o.datasource,o.predicates);var s={range:n.range,filterOptions:o};i.resolve(s)}else{var l=S(y(n.range));if(l[0]>a.usedRange.rowIndex||l[1]>a.usedRange.colIndex)return void i.reject("Select a cell or range inside the used range and try again.");l[0]===l[2]&&l[2]-l[0]==0&&(l[0]=0,l[1]=0,l[3]=a.usedRange.colIndex),l[2]=a.usedRange.rowIndex,l[0]=l[0]+1;var h=m(l);re(this.parent,a.name+"!"+h,!0,!0,null,null,null,null,!1).then(function(e){var n=new r.DataManager(e);t.setFilter(n,o.predicates);var a={range:h,filterOptions:o};i.resolve(a)})}},e.prototype.setFilter=function(e,n){var i=this;if(e&&n){var a=e.dataSource.json,o=new r.Query;n.length&&o.where(r.Predicate.and(n));var s=e.executeLocal(o);a.forEach(function(e){if(e){var r=parseInt(e.__rowIndex,10);i.parent.hideRow(r-1,void 0,s.indexOf(e)<0),t.isNullOrUndefined(i.parent.filteredRows)&&(i.parent.filteredRows={},i.parent.filteredRows.rowIdxColl=[],i.parent.filteredRows.sheetIdxColl=[]);var n=i.parent.filteredRows.rowIdxColl,a=i.parent.filteredRows.sheetIdxColl;if(s.indexOf(e)<0){if(n&&a)for(var o=0,l=a.length;o<l;o++)i.parent.activeSheetIndex===a[o]&&n[o]===r-1&&(n.splice(o,1),a.splice(o,1));n.push(r-1),a.push(i.parent.activeSheetIndex)}else if(n&&a)for(var o=0,h=a.length;o<h;o++)i.parent.activeSheetIndex===a[o]&&n[o]===r-1&&(n.splice(o,1),a.splice(o,1))}});var l=this.parent.getActiveSheet();(l.frozenColumns||l.frozenRows)&&this.parent.notify("dataRefresh",null)}},e.prototype.clearAllFilterHandler=function(){if(this.filterRange){var e=u(this.filterRange),t=this.parent.getActiveSheet();this.parent.hideRow(e[0],t.usedRange.rowIndex,!1)}},e.prototype.getModuleName=function(){return"workbookFilter"},e}(),_r=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.setImage=function(e){var t,r=e.range?e.range.indexOf("!")>0?e.range.split("!")[1]:e.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,n=e.range&&e.range.indexOf("!")>0?se(this.parent,e.range.split("!")[0]):this.parent.activeSheetIndex,i=c(r),a=n?this.parent.sheets[n]:this.parent.getActiveSheet(),o=J(i[0],i[1],a),s=e.options;if(o&&o.image){t=o.image;for(var l=0;l<s.length;l++)t.push(s[l])}Q(i[0],i[1],a,{image:o&&o.image?t:s},!0)},e.prototype.addEventListener=function(){this.parent.on("setImage",this.setImage,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("setImage",this.setImage)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"workbookImage"},e}(),Ur=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(Gt,this.setChartHandler,this),this.parent.on("refreshChart",this.refreshChartData,this),this.parent.on("deleteChartColl",this.deleteChartColl,this),this.parent.on(Yt,this.refreshChartSize,this),this.parent.on("focusChartBorder",this.focusChartBorder,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Gt,this.setChartHandler),this.parent.off("refreshChart",this.refreshChartData),this.parent.off("deleteChartColl",this.deleteChartColl),this.parent.off(Yt,this.refreshChartSize),this.parent.off("focusChartBorder",this.focusChartBorder))},e.prototype.setChartHandler=function(e){var r=0;e.isInitCell=!t.isNullOrUndefined(e.isInitCell)&&e.isInitCell,e.isUndoRedo=!!t.isNullOrUndefined(e.isUndoRedo)||e.isUndoRedo,e.isPaste=!t.isNullOrUndefined(e.isPaste)&&e.isPaste;var n=e.chart;if(n.length>0)for(;r<n.length;){if(!1===e.isCut&&document.getElementById(e.chart[r].id)&&(n[r]={range:n[r].range,id:"e_spreadsheet_chart_"+this.parent.chartCount,isSeriesInRows:n[r].isSeriesInRows,theme:n[r].theme,type:n[r].type},n[r].id="e_spreadsheet_chart_"+this.parent.chartCount,e.isIdAvailabe=!1),document.getElementById(e.chart[r].id))return;var i=!!t.isNullOrUndefined(e.isIdAvailabe)||e.isIdAvailabe;if(n[r].theme=n[r].theme||"Material",n[r].type=n[r].type||"Line",n[r].isSeriesInRows=n[r].isSeriesInRows||!1,n[r].range=n[r].range||this.parent.getActiveSheet().selectedRange,n[r].range.indexOf("!")<0&&(n[r].range=this.parent.getActiveSheet().name+"!"+n[r].range),t.isNullOrUndefined(n[r].id)&&(n[r].id="e_spreadsheet_chart_"+this.parent.chartCount,i=!1),n[r].height=n[r].height||290,n[r].width=n[r].width||480,this.parent.notify("initiateChart",{option:n[r],chartCount:this.parent.chartCount,isInitCell:e.isInitCell,isUndoRedo:e.isUndoRedo,dataSheetIdx:e.dataSheetIdx,range:e.range,isPaste:e.isPaste}),this.parent.chartColl.push(n[r]),i||this.parent.chartCount++,!e.isInitCell||e.isPaste){var a=n[r].range&&n[r].range.indexOf("!")>0?se(this.parent,n[r].range.split("!")[0]):this.parent.activeSheetIndex,o=c(e.isPaste?e.range:n[r].range),s=a?this.parent.sheets[a]:this.parent.getActiveSheet(),l=J(o[0],o[1],s);l&&l.chart?l.chart.push(n[r]):Q(o[0],o[1],s,{chart:[n[r]]},!0)}r++}},e.prototype.refreshChartData=function(e){for(var r,n=1,i=this.parent.sheets.length+1;n<i;){var a=this.parent.chartColl;if(r=a?a.length:0)for(;r--;){var o=this.parent.chartColl[r],s=t.isNullOrUndefined(e.showHide)?G(c(o.range),e.rIdx,e.cIdx):this.inRowColumnRange(c(o.range),e.rIdx,e.showHide),l=o.range.indexOf("!")>-1?se(this.parent,he(o.range)):this.parent.activeSheetIndex;s&&l===this.parent.activeSheetIndex&&this.parent.notify("updateChart",{chart:o})}n++}},e.prototype.inRowColumnRange=function(e,t,r){return"rows"===r?t>=e[0]&&t<=e[2]:t>=e[1]&&t<=e[3]},e.prototype.refreshChartSize=function(e){for(var r,n=1,i=this.parent.sheets.length+1;n<i;){var a=this.parent.chartColl;if(r=a?a.length:0)for(;r--;){var o=this.parent.chartColl[r];if(!t.isNullOrUndefined(e.overlayEle.querySelector("#"+o.id))){var s=this.parent.element.querySelector("."+o.id),l=t.getComponent(s,"chart");l&&(l.height=e.height,l.width=e.width)}}n++}},e.prototype.focusChartBorder=function(e){for(var r=0;r<this.parent.chartColl.length;r++){var n=document.getElementById(e.id),i=document.getElementById(this.parent.chartColl[r].id);n&&i&&t.closest(i,"."+n.classList[1])===n&&this.parent.notify("initiateChart",{option:this.parent.chartColl[r],chartCount:this.parent.chartCount,isRefresh:!0})}},e.prototype.deleteChartColl=function(e){for(var r=0;r<this.parent.chartColl.length;r++){var n=document.getElementById(this.parent.chartColl[r].id),i=document.getElementById(e.id);i&&n&&t.closest(n,"."+i.classList[1])===i&&this.parent.chartColl.splice(r,1)}},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"workbookChart"},e}(),Vr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.format=function(e){var t,r=e.range;r&&"string"==typeof r&&r.indexOf("!")>-1?(r=r.split("!")[1],t=this.parent.sheets[se(this.parent,e.range.split("!")[0])]):t=this.parent.getActiveSheet(),void 0===r&&(r=t.selectedRange);var n="object"!=typeof r&&e.onActionUpdate,i={range:r,style:Object.assign({},e.style),requestType:"CellFormat"};e.borderType&&(i.borderType=e.borderType);var a={};if(Object.assign(a,i.style,null,!0),n&&(this.parent.trigger("beforeCellFormat",i),this.parent.notify("actionBegin",{eventArgs:i,action:"format"}),i.cancel))return void(e.cancel=!0);var o="object"==typeof i.range?i.range:S(c(i.range));if(e.borderType&&(this.setTypedBorder(t,e.style.border,o,e.borderType,e.onActionUpdate),delete e.style.border),void 0!==i.style.borderTop){for(h=o[1];h<=o[3];h++)this.checkAdjustantBorder(t,"borderBottom",o[0]-1,h),this.checkFullBorder(t,"borderBottom",o[0]-1,h),this.checkFullBorder(t,"borderTop",o[0],h),this.setCellBorder(t,{borderTop:i.style.borderTop},o[0],h,e.onActionUpdate,h===o[3]);delete i.style.borderTop}if(void 0!==i.style.borderBottom){for(h=o[1];h<=o[3];h++)this.checkAdjustantBorder(t,"borderTop",o[2]+1,h),this.checkFullBorder(t,"borderTop",o[2]+1,h),this.checkFullBorder(t,"borderBottom",o[2],h),this.setCellBorder(t,{borderBottom:i.style.borderBottom},o[2],h,e.onActionUpdate,h===o[3]),this.setBottomBorderPriority(t,o[2],h);delete i.style.borderBottom}if(void 0!==i.style.borderLeft){for(h=o[0];h<=o[2];h++)this.checkAdjustantBorder(t,"borderRight",h,o[1]-1),this.checkFullBorder(t,"borderRight",h,o[1]-1),this.checkFullBorder(t,"borderLeft",h,o[1]),this.setCellBorder(t,{borderLeft:i.style.borderLeft},h,o[1],e.onActionUpdate);delete i.style.borderLeft}if(void 0!==i.style.borderRight){for(h=o[0];h<=o[2];h++)this.checkAdjustantBorder(t,"borderLeft",h,o[3]-1),this.checkFullBorder(t,"borderLeft",h,o[3]-1),this.checkFullBorder(t,"borderRight",h,o[3]),this.setCellBorder(t,{borderRight:i.style.borderRight},h,o[3],e.onActionUpdate);delete i.style.borderRight}var s,l;if(Object.keys(e.style).length)for(var h=o[0];h<=o[2];h++)for(var d=o[1];d<=o[3];d++)void 0===l&&(void 0!==i.style.border?(s=i.style.border,i.style.border=void 0,l=!0):l=!1),l&&this.setFullBorder(t,s,o,h,d,e.onActionUpdate),this.setCellStyle(t,h,d,i.style),this.parent.getActiveSheet().id===t.id&&this.parent.notify(Ft,{style:i.style,rowIdx:h,colIdx:d,lastCell:d===o[3],isHeightCheckNeeded:!0,manualUpdate:!0,onActionUpdate:e.onActionUpdate});l&&(i.style.border=s),this.parent.setUsedRange(o[2],o[3]),e.refreshRibbon&&this.parent.notify("activeCellChanged",null),n&&(i.style=a,i.range=t.name+"!"+r,this.parent.notify("actionComplete",{eventArgs:i,action:"format"}))},e.prototype.setBottomBorderPriority=function(e,t,r){if(Ee(e,t+1)){var n=this.skipHiddenRows(e,t+1);""!==this.parent.getCellStyleValue(["borderTop"],[n,r]).borderTop&&(e.rows[t].cells[r].style.bottomPriority=!0)}},e.prototype.setFullBorder=function(e,t,r,n,i,a){var o={};n===r[0]&&(this.checkAdjustantBorder(e,"borderBottom",n-1,i),this.checkFullBorder(e,"borderBottom",n-1,i)),i===r[1]&&(this.checkAdjustantBorder(e,"borderRight",n,i-1),this.checkFullBorder(e,"borderRight",n,i-1)),i===r[3]?(this.checkAdjustantBorder(e,"borderLeft",n,i+1),this.checkFullBorder(e,"borderLeft",n,i+1)):this.checkAdjustantBorder(e,"border",n,i+1),o.borderRight=t,o.borderTop=t,o.borderLeft=t,o.borderBottom=t,this.setCellBorder(e,o,n,i,a,i===r[3]),n===r[2]?(this.checkAdjustantBorder(e,"borderTop",n+1,i),this.checkFullBorder(e,"borderTop",n+1,i),this.setBottomBorderPriority(e,n,i)):this.checkAdjustantBorder(e,"border",n+1,i)},e.prototype.checkAdjustantBorder=function(e,t,r,n){var i={};""!==this.parent.getCellStyleValue([t],[r,n])[t]&&(i[t]=void 0,this.setCellStyle(e,r,n,i))},e.prototype.checkFullBorder=function(e,t,r,n){var i=this.parent.getCellStyleValue(["border"],[r,n]).border;if(""!==i){var a={border:void 0};["borderBottom","borderTop","borderLeft","borderRight"].forEach(function(e){e!==t&&(a[e]=i)}),this.setCellStyle(e,r,n,a)}},e.prototype.textDecorationActionUpdate=function(e){var t=this.parent.getActiveSheet(),r={range:t.selectedRange,style:e.style,requestType:"CellFormat"};if(this.parent.trigger("beforeCellFormat",r),this.parent.notify("actionBegin",{eventArgs:r,action:"format"}),r.cancel)return void(e.cancel=!0);var n,i=S(c(t.selectedRange)),a=e.style.textDecoration,o=a,s=c(t.activeCell),l=this.parent.getCellStyleValue(["textDecoration"],s).textDecoration,h=!1;"underline"===l?o="underline"===a?"none":"underline line-through":"line-through"===l?o="line-through"===a?"none":"underline line-through":"underline line-through"===l&&(o="underline"===a?"line-through":"underline",h=!0),"none"===o&&(h=!0),this.format({style:{textDecoration:o},range:s,refreshRibbon:e.refreshRibbon,onActionUpdate:!0});for(var d=i[0];d<=i[2];d++)for(var p=i[1];p<=i[3];p++)if(d!==s[0]||p!==s[1]){if(n={},"none"===(l=this.parent.getCellStyleValue(["textDecoration"],[d,p]).textDecoration)){if(h)continue;n.textDecoration=a}else if("underline"===l||"line-through"===l)if(h){if(a!==l)continue;n.textDecoration="none"}else n.textDecoration=a!==l?"underline line-through":a;else if("underline line-through"===l){if(!h)continue;n.textDecoration="underline"===a?"line-through":"underline"}this.format({style:n,range:[d,p,d,p],refreshRibbon:e.refreshRibbon,onActionUpdate:!0})}r.range=t.name+"!"+r.range,this.parent.notify("actionComplete",{eventArgs:r,action:"format"})},e.prototype.setTypedBorder=function(e,t,r,n,i){var a;if("Outer"===n){for(var o=r[1];o<=r[3];o++)this.checkAdjustantBorder(e,"borderBottom",r[0]-1,o),this.checkFullBorder(e,"borderBottom",r[0]-1,o),this.setCellBorder(e,{borderTop:t},r[0],o,i,o===r[3]),this.checkAdjustantBorder(e,"borderTop",r[2]+1,o),this.checkFullBorder(e,"borderTop",r[2]+1,o),this.setCellBorder(e,{borderBottom:t},r[2],o,i,o===r[3],n),this.setBottomBorderPriority(e,r[2],o);for(var s=r[0];s<=r[2];s++)this.checkAdjustantBorder(e,"borderRight",s,r[1]-1),this.checkFullBorder(e,"borderRight",s,r[1]-1),this.setCellBorder(e,{borderLeft:t},s,r[1],i),this.checkAdjustantBorder(e,"borderLeft",s,r[3]+1),this.checkFullBorder(e,"borderLeft",s,r[3]+1),this.setCellBorder(e,{borderRight:t},s,r[3],i,null,n)}else if("Inner"===n)for(l=r[0];l<=r[2];l++)for(h=r[1];h<=r[3];h++){d={};""!==(a=this.parent.getCellStyleValue(["border"],[l,h]).border)&&(d.border=void 0,h!==r[3]&&h!==r[1]&&l!==r[0]&&l!==r[2]||(l===r[0]&&(d.borderTop=a),l===r[2]&&(d.borderBottom=a),h===r[3]&&(d.borderRight=a),h===r[1]&&(d.borderLeft=a))),h!==r[3]&&(d.borderRight=t),l!==r[0]&&(d.borderTop=t),l!==r[2]&&(d.borderBottom=t),h!==r[1]&&(d.borderLeft=t),this.setCellBorder(e,d,l,h,i,h===r[3])}else if("Vertical"===n)for(l=r[0];l<=r[2];l++)for(h=r[1];h<=r[3];h++){d={borderRight:t,borderLeft:t};h===r[1]&&(this.checkAdjustantBorder(e,"borderRight",l,h-1),this.checkFullBorder(e,"borderRight",l,h-1)),h===r[3]&&(this.checkAdjustantBorder(e,"borderLeft",l,h+1),this.checkFullBorder(e,"borderLeft",l,h+1)),this.setCellBorder(e,d,l,h,i)}else for(var l=r[0];l<=r[2];l++)for(var h=r[1];h<=r[3];h++){var d={borderTop:t,borderBottom:t};l===r[0]&&(this.checkAdjustantBorder(e,"borderBottom",l-1,h),this.checkFullBorder(e,"borderBottom",l-1,h)),this.setCellBorder(e,d,l,h,i,h===r[3]),l===r[2]&&(this.checkAdjustantBorder(e,"borderTop",l+1,h),this.checkFullBorder(e,"borderTop",l+1,h),this.setBottomBorderPriority(e,l,h))}},e.prototype.setCellBorder=function(e,t,r,n,i,a,o){if(this.setCellStyle(e,r,n,t),this.parent.getActiveSheet().id===e.id){if("Outer"===o&&(t.borderBottom||t.borderRight)){var s={range:[r,n,r,n]};this.parent.notify("activeCellMergedRange",s),r=s.range[0],n=s.range[1]}this.parent.notify(Ft,{style:t,rowIdx:r,colIdx:n,onActionUpdate:i,first:"",lastCell:a,isHeightCheckNeeded:!0,manualUpdate:!0})}},e.prototype.setCellStyle=function(e,t,r,n){e.rows[t]?e.rows[t].cells||(e.rows[t].cells=[]):e.rows[t]={cells:[]},e.rows[t].cells[r]||(e.rows[t].cells[r]={}),e.rows[t].cells[r].style||(e.rows[t].cells[r].style={}),Object.assign(e.rows[t].cells[r].style,n,null,!0)},e.prototype.skipHiddenRows=function(e,t){return t++,Ee(e,t)&&(t=this.skipHiddenRows(e,t)),t},e.prototype.addEventListener=function(){this.parent.on(Tt,this.format,this),this.parent.on("textDecorationUpdate",this.textDecorationActionUpdate,this),this.parent.on("clear",this.clearCellObj,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Tt,this.format),this.parent.off("textDecorationUpdate",this.textDecorationActionUpdate),this.parent.off("clear",this.clearCellObj))},e.prototype.clearCellObj=function(e){var t,r,n=e.range?e.range.indexOf("!")>0?e.range.split("!")[1]:e.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,i=e.range&&e.range.indexOf("!")>0?se(this.parent,e.range.split("!")[0]):this.parent.activeSheetIndex,a=fe(this.parent,i),o=y(n),s=o[0],l=o[2];for(s;s<=l;s++)for(t=o[1],r=o[3],t;t<=r;t++){var h=J(s,t,a);if(h)switch(e.type){case"Clear Formats":delete h.format,delete h.rowSpan,delete h.style,delete h.wrap,delete h.colSpan;break;case"Clear Contents":h.hyperlink&&this.parent.notify("deleteHyperlink",{sheet:a,rowIdx:s,colIdx:t,preventRefresh:!0}),delete h.value,delete h.formula;break;case"Clear Hyperlinks":delete h.hyperlink;break;case"Clear All":Q(s,t,a,{},!1)}}},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"workbookcellformat"},e}(),zr=function(){function e(e){this.parent=e,this.localeObj=t.getNumericObject(this.parent.locale),this.decimalSep=this.localeObj.decimal,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("workbookEditOperation",this.performEditOperation,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("workbookEditOperation",this.performEditOperation)},e.prototype.getModuleName=function(){return"workbookEdit"},e.prototype.performEditOperation=function(e){switch(e.action){case"updateCellValue":this.updateCellValue(e.address,e.value,e.sheetIndex,e.isValueOnly)}},e.prototype.checkDecimalPoint=function(e){if(Number(e)){var t=e.toString().indexOf(this.decimalSep)+1;e=e.toString().substr(t).length<=6?t<7?e:parseFloat(e).toFixed(0):t>7?parseFloat(e).toFixed(0):parseFloat(e).toFixed(6-t+2)}return e},e.prototype.updateCellValue=function(e,r,n,i){void 0===i&&(i=!1),void 0===n&&(n=this.parent.activeSheetIndex);var a;a="string"==typeof e?c(e):e;var o=fe(this.parent,n),s=J(a[0],a[1],o,!0);if(s||(s=o.rows[a[0]].cells[a[1]]={}),i)r&&r.toString().indexOf(this.decimalSep)>-1&&(r=this.checkDecimalPoint(r)),s.value=r;else{var l=q(r);l||(s.formula="",s.value=D(r));var h={action:"refreshCalculate",value:r,rowIndex:a[0],colIndex:a[1],sheetIndex:n,isFormula:l};if("Text"!==H(s.format)){var d={value:r,rowIndex:a[0],colIndex:a[1],sheetIndex:n,updatedVal:""};this.parent.notify(Nt,d),!t.isNullOrUndefined(d.updatedVal)&&d.updatedVal.length>0&&(s.value=d.updatedVal)}this.parent.notify(Lt,h),l&&(s.formula=h.value,r=s.value)}this.parent.setUsedRange(a[0],a[1],o),this.parent.allowChart&&this.parent.notify("refreshChart",{cell:s,rIdx:a[0],cIdx:a[1],sheetIdx:n}),this.parent.allowConditionalFormat&&this.parent.notify("checkConditionalFormat",{rowIdx:a[0],colIdx:a[1],cell:s,isAction:!0})},e}(),qr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("setLinkModel",this.setLinkHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("setLinkModel",this.setLinkHandler)},e.prototype.setLinkHandler=function(e){var r,n,i,a=e.hyperlink,o=e.cell,s=this.parent.getActiveSheet();if(o&&-1!==o.indexOf("!")){r=o.split("!");for(var l=this.parent.sheets,h=0;h<l.length;h++)l[h].name===r[0]&&(n=h);s=this.parent.sheets[n],o=r[1]}var d=c(o=o||this.parent.getActiveSheet().activeCell),p=d[0],u=d[1];s&&(t.isNullOrUndefined(s.rows[p])&&(s.rows[p]={}),t.isNullOrUndefined(s.rows[p].cells)&&(s.rows[p].cells=[]),t.isNullOrUndefined(s.rows[p].cells[u])&&(s.rows[p].cells[u]={}),s.rows[p].cells[u].style?(s.rows[p].cells[u].style.textDecoration="underline",s.rows[p].cells[u].style.color="#00e"):s.rows[p].cells[u].style={textDecoration:"underline",color:"#00e"},"string"==typeof a?(0!==a.indexOf("http://")&&0!==a.indexOf("https://")&&0!==a.indexOf("ftp://")&&(i=a=0===a.toLowerCase().indexOf("www.")?"http://"+a:a),s.rows[p].cells[u].hyperlink=a):(0!==(i=a.address).indexOf("http://")&&0!==i.indexOf("https://")&&0!==i.indexOf("ftp://")&&(i=0===i.toLowerCase().indexOf("www.")?"http://"+i:i),s.rows[p].cells[u].hyperlink={address:i}))},e.prototype.getModuleName=function(){return"workbookHyperlink"},e}(),jr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.insertModel=function(e){var t,r,n,i=this;if(e.model){var a,o,s,l=[];if("number"==typeof e.start){a=e.start,e.end=e.end||a,a>e.end&&(a=e.end,e.end=e.start);for(p=a;p<=e.end;p++)l.push({})}else e.start?(a=e.start[0].index||0,l=e.start,s=!0):(a=0,l.push({}));var h;if("Row"===e.modelType){if(e.model=e.model,e.model.rows||(e.model.rows=[]),s&&e.model.usedRange.rowIndex>-1&&a>e.model.usedRange.rowIndex)for(p=e.model.usedRange.rowIndex;p<a-1;p++)l.splice(0,0,{});a<this.parent.frozenRowCount(e.model)&&(this.parent.setSheetPropertyOnMute(e.model,"frozenRows",e.model.frozenRows+l.length),h=!0),(t=e.model.rows).splice.apply(t,[a,0].concat(l)),a>e.model.usedRange.rowIndex?this.parent.setUsedRange(a+(l.length-1),e.model.usedRange.colIndex,e.model):this.parent.setUsedRange(e.model.usedRange.rowIndex+l.length,e.model.usedRange.colIndex,e.model);for(var d=a+l.length,p=0;p<=e.model.usedRange.colIndex;p++)e.model.rows[d]&&e.model.rows[d].cells&&e.model.rows[d].cells[p]&&void 0!==e.model.rows[d].cells[p].rowSpan&&e.model.rows[d].cells[p].rowSpan<0&&void 0===e.model.rows[d].cells[p].colSpan&&this.parent.notify("insertMerge",{range:[d,p,d,p],insertCount:l.length,insertModel:"Row"})}else if("Column"===e.modelType){e.model=e.model,e.model.columns||(e.model.columns=[]),(r=e.model.columns).splice.apply(r,[a,0].concat(l)),a<this.parent.frozenColCount(e.model)&&(this.parent.setSheetPropertyOnMute(e.model,"frozenColumns",e.model.frozenColumns+l.length),h=!0),a>e.model.usedRange.colIndex?this.parent.setUsedRange(e.model.usedRange.rowIndex,a+(l.length-1),e.model):this.parent.setUsedRange(e.model.usedRange.rowIndex,e.model.usedRange.colIndex+l.length,e.model),e.model.rows||(e.model.rows=[]);var c=[];e.columnCellsModel||(e.columnCellsModel=[]);for(p=0;p<l.length;p++)c.push(null);o=[];for(p=0;p<=e.model.usedRange.rowIndex;p++){e.model.rows[p]?e.model.rows[p].cells||(e.model.rows[p].cells=[]):e.model.rows[p]={cells:[]},a&&!e.model.rows[p].cells[a-1]&&(e.model.rows[p].cells[a-1]={}),(n=e.model.rows[p].cells).splice.apply(n,[a,0].concat(e.columnCellsModel[p]&&e.columnCellsModel[p].cells?e.columnCellsModel[p].cells:c));d=a+l.length;e.model.rows[p].cells[d]&&void 0!==e.model.rows[p].cells[d].colSpan&&e.model.rows[p].cells[d].colSpan<0&&void 0===e.model.rows[p].cells[d].rowSpan&&o.push({range:[p,d,p,d],insertCount:c.length,insertModel:"Column"})}o.forEach(function(e){i.parent.notify("insertMerge",e)})}else{if(void 0!==e.checkCount&&e.checkCount===this.parent.sheets.length)return;for(var u=l,p=0;p<u.length;p++)if(u[p].name)for(var f=0;f<this.parent.sheets.length;f++)if(u[p].name===this.parent.sheets[f].name){u.splice(p,1),p--;break}if(!u.length)return;delete l[0].index,this.parent.createSheet(a,l);var g;e.activeSheetIndex?this.parent.setProperties({activeSheetIndex:e.activeSheetIndex},!0):!e.isAction&&e.start<this.parent.activeSheetIndex&&this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(this.parent.activeSheetIndex)},!0),l.forEach(function(e){s&&i.updateRangeModel(e.ranges),g=e.id,i.parent.notify(Lt,{action:"addSheet",visibleName:e.name,sheetName:"Sheet"+g,index:g})})}var m={action:"refreshNamedRange",insertArgs:{model:l,index:a,modelType:e.modelType,isAction:e.isAction,activeSheetIndex:e.activeSheetIndex,sheetCount:this.parent.sheets.length,name:"insert"}},v={action:"refreshInsDelFormula",insertArgs:{model:l,startIndex:e.start,endIndex:e.end,modelType:e.modelType,name:"insert",activeSheetIndex:e.activeSheetIndex,sheetCount:this.parent.sheets.length}};"Sheet"!==e.modelType&&(this.parent.notify(Lt,m),this.parent.notify(Lt,v),e.model!==this.parent.getActiveSheet())||this.parent.notify("insert",{model:l,index:a,modelType:e.modelType,isAction:e.isAction,activeSheetIndex:e.activeSheetIndex,sheetCount:this.parent.sheets.length,insertType:e.insertType,freezePane:h})}},e.prototype.updateRangeModel=function(e){e.forEach(function(e){e.dataSource&&(e.startCell=e.startCell||"A1",e.showFieldAsHeader=void 0===e.showFieldAsHeader||e.showFieldAsHeader,e.template=e.template||"",e.address=e.address||"A1")})},e.prototype.setInsertInfo=function(e,t,r,n,i){void 0===i&&(i="Row");var a=r=t+(r-1);e.ranges.forEach(function(e){e.info&&t<e.info[n]&&(e.info["insert"+i+"Range"]?e.info["insert"+i+"Range"].push([t,a]):e.info["insert"+i+"Range"]=[[t,a]],e.info[n]+=a-t+1)})},e.prototype.addEventListener=function(){this.parent.on(Ht,this.insertModel,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Ht,this.insertModel)},e.prototype.getModuleName=function(){return"workbookinsert"},e}(),Wr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.deleteModel=function(e){var t=this,r=this.parent.sheets.length;if("Sheet"!==e.modelType||1!==r){var n=e.modelType.toLowerCase()+"s";if(e.start=e.start,e.start>e.end){var i=e.start;e.start=e.end,e.end=i}var a,o,s,l=[],h=e.end-e.start+1;if("Row"===e.modelType){if(e.model=e.model,e.start>e.model.usedRange.rowIndex)return;e.end>e.model.usedRange.rowIndex&&(e.end-=e.end-e.model.usedRange.rowIndex),e.model.usedRange.rowIndex-=e.end-e.start+1,e.model.usedRange.rowIndex<0&&(e.model.usedRange.rowIndex=0);var d=this.parent.frozenRowCount(e.model);e.start<d&&(d=e.end<d?e.end-e.start+1:d-e.start,d=e.model.frozenRows-d,this.parent.setSheetPropertyOnMute(e.model,"frozenRows",d),s=!0);var p=e.end+1,c=void 0,u=void 0;if(e.model.rows[e.start]&&e.model.rows[e.start].cells)for(g=0;g<=e.model.usedRange.colIndex;g++)e.model.rows[e.start].cells[g]&&void 0!==e.model.rows[e.start].cells[g].rowSpan&&e.model.rows[e.start].cells[g].rowSpan<0&&void 0===e.model.rows[e.start].cells[g].colSpan&&(u={range:[e.start,g,e.start,g]},this.parent.notify("activeCellMergedRange",u),u.range=u.range,u.range[2]<=e.end&&((o=J(u.range[0],g,e.model))&&o.rowSpan>1&&(o.rowSpan-(u.range[2]-e.start+1)>1?Q(u.range[0],g,e.model,{colSpan:o.rowSpan-(u.range[2]-e.start+1)},!0):delete e.model.rows[u.range[0]].cells[g].rowSpan),u=null)),e.model.rows[p]&&e.model.rows[p].cells&&e.model.rows[p].cells[g]&&void 0!==e.model.rows[p].cells[g].rowSpan&&e.model.rows[p].cells[g].rowSpan<0&&void 0===e.model.rows[p].cells[g].colSpan&&(u||(u={range:[p,g,p,g]},this.parent.notify("activeCellMergedRange",u)),c=new Object,u.range=u.range,Object.assign(c,J(u.range[0],u.range[1],e.model)),c&&c.rowSpan&&(c.rowSpan>1||c.colSpan>1)&&((v=[])[1]=g,v[3]=c.colSpan>1?g+(c.colSpan-1):g,u.range=u.range,u.range[0]<e.start?(v[0]=v[2]=u.range[0],c.rowSpan-h>1&&(v[2]+=c.rowSpan-h-1)):(v[0]=v[2]=e.start,c.rowSpan-(e.end-u.range[0]+1)>1&&(v[2]+=c.rowSpan-(e.end-u.range[0]+1)-1)),l.push({range:v,isAction:!1,preventRefresh:!0,merge:!0,type:"All",skipChecking:!0}))),u=null}else if("Column"===e.modelType){if(e.model=e.model,e.start>e.model.usedRange.colIndex)return;e.end>e.model.usedRange.colIndex&&(e.end-=e.end-e.model.usedRange.colIndex),e.model.usedRange.colIndex-=h,e.model.usedRange.colIndex<0&&(e.model.usedRange.colIndex=0);var f=this.parent.frozenColCount(e.model);e.start<f&&(f=e.end<f?e.end-e.start+1:f-e.start,f=e.model.frozenColumns-f,this.parent.setSheetPropertyOnMute(e.model,"frozenColumns",f),s=!0),a=[];for(var p=e.end+1,c=void 0,u=void 0,g=0;g<=e.model.usedRange.rowIndex;g++)if(a.push({}),e.model.rows[g]&&e.model.rows[g].cells){if(e.model.rows[g].cells[e.start]&&void 0!==e.model.rows[g].cells[e.start].colSpan&&e.model.rows[g].cells[e.start].colSpan<0&&void 0===e.model.rows[g].cells[e.start].rowSpan&&(u={range:[g,e.start,g,e.start]},this.parent.notify("activeCellMergedRange",u),u.range=u.range,u.range[3]<=e.end)){var m=J(g,u.range[1],e.model);m&&m.colSpan>1&&(m.colSpan-(u.range[3]-e.start+1)>1?Q(g,u.range[1],e.model,{colSpan:m.colSpan-(u.range[3]-e.start+1)},!0):delete e.model.rows[g].cells[u.range[1]].colSpan),u=null}if(e.model.rows[g].cells[p]&&void 0!==e.model.rows[g].cells[p].colSpan&&e.model.rows[g].cells[p].colSpan<0&&void 0===e.model.rows[g].cells[p].rowSpan&&(u||(u={range:[g,p,g,p]},this.parent.notify("activeCellMergedRange",u)),c=new Object,u.range=u.range,Object.assign(c,J(u.range[0],u.range[1],e.model)),c&&c.colSpan&&(c.colSpan>1||c.rowSpan>1))){var v=[];v[0]=g,v[2]=c.rowSpan>1?g+(c.rowSpan-1):g,u.range=u.range,u.range[1]<e.start?(v[1]=v[3]=u.range[1],c.colSpan-h>1&&(v[3]+=c.colSpan-h-1)):(v[1]=v[3]=e.start,c.colSpan-(e.end-u.range[1]+1)>1&&(v[3]+=c.colSpan-(e.end-u.range[1]+1)-1)),l.push({range:v,isAction:!1,preventRefresh:!0,merge:!0,type:"All",skipChecking:!0})}a[g].cells=e.model.rows[g].cells.splice(e.start,h),u=null}}else if(e.end-e.start==this.parent.sheets.length-1)return;for(var y=[],g=e.start;g<=e.end;g++)"Sheet"===e.modelType&&this.parent.notify(Lt,{action:"deleteSheetTab",sheetName:"",index:g+1}),e.model[n][e.start]?(y.push(e.model[n][e.start]),e.model[n].splice(e.start,1)):y.push({}),g===e.start&&(y[0].index=e.start);l.forEach(function(e){t.parent.notify(Vt,e)});var C={action:"refreshNamedRange",insertArgs:{startIndex:e.start,endIndex:e.end,modelType:e.modelType,isAction:e.isAction,deletedModel:y,deletedCellsModel:a,activeSheetIndex:this.parent.activeSheetIndex,name:"delete"}};this.parent.notify(Lt,C),this.parent.notify("beforeDelete",e),"Sheet"!==e.modelType&&e.model!==this.parent.getActiveSheet()||this.parent.notify("delete",{startIndex:e.start,endIndex:e.end,modelType:e.modelType,isAction:e.isAction,deletedModel:y,deletedCellsModel:a,activeSheetIndex:this.parent.activeSheetIndex,freezePane:s})}},e.prototype.setDeleteInfo=function(e,t,r,n){void 0===n&&(n="Row");var i=t-e+1,a=[];this.parent.getActiveSheet().ranges.forEach(function(o){o.info&&e<o.info[r]&&(o.info["delete"+n+"Range"]?o.info["delete"+n+"Range"].push([e,t]):o.info["delete"+n+"Range"]=[[e,t]],o.info[r]-=i,o.info["insert"+n+"Range"]&&(o.info["insert"+n+"Range"]=a))})},e.prototype.addEventListener=function(){this.parent.on("deleteModel",this.deleteModel,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("deleteModel",this.deleteModel)},e.prototype.getModuleName=function(){return"workbookdelete"},e}(),Gr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on(Bt,this.addValidationHandler,this),this.parent.on(_t,this.removeValidationHandler,this),this.parent.on("addHighlight",this.addHighlightHandler,this),this.parent.on("removeHighlight",this.removeHighlightHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Bt,this.addValidationHandler),this.parent.off(_t,this.removeValidationHandler),this.parent.off("addHighlight",this.addHighlightHandler),this.parent.off("removeHighlight",this.removeHighlightHandler))},e.prototype.addValidationHandler=function(e){this.ValidationHandler(e.rules,e.range,!1)},e.prototype.removeValidationHandler=function(e){this.ValidationHandler(e.rules,e.range,!0)},e.prototype.ValidationHandler=function(e,r,n){var i,a=r,o="";r.indexOf("!")>-1&&(a=r.split("!")[1],o=r.split("!")[0]);var s=fe(this.parent,this.parent.getAddressInfo(o+"A1:A1").sheetIndex),l=!1,h=s.rowCount,d=a.split(":");a.match(/\D/g)&&!a.match(/[0-9]/g)?(d[0]+=1,d[1]+=h,a=d[0]+":"+d[1],l=!0):!a.match(/\D/g)&&a.match(/[0-9]/g)&&(d[0]="A"+d[0],d[1]=g(0,s.colCount-1).replace(/[0-9]/g,"")+d[1],a=d[0]+":"+d[1]),t.isNullOrUndefined(o)||(r=o+a);var p=c(r=r||s.selectedRange);if(l)for(m=p[1];m<=p[3];m++){var u=Te(s,m);n&&u&&u.validation?delete s.columns[m].validation:(t.isNullOrUndefined(u)&&(s.columns[m]=Te(s,m)),s.columns[m].validation={operator:e.operator,type:e.type,value1:"List"===e.type&&e.value1.length>256?e.value1.substring(0,255):e.value1,value2:e.value2,inCellDropDown:e.inCellDropDown,ignoreBlank:e.ignoreBlank})}else for(var f=p[0];f<=p[2];f++){s.rows[f]||Ie(s,f,{});for(var m=p[1];m<=p[3];m++)if(s.rows[f].cells&&s.rows[f].cells[m]||Q(f,m,s,{}),i=s.rows[f].cells[m],n){if(i.validation){delete i.validation;var v=this.parent.getCellStyleValue(["backgroundColor","color"],[f,m]);this.parent.notify(Ft,{style:v,rowIdx:f,colIdx:m})}}else i.validation={type:e.type,operator:e.operator,value1:"List"===e.type&&e.value1.length>256?e.value1.substring(0,255):e.value1,value2:e.value2,ignoreBlank:e.ignoreBlank,inCellDropDown:e.inCellDropDown}}},e.prototype.addHighlightHandler=function(e){this.InvalidDataHandler(e.range,!1,e.td,e.isclearFormat)},e.prototype.removeHighlightHandler=function(e){this.InvalidDataHandler(e.range,!0)},e.prototype.getRange=function(e){var t=c(e),r=this.parent.getActiveSheet(),n=r.colCount,i=r.rowCount;return t[2]===i-1&&0===t[0]?e=e.replace(/[0-9]/g,""):t[3]===n-1&&0===t[2]&&(e=e.replace(/\D/g,"")),e},e.prototype.InvalidDataHandler=function(e,t,r,n){var i,a,o=this.parent.getActiveSheet(),s=(e=e||o.selectedRange)?c(e):[],l=!1;(e=this.getRange(e)).match(/\D/g)&&!e.match(/[0-9]/g)&&(l=!0);var h=e?s[0]:0,d=e?s[2]:o.rows.length;for(h;h<=d;h++)if(o.rows[h]){var p=e?s[1]:0,u=e?s[3]:o.rows[h].cells.length;for(p;p<=u;p++){var f=void 0;if(o.rows[h].cells[p]){var g=Te(o,p);if((i=o.rows[h].cells[p])&&i.validation){if(f=i.validation,n&&!f.isHighlighted)return;t?f.isHighlighted&&(i.validation.isHighlighted=!1):i.validation.isHighlighted=!0}else if(g&&g.validation){if(f=g.validation,n&&!f.isHighlighted)return;t&&l?f.isHighlighted&&(g.validation.isHighlighted=!1):l&&(g.validation.isHighlighted=!0)}a=i.value?i.value:"";var m=[h,p],v=this.parent.activeSheetIndex;if(f&&this.parent.allowDataValidation){this.parent.notify("isValidation",{value:a,range:m,sheetIdx:v,isCell:!1});var y=this.parent.allowDataValidation;this.parent.allowDataValidation=!0,y||this.parent.notify("validationHighlight",{isRemoveHighlightedData:t,rowIdx:h,colIdx:p,td:r})}}}}},e.prototype.getModuleName=function(){return"workbookDataValidation"},e}(),Yr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("findNext",this.findNext,this),this.parent.on("findPrevious",this.findPrevious,this),this.parent.on("replace",this.replace,this),this.parent.on("replaceAll",this.replaceAll,this),this.parent.on("count",this.totalCount,this),this.parent.on("findAllValues",this.findAllValues,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("findNext",this.findNext),this.parent.off("findPrevious",this.findPrevious),this.parent.off("replace",this.replace),this.parent.off("replaceAll",this.replaceAll),this.parent.off("count",this.totalCount),this.parent.off("findAllValues",this.findAllValues))},e.prototype.findNext=function(e){var t,r,n,i=this.parent.sheets,a=i[this.parent.activeSheetIndex],o=u(a.activeCell),s=a.usedRange,l=s.colIndex,h=e.value.toString(),d=0,p=s.rowIndex,c=t=o[1],f=r=o[0];if(a.rows[r]&&a.rows[r].cells&&a.rows[r].cells[t]&&(a.rows[r].cells[t].format?n=this.parent.getDisplayText(a.rows[r].cells[t]).toString():a.rows[r].cells[t].value&&(n=a.rows[r].cells[t].value.toString())),n){var g=n.toLowerCase(),m=n.indexOf(e.value)>-1,v=g.indexOf(e.value.toString().toLowerCase())>-1;(h===n||h===g||m||v)&&("By Column"===e.searchBy?r++:t++,d++)}(o[0]>a.usedRange.rowIndex||o[1]>a.usedRange.colIndex)&&(o[0]>a.usedRange.rowIndex&&o[1]<=a.usedRange.colIndex?(r=0,t=o[1]):o[0]<=a.usedRange.rowIndex&&o[1]>a.usedRange.colIndex?(r=o[0],t=0):(r=0,t=0));var y={rowIndex:r,colIndex:t,usedRange:s,endRow:p,endColumn:l,startRow:f,mode:e.mode,loopCount:0,count:d,args:e,val:void 0,stringValue:h,sheetIndex:this.parent.activeSheetIndex,startColumn:c,sheets:i};"By Row"===e.searchBy&&this.findNxtRow(y),"By Column"===e.searchBy&&this.findNxtCol(y)},e.prototype.findNxtRow=function(e){var t,r=e.sheets[e.sheetIndex],n=this.parent.sheets.length;t=r.usedRange;var i=u(r.activeCell);for(e.colIndex>=e.usedRange.colIndex+1&&(e.colIndex=0,e.rowIndex++),e.rowIndex;e.rowIndex<=e.endRow+1;e.rowIndex++){if(e.rowIndex>e.endRow){if("Workbook"===e.mode){var a=this.parent.activeSheetIndex;if(e.sheetIndex++,n===e.sheetIndex&&(e.sheetIndex=0),a===e.sheetIndex&&0===e.count)return void this.parent.notify(Pt,null);t=(r=e.sheets[e.sheetIndex]).usedRange,i=u(r.activeCell),e.rowIndex=0,e.colIndex=0,e.endColumn=t.colIndex,e.endRow=t.rowIndex}if(0===e.colIndex&&e.rowIndex>e.endRow)if(0===i[0]&&0===i[1]){if(0===e.count)return void this.parent.notify(Pt,null)}else(0!==i[0]&&0!==i[1]||0!==i[0]||0!==i[1])&&(e.startColumn=0,e.startRow=0,e.endColumn=t.colIndex,e.endRow=i[0],e.rowIndex=e.startRow,e.colIndex=e.startColumn,e.loopCount++)}if(e.count>0&&t.rowIndex<e.rowIndex&&(e.rowIndex=0,0===e.rowIndex&&(e.colIndex=0)),r.rows[e.rowIndex]){var o=r.rows[e.rowIndex];for(e.colIndex;e.colIndex<=e.endColumn;e.colIndex++)if(o&&o.cells&&o.cells[e.colIndex]&&this.nextCommon(e))return;if(e.colIndex>e.endColumn&&(e.colIndex=0),e.loopCount>0&&i[0]===e.rowIndex)return void this.parent.notify(Pt,null)}}if(0===e.count)return void this.parent.notify(Pt,null)},e.prototype.findNxtCol=function(e){var t,r=e.sheets[e.sheetIndex],n=u(r.activeCell),i=this.parent.sheets.length;for(e.rowIndex>=e.usedRange.rowIndex&&(e.rowIndex=0,e.colIndex++),e.colIndex;e.colIndex<=e.usedRange.colIndex+1;e.colIndex++){if(e.colIndex>=e.endColumn+1&&"Workbook"===e.mode){if(t=this.parent.activeSheetIndex,e.sheetIndex++,i===e.sheetIndex&&(e.sheetIndex=0),t===e.sheetIndex&&0===e.count)return void this.parent.notify(Pt,null);r=e.sheets[e.sheetIndex],e.usedRange=r.usedRange,n=u(r.activeCell),e.colIndex=0,e.rowIndex=0,e.endColumn=e.usedRange.colIndex,e.endRow=e.usedRange.rowIndex}if(e.colIndex>=e.endColumn+1&&(e.colIndex=0),e.rowIndex>e.endRow&&0===e.colIndex)if(0===n[0]&&0===n[1]||n[1]>r.usedRange.rowIndex||n[0]>r.usedRange.colIndex){if(0===e.count)return void this.parent.notify(Pt,null)}else(0!==n[1]||0!==n[0]||0!==n[1]&&0!==n[0])&&(e.startRow=0,e.startColumn=0,e.endRow=n[0],e.endColumn=e.usedRange.colIndex,e.colIndex=e.startColumn,e.rowIndex=e.startRow,e.loopCount++);if(e.count>0&&e.usedRange.colIndex+1<e.colIndex&&(e.colIndex=0,e.rowIndex=0),e.rowIndex>=e.endRow&&(e.rowIndex=0),e.colIndex<=e.usedRange.colIndex){for(e.rowIndex;e.rowIndex<=e.usedRange.rowIndex;e.rowIndex++)if(r.rows[e.rowIndex]&&r.rows[e.rowIndex].cells&&r.rows[e.rowIndex].cells[e.colIndex]&&this.nextCommon(e))return;if(e.loopCount>0&&n[1]===e.colIndex)return void this.parent.notify(Pt,null)}}if(0===e.count)return void this.parent.notify(Pt,null)},e.prototype.nextCommon=function(e){var t=e.sheets[e.sheetIndex];if(t.rows[e.rowIndex]){var r=t.rows[e.rowIndex].cells[e.colIndex];if(r&&r.value){var n=t.rows[e.rowIndex].cells[e.colIndex];if(n){var i=void 0;if(i=n.format?this.parent.getDisplayText(t.rows[e.rowIndex].cells[e.colIndex]):t.rows[e.rowIndex].cells[e.colIndex].value.toString(),e.args.isCSen&&e.args.isEMatch){if(i===e.stringValue){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(e.args.isCSen&&!e.args.isEMatch){a=i.indexOf(e.args.value)>-1;if(i===e.stringValue||a){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(!e.args.isCSen&&e.args.isEMatch){if(e.val=i.toString().toLowerCase(),e.val===e.stringValue){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(!e.args.isCSen&&!e.args.isEMatch){e.val=i.toString().toLowerCase();var a=e.val.indexOf(e.args.value.toString().toLowerCase())>-1,o=e.val.indexOf(e.args.value)>-1;if(e.val===e.stringValue||i===e.stringValue||a||i===e.stringValue||o){var s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}}}}return!1},e.prototype.findPrevious=function(e){var t,r=this.parent.sheets,n=e.sheetIndex,i=r[n],a=u(i.activeCell),o=0,s=i.usedRange.rowIndex,l=i.usedRange.colIndex,h=e.value.toString(),d=a[1],p=a[0],c=d,f=p;if(i.rows[p]&&i.rows[p].cells[d]&&(i.rows[p].cells[d].format?t=this.parent.getDisplayText(i.rows[p].cells[d]).toString():i.rows[p].cells[d].value&&(t=i.rows[p].cells[d].value.toString())),t){var g=t.toLowerCase(),m=t.indexOf(e.value)>-1,v=g.indexOf(e.value.toString().toLowerCase())>-1;(h===t||h===g||m||v)&&("By Row"===e.searchBy&&d--,"By Column"===e.searchBy&&p--,o++)}(a[0]>i.usedRange.rowIndex||a[1]>i.usedRange.colIndex)&&(a[0]>i.usedRange.rowIndex&&a[1]<=i.usedRange.colIndex?(p=i.usedRange.rowIndex,d=a[1]):a[0]<=i.usedRange.rowIndex&&a[1]>i.usedRange.colIndex?(p=a[0],d=i.usedRange.colIndex):(p=i.usedRange.rowIndex,d=i.usedRange.colIndex));var y={rowIndex:p,colIndex:d,endRow:s,endColumn:l,startRow:f,loopCount:0,count:o,args:e,val:void 0,stringValue:h,sheets:r,sheetIndex:n,startColumn:c};"By Row"===e.searchBy&&this.findPreRow(y),"By Column"===e.searchBy&&this.findPreCol(y)},e.prototype.findPreRow=function(e){var t,r=e.sheets[e.sheetIndex],n=this.parent.sheets.length,i=!1,a=u(r.activeCell);for(-1===e.colIndex&&(e.colIndex=e.endColumn,e.rowIndex--),e.rowIndex;e.rowIndex>=-1;e.rowIndex--){if(e.rowIndex<0&&e.colIndex<=0){if("Workbook"===e.args.mode){var o=this.parent.activeSheetIndex;if(-1===--e.sheetIndex&&(e.sheetIndex=n-1),o===e.sheetIndex&&0===e.count)return void this.parent.notify(Pt,null);t=(r=e.sheets[e.sheetIndex]).usedRange,a=u(r.activeCell),e.rowIndex=t.rowIndex,e.colIndex=t.colIndex,e.endColumn=0,e.endRow=0}i=this.commonCondition(e,a)}if(!i){"Workbook"!==e.args.mode&&e.count>0&&-1===e.rowIndex&&(e.rowIndex=e.endRow),-1===e.rowIndex&&(e.rowIndex=r.usedRange.rowIndex,e.colIndex=r.usedRange.colIndex);var s=r.rows[e.rowIndex];if(s){for(-1===e.colIndex&&(e.colIndex=r.usedRange.colIndex),e.colIndex;e.colIndex>=0;e.colIndex--)if(s&&s.cells&&s.cells[e.colIndex]&&this.prevCommon(e))return;if(e.loopCount>0&&a[0]===e.rowIndex)return void this.parent.notify(Pt,null)}}}if(!i&&0===e.count)return void this.parent.notify(Pt,null)},e.prototype.findPreCol=function(e){var t,r=e.sheets[e.sheetIndex],n=this.parent.sheets.length,i=!1,a=u(r.activeCell);for(e.colIndex;e.colIndex>=-1;e.colIndex--){if(e.rowIndex<0&&e.colIndex<=0){if("Workbook"===e.args.mode){var o=this.parent.activeSheetIndex;if(-1===--e.sheetIndex&&(e.sheetIndex=n-1),o===e.sheetIndex&&0===e.count)return void this.parent.notify(Pt,null);t=(r=e.sheets[e.sheetIndex]).usedRange,a=u(r.activeCell),e.rowIndex=t.rowIndex,e.colIndex=t.colIndex,e.endColumn=0,e.endRow=0}i=this.commonCondition(e,a)}if(!i){e.count>0&&e.colIndex<0&&(e.colIndex=e.endColumn),e.rowIndex<0&&(e.rowIndex=r.usedRange.rowIndex),e.colIndex<-1&&(e.colIndex=r.usedRange.colIndex,e.rowIndex--);var s=r.rows[e.rowIndex];for(s&&r.rows[e.rowIndex].cells[e.colIndex]&&-1===e.rowIndex&&(e.rowIndex=r.usedRange.rowIndex),e.rowIndex;e.rowIndex>=0;e.rowIndex--){if(s&&s.cells&&s.cells[e.colIndex]&&this.prevCommon(e))return;if(e.loopCount>0&&a[1]===e.colIndex)return void this.parent.notify(Pt,null)}}}if(!i&&0===e.count)return void this.parent.notify(Pt,null)},e.prototype.commonCondition=function(e,t){var r,n=e.sheets[e.sheetIndex];return t[0]!==e.endRow&&t[1]!==e.endColumn||t[0]!==e.endRow||t[1]!==e.endColumn?(e.startColumn=n.usedRange.colIndex,e.startRow=n.usedRange.rowIndex,e.endColumn=0,e.endRow=t[0],e.rowIndex=e.startRow,e.colIndex=e.startColumn,e.loopCount++,r=!1):(t[0]===n.usedRange.rowIndex&&t[1]===n.usedRange.colIndex||t[0]>n.usedRange.rowIndex||t[1]>n.usedRange.colIndex)&&0!==t[0]&&0!==t[1]&&(this.parent.notify(Pt,null),r=!0),r},e.prototype.prevCommon=function(e){var t=e.sheets[e.sheetIndex];if(t.rows[e.rowIndex]){var r=t.rows[e.rowIndex].cells[e.colIndex];if(r&&r.value){var n=t.rows[e.rowIndex].cells[e.colIndex];if(n){var i=void 0;if(i=n.format?this.parent.getDisplayText(t.rows[e.rowIndex].cells[e.colIndex]):t.rows[e.rowIndex].cells[e.colIndex].value.toString(),e.args.isCSen&&e.args.isEMatch){if(i===e.stringValue){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(e.args.isCSen&&!e.args.isEMatch){a=i.indexOf(e.args.value)>-1;if(i===e.stringValue||a){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(!e.args.isCSen&&e.args.isEMatch){if(e.val=i.toString().toLowerCase(),e.val===e.stringValue){s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}else if(!e.args.isCSen&&!e.args.isEMatch){e.val=i.toString().toLowerCase();var a=e.val.indexOf(e.args.value.toString().toLowerCase())>-1,o=e.val.indexOf(e.args.value)>-1;if(i===e.stringValue||i===e.stringValue||a||e.val===e.stringValue||o){var s=t.name+"!"+g(e.rowIndex,e.colIndex);return this.parent.notify(Mt,{address:s}),e.count++,!0}}}}}return!1},e.prototype.replace=function(e){if(this.parent.getActiveSheet().isProtected)return void this.parent.notify("editAlert",null);var t=this.parent.getActiveSheet(),r=u(t.activeCell),n=t.rows[r[0]].cells[r[1]].value.toString(),i=n.indexOf(e.value)>-1,a=n.toLowerCase().indexOf(e.value.toString().toLowerCase())>-1,o=n.toString().toLowerCase();n===e.value||i||o===e.value||a||(e.findOpt="next",this.findNext(e)),this.parent.getActiveSheet();var s,l=u(t.activeCell),h=t.activeCell,d=t.rows[l[0]].cells[l[1]],p=t.rows[l[0]].cells[l[1]].format,c=t.name+"!"+g(l[0],l[1]),f={undoRedoOpt:"before",address:c,compareVal:s=p?this.parent.getDisplayText(t.rows[l[0]].cells[l[1]]).toString():t.rows[l[0]].cells[l[1]].value.toString()};this.parent.notify("findUndoRedo",f);var m=s.toLowerCase(),v=s.indexOf(e.value)>-1,y=m.indexOf(e.value)>-1;if(e.value===s||e.value===m){t.rows[l[0]].cells[l[1]].value=e.replaceValue,this.parent.updateCell(d,h);var C={address:c,compareVal:e.replaceValue,undoRedoOpt:"after"};this.parent.notify("findUndoRedo",C)}else if(v){var b=s.replace(e.value,e.replaceValue);t.rows[l[0]].cells[l[1]].value=b,this.parent.updateCell(d,h);var x={address:c,compareVal:e.replaceValue,undoRedoOpt:"after"};this.parent.notify("findUndoRedo",x)}else if(y){var S=new RegExp(e.value.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"ig"),w=s.replace(S,e.replaceValue);t.rows[l[0]].cells[l[1]].value=w,this.parent.updateCell(d,h);var I={address:c,compareVal:e.replaceValue,undoRedoOpt:"after"};this.parent.notify("findUndoRedo",I)}},e.prototype.replaceAll=function(e){var t,r=0,n=this.parent.sheets[r],i=n.usedRange.rowIndex,a=0,o=0,s=n.usedRange.colIndex,l=0,h=[];for(o;o<=i;o++)if(l>s&&o===i&&"Workbook"===e.mode&&(r++,(n=this.parent.sheets[r])&&(l=0,o=0,s=n.usedRange.colIndex,i=n.usedRange.rowIndex)),n&&n.rows[o]){var d=n.rows[o];for(l===s+1&&(l=0),l;l<=s;l++){var p=n.rows[o].cells[l];if(d&&d.cells&&d.cells[l]&&d.cells[l].value){var c=n.rows[o].cells[l];if(c){var u=void 0;if(u=c.format?this.parent.getDisplayText(n.rows[o].cells[l]).toString():n.rows[o].cells[l].value.toString(),e.isCSen&&e.isEMatch)u===e.value&&(n.rows[o].cells[l].value=e.replaceValue,t=n.name+"!"+g(o,l),this.parent.updateCell(p,t),h.push(t),a++);else if(e.isCSen&&!e.isEMatch){m=u.indexOf(e.value)>-1;if(u===e.value||m){C=u.replace(e.value,e.replaceValue);n.rows[o].cells[l].value=C,t=n.name+"!"+g(o,l),this.parent.updateCell(p,t),h.push(t),a++}}else if(!e.isCSen&&e.isEMatch)(f=u.toString().toLowerCase())===e.value&&(n.rows[o].cells[l].value=e.replaceValue,t=n.name+"!"+g(o,l),this.parent.updateCell(p,t),h.push(t),a++);else if(!e.isCSen&&!e.isEMatch){var f=u.toString().toLowerCase(),m=f.indexOf(e.value.toString().toLowerCase())>-1,v=f.indexOf(e.value)>-1;if(u===e.value||m||f===e.value||u===e.value||v){var y=new RegExp(e.value.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"ig"),C=u.replace(y,e.replaceValue);n.rows[o].cells[l].value=C,t=n.name+"!"+g(o,l),this.parent.updateCell(p,t),h.push(t),a++}}}}}}var b={undoRedoOpt:"beforeReplaceAll",Collection:h,replaceValue:e.value};this.parent.notify("findUndoRedo",b),b={undoRedoOpt:"afterReplaceAll",Collection:h,replaceValue:e.replaceValue},this.parent.notify("findUndoRedo",b);var x=a;this.parent.notify("replaceAllDialog",{count:x,replaceValue:e.replaceValue})},e.prototype.totalCount=function(e){var t=this.parent.sheets[e.sheetIndex],r=t.usedRange.rowIndex,n=0,i=0,a=t.usedRange.colIndex,o=0;for(i;i<=r;i++)if(t.rows[i]){var s=t.rows[i];for(o===a+1&&(o=0),o;o<=a;o++)if(s&&s.cells&&s.cells[o]&&s.cells[o].value){var l=t.rows[i].cells[o];if(l){var h=void 0;if(h=l.format?this.parent.getDisplayText(t.rows[i].cells[o]).toString():l.value.toString(),e.isCSen&&e.isEMatch)h===e.value&&n++;else if(e.isCSen&&!e.isEMatch){d=h.indexOf(e.value)>-1;(h===e.value||d)&&n++}else if(!e.isCSen&&e.isEMatch)(g=h.toString().toLowerCase())===e.value&&n++;else if(!e.isCSen&&!e.isEMatch){var d=(g=h.toString().toLowerCase()).indexOf(e.value.toString().toLowerCase())>-1,p=g.indexOf(e.value)>-1;(g===e.value||h===e.value||d||h===e.value||p)&&n++}}}}var c=n;if((n=c-(this.requiredCount(e)-1))>c&&(n=c),0!==n){var f=u(t.activeCell),g=t.rows[f[0]]?this.parent.getDisplayText(t.rows[f[0]].cells[f[1]]).toString().toLowerCase():null;g&&-1===g.indexOf(e.value.toString().toLowerCase())&&(n-=1)}e.findCount=n+" of "+c},e.prototype.requiredCount=function(e){var t=this.parent.activeSheetIndex,r=this.parent.sheets[t],n=u(r.activeCell),i=r.usedRange.rowIndex,a=0,o=n[0],s=r.usedRange.colIndex,l=n[1];for(o;o<=i;o++)if(r.rows[o]){var h=r.rows[o];for(l===s+1&&(l=0),l;l<=s;l++)if(h&&h.cells&&h.cells[l]&&h.cells[l].value&&r.rows[o].cells[l]){var d=void 0;if(d=r.rows[o].cells[l].format?this.parent.getDisplayText(r.rows[o].cells[l]).toString():r.rows[o].cells[l].value.toString(),e.isCSen&&!e.isEMatch){f=d.indexOf(e.value)>-1;(d===e.value||f)&&a++}else if(e.isCSen&&e.isEMatch)d===e.value&&a++;else if(!e.isCSen&&e.isEMatch)(p=d.toString().toLowerCase())===e.value&&a++;else if(!e.isCSen&&!e.isEMatch){var p=d.toString().toLowerCase(),c=e.value.toString().toLowerCase(),f=p.indexOf(c)>-1,g=p.indexOf(e.value)>-1;(d===e.value||p===c||f||p===e.value||g)&&a++}}}return a},e.prototype.findAllValues=function(e){var r,n=e.sheetIndex,i=this.parent.sheets[n-1],a=i.usedRange.rowIndex,o=0,s=0,l=i.usedRange.colIndex,h=0,d=this.parent.sheets.length,p=e.sheetIndex;for(o;o<=a+1;o++){if(1!==p&&e.sheetIndex===d&&(n=1),o>a&&h>l&&"Workbook"===e.mode){if(n++,p===n)return void 0;n>d-1&&(n=0),(i=this.parent.sheets[n])&&(o=0,h=0,l=i.usedRange.colIndex,a=i.usedRange.rowIndex)}if(!t.isNullOrUndefined(i)&&i.rows[o]){var c=i.rows[o];for(h===l+2&&(h=0),h;h<=l+1;h++)if(c&&c.cells&&c.cells[h]){var u=i.rows[o].cells[h];if(u){var f=void 0;if(f=u.format?this.parent.getDisplayText(i.rows[o].cells[h]).toString():u.value.toString(),e.isCSen&&e.isEMatch)f===e.value&&(r=i.name+"!"+g(o,h),e.findCollection.push(r),s++);else if(e.isCSen&&!e.isEMatch){v=f.indexOf(e.value)>-1;(f===e.value||v)&&(r=i.name+"!"+g(o,h),e.findCollection.push(r),s++)}else if(!e.isCSen&&e.isEMatch)(m=f.toString().toLowerCase())===e.value&&(r=i.name+"!"+g(o,h),e.findCollection.push(r),s++);else if(!e.isCSen&&!e.isEMatch){var m=f.toString().toLowerCase(),v=m.indexOf(e.value.toLowerCase())>-1;(m===e.value||f===e.value||v||f===e.value)&&(r=i.name+"!"+g(o,h),e.findCollection.push(r),s++)}}}}}},e.prototype.getModuleName=function(){return"workbookfindAndReplace"},e}(),Xr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.protectsheetHandler=function(e){var r=this.parent.getActiveSheet();this.parent.setSheetPropertyOnMute(r,"protectSettings",{selectCells:e.selectCells,formatCells:e.formatCells,formatColumns:e.formatColumns,formatRows:e.formatRows,insertLink:e.insertLink}),this.parent.notify("protectSheet",r.protectSettings),this.parent.notify("updateToggleItem",{props:"Protect"}),r.columns.forEach(function(e){e&&t.isUndefined(e.isLocked)&&(e.isLocked=!0)})},e.prototype.unprotectsheetHandler=function(e){var t=this.parent.getActiveSheet();e.sheet&&(t=this.parent.sheets[e.sheet]),t.protectSettings.formatCells=t.protectSettings.formatColumns=!1,t.protectSettings.formatRows=t.protectSettings.selectCells=!1,this.parent.setSheetPropertyOnMute(t,"isProtected",!1),this.parent.notify("protectSheet",t.protectSettings),this.parent.notify("updateToggleItem",{props:"Protect"})},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("protectsheetHandler",this.protectsheetHandler,this),this.parent.on("unprotectsheetHandler",this.unprotectsheetHandler,this),this.parent.on("setLockCells",this.lockCells,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("protectsheetHandler",this.protectsheetHandler),this.parent.off("setLockCells",this.lockCells),this.parent.off("protectsheetHandler",this.unprotectsheetHandler))},e.prototype.lockCells=function(e){var t,r=this.parent.getActiveSheet(),n="object"==typeof(t=e?e.range:r.selectedRange)?t:S(c(t));if(0===n[0]&&n[2]===r.rowCount-1)for(i=n[1];i<=n[3];i++)Fe(r,i,{isLocked:e.isLocked});for(var i=n[0];i<=n[2];i++)for(var a=n[1];a<=n[3];a++)this.parent.getActiveSheet().id===r.id&&this.parent.notify("applyLockCells",{rowIdx:i,colIdx:a,isLocked:e.isLocked})},e.prototype.getModuleName=function(){return"workbookProtectSheet"},e}(),Kr=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.merge=function(e){e.isAction&&(this.parent.notify("actionBegin",{eventArgs:e,action:"merge"}),e.model||(e.model=[])),"string"==typeof e.range&&(e.range=c(e.range)),e.range=S(e.range),e.skipChecking||this.mergedRange(e),e.merge&&"All"!==e.type?"Horizontally"===e.type?this.mergeHorizontally(e):"Vertically"===e.type&&this.mergeVertically(e):(this.mergeAll(e),e.refreshRibbon&&this.parent.notify("activeCellChanged",null)),this.parent.setUsedRange(e.range[2],e.range[3]),e.isAction&&this.parent.notify("actionComplete",{eventArgs:e,action:"merge"});var t=e.sheet||this.parent.getActiveSheet();this.parent.sheets.indexOf(t)===this.parent.activeSheetIndex&&this.parent.notify("selectRange",{address:t.selectedRange,skipChecking:!0})},e.prototype.mergeAll=function(e){var t,r=0;e.range=e.range;for(var n,i,a,o=e.sheet||this.parent.getActiveSheet(),s=e.range[0];s<=e.range[2];s++){n=0,e.isAction&&e.model.push({cells:[]});for(var l=e.range[1];l<=e.range[3];l++){if((t=J(s,l,o))&&(t.value||t.formula)&&!i&&(i=t.formula||t.value),e.isAction&&e.merge&&(e.model[s-e.range[0]].cells[l-e.range[1]]={},Object.assign(e.model[s-e.range[0]].cells[l-e.range[1]],t)),o.rows[s]&&o.rows[s].cells&&o.rows[s].cells[l]&&(delete o.rows[s].cells[l].rowSpan,delete o.rows[s].cells[l].colSpan,!e.merge&&!e.isAction&&e.model&&e.model[s-e.range[0]]&&e.model[s-e.range[0]].cells[l-e.range[1]]&&e.model[s-e.range[0]].cells[l-e.range[1]]!=={}&&Q(s,l,o,e.model[s-e.range[0]].cells[l-e.range[1]])),e.merge){if(t=new Object,s===e.range[0]&&l===e.range[1]){e.range[3]-e.range[1]>0&&(t.colSpan=e.range[3]-e.range[1]+1),e.range[2]-e.range[0]>0&&(t.rowSpan=e.range[2]-e.range[0]+1),Q(e.range[0],e.range[1],o,t,!0);continue}s!==e.range[0]&&(t.rowSpan=-r),l!==e.range[1]&&(n++,t.colSpan=-n),o.rows[s]&&o.rows[s].cells&&o.rows[s].cells[l]&&(delete o.rows[s].cells[l].value,delete o.rows[s].cells[l].formula),a=J(s,l,o)||{},Q(s,l,o,Object.assign(t,a))}e.preventRefresh||this.parent.notify("applyMerge",{rowIdx:s,colIdx:l})}r++}e.merge&&(t=this.getCellValue(e.range[0],e.range[1],i,o),Q(e.range[0],e.range[1],o,t,!0),e.preventRefresh||this.parent.notify("applyMerge",{rowIdx:e.range[0],colIdx:e.range[1]}))},e.prototype.mergeHorizontally=function(e){var t;e.range=e.range;for(var r,n,i,a,o=e.sheet||this.parent.getActiveSheet(),s=e.range[0];s<=e.range[2];s++){t=0,e.isAction&&e.model.push({cells:[]});for(var l=e.range[1];l<=e.range[3];l++){if(a=J(s,l,o),r=new Object,e.isAction&&(e.model[s-e.range[0]].cells[l-e.range[1]]={},Object.assign(e.model[s-e.range[0]].cells[l-e.range[1]],a)),l===e.range[1]){if(s===e.range[0])continue;i=s-1,o.rows[i]&&o.rows[i].cells&&o.rows[i].cells[l]&&delete o.rows[i].cells[l].rowSpan,r=this.getCellValue(i,l,n,o),e.range[3]-e.range[1]>0&&(r.colSpan=e.range[3]-e.range[1]+1),n=null,Q(i,l,o,r,!0)}else a&&(a.value||a.formula)&&!n&&(n=a.formula||a.value),i=s,o.rows[i]&&o.rows[i].cells&&o.rows[i].cells[l]&&(delete o.rows[i].cells[l].rowSpan,delete o.rows[i].cells[l].value,delete o.rows[i].cells[l].formula),t++,r.colSpan=-t,Q(i,l,o,r,!0);this.parent.notify("applyMerge",{rowIdx:i,colIdx:l})}}o.rows[e.range[2]]&&o.rows[e.range[2]].cells&&o.rows[e.range[2]].cells[e.range[1]]&&delete o.rows[e.range[2]].cells[e.range[1]].rowSpan,r=this.getCellValue(e.range[2],e.range[1],n,o),e.range[3]-e.range[1]>0&&(r.colSpan=e.range[3]-e.range[1]+1),Q(e.range[2],e.range[1],o,r,!0),this.parent.notify("applyMerge",{rowIdx:e.range[2],colIdx:e.range[1]})},e.prototype.getCellValue=function(e,t,r,n){var i=new Object,a=J(e,t,n);return!r||a&&(a.value||a.formula)||(q(r)?i.formula=r:i.value=r),i},e.prototype.mergeVertically=function(e){var t=0;e.range=e.range;for(var r,n,i,a,o=e.sheet||this.parent.getActiveSheet(),s=e.range[1];s<=e.range[3];s++)for(var l=e.range[0];l<=e.range[2];l++){if(a=J(l,s,o),e.isAction&&(void 0===e.model[l-e.range[0]]&&(e.model[l-e.range[0]]={cells:[]}),e.model[l-e.range[0]].cells[s-e.range[1]]={},Object.assign(e.model[l-e.range[0]].cells[s-e.range[1]],a)),l===e.range[0]){if(t=0,s===e.range[1])continue;i=s-1,o.rows[l]&&o.rows[l].cells&&o.rows[l].cells[i]&&delete o.rows[l].cells[i].colSpan,r=this.getCellValue(l,i,n,o),e.range[2]-e.range[0]>0&&(r.rowSpan=e.range[2]-e.range[0]+1),n=null,Q(l,i,o,r,!0)}else r=new Object,a&&(a.value||a.formula)&&!n&&(n=a.formula||a.value),t++,i=s,o.rows[l]&&o.rows[l].cells&&o.rows[l].cells[i]&&(delete o.rows[l].cells[i].colSpan,delete o.rows[l].cells[i].value,delete o.rows[l].cells[i].formula),r.rowSpan=-t,Q(l,i,o,r,!0);this.parent.notify("applyMerge",{rowIdx:l,colIdx:i})}o.rows[e.range[0]]&&o.rows[e.range[0]].cells&&o.rows[e.range[0]].cells[e.range[3]]&&delete o.rows[e.range[0]].cells[e.range[3]].colSpan,r=this.getCellValue(e.range[0],e.range[1],n,o),e.range[2]-e.range[0]>0&&(r.rowSpan=e.range[2]-e.range[0]+1),Q(e.range[0],e.range[3],o,r,!0),this.parent.notify("applyMerge",{rowIdx:e.range[0],colIdx:e.range[3]})},e.prototype.activeCellRange=function(e){e.range=e.range;var r=this.parent.getActiveSheet(),n=J(e.range[0],e.range[1],r);n&&(!t.isNullOrUndefined(n.rowSpan)&&n.rowSpan<0&&(e.range[0]+=n.rowSpan,e.insertCount&&(e.range[0]-=e.insertCount)),!t.isNullOrUndefined(n.colSpan)&&n.colSpan<0&&(e.range[1]+=n.colSpan,e.insertCount&&(e.range[1]-=e.insertCount)),(n=J(e.range[0],e.range[1],r))&&(n.rowSpan>1&&(e.range[0]+(n.rowSpan-1)>=e.range[2]||e.insertCount)&&(e.range[2]=e.range[0]+(n.rowSpan-1)),n.colSpan>1&&(e.range[1]+(n.colSpan-1)>=e.range[3]||e.insertCount)&&(e.range[3]=e.range[1]+(n.colSpan-1))))},e.prototype.mergedRange=function(e){"string"==typeof e.range&&(e.range=c(e.range)),e.range[0]<=e.range[2]&&e.range[1]<=e.range[3]?this.forward(e):e.range[0]>=e.range[2]&&e.range[1]>=e.range[3]?this.reverse(e):e.range[0]<e.range[2]&&e.range[1]>e.range[3]?this.forwardReverse(e):e.range[0]>e.range[2]&&e.range[1]<e.range[3]&&this.reverseForward(e)},e.prototype.forward=function(e){e.range=e.range;var r,n,i=e.sheet||this.parent.getActiveSheet(),a=J(e.range[0],e.range[1],i),o=r=e.range[0],s=n=e.range[1];if(a&&(!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(o=r=e.range[0]+a.rowSpan),!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(s=n=e.range[1]+a.colSpan),(a=J(o,s,i))&&(a.rowSpan>1&&(r+=a.rowSpan-1,o+(a.rowSpan-1)>=e.range[2]&&(e.range[2]=e.range[0],e.range[2]=o+(a.rowSpan-1))),a.colSpan>1&&(n+=a.colSpan-1,s+(a.colSpan-1)>=e.range[3]&&(e.range[3]=e.range[1],e.range[3]=s+(a.colSpan-1))))),e.range[0]=o,e.range[1]=s,e.range[0]===o&&e.range[1]===s&&e.range[2]===r&&e.range[3]===n&&(e.isActiveCell=!0),!e.skipChecking){for(d=e.range[1];d<=e.range[3];d++)(a=J(e.range[2],d,i))&&(o=e.range[2],s=d,!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(s+=a.colSpan)<e.range[1]&&(e.range[1]=s),!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(o+=a.rowSpan)<e.range[0]&&(e.range[0]=o),(a=J(o,s,i))&&(a.colSpan>1&&s+(a.colSpan-1)>e.range[3]&&(e.range[3]=s,e.range[3]=s+(a.colSpan-1)),a.rowSpan>1&&o+(a.rowSpan-1)>e.range[2]&&(e.range[2]=o,e.range[2]=o+(a.rowSpan-1))));for(var l,h,d=e.range[1];d<=e.range[3];d++)(a=J(e.range[0],d,i))&&(h=d,l=e.range[0],!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(h+=a.colSpan)<e.range[1]&&(e.range[1]=h),!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(l+=a.rowSpan)<e.range[0]&&(e.range[0]=l));for(d=e.range[0];d<=e.range[2];d++)(a=J(d,e.range[3],i))&&(o=d,s=e.range[3],!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(o+=a.rowSpan)<e.range[0]&&(e.range[0]=o),!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(s+=a.colSpan)<e.range[1]&&(e.range[1]=s),(a=J(o,s,i))&&(a.rowSpan>1&&o+(a.rowSpan-1)>e.range[2]&&(e.range[2]=o,e.range[2]=o+(a.rowSpan-1)),a.colSpan>1&&s+(a.colSpan-1)>e.range[3]&&(e.range[3]=s,e.range[3]=s+(a.colSpan-1))))}},e.prototype.forwardReverse=function(e){var r=this.parent.getActiveSheet();e.range=e.range;var n=e.range[1],i=J(e.range[0],e.range[1],r),a=e.range[0];if(i&&(!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(n+=i.colSpan,e.range[3]>=n&&(e.range[3]=n)),!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(a+=i.rowSpan)<e.range[0]&&(e.range[0]=a),(i=J(a,n,r))&&(i.rowSpan>1&&a+(i.rowSpan-1)>=e.range[2]&&(e.range[2]=a+(i.rowSpan-1)),i.colSpan>1&&n+(i.colSpan-1)>=e.range[1]&&(e.range[1]=n+(i.colSpan-1)))),e.range[0]=a,!e.skipChecking){for(var o,s,l=e.range[3];l<=e.range[1];l++)(i=J(e.range[2],l,r))&&(s=l,o=e.range[2],!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(o+=i.rowSpan)<e.range[0]&&(e.range[0]=o),!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(s+=i.colSpan)<e.range[3]&&(e.range[3]=s),(i=J(o,s,r))&&(i.rowSpan>1&&o+(i.rowSpan-1)>e.range[2]&&(e.range[2]=o+(i.rowSpan-1)),i.colSpan>1&&s+(i.colSpan-1)>e.range[1]&&(e.range[1]=s+(i.colSpan-1))));for(var h,l=e.range[3];l<=e.range[1];l++)(i=J(e.range[0],l,r))&&(s=l,h=e.range[0],!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(h+=i.rowSpan)<e.range[0]&&(e.range[0]=h),!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(s+=i.colSpan),(i=J(h,s,r))&&(i.rowSpan>1&&h+(i.rowSpan-1)>e.range[2]&&(e.range[2]=h+(i.rowSpan-1)),i.colSpan>1&&s+(i.colSpan-1)>e.range[1]&&(e.range[1]=s,e.range[1]=s+(i.colSpan-1))));for(var d,l=e.range[0];l<=e.range[2];l++)(i=J(l,e.range[3],r))&&(h=l,d=e.range[3],!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(h+=i.rowSpan)<e.range[0]&&(e.range[0]=h),!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(d+=i.colSpan)<e.range[3]&&(e.range[3]=d),(i=J(h,d,r))&&(i.rowSpan>1&&h+(i.rowSpan-1)>e.range[2]&&(e.range[2]=h,e.range[2]=h+(i.rowSpan-1)),i.colSpan>1&&d+(i.colSpan-1)>e.range[1]&&(e.range[1]=d,e.range[1]=d+(i.colSpan-1))))}},e.prototype.reverse=function(e){e.range=e.range;var r=e.range[1],n=e.sheet||this.parent.getActiveSheet(),i=J(e.range[0],e.range[1],n),a=e.range[0];i&&(!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(r+=i.colSpan),!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(a+=i.rowSpan),e.range[2]>=a&&(e.range[2]=a,e.isActiveCell=!0),e.range[3]>=r?(e.range[3]=r,e.range[2]===a&&(e.isActiveCell=!0)):e.isActiveCell&&(e.isActiveCell=!1),(i=J(a,r,n))&&(i.rowSpan>1&&a+(i.rowSpan-1)>=e.range[0]&&(e.range[0]=a,e.range[0]=a+(i.rowSpan-1)),i.colSpan>1&&r+(i.colSpan-1)>=e.range[1]&&(e.range[1]=r,e.range[1]=r+(i.colSpan-1))));var o=e.range[3];if(!e.skipChecking){for(h=e.range[3];h<=e.range[1];h++)(i=J(e.range[2],h,n))&&(o=h,a=e.range[2],!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(a+=i.rowSpan)<e.range[2]&&(e.range[2]=a),!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(o+=i.colSpan)<e.range[3]&&(e.range[3]=o),(i=J(a,o,n))&&(i.rowSpan>1&&a+(i.rowSpan-1)>e.range[0]&&(e.range[0]=a,e.range[0]=a+(i.rowSpan-1)),i.colSpan>1&&o+(i.colSpan-1)>e.range[1]&&(e.range[1]=o,e.range[1]=o+(i.colSpan-1))));o=e.range[3];for(h=e.range[3];h<=e.range[1];h++)(i=J(e.range[0],h,n))&&(o=h,a=e.range[0],!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(o+=i.colSpan),!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(a+=i.rowSpan),(i=J(a,o,n))&&(i.colSpan>1&&o+(i.colSpan-1)>e.range[1]&&(e.range[1]=o,e.range[1]=o+(i.colSpan-1)),i.rowSpan>1&&a+(i.rowSpan-1)>e.range[0]&&(e.range[0]=a,e.range[0]=a+(i.rowSpan-1))));for(var s,l,h=e.range[2];h<=e.range[0];h++)(i=J(h,e.range[3],n))&&(l=h,s=e.range[3],!t.isNullOrUndefined(i.rowSpan)&&i.rowSpan<0&&(l+=i.rowSpan)<e.range[2]&&(e.range[2]=l),!t.isNullOrUndefined(i.colSpan)&&i.colSpan<0&&(s+=i.colSpan)<e.range[3]&&(e.range[3]=s),(i=J(l,s,n))&&(i.rowSpan>1&&l+(i.rowSpan-1)>e.range[0]&&(e.range[0]=l,e.range[0]=l+(i.rowSpan-1)),i.colSpan>1&&s+(i.colSpan-1)>e.range[1]&&(e.range[1]=s,e.range[1]=s+(i.colSpan-1))))}},e.prototype.reverseForward=function(e){e.range=e.range;var r=e.sheet||this.parent.getActiveSheet(),n=e.range[0],i=e.range[1],a=J(e.range[0],e.range[1],r);if(a&&(!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(n+=a.rowSpan,e.range[2]>=n&&(e.range[2]=n)),!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(i+=a.colSpan),(a=J(n,i,r))&&(a.rowSpan>1&&n+(a.rowSpan-1)>=e.range[0]&&(e.range[0]=n,e.range[0]=n+(a.rowSpan-1)),a.colSpan>1&&i+(a.colSpan-1)>=e.range[3]&&(e.range[3]=e.range[1],e.range[3]=i+(a.colSpan-1)))),!e.skipChecking){for(var o,s=e.range[3],l=e.range[1];l<=e.range[3];l++)(a=J(e.range[2],l,r))&&(o=e.range[2],s=l,!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(o+=a.rowSpan)<e.range[2]&&(e.range[2]=o),!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(s+=a.colSpan)<e.range[1]&&(e.range[1]=s),(a=J(o,s,r))&&(a.colSpan>1&&s+(a.colSpan-1)>e.range[3]&&(e.range[3]=s+(a.colSpan-1)),a.rowSpan>1&&a.rowSpan-1+o>e.range[0]&&(e.range[0]=a.rowSpan-1+o)));for(var h,d,l=e.range[1];l<=e.range[3];l++)(a=J(e.range[0],l,r))&&(d=l,h=e.range[0],!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(d+=a.colSpan)<e.range[1]&&(e.range[1]=d),!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(h+=a.rowSpan),(a=J(h,d,r))&&a.rowSpan>1&&h+(a.rowSpan-1)>e.range[0]&&(e.range[0]=h+(a.rowSpan-1)));for(var p,l=e.range[2];l<=e.range[0];l++)(a=J(l,e.range[3],r))&&(o=l,p=e.range[3],!t.isNullOrUndefined(a.rowSpan)&&a.rowSpan<0&&(o+=a.rowSpan)<e.range[2]&&(e.range[2]=o),!t.isNullOrUndefined(a.colSpan)&&a.colSpan<0&&(p+=a.colSpan)<e.range[1]&&(e.range[1]=p),(a=J(o,p,r))&&(a.rowSpan>1&&a.rowSpan-1+o>e.range[0]&&(e.range[0]=a.rowSpan-1+o),a.colSpan>1&&a.colSpan-1+p>e.range[3]&&(e.range[3]=p,e.range[3]=a.colSpan-1+p)))}},e.prototype.insertHandler=function(e){this.activeCellRange(e),e.range=e.range,"Row"===e.insertModel?e.range[2]+=e.insertCount:e.range[3]+=e.insertCount,e.preventRefresh=!0,e.merge=!0,this.mergeAll(e)},e.prototype.pasteHandler=function(e){for(var t,r,n,i=this.parent.getActiveSheet(),a=u(i.activeCell),o=e.range[0],s=0;o<=e.range[2];o++,s++)for(var l=e.range[1],h=0;l<=e.range[3];l++,h++){if((t=J(o,l,e.prevSheet)||{}).rowSpan>1&&(n=J(a[0]+(t.rowSpan-1),a[1],i)||{},r=J(a[0]+1,a[1],i)||{},void 0!==n.colSpan&&n.colSpan<0||void 0!==r.colSpan&&r.colSpan<0))return e.cancel=!0,void this.parent.notify("applyMerge",{showDialog:!0});if(t.colSpan>1&&(n=J(a[0],a[1]+(t.colSpan-1),i)||{},r=J(a[0],a[1]+1,i)||{},void 0!==n.rowSpan&&n.rowSpan<0||void 0!==r.rowSpan&&r.rowSpan<0))return e.cancel=!0,void this.parent.notify("applyMerge",{showDialog:!0})}},e.prototype.addEventListener=function(){this.parent.on(Vt,this.merge,this),this.parent.on("mergedRange",this.mergedRange,this),this.parent.on("activeCellMergedRange",this.activeCellRange,this),this.parent.on("insertMerge",this.insertHandler,this),this.parent.on("pasteMerge",this.pasteHandler,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Vt,this.merge),this.parent.off("mergedRange",this.mergedRange),this.parent.off("activeCellMergedRange",this.activeCellRange),this.parent.off("insertMerge",this.insertHandler),this.parent.off("pasteMerge",this.pasteHandler))},e.prototype.getModuleName=function(){return"workbookmerge"},e}(),$r=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on(zt,this.setCFrulHandler,this),this.parent.on(qt,this.clearRules,this),this.parent.on(Kt,this.cFUndoHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(zt,this.setCFrulHandler),this.parent.off(qt,this.clearRules),this.parent.off(Kt,this.cFUndoHandler))},e.prototype.setCFrulHandler=function(e){var t=e.conditionalFormat,r=t.range,n=e.isUndoRedo?e.sheetIdx:this.parent.getAddressInfo(r).sheetIndex,i=fe(this.parent,n),a=S(c(r=r||i.selectedRange));t.range=m(a),i.conditionalFormats||this.parent.setSheetPropertyOnMute(i,"conditionalFormats",[]);var o=i.conditionalFormats.length;if(i.conditionalFormats[o]=t,e.isUndoRedo&&n!==this.parent.activeSheetIndex)return void this.parent.notify(Mt,{address:i.name+"!"+t.range});for(var s=a[0];s<=a[2];s++){i.rows[s]||Ie(i,s,{});for(var l=a[1];l<=a[3];l++)if(i.rows[s].cells&&i.rows[s].cells[l]||Q(s,l,i,{}),n===this.parent.activeSheetIndex){var h=i.rows[s].cells[l];this.parent.notify("cFInitialCheck",{rowIdx:s,colIdx:l,cell:h,conditionalFormat:t,isAction:e.isAction})}}},e.prototype.clearRules=function(e){var r,n,i,a,o,s,l,h,d=!!t.isNullOrUndefined(e.isPublic),p=[],u=[],f=!0,g=e.range,v=e.isUndoRedo?e.sheetIdx:this.parent.getAddressInfo(g).sheetIndex,y=fe(this.parent,v),C=y.conditionalFormats,b=c(g);if(v===this.parent.activeSheetIndex)for(var x=b[0];x<=b[2];x++)for(var S=b[1];S<=b[3];S++)this.parent.notify("clearCF",{rIdx:x,cIdx:S});if(C){for(var w=C.length-1;w>=0;w--){var I=!1,E="",R=C[w],k=R.range.split(",");if(v===this.parent.activeSheetIndex&&(e.isClearCF||!e.isUndoRedo))for(var A=0;A<k.length;A++){var T=!1,F=c(k[A]);l=F[0],h=F[0],o=F[1],s=F[1],F[0]>=b[0]&&F[2]<=b[2]&&F[1]>=b[1]&&F[3]<=b[3]&&(T=!0);for(var L=F[0];L<=F[2];L++){for(var N=0,D=F[1];D<=F[3];D++)for(var O=b[0];O<=b[2];O++)for(var H=b[1];H<=b[3];H++)if(O===L&&H===D){var B=this.parent.getCellStyleValue(["backgroundColor","color"],[O,H]);this.parent.notify(Ft,{style:B,rowIdx:O,colIdx:H,lastCell:!0,isHeightCheckNeeded:!0,manualUpdate:!0}),N+=1,I=!0,O===F[0]?H===F[3]?o===F[1]?s===H?s=H:o=H-1:o!==F[1]&&s+1===H?(s=F[1],o-=1):o!==F[1]&&s===F[1]&&(o=b[1]-1):H===F[1]?s===F[1]&&(s=H+1):o===F[1]&&s===F[1]?(o=H,s=H):s=o===F[1]&&s!==F[1]?H+1:H:H===F[1]?s===F[1]&&F[1]!==F[3]&&(s=H+1):H===F[3]?o===F[1]?s===H?s=H:o=H-1:o!==F[1]&&s===F[1]?o=b[1]-1:o!==F[1]&&s+1===H?(s=F[1],o=b[1]-1):h=O:o===F[1]&&s===F[1]?(o=H,s=H):s!==F[1]&&o!==F[1]?s=H:o!==F[1]&&s===F[1]?o=H:s=H+1}N>0&&!T?(f&&(r=l,n=h,i=o,a=s),o===F[1]&&s!==F[1]?s===F[3]?(l!==L&&(E=E+" "+m([l,i,n,F[3]])),o===F[1]&&s===F[3]&&(L===F[2]?F[1]===b[3]&&(E=E+" "+m([L,s,L,F[3]])):(b[2]===F[0]&&s!==F[3]&&(E=E+" "+m([L,s,L,F[3]])),l=L+1,h=L+1,s=F[1]))):a!==s?(E=E+" "+m([l,a,L-1,F[3]]),s===F[3]&&o===F[1]?(l=L+1,h=L+1,s=F[1]):(l=L,h=L),s===F[3]&&o!==F[1]&&(o=F[1])):i!==o?(E=E+" "+m([l,F[1],L-1,i]),l=L+1,h=L+1,o=F[1],s=F[1]):L===F[2]?E=E+" "+m([l,s,L,F[3]]):(h<L||o===F[1]&&s===F[3])&&(h=L):s===F[1]&&o!==F[1]?(a!==s&&(E=E+" "+m([l,a,L-1,F[3]]),l=L,h=L),i!==o&&(E=E+" "+m([l,i,L-1,F[3]]),l=L,h=L),L===F[2]?E=E+" "+m([l,s,L,o]):h=L):s!==F[1]&&o!==F[1]?L===F[2]&&F[2]===b[0]?E=F[0]===F[2]?(E=E+" "+m([l,F[1],h,o-1]))+" "+m([l,s+1,h,F[3]]):(E=(E=E+" "+m([l,F[1],h,F[3]]))+" "+m([F[2],F[1],F[2],o-1]))+" "+m([F[2],s+1,F[2],F[3]]):L===F[2]?E=(E=E+" "+m([l,F[1],L,o-1]))+" "+m([l,s+1,L,F[3]]):(i===F[1]&&a===F[1]&&(E=E+" "+m([l,i,h,F[3]]),l=L),h=L):o===F[1]&&s===F[1]&&(b[2]!==F[0]?(F[2]>=b[2]&&L>b[2]&&(E=E+" "+m([l,o,h,F[3]])),F[1]===F[3]&&L<=F[2]&&r!==F[2]&&L!==r&&(E=E+" "+m([l,o,h,F[3]])),F[1]===F[3]&&(l=L+1,h=L+1)):((L===F[2]||L===F[0]&&F[1]!==F[3])&&(E=E+" "+m([l,o,h,s])),l=L+1,h=L+1),L===F[2]&&F[0]!==F[2]&&F[1]!==F[3]&&(E=E+" "+m([L,o,L,s]))),f||(r=l,n=h<=F[2]?h:F[2],i=o,a=s<=F[3]?s:F[3]),f=!1):T||(f&&(r=l,n=h,i=o,a=s),o===F[1]&&s===F[1]&&(L===F[2]&&(E=E+" "+m([l,o,L,F[3]])),h=L),s!==F[1]&&o!==F[1]&&(E=(E=E+" "+m([l,F[1],L-1,o-1]))+" "+m([l,s+1,L-1,F[3]]),l=L,h=L,o=F[1],s=F[1]),s!==F[1]&&o===F[1]&&(E=E+" "+m([l,s,L-1,F[3]]),l=L,h=L,o=F[1],s=F[1]),o!==F[1]&&s===F[1]&&(E=E+" "+m([l,s,L-1,o]),l=L,h=L,o=F[1],s=F[1]),f||(r=l,n=h<=F[2]?h:F[2],i=o,a=s<=F[3]?s:F[3]),f=!1)}}if(""===E?(u.push(y.conditionalFormats[w].range),y.conditionalFormats.splice(w,1)):(u.push(y.conditionalFormats[w].range),y.conditionalFormats[w].range=E.trim().replace(" ",",")),I&&!d&&(R.range=E.trim().replace(" ",","),p.push(R)),e.isUndoRedo){this.parent.activeSheetIndex!==e.sheetIdx&&this.parent.notify(Mt,{address:y.name+"!"+e.range});break}}if(!d){var M={cFormats:p,oldRange:u,selectedRange:g,sheetIdx:v};this.parent.notify(pr,{eventArgs:M,action:"clearCF"})}e.isclearFormat||this.parent.notify("addHighlight",{range:g,isclearFormat:!0})}},e.prototype.cFUndoHandler=function(e){if(e.sheetIdx===this.parent.activeSheetIndex)for(var t=e.conditionalFormat,r=t.range.split(","),n=fe(this.parent,e.sheetIdx),i=0;i<r.length;i++)for(var a=c(r[i]),o=a[0];o<=a[2];o++)for(var s=a[1];s<=a[3];s++){var l=n.rows[o].cells[s];this.parent.notify("cFInitialCheck",{rowIdx:o,colIdx:s,cell:l,conditionalFormat:t,isAction:!0})}},e.prototype.getModuleName=function(){return"workbookConditionalFormatting"},e}(),Zr=function(){function e(){Nn.Inject(Zt,Ir,xr,$t,Vr,zr,Br,Mr,qr,Pr,jr,Wr,Yr,Xr,Gr,Kr,$r,_r,Ur)}return e.prototype.getModuleName=function(){return"workbookBasic"},e.prototype.destroy=function(){},e}(),Jr=function(){function e(){Nn.Inject(Zt,Ir,$t,Vr,zr,Br,xr,Mr,qr,Pr,jr,Wr,Yr,Xr,Gr,Kr,$r,_r,Ur)}return e.prototype.getModuleName=function(){return"workbook-all"},e.prototype.destroy=function(){},e}(),Qr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),en=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},tn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("Calibri")],r.prototype,"fontFamily",void 0),en([t.Property("bottom")],r.prototype,"verticalAlign",void 0),en([t.Property("left")],r.prototype,"textAlign",void 0),en([t.Property("0pt")],r.prototype,"textIndent",void 0),en([t.Property("#000000")],r.prototype,"color",void 0),en([t.Property("#ffffff")],r.prototype,"backgroundColor",void 0),en([t.Property("normal")],r.prototype,"fontWeight",void 0),en([t.Property("normal")],r.prototype,"fontStyle",void 0),en([t.Property("11pt")],r.prototype,"fontSize",void 0),en([t.Property("none")],r.prototype,"textDecoration",void 0),en([t.Property("")],r.prototype,"border",void 0),en([t.Property("")],r.prototype,"borderTop",void 0),en([t.Property("")],r.prototype,"borderBottom",void 0),en([t.Property("")],r.prototype,"borderLeft",void 0),en([t.Property("")],r.prototype,"borderRight",void 0),r}(t.ChildProperty),rn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property()],r.prototype,"sheetIndex",void 0),en([t.Property()],r.prototype,"filterRange",void 0),en([t.Property(!1)],r.prototype,"hasFilter",void 0),en([t.Property()],r.prototype,"column",void 0),en([t.Property()],r.prototype,"criteria",void 0),en([t.Property()],r.prototype,"value",void 0),en([t.Property()],r.prototype,"dataType",void 0),en([t.Property()],r.prototype,"predicates",void 0),r}(t.ChildProperty),nn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property()],r.prototype,"sortRange",void 0),en([t.Property()],r.prototype,"columnIndex",void 0),en([t.Property()],r.prototype,"order",void 0),en([t.Property()],r.prototype,"sheetIndex",void 0),r}(t.ChildProperty),an=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("")],r.prototype,"name",void 0),en([t.Property("")],r.prototype,"scope",void 0),en([t.Property("")],r.prototype,"comment",void 0),en([t.Property("")],r.prototype,"refersTo",void 0),r}(t.ChildProperty),on=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property(!1)],r.prototype,"selectCells",void 0),en([t.Property(!1)],r.prototype,"formatCells",void 0),en([t.Property(!1)],r.prototype,"formatRows",void 0),en([t.Property(!1)],r.prototype,"formatColumns",void 0),en([t.Property(!1)],r.prototype,"insertLink",void 0),r}(t.ChildProperty),sn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("")],r.prototype,"address",void 0),r}(t.ChildProperty),ln=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("WholeNumber")],r.prototype,"type",void 0),en([t.Property("Between")],r.prototype,"operator",void 0),en([t.Property("0")],r.prototype,"value1",void 0),en([t.Property("0")],r.prototype,"value2",void 0),en([t.Property(!0)],r.prototype,"ignoreBlank",void 0),en([t.Property(!0)],r.prototype,"inCellDropDown",void 0),en([t.Property(!1)],r.prototype,"isHighlighted",void 0),r}(t.ChildProperty),hn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("General")],r.prototype,"format",void 0),en([t.Complex({},tn)],r.prototype,"style",void 0),en([t.Property(!0)],r.prototype,"isLocked",void 0),r}(t.ChildProperty),dn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("GreaterThan")],r.prototype,"type",void 0),en([t.Complex({},hn)],r.prototype,"format",void 0),en([t.Property("RedFT")],r.prototype,"cFColor",void 0),en([t.Property("")],r.prototype,"value",void 0),en([t.Property("")],r.prototype,"range",void 0),r}(t.ChildProperty),pn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property(!0)],r.prototype,"visible",void 0),en([t.Property("Auto")],r.prototype,"position",void 0),r}(t.ChildProperty),cn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property(!1)],r.prototype,"visible",void 0),en([t.Property("Auto")],r.prototype,"position",void 0),r}(t.ChildProperty),un=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property(0)],r.prototype,"width",void 0),r}(t.ChildProperty),fn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property(0)],r.prototype,"width",void 0),r}(t.ChildProperty),gn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("")],r.prototype,"title",void 0),en([t.Complex({},un)],r.prototype,"majorGridLines",void 0),en([t.Complex({},fn)],r.prototype,"minorGridLines",void 0),en([t.Property(!0)],r.prototype,"visible",void 0),r}(t.ChildProperty),mn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("Line")],r.prototype,"type",void 0),en([t.Property("Material")],r.prototype,"theme",void 0),en([t.Property(!1)],r.prototype,"isSeriesInRows",void 0),en([t.Property("")],r.prototype,"range",void 0),en([t.Property("")],r.prototype,"id",void 0),en([t.Property("")],r.prototype,"title",void 0),en([t.Property(290)],r.prototype,"height",void 0),en([t.Property(480)],r.prototype,"width",void 0),en([t.Property(0)],r.prototype,"top",void 0),en([t.Property(0)],r.prototype,"left",void 0),en([t.Complex({},pn)],r.prototype,"legendSettings",void 0),en([t.Complex({},gn)],r.prototype,"primaryXAxis",void 0),en([t.Complex({},gn)],r.prototype,"primaryYAxis",void 0),en([t.Complex({},cn)],r.prototype,"dataLabelSettings",void 0),r}(t.ChildProperty),vn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Qr(r,e),en([t.Property("")],r.prototype,"src",void 0),en([t.Property("")],r.prototype,"id",void 0),en([t.Property(300)],r.prototype,"height",void 0),en([t.Property(400)],r.prototype,"width",void 0),en([t.Property(0)],r.prototype,"top",void 0),en([t.Property(0)],r.prototype,"left",void 0),r}(t.ChildProperty),yn="spreadsheetLocale",Cn={SortOutOfRangeError:"Select a cell or range inside the used range and try again."},bn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xn=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Sn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return bn(r,e),xn([t.Collection([],vn)],r.prototype,"image",void 0),xn([t.Collection([],mn)],r.prototype,"chart",void 0),xn([t.Property("")],r.prototype,"value",void 0),xn([t.Property("")],r.prototype,"formula",void 0),xn([t.Property(0)],r.prototype,"index",void 0),xn([t.Property("General")],r.prototype,"format",void 0),xn([t.Complex({},tn)],r.prototype,"style",void 0),xn([t.Property("")],r.prototype,"hyperlink",void 0),xn([t.Property(!1)],r.prototype,"wrap",void 0),xn([t.Property(!0)],r.prototype,"isLocked",void 0),xn([t.Property("")],r.prototype,"validation",void 0),xn([t.Property(1)],r.prototype,"colSpan",void 0),xn([t.Property(1)],r.prototype,"rowSpan",void 0),r}(t.ChildProperty),wn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),In=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},En=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return wn(r,e),r.prototype.setProperties=function(t,r){var n=this;if(this.parentObj.isComplexArraySetter&&this.controlParent&&this.controlParent.isAngular)if(Object.keys(t).length){void 0===this.parentObj.currRangeIdx?this.parentObj.currRangeIdx=0:this.parentObj.currRangeIdx+=1;var i=this.parentObj.ranges[this.parentObj.currRangeIdx];i&&i.info&&(this.info=i.info),setTimeout(function(){void 0!==n.parentObj.currRangeIdx&&delete n.parentObj.currRangeIdx})}else if(this.controlParent.tagObjects[0].instance&&this.controlParent.tagObjects[0].instance.hasChanges&&!this.controlParent.tagObjects[0].instance.isInitChanges){var a=this.controlParent.sheets.indexOf(this.parentObj);if(void 0===this.parentObj.changedRangeIdx){for(var o,s=this.controlParent.tagObjects[0].instance.list[a].tagObjects,l=0;l<s.length;l++)if("ranges"===s[l].name){s[l].instance.list.forEach(function(e,t){e.hasChanges&&(o=t)});break}this.parentObj.changedRangeIdx=o}}e.prototype.setProperties.call(this,t,r)},In([t.Property(null)],r.prototype,"dataSource",void 0),In([t.Property("A1")],r.prototype,"startCell",void 0),In([t.Property(null)],r.prototype,"query",void 0),In([t.Property(!0)],r.prototype,"showFieldAsHeader",void 0),In([t.Property("")],r.prototype,"template",void 0),In([t.Property("A1")],r.prototype,"address",void 0),r}(t.ChildProperty),Rn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return wn(r,e),In([t.Property(0)],r.prototype,"rowIndex",void 0),In([t.Property(0)],r.prototype,"colIndex",void 0),r}(t.ChildProperty),kn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return wn(r,e),In([t.Property(null)],r.prototype,"rows",void 0),In([t.Property([])],r.prototype,"columns",void 0),In([t.Complex({},on)],r.prototype,"protectSettings",void 0),In([t.Collection([],En)],r.prototype,"ranges",void 0),In([t.Collection([],dn)],r.prototype,"conditionalFormats",void 0),In([t.Property(0)],r.prototype,"index",void 0),In([t.Property("")],r.prototype,"name",void 0),In([t.Property(100)],r.prototype,"rowCount",void 0),In([t.Property(100)],r.prototype,"colCount",void 0),In([t.Property("A1:A1")],r.prototype,"selectedRange",void 0),In([t.Property("A1")],r.prototype,"activeCell",void 0),In([t.Property({})],r.prototype,"usedRange",void 0),In([t.Property("A1")],r.prototype,"topLeftCell",void 0),In([t.Property(!0)],r.prototype,"showHeaders",void 0),In([t.Property(!0)],r.prototype,"showGridLines",void 0),In([t.Property(!1)],r.prototype,"isProtected",void 0),In([t.Property("Visible")],r.prototype,"state",void 0),In([t.Property(0)],r.prototype,"frozenRows",void 0),In([t.Property(0)],r.prototype,"frozenColumns",void 0),In([t.Property("A1")],r.prototype,"paneTopLeftCell",void 0),r}(t.ChildProperty),An=function(){function e(){this.services={}}return e.prototype.getService=function(e){if(t.isNullOrUndefined(this.services[e]))throw"The service "+e+" is not registered";return this.services[e]},e.prototype.register=function(e,r){t.isNullOrUndefined(this.services[e])&&(this.services[e]=r)},e}(),Tn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fn=function(){return(Fn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},Ln=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Nn=function(e){function r(t){var r=e.call(this,t)||this;return r.isEdit=!1,r.sheetNameCount=1,r.isOpen=!1,r.chartColl=[],r.chartCount=1,n.Inject(Zt,Ir,xr,$t,Vr,zr,Br,Mr,qr,Pr,jr,Yr,Gr,Xr,Kr,$r,_r,Ur),r.commonCellStyle={},t&&t.cellStyle&&(r.commonCellStyle=t.cellStyle),"workbook"===r.getModuleName()&&(r.serviceLocator=new An,r.initWorkbookServices(),r.dataBind(),r.initEmptySheet()),r}Tn(r,e),n=r,r.prototype.preRender=function(){Object.keys(this.commonCellStyle).length||(this.commonCellStyle=ee(this.cellStyle,!0)),"spreadsheet"!==this.getModuleName()||this.refreshing||this.initEmptySheet()},r.prototype.initWorkbookServices=function(){this.serviceLocator.register(yn,new t.L10n(this.getModuleName(),Cn,this.locale))},r.prototype.render=function(){},r.prototype.requiredModules=function(){return z(this)},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.cellFormat=function(e,t){var r=this.getActiveSheet();t=t||r.selectedRange,this.notify(Tt,{style:e,range:t,refreshRibbon:t.indexOf(r.activeCell)>-1})},r.prototype.lockCells=function(e,t){var r=this.getActiveSheet();e=e||r.selectedRange,this.notify("setLockCells",{range:e,isLocked:t})},r.prototype.getCellStyleValue=function(e,t){var r=this,n=J(t[0],t[1],this.getActiveSheet()),i={};return e.forEach(function(e){i[e]=r.cellStyle[e],n&&n.style&&n.style[e]&&(i[e]=n.style[e])}),i},r.prototype.numberFormat=function(e,t){this.notify("applyNumber",{format:e,range:t})},r.prototype.createSheet=function(e,t){void 0===e&&(e=this.sheets.length),void 0===t&&(t=[{}]);var r;(r=this.sheets).splice.apply(r,[e,0].concat(t)),ve(this,t),this.notify("sheetCreated",{sheetIndex:e||0,sheets:t}),this.notify(Lt,{action:"registerSheet",sheetIndex:e||0,sheetCount:e+t.length})},r.prototype.removeSheet=function(e){this.sheets.splice(e,1)},r.prototype.destroy=function(){this.notify("workbookDestroyed",null),e.prototype.destroy.call(this)},r.prototype.onPropertyChanged=function(e,r){for(var n=0,i=Object.keys(e);n<i.length;n++)switch(i[n]){case"cellStyle":t.merge(this.commonCellStyle,e.cellStyle);break;case"sheets":e.sheets===this.sheets?(this.notify(Lt,{action:"unRegisterSheet",propertyChange:!0}),this.sheetNameCount=1,this.notify("sheetsDestroyed",{}),ve(this),this.notify("sheetCreated",null),this.notify(Lt,{action:"registerSheet"})):ve(this)}},r.prototype.appendTo=function(t){e.prototype.appendTo.call(this,t)},r.prototype.hideRow=function(e,t,r){void 0===t&&(t=e),void 0===r&&(r=!0);var n=this.getActiveSheet();if(!r||!n.frozenRows&&!n.frozenColumns)for(var i=e;i<=t;i++)Ie(n,i,{hidden:r})},r.prototype.hideColumn=function(e,t,r){void 0===t&&(t=e),void 0===r&&(r=!0);var n=this.getActiveSheet();if(!n.frozenRows&&!n.frozenColumns)for(var i=e;i<=t;i++)Fe(n,i,{hidden:r})},r.prototype.setBorder=function(e,t,r){this.notify(Tt,{style:e,borderType:r,range:t||this.getActiveSheet().selectedRange})},r.prototype.insertRow=function(e,t,r){this.notify(Ht,{model:this.getSheetModel(r),start:e,end:t,modelType:"Row"})},r.prototype.insertColumn=function(e,t,r){this.notify(Ht,{model:this.getSheetModel(r),start:e,end:t,modelType:"Column"})},r.prototype.insertSheet=function(e,t){this.notify(Ht,{model:this,start:e,end:t,modelType:"Sheet"})},r.prototype.delete=function(e,r,n,i){e=e||0;var a;if(n&&"Sheet"!==n){if(!(a=this.getSheetModel(i)))return}else a=this;this.notify("deleteModel",{model:a,start:e,end:t.isNullOrUndefined(r)?e:r,modelType:n||"Sheet"})},r.prototype.moveSheet=function(e,t){be(this,e,t)},r.prototype.duplicateSheet=function(e){xe(this,e)},r.prototype.getSheetModel=function(e){if(t.isNullOrUndefined(e))return this.getActiveSheet();var r="string"==typeof e?se(this,e):e;return t.isNullOrUndefined(r)||r>=this.sheets.length?null:this.sheets[r]},r.prototype.merge=function(e,t){var r,n;e?n=fe(this,r=this.getAddressInfo(e).sheetIndex):e=(n=this.getActiveSheet()).selectedRange,this.notify(Vt,{merge:!0,range:e,type:t||"All",sheet:n,refreshRibbon:e.indexOf(n.activeCell)>-1,preventRefresh:this.activeSheetIndex!==r})},r.prototype.computeExpression=function(e){var t={action:"computeExpression",formula:e};return this.notify(Lt,t),t.calcValue},r.prototype.initEmptySheet=function(){this.sheets.length?ve(this):this.createSheet()},r.prototype.getActiveSheet=function(){return this.sheets[this.activeSheetIndex]},r.prototype.skipHiddenSheets=function(e,t,r){return void 0===r&&(r=0),this.sheets[e]&&"Visible"!==this.sheets[e].state&&(void 0===t&&(t=e),e=e&&e+1===this.sheets.length?t-1:e<t?--e:++e,e=this.skipHiddenSheets(e,t,++r)),r===this.sheets.length?(this.setSheetPropertyOnMute(this.sheets[0],"state","Visible"),0):e},r.prototype.setUsedRange=function(e,t,r){void 0===r&&(r=this.getActiveSheet()),e>r.usedRange.rowIndex&&(r.usedRange.rowIndex=e,r===this.getActiveSheet()&&this.notify("updateUsedRange",{index:e,update:"row"})),t>r.usedRange.colIndex&&(r.usedRange.colIndex=t,r===this.getActiveSheet()&&this.notify("updateUsedRange",{index:t,update:"col"}))},r.prototype.getData=function(e){return re(this,e)},r.prototype.getModuleName=function(){return"workbook"},r.prototype.getValueRowCol=function(e,r,n,i,a){var o={action:"getSheetInfo",sheetInfo:[]};if(this.notify(Lt,o),-1===de(this,"Sheet"+(e+1),o.sheetInfo)){var s={action:"getReferenceError",refError:""};return this.notify(Lt,s),s.refError}var l=fe(this,e=le(this,e+1)),h=J(r-1,n-1,l);if(i&&i.includes("!")&&!h&&l.ranges&&l.ranges.length){var d;if(this.formulaRefCell&&this.formulaRefCell===i)return h&&h.value;if(l.ranges.forEach(function(e){if(!e.info||!e.info.loadedRange||!e.info.loadedRange.length)return void(d=!0)}),d){if(this.formulaRefCell=i,e=le(this,Number(i[i.length-1])+1),t.isNullOrUndefined(e))return h&&h.value;i=i.substring(i.lastIndexOf("!")+1,i.length-1),re(this,l.name+"!A1:"+g(r-1,n-1),null,null,null,null,i,e)}}else h&&h.formula&&(a||t.isNullOrUndefined(h.value))&&this.notify("calculateFormula",{cell:h,rowIdx:r-1,colIdx:n-1,sheetIndex:e});return h&&h.value},r.prototype.setValueRowCol=function(e,t,r,n){e=le(this,e),this.notify("workbookEditOperation",{action:"updateCellValue",address:[r-1,n-1],value:t,sheetIndex:e,isValueOnly:!0})},r.prototype.open=function(e){this.notify("workbookOpen",e)},r.prototype.openFromJson=function(e){this.isOpen=!0;var t="object"==typeof e.file?JSON.stringify(e.file):e.file;this.notify("workbookOpen",{jsonObject:t})},r.prototype.save=function(e){if(void 0===e&&(e={}),this.allowSave){var t={url:this.saveUrl,fileName:e.fileName||"Sample",saveType:"Xlsx"},r=Fn({},t,e,{customParams:{},isFullPost:!0,needBlobData:!1,cancel:!1});this.trigger("beforeSave",r),this.notify(cr,{eventArgs:r,action:"beforeSave"}),r.cancel||this.notify("beginSave",{saveSettings:r,isFullPost:r.isFullPost,needBlobData:r.needBlobData,customParams:r.customParams})}},r.prototype.saveAsJson=function(){var e=this;return new Promise(function(t){e.on("onSave",function(r){r.cancel=!0,e.off("onSave"),t({jsonObject:{Workbook:r.jsonObject}}),e.notify("saveCompleted",r)}),e.save()})},r.prototype.addHyperlink=function(e,t){var r={hyperlink:e,cell:t};this.notify("setLinkModel",r)},r.prototype.findHandler=function(e){"next"===e.findOpt?this.notify("findNext",e):"prev"===e.findOpt&&this.notify("findPrevious",e)},r.prototype.replaceHandler=function(e){"replace"===e.replaceBy?this.notify("replace",e):this.notify("replaceAll",e)},r.prototype.protectSheet=function(e,t){this.notify("protectsheetHandler",t)},r.prototype.unprotectSheet=function(e){var t={sheet:e};this.notify("unprotectsheetHandler",t)},r.prototype.sort=function(e,t){if(!this.allowSorting)return Promise.reject();var r={args:{range:t||this.getActiveSheet().selectedRange,sortOptions:e||{sortDescriptors:{}},cancel:!1},promise:new Promise(function(e,t){e(void 0)})};return this.notify(Dt,r),r.promise},r.prototype.addDataValidation=function(e,t){var r={range:t=t||this.getActiveSheet().selectedRange,type:e.type,operator:e.operator,value1:e.value1,value2:e.value2,ignoreBlank:e.ignoreBlank,inCellDropDown:e.inCellDropDown,cancel:!1};this.notify(cr,{eventArgs:r,action:"validation"}),r.cancel||(t=r.range,e.type=r.type,e.operator=r.operator,e.value1=r.value1,e.value2=r.value2,e.ignoreBlank=r.ignoreBlank,e.inCellDropDown=r.inCellDropDown,this.notify(Bt,{rules:e,range:t}),delete r.cancel,this.notify(pr,{eventArgs:r,action:"validation"}))},r.prototype.removeDataValidation=function(e){this.notify(_t,{range:e})},r.prototype.addInvalidHighlight=function(e){this.notify("addHighlight",{range:e})},r.prototype.removeInvalidHighlight=function(e){this.notify("removeHighlight",{range:e})},r.prototype.conditionalFormat=function(e){e.range=e.range||this.getActiveSheet().selectedRange,this.notify(zt,{conditionalFormat:e})},r.prototype.clearConditionalFormat=function(e){e=e||this.getActiveSheet().selectedRange,this.notify(qt,{range:e})},r.prototype.updateCell=function(e,t){var r,n=y(t);t.includes("!")?void 0===(r=se(this,t.split("!")[0]))&&(r=this.activeSheetIndex):r=this.activeSheetIndex,Q(n[0],n[1],this.sheets[r],e,!0),e.value&&this.notify("workbookEditOperation",{action:"updateCellValue",address:n,value:e.value,sheetIndex:r})},r.prototype.wrap=function(e,t){void 0===t&&(t=!0),te(e,t,this)},r.prototype.addDefinedName=function(e){var t={action:"addDefinedName",isAdded:!1,definedName:e};return this.notify(Lt,t),t.isAdded},r.prototype.removeDefinedName=function(e,t){void 0===t&&(t="");var r={action:"removeDefinedName",isRemoved:!1,definedName:e,scope:t};return this.notify(Lt,r),r.isRemoved},r.prototype.clearRange=function(e,r,n){void 0===n&&(n=!0),oe(this,e||this.getActiveSheet().selectedRange,t.isNullOrUndefined(r)?this.activeSheetIndex:r,n)},r.prototype.insertImage=function(e,t){this.notify("setImage",{options:e,range:t||this.getActiveSheet().selectedRange})},r.prototype.insertChart=function(e){this.notify(Gt,{chart:e})},r.prototype.deleteChart=function(e){this.notify(br,{id:e})},r.prototype.filter=function(e,t){if(!this.allowFiltering)return Promise.reject();var r={args:{range:t||this.getActiveSheet().selectedRange,filterOptions:e,cancel:!1},promise:new Promise(function(e,t){e(void 0)})};return this.notify("initiateFilter",r),r.promise},r.prototype.clearFilter=function(){this.notify("clearAllFilter",null)},r.prototype.addCustomFunction=function(e,t){var r={action:"addCustomFunction",functionHandler:e,functionName:t=t||("string"==typeof e?e:e.name.replace("bound ",""))};this.notify(Lt,r)},r.prototype.clear=function(e){this.notify("clear",e)},r.prototype.getDisplayText=function(e){if(!e)return"";if(e.value&&e.format){var t={formattedText:e.value,value:e.value,format:e.format,onLoad:!0};return this.notify("getFormattedCell",t),t.formattedText}return!e.value&&e.hyperlink?"string"==typeof e.hyperlink?e.hyperlink:e.hyperlink.address:e.value||"number"==typeof e.value?e.value.toString():""},r.prototype.freezePanes=function(e,t,r){void 0===e&&(e=1),void 0===t&&(t=1);var n=this.getSheetModel(r);n.frozenRows===e&&n.frozenColumns===t||(this.setSheetPropertyOnMute(n,"frozenRows",e),this.setSheetPropertyOnMute(n,"frozenColumns",t),this.updateTopLeftCell(),n.name===this.getActiveSheet().name&&this.notify("dataRefresh",null))},r.prototype.Unfreeze=function(e){this.freezePanes(0,0,e)},r.prototype.updateTopLeftCell=function(e,r,n,i){i||(i=this.getActiveSheet());var a=u(i.topLeftCell);i.frozenRows||i.frozenColumns?(t.isNullOrUndefined(e)&&(e=i.frozenRows?0:a[0]),t.isNullOrUndefined(r)&&(r=i.frozenColumns?0:a[1]),e+=this.frozenRowCount(i),r+=this.frozenColCount(i),n&&("row"===n?e=u(i.paneTopLeftCell)[0]:r=u(i.paneTopLeftCell)[1]),this.setSheetPropertyOnMute(i,"paneTopLeftCell",g(e,r)),i.frozenRows&&(e=a[0]),i.frozenColumns&&(r=a[1])):(t.isNullOrUndefined(e)&&(e=a[0]),t.isNullOrUndefined(r)&&(r=a[1]),this.setSheetPropertyOnMute(i,"paneTopLeftCell",g(e,r))),this.setSheetPropertyOnMute(i,"topLeftCell",g(e,r))},r.prototype.getAddressInfo=function(e){return x(this,e)},r.prototype.setSheetPropertyOnMute=function(e,t,r){this.isProtectedOnChange=!0,e[t]=r,this.isProtectedOnChange=!1},r.prototype.frozenRowCount=function(e){return e.frozenRows?"A1"===e.topLeftCell?e.frozenRows:u(e.topLeftCell)[0]+e.frozenRows:0},r.prototype.frozenColCount=function(e){return e.frozenColumns?"A1"===e.topLeftCell?e.frozenColumns:u(e.topLeftCell)[1]+e.frozenColumns:0};var n;return Ln([t.Collection([],kn)],r.prototype,"sheets",void 0),Ln([t.Property(0)],r.prototype,"activeSheetIndex",void 0),Ln([t.Property("100%")],r.prototype,"height",void 0),Ln([t.Property(!0)],r.prototype,"allowFindAndReplace",void 0),Ln([t.Property()],r.prototype,"filterCollection",void 0),Ln([t.Property()],r.prototype,"sortCollection",void 0),Ln([t.Property("100%")],r.prototype,"width",void 0),Ln([t.Property(!0)],r.prototype,"showRibbon",void 0),Ln([t.Property(!0)],r.prototype,"showFormulaBar",void 0),Ln([t.Property(!0)],r.prototype,"showSheetTabs",void 0),Ln([t.Property(!0)],r.prototype,"allowEditing",void 0),Ln([t.Property(!0)],r.prototype,"allowOpen",void 0),Ln([t.Property(!0)],r.prototype,"allowSave",void 0),Ln([t.Property(!0)],r.prototype,"allowSorting",void 0),Ln([t.Property(!0)],r.prototype,"allowFiltering",void 0),Ln([t.Property(!0)],r.prototype,"allowNumberFormatting",void 0),Ln([t.Property(!0)],r.prototype,"allowCellFormatting",void 0),Ln([t.Property(!0)],r.prototype,"allowHyperlink",void 0),Ln([t.Property(!0)],r.prototype,"allowInsert",void 0),Ln([t.Property(!0)],r.prototype,"allowDelete",void 0),Ln([t.Property(!0)],r.prototype,"allowMerge",void 0),Ln([t.Property(!0)],r.prototype,"allowDataValidation",void 0),Ln([t.Property(!0)],r.prototype,"allowImage",void 0),Ln([t.Property(!0)],r.prototype,"allowChart",void 0),Ln([t.Property(!0)],r.prototype,"allowConditionalFormat",void 0),Ln([t.Complex({},tn)],r.prototype,"cellStyle",void 0),Ln([t.Property("")],r.prototype,"openUrl",void 0),Ln([t.Property("")],r.prototype,"saveUrl",void 0),Ln([t.Property("")],r.prototype,"password",void 0),Ln([t.Property(!1)],r.prototype,"isProtected",void 0),Ln([t.Collection([],an)],r.prototype,"definedNames",void 0),Ln([t.Event()],r.prototype,"beforeOpen",void 0),Ln([t.Event()],r.prototype,"openFailure",void 0),Ln([t.Event()],r.prototype,"beforeSave",void 0),Ln([t.Event()],r.prototype,"saveComplete",void 0),Ln([t.Event()],r.prototype,"beforeCellFormat",void 0),Ln([t.Event()],r.prototype,"queryCellInfo",void 0),r=n=Ln([t.NotifyPropertyChanges],r)}(t.Component),Dn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),On=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Hn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Dn(r,e),On([t.Collection([],Sn)],r.prototype,"cells",void 0),On([t.Property(0)],r.prototype,"index",void 0),On([t.Property(20)],r.prototype,"height",void 0),On([t.Property(!1)],r.prototype,"customHeight",void 0),On([t.Property(!1)],r.prototype,"hidden",void 0),On([t.Complex({},hn)],r.prototype,"format",void 0),r}(t.ChildProperty),Bn=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mn=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Pn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Bn(r,e),Mn([t.Property(0)],r.prototype,"index",void 0),Mn([t.Property(64)],r.prototype,"width",void 0),Mn([t.Property(!1)],r.prototype,"customWidth",void 0),Mn([t.Property(!1)],r.prototype,"hidden",void 0),Mn([t.Complex({},hn)],r.prototype,"format",void 0),Mn([t.Property(!0)],r.prototype,"isLocked",void 0),Mn([t.Property("")],r.prototype,"validation",void 0),r}(t.ChildProperty),_n=null,Un=["e-ribbon","e-formula-bar-panel","e-sheet-tab-panel","e-header-toolbar"],Vn={role:"role",selected:"aria-selected",multiselectable:"aria-multiselectable",busy:"aria-busy",colcount:"aria-colcount"},zn=function(){function e(e){this.parent=e,this.init(),this.addEventListener()}return e.prototype.init=function(){this.parent.element.appendChild(this.parent.createElement("input",{className:"e-clipboard",attrs:{contenteditable:"true"}}))},e.prototype.addEventListener=function(){var e=this.getClipboardEle();this.parent.on(ar,this.cut,this),this.parent.on("copy",this.copy,this),this.parent.on(or,this.paste,this),this.parent.on("clearCopy",this.clearCopiedInfo,this),this.parent.on("tabSwitch",this.tabSwitchHandler,this),this.parent.on(nr,this.cMenuBeforeOpenHandler,this),this.parent.on("ribboClick",this.ribbonClickHandler,this),this.parent.on("contentLoaded",this.initCopyIndicator,this),this.parent.on(sr,this.rowHeightChanged,this),t.EventHandler.add(e,"cut",this.cut,this),t.EventHandler.add(e,"copy",this.copy,this),t.EventHandler.add(e,"paste",this.paste,this)},e.prototype.removeEventListener=function(){var e=this.getClipboardEle();this.parent.isDestroyed||(this.parent.off(ar,this.cut),this.parent.off("copy",this.copy),this.parent.off(or,this.paste),this.parent.off("clearCopy",this.clearCopiedInfo),this.parent.off("tabSwitch",this.tabSwitchHandler),this.parent.off(nr,this.cMenuBeforeOpenHandler),this.parent.off("ribboClick",this.ribbonClickHandler),this.parent.off("contentLoaded",this.initCopyIndicator),this.parent.off(sr,this.rowHeightChanged)),t.EventHandler.remove(e,"cut",this.cut),t.EventHandler.remove(e,"copy",this.copy),t.EventHandler.remove(e,"paste",this.paste)},e.prototype.ribbonClickHandler=function(e){var t=this.parent.element.id;switch(e.item.id){case t+"_cut":this.cut({isAction:!0});break;case t+"_copy":this.copy({isAction:!0})}Et(this.parent.element)},e.prototype.tabSwitchHandler=function(e){0!==e.activeTab||this.copiedInfo||this.copiedShapeInfo||this.hidePaste()},e.prototype.cMenuBeforeOpenHandler=function(e){var t=this.parent.getActiveSheet(),r=this.parent.serviceLocator.getService(Hi),n=[],i=[],a=[],o=[],s=u(t.activeCell),l=J(s[0],s[1],t),h=t.isProtected&&X(l,Te(t,s[1]));"Content"!==e.target&&"RowHeader"!==e.target&&"ColumnHeader"!==e.target||(this.parent.enableContextMenuItems([r.getConstant("Paste"),r.getConstant("PasteSpecial")],!!(this.copiedInfo||this.copiedShapeInfo&&!h)),this.parent.enableContextMenuItems([r.getConstant("Cut")],!h)),"Content"===e.target&&h&&this.parent.enableContextMenuItems([r.getConstant("Cut"),r.getConstant("Filter"),r.getConstant("Sort")],!1),"Content"===e.target&&h&&!t.protectSettings.insertLink&&this.parent.enableContextMenuItems([r.getConstant("Hyperlink")],!1),"ColumnHeader"===e.target&&t.isProtected&&(a=[r.getConstant("DeleteColumn"),r.getConstant("DeleteColumns"),r.getConstant("InsertColumn"),r.getConstant("InsertColumns")],o=[r.getConstant("HideColumn"),r.getConstant("HideColumns"),r.getConstant("UnHideColumns")],this.parent.enableContextMenuItems(a,!1),this.parent.enableContextMenuItems(o,!!t.protectSettings.formatColumns)),"RowHeader"===e.target&&t.isProtected&&(n=[r.getConstant("DeleteRow"),r.getConstant("DeleteRows"),r.getConstant("InsertRow"),r.getConstant("InsertRows")],i=[r.getConstant("HideRow"),r.getConstant("HideRows"),r.getConstant("UnHideRows")],this.parent.enableContextMenuItems(n,!1),this.parent.enableContextMenuItems(i,!!t.protectSettings.formatRows))},e.prototype.rowHeightChanged=function(e){if(this.copiedInfo&&this.copiedInfo.range[0]>e.rowIdx){var t=this.parent.element.getElementsByClassName("e-copy-indicator")[0];t&&(t.style.top=parseInt(t.style.top,10)+e.threshold+"px")}},e.prototype.cut=function(e){this.setCopiedInfo(e,!0)},e.prototype.copy=function(e){this.setCopiedInfo(e,!1)},e.prototype.paste=function(e){if(!(this.parent.isEdit||this.parent.element.getElementsByClassName("e-dialog").length>0)){var r;e.isAction=!0;var n,i=e&&e.clipboardData||window.clipboardData,a=this.getCopiedIdx(),o=Object.assign({isExternal:i},this.copiedInfo);if(i||this.copiedShapeInfo||e.isInternal&&this.copiedInfo){var s=e&&e.sIdx>-1?e.sIdx:this.parent.activeSheetIndex,l=fe(this.parent,s),h=S(e&&e.range||c(l.selectedRange)),d=i&&this.getExternalCells(e);if(!e.isInternal&&d&&d.internal&&(i=!1,!this.copiedInfo))return;if(i&&!d.length)return;var p=0;if(d)for(H=0;H<d.length;H++)p=d[H].cells.length>p?d[H].cells.length:p;var u=h[0],f=i?[0,0,d.length-1,p-1]:S(this.copiedShapeInfo?c(l.selectedRange):this.copiedInfo.range),v=(h[2]-h[0]+1)%(f[2]-f[0]+1)==0&&(h[3]-h[1]+1)%(f[3]-f[1]+1)==0;r=v?h:[h[0],h[1]].concat([h[0]+f[2]-f[0],h[1]+f[3]-f[1]||h[1]]);var y={requestType:"paste",copiedInfo:this.copiedInfo,copiedRange:m(f),pastedRange:m(r),type:e&&e.type||"All",cancel:!1};if(e.isAction&&!this.copiedShapeInfo&&this.parent.notify(cr,{eventArgs:y,action:"clipboard"}),y.cancel)return;var C=void 0,b=void 0,x=void 0,w=[],E=fe(this.parent,i?s:a),R=I(f)&&this.isRangeMerged(h,l);u=(h=c(y.pastedRange))[0];var k={range:f=i?[0,0,d.length-1,p-1]:S(this.copiedShapeInfo?c(l.selectedRange):this.copiedInfo.range),prevSheet:E,cancel:!1};if(r=(v=(h[2]-h[0]+1)%(f[2]-f[0]+1)==0&&(h[3]-h[1]+1)%(f[3]-f[1]+1)==0&&!R)?h:[h[0],h[1]].concat([h[0]+f[2]-f[0],h[1]+f[3]-f[1]||h[1]]),this.parent.getActiveSheet().isProtected&&Rt(this.parent,r))return void this.parent.notify("editAlert",null);if(this.copiedShapeInfo&&!this.copiedInfo){var A=this.copiedShapeInfo.pictureElem;A.classList.contains("e-datavisualization-chart")?(this.copiedShapeInfo.chartInfo.top=null,this.copiedShapeInfo.chartInfo.left=null,this.parent.notify(Gt,{chart:[this.copiedShapeInfo.chartInfo],isInitCell:!0,isUndoRedo:!0,isPaste:!0,dataSheetIdx:this.copiedShapeInfo.sheetIdx,isCut:this.copiedShapeInfo.isCut,range:e.range||l.selectedRange,isIdAvailabe:!1})):this.parent.notify(yr,{options:{src:A.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:this.copiedShapeInfo.height,width:this.copiedShapeInfo.width,imageId:this.copiedShapeInfo.isCut?A.id:""},range:m([u,h[1],u,h[1]]),isPublic:!1,isUndoRedo:!0});var T=J(u,h[1],l);if(T&&!t.isNullOrUndefined(T.image)){var F=T.image?T.image.length-1:0,L={requestType:"imagePaste",copiedShapeInfo:this.copiedShapeInfo,pasteSheetIndex:this.parent.activeSheetIndex,pastedRange:Ce(this.parent)+"!"+m([u,h[1],u,h[1]]),pastedPictureElement:document.getElementById(T.image[F].id)};this.parent.notify(pr,{eventArgs:L,action:"clipboard"})}}else{if(this.parent.notify("pasteMerge",k),k.cancel)return;for(var N=y.type?y.type:e.type,D=[],O=this.isInRange(f,h,a),H=f[0],B=0;H<=f[2];H++,B++)if(O&&(D[h[0]+B]={cells:[]}),Ee(this.parent.getActiveSheet(),H))h[2]=h[2]-1,B-=1;else{for(var M=f[1],P=0;M<=f[3];M++,P++){if(O&&(D[h[0]+B].cells[h[1]+P]=J(h[0]+B,h[1]+P,E)),(C=i?d[H].cells[M]:t.extend({},O&&D[H]&&D[H].cells[M]?D[H].cells[M]:J(H,M,E),null,!0))&&e&&e.type||N){switch(N){case"Formats":C={format:C.format,style:C.style};break;case"Values":(C={value:C.value}).value&&C.value.toString().indexOf("\n")>-1&&this.parent.getCell(h[0],h[1]).classList.add("e-alt-unwrap")}b=["Formats","Values"].indexOf(e.type)>-1}if(!this.parent.scrollSettings.isFinite&&(f[2]-f[0]>1048575-h[0]||f[3]-f[1]>16383-h[1])||this.parent.scrollSettings.isFinite&&(f[2]-f[0]>l.rowCount-1-h[0]||f[3]-f[1]>l.colCount-1-h[1]))return void this.showDialog();var _=this.getConditionalFormats(H,M,E);if(v)for(var U=h[0];U<=h[2];U+=f[2]-f[0]+1)for(var V=h[1];V<=h[3];V+=f[3]-f[1]+1){if(x=J(U+B,V+P,l)||{},!i&&(void 0!==x.colSpan||void 0!==x.rowSpan)){var z={range:(k={range:[U+B,V+P,U+B,V+P]}).range,merge:!1,isAction:!1,type:"All"};w.push(z),this.parent.activeSheetIndex===l.index&&this.parent.notify(Vt,z)}var q=V+P;if(C=t.extend({},C||{},null,!0),!b){var j=$([U+B,q],[H,M],E);t.isNullOrUndefined(j)||(C.formula=j)}this.setConditionalFormats(_,U+B,q,l);var W=!1;if(this.parent.filteredRows&&this.parent.filteredRows.rowIdxColl&&this.parent.filteredRows.sheetIdxColl)for(var Y=0,X=this.parent.filteredRows.sheetIdxColl.length;Y<X;Y++)if(this.parent.filteredRows.sheetIdxColl[Y]===this.parent.activeSheetIndex&&this.parent.filteredRows.rowIdxColl[Y]===U+B){W=!0;break}W||(this.parent.getActiveSheet().isProtected&&C&&(t.isNullOrUndefined(C.isLocked)||!0===C.isLocked)&&(C.isLocked=x.isLocked),this.setCell(U+B,q,l,C,b,!1,!!_.length||V===h[3],i));var K=this.parent.activeSheetIndex,Z=this.parent.getCell(U+B,q),Q=g(U+B,q),ee={address:this.parent.sheets[K].name+"!"+Q,requestType:"paste",value:J(U+B,q,l)?J(U+B,q,l).value:"",oldValue:x.value,element:Z,displayText:this.parent.getDisplayText(C)};this.parent.trigger("cellSave",ee)}else!i&&ct(this.parent,H,M,a)||(R?this.setCell(u,h[1]+P,l,{value:C.value},!0,!1,M===f[3]):this.setCell(u,h[1]+P,l,C,b,!1,M===f[3]));if(!i&&this.copiedInfo.isCut&&(!G(h,H,M)||a!==this.parent.activeSheetIndex)){var te=J(H,M,E);te&&(te.isLocked||t.isNullOrUndefined(te.isLocked)?te=null:!1===te.isLocked&&(te=this.parent.getActiveSheet().isProtected?{isLocked:!1}:null)),this.setCell(H,M,E,te,!1,!0,M===f[3])}}u++}if(this.parent.notify("refreshRibbonIcons",null),this.parent.setUsedRange(r[2]+1,r[3]),s===this.parent.activeSheetIndex&&this.parent.notify("selectRange",{address:m(r)}),!i&&this.copiedInfo.isCut&&(n=this.copiedInfo.isCut,a===this.parent.activeSheetIndex&&this.parent.serviceLocator.getService("cell").refreshRange(f),this.clearCopiedInfo()),(i||O)&&this.copiedInfo&&this.clearCopiedInfo(),(i||e&&e.isAction)&&Et(this.parent.element),e.isAction){var re=o&&o.sId?le(this.parent,o.sId):this.parent.activeSheetIndex,L={requestType:"paste",copiedInfo:o,mergeCollection:w,pasteSheetIndex:this.parent.activeSheetIndex,copiedRange:this.parent.sheets[re].name+"!"+m(o&&o.range?o.range:c(this.parent.sheets[re].selectedRange)),pastedRange:Ce(this.parent)+"!"+m(r),type:N||"All"};this.parent.notify(pr,{eventArgs:L,action:"clipboard"})}if(n){this.updateFilter(o,r),St(E,f[0],f[1],this.parent.getCell(f[0],f[1]).offsetHeight);ie=wt(E,f[0]);ut(this.parent,E,ie,f[0])}var ne=fe(this.parent,a);if(!i&&f[0]===f[2]&&f[3]-f[1]==ne.colCount-1){for(var ie=ne.rows[f[0]].height,H=h[0];H<=h[2];H++)ut(this.parent,this.parent.getActiveSheet(),ie,H);n&&ut(this.parent,ne,20,f[0])}}}else this.getClipboardEle().select()}},e.prototype.getConditionalFormats=function(e,r,n){var i=[];if(n.conditionalFormats)for(var a=0;a<n.conditionalFormats.length;a++)G(c(n.conditionalFormats[a].range),e,r)&&i.push(t.extend({},n.conditionalFormats[a]));return i},e.prototype.setConditionalFormats=function(e,r,n,i){for(var a=0;a<e.length;a++)i.conditionalFormats.push(t.extend({},e[a].properties||e[a],{range:m([r,n])}))},e.prototype.isRangeMerged=function(e,t){var r=J(e[0],e[1],t);if(r&&(r.colSpan>1||r.rowSpan>1)){var n={range:e.slice(2,4).concat(e.slice(2,4))};return this.parent.notify("activeCellMergedRange",n),n.range[0]===e[0]&&n.range[1]===e[1]&&n.range[2]===e[2]&&n.range[3]===e[3]}return!1},e.prototype.updateFilter=function(e,t){var r,n;this.parent.notify("getFilteredCollection",null);for(var i=0;i<this.parent.sheets.length;i++)if(this.parent.filterCollection&&this.parent.filterCollection[i]&&this.parent.filterCollection[i].sheetIndex===le(this.parent,e.sId)){var a=e.range,o=c(this.parent.filterCollection[i].filterRange);a=S(a),o[0]===a[0]&&o[2]===a[2]&&o[1]===a[1]&&o[3]===a[3]&&(r=!0,n=[Math.abs(a[0]-o[0]),Math.abs(a[1]-o[1]),Math.abs(a[2]-o[2]),Math.abs(a[3]-o[3])])}var s=this.parent.getCell(e.range[0],e.range[1]),l=(s=s?s.querySelector(".e-filter-icon")?s:this.parent.getCell(e.range[2],e.range[3]):s)?s.querySelector(".e-sortasc-filter"):s,h=s?s.querySelector(".e-sortdesc-filter"):s;if(r)for(var d=0;d<this.parent.filterCollection.length;d++){var p=this.parent.filterCollection[d],u=e&&e.sId?le(this.parent,e.sId):this.parent.activeSheetIndex;if(p.sheetIndex===u&&this.parent.notify(dr,{predicates:null,range:p.filterRange,sIdx:u,isCut:!0}),p.sheetIndex===u&&u===this.parent.activeSheetIndex&&(n=[t[0]+n[0],t[1]+n[1],Math.abs(t[2]-n[2]),Math.abs(t[3]-n[3])],this.parent.notify(dr,{predicates:null,range:m(n),sIdx:null,isCut:!0}),e.range[3]===e.range[1])){var f=this.parent.getCell(t[0],t[1]);l&&f&&f.querySelector(".e-filter-icon").classList.add("e-sortasc-filter"),h&&f&&f.querySelector(".e-filter-icon").classList.add("e-sortdesc-filter")}}},e.prototype.isInRange=function(e,t,r){var n=this.parent.activeSheetIndex;return G(e,t[0],t[1])&&r===n||G(e,t[2],t[3])&&r===n},e.prototype.setCell=function(e,t,r,n,i,a,o,s){var l=r?le(this.parent,r.id):null;if(Q(e,t,r,n,i),n&&n.formula&&this.parent.notify(Lt,{action:"refreshCalculate",value:a?"":n.formula,rowIndex:e,colIndex:t,sheetIndex:this.parent.activeSheetIndex,isFormula:!0}),n&&!n.formula&&this.parent.notify("workbookEditOperation",{action:"updateCellValue",address:[e,t,e,t],value:n.value,sheetIndex:l}),r.name===this.parent.getActiveSheet().name&&this.parent.serviceLocator.getService("cell").refresh(e,t,o),n&&n.style&&s){var h=xt(this.parent,e,t,r,n.style||this.parent.cellStyle,n.wrap?vt(this.parent.getDisplayText(n),bt(r,e,t),n.style,this.parent.cellStyle):1);(h=Math.round(h))<20&&(h=20),St(r,e,t,h);var d=Ae(r,e),p=wt(r,e);p>d&&ut(this.parent,r,p,e)}},e.prototype.getCopiedIdx=function(){if(this.copiedInfo){for(var e=0;e<this.parent.sheets.length;e++)if(this.parent.sheets[e].id===this.copiedInfo.sId)return e;this.clearCopiedInfo()}return-1},e.prototype.setCopiedInfo=function(e,n){var i=this;if(!this.parent.isEdit){var a=new r.Deferred;e.promise=a.promise;var o,s=this.parent.getActiveSheet();if(e&&e.range){var l={range:e.range};this.parent.notify("mergedRange",l),o=l.range}else o=c(s.selectedRange);var h={sheet:s,indexes:[0,0,s.rowCount-1,s.colCount-1],promise:new Promise(function(e,t){e(void 0)})},d=document.getElementsByClassName("e-ss-overlay-active"),p=d.length;!s.isLocalData||e&&e.clipboardData||0!==o[0]||o[2]!==s.rowCount-1||(this.parent.showSpinner(),this.parent.notify("updateSheetFromDataSource",h)),h.promise.then(function(){if(p>0){var r={clientY:d[0].offsetTop,isImage:!0};i.parent.notify("getRowIdxFromClientY",r);var l={clientX:d[0].offsetLeft,isImage:!0};i.parent.notify("getColIdxFromClientX",l),i.copiedShapeInfo={sId:e&&e.sId?e.sId:s.id,sheetIdx:s.index,isCut:n,pictureElem:d[0],copiedRange:m([r.clientY,l.clientX,r.clientY,l.clientX]),height:d[0].offsetHeight,width:d[0].offsetWidth,chartInfo:i.getChartElemInfo(d[0])},i.hidePaste(!0),n&&(d[0].classList.contains("e-datavisualization-chart")?i.parent.deleteChart(i.copiedShapeInfo.chartInfo.id):i.parent.notify(Cr,{id:i.copiedShapeInfo.pictureElem.id,sheetIdx:i.copiedShapeInfo.sId,range:i.copiedShapeInfo.copiedRange}))}else e&&e.clipboardData||(i.copiedInfo&&i.clearCopiedInfo(),i.copiedInfo={range:o,sId:e&&e.sId?e.sId:s.id,isCut:n},i.hidePaste(!0),i.initCopyIndicator(),t.Browser.isIE||i.getClipboardEle().select(),e&&e.isAction&&document.execCommand(n?"cut":"copy"),i.parent.hideSpinner());t.Browser.isIE&&i.setExternalCells(e),a.resolve()}),e&&e.clipboardData&&(this.setExternalCells(e),Et(this.parent.element))}},e.prototype.getChartElemInfo=function(e){var t=this.parent.chartColl;if(e.classList.contains("e-datavisualization-chart"))for(var r=e.getElementsByClassName("e-control")[0].id,n=0;n<t.length;n++)if(t[n].id===r)return t[n];return null},e.prototype.clearCopiedInfo=function(){this.copiedInfo&&(this.parent.getActiveSheet().id===this.copiedInfo.sId&&(this.removeIndicator(this.parent.getSelectAllContent()),this.removeIndicator(this.parent.getColumnHeaderContent()),this.removeIndicator(this.parent.getRowHeaderContent()),this.removeIndicator(this.parent.getMainContent())),this.copiedInfo=null,this.hidePaste()),this.copiedShapeInfo&&(this.copiedShapeInfo=null,this.hidePaste())},e.prototype.removeIndicator=function(e){if(e){var r=e.querySelector(".e-copy-indicator");r&&t.detach(r)}},e.prototype.initCopyIndicator=function(){if(this.copiedInfo&&this.parent.getActiveSheet().id===this.copiedInfo.sId){var e=this.parent.createElement("div",{className:"e-copy-indicator"});e.appendChild(this.parent.createElement("div",{className:"e-top"})),e.appendChild(this.parent.createElement("div",{className:"e-bottom"})),e.appendChild(this.parent.createElement("div",{className:"e-left"})),e.appendChild(this.parent.createElement("div",{className:"e-right"})),je(this.parent,e,this.copiedInfo.range,"e-copy-indicator")}},e.prototype.showDialog=function(){var e=this;this.parent.serviceLocator.getService(Bi).show({header:"Spreadsheet",target:this.parent.element,height:205,width:340,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(Hi).getConstant("PasteAlert"),beforeOpen:function(t){var r={dialogName:"PasteDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0)}})},e.prototype.hidePaste=function(e){this.parent.getActiveSheet().isProtected&&(e=!1),this.parent.notify("enableToolbarItems",[{items:[this.parent.element.id+"_paste"],enable:e||!1}])},e.prototype.setExternalCells=function(e){for(var r,n="",i=this.copiedInfo.range,a=this.parent.getActiveSheet(),o='<html><body><table class="e-spreadsheet" xmlns="http://www.w3.org/1999/xhtml"><tbody>',s=i[0];s<=i[2];s++){o+="<tr>";for(var l=i[1];l<=i[3];l++){if(r=J(s,l,a),o+='<td style="white-space:'+(r&&r.wrap?"normal":"nowrap")+";vertical-align:bottom;",r&&r.style&&Object.keys(r.style).forEach(function(e){var t=e.match(/[A-Z]/);o+=("backgroundColor"===e?"background":t?e.replace(t[0],"-"+t[0].toLowerCase()):e)+":"+("backgroundColor"===e||"color"===e?r.style[e].slice(0,7):r.style[e])+";"}),o+='">',r&&!t.isNullOrUndefined(r.value)){var h={formattedText:r.value,value:r.value,format:r.format,onLoad:!0};r.format&&this.parent.notify("getFormattedCell",h),o+=h.formattedText,n+=h.formattedText}o+="</td>",n+=l===i[3]?"":"\t"}o+="</tr>",n+=s===i[2]?"":"\n"}o+="</tbody></table></body></html>",t.Browser.isIE?window.clipboardData.setData("text",n):(e.clipboardData.setData("text/html",o),e.clipboardData.setData("text/plain",n),e.preventDefault())},e.prototype.getExternalCells=function(e){var r,n,i,a=this,o=[],s=[],l=this.parent.createElement("span");return t.Browser.isIE?n=window.clipboardData.getData("text"):(r=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain"),l.innerHTML=r),l.querySelector("table")?l.querySelector(".e-spreadsheet")&&this.copiedInfo?o={internal:!0}:(l.querySelectorAll("tr").forEach(function(e){e.querySelectorAll("td").forEach(function(e,t){i=a.getStyle(e,l),e.textContent=e.textContent.replace(/(\r\n|\n|\r)/gm,"");var r,n=isNaN(parseInt(e.getAttribute("colspan"),10))?1:parseInt(e.getAttribute("colspan"),10),o=isNaN(parseInt(e.getAttribute("rowspan"),10))?1:parseInt(e.getAttribute("rowspan"),10);i.whiteSpace&&(r=!0,delete i.whiteSpace),s[t]={value:e.textContent?D(e.textContent.trim()):null,style:i,colSpan:n,rowSpan:o,wrap:r}}),o.push({cells:s}),s=[]}),this.updateMergeCells(o)):n&&(r&&[].slice.call(l.children).forEach(function(e){i=a.getStyle(e,l)}),n.trim().split("\n").forEach(function(e){e.split("\t").forEach(function(e,t){if(e){var r=void 0;i&&i.whiteSpace&&(r=!0,delete i.whiteSpace),s[t]={style:i,wrap:r},q(e)?s[t].formula=e:s[t].value=D(e.trim())}}),o.push({cells:s}),s=[]})),setTimeout(function(){a.getClipboardEle().innerHTML=""},0),o},e.prototype.updateMergeCells=function(e){for(var t,r,n=0;n<e.length;n++)for(var i=0;i<e[n].cells.length;i++)if(e[n].cells[i]){if(r=e[n].cells[i].colSpan,t=e[n].cells[i].rowSpan,r>1)for(a=1;a<r;a++)e[n].cells.splice(i+1,0,{colSpan:a-r});if(t>1)for(var a=t-1;a>0;a--)for(var o=0;o<r;o++)e[n+a].cells.splice(0===o?i:i+1,0,{rowSpan:-a,colSpan:-o})}},e.prototype.getStyle=function(e,t){var r=[],n={},i=Object.keys(this.parent.commonCellStyle);if(t.querySelector("style")&&e.classList.length&&t.querySelector("style").innerHTML.indexOf(e.classList[0])>-1){var a=t.querySelector("style").innerHTML.split(e.classList[0]);r.push(a[a.length-1].split("{")[1].split("}")[0])}var o=[].slice.call(e.querySelectorAll("*"));if(o.unshift(e),o.forEach(function(e){e.getAttribute("style")&&r.push(e.getAttribute("style")),"B"===e.tagName&&r.push("font-weight:bold")}),i.length&&t.querySelector("style"))for(var s=t.querySelector("style").innerHTML.split("td")[1].split("{")[1].split("}")[0],l=0;l<i.length;l++){var h=i[l],d=h.match(/[A-Z]/);d&&(h=h.replace(d[0],"-"+d[0].toLowerCase())),s.indexOf(h)>-1&&(n[i[l]]=s.split(h+":")[1].split(";")[0])}return r.forEach(function(e){e.split(";").forEach(function(e){var t=e.split(":")[0].trim();if(["font-family","vertical-align","text-align","text-indent","color","background","font-weight","font-style","font-size","text-decoration","border-bottom","border-top","border-right","border-left","border","white-space"].indexOf(t)>-1){var r=(t="background"===t?"backgroundColor":t).match(/-[a-z]/),i=e.split(":")[1];n[r?t.replace(r[0],r[0].charAt(1).toUpperCase()):t]="font-weight"===t&&-1===["bold","normal"].indexOf(i)?i>"599"?"bold":"normal":i}})}),e.innerHTML.indexOf("<s>")>-1&&(n.textDecoration="line-through"),this.defaultCellStyle(n)},e.prototype.defaultCellStyle=function(e){var t=["underline","line-through","underline line-through","none"],r=["left","center","right"],n=["bottom","middle","top"],i=e.fontSize?e.fontSize.trim():null;return e.textDecoration&&t.indexOf(e.textDecoration.trim())<0&&(e.textDecoration="none"),e.textAlign&&r.indexOf(e.textAlign.trim())<0&&(e.textAlign="left"),e.verticalAlign&&n.indexOf(e.verticalAlign.trim())<0&&(e.verticalAlign="bottom"),i&&(i=i.indexOf("px")>-1?.75*parseFloat(i)+"pt":i,e.fontSize=Math.round(parseFloat(i))+"pt"),e},e.prototype.getClipboardEle=function(){return this.parent.element.getElementsByClassName("e-clipboard")[0]},e.prototype.getModuleName=function(){return"clipboard"},e.prototype.destroy=function(){this.removeEventListener();var e=this.getClipboardEle();t.detach(e),this.parent=null},e}(),qn=function(){function e(e){this.editorElem=null,this.editCellData={},this.isEdit=!1,this.isCellEdit=!0,this.isNewValueEdit=!0,this.isAltEnter=!1,this.validCharacters=["+","-","*","/",",","(","=","&"],this.formulaBarCurStartPos=null,this.curEndPos=null,this.curStartPos=null,this.selectionStart=null,this.selectionEnd=null,this.keyCodes={BACKSPACE:8,SPACE:32,TAB:9,DELETE:46,ESC:27,ENTER:13,FIRSTALPHABET:65,LASTALPHABET:90,FIRSTNUMBER:48,LASTNUMBER:59,FIRSTNUMPAD:96,LASTNUMPAD:111,SYMBOLSETONESTART:186,SYMBOLSETONEEND:192,SYMBOLSETTWOSTART:219,SYMBOLSETTWOEND:222,FIREFOXEQUALPLUS:61,FIREFOXMINUS:173,F2:113},this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null,this.editorElem=null},e.prototype.addEventListener=function(){t.EventHandler.add(this.parent.element,"dblclick",this.dblClickHandler,this),this.parent.on("mouseDown",this.mouseDownHandler,this),this.parent.on(tr,this.keyUpHandler,this),this.parent.on(rr,this.keyDownHandler,this),this.parent.on(Qt,this.performEditOperation,this),this.parent.on("initiateCur",this.initiateCurPosition,this),this.parent.on("editValue",this.updateFormulaBarValue,this),this.parent.on("addressHandle",this.addressHandler,this),this.parent.on("initiateEdit",this.initiateRefSelection,this),this.parent.on("forRefSelRender",this.refSelectionRender,this)},e.prototype.removeEventListener=function(){t.EventHandler.remove(this.parent.element,"dblclick",this.dblClickHandler),this.parent.isDestroyed||(this.parent.off("mouseDown",this.mouseDownHandler),this.parent.off(tr,this.keyUpHandler),this.parent.off(rr,this.keyDownHandler),this.parent.off(Qt,this.performEditOperation),this.parent.off("initiateCur",this.initiateCurPosition),this.parent.off("editValue",this.updateFormulaBarValue),this.parent.off("addressHandle",this.addressHandler),this.parent.off("initiateEdit",this.initiateRefSelection),this.parent.off("forRefSelRender",this.refSelectionRender))},e.prototype.getModuleName=function(){return"edit"},e.prototype.performEditOperation=function(e){switch(e.action){case"renderEditor":this.renderEditor();break;case"refreshEditor":this.refreshEditor(e.value,e.refreshFormulaBar,e.refreshEditorElem,e.isAppend,e.trigEvent),e.refreshCurPos&&this.setCursorPosition();break;case"startEdit":if(this.isEdit){var t={isEdit:!1};this.parent.notify("isFormulaBarEdit",t),t.isEdit&&(this.isNewValueEdit=e.isNewValueEdit,this.startEdit(e.address,e.value,e.refreshCurPos))}else this.isNewValueEdit=e.isNewValueEdit,this.startEdit(e.address,e.value,e.refreshCurPos);break;case"endEdit":this.isEdit&&this.endEdit(e.refreshFormulaBar);break;case"cancelEdit":this.isEdit&&this.cancelEdit(e.refreshFormulaBar);break;case"getCurrentEditValue":e.editedValue=this.editCellData.value,void 0!==e.endFormulaRef&&(e.endFormulaRef=this.endFormulaRef);break;case"refreshDependentCellValue":this.refreshDependentCellValue(e.rowIdx,e.colIdx,e.sheetIdx);break;case"getElement":e.element=this.getEditElement(this.parent.getActiveSheet());break;case"focusEditorElem":this.editorElem.focus();break;case"getCurrentEditSheetIdx":e.sheetIndex=this.editCellData.sheetIndex}},e.prototype.keyUpHandler=function(e){if(this.isEdit){var t=this.getEditElement(this.parent.getActiveSheet());if(e.altKey&&13===e.keyCode?(t.focus(),this.altEnter(),this.isAltEnter=!0):this.isCellEdit&&this.editCellData.value!==t.textContent&&16!==e.keyCode&&this.refreshEditor(t.textContent,this.isCellEdit),q(this.editCellData.value,!0)&&(!e||16!==e.keyCode)&&(this.updateFormulaReference(t),this.endFormulaRef)){var r=this.getCurPosition();r.end&&this.validCharacters.indexOf(this.editCellData.value[r.end-1])>-1&&(this.endFormulaRef=!1)}}},e.prototype.updateFormulaReference=function(e){var t=this.parent.element.querySelector(".e-formularef-indicator");t&&t.parentElement.removeChild(t),this.editCellData.value!==e.textContent&&this.refreshEditor(e.textContent,!0);var r=this.editCellData.sheetIndex,n=this.editCellData.value;this.parent.notify("initiateFormulaReference",{range:n,formulaSheetIdx:r})},e.prototype.keyDownHandler=function(e){var r=e.target,n=e.keyCode,i=this.parent.getActiveSheet(),a=u(i.activeCell),o=J(a[0],a[1],i)||{};if(!t.closest(e.target,".e-findtool-dlg")&&!t.closest(e.target,".e-validationerror-dlg")&&!t.closest(e.target,".e-hyperlink-dlg"))if(i.isProtected&&!t.closest(e.target,".e-sheet-rename")&&X(o,Te(i,a[1]))){if((n>=this.keyCodes.FIRSTALPHABET&&n<=this.keyCodes.LASTALPHABET||n>=this.keyCodes.FIRSTNUMBER&&n<=this.keyCodes.LASTNUMBER||n===this.keyCodes.DELETE||n===this.keyCodes.BACKSPACE||n===this.keyCodes.SPACE||n>=this.keyCodes.FIRSTNUMPAD&&n<=this.keyCodes.LASTNUMPAD||n>=this.keyCodes.SYMBOLSETONESTART&&n<=this.keyCodes.SYMBOLSETONEEND||n>=219&&n<=222||!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&n===this.keyCodes.F2)&&67!==n&&89!==n&&90!==n){if(i.protectSettings.insertLink&&75===n)return;this.parent.element.querySelector(".e-editAlert-dlg")||e.ctrlKey||70===e.keyCode||r.parentElement.classList.contains("e-unprotectpwd-content")||r.parentElement.classList.contains("e-password-content")||this.parent.notify("editAlert",null)}}else if(this.isEdit){var s=this.getEditElement(i),l=q(this.editCellData.value,!0);if((this.isCellEdit||l&&this.editCellData.value!==s.textContent&&16!==e.keyCode)&&(a[1]<this.parent.frozenColCount(i)&&(!i.frozenRows||a[0]>=this.parent.frozenRowCount(i))&&s&&"auto"!==s.style.height&&mt(s.textContent,o.style,this.parent.cellStyle)>parseInt(s.style.maxWidth,10)&&(s.style.height="auto"),mt(s.textContent,o.style,this.parent.cellStyle)>parseInt(s.style.maxWidth,10)-5&&(s.style.height="auto"),a[0]<this.parent.frozenRowCount(i)&&s&&!s.style.overflow&&mt(s.textContent,o.style,this.parent.cellStyle)>parseInt(s.style.maxWidth,10)&&(s.style.overflow="auto"),this.refreshEditor(s.textContent,this.isCellEdit)),!e.altKey)switch(n){case this.keyCodes.ENTER:if(t.Browser.isWindows&&e.preventDefault(),this.isAltEnter){var h=s.textContent;h&&h.indexOf("\n")>-1&&(te(this.parent.getActiveSheet().selectedRange,!0,this.parent),this.refreshEditor(s.textContent,this.isCellEdit),this.isAltEnter=!1)}if(l){var d=this.parent.element.querySelector(".e-formularef-indicator");d&&d.parentElement.removeChild(d),this.editCellData.sheetIndex===i.id-1?this.endEdit(!1,e):(this.parent.goTo(this.editCellData.fullAddr),this.endEdit(!1,e))}else this.endEdit(!1,e);break;case this.keyCodes.TAB:this.hasFormulaSuggSelected()||this.endEdit(!1,e);break;case this.keyCodes.ESC:this.cancelEdit(!0,!0,e)}}else if(!this.isEdit&&(r.classList.contains("e-spreadsheet")||t.closest(r,".e-sheet-panel"))){var p=n>=this.keyCodes.FIRSTALPHABET&&n<=this.keyCodes.LASTALPHABET,c=n>=this.keyCodes.FIRSTNUMBER&&n<=this.keyCodes.LASTNUMBER,f=n>=this.keyCodes.FIRSTNUMPAD&&n<=this.keyCodes.LASTNUMPAD,g=n>=this.keyCodes.SYMBOLSETONESTART&&n<=this.keyCodes.SYMBOLSETONEEND;g||(g=n>=this.keyCodes.SYMBOLSETTWOSTART&&n<=this.keyCodes.SYMBOLSETTWOEND);var m=n===this.keyCodes.FIREFOXEQUALPLUS||n===this.keyCodes.FIREFOXMINUS,v=!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&n===this.keyCodes.F2,y=n===this.keyCodes.BACKSPACE;if(!e.ctrlKey&&!e.metaKey&&!e.altKey&&(!e.shiftKey&&n===this.keyCodes.SPACE||p||c||f||g||"mozilla"===t.Browser.info.name&&m)||v||y){v&&(this.isNewValueEdit=!1);var C=document.getElementsByClassName("e-ss-overlay-active");C.length>0?n===this.keyCodes.DELETE&&this.parent.notify(Cr,{id:C[0].id,sheetIdx:this.parent.activeSheetIndex+1}):this.startEdit(null,null,!0,!0)}n===this.keyCodes.DELETE&&(i.isProtected&&Rt(this.parent)?this.parent.notify("editAlert",null):(this.editingHandler("delete"),this.parent.notify("activeCellChanged",null)))}},e.prototype.renderEditor=function(){if(!this.editorElem||!t.select("#"+this.parent.element.id+"_edit",this.parent.element)){var e=this.parent.createElement("div",{id:this.parent.element.id+"_edit",className:"e-spreadsheet-edit"});e.contentEditable="true",e.spellcheck=!1,this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0]&&this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0].remove(),this.parent.element.querySelector(".e-sheet-content").appendChild(e),this.editorElem=e}this.parent.notify("formulaOperation",{action:"renderAutoComplete"})},e.prototype.refreshEditor=function(e,t,r,n,i){void 0===i&&(i=!0),n?e=this.editCellData.value=this.editCellData.value+e:this.editCellData.value=e;var a=this.getEditElement(this.parent.getActiveSheet());r&&(a.textContent=e),t&&this.parent.notify("formulaBarOperation",{action:"refreshFormulabar",value:e}),i&&this.editCellData.value===a.textContent&&this.triggerEvent("cellEditing")&&this.cancelEdit()},e.prototype.startEdit=function(e,t,r,n){void 0===r&&(r=!0),this.parent.showSheetTabs&&this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true");var i=this.parent.getActiveSheet(),a=u(i.activeCell),o=J(a[0],a[1],i,!1,!0);if(ct(this.parent,a[0],a[1],this.parent.activeSheetIndex)){var s=this.parent.getCell(a[0],a[1]),l=!1,h=s.innerHTML;if(s&&h.indexOf("<")>-1&&h.indexOf(">")>-1&&h.indexOf("input")>-1&&(l=!0),l)return}this.updateEditCellDetail(e,t),this.initiateEditor(r),this.positionEditor(),this.parent.isEdit=this.isEdit=!0,this.parent.notify("clearCopy",null),this.parent.notify("enableToolbarItems",[{enable:!1}]),o.formula&&!n&&this.parent.notify("initiateFormulaReference",{range:o.formula,formulaSheetIdx:this.editCellData.sheetIndex})},e.prototype.setCursorPosition=function(){var e=this.getEditElement(this.parent.getActiveSheet()),t=e.textContent.length;if(t){var r=document.getSelection(),n=document.createRange();n.setStart(e.firstChild,t),n.collapse(!0),r.removeAllRanges(),r.addRange(n)}e.focus()},e.prototype.hasFormulaSuggSelected=function(){var e=document.getElementById(this.parent.element.id+"_ac_popup");return e&&"visible"===e.style.visibility&&e.querySelectorAll(".e-item-focus").length>0},e.prototype.editingHandler=function(e){var t=document.getElementsByClassName("e-ss-overlay-active"),r=t.length;switch(e){case"delete":if(r>0)t[0].classList.contains("e-datavisualization-chart")?this.parent.notify(br,{id:t[0].id,sheetIdx:this.parent.activeSheetIndex+1}):this.parent.notify(Cr,{id:t[0].id,sheetIdx:this.parent.activeSheetIndex+1});else{var n=this.parent.getActiveSheet(),i=n.selectedRange;this.parent.notify(cr,{action:"cellDelete",eventArgs:{address:n.name+"!"+i}});var a=y(i);i=m(a=a[0]>a[2]?S(a):a),this.parent.clearRange(i,null,!0),this.parent.serviceLocator.getService("cell").refreshRange(a),this.parent.notify("selectionComplete",{}),this.parent.notify(pr,{action:"cellDelete",eventArgs:{address:n.name+"!"+i}})}}},e.prototype.getCurPosition=function(){var e={},t=window.getSelection();if(this.editorElem.textContent===this.editCellData.value&&(e.start=t.anchorOffset,e.end=t.focusOffset,e.start>e.end)){var r=e.start;e.start=e.end,e.end=r}if(t&&t.focusNode&&t.focusNode.classList&&t.focusNode.classList.contains("e-formula-bar-panel")&&this.editorElem.textContent===this.editCellData.value){var n=t.focusNode.getElementsByClassName("e-formula-bar e-css")[0];e.start=n.selectionStart,e.end=n.selectionEnd}return e},e.prototype.mouseDownHandler=function(e){if(!t.closest(e.target,".e-findtool-dlg")&&this.isEdit){var r=this.getCurPosition();r.start&&(this.curStartPos=this.selectionStart=r.start),r.end&&(this.curEndPos=this.selectionEnd=r.end);var n=e.target,i=this.parent.getActiveSheet(),a=this.parent.element.querySelector(".e-formularef-indicator");this.isCellEdit=n.classList.contains("e-spreadsheet-edit");var o=q(this.editCellData.value,!0),s=this.getEditElement(i);if(n.classList.contains("e-cell")||n.classList.contains("e-header-cell")||n.classList.contains("e-selectall")||t.closest(n,".e-toolbar-item.e-active")||t.closest(n,".e-table")){if(this.isAltEnter){var l=s.textContent;l&&l.indexOf("\n")>-1&&(this.isAltEnter=!1,te(this.parent.getActiveSheet().selectedRange,!0,this.parent),this.refreshEditor(s.textContent,this.isCellEdit))}if(!o||this.endFormulaRef)this.endFormulaRef=!1,this.endEdit(!1,e);else{var h=this.selectionEnd,d=u(i.activeCell),p=J(d[0],d[1],i);if(this.selectionStart!==this.selectionEnd&&this.editCellData.value===s.textContent&&-1!==this.validCharacters.indexOf(s.textContent.substring(this.selectionStart-1,this.selectionStart))&&j(s.textContent.substring(this.selectionStart,this.selectionEnd))&&s.textContent.indexOf(":")!==this.selectionEnd&&(this.editCellData.value=s.textContent.substring(0,this.selectionStart)+s.textContent.substring(this.selectionEnd,s.textContent.length)),this.editCellData.value===s.textContent&&s.textContent.indexOf("(")!==s.textContent.length-1&&-1!==s.textContent.indexOf("(")&&this.selectionStart===this.selectionEnd)if(this.editCellData.sheetIndex!==i.id-1){var c=this.parent.element.querySelector(".e-formula-bar");if(","!==s.textContent.substring(c.selectionEnd-1,c.selectionEnd)&&!e.shiftKey)return a&&a.parentElement.removeChild(a),this.parent.goTo(this.editCellData.fullAddr),void this.endEdit(!1,e)}else if(-1===this.validCharacters.indexOf(s.textContent.substring(h-1,h)))return a&&a.parentElement.removeChild(a),void this.endEdit(!1,e);if(!p)return;if((o=!!p.formula&&(q(J(d[0],d[1],i).formula)||this.editCellData.value&&0===this.editCellData.value.toString().indexOf("=")))&&this.parent.isEdit){var f=this.selectionEnd;this.editCellData.value.length===f?(")"===this.editCellData.value.substring(this.editCellData.value.length-1)||L(this.editCellData.value.substring(this.editCellData.value.length-1)))&&(a&&a.parentElement.removeChild(a),this.endEdit(!1,e)):this.editCellData.value===s.textContent&&(-1===this.validCharacters.indexOf((this.editCellData.value+i.selectedRange).substring(f-1,f))?(a&&a.parentElement.removeChild(a),this.endEdit(!1,e)):(-1===this.validCharacters.indexOf(s.textContent.substring(f-1,f))||")"!==s.textContent.substring(f,f+1)&&-1===this.validCharacters.indexOf(s.textContent.substring(f,f+1)))&&(a&&a.parentElement.removeChild(a),this.endEdit(!1,e)))}}}else if(o&&this.editCellData.value===s.textContent&&s.textContent.indexOf("(")!==s.textContent.length-1&&!this.isCellEdit&&-1===this.validCharacters.indexOf(this.editCellData.value.substring(this.selectionStart-1,this.selectionStart))&&this.editCellData.sheetIndex===i.id-1){h=window.getSelection().focusOffset;if(-1===this.validCharacters.indexOf(s.textContent.substring(h-1,h)))return a&&a.parentElement.removeChild(a),this.parent.goTo(this.editCellData.fullAddr),void this.endEdit(!1,e)}}},e.prototype.dblClickHandler=function(e){var r=e.target,n=this.parent.getActiveSheet(),i=u(n.activeCell),a=J(i[0],i[1],n)||{};if(!t.closest(r,".e-datavisualization-chart"))if(n.isProtected&&X(a,Te(n,i[1])))(r.classList.contains("e-active-cell")||r.classList.contains("e-cell"))&&this.parent.notify("editAlert",null);else if(r.className.indexOf("e-ss-overlay")<0&&(r.classList.contains("e-active-cell")||r.classList.contains("e-cell")||t.closest(r,".e-sheet-content")||r.classList.contains("e-table")))if(this.isEdit)if(q(this.editCellData.value)){var o=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.indexOf("!"));this.parent.getActiveSheet().name===o&&this.endEdit()}else r.className.indexOf("e-spreadsheet-edit")<0&&this.endEdit();else this.isNewValueEdit=!1,this.startEdit()},e.prototype.updateEditCellDetail=function(e,r){var n,i;if(n=t.isNullOrUndefined(this.editCellData.sheetIndex)?e&&e.split("!").length>1?se(this.parent,he(e)):this.parent.activeSheetIndex:this.editCellData.sheetIndex,this.editCellData.addr?q(this.editCellData.value,!0)&&(i=fe(this.parent,n),this.isNewValueEdit=!1):(i=fe(this.parent,n),e=e?C(e):i.activeCell),e){var a=c(e),o=a[0],s=a[1],l=this.parent.getCell(o,s),h=qe(i,a,this.parent.frozenRowCount(i),this.parent.frozenColCount(i),this.parent.viewport.beforeFreezeHeight,this.parent.viewport.beforeFreezeWidth,this.parent.sheetModule.colGroupWidth);this.editCellData={addr:e,fullAddr:Ce(this.parent,n)+"!"+e,rowIndex:o,colIndex:s,sheetIndex:n,element:l,value:r||"",position:h}}},e.prototype.initiateEditor=function(e){var r=this;this.parent.getData(this.editCellData.fullAddr).then(function(n){n.forEach(function(n){var i={cell:n,value:n?n.value:""};r.parent.notify("getFormattedBarText",i);var a=n?i.value:"";n&&n.formula&&(a=n.formula),r.editCellData.oldValue=a,r.editCellData.value?a=r.editCellData.value:r.editCellData.value=a,r.isNewValueEdit?a="":r.isNewValueEdit=!0,t.isUndefined(a)||r.refreshEditor(a,!1,!0,!1,!1),e&&r.setCursorPosition(),r.triggerEvent("cellEdit")&&r.cancelEdit(!0,!1)})})},e.prototype.positionEditor=function(e){var r,n=this.editCellData.element,i={isEdit:!1};if(this.parent.notify("isFormulaBarEdit",i),i.isEdit&&t.isNullOrUndefined(n)&&(n=r=this.parent.getCell(this.editCellData.rowIndex,this.editCellData.colIndex),this.editCellData.element=r),n){n.classList.add("e-ss-edited");var a=this.parent.getActiveSheet(),o=J(this.editCellData.rowIndex,this.editCellData.colIndex,a,!1,!0),s=this.editCellData.position.left+1,l=this.editCellData.position.top+1,h={range:[this.editCellData.rowIndex,this.editCellData.colIndex,this.editCellData.rowIndex,this.editCellData.colIndex]};this.parent.notify("activeCellMergedRange",h);var d=Ae(a,h.range[0],h.range[2])-3,p=Ne(a,h.range[1],h.range[3])-3,c=this.parent.element.getElementsByClassName("e-main-panel")[0],u=void 0,f=this.parent.frozenColCount(a),g=void 0,m=void 0,v=this.parent.frozenRowCount(a),y=void 0;this.editCellData.colIndex<f?(u=Math.abs(this.parent.getRowHeaderContent().getBoundingClientRect()[this.parent.enableRtl?"left":"right"]-n.getBoundingClientRect()[this.parent.enableRtl?"right":"left"])-1,this.editCellData.rowIndex<v?"2"===this.parent.getRowHeaderContent().style.zIndex&&(g="3"):mt(o.value,o.style,this.parent.cellStyle)>u&&(y=!0)):u=c.offsetWidth-s-28-this.parent.sheetModule.getRowHeaderWidth(a),this.editCellData.rowIndex<v&&(m=!0);var C=!m&&(o&&o.wrap||n&&e||y)?"auto;":d+"px;",b="display:block;top:"+l+"px;"+(this.parent.enableRtl?"right:":"left:")+s+"px;min-width:"+p+"px;max-width:"+(o&&o.wrap?p:u)+"px;height:"+C+(o&&o.wrap?"width:"+p+"px;":"")+"min-height:"+d+"px;"+(g?"z-index: "+g+";":"")+(m&&(o&&!o.wrap||n&&e)&&(mt(o.value,o.style,this.parent.cellStyle)>u||n&&e)?"overflow: auto;":"");b+=n.style.cssText;var x=this.getEditElement(a,!0);x.setAttribute("style",b),mt(x.textContent,o.style,this.parent.cellStyle)>u&&(x.style.height="auto"),this.parent.element.querySelector(".e-active-cell").style.height=d+4+"px",n.classList.contains("e-right-align")?x.classList.add("e-right-align"):n.classList.contains("e-center-align")&&x.classList.add("e-center-align")}},e.prototype.updateEditedValue=function(e){void 0===e&&(e=!0);var t=this.editCellData.oldValue,r=t?t.toString().toUpperCase():"",n=!0,i=this.editCellData.addr,a=c(this.parent.getActiveSheet().activeCell),o=this.parent.getActiveSheet(),s=J(a[0],a[1],o),l=Te(o,a[1]);if(this.parent.notify("setActionData",{args:{action:"beforeCellSave",eventArgs:{address:this.editCellData.addr}}}),this.parent.allowDataValidation&&(s&&s.validation||l&&l.validation)){var h=this.getEditElement(o).innerText,d=this.parent.activeSheetIndex,p=void 0;p="string"==typeof i?c(i):i,this.parent.notify("isValidation",{value:h,range:p,sheetIdx:d,isCell:!0}),n=this.parent.allowDataValidation,this.editCellData.value=n?h:this.editCellData.value,this.parent.allowDataValidation=!0}if((t!==this.editCellData.value||r.indexOf("=RAND()")>-1||r.indexOf("RAND()")>-1||r.indexOf("=RANDBETWEEN(")>-1||r.indexOf("RANDBETWEEN(")>-1)&&n){var u=this.parent.getActiveSheet(),f=c(u.activeCell);this.parent.notify("workbookEditOperation",{action:"updateCellValue",address:this.editCellData.addr,value:this.editCellData.value});var g=J(f[0],f[1],u,!0),m=this.getRefreshNodeArgs(g,f[0],f[1]);this.editCellData.value=m.value,g&&g.formula&&(this.editCellData.formula=g.formula),g&&g.wrap&&this.parent.notify(Ot,{range:f,wrap:!0,sheet:u}),e&&this.parent.refreshNode(this.editCellData.element,m)}return n},e.prototype.refreshDependentCellValue=function(e,t,r){if(e&&t&&(e--,t--,(this.editCellData.rowIndex!==e||this.editCellData.colIndex!==t)&&this.parent.activeSheetIndex===r)){var n=this.parent.getCell(e,t);if(n){var i=J(e,t,fe(this.parent,r)),a=this.getRefreshNodeArgs(i,e,t);this.parent.refreshNode(n,a)}}},e.prototype.getRefreshNodeArgs=function(e,t,r){var n=(e=e||{})&&e.format?e.format:"",i={value:e.value,format:n,onLoad:!0,rowIdx:t,colIdx:r,formattedText:"",isRightAlign:!1,type:"General",cell:e};return this.parent.notify("getFormattedCell",i),i.formattedText=this.parent.allowNumberFormatting?i.formattedText:i.value,{isRightAlign:i.isRightAlign,result:i.formattedText,type:i.type,value:i.value,curSymbol:i.curSymbol}},e.prototype.endEdit=function(e,t){void 0===e&&(e=!1);var r=u(this.parent.getActiveSheet().activeCell),n=this.parent.getCell(r[0],r[1]),i="";if(this.editCellData.element&&this.editCellData.element.children[0]&&"e-cf-databar"===this.editCellData.element.children[0].className&&(i=n.children[0].querySelector(".e-databar-value").style.fontSize),e&&this.refreshEditor(this.editCellData.oldValue,!1,!0,!1,!1),this.triggerEvent("beforeCellSave"))return void t.preventDefault();this.updateEditedValue()?(this.triggerEvent("cellSave",t),this.resetEditState(),this.focusElement()):t&&t.preventDefault(),""!==i&&(n.children[0].querySelector(".e-databar-value").style.fontSize=i),this.parent.showSheetTabs&&!this.parent.isProtected&&this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled")},e.prototype.cancelEdit=function(e,t,r){void 0===e&&(e=!0),void 0===t&&(t=!0),this.refreshEditor(this.editCellData.oldValue,e,!1,!1,!1),t&&this.triggerEvent("cellSave",r),this.resetEditState(),this.focusElement()},e.prototype.focusElement=function(){Et(this.parent.element),this.parent.notify("enableToolbarItems",[{enable:!0}])},e.prototype.triggerEvent=function(e,t){var r=J(this.editCellData.rowIndex,this.editCellData.colIndex,this.parent.getActiveSheet()),n={element:this.editCellData.element,value:this.editCellData.value,oldValue:this.editCellData.oldValue,address:this.editCellData.fullAddr,displayText:this.parent.getDisplayText(r)};return n.value!==n.oldValue&&("cellSave"===e&&(this.editCellData.formula&&(n.formula=this.editCellData.formula),n.originalEvent=t,this.parent.notify(pr,{eventArgs:n,action:"cellSave"})),"cellSave"!==e&&(n.cancel=!1)),this.parent.trigger(e,n),n.cancel},e.prototype.altEnter=function(){this.positionEditor(!0);var e,t=window.getSelection(),r=t.anchorNode,n=document.createRange();0===(e=3===r.nodeType?t.anchorOffset:r.textContent.length)&&r.textContent.length>0&&(e=r.textContent.length);var i=r.textContent,a=i.slice(0,e),o=i.slice(e)||" ";r.textContent=a+"\n"+o,n=document.createRange(),3===r.nodeType?(n.setStart(r,e+1),n.setEnd(r,e+1)):1===r.nodeType&&(n.setStart(r.firstChild,e+1),n.setEnd(r.firstChild,e+1)),t.removeAllRanges(),t.addRange(n)},e.prototype.resetEditState=function(e){if(void 0===e&&(e=!0),e){var r=this.getEditElement(this.parent.getActiveSheet());q(r.textContent)&&this.parent.notify("clearCellRef",null),this.editCellData.element&&(this.editCellData.element.classList.remove("e-ss-edited"),this.editorElem.textContent="",r===this.editorElem?(this.editorElem.removeAttribute("style"),this.editorElem.classList.remove("e-right-align")):t.detach(r))}this.editCellData={},this.parent.isEdit=this.isEdit=!1,this.isCellEdit=!0,this.parent.notify("formulaOperation",{action:"endEdit"})},e.prototype.refSelectionRender=function(){var e=this.getEditElement(this.parent.getActiveSheet());e&&q(e.textContent)&&this.parent.notify("initiateFormulaReference",{range:e.textContent,formulaSheetIdx:this.editCellData.sheetIndex})},e.prototype.initiateRefSelection=function(){var e=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.indexOf("!")),t=this.parent.element.querySelector(".e-formula-bar").value;this.parent.getActiveSheet().name===e&&q(this.editCellData.value,!0)?(this.startEdit(this.editCellData.addr,t,!1),this.parent.notify("initiateFormulaReference",{range:this.editCellData.value,formulaSheetIdx:this.editCellData.sheetIndex}),this.getEditElement(this.parent.getActiveSheet()).innerHTML=t,this.initiateCurPosition()):this.initiateCurPosition()},e.prototype.addressHandler=function(e){var t=window.getSelection();if(this.selectionStart=t.anchorOffset,this.selectionEnd=t.focusOffset,this.selectionStart>this.selectionEnd){var r=this.selectionStart;this.selectionStart=this.selectionEnd,this.selectionEnd=r}if(t&&t.focusNode&&t.focusNode.classList&&t.focusNode.classList.contains("e-formula-bar-panel")){var n=t.focusNode.getElementsByClassName("e-formula-bar e-css")[0];this.selectionStart=n.selectionStart,this.selectionEnd=n.selectionEnd}var i={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,i);var a=e.range,o=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.indexOf("!")),s=this.editCellData.sheetIndex,l=this.getEditElement(this.parent.getActiveSheet());if(this.parent.getActiveSheet().name!==o&&(a="'"+this.parent.getActiveSheet().name+"'!"+a),e.isSelect)this.parent.notify("initiateFormulaReference",{range:i.editedValue+a,formulaSheetIdx:s});else{var h=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.indexOf("!"));if(this.parent.getActiveSheet().name===h){var d=i.editedValue;this.selectionStart!==this.selectionEnd?(this.formulaBarCurStartPos=this.selectionStart,this.curStartPos=this.selectionStart,this.curEndPos=this.selectionStart+a.length,l.textContent=d.substring(0,this.selectionStart)+a+d.substring(this.selectionStart)):d.indexOf(")")===d.length-1&&this.selectionEnd===d.length?(l.textContent=d.substring(0,d.length-1)+a+d.substring(d.length-1),this.curEndPos=l.textContent.length-1):d.indexOf(")")!==d.length-1?(l.textContent=d+a,this.curEndPos=l.textContent.length):l.textContent!==d?(l.textContent=d.substring(0,this.curStartPos)+a+d.substring(this.curStartPos),this.curEndPos=this.curStartPos+a.length):this.selectionStart!==this.selectionEnd||-1===this.validCharacters.indexOf(d.substring(this.selectionStart-1,this.selectionEnd))||-1===this.validCharacters.indexOf(d.substring(this.selectionStart,this.selectionEnd+1))&&")"!==d.substring(this.selectionStart,this.selectionEnd+1)||(l.textContent=d.substring(0,this.selectionStart)+a+d.substring(this.selectionEnd),this.curStartPos=this.selectionStart,this.curEndPos=this.selectionStart+a.length,this.formulaBarCurStartPos=this.curStartPos)}}},e.prototype.updateFormulaBarValue=function(){var e=window.getSelection(),r=this.editCellData.value,n=this.parent.getActiveSheet().selectedRange;n=I(y(n))?n.split(":")[0]:n;var i=this.parent.element.querySelector(".e-formula-bar");if(r&&q(r,!0)){var a=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.indexOf("!"));this.parent.getActiveSheet().name!==a&&(n="'"+this.parent.getActiveSheet().name+"'!"+n),t.isNullOrUndefined(this.formulaBarCurStartPos)?r.indexOf(")")===r.length-1&&e.focusOffset===r.length?i.value=r.substring(0,r.length-1)+n+r.substring(r.length-1):r.indexOf(")")!==r.length-1?i.value=r+n:i.value!==r&&(i.value=r.substring(0,this.curStartPos)+n+r.substring(this.curStartPos)):i.value=r.substring(0,this.formulaBarCurStartPos)+n+r.substring(this.formulaBarCurStartPos),this.curEndPos=this.curStartPos+n.length}},e.prototype.setFormulaBarCurPosition=function(e,t,r){e.setSelectionRange&&(e.focus(),e.selectionStart=t,e.selectionEnd=t,e.setSelectionRange(t,r))},e.prototype.initiateCurPosition=function(e){void 0===e&&(e={isCellEdit:!1});var t=this.getEditElement(this.parent.getActiveSheet(),!0);if(e.isCellEdit){var r=this.getCurPosition();return void(this.endFormulaRef||r.start!==r.end||(this.updateFormulaReference(t),r.end&&-1===this.validCharacters.indexOf(this.editCellData.value[r.end-1])&&(this.endFormulaRef=!0)))}var n=t.innerText,i=window.getSelection();if(i&&i.focusNode&&i.focusNode.classList&&i.focusNode.classList.contains("e-formula-bar-panel")){var a=this.parent.element.querySelector(".e-formula-bar");return void this.setFormulaBarCurPosition(a,this.curEndPos,this.curEndPos)}if(n){var o=document.createRange();n.indexOf(")"),n.length,o.setStart(t.childNodes[0],this.curEndPos),o.setEnd(t.childNodes[0],this.curEndPos),i.removeAllRanges(),i.addRange(o)}if(this.editCellData.sheetIndex!==this.parent.getActiveSheet().id-1){var s=this.parent.element.querySelector(".e-formula-bar");if(s.value){var l=s.value.length;s.value.indexOf(")")===l-1?this.setFormulaBarCurPosition(s,l-1,l-1):this.setFormulaBarCurPosition(s,l,l)}}},e.prototype.getEditElement=function(e,t){if((this.isEdit||t)&&(e.frozenRows||e.frozenColumns)){var r=this.parent.frozenRowCount(e),n=this.parent.frozenColCount(e),i=u(e.activeCell),a=void 0;if(i[0]<r&&i[1]<n)a=this.parent.getSelectAllContent();else if(i[0]<r)a=this.parent.getColumnHeaderContent();else{if(!(i[1]<n))return this.editorElem;a=this.parent.getRowHeaderContent()}var o=a.getElementsByClassName("e-spreadsheet-edit")[0];return!o&&t&&(o=a.appendChild(this.editorElem.cloneNode())),o}return this.editorElem},e}(),jn=function(){function e(e){this.uniqueOBracket=String.fromCharCode(129),this.uniqueCBracket=String.fromCharCode(130),this.uniqueCSeparator=String.fromCharCode(131),this.uniqueCOperator=String.fromCharCode(132),this.uniquePOperator=String.fromCharCode(133),this.uniqueSOperator=String.fromCharCode(134),this.uniqueMOperator=String.fromCharCode(135),this.uniqueDOperator=String.fromCharCode(136),this.uniqueModOperator=String.fromCharCode(137),this.uniqueConcateOperator=String.fromCharCode(138),this.uniqueEqualOperator=String.fromCharCode(139),this.uniqueExpOperator=String.fromCharCode(140),this.uniqueGTOperator=String.fromCharCode(141),this.uniqueLTOperator=String.fromCharCode(142),this.invalidOperators=["%"],this.formulaRange=[],this.tableRangesFormula={},this.parent=e,this.addEventListener(),this.mouseMoveEvt=this.mouseMoveHandler.bind(this)}return e.prototype.addEventListener=function(){this.parent.on("contentLoaded",this.init,this),this.parent.on("mouseDown",this.mouseDownHandler,this),this.parent.on("virtualContentLoaded",this.virtualContentLoadedHandler,this),this.parent.on("cellNavigate",this.cellNavigateHandler,this),this.parent.on("selectRange",this.selectRange,this),this.parent.on(sr,this.rowHeightChanged,this),this.parent.on("colWidthChanged",this.colWidthChanged,this),this.parent.on("protectSelection",this.protectHandler,this),this.parent.on("initiateFormulaReference",this.initiateFormulaSelection,this),this.parent.on("clearCellRef",this.clearBorder,this),this.parent.on("getRowIdxFromClientY",this.getRowIdxFromClientY,this),this.parent.on("getColIdxFromClientX",this.getColIdxFromClientX,this),this.parent.on("focusBorder",this.chartBorderHandler,this),this.parent.on("selectionStatus",this.isTouchSelectionStarted,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contentLoaded",this.init),this.parent.off("mouseDown",this.mouseDownHandler),this.parent.off("virtualContentLoaded",this.virtualContentLoadedHandler),this.parent.off("cellNavigate",this.cellNavigateHandler),this.parent.off("selectRange",this.selectRange),this.parent.off(sr,this.rowHeightChanged),this.parent.off("colWidthChanged",this.colWidthChanged),this.parent.off("protectSelection",this.protectHandler),this.parent.off("initiateFormulaReference",this.initiateFormulaSelection),this.parent.off("clearCellRef",this.clearBorder),this.parent.off("getRowIdxFromClientY",this.getRowIdxFromClientY),this.parent.off("getColIdxFromClientX",this.getColIdxFromClientX),this.parent.off("focusBorder",this.chartBorderHandler),this.parent.off("selectionStatus",this.isTouchSelectionStarted))},e.prototype.isTouchSelectionStarted=function(e){e.touchSelectionStarted=this.touchSelectionStarted},e.prototype.rowHeightChanged=function(e){var t=this;Be(function(){var r=t.getActiveCell(),n=t.parent.getActiveSheet();if(r){var i=u(n.activeCell);if(n.frozenRows||n.frozenColumns){var a={range:[i[0],i[1],i[0],i[1]]};t.parent.notify("activeCellMergedRange",a),je(t.parent,r,a.range,"e-active-cell")}else i[0]===e.rowIdx?r.style.height=parseFloat(r.style.height)+e.threshold+"px":i[0]>e.rowIdx&&(r.style.top=parseFloat(r.style.top)+e.threshold+"px")}if(r=t.getSelectionElement()){var o=c(n.selectedRange),s=S(o),l={range:s,isActiveCell:!1,skipChecking:!0};if(t.parent.notify("mergedRange",l),l.isActiveCell||s[0]===s[2]&&s[1]===s[3])return;if(n.frozenRows||n.frozenColumns)return void je(t.parent,r,o);var h=s[0],d=s[2];h<=e.rowIdx&&d>=e.rowIdx&&r?r.style.height=parseFloat(r.style.height)+e.threshold+"px":h>e.rowIdx&&r&&(r.style.top=parseFloat(r.style.top)+e.threshold+"px")}})},e.prototype.colWidthChanged=function(e){var t=this;Be(function(){var r=t.parent.getActiveSheet(),n=t.getActiveCell();if(n){var i=u(t.parent.getActiveSheet().activeCell);if(r.frozenRows||r.frozenColumns){var a={range:[i[0],i[1],i[0],i[1]]};t.parent.notify("activeCellMergedRange",a),je(t.parent,n,a.range,"e-active-cell")}else i[1]===e.colIdx?n.style.width=parseFloat(n.style.width)+e.threshold+"px":i[1]>e.colIdx&&(n.style.left=parseFloat(n.style.left)+e.threshold+"px")}n=t.getSelectionElement();var o=c(t.parent.getActiveSheet().selectedRange),s=S(o),l={range:s,isActiveCell:!1,skipChecking:!0};if(t.parent.notify("mergedRange",l),!(l.isActiveCell||s[0]===s[2]&&s[1]===s[3])){if(r.frozenRows||r.frozenColumns)return void je(t.parent,n,o);var h=s[1],d=s[3];h<=e.colIdx&&d>=e.colIdx&&n?n.style.width=parseFloat(n.style.width)+e.threshold+"px":h>e.colIdx&&n&&(n.style.left=parseFloat(n.style.left)+e.threshold+"px")}})},e.prototype.selectRange=function(e){e.address="Single"===this.parent.selectionSettings.mode?m(u(e.address)):e.address,this.selectMultiRange(e.address,null,null,e.skipChecking)},e.prototype.init=function(){this.createSelectionElement();var e=this.parent.getActiveSheet(),t=S(c(e.selectedRange)),r=u(e.activeCell),n=t[0]<=r[0]&&t[2]>=r[0]&&t[1]<=r[1]&&t[3]>=r[1];this.selectMultiRange(e.selectedRange,!0,n)},e.prototype.selectMultiRange=function(e,t,r,n){var i=this,a=this.parent.activeSheetIndex;e.indexOf("!")>-1&&(a=se(this.parent,he(e)),e=e.split("!")[1]),this.parent.activeSheetIndex===a?e.split(" ").forEach(function(e,a){i.selectRangeByIdx(c(e),{type:"mousedown",ctrlKey:0!==a},null,r,t,n)}):pe(this.parent,e,this.parent.sheets[a])},e.prototype.createSelectionElement=function(){var e=this.parent.getMainContent(),t=this.parent.createElement("div",{className:"e-selection"});e.appendChild(t),t=this.parent.createElement("div",{className:"e-active-cell"}),e.appendChild(t)},e.prototype.mouseDownHandler=function(e){if(!(t.closest(e.target,".e-scrollbar")||e.target.classList.contains("e-main-panel")||e.target.classList.contains("e-sheet"))){var r={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,r);var n=q(r.editedValue,!0);if(!this.parent.isEdit||n){var i=document.getElementById(this.parent.element.id+"_overlay");if("string"==typeof e.target.className){if(e.target.className.indexOf("e-ss-overlay")>-1)return}else i&&i.classList.remove("e-ss-overlay-active");if(t.closest(e.target,".e-datavisualization-chart"))return;if(this.parent.getActiveSheet().isProtected&&!this.parent.getActiveSheet().protectSettings.selectCells)return;if(!t.closest(e.target,".e-findtool-dlg")&&this.getSheetElement().contains(e.target)&&!e.target.classList.contains("e-colresize")&&!e.target.classList.contains("e-rowresize")){var a=this.parent.getActiveSheet(),o=this.parent.selectionSettings.mode,s=this.getRowIdxFromClientY({clientY:it(e),target:e.target}),l=this.getColIdxFromClientX({clientX:nt(e),target:e.target}),h=u(a.activeCell),d=void 0,p=void 0;if(a.showHeaders){var f=e.target;if(a.frozenColumns||a.frozenRows){var g=this.parent.getSelectAllContent().querySelector("thead");p=g?(this.parent.getColumnHeaderContent().contains(f)||g.contains(f))&&f.classList.contains("e-header-cell"):this.parent.getColumnHeaderContent().contains(f)&&f.classList.contains("e-header-cell"),d=(g=this.parent.getSelectAllContent().querySelector("tbody"))?(this.parent.getRowHeaderContent().contains(f)||g.contains(f))&&f.classList.contains("e-header-cell"):this.parent.getRowHeaderContent().contains(f)&&f.classList.contains("e-header-cell")}else d=this.parent.getRowHeaderContent().contains(e.target),p=this.parent.getColumnHeaderContent().contains(e.target)}if(3===e.which&&this.isSelected(s,l))return;if("Multiple"===o&&(!Qe(e)&&(!Ze(e)||Ze(e)&&h[0]===s&&h[1]===l)||p||d)?(document.addEventListener(Ke().split(" ")[0],this.mouseMoveEvt),t.Browser.isPointer||document.addEventListener(Ke().split(" ")[1],this.mouseMoveEvt,{passive:!1}),this.touchSelectionStarted=!0):this.touchSelectionStarted=!1,Qe(e)||t.EventHandler.add(document,$e(),this.mouseUpHandler,this),Ze(e)&&!p&&!d)return void(this.touchEvt=e);var m=c(a.topLeftCell);d?(this.isRowSelected=!0,e.shiftKey&&"Single"!==o||(this.startCell=[s,0]),this.selectRangeByIdx([this.startCell[0],a.frozenColumns?m[1]:0,s,a.colCount-1],e)):p?(this.isColSelected=!0,e.shiftKey&&"Single"!==o||(this.startCell=[0,l]),this.selectRangeByIdx([a.frozenRows?m[0]:0,this.startCell[1],a.rowCount-1,l],e)):t.closest(e.target,".e-select-all-cell")?(this.startCell=[a.frozenRows?m[0]:0,a.frozenColumns?m[1]:0],this.selectRangeByIdx([].concat(this.startCell,[a.rowCount-1,a.colCount-1]),e)):e.target.classList.contains("e-sheet-content")||(e.shiftKey&&"Single"!==o||(this.startCell=[s,l]),this.selectRangeByIdx([].concat(this.startCell?this.startCell:u(a.activeCell),[s,l]),e)),this.parent.isMobileView()&&(this.parent.element.classList.add("e-mobile-focused"),this.parent.renderModule.setSheetPanelSize())}}if(n&&(e.target.classList.contains("e-cell")||e.target.classList.contains("e-header-cell"))&&this.parent.isEdit){var v=this.parent.getActiveSheet().selectedRange;v=I(y(v))?v.split(":")[0]:v,this.parent.notify("addressHandle",{range:v,isSelect:!1})}}},e.prototype.mouseMoveHandler=function(e){var r=this,n=this.parent.getActiveSheet();Je(e)&&e.preventDefault();var i={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,i);var a=q(i.editedValue,!0),o=this.parent.getMainContent().parentElement,s=this.parent.element.getElementsByClassName("e-scroller")[0],l=o.getBoundingClientRect(),h=this.parent.frozenColCount(n),d=l.left+this.parent.sheetModule.getRowHeaderWidth(n),p=l.top,f=l.right,g=l.bottom,m=nt(e),v=it(e),y=this.isRowSelected?n.colCount-1:this.getColIdxFromClientX({clientX:Math.min(m,f),target:e.target}),C=this.isColSelected?n.rowCount-1:this.getRowIdxFromClientY({clientY:Math.min(v,g),target:e.target}),b=c(n.selectedRange),x={range:[C,y,C,y]};if(this.parent.notify("activeCellMergedRange",x),x.range[2]!==b[2]||x.range[3]!==b[3]){var S=this.parent.frozenRowCount(n),w=v>g&&C<n.rowCount,I=v<p&&C>=0&&!this.isColSelected&&!!o.scrollTop,E=m>f&&y<n.colCount,R=m<d&&y>=0&&!this.isRowSelected&&!!s.scrollLeft;this.clearInterval();var k,A;if(a||this.isColSelected||this.isRowSelected||(b=u(n.activeCell)),w||I||E||R)(I||R)&&(k=C,A=y),this.scrollInterval=setInterval(function(){if((w||I)&&!r.isColSelected){if((C=r.getRowIdxFromClientY({clientY:w?g:p}))>=n.rowCount)return void r.clearInterval();o.scrollTop+=(w?1:-1)*Re(n,C)}if((E||R)&&!r.isRowSelected){if((y=r.getColIdxFromClientX({clientX:E?f:d}))>=n.colCount)return void r.clearInterval();s.scrollLeft+=(E?1:-1)*Le(n,y)}if(I&&!o.scrollTop||R&&!s.scrollLeft)return r.selectRangeByIdx([].concat(b[0],b[1],[k,A]),e),void r.clearInterval();r.selectRangeByIdx([].concat(b[0],b[1],[C,y]),e)},100);else{var T=[].concat(b[0],b[1],[C,y]);S&&T[0]<S&&T[2]>=S&&o.scrollTop&&(o.scrollTop=0,T[2]=S),h&&T[1]<h&&T[3]>=h&&s.scrollLeft&&(s.scrollLeft=0,T[3]=h),this.selectRangeByIdx(T,e)}if(a&&this.parent.isEdit&&!t.closest(e.target,"#"+this.parent.element.id+"_edit")){var F=this.parent.getActiveSheet().selectedRange;this.parent.notify("addressHandle",{range:F,isSelect:!1})}}},e.prototype.mouseUpHandler=function(e){var r=this.getRowIdxFromClientY({clientY:it(e),target:e.target}),n=this.getColIdxFromClientX({clientX:nt(e),target:e.target});this.clearInterval(),!Qe(e)||this.isColSelected||this.isRowSelected||this.getRowIdxFromClientY({clientY:it(this.touchEvt),target:e.target})!==r||this.getColIdxFromClientX({clientX:nt(this.touchEvt),target:e.target})!==n||this.mouseDownHandler(e),this.parent.trigger("select",{range:this.parent.getActiveSheet().selectedRange}),document.removeEventListener(Ke().split(" ")[0],this.mouseMoveEvt),t.Browser.isPointer||document.removeEventListener(Ke().split(" ")[1],this.mouseMoveEvt),t.EventHandler.remove(document,$e(),this.mouseUpHandler),this.parent.notify("mouseUpAfterSelection",e);var i={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,i),(q(i.editedValue)||i.editedValue&&0===i.editedValue.toString().indexOf("="))&&this.parent.isEdit&&this.parent.notify("initiateCur",{isCellEdit:e.target.classList.contains("e-spreadsheet-edit")})},e.prototype.isSelected=function(e,t){var r=S(c(this.parent.getActiveSheet().selectedRange));return r[0]<=e&&e<=r[2]&&r[1]<=t&&t<=r[3]},e.prototype.virtualContentLoadedHandler=function(e){var t,r,n=this,i=this.parent.getActiveSheet(),a=c(i.selectedRange);i.selectedRange.split(" ").forEach(function(o,s){a=c(o),r=0===a[1]&&a[3]===e.prevRowColCnt.colCount-1,(t=0===a[0]&&a[2]===e.prevRowColCnt.rowCount-1)&&r?n.selectRangeByIdx([0,0,i.rowCount-1,i.colCount-1],null,!0,null,null,null,s):t?n.selectRangeByIdx([0,a[1],i.rowCount-1,a[3]],null,!0,null,null,null,s):r?n.selectRangeByIdx([a[0],0,a[2],i.colCount-1],null,!0,null,null,null,s):(a=c(o),n.highlightHdr(a,0!==s,a[0]>=n.parent.viewport.topIndex||a[2]>=n.parent.viewport.topIndex,a[1]>=n.parent.viewport.leftIndex||a[3]>=n.parent.viewport.leftIndex))})},e.prototype.clearInterval=function(){clearInterval(this.scrollInterval),this.scrollInterval=null},e.prototype.getScrollLeft=function(){return this.parent.scrollModule?this.parent.scrollModule.prevScroll.scrollLeft:0},e.prototype.cellNavigateHandler=function(e){var t=this.parent.getActiveSheet();t.isProtected&&!t.protectSettings.selectCells||this.selectRangeByIdx(e.range.concat(e.range))},e.prototype.getColIdxFromClientX=function(e){var r=0,n=this.parent.getActiveSheet(),i=0;if(e.isImage)i=e.clientX;else{var a=document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect();i=this.parent.enableRtl?a.right-this.parent.sheetModule.getRowHeaderWidth(n,!0)-1-e.clientX:e.clientX-(a.left+this.parent.sheetModule.getRowHeaderWidth(n,!0)+1),i+=this.parent.viewport.beforeFreezeWidth,e.target&&(!e.target||t.closest(e.target,".e-row-header")||t.closest(e.target,".e-selectall-container"))||(i+=this.getScrollLeft())}for(var o=0;;o++)if(r+=Le(n,o,null,!0),i<r||this.parent.scrollSettings.isFinite&&o===n.colCount-1)return e.isImage||(e.size=i),e.clientX=o,o},e.prototype.getRowIdxFromClientY=function(e){var r=0,n=this.parent.getActiveSheet(),i=0;if(e.isImage)i=e.clientY;else{var a=document.getElementById(this.parent.element.id+"_sheet");i=e.clientY+this.parent.viewport.beforeFreezeHeight-(a.getBoundingClientRect().top+(n.showHeaders?31:0)),(!e.target||e.target&&!t.closest(e.target,".e-header-panel"))&&(i+=this.parent.getMainContent().parentElement.scrollTop)}for(var o=0;;o++)if(r+=Re(n,o,!0),i<r||this.parent.scrollSettings.isFinite&&o===n.rowCount-1)return e.isImage||(e.size=i),e.clientY=o,o},e.prototype.initFormulaReferenceIndicator=function(e){if(this.parent.isEdit){var t=this.parent.createElement("div",{className:"e-formularef-indicator"});t.appendChild(this.parent.createElement("div",{className:"e-top"})),t.appendChild(this.parent.createElement("div",{className:"e-bottom"})),t.appendChild(this.parent.createElement("div",{className:"e-left"})),t.appendChild(this.parent.createElement("div",{className:"e-right"})),this.parent.getMainContent().appendChild(t),je(this.parent,t,e,"e-formularef-indicator")}},e.prototype.selectRangeByIdx=function(e,r,n,i,a,o,s){if(!(r&&r.target&&t.closest(r.target,"#"+this.parent.element.id+"_edit"))){var l={action:"getCurrentEditValue",editedValue:"",endFormulaRef:!1};this.parent.notify(Qt,l);var h,d=q(l.editedValue,!0)&&!l.endFormulaRef,p=r&&r.ctrlKey&&et(r),u=this.getSelectionElement(r,s),f=this.parent.getActiveSheet(),g=this.parent.element.querySelector(".e-formularef-indicator"),v={range:[].slice.call(e),isActiveCell:!1,skipChecking:o},y=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active");this.isColSelected||this.isRowSelected||this.parent.notify("mergedRange",v),e!==v.range&&(h=!0);var C={range:m(e=v.range),cancel:!1};if(this.parent.trigger("beforeSelect",C),!C.cancel){if(d&&g&&g.parentElement.removeChild(g),!I(e)&&!v.isActiveCell||p)if(d&&this.parent.isEdit)r&&r.target&&!r.target.classList.contains("e-spreadsheet-edit")&&this.parent.isEdit&&(this.parent.notify("addressHandle",{range:m(e),isSelect:!0}),this.initFormulaReferenceIndicator(e));else{u&&u.classList.remove("e-hide");var b=this.isColSelected&&this.isRowSelected?void 0:this.getOffset(e[2],e[3]);h&&b&&(b.left={idx:0,size:0}),je(this.parent,u,e)}else u&&(u.classList.contains("e-multi-range")||u.classList.add("e-hide"),(f.frozenRows||f.frozenColumns)&&(We(this.parent.getSelectAllContent(),null,!1),We(this.parent.getColumnHeaderContent(),null,!1),We(this.parent.getRowHeaderContent(),null,!1))),f.frozenColumns||f.frozenRows||!u||je(this.parent,u,e),d&&r&&r.target&&!r.target.classList.contains("e-spreadsheet-edit")&&this.parent.isEdit&&(this.parent.notify("addressHandle",{range:m(e).split(":")[0],isSelect:!0}),this.initFormulaReferenceIndicator(e));var x={action:"getCurrentEditSheetIdx",sheetIndex:null};this.parent.notify(Qt,x);var S=m(e);if(r&&r.ctrlKey&&(tt(r)||rt(r)))S=f.selectedRange.slice(0,f.selectedRange.lastIndexOf(" "))+" "+S;else if(s>-1){var w=f.selectedRange.split(" ");w[s]=S,S=w.join(" ")}d?a||pe(this.parent,S,f,p):pe(this.parent,S,f,p),this.UpdateRowColSelected(e),this.highlightHdr(e,r&&r.ctrlKey),n||r&&("mousemove"===r.type||Je(r))||(d?x.sheetIndex===this.parent.getActiveSheet().id-1&&a?(i=!0,this.updateActiveCell(i?c(f.activeCell):e,a)):this.parent.isEdit||this.updateActiveCell(i?c(f.activeCell):e,a):this.updateActiveCell(i?c(f.activeCell):e,a)),t.isNullOrUndefined(r)&&(r={type:"mousedown"}),d?a||this.parent.notify("selectionComplete",r):this.parent.notify("selectionComplete",r),this.parent.notify("showAggregate",{}),this.parent.notify("refreshImgElem",{}),y&&this.parent.notify("removeDesignChart",{}),this.parent.notify("clearChartBorder",{})}}},e.prototype.UpdateRowColSelected=function(e){var t=this.parent.getActiveSheet();this.isRowSelected=0===e[1]&&e[3]===t.colCount-1,this.isColSelected=0===e[0]&&e[2]===t.rowCount-1},e.prototype.updateActiveCell=function(e,t){var r,n,i,a=this.parent.getActiveSheet(),o=c(a.topLeftCell);this.isColSelected?(r=o[0],n=e[1],this.isRowSelected&&(n=o[1])):(r=e[0],n=e[1],this.isRowSelected&&(n=o[1]));var s={range:[r,n].concat([r,n])};if(this.parent.notify("activeCellMergedRange",s),e!==s.range&&(i=!0),e=s.range,a.activeCell!==g(e[0],e[1])||t){if(this.parent.setSheetPropertyOnMute(a,"activeCell",g(e[0],e[1])),a.isProtected){var l=this.parent.element.querySelector(".e-formula-bar"),h=X(J(e[0],e[1],a),Te(a,e[1]));h&&l&&!l.disabled?l.disabled=!0:!h&&l&&l.disabled&&(l.disabled=!1)}if(this.getActiveCell()){var d=this.getOffset(e[2],e[3]);i&&(d.left={idx:0,size:0}),je(this.parent,this.getActiveCell(),e,"e-active-cell")}this.parent.notify("activeCellChanged",null)}else je(this.parent,this.getActiveCell(),e,"e-active-cell")},e.prototype.getOffset=function(e,t){var r={left:{idx:0,size:0},top:{idx:0,size:0}};return this.parent.scrollModule&&(t>=this.parent.scrollModule.offset.left.idx&&(r.left=this.parent.scrollModule.offset.left),e>=this.parent.scrollModule.offset.top.idx&&(r.top=this.parent.scrollModule.offset.top)),r},e.prototype.getSelectionElement=function(e,r){if(e&&e.ctrlKey){if(rt(e)||tt(e))return this.parent.getMainContent().querySelector(".e-selection:last-child");var n=this.parent.element.getElementsByClassName("e-selection")[0];n.classList.remove("e-hide");var i=n.cloneNode();return i.classList.add("e-multi-range"),this.parent.getMainContent().appendChild(i)}return r>-1?this.parent.getMainContent().getElementsByClassName("e-selection")[r]:([].slice.call(this.parent.element.getElementsByClassName("e-multi-range")).forEach(function(e){t.remove(e)}),this.parent.getMainContent().getElementsByClassName("e-selection")[0])},e.prototype.getActiveCell=function(){return this.parent.getMainContent().getElementsByClassName("e-active-cell")[0]},e.prototype.getSheetElement=function(){return document.getElementById(this.parent.element.id+"_sheet")},e.prototype.highlightHdr=function(e,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),this.parent.getActiveSheet().showHeaders){var a=this.parent.getActiveSheet(),o=[],s=[],l=S(e);l=this.getHdrIndexes(l);var h=this.parent.element.getElementsByClassName("e-select-all-cell")[0];if(r||(t.removeClass(this.getSheetElement().querySelectorAll(".e-highlight"),"e-highlight"),t.removeClass(this.getSheetElement().querySelectorAll(".e-prev-highlight"),"e-prev-highlight")),h&&t.removeClass([h],["e-prev-highlight-right","e-prev-highlight-bottom"]),n){var d,p=this.parent.frozenRowCount(a),c=void 0;(C=this.parent.getSelectAllContent().querySelector("tbody"))&&(d=[].slice.call(C.querySelectorAll(".e-header-cell")));for(var f=[].slice.call(this.parent.getRowHeaderContent().querySelectorAll(".e-header-cell")),g=u(a.topLeftCell)[0],m=l[0];m<l[2]+1;m++)(c=m<p?d[m-g]:f[m-p])&&o.push(c)}if(i){var v,y=this.parent.frozenColCount(a),c=void 0,C=this.parent.getSelectAllContent().querySelector("thead");C&&(v=[].slice.call(C.querySelectorAll(".e-header-cell")));for(var f=[].slice.call(this.parent.getColumnHeaderContent().querySelectorAll("th")),b=u(a.topLeftCell)[1],m=l[1];m<l[3]+1;m++)(c=m<y?v[m-b]:f[m-y])&&s.push(c)}a.isProtected&&!a.protectSettings.selectCells?t.removeClass([].concat(o,s),"e-highlight"):t.addClass([].concat(o,s),"e-highlight"),o.length&&o[0].parentElement.previousElementSibling&&o[0].parentElement.previousElementSibling.classList.add("e-prev-highlight"),s.length&&s[0].previousElementSibling&&s[0].previousElementSibling.classList.add("e-prev-highlight"),this.isRowSelected&&this.isColSelected&&(a.isProtected&&!a.protectSettings.selectCells?document.getElementById(this.parent.element.id+"_select_all").classList.remove("e-highlight"):document.getElementById(this.parent.element.id+"_select_all").classList.add("e-highlight")),h&&(0===l[0]&&h.classList.add("e-prev-highlight-bottom"),0===l[1]&&h.classList.add("e-prev-highlight-right"))}},e.prototype.protectHandler=function(){var e=c(this.parent.getActiveSheet().selectedRange),t=S(e),r=u(this.parent.getActiveSheet().activeCell),n=t[0]<=r[0]&&t[2]>=r[0]&&t[1]<=r[1]&&t[3]>=r[1];this.selectRangeByIdx(e,null,null,n)},e.prototype.getHdrIndexes=function(e){if(this.parent.scrollSettings.enableVirtualization){var t=[],r=this.parent.hiddenCount(this.parent.viewport.topIndex,e[0]),n=this.parent.hiddenCount(this.parent.viewport.leftIndex,e[1],"columns");return t[0]=this.isColSelected?e[0]:e[0]-this.parent.viewport.topIndex<0?0:e[0]-r-this.parent.viewport.topIndex,t[1]=this.isRowSelected?e[1]:e[1]-this.parent.viewport.leftIndex<0?0:e[1]-n-this.parent.viewport.leftIndex,t[2]=this.isColSelected?this.parent.viewport.rowCount+2*this.parent.getThreshold("row"):e[2]-this.parent.hiddenCount(e[0],e[2])-r-this.parent.viewport.topIndex,t[3]=this.isRowSelected?this.parent.viewport.colCount+2*this.parent.getThreshold("col"):e[3]-this.parent.hiddenCount(e[1],e[3],"columns")-n-this.parent.viewport.leftIndex,t}return e},e.prototype.initiateFormulaSelection=function(e){this.processFormulaEditRange(e.range,e.formulaSheetIdx)},e.prototype.processFormulaEditRange=function(e,t){var r,n=t,i=0,a=this.parseFormula(e),o=a.length,s=0,l=[["e-vborderright","e-vborderbottom"],["e-pborderright","e-pborderbottom"],["e-cborderright","e-cborderbottom"],["e-gborderright","e-gborderbottom"],["e-oborderright","e-oborderbottom"],["e-bborderright","e-bborderbottom"]];this.clearBorder();for(var h=this.parent.getActiveSheet().id-1;i<o&&(r=a[i],!(this.invalidOperators.indexOf(r)>-1));){if(j(r.toUpperCase())){if(r=r.replace(/\$/g,""),i>0&&a[i-1].indexOf("!")===a[i-1].length-1){var d=a[i-1].split("!");n=se(this.parent,d[0].substring(1,d[0].length-1))}":"===a[i+1]&&a[++i+1]&&j(a[i+1].toUpperCase())&&(r=r+":"+a[i+1],i++),h===n&&this.updateFormulaEditRange(r,s,l),n=t,s++}i++}},e.prototype.updateFormulaEditRange=function(e,t,r){var n=c(e);this.formulaRange[t]=e,this.dStartCell={rowIndex:n[0],colIndex:n[1]},this.dEndCell={rowIndex:n[2],colIndex:n[3]},this.focusBorder(this.dStartCell,this.dEndCell,r[t%6])},e.prototype.chartBorderHandler=function(e){this.focusBorder(e.startcell,e.endcell,e.classes,!0)},e.prototype.focusBorder=function(e,r,n,i){i=!t.isNullOrUndefined(i)&&i;var a=S([e.rowIndex,e.colIndex,r.rowIndex,r.colIndex]),o=this.parent.getActiveSheet();if(o.frozenRows||o.frozenColumns){var s=this.parent.createElement("div",{className:i?"e-range-indicator e-chart-range":"e-range-indicator e-formuala-range"});return s.appendChild(this.parent.createElement("div",{className:"e-top"})),s.appendChild(this.parent.createElement("div",{className:"e-bottom"})),s.appendChild(this.parent.createElement("div",{className:"e-left"})),s.appendChild(this.parent.createElement("div",{className:"e-right"})),void je(this.parent,s,a,"e-range-indicator")}var l=a[0],h=a[1],d=a[2],p=a[3];l&&this.getEleFromRange([l-1,h,l-1,p]).forEach(function(e){e&&(e.classList.add(n[1]),i||e.classList.add("e-formularef-selection"))}),this.getEleFromRange([l,p,d,p]).forEach(function(e){e&&(e.classList.add(n[0]),i||e.classList.add("e-formularef-selection"))}),this.getEleFromRange([d,h,d,p]).forEach(function(e){e&&(e.classList.add(n[1]),i||e.classList.add("e-formularef-selection"))}),h&&this.getEleFromRange([l,h-1,d,h-1]).forEach(function(e){e&&(e.classList.add(n[0]),i||e.classList.add("e-formularef-selection"))})},e.prototype.getEleFromRange=function(e){var t,r,n,i,a=e[0],o=e[1],s=e[2],l=e[3],h=[],d=[];if(a>s&&(n=a,a=s,s=n),o>l&&(n=o,o=l,l=n),this.parent.scrollSettings.enableVirtualization)for(t=a;t<=s;t++)if((r=t)>-1){var p=this.parent.getRow(r,null);p&&(i=p.getElementsByClassName("e-cell"),h=l===o?[i[l]]:this.getRowCells(i,o,l+1),this.merge(d,h))}return d},e.prototype.getRowCells=function(e,t,r){var n=[];for(t;t<r;t++)e[t]&&n.push(e[t]);return n},e.prototype.merge=function(e,t){e&&t&&Array.prototype.push.apply(e,t)},e.prototype.clearBorder=function(){var e=this.parent.getActiveSheet();if(e.frozenColumns||e.frozenRows)return void[].slice.call(this.parent.element.getElementsByClassName("e-formuala-range")).forEach(function(e){t.detach(e)});for(var r=this.parent.element.getElementsByClassName("e-formularef-selection"),n=0;n<r.length;n++)for(var i=r[n],a=["e-vborderright","e-vborderbottom","e-pborderright","e-pborderbottom","e-cborderright","e-cborderbottom","e-gborderright","e-gborderbottom","e-oborderright","e-oborderbottom","e-bborderright","e-bborderbottom"],o=0;o<a.length;o++)i.classList.remove(a[o])},e.prototype.parseFormula=function(e){for(var t,r,n=0,i=[],a=(e=this.markSpecialChar(e.replace("=",""))).split(/\(|\)|=|\^|>|<|,|:|\+|-|\*|\/|%|&/g),o=a.length;n<o;)if(t=a[n]){if(1===t.length)i.push(this.isUniqueChar(t)?this.getUniqueCharVal(t):t);else if(r=t[0],t.indexOf("!")>0){this.isUniqueChar(r)&&(i.push(this.getUniqueCharVal(r)),t=t.substr(1));var s=t.indexOf("!")+1;i.push(t.substr(0,s)),i.push(t.substr(s))}else this.isUniqueChar(r)?(i.push(this.getUniqueCharVal(r)),i.push(t.substr(1))):i.push(t);n++}else n++;return i},e.prototype.isUniqueChar=function(e){var t=e.charCodeAt(e.charAt[0]);return t>=129&&t<=142},e.prototype.getUniqueCharVal=function(e){switch(e){case this.uniqueOBracket:return"(";case this.uniqueCBracket:return")";case this.uniqueCOperator:return":";case this.uniqueSOperator:return"-";case this.uniquePOperator:return"+";case this.uniqueMOperator:return"*";case this.uniqueDOperator:return"/";case this.uniqueModOperator:return"%";case this.uniqueCSeparator:return",";case this.uniqueConcateOperator:return"&";case this.uniqueEqualOperator:return"=";case this.uniqueExpOperator:return"^";case this.uniqueLTOperator:return"<";case this.uniqueGTOperator:return">"}return""},e.prototype.markSpecialChar=function(e){return e=e.replace(/\(/g,"("+this.uniqueOBracket).replace(/\)/g,")"+this.uniqueCBracket),e=e.replace(/,/g,","+this.uniqueCSeparator).replace(/:/g,":"+this.uniqueCOperator),e=e.replace(/\+/g,"+"+this.uniquePOperator).replace(/-/g,"-"+this.uniqueSOperator),e=e.replace(/\*/g,"*"+this.uniqueMOperator).replace(/\//g,"/"+this.uniqueDOperator),e=e.replace(/&/g,"&"+this.uniqueConcateOperator),e=e.replace(/=/g,"="+this.uniqueEqualOperator),e=e.replace(/\^/g,"^"+this.uniqueExpOperator),(e=e.replace(/>/g,">"+this.uniqueGTOperator).replace(/</g,"<"+this.uniqueLTOperator)).replace(/%/g,"%"+this.uniqueModOperator)},e.prototype.getModuleName=function(){return"selection"},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e}(),Wn=function(){function e(e){this.clientX=0,this.parent=e,this.addEventListener(),this.initProps()}return e.prototype.onContentScroll=function(e){var r,n,i=this.parent.getMainContent().parentElement,a=e.scrollLeft,o=e.scrollTop||i.scrollTop,s=a&&this.parent.enableRtl?this.initScrollValue-a:a;if(!t.isNullOrUndefined(a)&&this.prevScroll.scrollLeft!==s){var l=s>this.prevScroll.scrollLeft;n=this.offset.left.size,this.offset.left=this.getColOffset(s,l,e.skipHidden),e.preventScroll||(this.parent.getColumnHeaderContent().scrollLeft=a,this.parent.getMainContent().scrollLeft=a,e.scrollLeft=a),r={cur:this.offset.left,prev:{idx:this.leftIndex,size:n},increase:l,preventScroll:e.preventScroll},this.updateTopLeftCell(l),this.parent.notify("horizontalScroll",r),this.parent.scrollSettings.enableVirtualization||!l||this.parent.scrollSettings.isFinite||this.updateNonVirtualCols(),this.leftIndex=r.prev.idx,this.prevScroll.scrollLeft=s}if(this.prevScroll.scrollTop!==o){var h=o>this.prevScroll.scrollTop;n=this.offset.top.size,this.offset.top=this.getRowOffset(o,h),r={cur:this.offset.top,prev:{idx:this.topIndex,size:n},increase:h,preventScroll:e.preventScroll},this.updateTopLeftCell(h),this.parent.notify("verticalScroll",r),this.parent.scrollSettings.enableVirtualization||!h||this.parent.scrollSettings.isFinite||this.updateNonVirtualRows(),this.topIndex=r.prev.idx,this.prevScroll.scrollTop=o}var d={isEdit:!1};this.parent.notify("isFormulaBarEdit",d),d.isEdit&&this.parent.element.querySelector(".e-formula-bar").focus()},e.prototype.updateNonVirtualRows=function(){var e=this.parent.getActiveSheet(),t=this.parent.getThreshold("row");this.offset.top.idx>e.rowCount-(this.parent.viewport.rowCount+t)&&(this.parent.renderModule.refreshUI({rowIndex:e.rowCount,colIndex:0,direction:"first",refresh:"RowPart"},g(e.rowCount,0)+":"+g(e.rowCount+t-1,e.colCount-1)),this.parent.setSheetPropertyOnMute(e,"rowCount",e.rowCount+t),this.parent.viewport.bottomIndex=e.rowCount-1)},e.prototype.updateNonVirtualCols=function(){var e=this.parent.getActiveSheet(),t=this.parent.getThreshold("col");this.offset.left.idx>e.colCount-(this.parent.viewport.colCount+t)&&(this.parent.renderModule.refreshUI({rowIndex:0,colIndex:e.colCount,direction:"first",refresh:"ColumnPart"},g(0,e.colCount)+":"+g(e.rowCount-1,e.colCount+t-1)),this.parent.setSheetPropertyOnMute(e,"colCount",e.colCount+t),this.parent.viewport.rightIndex=e.colCount-1)},e.prototype.updateTopLeftCell=function(e){var t=this.parent.getActiveSheet(),r=this.offset.top.idx,n=this.offset.left.idx;e||(r=It(t,r,!0),n=It(t,n,!0,"columns")),this.parent.updateTopLeftCell(r,n)},e.prototype.getRowOffset=function(e,t){var r=this.offset.top.size,n=this.parent.getActiveSheet(),i=t?this.offset.top.idx+1:this.offset.top.idx?this.offset.top.idx-1:0,a=this.parent.frozenRowCount(n),o=this.parent.scrollSettings.isFinite?n.rowCount:1/0;for(e=Math.round(e);i<o;)if(t){if(r+=Re(n,i-1+a,!0),Math.abs(Math.round(r)-e)<=1)return{idx:i,size:r};if(Math.round(r)>e)return{idx:i-1,size:r-Re(n,i-1+a,!0)};i++}else{if(0===r)return{idx:0,size:0};if((r-=Re(n,i+a,!0))<0&&(r=0),Math.abs(Math.round(r)-e)<=1)return{idx:i,size:r};if(Math.round(r)<e)return r+=Re(n,i+a,!0),Math.round(r)>e?{idx:i,size:r-Re(n,i+a,!0)<0?0:r-Re(n,i+a,!0)}:{idx:i+1,size:r};i--}return{idx:this.offset.top.idx,size:this.offset.top.size}},e.prototype.getColOffset=function(e,t,r){var n=this.offset.left.size,i=this.parent.getActiveSheet(),a=t?this.offset.left.idx+1:this.offset.left.idx-1,o=this.parent.frozenColCount(i),s=this.parent.scrollSettings.isFinite?i.colCount:1/0;for(e=Math.round(e);a<s;)if(t){if(n+=Le(i,a-1+o,r,!0),Math.round(n)===e)return{idx:a,size:n};if(Math.round(n)>e)return{idx:a-1,size:n-Le(i,a-1+o,r,!0)};a++}else{if(0===n)return{idx:0,size:0};if(n-=Le(i,a+o,r,!0),Math.round(n)===e)return{idx:a,size:n};if(Math.round(n)<e)return n+=Le(i,a+o,r,!0),Math.round(n)>e?{idx:a,size:n-Le(i,a+o,r,!0)}:{idx:a+1,size:n};a--}return{idx:this.offset.left.idx,size:this.offset.left.size}},e.prototype.contentLoaded=function(e){if(!this.parent.scrollSettings.enableVirtualization){var t=this.parent.createElement("div",{className:"e-virtualtrack"});this.updateNonVirualScrollWidth({scrollTrack:t}),this.parent.getScrollElement().appendChild(t)}e.left&&(this.parent.getScrollElement().scrollLeft=e.left),this.setScrollEvent(),this.parent.enableRtl&&(this.initScrollValue=this.parent.getScrollElement().scrollLeft)},e.prototype.updateNonVirualScrollWidth=function(e){e.scrollTrack||(e.scrollTrack=this.parent.getScrollElement().getElementsByClassName("e-virtualtrack")[0]),e.scrollTrack.style.width=Math.abs(this.parent.getContentTable().getBoundingClientRect().width)+"px"},e.prototype.onHeaderWheel=function(e){e.preventDefault(),this.parent.getMainContent().parentElement.scrollTop+=e.deltaY,this.parent.getScrollElement().scrollLeft+=e.deltaX},e.prototype.onContentWheel=function(e){0!==e.deltaX&&(e.preventDefault(),this.parent.getScrollElement().scrollLeft+=e.deltaX)},e.prototype.scrollHandler=function(e){this.onContentScroll({scrollLeft:e.target.scrollLeft})},e.prototype.updateScroll=function(e){t.isNullOrUndefined(e.left)?this.parent.sheetModule.contentPanel.scrollTop=e.top:this.parent.getScrollElement().scrollLeft=e.left},e.prototype.setScrollEvent=function(e){void 0===e&&(e={set:!0}),e.set?(t.EventHandler.add(this.parent.sheetModule.contentPanel,"scroll",this.onContentScroll,this),t.EventHandler.add(this.parent.getColumnHeaderContent(),"wheel",this.onHeaderWheel,this),t.EventHandler.add(this.parent.getSelectAllContent(),"wheel",this.onHeaderWheel,this),t.EventHandler.add(this.parent.getMainContent(),"wheel",this.onContentWheel,this),t.EventHandler.add(this.parent.getRowHeaderContent(),"wheel",this.onContentWheel,this),t.EventHandler.add(this.parent.getScrollElement(),"scroll",this.scrollHandler,this)):(t.EventHandler.remove(this.parent.sheetModule.contentPanel,"scroll",this.onContentScroll),t.EventHandler.remove(this.parent.getColumnHeaderContent(),"wheel",this.onHeaderWheel),t.EventHandler.remove(this.parent.getSelectAllContent(),"wheel",this.onHeaderWheel),t.EventHandler.remove(this.parent.getMainContent(),"wheel",this.onContentWheel),t.EventHandler.remove(this.parent.getRowHeaderContent(),"wheel",this.onContentWheel),t.EventHandler.remove(this.parent.getScrollElement(),"scroll",this.scrollHandler))},e.prototype.initProps=function(){this.topIndex=0,this.leftIndex=0,this.prevScroll={scrollLeft:0,scrollTop:0},this.offset={left:{idx:0,size:0},top:{idx:0,size:0}}},e.prototype.setPadding=function(){this.parent.sheetModule.contentPanel.style.overflowY="scroll";var e=_e();if(e>0){var t=this.parent.getColumnHeaderContent(),r=this.parent.enableRtl?{margin:"marginLeft",border:"borderLeftWidth"}:{margin:"marginRight",border:"borderRightWidth"};t.parentElement.style[r.margin]=e+"px",t.style[r.border]="1px"}},e.prototype.setClientX=function(e){if("mousedown"!==e.type&&"mouse"!==e.pointerType){var r={touchSelectionStarted:!1};if(this.parent.notify("selectionStatus",r),!r.touchSelectionStarted){this.clientX=this.getPointX(e);var n=document.getElementById(this.parent.element.id+"_sheet");t.EventHandler.add(n,t.Browser.isPointer?"pointermove":"touchmove",this.onTouchScroll,this),t.EventHandler.add(n,t.Browser.isPointer?"pointerup":"touchend",this.pointerUpHandler,this)}}},e.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].clientX:e.clientX},e.prototype.onTouchScroll=function(e){if("mouse"!==e.pointerType){var t=this.getPointX(e),r=this.clientX-t,n=this.parent.element.getElementsByClassName("e-scroller")[0];(r>10||r<-10)&&n.scrollLeft+r>=0&&(e.preventDefault(),this.clientX=t,Be(function(){n.scrollLeft+=r}))}},e.prototype.pointerUpHandler=function(){var e=document.getElementById(this.parent.element.id+"_sheet");t.EventHandler.remove(e,t.Browser.isPointer?"pointermove":"touchmove",this.onTouchScroll),t.EventHandler.remove(e,t.Browser.isPointer?"pointerup":"touchend",this.pointerUpHandler)},e.prototype.addEventListener=function(){this.parent.on("contentLoaded",this.contentLoaded,this),this.parent.on("onContentScroll",this.onContentScroll,this),this.parent.on("updateScroll",this.updateScroll,this),this.parent.on("deInitProperties",this.initProps,this),this.parent.on("spreadsheetDestroyed",this.destroy,this),this.parent.on("setScrollEvent",this.setScrollEvent,this),this.parent.on("mouseDown",this.setClientX,this),this.parent.scrollSettings.enableVirtualization||(this.parent.on("virtualContentLoaded",this.updateNonVirualScrollWidth,this),this.parent.on("colWidthChanged",this.updateNonVirualScrollWidth,this))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.off("contentLoaded",this.contentLoaded),this.parent.off("onContentScroll",this.onContentScroll),this.parent.off("updateScroll",this.updateScroll),this.parent.off("deInitProperties",this.initProps),this.parent.off("spreadsheetDestroyed",this.destroy),this.parent.off("setScrollEvent",this.setScrollEvent),this.parent.off("mouseDown",this.setClientX),this.parent.scrollSettings.enableVirtualization||(this.parent.off("virtualContentLoaded",this.updateNonVirualScrollWidth),this.parent.off("colWidthChanged",this.updateNonVirualScrollWidth))},e}(),Gn=function(){function e(e){this.scroll=[],this.parent=e,this.addEventListener()}return e.prototype.createVirtualElement=function(e){var r=this.parent.getActiveSheet(),n=this.parent.getMainContent();this.content=this.parent.createElement("div",{className:"e-virtualable"}),this.content.appendChild(n.querySelector(".e-table")),n.appendChild(this.content);var i,a=n.appendChild(this.parent.createElement("div",{className:"e-virtualtrack"})),o=0;this.parent.sheets.length>this.scroll.length&&this.initScroll();var s=this.parent.viewport.bottomIndex;r.rowCount>s+1||r.usedRange.rowIndex>s?(!this.parent.scrollSettings.isFinite&&r.rowCount<=r.usedRange.rowIndex&&this.parent.setSheetPropertyOnMute(r,"rowCount",r.usedRange.rowIndex+1),this.setScrollCount(r.rowCount,"row")):(this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(r,"rowCount",s+1),this.scroll[this.parent.activeSheetIndex].rowCount=r.rowCount);var l=this.parent.frozenRowCount(r),h=u(r.topLeftCell);e.top&&(o=e.top,r.frozenRows&&(o+=Ae(r,h[0],l-1,!0)),l=u(r.paneTopLeftCell)[0]),o+=Ae(r,l,this.scroll[this.parent.activeSheetIndex].rowCount-1,!0),s=this.parent.viewport.rightIndex;var d=0,p=this.parent.frozenColCount(r);e.left?(d=e.left,p&&(d+=Ne(r,h[1],p-1,!0)),l=u(r.paneTopLeftCell)[1]):l=p,r.colCount>s+1||r.usedRange.colIndex>s?(!this.parent.scrollSettings.isFinite&&r.colCount<=r.usedRange.colIndex&&this.parent.setSheetPropertyOnMute(r,"colCount",r.usedRange.colIndex+1),d+=Ne(r,l,s,!0),this.setScrollCount(r.colCount,"col"),i=d+Ne(r,s+1,this.scroll[this.parent.activeSheetIndex].colCount-1,!0)):(this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(r,"colCount",s+1),d+=Ne(r,l,r.colCount-1,!0),this.scroll[this.parent.activeSheetIndex].colCount=r.colCount,i=d),t.isNullOrUndefined(this.parent.viewport.leftIndex)&&(this.parent.viewport.leftIndex=0),t.isNullOrUndefined(this.parent.viewport.topIndex)&&(this.parent.viewport.topIndex=0),e.left&&(d=Ne(r,this.parent.viewport.leftIndex+p,s,!0)),t.isNullOrUndefined(this.translateX)&&(this.translateX=0),t.isNullOrUndefined(this.translateY)&&(this.translateY=0),n=this.parent.getRowHeaderContent(),this.rowHeader=this.content.cloneNode(),this.rowHeader.appendChild(n.querySelector(".e-table")),n.appendChild(this.rowHeader);var c=n.appendChild(a.cloneNode());this.rowHeader.style.transform="translate(0px, "+this.translateY+"px)",n=this.parent.getColumnHeaderContent(),this.colHeader=this.content.cloneNode(),this.colHeader.appendChild(n.querySelector(".e-table")),n.appendChild(this.colHeader);var f=n.appendChild(a.cloneNode());this.colHeader.style.width=d+"px",c.style.height=o+"px",f.style.width=i+"px",this.colHeader.style.transform="translate("+this.translateX+"px, 0px)",this.content.style.transform="translate("+this.translateX+"px, "+this.translateY+"px)",this.content.style.width=d+"px",a.style.height=o+"px",a.style.width=i+"px",this.parent.allowScrolling&&this.parent.getScrollElement().appendChild(f.cloneNode(!0))},e.prototype.initScroll=function(){for(var e=0;e<this.parent.sheets.length;)this.scroll[e]||this.scroll.push({rowCount:0,colCount:0}),e++},e.prototype.setScrollCount=function(e,t){var r=this.parent.activeSheetIndex;this.scroll[r][t+"Count"]||(this.scroll[r][t+"Count"]=e)},e.prototype.getRowAddress=function(e){var t=this.parent.getActiveSheet();return m([e[0],t.frozenColumns?u(t.topLeftCell)[1]:this.parent.viewport.leftIndex,e[1],this.parent.viewport.rightIndex])},e.prototype.getColAddress=function(e){var t=this.parent.getActiveSheet();return m([t.frozenRows?u(t.topLeftCell)[0]:this.parent.viewport.topIndex,e[0],this.parent.viewport.bottomIndex,e[1]])},e.prototype.updateScrollCount=function(e,t,r){void 0===r&&(r=e);var n=this.parent.getActiveSheet(),i=e+this.parent.viewport[t+"Count"]+1+r,a=this.scroll[this.parent.activeSheetIndex][t+"Count"];if(i<a){if(n[t+"Count"]===a)return;i=a}this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(n,t+"Count",i)},e.prototype.onVerticalScroll=function(e){var t=e.cur.idx,r=e.cur.size,n=e.prev.idx,i=Math.abs(t-n),a=this.parent.getThreshold("row");if(i>Math.round(a/2)){var o=void 0,s=void 0,l=void 0,h=this.parent.getActiveSheet();if(t<=a&&!e.increase){if(this.translateY&&n>a){this.translateY=0;var d=this.parent.frozenColCount(h),p=this.parent.frozenRowCount(h);if(this.parent.viewport.topIndex=n-(a-p),!e.preventScroll){var c=d?u(h.topLeftCell)[1]:this.parent.viewport.leftIndex,f=d?[p,this.parent.viewport.leftIndex+d]:[];if(i<this.parent.viewport.rowCount+a){s=this.parent.viewport.topIndex-1,o=this.parent.skipHidden(p,s)[0],this.parent.viewport.topIndex=this.parent.renderModule.skipHiddenIdx(o-p,!0);var g=this.hiddenCount(o,s),m=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.bottomIndex-(s-o+1-g),e.increase);this.parent.viewport.bottomIndex-=s-o+1-g+this.hiddenCount(m,this.parent.viewport.bottomIndex),this.parent.renderModule.refreshUI({colIndex:c,rowIndex:o,direction:"last",refresh:"RowPart",skipUpdateOnFirst:!0,frozenIndexes:f},this.getRowAddress([o,this.parent.renderModule.skipHiddenIdx(s,!1)]))}else{var v=this.parent.viewport.leftIndex;this.parent.renderModule.refreshUI({rowIndex:0,colIndex:c,refresh:"Row",skipUpdateOnFirst:!0,frozenIndexes:f,skipTranslate:!0}),d&&(this.parent.viewport.leftIndex=v),this.translate({refresh:"Row"})}Et(this.parent.element)}}this.updateScrollCount(a,"row")}if(n<a&&(i=Math.abs(t-a)),!e.increase&&this.parent.scrollSettings.isFinite&&this.parent.viewport.bottomIndex===h.rowCount-1){var y=this.parent.viewport.topIndex+a;if(y+=this.hiddenCount(this.parent.viewport.topIndex,y),t>y)return void(e.prev.idx=t);i=y-t}if(t>a){if(l=this.parent.viewport.topIndex,this.parent.viewport.topIndex=t-a,e.increase&&l>this.parent.viewport.topIndex)return void(this.parent.viewport.topIndex=l);p=this.parent.frozenRowCount(h);if(e.preventScroll)this.setThresholdHeight(r,a,p);else{var c=(d=this.parent.frozenColCount(h))?u(h.topLeftCell)[1]:this.parent.viewport.leftIndex,C=[];if(h.frozenColumns&&(C=[p,this.parent.viewport.leftIndex+d]),i<this.parent.viewport.rowCount+a)if(e.increase){if(o=this.parent.viewport.bottomIndex+1,s=this.parent.viewport.bottomIndex+(this.parent.viewport.topIndex-l),(s-=this.hiddenCount(l,this.parent.viewport.topIndex-1))<=this.parent.viewport.bottomIndex)return this.parent.viewport.topIndex=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.topIndex,e.increase),void this.setThresholdHeight(r,a,p);var b=this.parent.skipHidden(o,s),x=this.checkLastIdx(b[1],"row");o=b[0],s=x.index,this.parent.viewport.topIndex=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.topIndex-x.diff,e.increase),this.setThresholdHeight(r,a+x.diff,p),this.parent.viewport.bottomIndex=s,this.parent.renderModule.refreshUI({colIndex:c,rowIndex:o,direction:"first",refresh:"RowPart",frozenIndexes:C},this.getRowAddress([o,s]))}else{s=(o=this.parent.viewport.topIndex+p)+i-1;var g=this.hiddenCount(o,s),m=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.bottomIndex-(s-o-g),e.increase);this.parent.viewport.bottomIndex-=i-g+this.hiddenCount(m,this.parent.viewport.bottomIndex),o=this.parent.skipHidden(o,s)[0],this.parent.viewport.topIndex=this.parent.renderModule.skipHiddenIdx(o-p,!0),this.setThresholdHeight(r,a,p),this.parent.renderModule.refreshUI({colIndex:c,rowIndex:o,direction:"last",refresh:"RowPart",frozenIndexes:C},this.getRowAddress([o,s]))}else l=this.parent.viewport.leftIndex,this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:c,refresh:"Row",frozenIndexes:C,skipTranslate:!0}),d&&(this.parent.viewport.leftIndex=l),this.setThresholdHeight(r,a,p),this.translate({refresh:"Row"});this.updateScrollCount(t,"row",a),this.focusSheet()}}e.prev.idx=t}},e.prototype.hiddenCount=function(e,t,r){void 0===r&&(r="rows");for(var n=0,i=this.parent.getActiveSheet(),a=e;a<=t;a++)i[r][a]&&i[r][a].hidden&&n++;return n},e.prototype.checkLastIdx=function(e,t){var r=0;if(this.parent.scrollSettings.isFinite){var n=this.parent.getActiveSheet()[t+"Count"]-1;e>n&&(r=e-n,e=n)}return{index:e,diff:r}},e.prototype.onHorizontalScroll=function(e){var t=e.cur.idx,r=e.cur.size,n=e.prev.idx,i=Math.abs(t-n),a=this.parent.getThreshold("col");if(i>Math.round(a/2)){var o=void 0,s=void 0,l=void 0,h=this.parent.getActiveSheet();if(t<=a&&!e.increase){if(this.translateX&&n>a){var d=this.parent.frozenColCount(h),p=this.parent.frozenRowCount(h);if(this.translateX=0,this.parent.viewport.leftIndex=n-(a-d),!e.preventScroll){var c=p?u(h.topLeftCell)[0]:this.parent.viewport.topIndex,f=p?[this.parent.viewport.topIndex+p,d]:[];if(i<this.parent.viewport.colCount+a){s=this.parent.viewport.leftIndex-1,o=this.parent.skipHidden(d,s,"columns")[0],this.parent.viewport.leftIndex=this.parent.renderModule.skipHiddenIdx(o-d,!0);var g=this.hiddenCount(o,s,"columns"),m=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.rightIndex-(s-o+1-g),e.increase,"columns");this.parent.viewport.rightIndex-=s-o+1-g+this.hiddenCount(m,this.parent.viewport.rightIndex,"columns"),this.parent.renderModule.refreshUI({rowIndex:c,colIndex:o,direction:"last",refresh:"ColumnPart",skipUpdateOnFirst:!0,frozenIndexes:f},this.getColAddress([o,this.parent.renderModule.skipHiddenIdx(s,!1,"columns")]))}else{var v=this.parent.viewport.topIndex;this.parent.renderModule.refreshUI({rowIndex:c,colIndex:0,refresh:"Column",skipUpdateOnFirst:!0,frozenIndexes:f,skipTranslate:!0}),p&&(this.parent.viewport.topIndex=v),this.translate({refresh:"Column"})}Et(this.parent.element)}}this.updateScrollCount(a,"col")}if(n<a&&(i=Math.abs(t-a)),!e.increase&&this.parent.scrollSettings.isFinite&&this.parent.viewport.rightIndex===h.colCount-1){var y=this.parent.viewport.leftIndex+a;if(y+=this.hiddenCount(this.parent.viewport.leftIndex,y),t>y)return void(e.prev.idx=t);i=y-t}if(t>a){if(l=this.parent.viewport.leftIndex,this.parent.viewport.leftIndex=t-a,e.increase&&l>this.parent.viewport.leftIndex)return void(this.parent.viewport.leftIndex=l);d=this.parent.frozenColCount(h);if(e.preventScroll)this.setThresholdWidth(r,a,d);else{var c=(p=this.parent.frozenRowCount(h))?u(h.topLeftCell)[0]:this.parent.viewport.topIndex,C=[];if(p&&(C=[p+this.parent.viewport.topIndex,d]),i<this.parent.viewport.colCount+a)if(e.increase){if(o=this.parent.viewport.rightIndex+1,s=this.parent.viewport.rightIndex+(this.parent.viewport.leftIndex-l),(s-=this.hiddenCount(l,this.parent.viewport.leftIndex-1,"columns"))<=this.parent.viewport.rightIndex)return this.parent.viewport.leftIndex=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.leftIndex,e.increase,"columns"),void this.setThresholdWidth(r,a,d);var b=this.parent.skipHidden(o,s,"columns"),x=this.checkLastIdx(b[1],"col");o=b[0],s=x.index,this.parent.viewport.leftIndex=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.leftIndex-x.diff,e.increase,"columns"),this.setThresholdWidth(r,a,d),this.parent.viewport.rightIndex=s,this.parent.renderModule.refreshUI({rowIndex:c,colIndex:o,direction:"first",refresh:"ColumnPart",frozenIndexes:C},this.getColAddress([o,s]))}else{s=(o=this.parent.viewport.leftIndex+d)+i-1;var g=this.hiddenCount(o,s,"columns"),m=this.parent.renderModule.skipHiddenIdx(this.parent.viewport.rightIndex-(s-o-g),e.increase,"columns");this.parent.viewport.rightIndex-=i-g+this.hiddenCount(m,this.parent.viewport.rightIndex,"columns"),o=this.parent.skipHidden(o,s,"columns")[0],this.parent.viewport.leftIndex=this.parent.renderModule.skipHiddenIdx(o-d,!0,"columns",h),this.setThresholdWidth(r,a,d),this.parent.renderModule.refreshUI({rowIndex:c,colIndex:o,direction:"last",refresh:"ColumnPart",frozenIndexes:C},this.getColAddress([o,s]))}else l=this.parent.viewport.topIndex,this.parent.renderModule.refreshUI({rowIndex:c,colIndex:this.parent.viewport.leftIndex,refresh:"Column",frozenIndexes:C,skipTranslate:!0}),p&&(this.parent.viewport.topIndex=l),this.setThresholdWidth(r,a,d),this.translate({refresh:"Column"});this.updateScrollCount(t,"col",a),this.focusSheet()}}e.prev.idx=t}},e.prototype.focusSheet=function(){document.activeElement.classList.contains("e-text-findNext-short")&&t.closest(document.activeElement,"#"+this.parent.element.id)||Et(this.parent.element)},e.prototype.setThresholdHeight=function(e,t,r){for(var n=0,i=this.parent.getActiveSheet(),a=this.parent.viewport.topIndex+r,o=a+t;a<o;a++)n+=Re(i,a,!0);this.translateY=e-n},e.prototype.setThresholdWidth=function(e,t,r){for(var n=0,i=this.parent.getActiveSheet(),a=this.parent.viewport.leftIndex+r,o=a+t;a<o;a++)n+=Le(i,a,null,!0);this.translateX=e-n},e.prototype.translate=function(e){if(!e.skipTranslate){var t=this.parent.enableRtl?-this.translateX:this.translateX;"Row"!==e.refresh&&"RowPart"!==e.refresh||(this.content.style.transform="translate("+t+"px, "+this.translateY+"px)",this.rowHeader.style.transform="translate(0px, "+this.translateY+"px)"),"Column"!==e.refresh&&"ColumnPart"!==e.refresh||(this.content.style.transform="translate("+t+"px, "+this.translateY+"px)",this.colHeader.style.transform="translate("+t+"px, 0px)")}},e.prototype.updateColumnWidth=function(e){if("Column"===e.refresh){this.content.style.width="";var t=this.parent.getActiveSheet(),r=Ne(t,this.parent.viewport.leftIndex+this.parent.frozenColCount(t),this.parent.viewport.rightIndex,!0);if(this.colHeader.style.width=r+"px",this.content.style.width=r+"px",!this.parent.scrollSettings.isFinite||e.isUpdate){var n=this.parent.element.querySelector(".e-scroller .e-virtualtrack"),i=parseInt(n.style.width,10),a=r+this.translateX+this.parent.viewport.beforeFreezeWidth;if(a>i){o=a-i;n.style.width=i+o+"px"}else{var o=i-a,s=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0];i-o<parseInt(s.style.width,10)&&(n.style.width=s.style.width)}}}else if(!this.parent.scrollSettings.isFinite){var s=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0],l=parseInt(s.style.height,10),h=this.content.getBoundingClientRect().height+this.translateY+this.parent.viewport.beforeFreezeHeight;if(h>l){o=h-l;s.style.height=l+o+"px"}else{var o=l-h,d=this.parent.getRowHeaderContent().getElementsByClassName("e-virtualtrack")[0];l-o<parseInt(d.style.height,10)&&(s.style.height=d.style.height)}}},e.prototype.updateUsedRange=function(e){if(this.scroll.length){var t=this.parent.getActiveSheet();if("row"===e.update){if(e.index!==this.scroll[this.parent.activeSheetIndex].rowCount-1){var r=this.getVTrackHeight("height"),n=r;if(e.index>=this.scroll[this.parent.activeSheetIndex].rowCount?n+=Ae(t,this.scroll[this.parent.activeSheetIndex].rowCount,e.index,!0):n-=Ae(t,e.index+1,this.scroll[this.parent.activeSheetIndex].rowCount-1,!0),n<r)return;this.scroll[this.parent.activeSheetIndex].rowCount=e.index+1,this.updateVTrack(this.rowHeader,r,"height"),this.scroll[this.parent.activeSheetIndex].rowCount>t.rowCount&&this.parent.setSheetPropertyOnMute(t,"rowCount",this.scroll[this.parent.activeSheetIndex].rowCount)}}else if(e.index>this.scroll[this.parent.activeSheetIndex].colCount){var i=this.getVTrackHeight("width");i+=Ne(t,this.scroll[this.parent.activeSheetIndex].colCount,e.index,!0),this.scroll[this.parent.activeSheetIndex].colCount=e.index+1,this.updateVTrack(this.colHeader,i,"width"),this.scroll[this.parent.activeSheetIndex].colCount>t.colCount&&this.parent.setSheetPropertyOnMute(t,"colCount",this.scroll[this.parent.activeSheetIndex].colCount)}}},e.prototype.getVTrackHeight=function(e){var t=this.content.nextElementSibling.style[e];if(t.includes("e+")){var r=(t=t.split("px")[0]).split("e+");return Number(r[0])*Math.pow(10,Number(r[1]))}return parseFloat(t)},e.prototype.updateVTrackHeight=function(e){e.rowIdx<this.scroll[this.parent.activeSheetIndex].rowCount&&this.updateVTrack(this.rowHeader,this.getVTrackHeight("height")+e.threshold,"height")},e.prototype.updateVTrackWidth=function(e){if(e.colIdx>=this.parent.viewport.leftIndex&&e.colIdx<=this.parent.viewport.rightIndex){var t=this.parent.getColumnHeaderContent().getElementsByClassName("e-virtualtrack")[0];t.style.width=parseFloat(t.style.width)+e.threshold+"px";var r=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0];r.style.width=parseFloat(r.style.width)+e.threshold+"px";var n=this.parent.getColumnHeaderContent().getElementsByClassName("e-virtualable")[0];n.style.width=parseFloat(n.style.width)+e.threshold+"px";var i=this.parent.getMainContent().getElementsByClassName("e-virtualable")[0];i.style.width=parseFloat(i.style.width)+e.threshold+"px"}},e.prototype.updateVTrack=function(e,t,r){e.nextElementSibling.style[r]=t+"px",this.content.nextElementSibling.style[r]=t+"px"},e.prototype.deInitProps=function(){this.parent.viewport.leftIndex=null,this.parent.viewport.topIndex=null,this.parent.viewport.bottomIndex=null,this.translateX=null,this.translateY=null},e.prototype.updateScrollProps=function(e){var t=this;void 0===e&&(e={sheetIndex:0,sheets:this.parent.sheets}),0===this.scroll.length?this.initScroll():e.sheets.forEach(function(){t.scroll.splice(e.sheetIndex,0,{rowCount:0,colCount:0})})},e.prototype.sliceScrollProps=function(e){t.isNullOrUndefined(e.sheetIndex)?this.scroll.length=0:this.scroll.splice(e.sheetIndex,1)},e.prototype.addEventListener=function(){this.parent.on("beforeContentLoaded",this.createVirtualElement,this),this.parent.on("beforeVirtualContentLoaded",this.translate,this),this.parent.on("virtualContentLoaded",this.updateColumnWidth,this),this.parent.on("updateTableWidth",this.updateColumnWidth,this),this.parent.on("verticalScroll",this.onVerticalScroll,this),this.parent.on("horizontalScroll",this.onHorizontalScroll,this),this.parent.on("updateUsedRange",this.updateUsedRange,this),this.parent.on(sr,this.updateVTrackHeight,this),this.parent.on("colWidthChanged",this.updateVTrackWidth,this),this.parent.on("deInitProperties",this.deInitProps,this),this.parent.on("sheetsDestroyed",this.sliceScrollProps,this),this.parent.on("sheetCreated",this.updateScrollProps,this),this.parent.on("spreadsheetDestroyed",this.destroy,this)},e.prototype.destroy=function(){this.removeEventListener(),this.rowHeader=null,this.colHeader=null,this.content=null,this.parent=null,this.scroll.length=0,this.translateX=null,this.translateY=null},e.prototype.removeEventListener=function(){this.parent.off("beforeContentLoaded",this.createVirtualElement),this.parent.off("beforeVirtualContentLoaded",this.translate),this.parent.off("virtualContentLoaded",this.updateColumnWidth),this.parent.off("updateTableWidth",this.updateColumnWidth),this.parent.off("verticalScroll",this.onVerticalScroll),this.parent.off("horizontalScroll",this.onHorizontalScroll),this.parent.off("updateUsedRange",this.updateUsedRange),this.parent.off(sr,this.updateVTrackHeight),this.parent.off("colWidthChanged",this.updateVTrackWidth),this.parent.off("sheetsDestroyed",this.sliceScrollProps),this.parent.off("sheetCreated",this.updateScrollProps),this.parent.off("spreadsheetDestroyed",this.destroy)},e}(),Yn=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(rr,this.keyDownHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(rr,this.keyDownHandler)},e.prototype.keyDownHandler=function(e){if(!this.parent.isEdit&&(document.activeElement.classList.contains("e-spreadsheet")||t.closest(document.activeElement,".e-sheet"))&&!t.closest(e.target,".e-name-box")){var r=void 0,n=this.parent.enableRtl,i=this.parent.getActiveSheet(),a={e:e,isFilterCell:!1},o=u(this.parent.getActiveSheet().activeCell);if([9,37,38,39,40].indexOf(e.keyCode)>-1&&e.preventDefault(),e.shiftKey&&this.shiftSelection(e),e.shiftKey||!e.altKey||38!==e.keyCode&&40!==e.keyCode||this.parent.notify("filterCellKeyDown",a),!e.shiftKey&&(!n&&37===e.keyCode||n&&39===e.keyCode)||e.shiftKey&&9===e.keyCode)if(o[1]>0)o[1]-=1,r=!0;else{l=this.parent.getMainContent();0===o[1]&&l.scrollLeft&&!n&&(l.scrollLeft=0)}else if(e.shiftKey&&13===e.keyCode){if(!this.parent.element.querySelector(".e-find-toolbar"))if(o[0]>0)o[0]-=1,r=!0;else{l=this.parent.getMainContent().parentElement;0===o[0]&&l.scrollTop&&(l.scrollTop=0)}}else if(a.isFilterCell||e.shiftKey||38!==e.keyCode){if(!e.shiftKey&&(!n&&39===e.keyCode||n&&37===e.keyCode)||9===e.keyCode)(s=J(o[0],o[1],i))&&s.colSpan>1&&(o[1]+=s.colSpan-1),o[1]<i.colCount-1&&(o[1]+=1,r=!0);else if(!a.isFilterCell&&!e.shiftKey&&40===e.keyCode||13===e.keyCode){var s=J(o[0],o[1],i);s&&s.rowSpan>1&&(o[0]+=s.rowSpan-1),o[0]<i.rowCount-1&&(o[0]+=1,r=!0)}}else if(o[0]>0)o[0]-=1,r=!0;else{var l=this.parent.getMainContent().parentElement;0===o[0]&&l.scrollTop&&(l.scrollTop=0)}if(r){for(;Ee(this.parent.getActiveSheet(),o[0]);)40===e.keyCode&&(o[0]=o[0]+1),38===e.keyCode&&(o[0]=o[0]-1);this.scrollNavigation(o,!1),this.parent.setSheetPropertyOnMute(i,"activeCell",m(o)),this.parent.notify("cellNavigate",{range:o})}}e.target.classList.contains("e-sheet-rename")&&(32===e.keyCode?e.stopPropagation():13!==e.keyCode&&27!==e.keyCode||this.parent.notify("renameSheet",e))},e.prototype.shiftSelection=function(e){var r=this.parent.getActiveSheet(),n=c(r.selectedRange),i=S(n),a=!0;if(38===e.keyCode){for(o=i[1];o<=i[3];o++){s=J(n[2],o,this.parent.getActiveSheet());if(!t.isNullOrUndefined(s)&&s.rowSpan&&s.rowSpan<0){n[2]=n[2]-(Math.abs(s.rowSpan)+1),a=!1;break}}a&&(n[2]=n[2]-1),n[2]<0&&(n[2]=0)}if(40===e.keyCode){for(o=i[1];o<=i[3];o++){s=J(n[2],o,this.parent.getActiveSheet());if(!t.isNullOrUndefined(s)&&s.rowSpan&&s.rowSpan>0){n[2]=n[2]+Math.abs(s.rowSpan),a=!1;break}}a&&(n[2]=n[2]+1)}if(39===e.keyCode){for(o=i[0];o<=i[2];o++){s=J(o,n[3],this.parent.getActiveSheet());if(!t.isNullOrUndefined(s)&&s.colSpan&&s.colSpan>0){n[3]=n[3]+Math.abs(s.colSpan),a=!1;break}}a&&(n[3]=n[3]+1)}if(37===e.keyCode){for(var o=i[0];o<=i[2];o++){var s=J(o,n[3],this.parent.getActiveSheet());if(!t.isNullOrUndefined(s)&&s.colSpan&&s.colSpan<0){n[3]=n[3]-(Math.abs(s.colSpan)+1),a=!1;break}}a&&(n[3]=n[3]-1),n[3]<0&&(n[3]=0)}if(e.shiftKey&&e.ctrlKey&&!this.parent.scrollSettings.enableVirtualization){var l=[r.usedRange.rowIndex,r.usedRange.colIndex];37===e.keyCode&&(n[3]<=l[1]?n[3]=0:n[3]=l[1]),38===e.keyCode&&(n[2]<=l[0]?n[2]=0:n[2]=l[0]),39===e.keyCode&&(n[3]<=l[1]?n[3]=l[1]:n[3]=this.parent.getActiveSheet().colCount),40===e.keyCode&&(n[2]<=l[0]?n[2]=l[0]:n[2]=this.parent.getActiveSheet().rowCount)}if(37===e.keyCode||39===e.keyCode||38===e.keyCode||40===e.keyCode){for(;Ee(this.parent.getActiveSheet(),n[2]);)40===e.keyCode&&(n[2]=n[2]+1),38===e.keyCode&&(n[2]=n[2]-1);this.parent.selectRange(m(n)),this.scrollNavigation([n[2],n[3]],!1)}},e.prototype.scrollNavigation=function(e,t){if(this.parent.allowScrolling){var r=this.parent.enableRtl?-1:1,n=this.parent.getMainContent().parentElement,i=this.parent.getScrollElement(),a=this.parent.getActiveSheet(),o=S(c(a.selectedRange)),s=u(a.topLeftCell),l=this.parent.frozenRowCount(a),h=this.parent.frozenColCount(a),d=u(a.paneTopLeftCell),p=e[0]<l?s[0]:d[0],f=e[1]<h?s[1]:d[1],g=this.parent.scrollModule.offset.left.size,m=this.parent.scrollModule.offset.top.size;if(l&&e[0]!==o[2]&&n.scrollTop){if(e[0]===l)return void(n.scrollTop=0);e[0]===l-1&&(n.scrollTop=0)}if(h&&e[1]!==o[3]&&i.scrollLeft){if(e[1]===h)return void(i.scrollLeft=0);e[1]===h-1&&(i.scrollLeft=0)}this.getBottomIdx(p)<=e[0]||t?n.scrollTop=m+Re(a,d[0],!0):p>e[0]&&(n.scrollTop=m-Math.ceil(Re(a,e[0],!0))),this.getRightIdx(f)<=e[1]||t?i.scrollLeft=g+Le(a,d[1],null,!0)*r:f>e[1]&&(i.scrollLeft=g-Le(a,e[1],null,!0)*r)}},e.prototype.getBottomIdx=function(e){for(var t=0,r=this.parent.getActiveSheet(),n=(r.frozenRows?this.parent.viewport.height-this.parent.sheetModule.getColHeaderHeight(r,!0):this.parent.viewport.height)-17||20,i=e;;i++)if((t+=Re(r,i,!0))>=n)return i},e.prototype.getRightIdx=function(e){for(var t=0,r=this.parent.getActiveSheet(),n=this.parent.getMainContent().parentElement.offsetWidth-this.parent.sheetModule.getRowHeaderWidth(r),i=e;;i++)if((t+=Le(r,i,null,!0))>=n-17)return i},e.prototype.getModuleName=function(){return"keyboardNavigation"},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e}(),Xn=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(rr,this.keyDownHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(rr,this.keyDownHandler)},e.prototype.keyDownHandler=function(e){if(e.ctrlKey||e.metaKey){if(t.closest(e.target,".e-find-dlg")||([79,83].indexOf(e.keyCode)>-1?e.preventDefault():65!==e.keyCode||this.parent.isEdit||e.preventDefault()),79===e.keyCode)t.select("#"+this.parent.element.id+"_fileUpload",this.parent.element).click();else if(83===e.keyCode)this.parent.saveUrl&&this.parent.allowSave&&this.parent.save();else if(67===e.keyCode)this.parent.notify("copy",{promise:Promise});else if(75===e.keyCode){var r=u(this.parent.getActiveSheet().activeCell),n=this.parent.sheets[this.parent.getActiveSheet().id-1].rows[r[0]],i=void 0;e.preventDefault(),t.isNullOrUndefined(n)||(i=n.cells[r[1]]),t.isNullOrUndefined(i)&&Q(r[0],r[1],this.parent.getActiveSheet(),i,!1),i&&i.hyperlink?this.parent.notify("editHyperlink",null):this.parent.notify("initiateHyperlink",null)}else 90===e.keyCode?this.parent.isEdit||(e.preventDefault(),this.parent.notify("performUndoRedo",{isUndo:!0})):89===e.keyCode&&(this.parent.isEdit||(e.preventDefault(),this.parent.notify("performUndoRedo",{isUndo:!1})));var a=this.parent.sheets[this.parent.getActiveSheet().id-1],o=void 0;if(a){var s=u(a.activeCell),l=J(s[0],s[1],a);o=a.isProtected&&X(l,Te(a,s[1]))}if(70===e.keyCode&&(e.preventDefault(),this.parent.notify("ribbonFind",null)),!(o&&a.isProtected&&86!==e.keyCode||70===e.keyCode)){if(71===e.keyCode)e.preventDefault(),this.parent.notify(ur,null);else if(72===e.keyCode)e.preventDefault(),this.parent.notify(fr,null);else if(88===e.keyCode)this.parent.notify(ar,{promise:Promise});else if(86===e.keyCode)this.parent.notify(or,{isAction:!0});else if(66===e.keyCode)e.preventDefault(),h="bold"===(h=this.parent.getCellStyleValue(["fontWeight"],u(this.parent.getActiveSheet().activeCell)).fontWeight)?"normal":"bold",this.parent.notify(Tt,{style:{fontWeight:h},onActionUpdate:!0,refreshRibbon:!0});else if(73===e.keyCode){e.preventDefault();var h=this.parent.getCellStyleValue(["fontStyle"],u(this.parent.getActiveSheet().activeCell)).fontStyle;h="italic"===h?"normal":"italic",this.parent.notify(Tt,{style:{fontStyle:h},onActionUpdate:!0,refreshRibbon:!0})}else 85===e.keyCode?(e.preventDefault(),this.parent.notify("textDecorationUpdate",{style:{textDecoration:"underline"},refreshRibbon:!0})):53===e.keyCode&&(e.preventDefault(),this.parent.notify("textDecorationUpdate",{style:{textDecoration:"line-through"},refreshRibbon:!0}));e.shiftKey&&76===e.keyCode&&(this.parent.isEdit||(e.preventDefault(),this.parent.applyFilter()))}}27===e.keyCode&&this.parent.notify("clearCopy",null)},e.prototype.getModuleName=function(){return"keyboardShortcut"},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e}(),Kn=function(){function e(e){this.checkHeight=!1,this.parent=e,this.row=e.createElement("tr",{className:"e-row"}),this.parent.on(Jt,this.addEventListener,this)}return e.prototype.applyCellFormat=function(e){var t=Object.keys(e.style),r=this.parent.getActiveSheet();if(!(e.lastCell&&wt(r,e.rowIdx)<=20)||t.length){var n=e.cell||this.parent.getCell(e.rowIdx,e.colIdx);if(n){if(this.updateMergeBorder(e,r),void 0!==e.style.border||void 0!==e.style.borderTop||void 0!==e.style.borderLeft){var i={};Object.keys(e.style).forEach(function(t){i[t]=e.style[t]}),void 0!==i.border&&(Object.assign(n.style,{borderRight:e.style.border,borderBottom:e.style.border}),this.setLeftBorder(e.style.border,n,e.rowIdx,e.colIdx,e.row,e.onActionUpdate,e.first),this.setTopBorder(e.style.border,n,e.rowIdx,e.colIdx,e.pRow,e.pHRow,e.onActionUpdate,e.first,e.lastCell,e.manualUpdate),delete i.border),void 0!==i.borderTop&&(this.setTopBorder(e.style.borderTop,n,e.rowIdx,e.colIdx,e.pRow,e.pHRow,e.onActionUpdate,e.first,e.lastCell,e.manualUpdate),delete i.borderTop),void 0!==i.borderLeft&&(this.setLeftBorder(e.style.borderLeft,n,e.rowIdx,e.colIdx,e.row,e.onActionUpdate,e.first),delete i.borderLeft),Object.keys(i).length&&(void 0!==i.borderBottom&&this.setThickBorderHeight(i.borderBottom,e.rowIdx,e.colIdx,n,e.row,e.hRow,e.onActionUpdate,e.lastCell,e.manualUpdate),Object.assign(n.style,i))}else{void 0!==e.style.borderBottom&&this.setThickBorderHeight(e.style.borderBottom,e.rowIdx,e.colIdx,n,e.row,e.hRow,e.onActionUpdate,e.lastCell,e.manualUpdate),Object.assign(n.style,e.style);var a=J(e.rowIdx,e.colIdx,r);a&&(a.rowSpan||a.colSpan)&&n.offsetHeight>0&&(s=ft(this.parent,a.style||this.parent.cellStyle))>n.offsetHeight&&ut(this.parent,r,n.offsetHeight,e.rowIdx)}if(e.isHeightCheckNeeded&&(!r.rows[e.rowIdx]||!r.rows[e.rowIdx].customHeight))if(e.manualUpdate)this.checkHeight||(this.checkHeight=this.isHeightCheckNeeded(e.style,e.onActionUpdate)),n&&n.children[0]&&"e-cf-databar"===n.children[0].className&&e.style.fontSize&&(n.children[0].querySelector(".e-databar-value").style.fontSize=e.style.fontSize),this.updateRowHeight(e.rowIdx,e.colIdx,e.lastCell,e.onActionUpdate);else{var o=J(e.rowIdx,e.colIdx,r);if(o&&o.wrap||!this.isHeightCheckNeeded(e.style)||St(r,e.rowIdx,e.colIdx,xt(this.parent,e.rowIdx,e.colIdx,r,e.style)),e.lastCell){var s=wt(r,e.rowIdx);s>20&&s>Re(r,e.rowIdx)&&ut(this.parent,r,s,e.rowIdx,e.row,e.hRow,this.parent.scrollSettings.isFinite)}}}else this.updateRowHeight(e.rowIdx,e.colIdx,!0,e.onActionUpdate)}},e.prototype.updateRowHeight=function(e,r,n,i){if(this.checkHeight){var a=0,o=void 0,s=this.parent.getActiveSheet(),l=J(e,r,s,null,!0),h=this.parent.getCell(e,r);if(l&&!l.rowSpan&&!l.colSpan){if(a=xt(this.parent,e,r,s,l.style||this.parent.cellStyle,l.wrap?vt(this.parent.getDisplayText(l),bt(s,e,r),l.style,this.parent.cellStyle):1),!t.isNullOrUndefined(l.value)&&l.value.toString().indexOf("\n")>-1){var d=void 0,p=l.value.split("\n"),c=0,u=p.length;for(d=0;d<u;d++){var f=vt(p[d],bt(s,e,r),l.style,this.parent.cellStyle);0===f&&(f=1),c+=f}a=xt(this.parent,e,r,s,l.style||this.parent.cellStyle,c)}if(a<20&&(a=20),h&&h.children[0]&&"e-cf-databar"===h.children[0].className&&(h.children[0].style.height="100%",h.children[0].firstElementChild.nextElementSibling.style.height="100%"),St(s,e,r,a),n){this.checkHeight=!1;var g=s.frozenRows?this.parent.getRow(e,null,s.frozenColumns):this.parent.getRow(e);if(!g)return;var m=Re(s,e);o=wt(s,e),(i?o!==m:o>m)&&ut(this.parent,s,o,e,g,null,!0)}}}},e.prototype.updateMergeBorder=function(e,t){var r=J(e.rowIdx,e.colIdx,t,null,!0),n={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]};if(this.parent.notify("activeCellMergedRange",n),r.rowSpan>1&&!e.style.borderBottom){var i=J(n.range[2],n.range[1],t,null,!0);i.style&&i.style.borderBottom&&(e.style.borderBottom=i.style.borderBottom)}if(r.colSpan>1&&!e.style.borderRight){var a=J(n.range[0],n.range[3],t,null,!0);a.style&&a.style.borderRight&&(e.style.borderRight=a.style.borderRight)}},e.prototype.isHeightCheckNeeded=function(e,t){var r=Object.keys(e);return(t?r.indexOf("fontSize")>-1:r.indexOf("fontSize")>-1&&Number(e.fontSize.split("pt")[0])>12)||r.indexOf("fontFamily")>-1||r.indexOf("borderTop")>-1||r.indexOf("borderBottom")>-1},e.prototype.setLeftBorder=function(e,t,r,n,i,a,o){if(!o||!o.includes("Column"))for(var s=0;s<t.rowSpan;s++){for(var l=this.parent.getCell(r+s,n-1,i),h=1;l&&"none"===l.style.display;)l=this.parent.getCell(r+s,n-1-h,i),h++;l?(a&&""!==e&&n===this.parent.viewport.leftIndex&&(this.parent.getMainContent().scrollLeft-=this.getBorderSize(e)),l.style.borderRight="none"===e?l.style.borderRight:e):t.style.borderLeft=e}},e.prototype.setTopBorder=function(e,t,r,n,i,a,o,s,l,h){if(!s||!s.includes("Row"))for(var d=0;d<t.colSpan;d++){var p=this.parent.getCell(r-1,n+d,i);if(p){if(Ee(this.parent.getActiveSheet(),r-1)){var c=[Number(p.parentElement.getAttribute("aria-rowindex"))-1,n];if(this.parent.getCellStyleValue(["bottomPriority"],c).bottomPriority)return}o&&""!==e&&this.parent.getActiveSheet().topLeftCell.includes(""+(r+1))&&(this.parent.getMainContent().parentElement.scrollTop-=this.getBorderSize(e)),this.setThickBorderHeight(e,r-1,n+d,p,i,a,o,l,h),p.style.borderBottom="none"===e?p.style.borderBottom:e}else t.style.borderTop=e}},e.prototype.setThickBorderHeight=function(e,t,r,n,i,a,o,s,l){var h=e?this.getBorderSize(e):1,d=this.parent.getActiveSheet();if(h>2&&(!d.rows[t]||!d.rows[t].customHeight))if(l)this.checkHeight||(this.checkHeight=!0),this.updateRowHeight(t,r,s,o);else{var p=Re(d,t),c=Math.ceil(this.parent.calculateHeight(this.parent.getCellStyleValue(["fontFamily","fontSize"],[t,r]),1,3));c>p&&(ut(this.parent,d,c,t,i,a,!1),this.parent.notify(sr,{rowIdx:t,threshold:c-20}))}!o||!s&&this.checkHeight||!(h<3)||d.rows[t]&&d.rows[t].customHeight||(this.checkHeight||(this.checkHeight=!0),this.updateRowHeight(t,r,s,o))},e.prototype.getBorderSize=function(e){var t=e.split(" ")[0];return"thin"===t?1:"medium"===t?2:"thick"===t?3:parseInt(t,10)?parseInt(t,10):1},e.prototype.clearObj=function(e){var r,n,i=e.options,a=i.range?i.range.indexOf("!")>0?i.range.split("!")[1]:i.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,o=i.range&&i.range.indexOf("!")>0?se(this.parent,i.range.split("!")[0]):this.parent.activeSheetIndex,s=c(a),l=this.parent.sheets[o],h=s[0],d=s[2],p={range:a,type:i.type,requestType:"clear",sheetIndex:o};if(e.isPublic||this.parent.notify(cr,{action:"beforeClear",eventArgs:p}),"Clear Formats"===i.type||"Clear All"===i.type)for(this.parent.notify(qt,{range:a,isPublic:!1,isclearFormat:!0}),h;h<=d;h++)for(r=s[1],n=s[3],r;r<=n;r++){var u=J(h,r,l),f=this.parent.getCell(h,r);u&&(u.wrap&&this.parent.notify(Ot,{range:[h,r,h,r],wrap:!1,sheet:l}),u.hyperlink&&(t.removeClass(f.querySelectorAll(".e-hyperlink"),"e-hyperlink-style"),"Clear All"===i.type&&this.parent.removeHyperlink(m([h,r,h,r]))))}if("Clear Hyperlinks"===i.type)return void this.parent.removeHyperlink(a);this.parent.notify("clear",{range:l.name+"!"+a,type:i.type}),this.parent.serviceLocator.getService("cell").refreshRange(c(a)),e.isPublic||(p={range:l.name+"!"+a,type:i.type,sheetIndex:o},this.parent.notify("actionComplete",{eventArgs:p,action:"clear"})),this.parent.notify("addHighlight",{range:a,isclearFormat:!0}),this.parent.notify("selectRange",{address:a})},e.prototype.addEventListener=function(){this.parent.on(Ft,this.applyCellFormat,this),this.parent.on(mr,this.clearObj,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Jt,this.addEventListener),this.parent.off(Ft,this.applyCellFormat),this.parent.off(mr,this.clearObj))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null,this.row=null,this.checkHeight=null},e.prototype.getModuleName=function(){return"cellformat"},e}(),$n=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("contentLoaded",this.wireEvents,this),this.parent.on(hr,this.autoFit,this),this.parent.on("setAutoFit",this.setAutoFitHandler,this)},e.prototype.autoFit=function(e){for(var t=e.isRow?this.parent.getRowHeaderTable():this.parent.getColHeaderTable().rows[0],r=e.startIndex;r<=e.endIndex;r++)this.trgtEle=e.isRow?this.parent.getRow(r,t):this.parent.getCell(null,r,t),this.setAutofit(r,!e.isRow)},e.prototype.wireEvents=function(){var e=this.parent.getRowHeaderContent(),r=this.parent.element.getElementsByClassName("e-header-panel")[0];t.EventHandler.add(r,"dblclick",this.dblClickHandler,this),t.EventHandler.add(e,"dblclick",this.dblClickHandler,this),t.EventHandler.add(r,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(e,"mousedown",this.mouseDownHandler,this),this.wireResizeCursorEvent(e,r)},e.prototype.wireResizeCursorEvent=function(e,r){t.EventHandler.add(e,"mousemove",this.setTarget,this),t.EventHandler.add(r,"mousemove",this.setTarget,this)},e.prototype.unWireResizeCursorEvent=function(){t.EventHandler.remove(this.parent.getRowHeaderContent(),"mousemove",this.setTarget),t.EventHandler.remove(this.parent.element.getElementsByClassName("e-header-panel")[0],"mousemove",this.setTarget)},e.prototype.unwireEvents=function(){t.EventHandler.remove(this.parent.getColumnHeaderContent(),"dblclick",this.dblClickHandler),t.EventHandler.remove(this.parent.getRowHeaderContent(),"dblclick",this.dblClickHandler),t.EventHandler.remove(this.parent.getColumnHeaderContent(),"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.parent.getRowHeaderContent(),"mousedown",this.mouseDownHandler),this.unWireResizeCursorEvent()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contentLoaded",this.wireEvents),this.parent.off(hr,this.autoFit),this.parent.off("setAutoFit",this.setAutoFitHandler))},e.prototype.mouseMoveHandler=function(e){var t=this.parent.element.getElementsByClassName("e-colresize-handler")[0],r=this.parent.element.getElementsByClassName("e-rowresize-handler")[0];(t||r)&&(this.isMouseMoved=!0,t?e.x>this.trgtEle.parentElement.firstChild.getBoundingClientRect().left&&(t.style.left=e.clientX-document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect().left+"px"):r&&e.y>=this.trgtEle.parentElement.parentElement.firstChild.getBoundingClientRect().top&&(r.style.top=e.clientY-document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect().top+"px"))},e.prototype.mouseDownHandler=function(e){if(t.closest(e.target,".e-header-cell")){if(this.event=e,this.trgtEle=e.target,this.trgtEle.parentElement.classList.contains("e-hide-end")||this.trgtEle.classList.contains("e-hide-end")){var r=this.trgtEle.offsetHeight,n=e.offsetY;(r>=10&&n<5||r-2<8&&n<Math.ceil((n-2)/2))&&this.trgtEle.classList.add("e-skip-resize")}this.updateTarget(e,this.trgtEle);var i=this.trgtEle,a=i.classList.contains("e-colresize")?"e-colresize-handler":i.classList.contains("e-rowresize")?"e-rowresize-handler":"";this.createResizeHandler(i,a),this.unWireResizeCursorEvent(),t.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)}},e.prototype.mouseUpHandler=function(e){var r=this.parent.element.getElementsByClassName("e-colresize-handler")[0],n=this.parent.element.getElementsByClassName("e-rowresize-handler")[0];this.resizeOn(e),this.isMouseMoved=null;var i=r||n;i&&(document.getElementById(this.parent.element.id+"_sheet").removeChild(i),this.updateCursor()),t.EventHandler.remove(document,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),this.wireResizeCursorEvent(this.parent.getRowHeaderContent(),this.parent.element.getElementsByClassName("e-header-panel")[0])},e.prototype.dblClickHandler=function(e){if(t.closest(e.target,".e-header-cell"))if(this.trgtEle=e.target,this.updateTarget(e,this.trgtEle),this.trgtEle.classList.contains("e-colresize")){var r=parseInt(this.trgtEle.getAttribute("aria-colindex"),10)-1,n=Le(this.parent.getActiveSheet(),r)+"px";this.trgtEle.classList.contains("e-unhide-column")?this.showHiddenColumns(r-1):this.setAutofit(r,!0,n)}else if(this.trgtEle.classList.contains("e-rowresize")){var i=parseInt(this.trgtEle.parentElement.getAttribute("aria-rowindex"),10)-1,a=Re(this.parent.getActiveSheet(),i)+"px";this.setAutofit(i,!1,a)}},e.prototype.setTarget=function(e){if(t.closest(e.target,".e-header-cell")){var r=e.target,n=this.parent.getActiveSheet();if(n.isProtected&&(!n.protectSettings.formatColumns||!n.protectSettings.formatRows)){if(!n.protectSettings.formatRows&&!n.protectSettings.formatColumns)return;if(n.protectSettings.formatRows&&t.closest(r,".e-colhdr-table"))return;if(n.protectSettings.formatColumns&&t.closest(r,".e-rowhdr-table"))return}var i,a,o,s;if(t.closest(r,".e-header-row"))o=e.offsetX,a=r.offsetWidth,s="e-colresize",(l=this.getColPrevSibling(r))&&!l.classList.contains("e-select-all-cell")?i=l:Number(r.getAttribute("aria-colindex"))>1&&(i=r);else if(t.closest(r,".e-row")){o=e.offsetY,a=r.offsetHeight,s="e-rowresize";var l=this.getRowPrevSibling(r);l?i=l.firstElementChild:Number(r.parentElement.getAttribute("aria-rowindex"))>1&&(i=r)}if(a-2<8&&o!==Math.ceil((a-2)/2))o<Math.ceil((a-2)/2)?(r.classList.add(s),i.classList.add(s)):o>Math.ceil((a-2)/2)&&r.classList.add(s);else if(a-5<o&&o<=a&&a>=10)r.classList.add(s);else if(o<5&&i&&a>=10)r.classList.add(s),i.classList.add(s);else for(var h=this.parent.element.getElementsByClassName(s),d=0;d<h.length;d++)h[d].classList.remove(s)}},e.prototype.getColPrevSibling=function(e){var r=this.parent.frozenColCount(this.parent.getActiveSheet());return e.previousElementSibling||(r&&t.closest(e,".e-column-header")?this.parent.getSelectAllContent().querySelector(".e-header-row").lastElementChild:null)},e.prototype.getRowPrevSibling=function(e){var r=this.parent.frozenRowCount(this.parent.getActiveSheet());return e.parentElement.previousElementSibling||(r&&t.closest(e,".e-row-header")?this.parent.getSelectAllContent().querySelector("tbody").lastElementChild:null)},e.prototype.updateTarget=function(e,r){if(t.closest(r,".e-header-row")){if(r.offsetWidth<10&&e.offsetX<Math.ceil((r.offsetWidth-2)/2)||e.offsetX<5&&r.offsetWidth>=10&&r.classList.contains("e-colresize")){var n=this.parent.getActiveSheet(),i=Number(this.trgtEle.getAttribute("aria-colindex"))-2;(a=this.getColPrevSibling(r))&&!De(n,i)?this.trgtEle=a:i>-1&&this.trgtEle.classList.add("e-unhide-column")}}else if(r.offsetHeight<10&&e.offsetY<Math.ceil((r.offsetHeight-2)/2)||e.offsetY<5&&r.offsetHeight>=10&&r.classList.contains("e-rowresize")){var n=this.parent.getActiveSheet(),i=Number(r.parentElement.getAttribute("aria-rowindex"))-2,a=this.getRowPrevSibling(r);if(a||Ee(n,i))if("dblclick"===e.type&&Ee(n,i)){var o=S(c(n.selectedRange)),s=void 0;s=i<=o[2]&&i>o[0]?{startIndex:o[0],endIndex:o[2],hide:!1,autoFit:!0}:{startIndex:i,endIndex:i,hide:!1,autoFit:!0},this.parent.notify(lr,s)}else Ee(n,i)||(this.trgtEle=a.getElementsByClassName("e-header-cell")[0])}},e.prototype.setAutoFitHandler=function(e){this.setAutofit(e.idx,e.isCol)},e.prototype.setAutofit=function(e,t,r){var n=0,i=this.parent.getActiveSheet(),a=this.parent.getMainContent(),o=t?Le(this.parent.getActiveSheet(),e)+"px":Re(this.parent.getActiveSheet(),e)+"px",s=[],l=a.getElementsByClassName("e-content-table")[0];this.parent.getActiveSheet().showHeaders&&(t?this.parent.getColHeaderTable():this.parent.getRowHeaderTable()).getElementsByTagName("tr");var h=!1,d=0;if(t)for(var p=i.rows.length,c=0;c<p;c++)i.rows[c]&&i.rows[c].cells&&i.rows[c].cells[e]&&(J(c,e,i).wrap&&(h=!0,d++),(g=this.parent.createElement("td",{className:"e-cell"})).textContent=this.parent.getDisplayText(i.rows[c].cells[e]),i.rows[c].cells[e].style&&((m=i.rows[c].cells[e].style).fontFamily&&(g.style.fontFamily=m.fontFamily),m.fontSize&&(g.style.fontSize=m.fontSize)),s[n]=g,n++);else for(var u=i.rows[e]&&i.rows[e].cells?i.rows[e].cells.length:0,f=0;f<u;f++)if(i.rows[e]&&i.rows[e].cells[f]){J(e,f,i).wrap&&(h=!0,d++);var g=this.parent.createElement("td");if(g.textContent=this.parent.getDisplayText(i.rows[e].cells[f]),i.rows[e].cells[f].style){var m=i.rows[e].cells[f].style;m.fontFamily&&(g.style.fontFamily=m.fontFamily),m.fontSize&&(g.style.fontSize=m.fontSize)}s[n]=g,n++}if(0===d){var v=dt(l,s,t,this.parent,r,h);t&&(v=this.getFloatingElementWidth(v,e));var y=0===v?parseInt(o,10):v,C=parseInt(o,10)>y?-(parseInt(o,10)-y):y-parseInt(o,10);if(t)if(e>=this.parent.viewport.leftIndex&&e<=this.parent.viewport.rightIndex)Te(i,e).width=y>0?y:0,this.resizeStart(e,this.parent.getViewportIndex(e,!0),y+"px",t,!0,r),this.parent.notify("colWidthChanged",{threshold:C,colIdx:e});else{var b,x=Le(i,e);b=y>0?-(x-y):-x,this.parent.notify("colWidthChanged",{threshold:b,colIdx:e}),Te(i,e).width=y>0?y:0}else if(!t)if(e>=this.parent.viewport.topIndex&&e<=this.parent.viewport.bottomIndex)ke(i,e,(y=y>20?y:20)>0?y:0),this.resizeStart(e,this.parent.getViewportIndex(e),y+"px",t,!0,r),this.parent.notify(sr,{threshold:C,rowIdx:e});else{var S,w=Re(i,e);S=y>0?-(w-y):-w,this.parent.notify(sr,{threshold:S,rowIdx:e}),ke(i,e,y>0?y:0)}}},e.prototype.createResizeHandler=function(e,t){var r=this.parent.createElement("div",{className:t}),n=document.getElementById(this.parent.element.id+"_sheet");e.classList.contains("e-colresize")?(r.style.height=this.parent.getMainContent().parentElement.clientHeight+this.parent.getColumnHeaderContent().offsetHeight+"px",r.style.left=this.event.clientX-n.getBoundingClientRect().left+"px",r.style.top="0px"):e.classList.contains("e-rowresize")&&(r.style.width=this.parent.getMainContent().parentElement.clientWidth+"px",r.style.left="0px",r.style.top=this.event.clientY-n.getBoundingClientRect().top+"px"),n.appendChild(r),this.updateCursor()},e.prototype.setColWidth=function(e,t,r,n){var i=this.parent.getActiveSheet(),a=at(r)-n;if(a<0&&n<-a&&(a=-n),r>0){if(this.isMouseMoved&&this.trgtEle.classList.contains("e-unhide-column"))return this.showHiddenColumns(e,r),void this.parent.notify(pr,{eventArgs:{index:e,width:"0px",isCol:!0,sheetIdx:this.parent.activeSheetIndex,oldWidth:n+"px",hide:!1},action:"resize"});this.resizeStart(e,t,r+"px",!0,!1,n+"px"),Fe(i,e,{width:r,customWidth:!0}),this.parent.notify("colWidthChanged",{threshold:a,colIdx:e})}else this.isMouseMoved&&(this.parent.hideColumn(e),this.parent.notify(pr,{eventArgs:{index:e,width:"0px",isCol:!0,sheetIdx:this.parent.activeSheetIndex,oldWidth:n+"px",hide:!0},action:"resize"}))},e.prototype.showHiddenColumns=function(e,t){var r,n,i,a=this.parent.getActiveSheet(),o=c(a.selectedRange);if(e>=o[1]&&e<=o[3]&&o[2]===a.rowCount-1&&u(a.activeCell)[0]===u(a.topLeftCell)[0]?(r=o[1],n=o[3],i=this.parent.getMainContent().querySelector("colgroup")):r=n=e,void 0!==t)for(var s=r;s<=n;s++)Fe(a,s,{width:t,customWidth:!0}),s>=this.parent.viewport.leftIndex&&s<=this.parent.viewport.rightIndex&&!De(a,s)&&(i.children[this.parent.getViewportIndex(s,!0)].style.width=t+"px");this.trgtEle.classList.remove("e-unhide-column"),this.parent.hideColumn(r,n,!1),void 0===t&&this.autoFit({isRow:!1,startIndex:r,endIndex:n})},e.prototype.setRowHeight=function(e,t,r,n){var i=this.parent.getActiveSheet(),a=this.parent.frozenColCount(i),o=parseInt(this.parent.getRow(e,null,a).style.height,10),s=r,l=at(parseInt(s,10))-o;l<0&&o<-l&&(l=-o),this.resizeStart(e,t,s,!1,!1,n),Ie(i,e,{height:parseInt(s,10)>0?parseInt(s,10):0,customHeight:!0}),this.parent.notify(sr,{threshold:l,rowIdx:e,isCustomHgt:!0})},e.prototype.resizeOn=function(e){var t,r,n=this,i=this.parent.getActiveSheet(),a=c(i.activeCell),o=J(a[0],a[1],i);if(this.trgtEle.classList.contains("e-rowresize")){var s=Number(this.trgtEle.parentElement.getAttribute("aria-rowindex"))-2;if(this.isMouseMoved&&Ee(i,s)&&this.trgtEle.classList.contains("e-skip-resize")&&e.clientY>this.trgtEle.getBoundingClientRect().top){this.trgtEle.classList.remove("e-skip-resize");var l={startIndex:s,endIndex:s,hide:!1,skipAppend:!0};this.parent.notify(lr,l);var h=this.parent.getRowHeaderTable().tBodies[0],d=this.parent.getContentTable().tBodies[0];l.hdrRow.style.display="none",l.row.style.display="none",h.insertBefore(l.hdrRow,h.children[l.insertIdx]),d.insertBefore(l.row,d.children[l.insertIdx]),this.trgtEle=l.hdrRow.firstElementChild,l.hdrRow.nextElementSibling.classList.remove("e-hide-end"),l.mergeCollection.forEach(function(e){n.parent.notify(Vt,e)})}else if(this.trgtEle.classList.contains("e-skip-resize")){if(this.trgtEle.classList.remove("e-skip-resize"),!this.isMouseMoved&&Ee(i,s)||!this.trgtEle.parentElement.previousElementSibling)return;this.trgtEle=this.trgtEle.parentElement.previousElementSibling.getElementsByClassName("e-header-cell")[0]}r=t=parseInt(this.trgtEle.parentElement.getAttribute("aria-rowindex"),10)-1,t=this.parent.getViewportIndex(r);var p=this.parent.frozenColCount(i),u=this.parent.getRow(r,null,p).style.height,f=e.clientY-this.event.clientY+parseInt(u,10);if(f<=0)return this.parent.hideRow(r),Ie(i,r,{height:0,customHeight:!0}),void this.parent.notify(pr,{eventArgs:{index:r,height:"0px",isCol:!1,sheetIdx:this.parent.activeSheetIndex,oldHeight:u},action:"resize"});if(this.setRowHeight(r,t,f+"px",u),o&&o.rowSpan){b=this.parent.getCell(a[0],a[1]);this.parent.element.querySelector(".e-active-cell").style.height=b.offsetHeight+"px"}if("none"===this.trgtEle.parentElement.style.display){var g=this.parent.getActiveSheet(),m=S(c(g.selectedRange));if(r<=m[2]&&r>m[0]){f=Re(g,r);for(var v=void 0,y=m[0];y<=m[2];y++)y!==r&&(u=Re(g,y)+"px",Ie(g,y,{customHeight:!0,height:f}),Ee(g,y)?v||(v=y):(this.parent.getRow(y).style.height=f+"px",g.showHeaders&&(this.parent.getRow(y,this.parent.getRowHeaderTable()).style.height=f+"px")),this.parent.notify(pr,{eventArgs:{index:y,height:f+"px",isCol:!1,sheetIdx:this.parent.activeSheetIndex,oldHeight:u},action:"resize"}));this.parent.hideRow(m[0],r-1,!1),t+=Math.abs(r-v)}else 0===t||Ee(g,r-1)?0!==t&&this.trgtEle.parentElement.classList.add("e-hide-end"):this.trgtEle.parentElement.previousElementSibling.classList.remove("e-hide-start"),this.parent.selectRange(g.selectedRange);this.trgtEle.parentElement.style.display="",this.parent.getContentTable().rows[t].style.display=""}}else if(this.trgtEle.classList.contains("e-colresize")){this.isMouseMoved&&this.trgtEle.classList.contains("e-unhide-column")&&e.clientX<this.trgtEle.getBoundingClientRect().left&&(this.trgtEle.classList.remove("e-unhide-column"),this.trgtEle.previousElementSibling&&(this.trgtEle=this.trgtEle.previousElementSibling)),t=parseInt(this.trgtEle.getAttribute("aria-colindex"),10)-1;var C=void 0;if(this.trgtEle.classList.contains("e-unhide-column")?(t-=1,C=0):C=Le(this.parent.getActiveSheet(),t),this.setColWidth(t,this.parent.getViewportIndex(t,!0),e.clientX-this.event.clientX+C,C),o&&o.colSpan){var b=this.parent.getCell(a[0],a[1]);this.parent.element.querySelector(".e-active-cell").style.width=b.offsetWidth+"px"}}},e.prototype.resizeStart=function(e,t,r,n,i,a){lt(e,t,r,n,this.parent);var o,s,l=i?"resizeToFit":"resize";n?(o={index:e,width:r,isCol:n,sheetIdx:this.parent.activeSheetIndex,oldWidth:a},s=a!==r):(o={index:e,height:r,isCol:n,sheetIdx:this.parent.activeSheetIndex,oldHeight:a},s=a!==r),s&&this.parent.notify(pr,{eventArgs:o,action:l})},e.prototype.updateCursor=function(){this.parent.element.getElementsByClassName("e-colresize-handler")[0]?this.parent.element.classList.add("e-col-resizing"):this.parent.element.classList.contains("e-col-resizing")&&this.parent.element.classList.remove("e-col-resizing"),this.parent.element.getElementsByClassName("e-rowresize-handler")[0]?this.parent.element.classList.add("e-row-resizing"):this.parent.element.classList.contains("e-row-resizing")&&this.parent.element.classList.remove("e-row-resizing")},e.prototype.getFloatingElementWidth=function(e,t){var r=e,n={filterRange:[],hasFilter:!1};return this.parent.notify("getFilterRange",n),n.hasFilter&&n.filterRange&&n.filterRange[1]<=t&&n.filterRange[3]>=t&&(r=e+22),r},e.prototype.destroy=function(){this.unwireEvents(),this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"resize"},e}(),Zn=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.refreshClients=function(e){pt(e,this.parent)},e.prototype.addEventListener=function(){this.parent.on("collaborativeUpdate",this.refreshClients,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("collaborativeUpdate",this.refreshClients)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"collaborativeEditing"},e}(),Jn=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.hideShow=function(e){var t=this.parent.getActiveSheet();if(!t.frozenRows&&!t.frozenColumns){if(e.startIndex>e.endIndex){var r=e.startIndex;e.startIndex=e.endIndex,e.endIndex=r}e.actionUpdate&&this.parent.notify(cr,{eventArgs:e,action:"hideShow"}),e.isCol?this.hideCol(e):this.hideRow(e),e.actionUpdate&&this.parent.notify(pr,{eventArgs:e,action:"hideShow"})}},e.prototype.hideRow=function(e){var r,n,i,a,o=this,s=this.parent.getActiveSheet(),l=0;if(e.hide){for(var h=void 0,d=void 0,p=void 0,c=e.startIndex;c<=e.endIndex;c++)if(!Ee(s,c))if(void 0===n&&(s.showHeaders&&(d=this.parent.getRowHeaderTable()),h=this.parent.getContentTable(),n=this.parent.getViewportIndex(c),l=0),Ie(s,c,{hidden:!0}),this.refreshChart(c,"rows"),p=h&&h.rows[n]){if(!a)for(m=0;m<=s.usedRange.colIndex;m++)if(((r=J(c,m,s)||{}).colSpan||r.rowSpan)&&(e.startIndex>=this.parent.viewport.topIndex||this.parent.scrollSettings.enableVirtualization)){a=!0;break}if(a)continue;if(s.showHeaders&&t.detach(d.rows[n]),t.detach(p),l++,(p=h.rows[n])&&c===e.endIndex)for(var u=void 0,f=(i=It(s,c+1,!0))!==It(s,0,!0)&&i===(this.parent.viewport.topIndex>=e.startIndex?e.endIndex+1:this.parent.viewport.topIndex)?"Row":"",m=this.parent.viewport.leftIndex;m<=this.parent.viewport.rightIndex;m++)""!==(F=this.parent.getCellStyleValue(["borderTop"],[i,m]).borderTop)&&(u=p.cells[m],this.parent.notify(Ft,{onActionUpdate:!1,rowIdx:i,colIdx:m,style:{borderTop:F},row:p,pRow:p.previousElementSibling,first:f,cell:u}))}else c<=this.parent.viewport.bottomIndex?l++:l--;if(a&&(e.startIndex>=this.parent.viewport.topIndex||!this.parent.scrollSettings.enableVirtualization))return this.parent.selectRange(s.selectedRange),void this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Row"});if(!l)return;if(this.parent.selectRange(s.selectedRange),this.parent.scrollSettings.enableVirtualization){this.parent.viewport.topIndex>=e.startIndex&&(this.parent.viewport.topIndex=e.endIndex+1),e.startIndex=this.parent.viewport.bottomIndex+1,e.endIndex=e.startIndex+l-1;var v=this.parent.skipHidden(e.startIndex,e.endIndex);e.startIndex=v[0],e.endIndex=v[1],this.parent.viewport.bottomIndex=e.endIndex,this.parent.renderModule.refreshUI({colIndex:this.parent.viewport.leftIndex,direction:"",refresh:"RowPart"},g(e.startIndex,this.parent.viewport.leftIndex)+":"+g(e.endIndex,this.parent.viewport.leftIndex+this.parent.viewport.colCount+2*this.parent.getThreshold("col")))}s.showHeaders&&(0===n?d.rows[0]&&d.rows[0].classList.add("e-hide-end"):(d&&d.rows[n-1]&&d.rows[n-1].classList.add("e-hide-start"),d&&d.rows[n]&&d.rows[n].classList.add("e-hide-end")))}else{for(var y=void 0,C=void 0,b=void 0,p=void 0,x=void 0,S=void 0,w=void 0,I=void 0,E=e.startIndex-1,R=void 0,k=[],c=e.startIndex,A=e.endIndex;c<=A;c++)if(Ee(s,c))if(void 0===R)if(c>this.parent.viewport.bottomIndex){if(Ie(s,c,{hidden:!1}),void 0===I)return}else{void 0===I&&(I=c),Ie(s,c,{hidden:!1}),this.refreshChart(c,"rows"),void 0===n&&(y=document.createDocumentFragment(),C=document.createDocumentFragment(),x=this.parent.serviceLocator.getService("row"),s.showHeaders&&this.parent.getRowHeaderTable()&&(S=this.parent.getRowHeaderTable().tBodies[0]),w=this.parent.getContentTable()?this.parent.getContentTable().tBodies[0]:this.parent.getContentTable(),c<this.parent.viewport.topIndex&&(this.parent.viewport.topIndex=c),n=0===c?0:this.parent.getViewportIndex(c)),E++,s.showHeaders&&(b=x.refresh(c,null,null,!0),y.appendChild(b),S&&t.detach(S.lastElementChild)),p=C.appendChild(x.refresh(c,p,b)),w&&t.detach(w.lastElementChild);for(m=this.parent.viewport.leftIndex;m<=this.parent.viewport.rightIndex;m++)if(void 0!==(r=J(c,m,s)||{}).rowSpan){var T={range:[c,m,c,m],isAction:!1,merge:!0,type:"All",skipChecking:!0};this.parent.notify("activeCellMergedRange",T),k.length&&T.range[1]===k[k.length-1].range[1]||k.push(T)}}else A=c;else{if(e.startIndex===e.endIndex)return;void 0===n?E++:R=c}if(this.parent.viewport.bottomIndex=this.parent.viewport.topIndex+this.parent.viewport.rowCount+2*this.parent.getThreshold("row"),l=this.parent.hiddenCount(this.parent.viewport.topIndex,e.startIndex)+this.parent.hiddenCount(e.endIndex+1,this.parent.viewport.bottomIndex),this.parent.viewport.bottomIndex+=l,e.insertIdx=n,e.row=C.querySelector(".e-row"),e.mergeCollection=k,s.showHeaders&&(e.hdrRow=y.querySelector(".e-row"),0!==n&&!Ee(s,E-1)&&S.children[n-1]&&S.children[n-1].classList.remove("e-hide-start"),0!==e.startIndex&&Ee(s,e.startIndex-1)&&e.hdrRow.classList.add("e-hide-end"),Ee(s,E+1)?y.lastElementChild.classList.add("e-hide-start"):S.children[n]&&S.children[n].classList.remove("e-hide-end")),p&&w&&w.children[n]){i=It(s,E+1,!0);for(c=this.parent.viewport.leftIndex;c<=this.parent.viewport.rightIndex;c++){var F=this.parent.getCellStyleValue(["borderTop"],[i,c]).borderTop;if(""!==F){this.parent.notify(Ft,{onActionUpdate:!1,rowIdx:i,colIdx:c,style:{borderTop:F},pRow:p,cell:w.children[n].children[c],first:""});var L=It(s,I-1,!1);L>-1?!w.children[n-1]||this.parent.getCellStyleValue(["borderBottom"],[L,c]).borderBottom||this.parent.getCellStyleValue(["borderTop"],[I,c]).borderTop||(w.children[n-1].children[c].style.borderBottom=""):w.children[n].children[c].style.borderTop=""}}}if(e.skipAppend)return;s.showHeaders&&S&&S.insertBefore(y,S.children[n]),w&&w.insertBefore(C,w.children[n]),this.parent.selectRange(s.selectedRange),e.autoFit&&s.showHeaders&&this.parent.notify(hr,{startIndex:e.startIndex,endIndex:e.endIndex,isRow:!0}),k.forEach(function(e){o.parent.notify(Vt,e)}),void 0!==R&&R!==e.endIndex&&(e.startIndex=R,this.hideRow(e))}},e.prototype.hideCol=function(e){for(var t,r=this,n=this.parent.getActiveSheet(),i=[],a=[],o=u(n.topLeftCell),s=e.startIndex;s<=e.endIndex;s++)(e.hide?!De(n,s):De(n,s))&&(Fe(n,s,{hidden:e.hide}),this.refreshChart(s,"columns"),this.parent.scrollSettings.enableVirtualization&&(s<this.parent.viewport.leftIndex||s>this.parent.viewport.rightIndex)?s<this.parent.viewport.leftIndex&&a.push(s):(i.push(s),e.hide&&o[1]===s&&(t=!0)));if(a.length||i.length)if(e.hide){if(!i.length)return;if((i.length<=this.parent.getThreshold("col")||!this.parent.scrollSettings.enableVirtualization)&&this.removeCell(n,i),this.parent.scrollSettings.enableVirtualization){if(i[0]===this.parent.viewport.leftIndex&&(this.parent.viewport.leftIndex=It(n,i[i.length-1]+1,!0,"columns")),t){var l=0;if(i.slice(0,i.indexOf(o[1])).forEach(function(e){l+=Le(n,e,!0)}),l){this.parent.notify("setScrollEvent",{set:!1});var h=this.parent.getMainContent();h.scrollLeft-=l,this.parent.notify("onContentScroll",{scrollLeft:h.scrollLeft,preventScroll:!0,skipHidden:!0}),Be(function(){return r.parent.notify("setScrollEvent",{set:!0})})}}if(this.parent.scrollSettings.isFinite){var d=It(n,n.colCount-1,!1,"columns"),p=this.parent.viewport.leftIndex,c=this.parent.viewport.rightIndex;if(c+i.length>=d){var f=It(n,p-(c+i.length-d),!1,"columns");return f>-1&&(this.parent.viewport.leftIndex=f,this.parent.viewport.leftIndex-=this.parent.hiddenCount(c,d)),this.parent.viewport.rightIndex=d,p!==this.parent.viewport.leftIndex||c!==this.parent.viewport.rightIndex?this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex===It(n,0,!0,"columns"),rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Column"}):this.parent.notify("updateTableWidth",{refresh:"Column",isUpdate:!0}),void this.parent.selectRange(n.selectedRange)}}if(i.length<=this.parent.getThreshold("col")){var v=this.parent.skipHidden(this.parent.viewport.rightIndex+1,this.parent.viewport.rightIndex+i.length,"columns");this.parent.viewport.rightIndex=v[1],this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:v[0],direction:"",refresh:"ColumnPart"},""+m([this.parent.viewport.topIndex,v[0],this.parent.viewport.bottomIndex,v[1]]))}else this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex===It(n,0,!0,"columns"),rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Column"})}this.parent.selectRange(n.selectedRange)}else{if(a.length){if(a.sort(function(e,t){return e-t}),this.parent.scrollSettings.enableVirtualization&&a[0]<this.parent.getThreshold("col")){var y=u(n.topLeftCell)[0]+1;this.parent.setSheetPropertyOnMute(n,"topLeftCell","A"+y),this.parent.renderModule.refreshUI({skipUpdateOnFirst:!0,rowIndex:this.parent.viewport.topIndex,colIndex:0,refresh:"Column"}),this.parent.selectRange(n.selectedRange)}else this.parent.goTo(g(this.parent.viewport.topIndex,a[0]));return}i.length<=this.parent.getThreshold("col")||!this.parent.scrollSettings.enableVirtualization?(this.appendCell(n,i),this.parent.scrollSettings.enableVirtualization&&this.parent.notify("virtualContentLoaded",{refresh:"Column",prevRowColCnt:{rowCount:n.rowCount,colCount:n.colCount}})):this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex===It(n,0,!0,"columns"),rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Column"}),this.parent.selectRange(n.selectedRange)}},e.prototype.removeCell=function(e,r){var n,i,a,o,s,l,h=this,d=0,p=this.parent.getViewportIndex(r[0],!0)+1;this.parent.scrollSettings.enableVirtualization?(n=this.parent.viewport.topIndex,i=this.parent.viewport.bottomIndex):(n=0,i=e.rowCount-1);var c,u=this.parent.getContentTable(),f=u.getElementsByTagName("colgroup")[0];if(e.showHeaders){var g=this.parent.getColHeaderTable();s=g.getElementsByTagName("colgroup")[0],a=g.rows[0]}for(var m=r.length-1;n<=i;)Ee(e,n)?n++:(o=u.rows[d],r.forEach(function(i,u){if(t.detach(o.cells[p]),0===d&&(e.showHeaders&&(t.detach(a.cells[p]),t.detach(s.children[p])),t.detach(f.children[p])),0===u&&void 0!==(l=J(n,i,e)||{}).colSpan&&(void 0===l.rowSpan||l.colSpan>1)&&h.parent.notify("hiddenMerge",{rowIdx:n,colIdx:i,model:"col",start:r[0],end:r[m]}),u===m){c=It(e,i+1,!0,"columns");var g=h.parent.getCellStyleValue(["borderLeft"],[d,c]).borderLeft;""!==g&&h.parent.notify(Ft,{onActionUpdate:!1,rowIdx:d,colIdx:c,style:{borderLeft:g},row:o,first:""}),void 0!==(l=J(n,i,e)||{}).colSpan&&(void 0===l.rowSpan||l.colSpan>1)&&h.parent.notify("hiddenMerge",{rowIdx:n,colIdx:i,model:"col",start:r[0],end:r[m],isEnd:!0})}}),n++,d++);p-1>-1&&e.showHeaders&&a.cells[p-1]&&a.cells[p-1].classList.add("e-hide-start"),a.cells[p]&&a.cells[p].classList.add("e-hide-end")},e.prototype.appendCell=function(e,r){var n,i,a,o,s,l,h=this,d=0;this.parent.scrollSettings.enableVirtualization?(n=this.parent.viewport.topIndex,i=this.parent.viewport.bottomIndex):(n=0,i=e.rowCount-1);var p=this.parent.getContentTable(),c=this.parent.getColHeaderTable(),u=p.getElementsByTagName("colgroup")[0];e.showHeaders&&(s=c.getElementsByTagName("colgroup")[0],a=c.rows[0]);var f=this.parent.serviceLocator.getService("cell");r.sort(function(e,t){return e-t});for(var m,v,y,C=[],b=[],x=r.length-1;n<=i;)Ee(e,n)?n++:(o=p.rows[d],r.forEach(function(i,p){if(0===d&&(b[p]=h.parent.getViewportIndex(i,!0),u.children[b[p]]?(u.insertBefore(h.parent.sheetModule.updateCol(e,i),u.children[b[p]]),e.showHeaders&&(y=a.cells[b[p]],0===p&&r[p]&&!De(e,r[p]-1)&&y.previousElementSibling.classList.remove("e-hide-start"),a.insertBefore(f.renderColHeader(i),y),p===x&&y.classList.remove("e-hide-end"))):(u.appendChild(h.parent.sheetModule.updateCol(e,i)),e.showHeaders&&a.appendChild(f.renderColHeader(i))),t.detach(u.lastChild),e.showHeaders&&(t.detach(a.lastChild),p===x&&(t.detach(s),c.insertBefore(u.cloneNode(!0),c.tHead[0])))),t.detach(o.lastChild),y=o.cells[b[p]],v=f.render({rowIdx:n,colIdx:i,cell:J(n,i,e),address:g(n,i),lastCell:i===x,isHeightCheckNeeded:!0,first:i!==It(e,0,!0,"columns")&&i===h.parent.viewport.leftIndex?"Column":"",checkNextBorder:p===x?"Column":""}),y?o.insertBefore(v,y):o.appendChild(v),0===p&&v.previousSibling&&""!==h.parent.getCellStyleValue(["borderLeft"],[d,It(e,r[r.length-1]+1,!0,"columns")]).borderLeft&&(l=It(e,r[0]-1,!1,"columns"))>-1&&!h.parent.getCellStyleValue(["borderRight"],[d,l]).borderRight&&!h.parent.getCellStyleValue(["borderLeft"],[d,r[0]]).borderLeft&&(v.previousSibling.style.borderRight=""),void 0!==(m=J(d,i,e)||{}).colSpan&&(void 0===m.rowSpan||m.colSpan>1)){var S={range:[d,i,d,i],isAction:!1,merge:!0,type:"All",skipChecking:!0};h.parent.notify("activeCellMergedRange",S),C.length&&S.range[1]===C[C.length-1].range[1]||C.push(S)}}),n++,d++);C.forEach(function(e){h.parent.notify(Vt,e)}),this.parent.viewport.rightIndex=It(e,this.parent.viewport.rightIndex-r.length,!1,"columns")},e.prototype.refreshChart=function(e,t){this.parent.notify("refreshChart",{rIdx:e,showHide:t})},e.prototype.addEventListener=function(){this.parent.on(lr,this.hideShow,this),this.parent.on("spreadsheetDestroyed",this.destroy,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.off(lr,this.hideShow),this.parent.off("spreadsheetDestroyed",this.destroy)},e}(),Qn=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("initiateHyperlink",this.initiateHyperlinkHandler,this),this.parent.on("editHyperlink",this.editHyperlinkHandler,this),this.parent.on("openHyperlink",this.openHyperlinkHandler,this),this.parent.on(er,this.hyperlinkClickHandler,this),this.parent.on("createHyperlinkElement",this.createHyperlinkElementHandler,this),this.parent.on(tr,this.keyUpHandler,this),this.parent.on("deleteHyperlink",this.removeHyperlink,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiateHyperlink",this.initiateHyperlinkHandler),this.parent.off("editHyperlink",this.editHyperlinkHandler),this.parent.off("openHyperlink",this.openHyperlinkHandler),this.parent.off(er,this.hyperlinkClickHandler),this.parent.off("createHyperlinkElement",this.createHyperlinkElementHandler),this.parent.off(tr,this.keyUpHandler),this.parent.off("deleteHyperlink",this.removeHyperlink))},e.prototype.getModuleName=function(){return"spreadsheetHyperlink"},e.prototype.keyUpHandler=function(e){var r=e.target;if(t.closest(r,".e-document")){var n=document.querySelector(".e-hyp-text"),i=this.parent.element.querySelector(".e-hyperlink-alert-span"),a=(t.closest(r,".e-hyperlink-dlg")||t.closest(r,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild;n&&n.value&&(j(n.value.toUpperCase())?i&&(i.remove(),a.removeAttribute("disabled")):(this.showDialog(),a.setAttribute("disabled","true")))}if(r.classList.contains("e-text")&&t.closest(r,".e-cont")&&t.closest(r,".e-webpage")&&t.closest(r,".e-webpage").getElementsByClassName("e-cont")[1]===r.parentElement){a=(t.closest(r,".e-hyperlink-dlg")||t.closest(r,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild;""!==r.value?a.removeAttribute("disabled"):!!t.closest(r,".e-link-dialog").querySelector(".e-webpage").querySelectorAll(".e-cont")[1].querySelector(".e-text").value||a.setAttribute("disabled","true")}},e.prototype.initiateHyperlinkHandler=function(){var e=this,t=this.parent.serviceLocator.getService(Hi),r=this.parent.getActiveSheet();if(r.isProtected&&!r.protectSettings.insertLink)return void this.parent.notify("editAlert",null);if(!this.parent.element.querySelector(".e-hyperlink-dlg")){var n=this.parent.serviceLocator.getService(Bi);n.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-hyperlink-dlg",header:t.getConstant("InsertLink"),beforeOpen:function(t){var r={dialogName:"InsertLinkDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0),n.dialogInstance.content=e.hyperlinkContent(),n.dialogInstance.dataBind(),Et(e.parent.element)},open:function(){setTimeout(function(){Et(n.dialogInstance.element.querySelectorAll(".e-webpage input")[1])})},buttons:[{buttonModel:{content:t.getConstant("Insert"),isPrimary:!0,disabled:!0},click:function(){e.dlgClickHandler(),n.hide()}}]})}},e.prototype.dlgClickHandler=function(){var e,t,r=this.parent.element.querySelector(".e-link-dialog").getElementsByClassName("e-content")[0].querySelector(".e-item.e-active");if(r)if(r.querySelector(".e-webpage")){e=r.getElementsByClassName("e-cont")[0].querySelector(".e-text").value;o={address:t=r.getElementsByClassName("e-cont")[1].querySelector(".e-text").value};this.parent.insertHyperlink(o,this.parent.getActiveSheet().activeCell,e,!1)}else{e=r.getElementsByClassName("e-cont")[0].querySelector(".e-text").value,t=r.getElementsByClassName("e-cont")[1].querySelector(".e-text").value;var n=r.getElementsByClassName("e-cont")[2];if(n.getElementsByClassName("e-list-item")[0].querySelector(".e-active")){o={address:t=r.getElementsByClassName("e-cont")[2].querySelector(".e-active").textContent+"!"+t.toUpperCase()};this.parent.insertHyperlink(o,this.parent.getActiveSheet().activeCell,e,!1)}else if(n.querySelector(".e-active"))for(var i=r.getElementsByClassName("e-cont")[2].querySelector(".e-active").textContent,a=0;a<this.parent.definedNames.length;a++)if(this.parent.definedNames[a].name===i){var o={address:this.parent.definedNames[a].name};this.parent.insertHyperlink(o,this.parent.getActiveSheet().activeCell,e,!1)}}},e.prototype.showDialog=function(){this.parent.element.querySelector(".e-hyperlink-alert-span")&&this.parent.element.querySelector(".e-hyperlink-alert-span").remove();var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("span",{className:"e-hyperlink-alert-span",innerHTML:e.getConstant("HyperlinkAlert")});(this.parent.element.querySelector(".e-hyperlink-dlg")||this.parent.element.querySelector(".e-edithyperlink-dlg")).querySelector(".e-dlg-content").appendChild(t)},e.prototype.editHyperlinkHandler=function(){var e=this,t=this.parent.serviceLocator.getService(Hi),r=this.parent.serviceLocator.getService(Bi);r.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-edithyperlink-dlg",header:t.getConstant("EditLink"),beforeOpen:function(t){var n={dialogName:"EditLinkDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",n),n.cancel&&(t.cancel=!0),r.dialogInstance.content=e.hyperEditContent(),r.dialogInstance.dataBind(),Et(e.parent.element)},open:function(){setTimeout(function(){Et(r.dialogInstance.element.querySelector(".e-webpage")?r.dialogInstance.element.querySelectorAll(".e-webpage input")[1]:r.dialogInstance.element.querySelectorAll(".e-document input")[1])})},buttons:[{buttonModel:{content:t.getConstant("Update"),isPrimary:!0},click:function(){e.dlgClickHandler(),r.hide()}}]})},e.prototype.openHyperlinkHandler=function(){var e=u(this.parent.getActiveSheet().activeCell),t=this.parent.getCell(e[0],e[1]);t.getElementsByClassName("e-hyperlink")[0]&&(t=t.querySelector(".e-hyperlink")),this.hlOpenHandler(t)},e.prototype.hlOpenHandler=function(e){var r=this;if(e.classList.contains("e-hyperlink")){var n=["",""],i=void 0,a=!0;e.style.color="#551A8B",t.closest(e,".e-cell")&&(t.closest(e,".e-cell").style.color="#551A8B");var o=this.parent.getActiveSheet(),s=parseInt(e.parentElement.getAttribute("aria-colindex"),10)-1,l=parseInt(e.parentElement.parentElement.getAttribute("aria-rowindex"),10)-1,h=o.rows[l].cells[s].hyperlink,d=void 0,p={hyperlink:h,cell:this.parent.getActiveSheet().activeCell,target:"_blank",cancel:!1};if(this.parent.trigger("beforeHyperlinkClick",p),p.cancel)return;var u={hyperlink:h=p.hyperlink,cell:this.parent.getActiveSheet().activeCell};"string"==typeof h&&(d=h),"object"==typeof h&&(d=h.address);var f=d;if(-1===d.indexOf("http://")&&-1===d.indexOf("https://")&&-1===d.indexOf("ftp://")){if(!t.isNullOrUndefined(d)){if(this.parent.definedNames)for(v=0;v<this.parent.definedNames.length;v++)if(this.parent.definedNames[v].name===d){d=(d=this.parent.definedNames[v].refersTo).slice(1);break}-1!==d.indexOf("!")?-1!==(n=d.split("!"))[0].indexOf(" ")&&(n[0]=n[0].slice(1,n[0].length-1)):(n[0]=this.parent.getActiveSheet().name,n[1]=d);for(var g,v=0;v<this.parent.sheets.length;v++)this.parent.sheets[v].name===n[0]&&(g=v);if(o=this.parent.sheets[g],-1!==n[1].indexOf(":")){var y=n[1].indexOf(":"),C=n[1].substr(0,y),b=n[1].substr(y+1,n[1].length);C=C.replace("$",""),(b=b.replace("$","")).match(/\D/g)&&!b.match(/[0-9]/g)&&C.match(/\D/g)&&!C.match(/[0-9]/g)?(C+="1",b+=o.rowCount,n[1]=C+":"+b):!b.match(/\D/g)&&b.match(/[0-9]/g)&&!C.match(/\D/g)&&C.match(/[0-9]/g)&&(i=[parseInt(C,10)-1,0,parseInt(b,10)-1,o.colCount-1],a=!1)}var x=void 0,S=this.parent.definedNames;if(!t.isNullOrUndefined(S))for(v=0;v<S.length;v++)if(S[v].name===f){x=!0;break}if(j(n[1])||x){if(i=a?c(n[1]):i,this.parent.scrollSettings.enableVirtualization&&(i[0]=i[0]>=this.parent.viewport.topIndex?i[0]-this.parent.viewport.topIndex:i[0],i[1]=i[1]>=this.parent.viewport.leftIndex?i[1]-this.parent.viewport.leftIndex:i[1]),!t.isNullOrUndefined(o)){var w=m(i);if(o===this.parent.getActiveSheet())Be(function(){r.parent.goTo(w)});else{if(w.indexOf(":")>=0){var I=w.split(":");w=I[0]===I[1]?I[0]:w}Be(function(){r.parent.goTo(r.parent.sheets[g].name+"!"+w)})}}}else this.showInvalidHyperlinkDialog()}}else this.isValidUrl(d)?window.open(d,p.target):this.showInvalidHyperlinkDialog();this.parent.trigger("afterHyperlinkClick",u)}},e.prototype.isValidUrl=function(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)},e.prototype.showInvalidHyperlinkDialog=function(){var e=this.parent.serviceLocator.getService(Bi),t=this.parent.serviceLocator.getService(Hi);e.show({width:323,isModal:!0,showCloseIcon:!0,header:t.getConstant("Hyperlink"),content:t.getConstant("InvalidHyperlinkAlert"),buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0},click:function(){e.hide()}}]},!1)},e.prototype.hyperlinkClickHandler=function(e){var r=e.target;if(t.closest(r,".e-link-dialog")&&t.closest(r,".e-toolbar-item")){var n=(c=(p=t.closest(r,".e-hyperlink-dlg")||t.closest(r,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0]).firstChild,i=p.querySelector(".e-document"),a=p.querySelector(".e-webpage"),o=a?a.querySelectorAll(".e-cont")[0].querySelector(".e-text").value:i.querySelectorAll(".e-cont")[0].querySelector(".e-text").value,s=i?i.querySelectorAll(".e-cont")[0].querySelector(".e-text").value:o;if(t.closest(r,".e-toolbar-items").getElementsByClassName("e-toolbar-item")[1].classList.contains("e-active")){var l=i.querySelectorAll(".e-cont")[2].querySelector(".e-active");i.querySelectorAll(".e-cont")[0].querySelector(".e-text").value=o,t.closest(l,".e-list-item").classList.contains("e-level-2")&&n.hasAttribute("disabled")?n.removeAttribute("disabled"):t.closest(l,".e-list-item").classList.contains("e-level-1")&&!n.hasAttribute("disabled")&&n.setAttribute("disabled","true")}else{var h=!a.querySelectorAll(".e-cont")[1].querySelector(".e-text").value;a.querySelectorAll(".e-cont")[0].querySelector(".e-text").value=s,h&&!n.hasAttribute("disabled")?n.setAttribute("disabled","true"):!h&&n.hasAttribute("disabled")&&n.removeAttribute("disabled")}}if(t.closest(r,".e-list-item")&&r.classList.contains("e-fullrow")){var d=this.parent.element.getElementsByClassName("e-link-dialog")[0].getElementsByClassName("e-content")[0].getElementsByClassName("e-active")[0].getElementsByClassName("e-cont")[1].getElementsByClassName("e-text")[0],p=t.closest(r,".e-hyperlink-dlg")||t.closest(r,".e-edithyperlink-dlg"),c=p.getElementsByClassName("e-footer-content")[0],n=c.firstChild;t.closest(r,".e-list-item").classList.contains("e-level-2")?("defName"===t.closest(r,".e-list-item").getAttribute("data-uid")?d.classList.contains("e-disabled")||d.hasAttribute("readonly")||(d.setAttribute("readonly","true"),d.classList.add("e-disabled"),d.setAttribute("disabled","true")):"sheet"===t.closest(r,".e-list-item").getAttribute("data-uid")&&d.classList.contains("e-disabled")&&d.hasAttribute("readonly")&&(d.removeAttribute("readonly"),d.classList.remove("e-disabled"),d.removeAttribute("disabled")),n.hasAttribute("disabled")&&n.removeAttribute("disabled")):t.closest(r,".e-list-item").classList.contains("e-level-1")&&n.setAttribute("disabled","true")}else this.hlOpenHandler(r)},e.prototype.createHyperlinkElementHandler=function(e){var r=e.cell,n=e.td,i=this.parent.createElement("a",{className:"e-hyperlink e-hyperlink-style"});if(i.style.color="#00e",t.isNullOrUndefined(r.hyperlink))n.querySelector("a")&&r.hyperlink&&"string"==typeof r.hyperlink&&n.querySelector("a").setAttribute("href",r.hyperlink);else{var a=r.hyperlink;"string"==typeof a?(-1===a.indexOf("http://")&&-1===a.indexOf("https://")&&-1===a.indexOf("ftp://")&&-1!==a.indexOf("www.")&&(a="http://"+a),0===a.indexOf("http://")||0===a.indexOf("https://")||0===a.indexOf("ftp://")?(i.setAttribute("href",a),i.setAttribute("target","_blank")):(a.includes("=")||a.includes("!"))&&i.setAttribute("ref",a),i.innerText=""!==n.innerText?n.innerText:a,n.textContent="",n.innerText="",n.appendChild(i)):"object"==typeof a&&(0===a.address.indexOf("http://")||0===a.address.indexOf("https://")||0===a.address.indexOf("ftp://")?(i.setAttribute("href",a.address),i.setAttribute("target","_blank")):(a.address.includes("=")||a.address.includes("!"))&&i.setAttribute("ref",a.address),"Accounting"===H(r.format)?i.innerHTML=n.innerHTML:i.innerText=""!==n.innerText?n.innerText:a.address,n.textContent="",n.innerText="",n.appendChild(i))}},e.prototype.hyperEditContent=function(){var e=!0,t=this.hyperlinkContent(),r=c(this.parent.getActiveSheet().activeCell),n=this.parent.sheets[this.parent.getActiveSheet().id-1].rows[r[0]].cells[r[1]];this.parent.scrollSettings.enableVirtualization&&(r[0]=r[0]-this.parent.viewport.topIndex,r[1]=r[1]-this.parent.viewport.leftIndex);var i,a=this.parent.getDisplayText(n),o=n.hyperlink;"string"==typeof o?(i=o,a=a||i,-1===i.indexOf("http://")&&-1===i.indexOf("https://")&&-1===i.indexOf("ftp://")&&(e=!1)):"object"==typeof o&&(i=o.address,a=a||i,-1===i.indexOf("http://")&&-1===i.indexOf("https://")&&-1===i.indexOf("ftp://")&&(e=!1));for(var s=0,l=0,h=this.parent.definedNames,d=this.parent.sheets,p=0,u=h.length;p<u;p++)h[p].name===i&&s++;for(var p=0,u=d.length;p<u;p++)i.includes(d[p].name)&&l++;0===s&&0===l&&(e=!0);var f=t.querySelector(".e-content");if(e){var g=f.querySelector(".e-webpage");g.getElementsByClassName("e-cont")[0].getElementsByClassName("e-text")[0].setAttribute("value",a),"string"==typeof o?g.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",o):g.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",o.address)}else{var m=void 0,v=f.querySelector(".e-document");v.getElementsByClassName("e-cont")[0].getElementsByClassName("e-text")[0].setAttribute("value",a);var y=void 0;if(this.parent.definedNames)for(p=0;p<this.parent.definedNames.length;p++)if(this.parent.definedNames[p].name===i){m=!0;break}if(m){var C=v.getElementsByClassName("e-cont")[1].getElementsByClassName("e-text")[0];C.setAttribute("readonly","true"),C.classList.add("e-disabled"),C.setAttribute("disabled","true");for(var b=(S=v.getElementsByClassName("e-cont")[2]).querySelectorAll(".e-list-item.e-level-1")[1],p=0;p<b.getElementsByTagName("li").length;p++)b.getElementsByTagName("li")[p].innerText===i&&b.getElementsByTagName("li")[p].classList.add("e-active")}else{i&&-1!==i.indexOf("!")&&(y=i.split("!"));var x=y[0];v.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",y[1]);for(var S=v.getElementsByClassName("e-cont")[2],b=S.querySelectorAll(".e-list-item.e-level-1")[0],p=0;p<b.getElementsByTagName("li").length;p++)if(b.getElementsByTagName("li")[p].innerText===x){if(b.getElementsByTagName("li")[p].classList.contains("e-active"))break;b.getElementsByTagName("li")[p].classList.add("e-active")}else b.getElementsByTagName("li")[p].classList.contains("e-active")&&b.getElementsByTagName("li")[p].classList.remove("e-active")}}return t},e.prototype.hyperlinkContent=function(){var e,r,i=this.parent.serviceLocator.getService(Hi),a=0,o=0,s=!0,l=!0,h=c(this.parent.getActiveSheet().activeCell),d=this.parent.getActiveSheet(),p=J(h[0],h[1],d),u=!0;if(p){u=!!(p.value&&"string"==typeof p.value&&null!==p.value.match("[A-Za-z]+")||""===p.value||t.isNullOrUndefined(p.value));var f=p.hyperlink;if("string"==typeof f)-1===(g=f).indexOf("http://")&&-1===g.indexOf("https://")&&-1===g.indexOf("ftp://")&&(r=f,s=!1);else if("object"==typeof f){var g=f.address;-1===g.indexOf("http://")&&-1===g.indexOf("https://")&&-1===g.indexOf("ftp://")&&(r=f.address,s=!1)}if(r){for(var m=0,v=0,y=this.parent.definedNames,C=this.parent.sheets,b=0,x=C.length;b<x;b++)r.includes(C[b].name)&&v++;for(var S=0,x=y.length;S<x;S++)y[S].name===r&&m++;0===m&&0===v&&(s=!0)}if(o=s?0:1,this.parent.definedNames)for(var w=0;w<this.parent.definedNames.length;w++)if(this.parent.definedNames[w].name===r){e=!0,l=!1;break}}var I=this.parent.createElement("div",{className:"e-link-dialog"}),E=this.parent.createElement("div",{className:"e-webpage"}),R=this.parent.createElement("div",{className:"e-document"});new n.Tab({selectedItem:o,items:[{header:{text:i.getConstant("WebPage")},content:E},{header:{text:i.getConstant("ThisDocument")},content:R}]}).appendTo(I),s?I.querySelector(".e-toolbar-items").querySelector(".e-indicator").setAttribute("style","left: 0; right: 136px"):I.querySelector(".e-toolbar-items").querySelector(".e-indicator").setAttribute("style","left: 136px; right: 0");var k=this.parent.createElement("div",{className:"e-cont"}),A=this.parent.createElement("div",{className:"e-cont"}),T=this.parent.createElement("div",{className:"e-header",innerHTML:i.getConstant("DisplayText")}),F=this.parent.createElement("div",{className:"e-header",innerHTML:i.getConstant("Url")}),L=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}});u||(L.classList.add("e-disabled"),L.setAttribute("readonly","true"),L.setAttribute("disabled","true")),p&&t.isNullOrUndefined(p.hyperlink)&&L.setAttribute("value",this.parent.getDisplayText(p));var N=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}});L.setAttribute("placeholder",i.getConstant("EnterTheTextToDisplay")),N.setAttribute("placeholder",i.getConstant("EnterTheUrl")),k.appendChild(L),k.insertBefore(T,L),A.appendChild(N),A.insertBefore(F,N),E.appendChild(A),E.insertBefore(k,A);var D=[],O=[],H=this.parent.sheets;for(a;a<this.parent.sheets.length;a++){var B=this.parent.sheets[a].name;"Visible"===this.parent.sheets[a].state&&(H[a]===this.parent.getActiveSheet()?D.push({nodeId:"sheet",nodeText:-1!==B.indexOf(" ")?"'"+B+"'":B,selected:!0}):D.push({nodeId:"sheet",nodeText:-1!==B.indexOf(" ")?"'"+B+"'":B}))}for(a=0;a<this.parent.definedNames.length;a++)O.push({nodeId:"defName",nodeText:this.parent.definedNames[a].name});var M=[{nodeId:"01",nodeText:i.getConstant("CellReference"),expanded:l,nodeChild:D},{nodeId:"02",nodeText:i.getConstant("DefinedNames"),expanded:e,nodeChild:O}],P=new n.TreeView({fields:{dataSource:M,id:"nodeId",text:"nodeText",child:"nodeChild"}}),_=this.parent.createElement("div",{className:"e-cont"}),U=this.parent.createElement("div",{className:"e-header",innerHTML:i.getConstant("CellReference")}),V=this.parent.createElement("input",{className:"e-input e-text e-hyp-text",attrs:{type:"Text"}});V.setAttribute("value","A1"),_.appendChild(V),_.insertBefore(U,V);var z=this.parent.createElement("div",{className:"e-cont"}),q=this.parent.createElement("div",{className:"e-header",innerHTML:i.getConstant("DisplayText")}),j=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}});u||(j.classList.add("e-disabled"),j.setAttribute("readonly","true"),j.setAttribute("disabled","true")),p&&t.isNullOrUndefined(p.hyperlink)&&j.setAttribute("value",this.parent.getDisplayText(p)),j.setAttribute("placeholder",i.getConstant("EnterTheTextToDisplay")),z.appendChild(j),z.insertBefore(q,j);var W=this.parent.createElement("div",{className:"e-cont"}),G=this.parent.createElement("div",{className:"e-header",innerHTML:i.getConstant("Sheet")}),Y=this.parent.createElement("div",{className:"e-refcont"});return W.appendChild(Y),W.insertBefore(G,Y),R.appendChild(_),R.insertBefore(z,_),P.appendTo(Y),R.appendChild(W),I},e.prototype.removeHyperlink=function(e){var t=J(e.rowIdx,e.colIdx,e.sheet);t&&t.hyperlink&&("string"==typeof t.hyperlink?t.value=t.value?t.value:t.hyperlink:t.value=t.value?t.value:t.hyperlink.address,delete t.hyperlink,t.style&&(delete t.style.textDecoration,delete t.style.color),e.sheet===this.parent.getActiveSheet()&&(t.style&&this.parent.notify("refreshRibbonIcons",null),e.preventRefresh||this.parent.serviceLocator.getService("cell").refreshRange([e.rowIdx,e.colIdx,e.rowIdx,e.colIdx])))},e}(),ei=function(){function e(e){this.undoCollection=[],this.redoCollection=[],this.isUndo=!1,this.undoRedoStep=100,this.parent=e,this.addEventListener()}return e.prototype.setActionData=function(e){var t,r=this.parent.getActiveSheet(),n=[],i=[],a=e.args,o=a.eventArgs,s={};switch(a.action){case"format":t=c(a.eventArgs.range);break;case"clipboard":s=o.copiedInfo,t=c(C(o.pastedRange)),s&&s.isCut&&(i=this.getCellDetails(s.range,fe(this.parent,le(this.parent,s.sId))));break;case"beforeSort":(t=c(a.eventArgs.range))[0]===t[2]&&t[2]-t[0]==0&&(t[0]=0,t[1]=0,t[2]=r.usedRange.rowIndex,t[3]=r.usedRange.colIndex);break;case"beforeCellSave":case"cellDelete":t=c(o.address);break;case"beforeWrap":case"beforeReplace":t=this.parent.getAddressInfo(o.address).indices;break;case"beforeClear":case"beforeInsertImage":case"beforeInsertChart":case"filter":t=c(o.range)}n=this.getCellDetails(t,r),this.beforeActionData={cellDetails:n,cutCellDetails:i}},e.prototype.getBeforeActionData=function(e){e.beforeDetails=this.beforeActionData},e.prototype.performUndoRedo=function(e){var r=e.isUndo?this.undoCollection.pop():this.redoCollection.pop();if(this.isUndo=e.isUndo,r){switch(r.action){case"cellSave":case"format":case"sorting":case"wrap":case"cellDelete":r=this.performOperation(r);break;case"clipboard":r=this.undoForClipboard(r);break;case"resize":r=this.undoForResize(r);break;case"hideShow":r.eventArgs.hide=!r.eventArgs.hide,pt(r,this.parent);break;case"replace":r=this.performOperation(r);break;case"insert":case"filter":case"delete":case"validation":pt(r,this.parent,!e.isUndo);break;case"merge":r.eventArgs.merge=!r.eventArgs.merge,pt(r,this.parent);break;case"clear":r=this.performOperation(r);break;case"conditionalFormat":pt(r,this.parent,!e.isUndo,this.undoCollection);break;case"clearCF":case"insertImage":case"imageRefresh":pt(r,this.parent,!e.isUndo);break;case"insertChart":case"deleteChart":case"chartRefresh":pt(r,this.parent,!e.isUndo)}e.isUndo?this.redoCollection.push(r):this.undoCollection.push(r),this.undoCollection.length>this.undoRedoStep&&this.undoCollection.splice(0,1),this.redoCollection.length>this.undoRedoStep&&this.redoCollection.splice(0,1),this.updateUndoRedoIcons();var n=Object.assign({},r.eventArgs);n.requestType=e.isUndo?"undo":"redo",delete n.beforeActionData,e.isPublic||(this.parent.notify("triggerDataChange",t.extend({isUndo:e.isUndo},r,null,!0)),this.parent.notify(pr,{eventArgs:n,action:"undoRedo"})),this.parent.notify("refreshRibbonIcons",null)}},e.prototype.updateUndoRedoCollection=function(e){var t=["clipboard","format","sorting","cellSave","resize","resizeToFit","wrap","hideShow","replace","validation","merge","clear","conditionalFormat","clearCF","insertImage","imageRefresh","insertChart","deleteChart","chartRefresh","filter","cellDelete"];"insert"!==e.args.action&&"delete"!==e.args.action||"Sheet"===e.args.eventArgs.modelType||t.push(e.args.action);var r=e.args.action;if(-1!==t.indexOf(r)||e.isPublic){var n=e.args.eventArgs;if("clipboard"===r||"sorting"===r||"format"===r||"cellSave"===r||"wrap"===r||"replace"===r||"validation"===r||"clear"===r||"conditionalFormat"===r||"clearCF"===r||"insertImage"===r||"imageRefresh"===r||"insertChart"===r||"chartRefresh"===r||"filter"===r||"cellDelete"===r){var i={beforeDetails:{cellDetails:[]}};this.parent.notify("getBeforeActionData",i),n.beforeActionData=i.beforeDetails}if("clipboard"===r&&n.copiedInfo.isExternal){var a=this.parent.getAddressInfo(n.pastedRange);n.copiedInfo.cellDetails=this.getCellDetails(a.indices,fe(this.parent,a.sheetIndex))}this.undoCollection.push(e.args),this.redoCollection=[],this.undoCollection.length>this.undoRedoStep&&this.undoCollection.splice(0,1),this.updateUndoRedoIcons()}},e.prototype.clearUndoRedoCollection=function(){this.undoCollection=[],this.redoCollection=[],this.updateUndoRedoIcons()},e.prototype.updateUndoRedoIcons=function(){var e=this.parent.serviceLocator.getService(Hi);this.parent.notify("enableToolbarItems",[{tab:e.getConstant("Home"),items:[this.parent.element.id+"_undo"],enable:this.undoCollection.length>0}]),this.parent.notify("enableToolbarItems",[{tab:e.getConstant("Home"),items:[this.parent.element.id+"_redo"],enable:this.redoCollection.length>0}])},e.prototype.undoForClipboard=function(e){var t,r=this,n=e.eventArgs,i=n.pastedRange.split("!"),a=c(i[1]),o=se(this.parent,i[0]),s=fe(this.parent,o),l=n.copiedInfo,h=n.beforeActionData,d=this.checkRefreshNeeded(o);if("imagePaste"===e.eventArgs.requestType){var p=n.copiedShapeInfo;this.isUndo?(t=p.pictureElem,p.isCut?(this.parent.notify(Cr,{id:t.id,sheetIdx:n.pasteSheetIndex+1}),this.parent.notify(yr,{options:{src:t.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:p.height,width:p.width,imageId:t.id},range:p.copiedRange,isPublic:!1,isUndoRedo:!0})):this.parent.notify(Cr,{id:n.pastedPictureElement.id,sheetIdx:n.pasteSheetIndex+1})):p.isCut?(t=p.pictureElem,this.parent.notify(Cr,{id:t.id,sheetIdx:p.sId}),this.parent.notify(yr,{options:{src:t.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:p.height,width:p.width,imageId:t.id},range:p.pastedRange,isPublic:!1,isUndoRedo:!0})):(t=n.pastedPictureElement,this.parent.notify(yr,{options:{src:t.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:t.offsetHeight,width:t.offsetWidth,imageId:t.id},range:p.pastedRange,isPublic:!1,isUndoRedo:!0}))}else{if(this.isUndo){if(l.isCut){var u=h.cutCellDetails;this.updateCellDetails(u,fe(this.parent,le(this.parent,l.sId)),S(l.range),d),this.parent.notify("getFilteredCollection",null);for(var f=0;f<this.parent.sheets.length;f++){var g=le(this.parent,l.sId);if(this.parent.filterCollection&&this.parent.filterCollection[f]&&this.parent.filterCollection[f].sheetIndex===n.pasteSheetIndex){var v=this.parent.filterCollection[f],y=c(v.filterRange),C=S(a);if(y[0]>=C[0]&&y[2]<=C[2]){this.parent.notify(dr,{predicates:null,range:v.filterRange,sIdx:n.pasteSheetIndex,isCut:!0});var b=[Math.abs(C[0]-y[0]),Math.abs(C[1]-y[1]),Math.abs(C[2]-y[2]),Math.abs(C[3]-y[3])],x=S(l.range);b=[x[0]+b[0],x[1]+b[1],Math.abs(x[2]-b[2]),Math.abs(x[3]-b[3])],this.parent.notify(dr,{predicates:null,range:m(b),sIdx:g,isCut:!0})}}}}h&&this.updateCellDetails(h.cellDetails,s,a,d),St(s,a[0],a[1],20);var w=wt(s,a[0]);ut(this.parent,s,w,a[0]),n.mergeCollection.forEach(function(e){e.merge=!e.merge,r.parent.notify(Vt,e),e.merge=!e.merge})}else if(l.isExternal){var I=this.parent.getAddressInfo(n.pastedRange);this.updateCellDetails(l.cellDetails,fe(this.parent,I.sheetIndex),I.indices,!0)}else pt(e,this.parent,l.isCut);d&&this.parent.notify("selectRange",{address:i[1]})}return e},e.prototype.undoForResize=function(e){var t=e.eventArgs;if(void 0===t.hide)if(t.isCol){r=t.oldWidth;t.oldWidth=t.width,t.width=r}else{var r=t.oldHeight;t.oldHeight=t.height,t.height=r}else t.hide=!t.hide;pt(e,this.parent);var n=this.parent.getActiveSheet(),i=c(n.activeCell),a=J(i[0],i[1],n);if(a&&a.rowSpan){o=this.parent.getCell(i[0],i[1]);this.parent.element.querySelector(".e-active-cell").style.height=o.offsetHeight+"px"}else if(a&&a.colSpan){var o=this.parent.getCell(i[0],i[1]);this.parent.element.querySelector(".e-active-cell").style.width=o.offsetWidth+"px"}return e},e.prototype.performOperation=function(e){var t=e.eventArgs,r="cellSave"===e.action||"wrap"===e.action||"replace"===e.action||"cellDelete"===e.action?t.address.split("!"):t.range.split("!"),n=c(r[1]),i=n,a=se(this.parent,r[0]),o=fe(this.parent,a),s=t.beforeActionData,l=this.checkRefreshNeeded(a);if(this.isUndo)this.updateCellDetails(s.cellDetails,o,n,l,e);else{var h=e.eventArgs,d=c(o.activeCell),p=this.parent.getCellStyleValue(["textDecoration"],d).textDecoration;if(h&&h.style&&h.style.textDecoration){var u=h.style.textDecoration,f=u,g=void 0,m=!1;"underline"===p?f="underline"===u?"none":"underline line-through":"line-through"===p?f="line-through"===u?"none":"underline line-through":"underline line-through"===p&&(f="underline"===u?"line-through":"underline",m=!0),"none"===f&&(m=!0),h.style.textDecoration=f,e.eventArgs=h,this.parent.notify(Tt,{style:{textDecoration:f},range:d,refreshRibbon:!0,onActionUpdate:!0});for(var v=i[0];v<=i[2];v++)for(var y=i[1];y<=i[3];y++)if(v!==d[0]||y!==d[1]){if(g={},"none"===(p=this.parent.getCellStyleValue(["textDecoration"],[v,y]).textDecoration)){if(m)continue;g.textDecoration=u}else if("underline"===p||"line-through"===p)if(m){if(u!==p)continue;g.textDecoration="none"}else g.textDecoration=u!==p?"underline line-through":u;else if("underline line-through"===p){if(!m)continue;g.textDecoration="underline"===u?"line-through":"underline"}this.parent.notify(Tt,{style:{textDecoration:g.textDecoration},range:[v,y,v,y],refreshRibbon:!0,onActionUpdate:!0})}h.style.textDecoration=u,e.eventArgs=h}else pt(e,this.parent,!0)}return l&&this.parent.notify("selectRange",{address:r[1]}),e},e.prototype.getCellDetails=function(e,t){for(var r,n=[],i=(e=S(e))[0];i<=e[2];i++)for(var a=e[1];a<=e[3];a++)r=J(i,a,t),n.push({rowIndex:i,colIndex:a,format:r?r.format:null,isLocked:r?r.isLocked:null,style:r&&r.style?Object.assign({},r.style):null,value:r?r.value:"",formula:r?r.formula:"",wrap:r&&r.wrap,rowSpan:r&&r.rowSpan,colSpan:r&&r.colSpan,hyperlink:r&&r.hyperlink,image:r&&r.image&&r.chart});return n},e.prototype.updateCellDetails=function(e,r,n,i,a){for(var o,s=e.length,l=0;l<s;l++)Q(e[l].rowIndex,e[l].colIndex,r,{value:e[l].value,format:e[l].format,isLocked:e[l].isLocked,style:e[l].style&&Object.assign({},e[l].style),formula:e[l].formula,wrap:e[l].wrap,rowSpan:e[l].rowSpan,colSpan:e[l].colSpan,hyperlink:e[l].hyperlink}),this.parent.notify("workbookEditOperation",{action:"updateCellValue",address:[e[l].rowIndex,e[l].colIndex,e[l].rowIndex,e[l].colIndex],value:e[l].formula?e[l].formula:e[l].value}),a&&"wrap"===a.action&&a.eventArgs.wrap&&this.parent.notify(Ot,{range:[e[l].rowIndex,e[l].colIndex,e[l].rowIndex,e[l].colIndex],wrap:!1,sheet:r}),a&&e[l].hyperlink&&"clear"===a.action&&(a.eventArgs.range=r.name+"!"+m([e[l].rowIndex,e[l].colIndex,e[l].rowIndex,e[l].colIndex]),o=this.parent.getCell(e[l].rowIndex,e[l].colIndex),"Clear All"===a.eventArgs.type||"Clear Hyperlinks"===a.eventArgs.type?this.parent.addHyperlink(e[l].hyperlink,a.eventArgs.range):"Clear Formats"===a.eventArgs.type&&t.addClass(o.querySelectorAll(".e-hyperlink"),"e-hyperlink-style"));i&&this.parent.serviceLocator.getService("cell").refreshRange(n)},e.prototype.checkRefreshNeeded=function(e){var t=!0;return e!==this.parent.activeSheetIndex&&(this.parent.activeSheetIndex=e,this.parent.dataBind(),t=!1),t},e.prototype.addEventListener=function(){this.parent.on("performUndoRedo",this.performUndoRedo,this),this.parent.on("updateUndoRedoCollection",this.updateUndoRedoCollection,this),this.parent.on("setActionData",this.setActionData,this),this.parent.on("getBeforeActionData",this.getBeforeActionData,this),this.parent.on("clearUndoRedoCollection",this.clearUndoRedoCollection,this),this.parent.on("setUndoRedo",this.updateUndoRedoIcons,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("performUndoRedo",this.performUndoRedo),this.parent.off("updateUndoRedoCollection",this.updateUndoRedoCollection),this.parent.off("setActionData",this.setActionData),this.parent.off("getBeforeActionData",this.getBeforeActionData),this.parent.off("clearUndoRedoCollection",this.clearUndoRedoCollection),this.parent.off("setUndoRedo",this.updateUndoRedoIcons))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"undoredo"},e}(),ti=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("ribboClick",this.ribbonClickHandler,this),this.parent.on(Ot,this.wrapTextHandler,this),this.parent.on(sr,this.rowHeightChangedHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("ribboClick",this.ribbonClickHandler),this.parent.off(Ot,this.wrapTextHandler),this.parent.off(sr,this.rowHeightChangedHandler))},e.prototype.wrapTextHandler=function(e){if(ze(this.parent,e.range,!0))for(var r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=e.range[0];l<=e.range[2];l++){o=0,a=we(e.sheet,l).customHeight||e.isCustomHgt;for(var h=e.range[1];h<=e.range[3];h++)if(!((n=J(l,h,e.sheet,null,!0)).rowSpan<0||n.colSpan<0)){var d=n.rowSpan>1||n.colSpan>1;if((r=e.initial?e.td:this.parent.getCell(l,h))&&(e.wrap?r.classList.add(Oi):r.classList.remove(Oi),(a||d)&&(0!==r.children.length&&r.querySelector(".e-wrap-content")||(r.innerHTML=this.parent.createElement("span",{className:"e-wrap-content",innerHTML:r.innerHTML,styles:r.style.cssText}).outerHTML))),t.Browser.isIE&&r.classList.add("e-ie-wrap"),!a&&!d){i=bt(e.sheet,l,h,n.colSpan>1?h+n.colSpan-1:h);var p=this.parent.getDisplayText(n);if(p.indexOf("\n")<0){var c=this.parent.element.querySelector(".e-spreadsheet-edit");c&&c.textContent.indexOf("\n")>-1&&(p=c.textContent)}if(p)if(e.wrap){r&&r.classList.contains("e-alt-unwrap")&&r.classList.remove("e-alt-unwrap");var u=void 0,f=0,g=void 0;if(p.indexOf("\n")>-1){var m=p.split("\n"),v=m.length;for(g=0;g<v;g++)0===(u=vt(m[g],i,n.style,this.parent.cellStyle))&&(u=1),f+=u;u=f}else u=vt(p,i,n.style,this.parent.cellStyle);if(s=xt(this.parent,l,h,e.sheet,n.style||this.parent.cellStyle,u),o=Math.max(o,s),n.rowSpan>1){var y=Ae(e.sheet,l,l+(n.rowSpan-1));if(y>=o)return;s=o=Re(e.sheet,l)+(o-y)}St(e.sheet,l,h,s)}else p.indexOf("\n")>-1&&r.classList.add("e-alt-unwrap"),s=xt(this.parent,l,h,e.sheet,n.style||this.parent.cellStyle,1),St(e.sheet,l,h,s),o=Math.max(wt(e.sheet,l),20);else e.wrap&&p||(St(e.sheet,l,h,20),o=Math.max(wt(e.sheet,l),20));h===e.range[3]&&(e.wrap&&o>20&&wt(e.sheet,l)<=o||(!e.wrap||!p)&&wt(e.sheet,l)<Re(e.sheet,l)&&Re(e.sheet,l)>20)&&ut(this.parent,e.sheet,o,l,e.row,e.hRow)}}}},e.prototype.ribbonClickHandler=function(e){var r=t.closest(e.originalEvent.target,".e-btn");if(r&&r.id===this.parent.element.id+"_wrap"){var n=r.classList.contains("e-active"),i=b(this.parent.getActiveSheet()),a={address:i,wrap:n,cancel:!1};this.parent.notify(cr,{action:"beforeWrap",eventArgs:a}),a.cancel||(te(this.parent.getActiveSheet().selectedRange,n,this.parent),this.parent.notify(pr,{action:"wrap",eventArgs:{address:i,wrap:n}}))}},e.prototype.rowHeightChangedHandler=function(e){if(e.isCustomHgt)for(var t=this.parent.getActiveSheet(),r=this.parent.viewport.leftIndex,n=r+this.parent.viewport.colCount+2*this.parent.getThreshold("col"),i=r;i<n;i++){var a=J(e.rowIdx,i,t);if(a&&a.wrap){var o=this.parent.getCell(e.rowIdx,i);0!==o.children.length&&o.querySelector(".e-wrap-content")||(o.innerHTML=this.parent.createElement("span",{className:"e-wrap-content",innerHTML:o.innerHTML}).outerHTML)}}},e.prototype.getModuleName=function(){return"wrapText"},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e}(),ri=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.insert=function(e){var t;switch(e.isAction&&(t=!0,delete e.isAction),t&&this.parent.notify(cr,{eventArgs:e,action:"insert"}),this.parent.notify("beforeInsert",e),e.modelType){case"Sheet":this.parent.notify("insertSheetTab",{startIdx:e.index,endIdx:e.index+(e.model.length-1),preventUpdate:!t}),this.parent.renderModule.refreshSheet(),Et(this.parent.element);break;case"Row":if(!this.parent.scrollSettings.enableVirtualization||e.index<=this.parent.viewport.bottomIndex){if(this.parent.scrollSettings.enableVirtualization){if(e.freezePane){this.parent.renderModule.refreshSheet();break}e.index<this.parent.viewport.topIndex&&(this.parent.viewport.topIndex+=e.model.length),this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.topIndex===It(this.parent.getActiveSheet(),0,!0),rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Row"})}else this.parent.renderModule.refreshUI({skipUpdateOnFirst:!0,rowIndex:e.index,colIndex:0,refresh:"Row"});this.parent.selectRange(this.parent.getActiveSheet().selectedRange)}break;case"Column":if(!this.parent.scrollSettings.enableVirtualization||e.index<=this.parent.viewport.rightIndex){if(e.freezePane){this.parent.renderModule.refreshSheet();break}this.parent.scrollSettings.enableVirtualization?(e.index<this.parent.viewport.leftIndex&&(this.parent.viewport.leftIndex+=e.model.length),this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex===It(this.parent.getActiveSheet(),0,!0,"columns"),rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Column"})):this.parent.renderModule.refreshUI({skipUpdateOnFirst:!0,rowIndex:0,colIndex:e.index,refresh:"Column"}),this.parent.selectRange(this.parent.getActiveSheet().selectedRange)}}this.refreshImgElement(e.model.length,this.parent.activeSheetIndex,e.modelType,e.index),t&&this.parent.notify(pr,{eventArgs:e,action:"insert"})},e.prototype.refreshImgElement=function(e,t,r,n){for(var i,a=this.parent.sheets[t],o=[0,0,a.usedRange.rowIndex,a.usedRange.colIndex],s=0;s<=o[2];s++)for(var l=o[1];l<=o[3];l++)(i=J(s,l,a))&&i.image&&i.image.length>0&&("Row"===r&&s>=n||"Column"===r&&l>=n)&&this.parent.notify("refreshImagePosition",{rowIdx:s,colIdx:l,sheetIdx:t,type:r,count:e,status:"insert"})},e.prototype.addEventListener=function(){this.parent.on("insert",this.insert,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("insert",this.insert)},e.prototype.getModuleName=function(){return"insert"},e}(),ni=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.delete=function(e){var t;if(e.isAction&&(t=!0,delete e.isAction),t&&this.parent.notify(cr,{eventArgs:e,action:"delete"}),"Sheet"===e.modelType){var r=e.activeSheetIndex>=e.startIndex&&e.activeSheetIndex<=e.endIndex;r&&this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(e.startIndex<this.parent.sheets.length?e.startIndex:e.startIndex?e.startIndex-1:0)},!0),this.parent.notify("refreshSheetTabs",null),r&&this.parent.renderModule.refreshSheet(),Et(this.parent.element)}else"Row"===e.modelType?(!this.parent.scrollSettings.enableVirtualization||e.startIndex<=this.parent.viewport.bottomIndex)&&(e.freezePane?this.parent.renderModule.refreshSheet():this.parent.scrollSettings.enableVirtualization?(e.startIndex<this.parent.viewport.topIndex&&(this.parent.viewport.topIndex-=e.model.length),this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.topIndex===It(this.parent.getActiveSheet(),0,!0),rowIndex:this.parent.viewport.topIndex,refresh:"Row",colIndex:this.parent.viewport.leftIndex}),this.parent.selectRange(this.parent.getActiveSheet().selectedRange)):(this.parent.renderModule.refreshUI({skipUpdateOnFirst:!0,refresh:"Row",rowIndex:e.startIndex,colIndex:0}),this.parent.selectRange(this.parent.getActiveSheet().selectedRange))):(!this.parent.scrollSettings.enableVirtualization||e.startIndex<=this.parent.viewport.rightIndex)&&(e.freezePane?this.parent.renderModule.refreshSheet():this.parent.scrollSettings.enableVirtualization?(e.startIndex<this.parent.viewport.leftIndex&&(this.parent.viewport.leftIndex-=e.model.length),this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex===It(this.parent.getActiveSheet(),0,!0,"columns"),rowIndex:this.parent.viewport.topIndex,refresh:"Column",colIndex:this.parent.viewport.leftIndex}),this.parent.selectRange(this.parent.getActiveSheet().selectedRange)):(this.parent.renderModule.refreshUI({skipUpdateOnFirst:!0,refresh:"Column",rowIndex:0,colIndex:e.startIndex}),this.parent.selectRange(this.parent.getActiveSheet().selectedRange)));this.refreshImgElement(e.deletedModel.length,this.parent.activeSheetIndex,e.modelType,e.startIndex),t&&this.parent.notify(pr,{eventArgs:e,action:"delete"})},e.prototype.refreshImgElement=function(e,t,r,n){for(var i,a=this.parent.sheets[t],o=[0,0,a.usedRange.rowIndex,a.usedRange.colIndex],s=0;s<=o[2];s++)for(var l=o[1];l<=o[3];l++)(i=J(s,l,a))&&i.image&&i.image.length>0&&("Row"===r&&s>=n||"Column"===r&&l>=n)&&this.parent.notify("refreshImagePosition",{rowIdx:s,colIdx:l,sheetIdx:t,type:r,count:e,status:"delete"})},e.prototype.addEventListener=function(){this.parent.on("delete",this.delete,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("delete",this.delete)},e.prototype.getModuleName=function(){return"delete"},e}(),ii=function(){function e(e){this.data=[],this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener();var e=t.select("#"+this.parent.element.id+"_datavalidation-popup");e&&e.remove(),this.parent=null},e.prototype.addEventListener=function(){t.EventHandler.add(this.parent.element,"dblclick",this.listOpen,this),t.EventHandler.add(document,"mousedown",this.mouseDownHandler,this),this.parent.on("initiatedatavalidation",this.initiateDataValidationHandler,this),this.parent.on("invalidData",this.invalidDataHandler,this),this.parent.on("isValidation",this.checkDataValidation,this),this.parent.on("activeCellChanged",this.listHandler,this),this.parent.on(tr,this.keyUpHandler,this),this.parent.on("removeDataValidation",this.removeValidationHandler,this),this.parent.on("validationHighlight",this.InvalidElementHandler,this)},e.prototype.removeEventListener=function(){t.EventHandler.remove(this.parent.element,"dblclick",this.listOpen),t.EventHandler.remove(document,"mousedown",this.mouseDownHandler),this.parent.isDestroyed||(this.parent.off("initiatedatavalidation",this.initiateDataValidationHandler),this.parent.off("invalidData",this.invalidDataHandler),this.parent.off("isValidation",this.checkDataValidation),this.parent.off("activeCellChanged",this.listHandler),this.parent.off(tr,this.keyUpHandler),this.parent.off("removeDataValidation",this.removeValidationHandler),this.parent.off("validationHighlight",this.InvalidElementHandler))},e.prototype.removeValidationHandler=function(e){var t=this.getRange(this.parent.getActiveSheet().selectedRange);this.parent.removeDataValidation(t)},e.prototype.mouseDownHandler=function(e){var r=e.target,n=t.closest(r,".e-ddl");n&&n.getAttribute("id")===this.parent.element.id+"listValid_popup"&&this.parent.notify("formulaBarOperation",{action:"refreshFormulabar",value:r.innerText})},e.prototype.keyUpHandler=function(e){var r=e.target,n=this.parent.element.querySelector(".e-datavalidation-dlg");if(t.closest(r,".e-values")&&n&&13!==e.keyCode){var i=n.querySelector(".e-values"),a=i.querySelector(".e-dlg-error"),o=n.querySelector(".e-footer-content").querySelector(".e-primary");o.hasAttribute("disabled")&&o.removeAttribute("disabled"),a&&i.removeChild(a)}},e.prototype.listOpen=function(e){var t=e.target;this.listObj&&t.classList.contains("e-cell")&&t.querySelector(".e-validation-list")&&this.listObj.showPopup()},e.prototype.invalidDataHandler=function(e){e.isRemoveHighlight?this.parent.removeInvalidHighlight():this.parent.addInvalidHighlight()},e.prototype.listHandler=function(){var e=this;if(this.parent.allowDataValidation){var r=this.parent.getActiveSheet(),n=u(r.activeCell),i=J(n[0],n[1],r),a=Te(r,n[1]),s=this.parent.getCell(n[0],n[1]),l=void 0;if(!s)return;if(document.getElementsByClassName("e-validation-list")[0]&&(t.remove(document.getElementsByClassName("e-validation-list")[0]),this.data=[]),i&&i.validation?l=i.validation:a&&a.validation&&(l=a.validation),l&&"List"===l.type&&(l.ignoreBlank=!!t.isNullOrUndefined(l.ignoreBlank)||l.ignoreBlank,l.inCellDropDown=!!t.isNullOrUndefined(l.inCellDropDown)||l.inCellDropDown,l.inCellDropDown)){var h=this.parent.createElement("div",{className:"e-validation-list"}),d=this.parent.createElement("input",{id:this.parent.element.id+"listValid"});h.appendChild(d),l.inCellDropDown||(h.style.display="none"),s.insertBefore(h,s.firstChild);var p=this.updateDataSource(i,l);this.listObj=new o.DropDownList({index:this.setDropDownListIndex(p,i,l),dataSource:p,fields:{text:"text",value:"id"},width:"0px",popupHeight:"200px",change:function(){e.listValueChange(e.listObj.text)},open:function(n){if(n.popup.offsetX=4-(s.offsetWidth-20),n.popup.offsetY=-13,n.popup.element.style.width=s.offsetWidth-1+"px",t.Browser.isDevice&&e.parent.scrollModule){var i=e.parent.scrollModule.offset,a=e.parent.viewport;n.popup.offsetY+=a.topIndex?i.top.size-Ae(r,a.topIndex+1,i.top.idx,!0):0,n.popup.offsetX+=a.leftIndex?i.left.size-Ne(r,a.leftIndex+1,i.left.idx,!0):0,n.popup.refresh()}}}),this.listObj.appendTo("#"+this.parent.element.id+"listValid")}i&&i.validation&&(i.validation=l)}},e.prototype.setDropDownListIndex=function(e,t,r){if(t&&t.value)for(var n=0,i=e.length;n<i;n++)if(e[n].text===t.value.toString())return n;return null},e.prototype.updateDataSource=function(e,t){this.data=[];var r=0,n=t.value1;if(-1!==n.indexOf("=")){var i=n.indexOf("!")>-1?fe(this.parent,se(this.parent,n.split("=")[1].split("!")[0])):this.parent.getActiveSheet(),a=n.indexOf("!")>-1?n.split("!")[1]:n.split("=")[1],o=void 0,s=a.split(":");if(s[0].match(/[a-z]+$/gi)&&s[1].match(/[a-z]+$/gi)||s[0].match(/^[0-9]/g)&&s[1].match(/^[0-9]/g)){var l=this.parent.getIndexes(a);o=l.isCol?[0,l.startIdx,i.usedRange.rowIndex,l.startIdx]:[l.startIdx,0,l.startIdx,i.usedRange.colIndex]}else o=c(a);for(var h=o[0];h<=o[2];h++){i.rows[h]||Ie(i,h,{});for(var d=o[1];d<=o[3];d++){i.rows[h].cells||Q(h,d,i,{}),r+=1,e=i.rows[h].cells[d];var p=this.parent.getDisplayText(e)||"";t.ignoreBlank&&""===p||this.data.push({text:p,id:"list-"+r})}}}else for(var u=n.split(","),f=0;f<u.length;f++)r+=1,this.data.push({text:u[f],id:"list-"+r});return this.data},e.prototype.listValueChange=function(e){var t=this.parent.getActiveSheet(),r=y(t.activeCell),n=Object.assign({},J(r[0],r[1],t));t.isProtected&&X(n,Te(t,r[1]))?this.parent.notify("editAlert",null):(this.parent.notify("workbookEditOperation",{action:"updateCellValue",address:t.activeCell,value:e}),this.parent.serviceLocator.getService("cell").refreshRange(r),this.parent.trigger("cellSave",{value:e,oldValue:n&&n.value,address:t.name+"!"+t.activeCell,displayText:this.parent.getDisplayText(J(r[0],r[1],t))}))},e.prototype.getRange=function(e){var t=this.parent.getActiveSheet(),r=c(e),n=t.rowCount,i=t.colCount;return r[2]===n-1&&0===r[0]?e=e.replace(/[0-9]/g,""):r[3]===i-1&&0===r[2]&&(e=e.replace(/\D/g,"")),e},e.prototype.initiateDataValidationHandler=function(){var e,r,n,i,a,o=this,s=this.parent.serviceLocator.getService(Hi),l=!0,h=!0,d=!0,p=this.parent.getActiveSheet(),u=p.selectedRange,f=c(u);u=this.getRange(u);for(var g=f[0];g<=f[2];g++)if(p.rows[g])for(var m=f[1];m<=f[3];m++)p.rows[g].cells&&p.rows[g].cells[m]&&(a=p.rows[g].cells[m]).validation&&(d=!1,e=a.validation.type,r=a.validation.operator,n=a.validation.value1,i=a.validation.value2,l=t.isNullOrUndefined(a.validation.ignoreBlank)?l:a.validation.ignoreBlank,h=t.isNullOrUndefined(a.validation.inCellDropDown)?h:a.validation.inCellDropDown);if(!this.parent.element.querySelector(".e-datavalidation-dlg")){var v=this.parent.serviceLocator.getService(Bi);v.show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-datavalidation-dlg",header:s.getConstant("DataValidation"),target:document.querySelector(".e-control.e-spreadsheet"),beforeOpen:function(t){var a={dialogName:"ValidationDialog",element:t.element,target:t.target,cancel:t.cancel};o.parent.trigger("dialogBeforeOpen",a),a.cancel&&(t.cancel=!0),v.dialogInstance.content=o.dataValidationContent(d,e,r,n,i,l,h,u),v.dialogInstance.dataBind(),Et(o.parent.element)},buttons:[{buttonModel:{content:s.getConstant("CLEARALL"),cssClass:"e-btn e-clearall-btn e-flat"},click:function(){v.dialogInstance.content=o.dataValidationContent(!0,e,r,n,i,l,h,u),v.dialogInstance.dataBind(),Et(o.parent.element)}},{buttonModel:{content:s.getConstant("APPLY"),isPrimary:!0},click:function(){o.dlgClickHandler(v)}}]}),v.dialogInstance.refresh()}},e.prototype.dataValidationContent=function(e,t,r,n,s,l,h,d){var p=this,c=this.parent.serviceLocator.getService(Hi),u=e?"0":n,f=e?"0":s,g=this.parent.createElement("div",{className:"e-validation-dlg"}),m=this.parent.createElement("div",{className:"e-cellrange"}),v=this.parent.createElement("div",{className:"e-allowdata"}),y=this.parent.createElement("div",{className:"e-values"}),C=this.parent.createElement("div",{className:"e-ignoreblank"});g.appendChild(m),g.appendChild(v),g.appendChild(y),g.appendChild(C);var b=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("CellRange")}),x=this.parent.createElement("input",{className:"e-input",attrs:{value:d}});m.appendChild(b),m.appendChild(x);var S=this.parent.createElement("div",{className:"e-allow"}),w=this.parent.createElement("div",{className:"e-data"});v.appendChild(S),v.appendChild(w);var I=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Allow")});this.typeData=[{text:c.getConstant("WholeNumber"),id:"type-1"},{text:c.getConstant("Decimal"),id:"type-2"},{text:c.getConstant("Date"),id:"type-3"},{text:c.getConstant("Time"),id:"type-4"},{text:c.getConstant("TextLength"),id:"type-5"},{text:c.getConstant("List"),id:"type-6"}],this.operatorData=[{text:c.getConstant("Between"),id:"operator-1"},{text:c.getConstant("NotBetween"),id:"operator-2"},{text:c.getConstant("EqualTo"),id:"operator-3"},{text:c.getConstant("NotEqualTo"),id:"operator-4"},{text:c.getConstant("Greaterthan"),id:"operator-5"},{text:c.getConstant("Lessthan"),id:"operator-6"},{text:c.getConstant("GreaterThanOrEqualTo"),id:"operator-7"},{text:c.getConstant("LessThanOrEqualTo"),id:"operator-8"}];var E=this.parent.createElement("input",{className:"e-select"}),R=0;if(!e)for(F=0;F<this.typeData.length;F++)if(t===this.typeData[F].text.replace(" ","")){R=F;break}if(e||"List"!==t){var k=0,A=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Data")}),T=this.parent.createElement("input",{className:"e-select"});if(!e)for(var F=0;F<this.operatorData.length;F++)if(r===this.FormattedValue(this.operatorData[F].text)){k=F;break}w.appendChild(A),w.appendChild(T),this.dataList=new o.DropDownList({dataSource:this.operatorData,index:k,popupHeight:"200px",change:function(){p.userInput(N,p.dataList)}}),this.dataList.appendTo(T)}else{var L=this.parent.createElement("input",{className:"e-checkbox"});w.appendChild(L),new a.CheckBox({label:c.getConstant("InCellDropDown"),checked:h}).appendTo(L)}S.appendChild(I),S.appendChild(E);var N=new o.DropDownList({dataSource:this.typeData,index:R,popupHeight:"200px",change:function(){p.userInput(N,p.dataList)}});if(N.appendTo(E),e||"List"!==N.value&&("Between"===this.dataList.value||"Not between"===this.dataList.value)){var D=this.parent.createElement("div",{className:"e-minimum"}),O=this.parent.createElement("div",{className:"e-maximum"});y.appendChild(D),y.appendChild(O);var H=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Minimum")}),B=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Maximum")}),M=this.parent.createElement("input",{id:"minvalue",className:"e-input",attrs:{value:u}}),P=this.parent.createElement("input",{id:"maxvalue",className:"e-input",attrs:{value:f}});D.appendChild(H),D.appendChild(M),O.appendChild(B),O.appendChild(P),new i.NumericTextBox({value:0}).appendTo("#minvalue"),new i.NumericTextBox({value:0}).appendTo("#maxvalue")}else if(e&&" List"!==t){var _=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Value")}),U=this.parent.createElement("input",{className:"e-input",attrs:{value:u}});y.appendChild(_),y.appendChild(U)}else{var _=this.parent.createElement("span",{className:"e-header",innerHTML:c.getConstant("Sources")}),U=this.parent.createElement("input",{className:"e-input",attrs:{value:u}});y.appendChild(_),y.appendChild(U)}var V=l,z=this.parent.createElement("input",{className:"e-checkbox"});return C.appendChild(z),new a.CheckBox({label:c.getConstant("IgnoreBlank"),checked:V}).appendTo(z),g},e.prototype.userInput=function(e,t){for(var r=this.parent.element.querySelector(".e-datavalidation-dlg").querySelector(".e-validation-dlg"),n=r.querySelector(".e-allowdata"),o=r.querySelector(".e-values"),s=this.parent.serviceLocator.getService(Hi),l=n.querySelector(".e-data");o.lastChild;)o.removeChild(o.lastChild);if("List"===e.value){for(;l.lastChild;)l.removeChild(l.lastChild);var h=this.parent.createElement("input",{className:"e-checkbox"});l.appendChild(h),new a.CheckBox({label:s.getConstant("InCellDropDown"),checked:!0}).appendTo(h)}else if(l.getElementsByClassName("e-checkbox-wrapper")[0]){for(;l.lastChild;)l.removeChild(l.lastChild);var d=this.parent.createElement("span",{className:"e-header",innerHTML:"Data"}),p=this.parent.createElement("input",{className:"e-select"});l.appendChild(d),l.appendChild(p),t.appendTo(p)}if("List"===e.value||"Between"!==t.value&&"Not between"!==t.value){var c="List"===e.value?s.getConstant("Sources"):s.getConstant("Value"),u=this.parent.createElement("span",{className:"e-header",innerHTML:c}),f="List"===e.value?this.parent.createElement("input",{className:"e-input",attrs:{placeholder:"Enter value"}}):this.parent.createElement("input",{className:"e-input",attrs:{value:"0"}});o.appendChild(u),o.appendChild(f)}else{var g=this.parent.createElement("div",{className:"e-minimum"}),m=this.parent.createElement("div",{className:"e-maximum"});o.appendChild(g),o.appendChild(m);var v=this.parent.createElement("span",{className:"e-header",innerHTML:s.getConstant("Minimum")}),y=this.parent.createElement("span",{className:"e-header",innerHTML:s.getConstant("Maximum")}),C=this.parent.createElement("input",{id:"min",className:"e-input",attrs:{value:"0"}}),b=this.parent.createElement("input",{id:"max",className:"e-input",attrs:{value:"0"}});new i.NumericTextBox({value:0}).appendTo("min"),new i.NumericTextBox({value:0}).appendTo("max"),g.appendChild(v),g.appendChild(C),m.appendChild(y),m.appendChild(b)}},e.prototype.dlgClickHandler=function(e){var t,r,n=this.parent.serviceLocator.getService(Hi),i=!0,a=this.parent.element.querySelector(".e-datavalidation-dlg"),o=a.querySelector(".e-footer-content"),s=a.getElementsByClassName("e-dlg-content")[0].getElementsByClassName("e-validation-dlg")[0],l=s.getElementsByClassName("e-allowdata")[0],h=l.getElementsByClassName("e-allow")[0].getElementsByTagName("input")[0],d=l.getElementsByClassName("e-data")[0].getElementsByTagName("input")[0],p=s.getElementsByClassName("e-values")[0],c=p.getElementsByTagName("input")[0].value,f=p.getElementsByTagName("input")[1]?p.getElementsByTagName("input")[1].value:"",g="true"===s.querySelector(".e-ignoreblank").querySelector(".e-checkbox-wrapper").getAttribute("aria-checked"),m=l.querySelector(".e-data").querySelector(".e-checkbox-wrapper")?!!l.querySelector(".e-data").querySelector(".e-checkbox-wrapper").querySelector(".e-check"):null,v=s.querySelector(".e-cellrange").getElementsByTagName("input")[0].value,y=h.value;d&&(r=d.value,r=this.FormattedValue(r)),y&&(y=y.replace(" ",""));var C=[],b=[];if(""!==c&&b.push(c),""!==f&&b.push(f),"List"===y)if(-1!==c.indexOf("=")){if(-1!==c.indexOf(":")){var x=c.indexOf("!")>-1?c.split("!")[1]:c.split("=")[1],S=!(c.indexOf("!")>-1)||se(this.parent,c.split("=")[1].split("!")[0])>-1;C=x.split(":");var w=!!x.match(/[a-z]/gi)&&C[0].replace(/[0-9]/g,"")===C[1].replace(/[0-9]/g,""),I=!!x.match(/\d/g)&&C[0].replace(/\D/g,"")===C[1].replace(/\D/g,"");(i=!!S&&(!!w||!!I))||(t=n.getConstant("DialogError"))}}else c.length>256&&(i=!1,t=n.getConstant("ListLengthError"));if("List"!==y||i){var E=this.parent.getActiveSheet(),R=y,k=this.isDialogValidator(b,R,r);if(t=k.errorMsg,i=k.isValidate){var A=u(this.parent.getActiveSheet().activeCell);if(E&&E.rows[A[0]]&&E.rows[A[0]].cells[A[1]]&&E.rows[A[0]].cells[A[1]].validation&&"List"===E.rows[A[0]].cells[A[1]].validation.type){var T=this.parent.getMainContent().getElementsByTagName("tr")[A[0]].getElementsByClassName("e-cell")[A[1]];T&&T.getElementsByClassName("e-validation-list")[0]&&(T.removeChild(T.getElementsByClassName("e-validation-list")[0]),this.listObj.destroy())}var F={type:y,operator:r,value1:c,value2:f,ignoreBlank:g,inCellDropDown:m};this.parent.addDataValidation(F,v),"List"===y&&i&&this.listHandler(),document.getElementsByClassName("e-validationerror-dlg")[0]||(e.dialogInstance?e.dialogInstance.hide():e.hide())}}if(!i){var L=this.parent.createElement("div",{className:"e-dlg-error",id:"e-invalid",innerHTML:t});p.appendChild(L),o.querySelector(".e-primary").setAttribute("disabled","true")}},e.prototype.FormattedValue=function(e){switch(e){case"Between":e="Between";break;case"Not between":e="NotBetween";break;case"Equal to":e="EqualTo";break;case"Not equal to":e="NotEqualTo";break;case"Greater than":e="GreaterThan";break;case"Less than":e="LessThan";break;case"Greater than or equal to":e="GreaterThanOrEqualTo";break;case"Less than or equal to":e="LessThanOrEqualTo";break;default:e="Between"}return e},e.prototype.isDialogValidator=function(e,t,r){var n,i=this.parent.serviceLocator.getService(Hi),a=0;if("List"===t?!(e.length>0):"Between"===r||"NotBetween"===r?2!==e.length:!(e.length>0))n={isValidate:!1,errorMsg:i.getConstant("EmptyError")};else{for(var o=0;o<e.length&&(n=this.formatValidation(e[o],t)).isValidate;o++)a+=1;n.isValidate=a===e.length}return{isValidate:n.isValidate,errorMsg:n.errorMsg}},e.prototype.isValidationHandler=function(e){var r=this.parent.serviceLocator.getService(Hi);e.value=e.value?e.value:"";var n,i,a,o=e.value,s=this.parent.sheets[e.sheetIdx],l=J(e.range[0],e.range[1],s),h=Te(s,e.range[1]);if(l&&l.validation?a=l.validation:h&&h.validation&&(a=h.validation),a){var d=e.value,p=a.value1,c=a.value2,u=a.operator,f=a.type,g=!!t.isNullOrUndefined(a.ignoreBlank)||a.ignoreBlank,m=this.formatValidation(e.value,f);if(n=m.isValidate,i=m.errorMsg,n){if(n=!1,"Date"===f||"Time"===f){e.value=e.value.slice(e.value.indexOf(" ")+1,e.value.length);for(b=0;b<=3;b++){e.value=0===b?e.value:1===b?a.value1:a.value2;var v={value:e.value,rowIndex:e.range[0],colIndex:e.range[1],sheetIndex:e.sheetIdx,updatedVal:""};""!==e.value&&this.parent.notify(Nt,v);var y=v.updatedVal;0==b&&""==y?d=e.value:0==b?d=y:1==b?p=y:c=y}}else"TextLength"===a.type&&(d=e.value.toString().length.toString());if("List"===f)if(-1!==p.indexOf("="))for(b=0;b<this.data.length;b++)e.value.toString()===this.data[b].text&&(n=!0);else for(var C=p.split(","),b=0;b<C.length;b++)e.value.toString()===C[b]&&(n=!0);else switch("Decimal"===f||"Time"===f?(d=parseFloat(d.toString()),p=parseFloat(p.toString()),c=c?parseFloat(c.toString()):null):(d=parseInt(d.toString(),10),p=parseInt(p.toString(),10),c=c?parseInt(c.toString(),10):null),u){case"EqualTo":n=d===p||!(!g||""!==o);break;case"NotEqualTo":n=d!==p||!(!g||""!==o);break;case"Between":n=d>=p&&d<=c||!(!g||""!==o);break;case"NotBetween":n=!(d>=p&&d<=c);break;case"GreaterThan":n=d>p||!(!g||""!==o);break;case"LessThan":n=d<p||!(!g||""!==o);break;case"GreaterThanOrEqualTo":n=d>=p||!(!g||""!==o);break;case"LessThanOrEqualTo":n=d<=p||!(!g||""!==o)}}}if(i=r.getConstant("ValidationError"),n){var x=this.parent.getCellStyleValue(["backgroundColor","color"],[e.range[0],e.range[1]]);this.parent.notify(Ft,{style:x,rowIdx:e.range[0],colIdx:e.range[1],isHeightCheckNeeded:!0,manualUpdate:!0,onActionUpdate:!0})}return{isValidate:n,errorMsg:i}},e.prototype.checkDataValidation=function(e){var t=this.isValidationHandler({value:e.value,range:e.range,sheetIdx:e.sheetIdx});!t.isValidate&&e.isCell&&this.validationErrorHandler(t.errorMsg),this.parent.allowDataValidation=t.isValidate},e.prototype.formatValidation=function(e,t){var r,n=this.parent.element.getElementsByClassName("e-sheet-panel")[0],a=this.parent.createElement("form",{id:"formId",className:"form-horizontal"}),o=this.parent.createElement("input",{id:"e-validation",innerHTML:e});o.setAttribute("name","validation"),o.setAttribute("type","text"),o.setAttribute("value",e),a.appendChild(o),n.appendChild(a);var s;switch(t){case"Date":s={rules:{validation:{date:!0}},customPlacement:function(e,t){r=t.innerText}};break;case"Decimal":s={rules:{validation:{number:!0}},customPlacement:function(e,t){r=t.innerText}};break;case"WholeNumber":s={rules:{validation:{regex:/^\d*\.?[0]*$/}},customPlacement:function(e,t){r=t.innerText}}}var l=new i.FormValidator("#formId",s).validate();return n.removeChild(n.getElementsByClassName("form-horizontal")[0]),{isValidate:l,errorMsg:r}},e.prototype.InvalidElementHandler=function(e){var t=e.rowIdx,r=e.colIdx,n=e.isRemoveHighlightedData;if(n){if(n){var i=this.parent.getCellStyleValue(["backgroundColor","color"],[t,r]);this.parent.notify(Ft,{style:i,rowIdx:t,colIdx:r,cell:e.td})}}else this.parent.notify(Ft,{style:{backgroundColor:"#ffff00",color:"#ff0000"},rowIdx:t,colIdx:r,cell:e.td})},e.prototype.validationErrorHandler=function(e){var t=this,r=document.getElementsByClassName("e-spreadsheet-edit")[0],n=this.parent.serviceLocator.getService(Hi);if(!this.parent.element.querySelector(".e-validationerror-dlg")){var i=this.parent.serviceLocator.getService(Bi),a={width:400,height:200,isModal:!0,showCloseIcon:!0,cssClass:"e-validationerror-dlg",target:document.querySelector(".e-control.e-spreadsheet"),beforeOpen:function(n){var a={dialogName:"ValidationErrorDialog",element:n.element,target:n.target,cancel:n.cancel,content:e};t.parent.trigger("dialogBeforeOpen",a),a.cancel&&(t.errorDlgHandler(i,"Cancel"),n.cancel=!0),r.focus(),i.dialogInstance.content=a.content,i.dialogInstance.dataBind()},buttons:[{buttonModel:{content:n.getConstant("Retry"),isPrimary:!0},click:function(){t.errorDlgHandler(i,"Retry")}},{buttonModel:{content:n.getConstant("Cancel")},click:function(){t.errorDlgHandler(i,"Cancel")}}]};i.show(a,!1)}},e.prototype.errorDlgHandler=function(e,t){if("Retry"===t){var r=document.getElementsByClassName("e-spreadsheet-edit")[0];if(e.hide(),r.innerText){var n=document.createRange();n.setStart(r.childNodes[0],0),n.setEnd(r.childNodes[0],r.innerText.length);var i=window.getSelection();i.removeAllRanges(),i.addRange(n),this.listObj&&this.listObj.showPopup()}}else{var a=u(this.parent.getActiveSheet().activeCell),o=J(a[0],a[1],this.parent.getActiveSheet()),s=o?this.parent.getDisplayText(o):"";this.parent.notify(Qt,{action:"cancelEdit",value:s,refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!1,trigEvent:!0}),e.hide()}},e.prototype.getModuleName=function(){return"dataValidation"},e}(),ai=function(){function e(e){this.password="",this.parent=e,this.init()}return e.prototype.init=function(){this.addEventListener()},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("applyProtect",this.protect,this),this.parent.on("protectSheet",this.protectSheetHandler,this),this.parent.on("editAlert",this.editProtectedAlert,this),this.parent.on("applyLockCells",this.lockCellsHandler,this),this.parent.on("protectWorkbook",this.protectWorkbook,this),this.parent.on(tr,this.KeyUpHandler,this),this.parent.on("unProtectWorkbook",this.unProtectWorkbook,this),this.parent.on("getPassWord",this.getPassWord,this),this.parent.on("importProtectWorkbook",this.importProtectWorkbook,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("applyProtect",this.protect),this.parent.off("protectSheet",this.protectSheetHandler),this.parent.off("editAlert",this.editProtectedAlert),this.parent.off("applyLockCells",this.lockCellsHandler),this.parent.off("protectWorkbook",this.protectWorkbook),this.parent.off(tr,this.KeyUpHandler),this.parent.off("unProtectWorkbook",this.unProtectWorkbook),this.parent.off("getPassWord",this.getPassWord),this.parent.off("importProtectWorkbook",this.importProtectWorkbook))},e.prototype.protect=function(e){this.parent.notify("clearCopy",null),e.isActive?(this.parent.setSheetPropertyOnMute(this.parent.getActiveSheet(),"isProtected",!1),this.parent.notify("updateToggleItem",{props:"Protect"}),this.parent.notify("protectSheet",{isActive:e.isActive}),this.parent.notify("protectSelection",null)):this.createDialogue()},e.prototype.createDialogue=function(){var e=this,r=this.parent.serviceLocator.getService(Hi),n=[{text:r.getConstant("SelectCells"),id:"1"},{text:r.getConstant("FormatCells"),id:"2"},{text:r.getConstant("FormatRows"),id:"3"},{text:r.getConstant("FormatColumns"),id:"4"},{text:r.getConstant("InsertLinks"),id:"5"}];this.optionList=new s.ListView({width:"250px",dataSource:n,showCheckBox:!0,select:this.dialogOpen.bind(this)});var i=this.parent.createElement("div",{className:"e-protect-content",innerHTML:r.getConstant("ProtectAllowUser")});this.parent.setSheetPropertyOnMute(this.parent.getActiveSheet(),"isProtected",!1);var o=new a.CheckBox({checked:!0,label:r.getConstant("ProtectContent"),cssClass:"e-protect-checkbox"}),l=this.parent.createElement("div",{className:"e-protect-option-list",id:this.parent.element.id+"_option_list"}),h=this.parent.createElement("div",{className:"e-header-content",innerHTML:r.getConstant("ProtectSheet")}),d=this.parent.createElement("input",{id:this.parent.element.id+"_protect_check",attrs:{type:"checkbox"}});this.dialog=this.parent.serviceLocator.getService("dialog"),this.dialog.show({header:h.outerHTML,content:d.outerHTML+i.outerHTML+l.outerHTML,showCloseIcon:!0,isModal:!0,cssClass:"e-protect-dlg",beforeOpen:function(t){var r={dialogName:"ProtectSheetDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0),Et(e.parent.element)},open:function(){e.okBtnFocus()},beforeClose:function(){var r=document.getElementById(e.parent.element.id+"_protect_check");t.EventHandler.remove(r,"focus",e.okBtnFocus),t.EventHandler.remove(o.element,"click",e.checkBoxClickHandler),Et(e.parent.element)},buttons:[{click:this.selectOption.bind(this,this.dialog,this),buttonModel:{content:r.getConstant("Ok"),isPrimary:!0}}]}),o.appendTo("#"+this.parent.element.id+"_protect_check"),this.optionList.appendTo("#"+this.parent.element.id+"_option_list"),this.optionList.selectMultipleItems([{id:"1"}]),t.EventHandler.add(o.element,"click",this.checkBoxClickHandler,this)},e.prototype.okBtnFocus=function(){var e=this;document.getElementById(this.parent.element.id+"_protect_check").addEventListener("focus",function(){e.dialog.dialogInstance.element.getElementsByClassName("e-footer-content")[0].querySelector("button").focus()})},e.prototype.checkBoxClickHandler=function(){!1===document.getElementById(this.parent.element.id+"_protect_check").checked?this.dialog.dialogInstance.element.getElementsByClassName("e-footer-content")[0].querySelector("button").disabled=!0:(this.dialog.dialogInstance.element.getElementsByClassName("e-footer-content")[0].querySelector("button").disabled=!1,this.dialog.dialogInstance.element.getElementsByClassName("e-footer-content")[0].querySelector("button").focus())},e.prototype.dialogOpen=function(){this.dialog.dialogInstance.element.getElementsByClassName("e-footer-content")[0].querySelector("button").focus()},e.prototype.selectOption=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.optionList.getSelectedItems();this.parent.setSheetPropertyOnMute(this.parent.getActiveSheet(),"isProtected",!0);var r={selectCells:t.text.indexOf(e.getConstant("SelectCells"))>-1,formatCells:t.text.indexOf(e.getConstant("FormatCells"))>-1,formatRows:t.text.indexOf(e.getConstant("FormatRows"))>-1,formatColumns:t.text.indexOf(e.getConstant("FormatColumns"))>-1,insertLink:t.text.indexOf(e.getConstant("InsertLinks"))>-1};this.parent.protectSheet(null,r),this.parent.notify("protectSelection",null),this.parent.notify("clearUndoRedoCollection",null),this.dialog.hide()},e.prototype.protectSheetHandler=function(){var e=this.parent.getActiveSheet(),t=this.parent.element.id,r=[t+"_undo",t+"_redo",t+"_cut",t+"_copy",t+"_paste",t+"_number_format",t+"_font_name",t+"_font_size",t+"_bold",t+"_italic",t+"_line-through",t+"_underline",t+"_font_color_picker",t+"_fill_color_picker",t+"_borders",t+"_merge_cells",t+"_text_align",t+"_vertical_align",t+"_wrap",t+"_sorting",t+"_clear",t+"_conditionalformatting"],n=[t+"_cut",t+"_copy",t+"_number_format",t+"_font_name",t+"_font_size",t+"_bold",t+"_italic",t+"_line-through",t+"_underline",t+"_font_color_picker",t+"_fill_color_picker",t+"_borders",t+"_text_align",t+"_vertical_align",t+"_wrap",t+"_sorting",t+"_clear",t+"_conditionalformatting"],i=[t+"_insert_function"],a=[t+"_hyperlink",t+"_",t+"_chart"],o=[t+"_"],s=[t+"_find"],l=[t+"_datavalidation"],h=[t+"_chart"],d=document.getElementById(this.parent.element.id+"_sheet_panel");d&&(e.isProtected&&e.protectSettings.selectCells?d.classList.remove("e-protected"):d.classList.add("e-protected"),e.isProtected||d.classList.remove("e-protected")),this.parent.dataBind(),this.parent.notify("protectCellFormat",{disableHomeBtnId:r,enableHomeBtnId:n,enableFrmlaBtnId:i,enableInsertBtnId:a,findBtnId:s,dataValidationBtnId:l,imageBtnId:o,chartBtnId:h}),this.parent.notify("enableFormulaInput",null),e.isProtected&&this.parent.notify("updateToggleItem",{props:"Protect"})},e.prototype.editProtectedAlert=function(){var e=this,t=this.parent.serviceLocator.getService(Hi);this.dialog=this.parent.serviceLocator.getService("dialog"),this.dialog.show({content:t.getConstant("EditAlert"),isModal:!0,closeOnEscape:!0,showCloseIcon:!0,width:"400px",cssClass:"e-editAlert-dlg",beforeOpen:function(t){var r={dialogName:"EditAlertDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0,Be(function(){return e.dialog.destroyDialog()})),Et(e.parent.element)},close:function(){return Et(e.parent.element)}})},e.prototype.lockCellsHandler=function(e){var t=this.parent.getActiveSheet(),r={isLocked:!!e.isLocked&&e.isLocked};Q(e.rowIdx,e.colIdx,t,r,!0)},e.prototype.protectWorkbook=function(){var e=this,t=this.parent.serviceLocator.getService(Hi),r=this.parent.serviceLocator.getService(Bi);r.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-protectworkbook-dlg",header:t.getConstant("ProtectWorkbook"),beforeOpen:function(t){var n={dialogName:"ProtectWorkbook",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",n),n.cancel&&(t.cancel=!0),r.dialogInstance.content=e.passwordProtectContent(),r.dialogInstance.dataBind(),e.parent.element.focus()},buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0},click:function(){e.alertMessage(),e.dlgClickHandler(r)}}]})},e.prototype.passwordProtectContent=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("div",{className:"e-password-dialog"}),r=this.parent.createElement("div",{className:"e-password-content"}),n=this.parent.createElement("div",{className:"e-password-content"}),i=this.parent.createElement("div",{className:"e-header",innerHTML:e.getConstant("Password")}),a=this.parent.createElement("div",{className:"e-header",innerHTML:e.getConstant("ConfirmPassword")}),o=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}}),s=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}});return o.setAttribute("placeholder",e.getConstant("EnterThePassword")),s.setAttribute("placeholder",e.getConstant("EnterTheConfirmPassword")),r.appendChild(o),r.insertBefore(i,o),n.appendChild(s),n.insertBefore(a,s),t.appendChild(n),t.insertBefore(r,n),t},e.prototype.KeyUpHandler=function(e){var r=e.target;if(r.classList.contains("e-text")&&t.closest(r,".e-password-content")&&t.closest(r,".e-password-dialog")&&t.closest(r,".e-password-dialog").getElementsByClassName("e-password-content")[1]===r.parentElement){var n=t.closest(r,".e-protectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild;""!==r.value?n.removeAttribute("disabled"):n.setAttribute("disabled","true")}if(r.classList.contains("e-text")&&t.closest(r,".e-unprotectpwd-content")&&t.closest(r,".e-unprotectpwd-dialog")&&t.closest(r,".e-unprotectpwd-dialog").getElementsByClassName("e-unprotectpwd-content")[0]===r.parentElement){var i=t.closest(r,".e-unprotectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild;""!==r.value?i.removeAttribute("disabled"):i.setAttribute("disabled","true")}if(r.classList.contains("e-text")&&t.closest(r,".e-importprotectpwd-content")&&t.closest(r,".e-importprotectpwd-dialog")&&t.closest(r,".e-importprotectpwd-dialog").getElementsByClassName("e-importprotectpwd-content")[0]===r.parentElement){var a=t.closest(r,".e-importprotectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild;""!==r.value?a.removeAttribute("disabled"):a.setAttribute("disabled","true")}},e.prototype.alertMessage=function(){var e=this.parent.element.querySelector(".e-pwd-alert-span"),t=this.parent.element.querySelector(".e-unprotectpwd-alert-span"),r=this.parent.element.querySelector(".e-importprotectpwd-alert-span");e&&e.remove(),t&&t.remove(),r&&r.remove()},e.prototype.dlgClickHandler=function(e){var t=this.parent.serviceLocator.getService(Hi),r=this.parent.element.querySelector(".e-password-dialog").getElementsByClassName("e-password-content")[0].querySelector(".e-input"),n=this.parent.element.querySelector(".e-password-dialog").getElementsByClassName("e-password-content")[1].querySelector(".e-input"),i=this.parent.createElement("span",{className:"e-pwd-alert-span"});r.value===n.value?(this.parent.password=r.value,this.parent.isProtected=!0,e.hide(),this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.parent.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled")),this.parent.notify("updateToggleItem",{props:"Protectworkbook"})):""===r.value?i.textContent=t.getConstant("PasswordAlertMsg"):""===n.value?i.textContent=t.getConstant("ConfirmPasswordAlertMsg"):r.value!==n.value&&(i.textContent=t.getConstant("PasswordAlert")),this.parent.element.querySelector(".e-protectworkbook-dlg").querySelector(".e-dlg-content").appendChild(i)},e.prototype.unProtectWorkbook=function(){var e=this,t=this.parent.serviceLocator.getService(Hi),r=this.parent.serviceLocator.getService(Bi);r.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-unprotectworkbook-dlg",header:t.getConstant("UnProtectWorkbook"),beforeOpen:function(t){var n={dialogName:"UnProtectWorkbook",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",n),n.cancel&&(t.cancel=!0),r.dialogInstance.content=e.unProtectPasswordContent(),r.dialogInstance.dataBind(),e.parent.element.focus()},buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0,disabled:!0},click:function(){e.alertMessage(),e.unprotectdlgOkClick(r)}}]})},e.prototype.unProtectPasswordContent=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("div",{className:"e-unprotectpwd-dialog"}),r=this.parent.createElement("div",{className:"e-unprotectpwd-content"}),n=this.parent.createElement("div",{className:"e-header",innerHTML:e.getConstant("EnterThePassword")}),i=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}});return r.appendChild(i),r.insertBefore(n,i),t.appendChild(r),t},e.prototype.unprotectdlgOkClick=function(e){var t=this.parent.serviceLocator.getService(Hi),r=this.parent.element.querySelector(".e-unprotectpwd-dialog").getElementsByClassName("e-unprotectpwd-content")[0].querySelector(".e-input");if(this.parent.password===r.value)e.hide(),this.parent.password="",this.parent.isProtected=!1,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled")),document.getElementById(this.parent.element.id+"_protectworkbook").classList.remove("e-active"),this.parent.notify("updateToggleItem",{props:"Protectworkbook"});else{var n=this.parent.createElement("span",{className:"e-unprotectpwd-alert-span",innerHTML:t.getConstant("UnProtectPasswordAlert")});this.parent.element.querySelector(".e-unprotectworkbook-dlg").querySelector(".e-dlg-content").appendChild(n)}},e.prototype.getPassWord=function(e){e.passWord=this.password},e.prototype.importProtectWorkbook=function(e){var t=this,r=this.parent.serviceLocator.getService(Hi),n=this.parent.serviceLocator.getService(Bi);n.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-importprotectworkbook-dlg",header:r.getConstant("UnProtectWorkbook"),beforeOpen:function(r){var i={dialogName:"ImportProtectWorkbook",element:r.element,target:r.target,cancel:r.cancel};t.parent.trigger("dialogBeforeOpen",i),i.cancel&&(r.cancel=!0),n.dialogInstance.content=t.importProtectPasswordContent(e),n.dialogInstance.dataBind(),t.parent.element.focus()},buttons:[{buttonModel:{content:r.getConstant("Ok"),isPrimary:!0,disabled:!0},click:function(){t.alertMessage(),t.importOkClick(e)}}]})},e.prototype.importProtectPasswordContent=function(e){var t=this.parent.serviceLocator.getService(Hi),r=this.parent.createElement("div",{className:"e-importprotectpwd-dialog"}),n=this.parent.createElement("div",{className:"e-importprotectpwd-content"}),i=this.parent.createElement("span",{className:"e-header",innerHTML:'"'+e.file.name+'" '+t.getConstant("IsProtected")}),a=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}});return a.setAttribute("placeholder",t.getConstant("EnterThePassword")),n.appendChild(i),n.appendChild(a),r.appendChild(n),r},e.prototype.importOkClick=function(e){var t=this.parent.element.querySelector(".e-importprotectpwd-dialog").getElementsByClassName("e-importprotectpwd-content")[0].querySelector(".e-input");this.parent.password=t.value;var r={file:e.file,password:t.value};this.parent.open(r)},e.prototype.getModuleName=function(){return"protectSheet"},e}(),oi=function(){function e(e){this.shortValue="",this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(fr,this.renderFindDlg,this),this.parent.on(ur,this.renderGotoDlg,this),this.parent.on(Mt,this.gotoHandler,this),this.parent.on("findHandler",this.findHandler,this),this.parent.on(gr,this.replaceHandler,this),this.parent.on(Pt,this.showDialog,this),this.parent.on("replaceAllDialog",this.replaceAllDialog,this),this.parent.on("findUndoRedo",this.findUndoRedo,this),this.parent.on("findKeyUp",this.findKeyUp,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(fr,this.renderFindDlg),this.parent.off(ur,this.renderGotoDlg),this.parent.off(Mt,this.gotoHandler),this.parent.off("findHandler",this.findHandler),this.parent.off(gr,this.replaceHandler),this.parent.off(Pt,this.showDialog),this.parent.off("replaceAllDialog",this.replaceAllDialog),this.parent.off("findUndoRedo",this.findUndoRedo),this.parent.off("findKeyUp",this.findKeyUp))},e.prototype.findUndoRedo=function(e){var t={address:e.address,compareVal:e.compareVal,cancel:!1};if("before"===e.undoRedoOpt)this.parent.notify(cr,{action:"beforeReplace",eventArgs:t});else if("after"===e.undoRedoOpt){if(!t.cancel){var r={address:e.address,compareVal:e.compareVal};this.parent.notify(pr,{action:"replace",eventArgs:r})}}else if("beforeReplaceAll"===e.undoRedoOpt){if(!t.cancel){var n={replaceValue:e.replaceValue,addressCollection:e.Collection};this.parent.notify(cr,{action:"beforeReplaceAll",eventArgs:n})}}else if("afterReplaceAll"===e.undoRedoOpt&&!t.cancel){var i={replaceValue:e.replaceValue,addressCollection:e.Collection};this.parent.notify(pr,{action:"replaceAll",eventArgs:i})}},e.prototype.renderFindDlg=function(){var e=this,r=this.parent.serviceLocator.getService(Hi),n=this.parent.serviceLocator.getService(Bi);if(t.isNullOrUndefined(this.parent.element.querySelector(".e-find-dlg"))){var i={isModal:!1,showCloseIcon:!0,cssClass:"e-find-dlg",allowDragging:!0,header:r.getConstant("FindAndReplace"),closeOnEscape:!1,beforeOpen:function(t){var r={dialogName:"FindAndReplaceDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0),n.dialogInstance.content=e.findandreplaceContent(),n.dialogInstance.dataBind(),Et(e.parent.element)},buttons:[{buttonModel:{content:r.getConstant("FindPreviousBtn"),isPrimary:!0,cssClass:"e-btn-findPrevious",disabled:!0},click:function(t){if(e.dialogMessage(),t&&13===t.keyCode)return void e.findDlgClick("next");e.findDlgClick("prev")}},{buttonModel:{content:r.getConstant("FindNextBtn"),isPrimary:!0,cssClass:"e-btn-findNext",disabled:!0},click:function(){e.dialogMessage(),e.findDlgClick("next")}},{buttonModel:{content:r.getConstant("ReplaceBtn"),isPrimary:!0,cssClass:"e-btn-replace",disabled:!0},click:function(){e.dialogMessage(),e.findDlgClick("replace")}},{buttonModel:{content:r.getConstant("ReplaceAllBtn"),isPrimary:!0,cssClass:"e-btn-replaceAll",disabled:!0},click:function(){e.dialogMessage(),e.findDlgClick("replaceAll")}}],open:function(){if(e.parent.element.querySelector(".e-text-findNext").value){var r=e.parent.element.querySelector(".e-btn-findPrevious");t.getComponent(r,"btn").disabled=!1,t.getComponent(e.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!1}},close:function(){n.hide()}};n.show(i,!1)}else n.hide()},e.prototype.dialogMessage=function(){this.parent.element.querySelector(".e-replace-alert-span")?this.parent.element.querySelector(".e-replace-alert-span").remove():this.parent.element.querySelector(".e-find-alert-span")&&this.parent.element.querySelector(".e-find-alert-span").remove()},e.prototype.renderGotoDlg=function(){var e=this,r=this.parent.serviceLocator.getService(Hi),n=this.parent.serviceLocator.getService(Bi);if(t.isNullOrUndefined(this.parent.element.querySelector(".e-find-dlg"))){var i={width:300,isModal:!1,showCloseIcon:!0,cssClass:"e-goto-dlg",allowDragging:!0,header:r.getConstant("GotoHeader"),beforeOpen:function(t){var r={dialogName:"GoToDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0),n.dialogInstance.content=e.GotoContent(),n.dialogInstance.dataBind(),Et(e.parent.element)},buttons:[{buttonModel:{content:r.getConstant("Ok"),isPrimary:!0,cssClass:"e-btn-goto-ok"},click:function(){e.gotoHandler()}}],close:function(){n.hide()},open:function(){e.textFocus()}};n.show(i,!1)}else n.hide()},e.prototype.textFocus=function(){var e=this;this.parent.element.querySelector(".e-text-goto").addEventListener("focus",function(){e.parent.element.querySelector(".e-goto-alert-span")&&e.parent.element.querySelector(".e-goto-alert-span").remove()})},e.prototype.findDlgClick=function(e){"prev"===e?this.findHandler({findOption:e}):"next"===e?this.findHandler({findOption:e}):this.replaceHandler({findDlgArgs:e})},e.prototype.findHandler=function(e){var r=this.parent.element.querySelector(".e-text-findNext");r||(r=this.parent.element.querySelector(".e-text-findNext-short"))||this.gotoAlert();var n=r.value;if(""!==r.value){var i=this.parent.activeSheetIndex,a=this.parent.element.querySelector(".e-findnreplace-checkcase"),o=void 0;o=!!a&&t.getComponent(a,"checkbox").checked;var s=this.parent.element.querySelector(".e-findnreplace-checkmatch"),l=void 0;l=!!s&&t.getComponent(s,"checkbox").checked;var h=this.parent.element.querySelector(".e-findnreplace-searchby"),d=void 0;d=h?t.getComponent(h,"dropdownlist").value.toString():"By Row";var p=this.parent.element.querySelector(".e-findnreplace-searchwithin"),c=void 0;c=p?t.getComponent(p,"dropdownlist").value.toString():"Sheet";var u={value:n,sheetIndex:i,findOpt:e.findOption,mode:c,isCSen:o,isEMatch:l,searchBy:d};"next"===e.findOption||"prev"===e.findOption?this.parent.find(u):"count"===e.countArgs.countOpt&&(this.parent.notify("count",u),e.countArgs.findCount=u.findCount)}},e.prototype.replaceHandler=function(e){var r=this.parent.activeSheetIndex,n=this.parent.element.querySelector(".e-text-findNext"),i=this.parent.element.querySelector(".e-text-replaceInp"),a=this.parent.element.querySelector(".e-findnreplace-checkcase"),o=t.getComponent(a,"checkbox"),s=this.parent.element.querySelector(".e-findnreplace-checkmatch"),l=t.getComponent(s,"checkbox"),h=this.parent.element.querySelector(".e-findnreplace-searchby"),d=t.getComponent(h,"dropdownlist"),p=this.parent.element.querySelector(".e-findnreplace-searchwithin"),c=t.getComponent(p,"dropdownlist"),u={value:n.value,mode:c.value.toString(),isCSen:o.checked,isEMatch:l.checked,searchBy:d.value.toString(),findOpt:"next",replaceValue:i.value,replaceBy:e.findDlgArgs?e.findDlgArgs:e.replaceMode,sheetIndex:r};this.parent.replace(u)},e.prototype.gotoHandler=function(e){if(e)this.parent.goTo(e.address);else{var t=this.parent.element.querySelector(".e-text-goto").value,r=t.split("");if(""===t||isNaN(parseInt(r[1],10)))return void this.gotoAlert();var n=t.toString().toUpperCase();this.parent.goTo(n)}},e.prototype.gotoAlert=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("span",{className:"e-goto-alert-span",innerHTML:e.getConstant("InsertingEmptyValue")});this.parent.element.querySelector(".e-goto-alert-span")&&this.parent.element.querySelector(".e-goto-alert-span").remove(),this.parent.element.querySelector(".e-goto-dlg").querySelector(".e-dlg-content").appendChild(t)},e.prototype.showDialog=function(){this.parent.element.querySelector(".e-replace-alert-span")&&this.parent.element.querySelector(".e-replace-alert-span").remove();var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("span",{className:"e-find-alert-span",innerHTML:e.getConstant("NoElements")});this.parent.element.querySelector(".e-find-dlg")&&this.parent.element.querySelector(".e-find-dlg").querySelector(".e-dlg-content").appendChild(t)},e.prototype.replaceAllDialog=function(e){this.parent.element.querySelector(".e-find-alert-span")&&this.parent.element.querySelector(".e-find-alert-span").remove();var t=this.parent.serviceLocator.getService(Hi),r=this.parent.createElement("span",{className:"e-replace-alert-span",innerHTML:e.count+t.getConstant("ReplaceAllEnd")+e.replaceValue});this.parent.element.querySelector(".e-find-dlg")&&this.parent.element.querySelector(".e-find-dlg").querySelector(".e-dlg-content").appendChild(r)},e.prototype.findKeyUp=function(e){if(e.target.classList.contains("e-text-findNext")){var r=this.parent.element.querySelector(".e-text-findNext").value;if(t.isNullOrUndefined(r)||""===r)t.getComponent(this.parent.element.querySelector(".e-btn-findPrevious"),"btn").disabled=!0,t.getComponent(this.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!0,this.dialogMessage();else{var n=this.parent.element.querySelector(".e-btn-findPrevious");t.getComponent(n,"btn").disabled=!1,t.getComponent(this.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!1}}var i=this.parent.element.querySelector(".e-text-findNext").value,a=this.parent.element.querySelector(".e-text-replaceInp").value;t.isNullOrUndefined(i)||t.isNullOrUndefined(a)||""===i||""===a?(t.getComponent(this.parent.element.querySelector(".e-btn-replace"),"btn").disabled=!0,t.getComponent(this.parent.element.querySelector(".e-btn-replaceAll"),"btn").disabled=!0):!1===this.parent.getActiveSheet().isProtected&&(t.getComponent(this.parent.element.querySelector(".e-btn-replace"),"btn").disabled=!1,t.getComponent(this.parent.element.querySelector(".e-btn-replaceAll"),"btn").disabled=!1)},e.prototype.findandreplaceContent=function(){this.parent.element.querySelector(".e-text-findNext-short")&&(this.shortValue=this.parent.element.querySelector(".e-text-findNext-short").value);var e=this.parent.createElement("div",{className:"e-link-dialog"}),t=this.parent.createElement("div",{className:"e-find"}),r=this.parent.createElement("div",{className:"e-findCheck"}),n=this.parent.serviceLocator.getService(Hi);e.appendChild(t);var s=this.parent.createElement("div",{className:"e-cont"}),l=this.parent.createElement("p",{className:"e-header",innerHTML:n.getConstant("FindWhat")}),h=this.parent.createElement("input",{className:"e-input e-text-findNext",attrs:{type:"Text",placeholder:n.getConstant("FindValue"),value:this.shortValue}});s.appendChild(h),s.insertBefore(l,h),t.appendChild(s);var d=new i.TextBox({width:"70%"});d.createElement=this.parent.createElement,d.appendTo(h);var p=this.parent.createElement("div",{className:"e-cont"}),c=this.parent.createElement("p",{className:"e-header",innerHTML:n.getConstant("ReplaceWith")}),u=this.parent.createElement("input",{className:"e-input e-text-replaceInp",attrs:{type:"Text",placeholder:n.getConstant("ReplaceValue")}});p.appendChild(u),p.insertBefore(c,u),t.appendChild(p);var f=new i.TextBox({width:"70%"});f.createElement=this.parent.createElement,f.appendTo(u);var g=[{Id:"Sheet",Within:n.getConstant("Sheet")},{Id:"Workbook",Within:n.getConstant("Workbook")}],m=new o.DropDownList({dataSource:g,cssClass:"e-searchby",fields:{value:"Id",text:"Within"},width:"50%",index:0}),v=this.parent.createElement("input",{className:"e-findnreplace-searchwithin",attrs:{type:"select",label:n.getConstant("SearchBy")}}),y=this.parent.createElement("p",{className:"e-header",innerHTML:n.getConstant("SearchWithin")});t.appendChild(y),t.appendChild(v),m.createElement=this.parent.createElement,m.appendTo(v);var C=[{Id:"By Row",Search:n.getConstant("ByRow")},{Id:"By Column",Search:n.getConstant("ByColumn")}],b=new o.DropDownList({dataSource:C,cssClass:"e-searchby",fields:{value:"Id",text:"Search"},width:"50%",index:0}),x=this.parent.createElement("input",{className:"e-findnreplace-searchby",attrs:{type:"select",label:n.getConstant("SearchBy")}}),S=this.parent.createElement("p",{className:"e-header",innerHTML:n.getConstant("SearchBy")});t.appendChild(S),t.appendChild(x),b.createElement=this.parent.createElement,b.appendTo(x);var w=new a.CheckBox({label:n.getConstant("MatchCase"),checked:!1,cssClass:"e-findnreplace-casecheckbox"}),I=this.parent.createElement("input",{className:"e-findnreplace-checkcase",attrs:{type:"checkbox"}});r.appendChild(I),w.createElement=this.parent.createElement,w.appendTo(I);var E=new a.CheckBox({label:n.getConstant("MatchExactCellElements"),checked:!1,cssClass:"e-findnreplace-exactmatchcheckbox"}),R=this.parent.createElement("input",{className:"e-findnreplace-checkmatch",attrs:{type:"checkbox"}});return r.appendChild(R),E.createElement=this.parent.createElement,E.appendTo(R),t.appendChild(r),e},e.prototype.GotoContent=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.parent.createElement("div",{className:"e-link-dialog"}),r=this.parent.createElement("div",{className:"e-goto"});t.appendChild(r);var n=this.parent.createElement("div",{className:"e-cont"}),a=this.parent.createElement("p",{className:"e-header",innerHTML:e.getConstant("Reference")}),o=new i.TextBox({placeholder:e.getConstant("EntercellAddress")}),s=this.parent.createElement("input",{className:"e-text-goto",attrs:{type:"Text"}});return n.appendChild(s),n.insertBefore(a,s),r.appendChild(n),o.createElement=this.parent.createElement,o.appendTo(s),t},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"findAndReplace"},e}(),si=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.merge=function(e){var t=this;if(e.showDialog)return void this.parent.serviceLocator.getService(Bi).show({target:this.parent.element,height:180,width:400,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(Hi).getConstant("PasteMergeAlert"),beforeOpen:function(e){var r={dialogName:"MergeDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0),Et(t.parent.element)}});this.parent.serviceLocator.getService("cell").refresh(e.rowIdx,e.colIdx,e.lastCell,e.element)},e.prototype.hideHandler=function(e){var t=this.parent.getActiveSheet(),r={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]};this.parent.notify("activeCellMergedRange",r),r.range=r.range;var n=J(r.range[0],r.range[1],t)||{},i="row"===e.model?r.range[0]:r.range[1],a=i+((n[e.model+"Span"]||1)-1);if(!(!e.isEnd&&(e.start===i||De(t,i))||e.isEnd&&e.start>i&&!De(t,i))&&n[e.model+"Span"]>1&&a>=e.start)if("row"===e.model?Ee(t,i):De(t,i)){if(e.end<a&&(a-e.end>1||n.rowSpan>1)){var o=this.parent.getCell(e.rowIdx,e.end+1);if(o&&(a-e.end>1&&(o.colSpan=a-e.end),o.style.display=""),n.rowSpan>1){var s=n.rowSpan-this.parent.hiddenCount(e.rowIdx,e.rowIdx+(n.rowSpan-1));s>1&&(o.rowSpan=s)}}}else this.merge({rowIdx:r.range[0],colIdx:r.range[1]})},e.prototype.checkPrevMerge=function(e){var t,r,n,i=this.parent.getActiveSheet();if(e.isRow)return void(e.rowIdx-1>-1&&Ee(i,e.rowIdx-1)&&(void 0===(t=J(e.rowIdx-1,e.colIdx,i)||{}).rowSpan&&void 0===t.colSpan||!(void 0===t.colSpan||t.colSpan>1||e.colIdx-1>-1&&De(i,e.colIdx-1))||(r={range:[e.rowIdx-1,e.colIdx,e.rowIdx-1,e.colIdx]},this.parent.notify("activeCellMergedRange",r),r.range=r.range,Ee(i,r.range[0])&&r.range[2]>=e.rowIdx&&(t=J(r.range[0],r.range[1],i)||{}).rowSpan>1&&((n=r.range[2]-e.rowIdx+1-this.parent.hiddenCount(e.rowIdx,e.rowIdx+(r.range[2]-e.rowIdx)))>1&&(e.td.rowSpan=n,e.td.style.display=""),t.colSpan>1&&!(e.colIdx-1>-1&&De(i,e.colIdx-1))&&(n=t.colSpan-this.parent.hiddenCount(e.colIdx,e.colIdx+(t.colSpan-1),"columns"))>1&&(e.td.colSpan=n,e.td.style.display="")))));e.colIdx-1>-1&&De(i,e.colIdx-1)&&(void 0===(t=J(e.rowIdx,e.colIdx-1,i)||{}).colSpan&&void 0===t.rowSpan||!(void 0===t.rowSpan||t.rowSpan>1||e.rowIdx-1>-1&&Ee(i,e.rowIdx-1))||(r={range:[e.rowIdx,e.colIdx-1,e.rowIdx,e.colIdx-1]},this.parent.notify("activeCellMergedRange",r),r.range=r.range,De(i,r.range[1])&&r.range[3]>=e.colIdx&&(t=J(r.range[0],r.range[1],i)||{}).colSpan>1&&((n=r.range[3]-e.colIdx+1-this.parent.hiddenCount(e.colIdx,e.colIdx+(t.colSpan-1),"columns"))>1&&(e.td.colSpan=n,e.td.style.display=""),t.rowSpan>1&&!(e.rowIdx-1>-1&&Ee(i,e.rowIdx-1))&&(n=t.rowSpan-this.parent.hiddenCount(e.rowIdx,e.rowIdx+(t.rowSpan-1)))>1&&(e.td.rowSpan=n,e.td.style.display=""))))},e.prototype.checkMerge=function(e){var t=this.parent.getActiveSheet(),r=J(e.rowIdx,e.colIdx,t)||{};if(e.isRow){if(void 0===r.colSpan||De(t,e.colIdx-1)){if((n={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]}).range=n.range,this.parent.notify("activeCellMergedRange",n),De(t,e.colIdx-1)&&!De(t,n.range[1])||e.isFreezePane&&n.range[0]<this.parent.frozenRowCount(t))return void(e.insideFreezePane=n.range[0]<this.parent.frozenRowCount(t));r=J(n.range[0],n.range[1],t),(i=n.range[2]-e.rowIdx+1-this.parent.hiddenCount(e.rowIdx,n.range[2]))>1&&(this.merge({rowIdx:n.range[0],colIdx:n.range[1],element:e.td}),e.td.rowSpan=i,e.td.style.display="")}}else if(void 0===r.rowSpan||Ee(t,e.rowIdx-1)){var n={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]};if(n.range=n.range,this.parent.notify("activeCellMergedRange",n),Ee(t,e.rowIdx-1)&&!Ee(t,n.range[0])||e.isFreezePane&&n.range[1]<this.parent.frozenColCount(t))return void(e.insideFreezePane=n.range[1]<this.parent.frozenColCount(t));r=J(n.range[0],n.range[1],t);var i=n.range[3]-e.colIdx+1-this.parent.hiddenCount(e.colIdx,n.range[3],"columns");i>1&&(this.merge({rowIdx:n.range[0],colIdx:n.range[1],element:e.td}),e.td.colSpan=i,e.td.style.display="")}},e.prototype.addEventListener=function(){this.parent.on("applyMerge",this.merge,this),this.parent.on("hiddenMerge",this.hideHandler,this),this.parent.on("checkPrevMerge",this.checkPrevMerge,this),this.parent.on("checkMerge",this.checkMerge,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("applyMerge",this.merge),this.parent.off("hiddenMerge",this.hideHandler),this.parent.off("checkPrevMerge",this.checkPrevMerge),this.parent.off("checkMerge",this.checkMerge))},e.prototype.getModuleName=function(){return"merge"},e}(),li=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("cFRender",this.cFInitialRender,this),this.parent.on("cFInitialCheck",this.cFInitialCheckHandler,this),this.parent.on("checkConditionalFormat",this.checkConditionalFormatHandler,this),this.parent.on("initiateConditionalFormat",this.initiateCFHandler,this),this.parent.on("setCF",this.setCFHandler,this),this.parent.on(jt,this.cFDeleteHandler,this),this.parent.on("clearCF",this.clearCFHandler,this),this.parent.on(Wt,this.addClearCFHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cFRender",this.cFInitialRender),this.parent.off("cFInitialCheck",this.cFInitialCheckHandler),this.parent.off("checkConditionalFormat",this.checkConditionalFormatHandler),this.parent.off("initiateConditionalFormat",this.initiateCFHandler),this.parent.off("setCF",this.setCFHandler),this.parent.off(jt,this.cFDeleteHandler),this.parent.off("clearCF",this.clearCFHandler))},e.prototype.setCF=function(e){e.range=e.range||this.parent.getActiveSheet().selectedRange;var t={range:e.range,type:e.type,cFColor:e.cFColor,value:e.value,sheetIdx:this.parent.activeSheetIndex,cancel:!1};this.parent.notify(cr,{eventArgs:t,action:"conditionalFormat"}),t.cancel||(e.type=t.type,e.cFColor=t.cFColor,e.value=t.value,e.range=t.range,this.parent.notify(zt,{conditionalFormat:e,isAction:!0}),delete t.cancel,this.parent.notify(pr,{eventArgs:t,action:"conditionalFormat"}))},e.prototype.addClearCFHandler=function(e){for(var t=this.parent.getActiveSheet(),r=e.conditionalFormats,n=e.oldRange,i=e.selectedRange,a=t.conditionalFormats,o=r.length-1;o>=0;o--){for(var s=!1,l=0;l<a.length;l++)if(a[l].type===r[o].type&&a[l].range===r[o].range){s=!0,a[l].range=n[o],t.conditionalFormats[l].range=n[o];for(var h=c(i),d=n[o].split(","),p=0;p<d.length;p++)for(var u=c(d[p]),f=u[0];f<=u[2];f++)for(var g=u[1];g<=u[3];g++)for(var m=h[0];m<=h[2];m++)for(var v=h[1];v<=h[3];v++)if(m===f&&v===g){var y=this.parent.getCell(f,g),C=t.rows[f]&&t.rows[f].cells[g]?t.rows[f].cells[g]:null;C&&this.cFInitialCheckHandler({rowIdx:f,colIdx:g,cell:C,td:y,conditionalFormat:a[l]})}}if(!s){var b=r[o];b.range=n[o],this.parent.notify(zt,{conditionalFormat:b})}}},e.prototype.cFDeleteHandler=function(e){var t=this.parent.getCell(e.rowIdx,e.colIdx);t&&(t.querySelector(".e-cf-databar")&&t.removeChild(t.querySelector(".e-cf-databar")),t.querySelector(".e-iconsetspan")&&t.removeChild(t.querySelector(".e-iconsetspan")))},e.prototype.clearCFHandler=function(e){var t=this.parent.getActiveSheet(),r=this.parent.getCell(e.rIdx,e.cIdx),n=J(e.rIdx,e.cIdx,t);if(r){if(r.classList.remove("e-redft"),r.classList.remove("e-yellowft"),r.classList.remove("e-greenft"),r.classList.remove("e-redf"),r.classList.remove("e-redt"),r.classList.remove("e-iconset"),r.style){if(r.style.backgroundColor){r.style.backgroundColor="";i=this.parent.getCellStyleValue(["backgroundColor"],[e.rIdx,e.cIdx]);this.parent.notify(Ft,{style:i,rowIdx:e.rIdx,colIdx:e.cIdx})}if(r.style.color){r.style.color="";var i=this.parent.getCellStyleValue(["color"],[e.rIdx,e.cIdx]);this.parent.notify(Ft,{style:i,rowIdx:e.rIdx,colIdx:e.cIdx})}}r.querySelector(".e-cf-databar")&&(r.removeChild(r.querySelector(".e-cf-databar")),r.textContent=this.parent.getDisplayText(n)),r.querySelector(".e-iconsetspan")&&(r.removeChild(r.querySelector(".e-iconsetspan")),r.textContent=this.parent.getDisplayText(n))}},e.prototype.setCFHandler=function(e){"cf_databars"===e.action?this.setCF({type:e.id}):"cf_colorscales"===e.action?this.setCF({type:e.id}):"cf_iconsets"===e.action&&this.setCF({type:e.id})},e.prototype.initiateCFHandler=function(e){var t=this,r=this.parent.serviceLocator.getService(Hi),n=this.parent.serviceLocator.getService(Bi);n.show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-conditionalformatting-dlg",header:e.action.replace("...",""),target:document.querySelector(".e-control.e-spreadsheet"),beforeOpen:function(){n.dialogInstance.content=t.cFDlgContent(e.action),n.dialogInstance.dataBind(),Et(t.parent.element)},buttons:[{buttonModel:{content:r.getConstant("Ok"),isPrimary:!0,cssClass:"e-btn e-clearall-btn e-flat"},click:function(){n.dialogInstance.element.getElementsByClassName("e-clearall-btn")[0].disabled||(t.dlgClickHandler(e.action),n.hide())}}]}),n.dialogInstance.refresh()},e.prototype.dlgClickHandler=function(e){var r="",n="",i=this.parent.element.querySelector(".e-conditionalformatting-dlg").getElementsByClassName("e-dlg-content")[0].querySelector(".e-cf-dlg"),a=i.querySelector(".e-cfmain");if(a){var o=a.getElementsByTagName("input")[0];o&&o.parentElement.classList.contains("e-cfmain")&&(r=a.getElementsByTagName("input")[0].value),n=a.getElementsByTagName("input")[1]?i.querySelector(".e-cfmain").getElementsByTagName("input")[1].value:"";var s=t.getNumberDependable(this.parent.locale,"");r=r.split(s).join("").split(",").join(""),n=n.split(s).join("").split(",").join("")}var l=this.getCFColor(i.querySelector(".e-cfsub").getElementsByTagName("input")[0].value),h="Duplicate Values..."===e?i.querySelector(".e-cfmain").getElementsByTagName("input")[0].value:this.getType(e);""!==r&&""!==n?this.setCF({type:h,cFColor:l,value:r+","+n}):""!==r?this.setCF({type:h,cFColor:l,value:r}):this.setCF({type:h,cFColor:l,value:n})},e.prototype.getType=function(e){var t=this.parent.serviceLocator.getService(Hi),r="";switch(e){case t.getConstant("GreaterThan")+"...":r="GreaterThan";break;case t.getConstant("LessThan")+"...":r="LessThan";break;case t.getConstant("Between")+"...":r="Between";break;case t.getConstant("CFEqualTo")+"...":r="EqualTo";break;case t.getConstant("TextThatContains")+"...":r="ContainsText";break;case t.getConstant("ADateOccuring")+"...":r="DateOccur";break;case t.getConstant("Top10Items")+"...":r="Top10Items";break;case t.getConstant("Bottom10Items")+"...":r="Bottom10Items";break;case t.getConstant("Top10")+" %...":r="Top10Percentage";break;case t.getConstant("Bottom10")+" %...":r="Bottom10Percentage";break;case t.getConstant("AboveAverage")+"...":r="AboveAverage";break;case t.getConstant("BelowAverage")+"...":r="BelowAverage"}return r},e.prototype.getCFColor=function(e){var t=this.parent.serviceLocator.getService(Hi),r="RedFT";switch(e){case t.getConstant("LightRedFillWithDarkRedText"):r="RedFT";break;case t.getConstant("YellowFillWithDarkYellowText"):r="YellowFT";break;case t.getConstant("GreenFillWithDarkGreenText"):r="GreenFT";break;case t.getConstant("RedFill"):r="RedF";break;case t.getConstant("RedText"):r="RedT"}return r},e.prototype.cFDlgContent=function(e){var t=this.getDlgText(e),r=this.parent.serviceLocator.getService(Hi),n=this.parent.createElement("div",{className:"e-cf-dlg"}),a=this.parent.createElement("div",{className:"e-cfmain"}),s=this.parent.createElement("div",{className:"e-cfsub"}),l=this.parent.createElement("span",{className:"e-header e-top-header",innerHTML:t}),h=this.parent.createElement("input",{className:"e-input",id:"valueInput",attrs:{type:"text"}}),d=this.parent.createElement("input",{className:"e-select"}),p=this.parent.createElement("span",{className:"e-header",innerHTML:r.getConstant("With")}),c=this.parent.createElement("input",{className:"e-select"});n.appendChild(a),n.appendChild(s),a.appendChild(l);var u;if(e!==r.getConstant("DuplicateValues")+"..."){if(e!==r.getConstant("AboveAverage")+"..."&&e!==r.getConstant("BelowAverage")+"..."){a.appendChild(h),u=!0;var f=e===r.getConstant("Top10")+" %..."||e===r.getConstant("Bottom10")+" %...";(e===r.getConstant("Top10Items")+"..."||e===r.getConstant("Bottom10Items")+"..."||f)&&(h.maxLength=f?3:4,new i.NumericTextBox({value:10,min:1,max:f?100:1e3,format:"###"}).appendTo(h))}}else{a.appendChild(d);var g=[{text:r.getConstant("Duplicate"),id:"duplicate"},{text:r.getConstant("Unique"),id:"unique"}];new o.DropDownList({dataSource:g,index:0,popupHeight:"200px"}).appendTo(d)}if(e===r.getConstant("Between")+"..."){var m=this.parent.createElement("span",{className:"e-header e-header-2",innerHTML:r.getConstant("And")}),v=this.parent.createElement("input",{className:"e-input e-between"});a.appendChild(m),a.appendChild(v),v.addEventListener("input",this.validateCfInput.bind(this))}u&&(this.validateCfInput({target:h}),h.addEventListener("input",this.validateCfInput.bind(this))),s.appendChild(p),s.appendChild(c);var y=[{text:r.getConstant("LightRedFillWithDarkRedText"),value:"redft",id:"redft"},{text:r.getConstant("YellowFillWithDarkYellowText"),id:"yellowft"},{text:r.getConstant("GreenFillWithDarkGreenText"),id:"greenft"},{text:r.getConstant("RedFill"),id:"redf"},{text:r.getConstant("RedText"),id:"redt"}];return new o.DropDownList({dataSource:y,index:0,popupHeight:"200px"}).appendTo(c),n},e.prototype.validateCfInput=function(e){var t=this.parent.serviceLocator.getService(Bi),r=e.target.value,n=t.dialogInstance.element.getElementsByClassName("e-clearall-btn")[0];r&&(e.target.classList.contains("e-between")||e.target.parentElement.querySelector(".e-between"))&&(r=e.target.parentElement.querySelector(e.target.classList.contains("e-between")?".e-input":".e-between").value),n.disabled=!r},e.prototype.checkCellHandler=function(e,t,r){for(var n=!1,i=r.range.trim().split(","),a=0;a<i.length;a++){var o=i[a],s=c(o=o.indexOf(":")>-1?o:o+":"+o);if(e>=s[0]&&e<=s[2]&&t>=s[1]&&t<=s[3]){n=!0;break}}return n},e.prototype.getDlgText=function(e){var t=this.parent.serviceLocator.getService(Hi),r="";switch(e){case t.getConstant("GreaterThan")+"...":r=t.getConstant("FormatCellsGreaterThan");break;case t.getConstant("LessThan")+"...":r=t.getConstant("FormatCellsLessThan");break;case t.getConstant("Between")+"...":r=t.getConstant("FormatCellsBetween");break;case t.getConstant("CFEqualTo")+"...":r=t.getConstant("FormatCellsEqualTo");break;case t.getConstant("TextThatContains")+"...":r=t.getConstant("FormatCellsThatContainTheText");break;case t.getConstant("ADateOccuring")+"...":r=t.getConstant("FormatCellsThatContainADateOccurring");break;case t.getConstant("DuplicateValues")+"...":r=t.getConstant("FormatCellsDuplicate");break;case t.getConstant("Top10Items")+"...":case t.getConstant("Top10")+" %...":r=t.getConstant("FormatCellsTop");break;case t.getConstant("Bottom10Items")+"...":case t.getConstant("Bottom10")+" %...":r=t.getConstant("FormatCellsBottom");break;case t.getConstant("AboveAverage")+"...":r=t.getConstant("FormatCellsAbove");break;case t.getConstant("BelowAverage")+"...":r=t.getConstant("FormatCellsBelow")}return r},e.prototype.cFInitialRender=function(e){var t=this.parent.getActiveSheet().conditionalFormats;if(t)for(var r=0;r<t.length;r++){this.checkCellHandler(e.rowIdx,e.colIdx,t[r])&&this.cFInitialCheckHandler({rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.cell,td:e.td,conditionalFormat:t[r]})}},e.prototype.triggetConditionalFormatEvent=function(e,t){t&&(e.conditionalFormat.value||"AboveAverage"===e.conditionalFormat.type||"BelowAverage"===e.conditionalFormat.type||"Duplicate"===e.conditionalFormat.type)&&this.parent.trigger("beforeConditionalFormat",e)},e.prototype.cFInitialCheckHandler=function(e){var t,r=!1,n=["e-redft","e-yellowft","e-greenft","e-redf","e-redt"],i=e.cell.value||"",a=e.td||this.parent.getCell(e.rowIdx,e.colIdx);if(a){var o=e.conditionalFormat;if(o.type=o.type||"GreaterThan",o.cFColor=o.cFColor?o.cFColor:o.format?o.cFColor:"RedFT",r=this.cFRCheck(o,i,a,e.rowIdx,e.colIdx,!0),this.triggetConditionalFormatEvent({conditionalFormat:o,cell:e.cell,element:a,address:g(e.rowIdx,e.colIdx),apply:r},e.isAction),r){for(var s=0;s<n.length;s++)if(a.classList.contains(n[s])){a.classList.remove(n[s]);break}o.format&&o.format.style&&(t=o.format.style);var l={};o.cFColor?(a.classList.add("e-"+o.cFColor.toLowerCase()),l=this.setFormat(l,o)):l=t,l.backgroundColor&&a.style.setProperty("background-color",l.backgroundColor),l.color&&a.style.setProperty("color",l.color),l.fontWeight&&a.style.setProperty("font-weight",l.fontWeight),l.fontStyle&&a.style.setProperty("font-style",l.fontStyle),l.textDecoration&&a.style.setProperty("text-decoration",l.textDecoration)}}},e.prototype.checkConditionalFormatHandler=function(e){var r,n,i=!1,a=!1,o=this.parent.getActiveSheet(),s=e.cell,l=o.conditionalFormats,h=s?t.isNullOrUndefined(s.value)?"":s.value:"",d=["e-redft","e-yellowft","e-greenft","e-redf","e-redt"];if(n=this.parent.getCell(e.rowIdx,e.colIdx),l&&!(l.length<1))for(var p=l.length-1;p>=0;p--){for(var u=l[p].range.trim().split(","),f=0;f<u.length;f++)if(g=(g=u[f]).indexOf(":")>-1?g:g+":"+g,r=c(g),e.rowIdx>=r[0]&&e.colIdx>=r[1]&&e.rowIdx<=r[2]&&e.colIdx<=r[3]){a=!0;break}if(a){if("GreaterThanLessThanEqualToBetweenContainsTextDateOccur".includes(o.conditionalFormats[p].type)){y=J(e.rowIdx,e.colIdx,o)&&J(e.rowIdx,e.colIdx,o).value?J(e.rowIdx,e.colIdx,o).value:"";i=(!t.isNullOrUndefined(y)||""!==y)&&this.cFRCheck(o.conditionalFormats[p],y,n),this.setColor(n,e.rowIdx,e.colIdx,p,i,e.isAction)}else if("Top10ItemsBottom10ItemsTop10%Bottom10%AboveAverageBelowAverageDuplicateUnique".includes(o.conditionalFormats[p].type))for(f=0;f<u.length;f++)for(var g=u[f],m=(r=c(g=g.indexOf(":")>-1?g:g+":"+g))[0];m<=r[2];m++){o.rows[m]||Ie(o,m,{});for(var v=r[1];v<=r[3];v++){o.rows[m].cells&&o.rows[m].cells[v]||Q(m,v,o,{});var y=J(m,v,o)&&J(m,v,o).value?J(m,v,o).value:"";i=this.cFRCheck(o.conditionalFormats[p],y,n,m,v,!1),n=this.parent.getCell(m,v),this.setColor(n,m,v,p,i,e.isAction)}}else if("BlueDataBarGreenDataBarRedDataBarOrangeDataBarLightBlueDataBarPurpleColorScaleGYRColorScaleRYGColorScaleGWRColorScaleRWGColorScaleBWRColorScaleRWBColorScaleWRColorScaleRWColorScaleGWColorScaleWGColorScaleGYColorScaleYGColorScaleThreeArrowsThreeArrowsGrayFourArrowsGrayFourArrowsFiveArrowsGrayFiveArrowsThreeTrafficLights1ThreeTrafficLights2ThreeSignsFourTrafficLightsFourRedToBlackThreeSymbolsThreeSymbols2ThreeFlagsFourRatingFiveQuartersFiveRatingThreeTrianglesThreeStarsFiveBoxes".includes(o.conditionalFormats[p].type)){for(var C=0;C<d.length;C++)n.classList.contains(d[C])&&n.classList.remove(d[C]);i=this.cFRCheck(o.conditionalFormats[p],h,n,e.rowIdx,e.colIdx,!1)}a=!1}if(i)break}},e.prototype.setColor=function(e,r,n,i,a,o){var s=this.parent.getActiveSheet(),l=s.conditionalFormats;this.triggetConditionalFormatEvent({conditionalFormat:l[i],cell:J(r,n,s),element:e,address:g(r,n),apply:a},o);var h=["e-redft","e-yellowft","e-greenft","e-redf","e-redt"],d=!1;if(l[i].cFColor)e&&e.classList.contains("e-"+l[i].cFColor.toLowerCase())&&(d=!0);else if(l[i].format.style.backgroundColor&&e.style.backgroundColor){var p=this.hexToRgb(l[i].format.style.backgroundColor);"rgb("+p.r+", "+p.g+", "+p.b+")"===e.style.backgroundColor&&(d=!0)}if(a){if(d)for(c=0;c<h.length;c++)if(e.classList.contains(h[c])){e.classList.remove(h[c]);break}f={};l[i].cFColor?(e.classList.add("e-"+l[i].cFColor.toLowerCase()),f=this.setFormat(f,l[i])):f=l[i].format.style,this.parent.notify(Ft,{style:f,rowIdx:r,colIdx:n,lastCell:!0,isHeightCheckNeeded:!0,manualUpdate:!0})}else{if(d){for(var c=0;c<h.length;c++)if(e.classList.contains(h[c])){e.classList.remove(h[c]);break}e.removeAttribute("style")}var u=J(r,n,this.parent.getActiveSheet(),null,!0),f=t.extend({},this.parent.commonCellStyle,u.style);this.parent.notify(Ft,{style:f,rowIdx:r,colIdx:n})}},e.prototype.hexToRgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},e.prototype.cFRCheck=function(e,t,r,n,i,a){var o="",s="",l=t.toString();if(e.value){var h=e.value.split(",");if(h.length>1)if(h[0].split("(").length>1){for(var d="",p=0;p<h.length;p++)(d+=h[p]+",").split("(").length===d.split(")").length&&""===o&&(o=d.substring(0,d.length-1),d="");s=d.substring(0,d.length-1)}else{o=h[0];for(p=1;p<h.length;p++)s+=p+1===h.length?h[p]:h[p]+","}else o=e.value}var c=!1,u=e.type;"BlueDataBarGreenDataBarRedDataBarOrangeDataBarLightBlueDataBarPurpleDataBar".includes(u)&&(u="DataBar"),"GYRColorScaleRYGColorScaleGWRColorScaleRWGColorScaleBWRColorScaleRWBColorScaleWRColorScaleRWColorScaleGWColorScaleWGColorScaleGYColorScaleYGColorScale".includes(u)&&(u="ColorScale"),"ThreeArrowsThreeArrowsGrayFourArrowsGrayFourArrowsFiveArrowsGrayFiveArrowsThreeTrafficLights1ThreeTrafficLights2ThreeSignsFourTrafficLightsFourRedToBlackThreeSymbolsThreeSymbols2ThreeFlagsFourRatingFiveQuartersFiveRatingThreeTrianglesThreeStarsFiveBoxes".includes(u)&&(u="IconSet");var f={};switch(u){case"GreaterThan":c=this.isGreaterThanLessThan(e,l,o,!0);break;case"LessThan":c=this.isGreaterThanLessThan(e,l,o,!1);break;case"Between":c=this.isBetWeen(e,l,o,s);break;case"EqualTo":c=this.isEqualTo(e,l,o);break;case"ContainsText":c=this.isContainsText(l,o);break;case"DateOccur":f={value:o,rowIndex:0,colIndex:0,sheetIndex:0,updatedVal:""},this.parent.notify(Nt,f),l===f.updatedVal&&(c=!0);break;case"Unique":case"Duplicate":c=this.isDuplicateUnique(l,e);break;case"Top10Items":c=this.isTopBottomTenValue(l,o,e,!0);break;case"Bottom10Items":c=this.isTopBottomTenValue(l,o,e,!1);break;case"Top10Percentage":c=this.isTopBottomTenPercentage(l,o,e,!0);break;case"Bottom10Percentage":c=this.isTopBottomTenPercentage(l,o,e,!1);break;case"AboveAverage":c=this.isAboveBelowAverage(l,o,e,!0);break;case"BelowAverage":c=this.isAboveBelowAverage(l,o,e,!1);break;case"DataBar":case"ColorScale":case"IconSet":this.isDataBarColorScalesIconSets(u,l,e,r,n,i,a)}return c},e.prototype.isDataBarColorScalesIconSets=function(e,t,r,n,i,a,o){var s=this.parent.getActiveSheet();if(o)"DataBar"===e?this.applyDataBars(t,r,n,i,a):"ColorScale"===e?this.applyColorScale(t,r,n,i,a):this.applyIconSet(t,r,n,i,a);else{n=null;for(var l=r.range.split(","),h=0;h<l.length;h++)for(var d=c(l[h]),p=d[0];p<=d[2];p++)for(var u=d[1];u<=d[3];u++)if(J(p,u,s)){var f=J(p,u,s).value;n=this.parent.getCell(p,u),"DataBar"===e?this.applyDataBars(f,r,n,p,u):"ColorScale"===e?this.applyColorScale(f,r,n,p,u):this.applyIconSet(f,r,n,p,u)}}},e.prototype.applyIconSet=function(e,r,n,i,a){var o=parseInt(e,10),s=this.getIconList(r.type).split(","),l=[],h=this.parent.getActiveSheet(),d=h.rows[i]&&h.rows[i].cells[a]?h.rows[i].cells[a]:null;if(d){for(var p=n||this.parent.getMainContent().getElementsByClassName("e-row")[i].getElementsByClassName("e-cell")[a],u=r.range.split(","),f=0;f<u.length;f++){var g=c(u[f]);l=this.getNumericArray(g,l)}var m,v=(l=l.sort(function(e,t){return e-t}))[0],y=l[l.length-1];if(3===s.length){var C=v+.33*(y-v);m="e-"+(o>=v+.67*(y-v)?s[0].trim():o>=C?s[1].trim():s[2].trim())}else if(4===s.length){var b=v+.25*(y-v),x=v+.5*(y-v);m="e-"+(o>=(S=v+.75*(y-v))?s[0].trim():o>=x?s[1].trim():o>=b?s[2].trim():s[3].trim())}else if(5===s.length){var b=v+.2*(y-v),x=v+.4*(y-v),S=v+.6*(y-v);m="e-"+(o>=v+.8*(y-v)?s[0].trim():o>=S?s[1].trim():o>=x?s[2].trim():o>=b?s[3].trim():s[4].trim())}if(!t.isNullOrUndefined(d)){var w=this.parent.createElement("span",{className:"e-icon"});w.classList.add("e-iconsetspan"),w.classList.add(m),this.applyIconSetIcon({rowIndex:i,colIndex:a},w,p)}}},e.prototype.applyIconSetIcon=function(e,t,r){var n=this.parent.getActiveSheet(),i=J(e.rowIndex,e.colIndex,n).value,a=r;a.classList.contains("e-iconset")&&a.querySelector(".e-iconsetspan")&&a.removeChild(a.querySelector(".e-iconsetspan")),L(i)&&(a.insertBefore(t,a.childNodes[0]),a.classList.add("e-iconset"))},e.prototype.getIconList=function(e){switch(e){case"ThreeArrows":return"3arrows-1,3arrows-2,3arrows-3";case"ThreeArrowsGray":return"3arrowsgray-1,3arrowsgray-2,3arrowsgray-3";case"FourArrowsGray":return"4arrowsgray-1,4arrowsgray-2,4arrowsgray-3,4arrowsgray-4";case"FourArrows":return"4arrows-1,4arrows-2,4arrows-3,4arrows-4";case"FiveArrowsGray":return"5arrowsgray-1,5arrowsgray-2,5arrowsgray-3,5arrowsgray-4,5arrowsgray-5";case"FiveArrows":return"5arrows-1,5arrows-2,5arrows-3,5arrows-4,5arrows-5";case"ThreeTrafficLights1":return"3trafficlights-1,3trafficlights-2,3trafficlights-3";case"ThreeTrafficLights2":return"3rafficlights2-1,3rafficlights2-2,3rafficlights2-3";case"ThreeSigns":return"3signs-1,3signs-2,3signs-3";case"FourTrafficLights":return"4trafficlights-1,4trafficlights-2,4trafficlights-3,4trafficlights-4";case"FourRedToBlack":return"4redtoblack-1,4redtoblack-2,4redtoblack-3,4redtoblack-4";case"ThreeSymbols":return"3symbols-1,3symbols-2,3symbols-3";case"ThreeSymbols2":return"3symbols2-1,3symbols2-2,3symbols2-3";case"ThreeFlags":return"3flags-1,3flags-2,3flags-3";case"FourRating":return"4rating-1,4rating-2,4rating-3,4rating-4";case"FiveQuarters":return"5quarters-1,5quarters-2,5quarters-3,5quarters-4,5quarters-5";case"FiveRating":return"5rating-1,5rating-2,5rating-3,5rating-4,5rating-5";case"ThreeTriangles":return"3triangles-1,3triangles-2,3triangles-3";case"ThreeStars":return"3stars-1,3stars-2,3stars-3";case"FiveBoxes":return"5boxes-1,5boxes-2,5boxes-3,5boxes-4,5boxes-5"}return"3arrows-1,3arrows-2,3arrows-3"},e.prototype.applyColorScale=function(e,r,n,i,a){var o,s=this.parent.getActiveSheet(),l=parseInt(e,10),h=[],d=this.getColor(r.type),p=s.rows[i]&&s.rows[i].cells[a]?s.rows[i].cells[a]:null;if(p){for(var u=r.range.split(","),f=n||this.parent.getMainContent().getElementsByClassName("e-row")[i].getElementsByClassName("e-cell")[a],g=0;g<u.length;g++){var m=c(u[g]);h=this.getNumericArray(m,h)}h=h.sort(function(e,t){return e-t}).reverse();for(var v=0;v<h.length;v++)if(h[v]===l){o=v;break}var y=0===o?d[0]:o===h.length-1?d[d.length-1]:3===h.length&&1===o?d[1]:this.getGradient(o,d[0],d[1],d[2],h.length);if(!t.isNullOrUndefined(p)){var C={};t.isNullOrUndefined(o)?(C=this.parent.getCellStyleValue(["backgroundColor"],[i,a]),f.style.backgroundColor=C.backgroundColor):(C={backgroundColor:y},f.style.backgroundColor=y)}}},e.prototype.applyDataBars=function(e,r,n,i,a){var o=this.parent.getActiveSheet(),s={},l={},h="",d="",p=r.type,u=o.rows[i].cells&&o.rows[i].cells[a]?o.rows[i].cells[a]:null;if(u){for(var f,g=[],m=this.parent.getMainContent().getElementsByClassName("e-row")[i],v=n||this.parent.getMainContent().getElementsByClassName("e-row")[i].getElementsByClassName("e-cell")[a],y=m&&m.style?parseInt(m.style.height,10):20,C=[],b=[],x=0,S=parseInt(e,10),w=r.range.split(","),I=0;I<w.length;I++){var E=c(w[I]);g=this.getNumericArray(E,g)}for(var R=0;R<g.length;R++)for(var k=0;k<g.length;k++)g[k]>0?C.push(g[k]):b.push(g[k]);if(p="BlueDataBar"===p?"B":"GreenDataBar"===p?"G":"RedDataBar"===p?"R":"OrangeDataBar"===p?"O":"LightBlueDataBar"===p?"LB":"PurpleDataBar"===p?"P":"",h=this.getColor(p)[0],d=this.getColor("R")[0],C=C.sort(function(e,t){return e-t}).reverse(),(b=b.sort(function(e,t){return e-t})).length&&C.length)f=C[0]+Math.abs(b[0]),x=Math.abs(b[0]/f*100);else{if(!b.length&&!C.length)return;f=b.length?b[0]:C[0]}if(v&&(t.isNullOrUndefined(S)||""===e)&&v.getElementsByClassName("e-cf-databar")[0]&&v.removeChild(v.getElementsByClassName("e-cf-databar")[0]),L(S)){var A=this.parent.createElement("div",{id:"spreadsheet-databar",className:"e-cf-databar"}),T=this.parent.createElement("span",{id:"spreadsheet-leftspan",className:"e-databar"}),F=this.parent.createElement("span",{id:"spreadsheet-rightspan",className:"e-databar"}),N=this.parent.createElement("span",{id:"spreadsheet-dataspan",className:"e-databar-value"}),D=void 0;s=T.style,l=F.style,A.appendChild(N),A.insertBefore(F,N),A.insertBefore(T,F),v.querySelector(".e-iconsetspan")&&(D=v.querySelector(".e-iconsetspan")),v.textContent="",v.appendChild(A),D&&v.insertBefore(D,v.firstElementChild),N.innerHTML=this.parent.getDisplayText(u),A.style.height=y-1+"px",N.style.fontSize="11pt",b.length?C.length?S>-1?(s.width=x+"%",s.height=y-3+"px",s.backgroundColor="transparent",s.left="0px",l.width=Math.ceil(Math.abs(S/f*100))+"%",l.height=y-3+"px",l.backgroundColor=p=h,l.left=x+"%"):S<0&&(s.width=Math.ceil(Math.abs(S/f*100))+"%",s.height=y-3+"px",s.backgroundColor=d,s.width===x+"%"?s.left="0px":s.right=100-x+"%"):(l.width=Math.ceil(Math.abs(S/f*100))+"%",l.height=y-3+"px",l.backgroundColor=p=d,l.left="0px"):(l.width=Math.ceil(Math.abs(S/f*100))+"%",l.height=y-3+"px",l.backgroundColor=p=h,l.left="0px")}}},e.prototype.getNumericArray=function(e,r){for(var n=this.parent.getActiveSheet(),i=e[0];i<=e[2];i++)for(var a=e[1];a<=e[3];a++){var o=J(i,a,n)&&J(i,a,n).value?J(i,a,n).value:"";if(t.isNullOrUndefined(o)||L(o)||F(o)){var s=parseInt(o,10);t.isNullOrUndefined(o)||""===o||r.push(s)}}return r},e.prototype.getColor=function(e){if("LB"===e)return["#008aef"];for(var t=e.split(""),r=[],n=0;n<t.length;n++)switch(t[n]){case"G":r.push("#63be7b");break;case"Y":r.push("#ffeb84");break;case"R":r.push("#f8696b");break;case"W":r.push("#ffffff");break;case"B":r.push("#5a8ac6");break;case"O":r.push("#ffb628");break;case"LB":r.push("#008aef");break;case"P":r.push("#d6007b")}return r},e.prototype.getGradient=function(e,r,n,i,a){if(t.isNullOrUndefined(i))return this.getLinear(r,n,e/a);var o=a/2;return e>=o?this.getLinear(n,i,Math.abs((e-o)/o)):this.getLinear(r,n,e/o)},e.prototype.getLinear=function(e,t,r){return"#"+this.byteLinear(e[1]+e[2],t[1]+t[2],r)+this.byteLinear(e[3]+e[4],t[3]+t[4],r)+this.byteLinear(e[5]+e[6],t[5]+t[6],r)},e.prototype.byteLinear=function(e,t,r){var n=parseInt(e,16)*(1-r)+parseInt(t,16)*r|0;return Math.abs(n).toString(16)},e.prototype.isGreaterThanLessThan=function(e,t,r,n){var i=new RegExp(/[^.-a-zA-Z 0-9]+/g),a=!1;if(L(t))if(L(r))a=n?parseFloat(t)>parseFloat(r.replace(i,"")):parseFloat(t)<parseFloat(r.replace(i,""));else{var o={value:r,rowIndex:0,colIndex:0,sheetIndex:0,isDate:!1,updatedVal:"",isTime:!1};this.parent.notify(Nt,o),o.isDate||o.isTime?(a=n?t>o.updatedVal:t<o.updatedVal,e.value=o.updatedVal.toString()):a=n?t.toLowerCase()>r.toLowerCase():t.toLowerCase()<r.toLowerCase()}else""!==t||n||(a=!0);return a},e.prototype.isBetWeen=function(e,t,r,n){var i=new RegExp(/[^.-a-zA-Z 0-9]+/g),a=!1;if(r=r.replace(i,""),n=n.replace(i,""),L(t))if(L(r))a=parseFloat(t)>=parseFloat(r)&&parseFloat(t)<=parseFloat(n);else if(r&&n){var o={value:r,rowIndex:0,colIndex:0,sheetIndex:0,isDate:!1,updatedVal:"",isTime:!1},s={value:n,rowIndex:0,colIndex:0,sheetIndex:0,isDate:!1,updatedVal:"",isTime:!1};this.parent.notify(Nt,o),this.parent.notify(Nt,s),(o.isDate||o.isTime)&&(s.isDate||s.isTime)?(a=t>=o.updatedVal&&t<=s.updatedVal,e.value=o.updatedVal.toString()+","+s.updatedVal.toString()):a=t.toLowerCase()>=r.toLowerCase()&&t.toLowerCase()<=n.toLowerCase()}return a},e.prototype.isEqualTo=function(e,t,r){var n=new RegExp(/[^.-a-zA-Z 0-9]+/g),i=!1;if(L(t))if(L(r))i=parseFloat(t)===parseFloat(r.replace(n,""));else{var a={value:r,rowIndex:0,colIndex:0,sheetIndex:0,isDate:!1,updatedVal:"",isTime:!1};this.parent.notify(Nt,a),a.isTime||a.isDate?(i=t===a.updatedVal,e.value=a.updatedVal.toString()):i=t.toLowerCase()===r.toLowerCase()}return i},e.prototype.isContainsText=function(e,r){var n=new RegExp(/[^.-a-zA-Z 0-9]+/g),i=!1;return t.isNullOrUndefined(e)||!e.length?i=!1:L(r.replace(n,""))?(r=r.replace(n,""),F(e)&&(e=T(e).toString()),i=e.indexOf(r)>-1):F(r)?(F(e)&&(e=T(e).toString()),i=e.indexOf(T(r).toString())>-1):i=e.toLowerCase().indexOf(r.toLowerCase())>-1,i},e.prototype.isTopBottomTenValue=function(e,t,r,n){var i=this.parent.getActiveSheet(),a=new RegExp(/[^.-a-zA-Z 0-9]+/g),o=parseInt(e,10),s=parseInt(t,10),l=!1;if(L(t)){L(e)?(o=parseFloat(e),s=parseFloat(t.replace(a,""))):F(e)&&(o=T(e),s=parseFloat(t));for(var h=[],d=void 0,p=r.range.split(","),u=0;u<p.length;u++)for(var f=c(p[u]),g=f[0];g<=f[2];g++)for(var m=f[1];m<=f[3];m++)(d=J(g,m,i)&&J(g,m,i).value?J(g,m,i).value:"")&&L(d)&&(d=parseFloat(d),h.push(d));l=(h=(h=n?h.sort(function(e,t){return e-t}).reverse():h.sort(function(e,t){return e-t})).slice(0,s)).indexOf(o)>-1}return l},e.prototype.isTopBottomTenPercentage=function(e,t,r,n){var i=this.parent.getActiveSheet(),a=new RegExp(/[^.-a-zA-Z 0-9]+/g),o=parseInt(e,10),s=parseInt(t,10),l=!1;if(L(t)){L(e)?(o=parseFloat(e),s=parseFloat(t.replace(a,""))):F(e)&&(o=T(e),s=parseFloat(t));for(var h=[],d=void 0,p=0,u=void 0,f=r.range.split(","),g=0;g<f.length;g++)for(var m=c(f[g]),v=m[0];v<=m[2];v++)for(var y=m[1];y<=m[3];y++)(d=J(v,y,i)&&J(v,y,i).value?J(v,y,i).value:"")&&L(d)&&(d=parseFloat(d),h.push(d)),p++;u=s/(100/p),u=Math.ceil(u),l=(h=(h=n?h.sort(function(e,t){return e-t}).reverse():h.sort(function(e,t){return e-t})).slice(0,u||1)).indexOf(o)>-1}return l},e.prototype.isAboveBelowAverage=function(e,t,r,n){for(var i,a=this.parent.getActiveSheet(),o=parseFloat(e),s=r.range.split(","),l=[],h=0,d=0;d<s.length;d++)for(var p=c(s[d]),u=p[0];u<=p[2];u++)for(var f=p[1];f<=p[3];f++)(i=J(u,f,a)&&J(u,f,a).value?J(u,f,a).value:"")&&L(i)&&(i=parseFloat(i),l.push(i));for(var g=0;g<l.length;g++)h+=l[g];return h/=l.length,n?o>h:o<h},e.prototype.isDuplicateUnique=function(e,r){var n,i=r.type,a=0,o=this.parent.getActiveSheet(),s=e,l=r.range.split(",");if(t.isNullOrUndefined(s)||""===s)return!1;for(var h=0;h<l.length;h++)for(var d=c(l[h]),p=d[0];p<=d[2];p++)for(var u=d[1];u<=d[3];u++)if((n=J(p,u,o)&&J(p,u,o).value?J(p,u,o).value.toString():"")&&""!==n&&2===(a=s.toLowerCase()===n.toLowerCase()?a+1:a))return"Duplicate"===i;return"Duplicate"!==i},e.prototype.setFormat=function(e,t){switch(t.cFColor){case"RedFT":e.backgroundColor="#ffc7ce",e.color="#9c0055";break;case"YellowFT":e.backgroundColor="#ffeb9c",e.color="#9c6500";break;case"GreenFT":e.backgroundColor="#c6efce",e.color="#006100";break;case"RedF":e.backgroundColor="#ffc7ce";break;case"RedT":e.color="#9c0055"}return e},e.prototype.getModuleName=function(){return"conditionalFormatting"},e}(),hi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),di=function(){return(di=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},pi=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},ci=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return hi(r,e),pi([t.Property("")],r.prototype,"text",void 0),pi([t.Property("")],r.prototype,"iconCss",void 0),pi([t.Property("left")],r.prototype,"iconPosition",void 0),r}(t.ChildProperty),ui=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return hi(r,e),pi([t.Complex({},ci)],r.prototype,"header",void 0),pi([t.Collection([],n.Item)],r.prototype,"content",void 0),pi([t.Property("")],r.prototype,"cssClass",void 0),pi([t.Property(!1)],r.prototype,"disabled",void 0),r}(t.ChildProperty),fi=function(e){function r(t,r){return e.call(this,t)||this}return hi(r,e),r.prototype.preRender=function(){},r.prototype.render=function(){this.element.id||(this.element.id=t.getUniqueID("ribbon")),this.renderRibbon()},r.prototype.destroy=function(){var r=this.element.querySelector(".e-drop-icon");if(r&&r.removeEventListener("click",this.ribbonExpandCollapse.bind(this)),this.menuItems.length){var n=document.getElementById(this.element.id+"_menu");n&&t.getComponent(n,"menu").destroy()}this.toolbarObj.destroy(),this.tabObj.destroy(),this.element.innerHTML="",this.toolbarObj=null,this.tabObj=null,e.prototype.destroy.call(this)},r.prototype.getTabItems=function(){var e=this,t=[];return this.menuItems.length&&t.push({header:{text:this.initMenu(this.menuItems)},content:this.toolbarObj.element,cssClass:"e-menu-tab"}),this.items.forEach(function(r){t.push({header:r.header,content:e.toolbarObj.element})}),t},r.prototype.initMenu=function(e){var r=this,i=this.createElement("ul",{id:this.element.id+"_menu"});this.element.appendChild(i);var a=new n.Menu({cssClass:"e-file-menu",items:e,showItemOnClick:!0,beforeOpen:function(t){t.parentItem.text===e[0].text&&(a.showItemOnClick=!1),r.trigger("beforeOpen",t)},select:function(e){r.trigger("fileMenuItemSelect",e)},beforeClose:function(n){if("mouseover"===n.event.type&&!t.closest(n.event.target,".e-menu-popup"))return void(n.cancel=!0);r.trigger("beforeClose",n),n.parentItem&&n.parentItem.text!==e[0].text||requestAnimationFrame(function(){return a.setProperties({showItemOnClick:!0},!0)})},beforeItemRender:function(e){r.trigger("beforeFileMenuItemRender",e)}});return a.createElement=this.createElement,a.appendTo(i),i.parentElement},r.prototype.renderRibbon=function(){var e=this,r=this.createElement("div"),i=this.createElement("div");this.toolbarObj=new n.Toolbar({items:this.items[this.selectedTab].content,clicked:function(t){return e.trigger("clicked",t)}}),this.toolbarObj.createElement=this.createElement,this.toolbarObj.appendTo(i),this.tabObj=new n.Tab({selectedItem:this.getIndex(this.selectedTab),animation:{next:{duration:0},previous:{duration:0}},items:this.getTabItems(),selecting:function(r){if(e.menuItems.length&&0===r.selectingIndex)r.cancel=!0;else{if(r.selectingIndex===e.getIndex(e.selectedTab))return;e.updateToolbar(e.getIndex(r.selectingIndex,!0)),e.toolbarObj.dataBind(),e.element.classList.contains("e-collapsed")&&t.EventHandler.remove(r.selectedItem,"click",e.ribbonExpandCollapse);var n=void 0;e.menuItems.length?((n=di({},r)).selectingIndex-=1,n.selectedIndex-=1):n=r,e.trigger("selecting",n)}},selected:function(t){t.selectedIndex!==e.getIndex(e.selectedTab)&&(e.setProperties({selectedTab:e.getIndex(t.selectedIndex,!0)},!0),e.element.classList.contains("e-collapsed")&&(e.element.classList.remove("e-collapsed"),e.trigger("expandCollapse",{element:e.toolbarObj.element,expanded:!0})))},created:function(){e.toolbarObj.refreshOverflow()}}),this.element.appendChild(r),this.tabObj.createElement=this.createElement,this.tabObj.appendTo(r);var a=this.createElement("span",{className:"e-drop-icon e-icons"});a.addEventListener("click",this.ribbonExpandCollapse.bind(this)),this.element.appendChild(a)},r.prototype.ribbonExpandCollapse=function(e){var r,n={element:this.toolbarObj.element,expanded:!0};this.element.classList.contains("e-collapsed")?(r=this.tabObj.element.querySelector(".e-tab-header").getElementsByClassName("e-toolbar-item")[this.tabObj.selectedItem],this.element.classList.remove("e-collapsed"),r.classList.add("e-active"),t.EventHandler.remove(r,"click",this.ribbonExpandCollapse),this.trigger("expandCollapse",n)):(r=this.tabObj.element.querySelector(".e-tab-header .e-toolbar-item.e-active"),this.element.classList.add("e-collapsed"),n.expanded=!1,r.classList.remove("e-active"),t.EventHandler.add(r,"click",this.ribbonExpandCollapse,this),this.trigger("expandCollapse",n))},r.prototype.getIndex=function(e,t){return this.menuItems.length?t?e-1:e+1:e},r.prototype.updateToolbar=function(e){this.toolbarObj.items=this.items[e].content,this.toolbarObj.dataBind()},r.prototype.enableMenuItems=function(e,r,n){void 0===r&&(r=!0),this.menuItems.length&&t.getComponent(document.getElementById(this.element.id+"_menu"),"menu").enableItems(e,r,n)},r.prototype.hideMenuItems=function(e,r,n){if(void 0===r&&(r=!0),this.menuItems.length){var i=t.getComponent(document.getElementById(this.element.id+"_menu"),"menu");r?i.hideItems(e,n):i.showItems(e,n)}},r.prototype.addMenuItems=function(e,r,n,i){if(void 0===n&&(n=!0),this.menuItems.length){var a=t.getComponent(document.getElementById(this.element.id+"_menu"),"menu");n?a.insertAfter(e.reverse(),r,i):a.insertBefore(e,r,i)}},r.prototype.hideTabs=function(e,t){var r=this;void 0===t&&(t=!0);var n,i,a,o;if(t||(o=this.isAllHidden()),e.forEach(function(e){(n=r.getTabIndex(e,-1))>-1&&(t?r.items[n].cssClass.includes(" e-hide")||(r.items[n].cssClass=r.items[n].cssClass+" e-hide",r.tabObj.items[r.getIndex(n)].cssClass=r.items[n].cssClass,void 0===i&&n===r.selectedTab&&(i=!0),a=!0):r.items[n].cssClass.includes(" e-hide")&&(r.items[n].cssClass=r.items[n].cssClass.replace(" e-hide",""),r.tabObj.items[r.getIndex(n)].cssClass=r.items[n].cssClass,void 0===i&&n===r.selectedTab&&(i=!0),a=!0))}),this.setProperties({items:this.items},!0),this.tabObj.items=this.tabObj.items,this.tabObj.dataBind(),t&&(o=this.isAllHidden())&&(i=!1),!t&&o&&(i=!i),a&&o&&(this.element.classList.contains("e-collapsed")?(this.element.classList.remove("e-collapsed"),this.element.querySelector(".e-drop-icon").classList.remove("e-hide")):(this.element.classList.add("e-collapsed"),this.element.querySelector(".e-drop-icon").classList.add("e-hide"))),i)for(var s=0;s<this.items.length;s++)if(!this.items[s].cssClass.includes(" e-hide")){this.tabObj.selectedItem=this.getIndex(s),this.tabObj.dataBind();break}},r.prototype.isAllHidden=function(){for(var e=!0,t=0;t<this.items.length;t++)if(!this.items[t].cssClass.includes(" e-hide")){e=!1;break}return e},r.prototype.enableTabs=function(e,t){var r=this;void 0===t&&(t=!0),e.forEach(function(e){var n=r.getTabIndex(e,-1);n>-1&&(r.items[n].disabled=!t,n=r.getIndex(n),r.tabObj.enableTab(n,t))}),this.setProperties({items:this.items},!0)},r.prototype.addTabs=function(e,t){var r=this,n=this.getTabIndex(t);e.forEach(function(e){e=new ui(r.items[0],"items",e,!0),r.items.splice(n,0,e),r.tabObj.addTab([{header:e.header,content:r.toolbarObj.element}],r.getIndex(n)),n++}),this.setProperties({items:this.items},!0),this.setProperties({selectedTab:this.getIndex(this.tabObj.selectedItem,!0)},!0)},r.prototype.getTabIndex=function(e,t){if(void 0===t&&(t=this.items.length),e)for(var r=0;r<this.items.length;r++)if(this.items[r].header.text===e){t=r;break}return t},r.prototype.addToolbarItems=function(e,r,i){var a=this,o=this.getTabIndex(e);t.isNullOrUndefined(i)&&(i=this.items[o].content.length),r.forEach(function(e){e=new n.Item(a.items[o].content[0],"content",e,!0),a.items[o].content.splice(i,0,e),i++}),this.setProperties({items:this.items},!0),o===this.selectedTab&&r.length&&this.updateToolbar(o)},r.prototype.enableItems=function(e,t,r){if(void 0===r&&(r=!0),t){var n=this.getTabIndex(e,-1);if(n<0)return;for(var i=0;i<t.length;i++){if("string"==typeof t[i])for(var a=0;a<this.items[n].content.length;a++)if(this.items[n].content[a].id===t[i]){t[i]=a;break}if("string"==typeof t[i])return;this.items[n].content[t[i]].disabled=!r,n!==this.selectedTab&&this.setProperties({items:this.items},!0)}n===this.selectedTab&&this.updateToolbar(n)}else this.toolbarObj.disable(!r)},r.prototype.hideToolbarItems=function(e,t,r){var n=this;void 0===r&&(r=!0);for(var i,a=0;a<this.items.length;a++)if(this.items[a].header.text===e){i=a,t.forEach(function(e){n.items[i].content[e]&&(r?n.items[i].content[e].cssClass.includes(" e-hide")||(n.items[i].content[e].cssClass=n.items[i].content[e].cssClass+" e-hide"):n.items[i].content[e].cssClass.includes(" e-hide")&&(n.items[i].content[e].cssClass=n.items[i].content[e].cssClass.replace(" e-hide","")))});break}this.setProperties({items:this.items},!0),void 0!==i&&i===this.selectedTab&&this.updateToolbar(i)},r.prototype.getModuleName=function(){return"ribbon"},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.onPropertyChanged=function(e,t){for(var r=0,n=Object.keys(e);r<n.length;r++)switch(n[r]){case"selectedTab":this.tabObj.selectedItem=this.getIndex(e.selectedTab),this.tabObj.dataBind()}},pi([t.Property("")],r.prototype,"cssClass",void 0),pi([t.Property(!0)],r.prototype,"menuType",void 0),pi([t.Collection([],n.MenuItem)],r.prototype,"menuItems",void 0),pi([t.Property(0)],r.prototype,"selectedTab",void 0),pi([t.Collection([],ui)],r.prototype,"items",void 0),pi([t.Event()],r.prototype,"selecting",void 0),pi([t.Event()],r.prototype,"fileMenuItemSelect",void 0),pi([t.Event()],r.prototype,"beforeFileMenuItemRender",void 0),pi([t.Event()],r.prototype,"beforeOpen",void 0),pi([t.Event()],r.prototype,"beforeClose",void 0),pi([t.Event()],r.prototype,"selectFormat",void 0),pi([t.Event()],r.prototype,"clicked",void 0),pi([t.Event()],r.prototype,"created",void 0),pi([t.Event()],r.prototype,"expandCollapse",void 0),r=pi([t.NotifyPropertyChanges],r)}(t.Component),gi=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.render=function(){var e=this,r=this.parent.element.id,n=this.parent.createElement("input",{attrs:{type:"color"}});this.fontColorPicker=new i.ColorPicker({value:"#000000ff",mode:"Palette",showButtons:!1,presetColors:Pi,enableOpacity:!1,beforeClose:function(){return e.beforeCloseHandler(e.fontColorPicker)},open:this.openHandler.bind(this),beforeModeSwitch:function(t){return e.beforeModeSwitch(e.fontColorPicker,t)},change:function(t){var r={style:{color:e.fontColorPicker.getValue(t.currentValue.rgba)},onActionUpdate:!0};e.parent.notify(Tt,r),r.cancel?e.fontColorPicker.setProperties({value:e.fontColorPicker.getValue(t.previousValue.rgba,"HEXA")},!0):e.updateSelectedColor(r.style.color,e.fontColorPicker.element),Et(e.parent.element)},created:function(){return e.wireFocusEvent(e.fontColorPicker.element,"#000000")}}),this.fontColorPicker.createElement=this.parent.createElement,this.parent.element.appendChild(n),this.fontColorPicker.appendTo(n),n.parentElement.id=r+"_font_color_picker",t.addClass([n.nextElementSibling.getElementsByClassName("e-selected-color")[0]],["e-icons","e-font-color"]),n=this.parent.createElement("input",{attrs:{type:"color"}}),this.filColorPicker=new i.ColorPicker({value:"#ffff00ff",mode:"Palette",presetColors:_i,showButtons:!1,enableOpacity:!1,open:this.openHandler.bind(this),beforeClose:function(){return e.beforeCloseHandler(e.filColorPicker)},beforeModeSwitch:function(t){return e.beforeModeSwitch(e.filColorPicker,t)},change:function(t){var r={style:{backgroundColor:e.filColorPicker.getValue(t.currentValue.rgba)},onActionUpdate:!0};e.parent.notify(Tt,r),r.cancel?e.filColorPicker.setProperties({value:e.filColorPicker.getValue(t.previousValue.rgba,"HEXA")},!0):e.updateSelectedColor(r.style.backgroundColor,e.filColorPicker.element),Et(e.parent.element)},created:function(){return e.wireFocusEvent(e.filColorPicker.element,"#ffff00")}}),this.filColorPicker.createElement=this.parent.createElement,this.parent.element.appendChild(n),this.filColorPicker.appendTo(n),n.parentElement.id=r+"_fill_color_picker",t.addClass([n.nextElementSibling.getElementsByClassName("e-selected-color")[0]],["e-icons","e-fill-color"])},e.prototype.updateSelectedColor=function(e,t){t.nextElementSibling.querySelector(".e-selected-color").style.borderBottomColor=e},e.prototype.wireFocusEvent=function(e,t){var r=this;this.updateSelectedColor(t,e),(e=e.parentElement.querySelector(".e-split-colorpicker")).addEventListener("focus",function(){Et(r.parent.element)})},e.prototype.openHandler=function(e){e.element.querySelector(".e-mode-switch-btn").title=this.parent.serviceLocator.getService(Hi).getConstant("MoreColors")},e.prototype.beforeCloseHandler=function(e){e.modeSwitcher||e.setProperties({modeSwitcher:!0},!0),e.showButtons&&e.setProperties({showButtons:!1},!0)},e.prototype.beforeModeSwitch=function(e,t){var r=this.parent.serviceLocator.getService(Hi);"Picker"===t.mode?(e.showButtons=!0,e.dataBind(),t.element.querySelector(".e-apply").title=r.getConstant("Apply"),t.element.querySelector(".e-cancel").title=r.getConstant("Cancel"),t.element.querySelector(".e-mode-switch-btn").title=r.getConstant("StandardColors")):(e.showButtons=!1,e.dataBind(),t.element.querySelector(".e-mode-switch-btn").title=r.getConstant("MoreColors"))},e.prototype.destroy=function(){this.parent&&(this.removeEventListener(),this.fontColorPicker.destroy(),this.fontColorPicker=null,this.filColorPicker.destroy(),this.filColorPicker=null,this.parent=null)},e.prototype.addEventListener=function(){this.parent.on("beforeRibbonCreate",this.render,this),this.parent.on("destroyRibbonComponents",this.destroy,this),this.parent.on("spreadsheetDestroyed",this.destroy,this)},e.prototype.removeEventListener=function(){this.parent.off("beforeRibbonCreate",this.render),this.parent.off("destroyRibbonComponents",this.destroy),this.parent.on("spreadsheetDestroyed",this.destroy,this)},e}(),mi=function(){function e(e){this.border="1px solid #000000",this.fontNameIndex=5,this.numPopupWidth=0,this.findValue="",this.preTabIdx=1,this.chartThemeIndex=5,this.parent=e,this.addEventListener(),new gi(e)}return e.prototype.getModuleName=function(){return"ribbon"},e.prototype.initRibbon=function(e){if(!this.parent.showRibbon&&this.ribbon)return void this.destroy();this.parent.notify("beforeRibbonCreate",{}),this.parent.isMobileView()?this.createMobileView():this.createRibbon(e)},e.prototype.getRibbonMenuItems=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.parent.element.id;return[{text:this.parent.isMobileView()?"":e.getConstant("File"),iconCss:this.parent.isMobileView()?"e-icons e-file-menu-icon":null,id:t+"_File",items:[{text:e.getConstant("New"),id:t+"_New",iconCss:"e-new e-icons"},{text:e.getConstant("Open"),id:t+"_Open",iconCss:"e-open e-icons"},{text:e.getConstant("SaveAs"),iconCss:"e-save e-icons",id:t+"_Save_As",items:[{text:e.getConstant("ExcelXlsx"),id:t+"_Xlsx",iconCss:"e-xlsx e-icons"},{text:e.getConstant("ExcelXls"),id:t+"_Xls",iconCss:"e-xls e-icons"},{text:e.getConstant("CSV"),id:t+"_Csv",iconCss:"e-csv e-icons"},{text:e.getConstant("PDF"),id:t+"_Pdf",iconCss:"e-pdf e-icons"}]}]}]},e.prototype.getRibbonItems=function(){var e=this,r=this.parent.element.id,n=this.parent.serviceLocator.getService(Hi),i=[{header:{text:n.getConstant("Home")},content:[{prefixIcon:"e-undo-icon",tooltipText:n.getConstant("Undo")+" (Ctrl+Z)",id:r+"_undo",disabled:!0},{prefixIcon:"e-redo-icon",tooltipText:n.getConstant("Redo")+" (Ctrl+Y)",id:r+"_redo",disabled:!0},{type:"Separator",id:r+"_separator_1"},{prefixIcon:"e-cut-icon",tooltipText:n.getConstant("Cut")+" (Ctrl+X)",id:r+"_cut"},{prefixIcon:"e-copy-icon",tooltipText:n.getConstant("Copy")+" (Ctrl+C)",id:r+"_copy"},{tooltipText:n.getConstant("Paste")+" (Ctrl+V)",template:this.getPasteBtn(r),id:r+"_paste",disabled:!0},{type:"Separator",id:r+"_separator_2"},{template:this.getNumFormatDDB(r),tooltipText:n.getConstant("NumberFormat"),id:r+"_number_format"},{type:"Separator",id:r+"_separator_3"},{template:this.getFontNameDDB(r),tooltipText:n.getConstant("Font"),id:r+"_font_name"},{type:"Separator",id:r+"_separator_4"},{template:this.getFontSizeDDB(r),tooltipText:n.getConstant("FontSize"),id:r+"_font_size"},{type:"Separator",id:r+"_separator_5"},{template:this.getBtn(r,"bold"),tooltipText:n.getConstant("Bold")+" (Ctrl+B)",id:r+"_bold"},{template:this.getBtn(r,"italic"),tooltipText:n.getConstant("Italic")+" (Ctrl+I)",id:r+"_italic"},{template:this.getBtn(r,"line-through"),tooltipText:n.getConstant("Strikethrough")+" (Ctrl+5)",id:r+"_line-through"},{template:this.getBtn(r,"underline"),tooltipText:n.getConstant("Underline")+" (Ctrl+U)",id:r+"_underline"},{template:document.getElementById(r+"_font_color_picker"),tooltipText:n.getConstant("TextColor"),id:r+"_font_color_picker"},{type:"Separator",id:r+"_separator_6"},{template:document.getElementById(r+"_fill_color_picker"),tooltipText:n.getConstant("FillColor"),id:r+"_fill_color_picker"},{template:this.getBordersDBB(r),tooltipText:n.getConstant("Borders"),id:r+"_borders"},{template:this.getMergeSplitBtn(r),tooltipText:n.getConstant("MergeCells"),id:r+"_merge_cells",disabled:!0},{type:"Separator",id:r+"_separator_7"},{template:this.getTextAlignDDB(r),tooltipText:n.getConstant("HorizontalAlignment"),id:r+"_text_align"},{template:this.getVerticalAlignDDB(r),tooltipText:n.getConstant("VerticalAlignment"),id:r+"_vertical_align"},{template:this.getBtn(r,"wrap",!1),tooltipText:""+n.getConstant("WrapText"),id:r+"_wrap"}]},{header:{text:n.getConstant("Insert")},content:[{prefixIcon:"e-hyperlink-icon",text:n.getConstant("Link"),id:r+"_hyperlink",tooltipText:n.getConstant("Link"),click:function(){e.getHyperlinkDlg()}},{prefixIcon:"e-image-icon",text:n.getConstant("Image"),id:r+"_",tooltipText:n.getConstant("Image"),click:function(){t.select("#"+r+"_imageUpload",e.parent.element).click()}}]},{header:{text:n.getConstant("Formulas")},content:[{prefixIcon:"e-insert-function",tooltipText:n.getConstant("InsertFunction"),text:n.getConstant("InsertFunction"),id:r+"_insert_function"}]},{header:{text:n.getConstant("Data")},content:[{prefixIcon:"e-protect-icon",text:n.getConstant("ProtectSheet"),id:r+"_protect",tooltipText:n.getConstant("ProtectSheet")},{prefixIcon:"e-password-protect-icon",text:n.getConstant("ProtectWorkbook"),id:r+"_protectworkbook",tooltipText:n.getConstant("ProtectWorkbook")},{type:"Separator",id:r+"_separator_8"},{template:this.datavalidationDDB(r),tooltipText:n.getConstant("DataValidation"),id:r+"_datavalidation"}]},{header:{text:n.getConstant("View")},content:[{prefixIcon:"e-hide-headers",text:this.getLocaleText("Headers"),id:r+"_headers",tooltipText:this.getLocaleText("Headers")},{type:"Separator",id:r+"_separator_9"},{prefixIcon:"e-hide-gridlines",text:this.getLocaleText("GridLines"),id:r+"_gridlines",tooltipText:this.getLocaleText("GridLines")},{type:"Separator",id:r+"_separator_13"},{prefixIcon:"e-freeze-pane",text:n.getConstant("FreezePanes"),id:r+"_freezepanes",tooltipText:n.getConstant("FreezePanes")},{prefixIcon:"e-freeze-row",text:n.getConstant("FreezeRows"),id:r+"_freezerows",tooltipText:n.getConstant("FreezeRows")},{prefixIcon:"e-freeze-column",text:n.getConstant("FreezeColumns"),id:r+"_freezecolumns",tooltipText:n.getConstant("FreezeColumns")}]}];return this.parent.allowConditionalFormat&&i.find(function(e){return e.header&&e.header.text===n.getConstant("Home")}).content.push({type:"Separator",id:r+"_separator_10"},{template:this.getCFDBB(r),tooltipText:n.getConstant("ConditionalFormatting"),id:r+"_conditionalformatting"}),this.parent.allowChart&&i.find(function(e){return e.header&&e.header.text===n.getConstant("Insert")}).content.push({type:"Separator",id:r+"_separator_11"},{template:this.getChartDDB(r,!0),text:n.getConstant("Chart"),tooltipText:n.getConstant("Chart"),id:r+"_chart"}),this.parent.allowCellFormatting&&i.find(function(e){return e.header&&e.header.text===n.getConstant("Home")}).content.push({type:"Separator",id:r+"_separator_12"},{template:this.getClearDDB(r),tooltipText:n.getConstant("Clear"),id:r+"_clear"}),(this.parent.allowSorting||this.parent.allowFiltering)&&i.find(function(e){return e.header&&e.header.text===n.getConstant("Home")}).content.push({template:this.getSortFilterDDB(r),tooltipText:n.getConstant("SortAndFilter"),id:r+"_sorting"}),this.parent.allowFindAndReplace&&i.find(function(e){return e.header&&e.header.text===n.getConstant("Home")}).content.push({template:this.getFindDDb(r),prefixIcon:"e-tbar-search-icon tb-icons",tooltipText:n.getConstant("FindReplaceTooltip"),id:r+"_find"}),i},e.prototype.getPasteBtn=function(e){var t=this,r=this.parent.element.appendChild(this.parent.createElement("button",{id:e+"_paste"})),n=this.parent.serviceLocator.getService(Hi);return this.pasteSplitBtn=new l.SplitButton({iconCss:"e-icons e-paste-icon",items:[{text:n.getConstant("All"),id:"All"},{text:n.getConstant("Values"),id:"Values"},{text:n.getConstant("Formats"),id:"Formats"}],select:function(e){t.parent.notify(or,{type:e.item.id,isAction:!0,isInternal:!0})},click:function(){t.parent.notify(or,{isAction:!0,isInternal:!0})},close:function(){Et(t.parent.element)}}),this.pasteSplitBtn.createElement=this.parent.createElement,this.pasteSplitBtn.appendTo(r),r.parentElement},e.prototype.getHyperlinkDlg=function(){var e,r=c(this.parent.getActiveSheet().activeCell),n=this.parent.sheets[this.parent.getActiveSheet().id-1].rows[r[0]];t.isNullOrUndefined(n)||(e=n.cells[r[1]]),t.isNullOrUndefined(e)&&Q(r[0],r[1],this.parent.getActiveSheet(),e,!1),e&&e.hyperlink?this.parent.notify("editHyperlink",null):this.parent.notify("initiateHyperlink",null)},e.prototype.passwordProtectDlg=function(){this.parent.password.length>0?this.parent.notify("unProtectWorkbook",null):document.getElementById(this.parent.element.id+"_protectworkbook").classList.contains("e-active")?(document.getElementById(this.parent.element.id+"_protectworkbook").classList.remove("e-active"),this.parent.showSheetTabs&&this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled")):this.parent.notify("protectWorkbook",null)},e.prototype.getLocaleText=function(e,t){var r,n=this.parent.serviceLocator.getService(Hi);return this.parent.getActiveSheet()["show"+e]?(t&&document.getElementById(this.parent.element.id+"_sheet").classList.remove("e-hide-"+e.toLowerCase()),r=n.getConstant("Hide"+e)):(t&&document.getElementById(this.parent.element.id+"_sheet").classList.add("e-hide-"+e.toLowerCase()),r=n.getConstant("Show"+e)),r},e.prototype.getLocaleProtectText=function(e,t){var r,n=this.parent.serviceLocator.getService(Hi);return this.parent.getActiveSheet().isProtected?(t&&this.parent.getMainContent().classList.remove("e-hide-"+e.toLowerCase()),r=n.getConstant("Unprotect"+e)):(t&&this.parent.getMainContent().classList.add("e-hide-"+e.toLowerCase()),r=n.getConstant("Protect"+e)),r},e.prototype.getLocaleProtectWorkbook=function(e,t){var r,n=this.parent.serviceLocator.getService(Hi);return this.parent.isProtected?(t&&this.parent.getMainContent().classList.remove("e-hide-"+e.toLowerCase()),r=n.getConstant(e)):(t&&this.parent.getMainContent().classList.add("e-hide-"+e.toLowerCase()),r=n.getConstant(e)),r},e.prototype.insertDesignChart=function(){var e=this,t=this.parent.serviceLocator.getService(Hi),r=this.ribbon.items.length-1;if(this.preTabIdx=this.ribbon.selectedTab,this.parent.allowChart&&this.ribbon.items[r]&&this.ribbon.items[r].header.text!==t.getConstant("ChartDesign")){var n=this.parent.element.id,i=[{header:{text:t.getConstant("ChartDesign")},content:[{template:this.getAddChartEleDBB(n),tooltipText:t.getConstant("AddChartElement"),id:n+"add_chart_ element_chart"},{type:"Separator"},{prefixIcon:"e-switch-row-column-icon",text:t.getConstant("SwitchRowColumn"),tooltipText:t.getConstant("SwitchRowColumn"),id:n+"switch_row_column_chart",click:function(){e.parent.notify("chartDesignTab",{switchRowColumn:!0})}},{type:"Separator"},{template:this.getChartThemeDDB(n),tooltipText:t.getConstant("ChartTheme"),id:n+"_chart_theme"},{type:"Separator"},{template:this.getChartDDB(n,!1),tooltipText:t.getConstant("ChartType"),id:n+"_chart_type"}]}];this.parent.addRibbonTabs(i),r=this.ribbon.items.length,this.ribbon.tabObj.select(r)}},e.prototype.removeDesignChart=function(){var e=this.parent.serviceLocator.getService(Hi),t=this.ribbon.items.length-1;this.parent.allowChart&&this.ribbon.items[t]&&this.ribbon.items[t].header.text===e.getConstant("ChartDesign")&&(this.ribbon.tabObj.select(this.preTabIdx+1),this.parent.hideRibbonTabs([e.getConstant("ChartDesign")],!0),document.getElementsByClassName("e-addchart-ddb").length>0&&document.getElementsByClassName("e-addchart-ddb")[0].remove(),document.getElementsByClassName("e-chart-type-ddb").length>0&&document.getElementsByClassName("e-chart-type-ddb")[0].remove(),document.getElementsByClassName("e-charttheme-ddb").length>0&&document.getElementsByClassName("e-charttheme-ddb")[0].remove(),delete this.ribbon.items[t].content[0],this.ribbon.items.length=this.ribbon.items.length-1)},e.prototype.createRibbon=function(e){var t=this.parent.createElement("div",{id:this.parent.element.id+"_ribbon"});if(this.ribbon=new fi({selectedTab:0,menuItems:this.getRibbonMenuItems(),items:this.getRibbonItems(),fileMenuItemSelect:this.fileMenuItemSelect.bind(this),beforeOpen:this.fileMenuBeforeOpen.bind(this),beforeClose:this.fileMenuBeforeClose.bind(this),clicked:this.toolbarClicked.bind(this),created:this.ribbonCreated.bind(this),selecting:this.tabSelecting.bind(this),expandCollapse:this.expandCollapseHandler.bind(this),beforeFileMenuItemRender:this.beforeRenderHandler.bind(this)}),this.ribbon.createElement=this.parent.createElement,e&&e.uiUpdate){var r=this.parent.element.querySelector(".e-formula-bar-panel")||document.getElementById(this.parent.element.id+"_sheet_panel");this.parent.element.insertBefore(t,r)}else this.parent.element.appendChild(t);this.ribbon.appendTo(t)},e.prototype.tabSelecting=function(e){e.selectingIndex!==this.ribbon.selectedTab&&(this.refreshRibbonContent(e.selectingIndex),this.parent.notify("tabSwitch",{activeTab:e.selectingIndex}))},e.prototype.beforeRenderHandler=function(e){var t=this.parent.serviceLocator.getService(Hi);e.item.text!==t.getConstant("Open")||this.parent.openUrl&&this.parent.allowOpen||e.element.classList.add("e-disabled"),e.item.text!==t.getConstant("SaveAs")||this.parent.saveUrl&&this.parent.allowSave||e.element.classList.add("e-disabled")},e.prototype.getChartThemeDDB=function(e){var t=this,r=this.parent.createElement("button",{id:e+"_chart_theme"});return r.appendChild(this.parent.createElement("span",{className:"e-tbar-btn-text",innerHTML:"Material"})),this.chartThemeDDB=new l.DropDownButton({items:this.getChartThemeDdbItems(),content:"",select:function(e){return t.chartThemeDDBSelect(e)},close:function(){return t.parent.element.focus()},cssClass:"e-flat e-charttheme-ddb",beforeOpen:function(e){return t.tBarDdbBeforeOpen(e.element,e.items)}}),this.chartThemeDDB.createElement=this.parent.createElement,this.chartThemeDDB.appendTo(r),r},e.prototype.getNumFormatDDB=function(e){var t=this,r=this.parent.createElement("button",{id:e+"_number_format"});return r.appendChild(this.parent.createElement("span",{className:"e-tbar-btn-text",innerHTML:"General"})),this.numFormatDDB=new l.DropDownButton({items:this.getNumFormatDdbItems(e),content:"",select:function(e){return t.numDDBSelect(e)},open:function(e){return t.numDDBOpen(e)},beforeItemRender:function(e){return t.previewNumFormat(e)},close:function(){return Et(t.parent.element)},cssClass:"e-flat e-numformat-ddb",beforeOpen:function(e){return t.tBarDdbBeforeOpen(e.element,e.items)}}),this.numFormatDDB.createElement=this.parent.createElement,this.numFormatDDB.appendTo(r),r},e.prototype.getFontSizeDDB=function(e){var t=this;return this.fontSizeDdb=new l.DropDownButton({cssClass:"e-font-size-ddb",content:"11",items:[{text:"8"},{text:"9"},{text:"10"},{text:"11"},{text:"12"},{text:"14"},{text:"16"},{text:"18"},{text:"20"},{text:"22"},{text:"24"},{text:"26"},{text:"28"},{text:"36"},{text:"48"},{text:"72"}],beforeOpen:function(e){t.tBarDdbBeforeOpen(e.element,e.items),t.refreshSelected(t.fontSizeDdb,e.element,"content","text")},select:function(e){var r={style:{fontSize:e.item.text+"pt"},onActionUpdate:!0};t.parent.notify(Tt,r),r.cancel||(t.fontSizeDdb.content=r.style.fontSize.split("pt")[0],t.fontSizeDdb.dataBind())},close:function(){return Et(t.parent.element)}}),this.fontSizeDdb.createElement=this.parent.createElement,this.fontSizeDdb.appendTo(this.parent.createElement("button",{id:e+"_font_size"})),this.fontSizeDdb.element},e.prototype.getChartDDB=function(e,r){var i=this,a=this.parent.serviceLocator.getService(Hi),o=r?"e-chart-menu":"e-chart-type-menu";this.chartMenu=new n.Menu({cssClass:o,items:[{iconCss:"e-icons e-column",text:a.getConstant("Column"),items:[{id:"column_chart"}]},{iconCss:"e-icons e-bar",text:a.getConstant("Bar"),items:[{id:"bar_chart"}]},{iconCss:"e-icons e-area",text:a.getConstant("Area"),items:[{id:"area_chart"}]},{iconCss:"e-icons e-pie-doughnut",text:a.getConstant("PieAndDoughnut"),items:[{id:"pie_doughnut_chart"}]},{iconCss:"e-icons e-line",text:a.getConstant("Line"),items:[{id:"line_chart"}]},{iconCss:"e-icons e-scatter",text:a.getConstant("Scatter"),items:[{id:"scatter_chart"}]}],orientation:"Vertical",beforeOpen:function(e){e.parentItem.text===a.getConstant("Column")?(e.element.firstChild.appendChild(s),e.element.parentElement.classList.add("e-column-chart")):e.parentItem.text===a.getConstant("Bar")?(e.element.firstChild.appendChild(y),e.element.parentElement.classList.add("e-bar-chart")):e.parentItem.text===a.getConstant("Area")?(e.element.firstChild.appendChild(A),e.element.parentElement.classList.add("e-area-chart")):e.parentItem.text===a.getConstant("Line")?(e.element.firstChild.appendChild(O),e.element.parentElement.classList.add("e-line-chart")):e.parentItem.text===a.getConstant("PieAndDoughnut")?(e.element.firstChild.appendChild(U),e.element.parentElement.classList.add("e-pie-doughnut-chart")):e.parentItem.text===a.getConstant("Radar")?(e.element.firstChild.appendChild(W),e.element.parentElement.classList.add("e-radar-chart")):e.parentItem.text===a.getConstant("Scatter")&&(e.element.firstChild.appendChild($),e.element.parentElement.classList.add("e-scatter-chart"))},select:this.chartSelected.bind(this)}),this.chartMenu.createElement=this.parent.createElement;var s=this.parent.createElement("div",{id:"column_main",className:"e-column-main"}),h=this.parent.createElement("div",{id:"column1_text",className:"e-column1-text",innerHTML:a.getConstant("Column")}),d=this.parent.createElement("div",{id:"column1_cont",className:"e-column1-cont"}),p=this.parent.createElement("div",{id:"column2_cont",className:"e-column2-cont"});s.appendChild(h),s.appendChild(d);var c=this.parent.createElement("span",{id:"clusteredColumn",className:"e-clusteredcolumn e-column-icon e-menu-icon e-icons"}),u=this.parent.createElement("span",{id:"stackedColumn",className:"e-stackedcolumn e-column-icon e-menu-icon e-icons"}),f=this.parent.createElement("span",{id:"stackedColumn100",className:"e-stackedcolumn100 e-column-icon e-menu-icon e-icons"}),g=this.parent.createElement("span",{id:"clusteredColumn3D",className:"e-clusteredColumn3D e-column-icon"}),m=this.parent.createElement("span",{id:"stackedColumn3D",className:"e-stackedColumn3D e-column-icon"}),v=this.parent.createElement("span",{id:"stackedColumn1003D",className:"e-stackedColumn1003D e-column-icon"});c.title=a.getConstant("ClusteredColumn"),u.title=a.getConstant("StackedColumn"),f.title=a.getConstant("StackedColumn100"),v.title=a.getConstant("OrangeDataBar"),m.title=a.getConstant("LightblueDataBar"),g.title=a.getConstant("PurpleDataBar"),d.appendChild(c),d.appendChild(u),d.appendChild(f),p.appendChild(g),p.appendChild(m),p.appendChild(v);var y=this.parent.createElement("div",{id:"bar_main",className:"e-bar-main"}),C=this.parent.createElement("div",{id:"bar1_text",className:"e-bar1-text",innerHTML:a.getConstant("Bar")}),b=this.parent.createElement("div",{id:"bar1_cont",className:"e-bar1-cont"}),x=this.parent.createElement("div",{id:"bar2_cont",className:"e-bar2-cont"});y.appendChild(C),y.appendChild(b);var S=this.parent.createElement("span",{id:"clusteredBar",className:"e-clusteredbar e-bar-icon e-menu-icon e-icons"}),w=this.parent.createElement("span",{id:"stackedBar",className:"e-stackedbar e-bar-icon e-menu-icon e-icons"}),I=this.parent.createElement("span",{id:"stackedBar100",className:"e-stackedbar100 e-bar-icon e-menu-icon e-icons"}),E=this.parent.createElement("span",{id:"clusteredBar3D",className:"e-clusteredBar3D e-bar-icon"}),R=this.parent.createElement("span",{id:"stackedBar3D",className:"e-stackedBar3D e-bar-icon"}),k=this.parent.createElement("span",{id:"stackedBar1003D",className:"e-stackedBar1003D e-bar-icon"});S.title=a.getConstant("ClusteredBar"),w.title=a.getConstant("StackedBar"),I.title=a.getConstant("StackedBar100"),k.title=a.getConstant("OrangeDataBar"),R.title=a.getConstant("LightblueDataBar"),E.title=a.getConstant("PurpleDataBar"),b.appendChild(S),b.appendChild(w),b.appendChild(I),x.appendChild(E),x.appendChild(R),x.appendChild(k);var A=this.parent.createElement("div",{id:"area_main",className:"e-area-main"}),T=this.parent.createElement("div",{id:"area_text",className:"e-area-text",innerHTML:a.getConstant("Area")}),F=this.parent.createElement("div",{id:"area_cont",className:"e-area-cont"});A.appendChild(T),A.appendChild(F);var L=this.parent.createElement("span",{id:"area",className:"e-area e-area-icon e-menu-icon e-icons"}),N=this.parent.createElement("span",{id:"stackedArea",className:"e-stackedarea e-area-icon e-menu-icon e-icons"}),D=this.parent.createElement("span",{id:"stackedArea100",className:"e-stackedarea100 e-area-icon e-menu-icon e-icons"});L.title=a.getConstant("Area"),N.title=a.getConstant("StackedArea"),D.title=a.getConstant("StackedArea100"),F.appendChild(L),F.appendChild(N),F.appendChild(D);var O=this.parent.createElement("div",{id:"line_main",className:"e-line-main"}),H=this.parent.createElement("div",{id:"line_text",className:"e-line-text",innerHTML:a.getConstant("Line")}),B=this.parent.createElement("div",{id:"line_cont",className:"e-line-cont"});O.appendChild(H),O.appendChild(B);var M=this.parent.createElement("span",{id:"line",className:"e-line e-line-icon e-menu-icon e-icons"}),P=this.parent.createElement("span",{id:"stackedLine",className:"e-stackedline e-line-icon e-menu-icon e-icons"}),_=this.parent.createElement("span",{id:"stackedline100",className:"e-stackedline100 e-line-icon e-menu-icon e-icons"});M.title=a.getConstant("Line"),P.title=a.getConstant("StackedLine"),_.title=a.getConstant("StackedLine100"),B.appendChild(M),B.appendChild(P),B.appendChild(_);var U=this.parent.createElement("div",{id:"pie_main",className:"e-pie-main"}),V=this.parent.createElement("div",{id:"pie_text",className:"e-pie-text",innerHTML:a.getConstant("Pie")}),z=this.parent.createElement("div",{id:"pie_cont",className:"e-pie-cont"});U.appendChild(V),U.appendChild(z);var q=this.parent.createElement("span",{id:"pie",className:"e-pie e-pie-icon e-menu-icon e-icons"}),j=this.parent.createElement("span",{id:"doughnut",className:"e-doughnut e-pie-icon e-menu-icon e-icons"});q.title=a.getConstant("Pie"),j.title=a.getConstant("Doughnut"),z.appendChild(q),z.appendChild(j);var W=this.parent.createElement("div",{id:"radar_main",className:"e-radar-main"}),G=this.parent.createElement("div",{id:"radar_text",className:"e-radar-text",innerHTML:"Radar"}),Y=this.parent.createElement("div",{id:"radar_cont",className:"e-radar-cont"});W.appendChild(G),W.appendChild(Y);var X=this.parent.createElement("span",{id:"radar",className:"e-radar e-radar-icon e-menu-icon e-icons"}),K=this.parent.createElement("span",{id:"radar_markers",className:"e-radar-markers e-radar-icon e-menu-icon e-icons"});X.title=a.getConstant("BlueDataBar"),K.title=a.getConstant("GreenDataBar"),Y.appendChild(X),Y.appendChild(K);var $=this.parent.createElement("div",{id:"scatter_main",className:"e-scatter-main"}),Z=this.parent.createElement("div",{id:"scatter_text",className:"e-scatter-text",innerHTML:a.getConstant("Scatter")}),J=this.parent.createElement("div",{id:"scatter_cont",className:"e-scatter-cont"});$.appendChild(Z),$.appendChild(J);var Q=this.parent.createElement("span",{id:"scatter",className:"e-scatter e-scatter-icon e-menu-icon e-icons"});Q.title=a.getConstant("Scatter"),J.appendChild(Q);var ee=r?"_chart_menu":"_chart_type_menu",te=this.parent.element.appendChild(this.parent.createElement("ul",{id:e+ee,styles:"display: none;"}));this.chartMenu.appendTo(te),te.classList.add("e-ul");var re=r?"e-chart-icon":"e-chart-type-icon",ne=r?"e-chart-ddb":"e-chart-type-ddb",ie=r?e+"_chart-btn":e+"_chart-type-btn";this.chartDdb=new l.DropDownButton({iconCss:"e-icons "+re,cssClass:ne,target:this.chartMenu.element.parentElement,created:function(){i.chartMenu.element.style.display=""},beforeClose:function(e){e.event&&t.closest(e.event.target,"."+ne)&&t.closest(e.event.target,"."+ne).id!==ie&&(e.cancel=!0)},close:function(){return Et(i.parent.element)}}),this.chartDdb.createElement=this.parent.createElement;var ae;return r?(ae=this.parent.createElement("button",{id:ie})).appendChild(this.parent.createElement("span",{id:e+"_chart",innerHTML:a.getConstant("Chart")})):(ae=this.parent.createElement("button",{id:ie})).appendChild(this.parent.createElement("span",{id:e+"_chart_type",innerHTML:a.getConstant("ChartType")})),this.chartDdb.appendTo(ae),this.chartDdb.element},e.prototype.getAddChartEleDBB=function(e){var r=this,i=this.parent.serviceLocator.getService(Hi);this.addChartMenu=new n.Menu({cssClass:"e-addchart-menu",title:i.getConstant("AddChartElement"),items:[{iconCss:"e-icons e-axes",text:i.getConstant("Axes"),items:[{iconCss:"e-icons e-ph-axes",id:"PHAxes",text:i.getConstant("PrimaryHorizontal")},{iconCss:"e-icons e-pv-axes",id:"PVAxes",text:i.getConstant("PrimaryVertical")}]},{iconCss:"e-icons e-axis-title",text:i.getConstant("AxisTitle"),items:[{iconCss:"e-icons e-ph-axistitle",id:"PHAxisTitle",text:i.getConstant("PrimaryHorizontal")},{iconCss:"e-icons e-pv-axistitle",id:"PVAxisTitle",text:i.getConstant("PrimaryVertical")}]},{iconCss:"e-icons e-chart-title",text:i.getConstant("ChartTitle"),items:[{iconCss:"e-icons e-ct-none",id:"ChartTitleNone",text:i.getConstant("None")},{iconCss:"e-icons e-ct-abovechart",id:"ChartTitleAbove",text:i.getConstant("AboveChart")}]},{iconCss:"e-icons e-data-labels",text:i.getConstant("DataLabels"),items:[{iconCss:"e-icons e-dl-none",id:"DLNone",text:i.getConstant("None")},{iconCss:"e-icons e-dl-center",id:"DLCenter",text:i.getConstant("Center")},{iconCss:"e-icons e-dl-insideend",id:"DLInsideend",text:i.getConstant("InsideEnd")},{iconCss:"e-icons e-dl-insidebase",id:"DLInsidebase",text:i.getConstant("InsideBase")},{iconCss:"e-icons e-dl-outsideend",id:"DLOutsideend",text:i.getConstant("OutsideEnd")}]},{iconCss:"e-icons e-gridlines",text:i.getConstant("Gridlines"),items:[{iconCss:"e-icons e-gl-major-horizontal",id:"GLMajorHorizontal",text:i.getConstant("PrimaryMajorHorizontal")},{iconCss:"e-icons e-gl-major-vertical",id:"GLMajorVertical",text:i.getConstant("PrimaryMajorVertical")},{iconCss:"e-icons e-gl-minor-horizontal",id:"GLMinorHorizontal",text:i.getConstant("PrimaryMinorHorizontal")},{iconCss:"e-icons e-gl-minor-vertical",id:"GLMinorVertical",text:i.getConstant("PrimaryMinorVertical")}]},{iconCss:"e-icons e-legends",text:i.getConstant("Legends"),items:[{iconCss:"e-icons e-legends-none",id:"LegendNone",text:i.getConstant("None")},{iconCss:"e-icons e-legends-right",id:"LegendsRight",text:i.getConstant("Right")},{iconCss:"e-icons e-legends-left",id:"LegendsLeft",text:i.getConstant("Left")},{iconCss:"e-icons e-legends-bottom",id:"LegendsBottom",text:i.getConstant("Bottom")},{iconCss:"e-icons e-legends-top",id:"LegendsTop",text:i.getConstant("Top")}]}],orientation:"Vertical",select:this.addChartEleSelected.bind(this)});var a=this.parent.element.appendChild(this.parent.createElement("ul",{id:e+"_add_chart_menu",styles:"display: none;"}));this.addChartMenu.appendTo(a),a.classList.add("e-ul"),this.addChartDdb=new l.DropDownButton({iconCss:"e-icons e-addchart-icon",cssClass:"e-addchart-ddb",target:this.addChartMenu.element.parentElement,created:function(){r.addChartMenu.element.style.display=""},beforeClose:function(r){r.event&&t.closest(r.event.target,".e-addchart-ddb")&&t.closest(r.event.target,".e-addchart-ddb").id!==e+"_addchart"&&(r.cancel=!0)},close:function(){return r.parent.element.focus()}}),this.addChartDdb.createElement=this.parent.createElement;var o=this.parent.createElement("button",{id:e+"_addchart"});return o.appendChild(this.parent.createElement("span",{id:e+"_chart",innerHTML:i.getConstant("AddChartElement")})),this.addChartDdb.appendTo(o),this.addChartDdb.element},e.prototype.getCFDBB=function(e){var t=this,r=this.parent.serviceLocator.getService(Hi);this.cFMenu=new n.Menu({cssClass:"e-cf-menu",items:[{iconCss:"e-icons e-hlcellrules",text:r.getConstant("HighlightCellsRules"),items:[{iconCss:"e-icons e-greaterthan",id:"cf_greaterthan",text:r.getConstant("GreaterThan")+"..."},{iconCss:"e-icons e-lessthan",id:"cf_lessthan",text:r.getConstant("LessThan")+"..."},{iconCss:"e-icons e-between",id:"cf_between",text:r.getConstant("Between")+"..."},{iconCss:"e-icons e-equalto",id:"cf_eqaulto",text:r.getConstant("CFEqualTo")+"..."},{iconCss:"e-icons e-textcontains",id:"cf_textthatcontains",text:r.getConstant("TextThatContains")+"..."},{iconCss:"e-icons e-adateoccuring",id:"cf_adateoccuring",text:r.getConstant("ADateOccuring")+"..."},{iconCss:"e-icons e-duplicate",id:"cf_duplicatevalues",text:r.getConstant("DuplicateValues")+"..."}]},{iconCss:"e-icons e-topbottomrules",text:r.getConstant("TopBottomRules"),items:[{iconCss:"e-icons e-top10items",id:"cf_top10items",text:r.getConstant("Top10Items")+"..."},{iconCss:"e-icons e-top10",id:"cf_top10",text:r.getConstant("Top10")+" %..."},{iconCss:"e-icons e-bottom10items",id:"cf_bottom10items",text:r.getConstant("Bottom10Items")+"..."},{iconCss:"e-icons e-bottom10",id:"cf_bottom10",text:r.getConstant("Bottom10")+" %..."},{iconCss:"e-icons e-aboveaverage",id:"cf_aboveaverage",text:r.getConstant("AboveAverage")+"..."},{iconCss:"e-icons e-belowaverage",id:"cf_belowaverage",text:r.getConstant("BelowAverage")+"..."}]},{iconCss:"e-icons e-databars",text:r.getConstant("DataBars"),items:[{id:"cf_databars"}]},{iconCss:"e-icons e-colorscales",text:r.getConstant("ColorScales"),items:[{id:"cf_colorscales"}]},{iconCss:"e-icons e-iconsets",text:r.getConstant("IconSets"),items:[{id:"cf_iconsets"}]},{iconCss:"e-icons e-clearrules",text:r.getConstant("ClearRules"),items:[{id:"cf_cr_cells",text:r.getConstant("SelectedCells")},{id:"cf_cr_sheet",text:r.getConstant("EntireSheet")}]}],orientation:"Vertical",beforeOpen:function(e){e.parentItem.text===r.getConstant("DataBars")?(e.element.firstChild.appendChild(i),e.element.parentElement.classList.add("e-databars")):e.parentItem.text===r.getConstant("ColorScales")?(e.element.firstChild.appendChild(f),e.element.parentElement.classList.add("e-colorscales")):e.parentItem.text===r.getConstant("IconSets")&&(e.element.firstChild.appendChild(F),e.element.parentElement.classList.add("e-iconsets"))},select:this.cFSelected.bind(this)});var i=this.parent.createElement("div",{id:"db",className:"e-db"}),a=this.parent.createElement("div",{id:"db1",className:"e-db1"}),o=this.parent.createElement("div",{id:"db2",className:"e-db2"});i.appendChild(a),i.appendChild(o);var s=this.parent.createElement("span",{id:"BlueDataBar",className:"e-bdatabar e-databar-icon"}),h=this.parent.createElement("span",{id:"GreenDataBar",className:"e-gdatabar e-databar-icon"}),d=this.parent.createElement("span",{id:"RedDataBar",className:"e-rdatabar e-databar-icon"}),p=this.parent.createElement("span",{id:"OrangeDataBar",className:"e-odatabar e-databar-icon"}),c=this.parent.createElement("span",{id:"LightBlueDataBar",className:"e-lbdatabar e-databar-icon"}),u=this.parent.createElement("span",{id:"PurpleDataBar",className:"e-pdatabar e-databar-icon"});s.title=r.getConstant("BlueDataBar"),h.title=r.getConstant("GreenDataBar"),d.title=r.getConstant("RedDataBar"),p.title=r.getConstant("OrangeDataBar"),c.title=r.getConstant("LightblueDataBar"),u.title=r.getConstant("PurpleDataBar"),a.appendChild(s),a.appendChild(h),a.appendChild(d),o.appendChild(p),o.appendChild(c),o.appendChild(u),this.cFMenu.createElement=this.parent.createElement;var f=this.parent.createElement("div",{id:"db",className:"e-cs"}),g=this.parent.createElement("div",{id:"cs1",className:"e-cs1"}),m=this.parent.createElement("div",{id:"cs2",className:"e-cs2"}),v=this.parent.createElement("div",{id:"cs3",className:"e-cs3"});f.appendChild(g),f.appendChild(m),f.appendChild(v);var y=this.parent.createElement("span",{id:"GYRColorScale",className:"e-gyr e-colorscale-icon"}),C=this.parent.createElement("span",{id:"RYGColorScale",className:"e-ryg e-colorscale-icon"}),b=this.parent.createElement("span",{id:"GWRColorScale",className:"e-gwr e-colorscale-icon"}),x=this.parent.createElement("span",{id:"RWGColorScale",className:"e-rwg e-colorscale-icon"}),S=this.parent.createElement("span",{id:"BWRColorScale",className:"e-bwr e-colorscale-icon"}),w=this.parent.createElement("span",{id:"RWBColorScale",className:"e-rwb e-colorscale-icon"}),I=this.parent.createElement("span",{id:"WRColorScale",className:"e-wr e-colorscale-icon"}),E=this.parent.createElement("span",{id:"RWColorScale",className:"e-rw e-colorscale-icon"}),R=this.parent.createElement("span",{id:"GWColorScale",className:"e-gw e-colorscale-icon"}),k=this.parent.createElement("span",{id:"WGColorScale",className:"e-wg e-colorscale-icon"}),A=this.parent.createElement("span",{id:"GYColorScale",className:"e-gy e-colorscale-icon"}),T=this.parent.createElement("span",{id:"YGColorScale",className:"e-yg e-colorscale-icon"});y.title=r.getConstant("GYRColorScale"),C.title=r.getConstant("RYGColorScale"),b.title=r.getConstant("GWRColorScale"),x.title=r.getConstant("RWGColorScale"),S.title=r.getConstant("BWRColorScale"),w.title=r.getConstant("RWBColorScale"),I.title=r.getConstant("WRColorScale"),E.title=r.getConstant("RWColorScale"),R.title=r.getConstant("GWColorScale"),k.title=r.getConstant("WGColorScale"),A.title=r.getConstant("GYColorScale"),T.title=r.getConstant("YGColorScale"),g.appendChild(y),g.appendChild(C),g.appendChild(b),g.appendChild(x),m.appendChild(S),m.appendChild(w),m.appendChild(I),m.appendChild(E),v.appendChild(R),v.appendChild(k),v.appendChild(A),v.appendChild(T);var F=this.parent.createElement("div",{id:"is",className:"e-is"}),L=this.parent.createElement("div",{id:"is1",className:"e-is1",innerHTML:"Directional"}),N=this.parent.createElement("div",{id:"is2",className:"e-is2"}),D=this.parent.createElement("div",{id:"is3",className:"e-is3",innerHTML:"Shapes"}),O=this.parent.createElement("div",{id:"is4",className:"e-is4"}),H=this.parent.createElement("div",{id:"is5",className:"e-is5",innerHTML:"Indicators"}),B=this.parent.createElement("div",{id:"is6",className:"e-is6"}),M=this.parent.createElement("div",{id:"is7",className:"e-is7",innerHTML:"Ratings"}),P=this.parent.createElement("div",{id:"is8",className:"e-is8"});L.title=r.getConstant("GYColorScale"),N.title=r.getConstant("YGColorScale"),D.title=r.getConstant("GYColorScale"),O.title=r.getConstant("YGColorScale"),H.title=r.getConstant("GYColorScale"),B.title=r.getConstant("YGColorScale"),M.title=r.getConstant("GYColorScale"),P.title=r.getConstant("YGColorScale"),F.appendChild(L),F.appendChild(N),F.appendChild(D),F.appendChild(O),F.appendChild(H),F.appendChild(B),F.appendChild(M),F.appendChild(P);var _=this.parent.createElement("div",{id:"ThreeArrows",className:"e-3arrows e-is-wrapper"}),U=this.parent.createElement("div",{id:"ThreeArrowsGray",className:"e-3arrowsgray e-is-wrapper"}),V=this.parent.createElement("div",{id:"ThreeTriangles",className:"e-3triangles e-is-wrapper"}),z=this.parent.createElement("div",{id:"FourArrowsGray",className:"e-4arrowsgray e-is-wrapper"}),q=this.parent.createElement("div",{id:"FourArrows",className:"e-4arrows e-is-wrapper"}),j=this.parent.createElement("div",{id:"FiveArrowsGray",className:"e-5arrowsgray e-is-wrapper"}),W=this.parent.createElement("div",{id:"FiveArrows",className:"e-5arrows e-is-wrapper"});_.title=r.getConstant("ThreeArrowsColor"),U.title=r.getConstant("ThreeArrowsGray"),V.title=r.getConstant("ThreeTriangles"),z.title=r.getConstant("FourArrowsColor"),q.title=r.getConstant("FourArrowsGray"),j.title=r.getConstant("FiveArrowsColor"),W.title=r.getConstant("FiveArrowsGray"),N.appendChild(_),N.appendChild(U),N.appendChild(V),N.appendChild(z),N.appendChild(q),N.appendChild(j),N.appendChild(W);var G=this.parent.createElement("div",{id:"ThreeTrafficLights1",className:"e-3trafficlights e-is-wrapper"}),Y=this.parent.createElement("div",{id:"ThreeTrafficLights2",className:"e-3rafficlights2 e-is-wrapper"}),X=this.parent.createElement("div",{id:"ThreeSigns",className:"e-3signs e-is-wrapper"}),K=this.parent.createElement("div",{id:"FourTrafficLights",className:"e-4trafficlights e-is-wrapper"}),$=this.parent.createElement("div",{id:"FourRedToBlack",className:"e-4redtoblack e-is-wrapper"});G.title=r.getConstant("ThreeTrafficLights1"),Y.title=r.getConstant("ThreeTrafficLights2"),X.title=r.getConstant("ThreeSigns"),K.title=r.getConstant("FourTrafficLights"),$.title=r.getConstant("RedToBlack"),O.appendChild(G),O.appendChild(Y),O.appendChild(X),O.appendChild(K),O.appendChild($);var Z=this.parent.createElement("div",{id:"ThreeSymbols",className:"e-3symbols e-is-wrapper"}),J=this.parent.createElement("div",{id:"ThreeSymbols2",className:"e-3symbols2 e-is-wrapper"}),Q=this.parent.createElement("div",{id:"ThreeFlags",className:"e-3flags e-is-wrapper"});Z.title=r.getConstant("ThreeSymbols1"),J.title=r.getConstant("ThreeSymbols2"),Q.title=r.getConstant("ThreeFlags"),B.appendChild(Z),B.appendChild(J),B.appendChild(Q);var ee=this.parent.createElement("div",{id:"ThreeStars",className:"e-3stars e-is-wrapper"}),te=this.parent.createElement("div",{id:"FourRating",className:"e-4rating e-is-wrapper"}),re=this.parent.createElement("div",{id:"FiveQuarters",className:"e-5quarters e-is-wrapper"}),ne=this.parent.createElement("div",{id:"FiveRating",className:"e-5rating e-is-wrapper"}),ie=this.parent.createElement("div",{id:"FiveBoxes",className:"e-5boxes e-is-wrapper"});ee.title=r.getConstant("ThreeStars"),te.title=r.getConstant("FourRatings"),re.title=r.getConstant("FiveQuarters"),ne.title=r.getConstant("FiveRatings"),ie.title=r.getConstant("FiveBoxes"),P.appendChild(ee),P.appendChild(te),P.appendChild(re),P.appendChild(ne),P.appendChild(ie),_.appendChild(this.createElement("span","e-3arrows-1 e-iconsetspan")),_.appendChild(this.createElement("span","e-3arrows-2 e-iconsetspan")),_.appendChild(this.createElement("span","e-3arrows-3 e-iconsetspan")),U.appendChild(this.createElement("span","e-3arrowsgray-1 e-iconsetspan")),U.appendChild(this.createElement("span","e-3arrowsgray-2 e-iconsetspan")),U.appendChild(this.createElement("span","e-3arrowsgray-3 e-iconsetspan")),V.appendChild(this.createElement("span","e-3triangles-1 e-iconsetspan")),V.appendChild(this.createElement("span","e-3triangles-2 e-iconsetspan")),V.appendChild(this.createElement("span","e-3triangles-3 e-iconsetspan")),z.appendChild(this.createElement("span","e-4arrowsgray-1 e-iconsetspan")),z.appendChild(this.createElement("span","e-4arrowsgray-2 e-iconsetspan")),z.appendChild(this.createElement("span","e-4arrowsgray-3 e-iconsetspan")),z.appendChild(this.createElement("span","e-4arrowsgray-4 e-iconsetspan")),q.appendChild(this.createElement("span","e-4arrows-1 e-iconsetspan")),q.appendChild(this.createElement("span","e-4arrows-2 e-iconsetspan")),q.appendChild(this.createElement("span","e-4arrows-3 e-iconsetspan")),q.appendChild(this.createElement("span","e-4arrows-4 e-iconsetspan")),j.appendChild(this.createElement("span","e-5arrowsgray-1 e-iconsetspan")),j.appendChild(this.createElement("span","e-5arrowsgray-2 e-iconsetspan")),j.appendChild(this.createElement("span","e-5arrowsgray-3 e-iconsetspan")),j.appendChild(this.createElement("span","e-5arrowsgray-4 e-iconsetspan")),j.appendChild(this.createElement("span","e-5arrowsgray-5 e-iconsetspan")),W.appendChild(this.createElement("span","e-5arrows-1 e-iconsetspan")),W.appendChild(this.createElement("span","e-5arrows-2 e-iconsetspan")),W.appendChild(this.createElement("span","e-5arrows-3 e-iconsetspan")),W.appendChild(this.createElement("span","e-5arrows-4 e-iconsetspan")),W.appendChild(this.createElement("span","e-5arrows-5 e-iconsetspan")),G.appendChild(this.createElement("span","e-3trafficlights-1 e-iconsetspan")),G.appendChild(this.createElement("span","e-3trafficlights-2 e-iconsetspan")),G.appendChild(this.createElement("span","e-3trafficlights-3 e-iconsetspan")),Y.appendChild(this.createElement("span","e-3rafficlights2-1 e-iconsetspan")),Y.appendChild(this.createElement("span","e-3rafficlights2-2 e-iconsetspan")),Y.appendChild(this.createElement("span","e-3rafficlights2-3 e-iconsetspan")),X.appendChild(this.createElement("span","e-3signs-1 e-iconsetspan")),X.appendChild(this.createElement("span","e-3signs-2 e-iconsetspan")),X.appendChild(this.createElement("span","e-3signs-3 e-iconsetspan")),K.appendChild(this.createElement("span","e-4trafficlights-1 e-iconsetspan")),K.appendChild(this.createElement("span","e-4trafficlights-2 e-iconsetspan")),K.appendChild(this.createElement("span","e-4trafficlights-3 e-iconsetspan")),K.appendChild(this.createElement("span","e-4trafficlights-4 e-iconsetspan")),$.appendChild(this.createElement("span","e-4redtoblack-1 e-iconsetspan")),$.appendChild(this.createElement("span","e-4redtoblack-2 e-iconsetspan")),$.appendChild(this.createElement("span","e-4redtoblack-3 e-iconsetspan")),$.appendChild(this.createElement("span","e-4redtoblack-4 e-iconsetspan")),Z.appendChild(this.createElement("span","e-3symbols-1 e-iconsetspan")),Z.appendChild(this.createElement("span","e-3symbols-2 e-iconsetspan")),Z.appendChild(this.createElement("span","e-3symbols-3 e-iconsetspan")),J.appendChild(this.createElement("span","e-3symbols2-1 e-iconsetspan")),J.appendChild(this.createElement("span","e-3symbols2-2 e-iconsetspan")),J.appendChild(this.createElement("span","e-3symbols2-3 e-iconsetspan")),Q.appendChild(this.createElement("span","e-3flags-1 e-iconsetspan")),Q.appendChild(this.createElement("span","e-3flags-2 e-iconsetspan")),Q.appendChild(this.createElement("span","e-3flags-3 e-iconsetspan")),ee.appendChild(this.createElement("span","e-3stars-1 e-iconsetspan")),ee.appendChild(this.createElement("span","e-3stars-2 e-iconsetspan")),ee.appendChild(this.createElement("span","e-3stars-3 e-iconsetspan")),te.appendChild(this.createElement("span","e-4rating-1 e-iconsetspan")),te.appendChild(this.createElement("span","e-4rating-2 e-iconsetspan")),te.appendChild(this.createElement("span","e-4rating-3 e-iconsetspan")),te.appendChild(this.createElement("span","e-4rating-4 e-iconsetspan")),re.appendChild(this.createElement("span","e-5quarters-1 e-iconsetspan")),re.appendChild(this.createElement("span","e-5quarters-2 e-iconsetspan")),re.appendChild(this.createElement("span","e-5quarters-3 e-iconsetspan")),re.appendChild(this.createElement("span","e-5quarters-4 e-iconsetspan")),re.appendChild(this.createElement("span","e-5quarters-5 e-iconsetspan")),ne.appendChild(this.createElement("span","e-5rating-1 e-iconsetspan")),ne.appendChild(this.createElement("span","e-5rating-2 e-iconsetspan")),ne.appendChild(this.createElement("span","e-5rating-3 e-iconsetspan")),ne.appendChild(this.createElement("span","e-5rating-4 e-iconsetspan")),ne.appendChild(this.createElement("span","e-5rating-5 e-iconsetspan")),ie.appendChild(this.createElement("span","e-5boxes-1 e-iconsetspan")),ie.appendChild(this.createElement("span","e-5boxes-2 e-iconsetspan")),ie.appendChild(this.createElement("span","e-5boxes-3 e-iconsetspan")),ie.appendChild(this.createElement("span","e-5boxes-4 e-iconsetspan")),ie.appendChild(this.createElement("span","e-5boxes-5 e-iconsetspan"));var ae=this.parent.element.appendChild(this.parent.createElement("ul",{id:e+"_cf_menu",styles:"display: none;"}));return this.cFMenu.appendTo(ae),ae.classList.add("e-ul"),this.cFDdb=new l.DropDownButton({iconCss:"e-icons e-conditionalformatting-icon",cssClass:"e-cf-ddb",target:this.cFMenu.element.parentElement,created:function(){t.cFMenu.element.style.display=""},close:function(){return Et(t.parent.element)}}),this.cFDdb.createElement=this.parent.createElement,this.cFDdb.appendTo(this.parent.createElement("button",{id:e+"_conditionalformatting"})),this.cFDdb.element},e.prototype.createElement=function(e,t){return this.parent.createElement(e,{className:t})},e.prototype.getBordersDBB=function(e){var r,a=this,o=this.parent.serviceLocator.getService(Hi);this.bordersMenu=new n.Menu({cssClass:"e-borders-menu",items:[{iconCss:"e-icons e-top-borders",text:o.getConstant("TopBorders")},{iconCss:"e-icons e-left-borders",text:o.getConstant("LeftBorders")},{iconCss:"e-icons e-right-borders",text:o.getConstant("RightBorders")},{iconCss:"e-icons e-bottom-borders",text:o.getConstant("BottomBorders")},{iconCss:"e-icons e-all-borders",text:o.getConstant("AllBorders")},{iconCss:"e-icons e-horizontal-borders",text:o.getConstant("HorizontalBorders")},{iconCss:"e-icons e-vertical-borders",text:o.getConstant("VerticalBorders")},{iconCss:"e-icons e-outside-borders",text:o.getConstant("OutsideBorders")},{iconCss:"e-icons e-inside-borders",text:o.getConstant("InsideBorders")},{iconCss:"e-icons e-no-borders",text:o.getConstant("NoBorders")},{separator:!0},{text:o.getConstant("BorderColor"),items:[{id:e+"_border_colors"}]},{text:o.getConstant("BorderStyle"),items:[{iconCss:"e-icons e-selected-icon",id:e+"_1px"},{id:e+"_2px"},{id:e+"_3px"},{id:e+"_dashed"},{id:e+"_dotted"},{id:e+"_double"}]}],orientation:"Vertical",beforeOpen:function(e){"Border Color"===e.parentItem.text?(a.colorPicker.refresh(),r=a.colorPicker.element.parentElement,e.element.firstElementChild.appendChild(r),r.style.display="inline-block",e.element.parentElement.classList.add("e-border-color")):e.element.classList.add("e-border-style")},beforeClose:function(e){"Border Color"===e.parentItem.text&&(!t.closest(e.event.target,".e-border-colorpicker")||t.closest(e.event.target,".e-apply")||t.closest(e.event.target,".e-cancel")?(a.colorPicker=t.getComponent(a.cPickerEle,"colorpicker"),"Picker"===a.colorPicker.mode&&(a.colorPicker.mode="Palette",a.colorPicker.dataBind()),r.style.display="",a.parent.element.appendChild(r)):e.cancel=!0)},onOpen:function(e){"Border Color"===e.parentItem.text&&(e.element.parentElement.style.overflow="visible")},select:this.borderSelected.bind(this)}),this.bordersMenu.createElement=this.parent.createElement;var s=this.parent.element.appendChild(this.parent.createElement("ul",{id:e+"_borders_menu",styles:"display: none;"}));return this.bordersMenu.appendTo(s),s.classList.add("e-ul"),this.cPickerEle=this.parent.createElement("input",{id:e+"_cell_border_color",attrs:{type:"color"}}),this.parent.element.appendChild(this.cPickerEle),this.colorPicker=new i.ColorPicker({cssClass:"e-border-colorpicker",mode:"Palette",inline:!0,change:function(e){var t=a.border.split(" ");t[2]=e.currentValue.hex,a.border=t.join(" ")},created:function(){r=a.colorPicker.element.parentElement}}),this.colorPicker.createElement=this.parent.createElement,this.colorPicker.appendTo(this.cPickerEle),this.bordersDdb=new l.DropDownButton({iconCss:"e-icons e-bottom-borders",cssClass:"e-borders-ddb",target:this.bordersMenu.element.parentElement,created:function(){a.bordersMenu.element.style.display=""},beforeOpen:function(e){return a.tBarDdbBeforeOpen(e.element.firstElementChild,a.bordersMenu.items,1)},beforeClose:function(e){e.event&&t.closest(e.event.target,".e-borders-menu")&&(e.cancel=!0)},close:function(){return Et(a.parent.element)}}),this.bordersDdb.createElement=this.parent.createElement,this.bordersDdb.appendTo(this.parent.createElement("button",{id:e+"_borders"})),this.bordersDdb.element},e.prototype.chartSelected=function(e){var r=!t.isNullOrUndefined(t.closest(e.element,".e-chart-menu")),n=e.element.id;if("column_chartbar_chartarea_chartpie_doughnut_chartline_chartradar_chartscatter_chart".includes(n)){var i=e.event.target.id;this.parent.notify("insertChart",{action:n,id:i,isChart:r})}},e.prototype.addChartEleSelected=function(e){var t=e.element.id;this.parent.notify("chartDesignTab",{addChartEle:t})},e.prototype.cFSelected=function(e){var t=e.element.id;if("cf_greaterthancf_lessthancf_betweencf_eqaultocf_textthatcontainscf_adateoccuringcf_duplicatevaluescf_top10itemscf_top10cf_bottom10itemscf_bottom10cf_aboveaveragecf_belowaverage".includes(t))this.parent.notify("initiateConditionalFormat",{action:e.item.text});else if("cf_databarscf_colorscales".includes(t)){var r=e.event.target.id;this.parent.notify("setCF",{action:t,id:r})}else if("cf_iconsets"===e.element.id){var n=e.event.target,i=""===n.id?n.parentElement.id:n.id;this.parent.notify("setCF",{action:t,id:i})}if("cf_cr_cells"===t)this.parent.notify(qt,{range:this.parent.getActiveSheet().selectedRange,isPublic:!1});else if("cf_cr_sheet"===t){var a=this.parent.getActiveSheet(),o=m([0,0,a.rowCount-1,a.colCount-1]);this.parent.conditionalFormat=null,this.parent.notify(qt,{range:o,isPublic:!1})}},e.prototype.borderSelected=function(e){if(!e.item.items.length&&e.item.id!==this.parent.element.id+"_border_colors"){if(!e.item.text){var t=this.parent.element.id,r=this.border.split(" "),n="solid"===r[1]?t+"_"+r[0]:t+"_"+r[1];if(n===e.item.id)return;return e.item.id===t+"_1px"||e.item.id===t+"_2px"||e.item.id===t+"_3px"?(r[0]=e.item.id.split(t+"_")[1],r[1]="solid"):(r[1]=e.item.id.split(t+"_")[1],r[0]="double"===r[1]?"3px":"1px"),this.border=r.join(" "),this.bordersMenu.items[12].items.forEach(function(t){t.id===n&&(t.iconCss=null),t.id===e.item.id&&(t.iconCss="e-icons e-selected-icon")}),void this.bordersMenu.setProperties({items:this.bordersMenu.items},!0)}switch(this.bordersDdb.toggle(),this.parent.showSpinner(),e.item.text){case"Top Borders":this.parent.notify(Tt,{style:{borderTop:this.border},onActionUpdate:!0});break;case"Left Borders":this.parent.notify(Tt,{style:{borderLeft:this.border},onActionUpdate:!0});break;case"Right Borders":this.parent.notify(Tt,{style:{borderRight:this.border},onActionUpdate:!0});break;case"Bottom Borders":this.parent.notify(Tt,{style:{borderBottom:this.border},onActionUpdate:!0});break;case"All Borders":this.parent.notify(Tt,{style:{border:this.border},onActionUpdate:!0});break;case"Horizontal Borders":this.parent.notify(Tt,{style:{border:this.border},onActionUpdate:!0,borderType:"Horizontal"});break;case"Vertical Borders":this.parent.notify(Tt,{style:{border:this.border},onActionUpdate:!0,borderType:"Vertical"});break;case"Outside Borders":this.parent.notify(Tt,{style:{border:this.border},onActionUpdate:!0,borderType:"Outer"});break;case"Inside Borders":this.parent.notify(Tt,{style:{border:this.border},onActionUpdate:!0,borderType:"Inner"});break;case"No Borders":this.parent.notify(Tt,{style:{border:""},onActionUpdate:!0})}this.parent.hideSpinner()}},e.prototype.getFontNameDDB=function(e){var t=this,r=this.parent.createElement("button",{id:e+"_font_name"});return r.appendChild(this.parent.createElement("span",{className:"e-tbar-btn-text",innerHTML:"Calibri"})),this.fontNameDdb=new l.DropDownButton({cssClass:"e-font-family",items:this.getFontFamilyItems(),select:function(e){var r={style:{fontFamily:e.item.text},onActionUpdate:!0};t.parent.notify(Tt,r),r.cancel||t.refreshFontNameSelection(r.style.fontFamily)},close:function(){return Et(t.parent.element)},beforeOpen:function(e){return t.tBarDdbBeforeOpen(e.element,e.items)}}),this.fontNameDdb.createElement=this.parent.createElement,this.fontNameDdb.appendTo(r),r},e.prototype.getBtn=function(e,t,r){void 0===r&&(r=!0);var n=new a.Button({iconCss:"e-icons e-"+t+"-icon",isToggle:!0});return n.createElement=this.parent.createElement,n.appendTo(this.parent.createElement("button",{id:e+"_"+t})),r&&n.element.addEventListener("click",this.toggleBtnClicked.bind(this)),n.element},e.prototype.datavalidationDDB=function(e){var t,r=this,n=this.parent.serviceLocator.getService(Hi);return this.datavalidationDdb=new l.DropDownButton({cssClass:"e-datavalidation-ddb",iconCss:"e-datavalidation-icon e-icons",items:[{text:n.getConstant("DataValidation")},{text:n.getConstant("HighlightInvalidData")},{text:n.getConstant("ClearHighlight")},{text:n.getConstant("ClearValidation")}],beforeOpen:function(e){r.refreshSelected(r.datavalidationDdb,e.element,"iconCss")},select:function(e){switch(e.item.text){case n.getConstant("DataValidation"):r.parent.notify("initiatedatavalidation",null);break;case n.getConstant("HighlightInvalidData"):r.parent.notify("invalidData",{isRemoveHighlight:!1});break;case n.getConstant("ClearHighlight"):r.parent.notify("invalidData",{isRemoveHighlight:!0});break;case n.getConstant("ClearValidation"):r.parent.notify("removeDataValidation",null);break;default:t=e.item.text===n.getConstant("SortAscending")?"Ascending":"Descending",r.parent.notify("applySort",{sortOptions:{sortDescriptors:{order:t}}})}},close:function(){return Et(r.parent.element)}}),this.datavalidationDdb.createElement=this.parent.createElement,this.datavalidationDdb.appendTo(this.parent.createElement("button",{id:e+"_datavalidation"})),this.datavalidationDdb.element},e.prototype.getTextAlignDDB=function(e){var t=this;return this.textAlignDdb=new l.DropDownButton({cssClass:"e-align-ddb",iconCss:"e-icons e-left-icon",items:[{iconCss:"e-icons e-left-icon"},{iconCss:"e-icons e-center-icon"},{iconCss:"e-icons e-right-icon"}],beforeItemRender:this.alignItemRender.bind(this),beforeOpen:function(e){t.refreshSelected(t.textAlignDdb,e.element,"iconCss")},select:function(e){var r={style:{textAlign:e.item.iconCss.split(" e-")[1].split("-icon")[0]},onActionUpdate:!0};t.parent.notify(Tt,r),r.cancel||(t.textAlignDdb.iconCss="e-icons e-"+r.style.textAlign+"-icon",t.textAlignDdb.dataBind())},close:function(){return Et(t.parent.element)}}),this.textAlignDdb.createElement=this.parent.createElement,this.textAlignDdb.appendTo(this.parent.createElement("button",{id:e+"_text_align"})),this.textAlignDdb.element},e.prototype.getVerticalAlignDDB=function(e){var t=this;return this.verticalAlignDdb=new l.DropDownButton({cssClass:"e-align-ddb",iconCss:"e-icons e-bottom-icon",items:[{iconCss:"e-icons e-top-icon"},{iconCss:"e-icons e-middle-icon"},{iconCss:"e-icons e-bottom-icon"}],beforeItemRender:this.alignItemRender.bind(this),beforeOpen:function(e){t.refreshSelected(t.verticalAlignDdb,e.element,"iconCss")},select:function(e){var r={style:{verticalAlign:e.item.iconCss.split(" e-")[1].split("-icon")[0]},onActionUpdate:!0};t.parent.notify(Tt,r),r.cancel||(t.verticalAlignDdb.iconCss="e-icons e-"+r.style.verticalAlign+"-icon",t.verticalAlignDdb.dataBind())},close:function(){return Et(t.parent.element)}}),this.verticalAlignDdb.createElement=this.parent.createElement,this.verticalAlignDdb.appendTo(this.parent.createElement("button",{id:e+"_vertical_align"})),this.verticalAlignDdb.element},e.prototype.getMergeSplitBtn=function(e){var t=this;this.parent.element.appendChild(this.parent.createElement("button",{id:e+"_merge"}));var r=this.parent.serviceLocator.getService(Hi);return this.mergeSplitBtn=new l.SplitButton({cssClass:"e-merge-ddb",iconCss:"e-icons e-merge-icon",items:[{text:r.getConstant("MergeAll"),id:e+"_merge_all"},{text:r.getConstant("MergeHorizontally"),id:e+"_merge_horizontally"},{text:r.getConstant("MergeVertically"),id:e+"_merge_vertically"},{separator:!0,id:e+"_merge_separator"},{text:r.getConstant("Unmerge"),id:e+"_unmerge"}],select:this.mergeSelectHandler.bind(this),close:function(){return Et(t.parent.element)},click:function(e){e.element.classList.contains("e-active")?(t.toggleActiveState(!1),t.unMerge()):(t.toggleActiveState(!0),t.merge(t.parent.element.id+"_merge_all"))},created:function(){t.mergeSplitBtn.element.title=r.getConstant("MergeCells"),t.mergeSplitBtn.element.nextElementSibling.title=r.getConstant("SelectMergeType")}}),this.mergeSplitBtn.createElement=this.parent.createElement,this.mergeSplitBtn.appendTo("#"+e+"_merge"),this.mergeSplitBtn.element.parentElement},e.prototype.mergeSelectHandler=function(e){e.item.id===this.parent.element.id+"_unmerge"?this.unMerge():this.merge(e.item.id)},e.prototype.unMerge=function(){this.parent.showSpinner(),this.parent.notify(Vt,{merge:!1,range:this.parent.getActiveSheet().selectedRange,isAction:!0,refreshRibbon:!0,type:"All"}),this.parent.hideSpinner()},e.prototype.merge=function(e){for(var t,r,n=this,i=this.parent.getActiveSheet(),a=c(i.selectedRange),o=a[0];o<=a[2];o++)for(var s=a[1];s<=a[3];s++)o===a[0]&&s===a[1]&&e.includes("merge_all")||o===a[0]&&e.includes("merge_vertically")||s===a[1]&&e.includes("_merge_horizontally")||((t=J(o,s,i)||{}).value||t.formula)&&(r=!0);if(!r)return void this.performMerge(e);var l=this.parent.serviceLocator.getService(Bi);l.show({target:this.parent.element,height:200,width:400,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(Hi).getConstant("MergeCellsAlert"),beforeOpen:function(e){var t={dialogName:"MergeAlertDialog",element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0),Et(n.parent.element)},buttons:[{buttonModel:{content:this.parent.serviceLocator.getService(Hi).getConstant("Ok"),isPrimary:!0},click:function(){l.hide(),n.performMerge(e)}}]})},e.prototype.performMerge=function(e){var t=this.parent.element.id;switch(this.parent.showSpinner(),e){case t+"_merge_all":this.parent.notify(Vt,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"All",isAction:!0,refreshRibbon:!0});break;case t+"_merge_horizontally":this.parent.notify(Vt,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"Horizontally",isAction:!0});break;case t+"_merge_vertically":this.parent.notify(Vt,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"Vertically",isAction:!0})}this.parent.hideSpinner()},e.prototype.getSortFilterDDB=function(e){var t,r=this,n=this.parent.serviceLocator.getService(Hi);return this.sortingDdb=new l.DropDownButton({cssClass:"e-sort-filter-ddb",iconCss:"e-icons e-sort-filter-icon",items:[{text:n.getConstant("SortAscending"),iconCss:"e-icons e-sort-asc"},{text:n.getConstant("SortDescending"),iconCss:"e-icons e-sort-desc"},{text:n.getConstant("CustomSort")+"...",iconCss:"e-icons e-sort-custom"},{separator:!0},{text:n.getConstant("Filter"),iconCss:"e-icons e-filter-apply",id:e+"_applyfilter"},{text:n.getConstant("ClearAllFilter"),iconCss:"e-icons e-filter-clear",id:e+"_clearfilter"},{text:n.getConstant("ReapplyFilter"),iconCss:"e-icons e-filter-reapply",id:e+"_reapplyfilter"}],beforeItemRender:function(t){var n={isFiltered:!1,isClearAll:!0};if(r.parent.notify("getFilteredColumn",n),t.item.id===e+"_clearfilter"||t.item.id===e+"_reapplyfilter")n.isFiltered?t.element.classList.remove("e-disabled"):t.element.classList.add("e-disabled");else if(t.item.id===e+"_applyfilter"){var i=r.parent.getActiveSheet();(i.frozenColumns||i.frozenRows)&&t.element.classList.add("e-disabled")}},beforeOpen:function(e){r.refreshSelected(r.sortingDdb,e.element,"iconCss")},select:function(e){switch(e.item.text){case n.getConstant("Filter"):r.parent.applyFilter();break;case n.getConstant("ClearAllFilter"):r.parent.clearFilter();break;case n.getConstant("ReapplyFilter"):r.parent.notify("reapplyFilter",null);break;case n.getConstant("CustomSort")+"...":r.parent.notify("initiateCustomSort",null);break;default:t=e.item.text===n.getConstant("SortAscending")?"Ascending":"Descending",r.parent.notify("applySort",{sortOptions:{sortDescriptors:{order:t}}})}},close:function(){return Et(r.parent.element)}}),this.sortingDdb.createElement=this.parent.createElement,this.sortingDdb.appendTo(this.parent.createElement("button",{id:e+"_sorting"})),this.sortingDdb.element},e.prototype.getFindDDb=function(e){var t=this,r=this.parent.createElement("button",{id:e+"_findbtn"});return this.findDdb=new a.Button({cssClass:"e-spreadsheet-find-ddb e-caret-hide",iconCss:"e-icons e-search-icon"}),this.findDdb.createElement=this.parent.createElement,this.findDdb.appendTo(r),r.onclick=function(){t.findToolDlg()},this.findDdb.element},e.prototype.findToolDlg=function(){var e,r=this;if(t.isNullOrUndefined(this.parent.element.querySelector(".e-findtool-dlg"))){var i,a=this.parent.createElement("div",{className:"e-input-group"}),o=this.parent.createElement("input",{className:"e-input e-text-findNext-short",attrs:{type:"Text",value:this.findValue}}),s=this.parent.serviceLocator.getService(Hi);o.setAttribute("placeholder",s.getConstant("FindValue"));var l=this.parent.createElement("span",{className:"e-input-group-icon"});o.onkeyup=function(){e={countOpt:"count",findCount:""},r.parent.notify("findHandler",{countArgs:e}),l.textContent=e.findCount;var n=document.querySelector(".e-text-findNext-short").value,a=document.querySelector(".e-findRib-next"),o=document.querySelector(".e-findRib-prev");t.isNullOrUndefined(n)||""===n||"0 of 0"===e.findCount?(i.enableItems(a,!1),i.enableItems(o,!1),l.textContent="0 of 0"):t.isNullOrUndefined(n)&&"0 of 0"===e.findCount||(i.enableItems(a,!0),i.enableItems(o,!0))},o.onkeydown=function(t){e={countOpt:"count",findCount:""},r.parent.notify("findHandler",{countArgs:e});var n=e.findCount;r.findOnKeyDown(t,n)},a.appendChild(o),a.appendChild(l);var d=[{type:"Input",template:a},{prefixIcon:"e-icons e-prev-icon",tooltipText:"Find Previous",type:"Button",cssClass:"e-findRib-prev",disabled:!0},{prefixIcon:"e-icons e-next-icon",tooltipText:"Find Next",type:"Button",cssClass:"e-findRib-next",disabled:!0},{type:"Separator"},{prefixIcon:"e-icons e-option-icon",tooltipText:"More Options",type:"Button",cssClass:"e-findRib-more"},{prefixIcon:"e-icons e-close",tooltipText:"Close",type:"Button",cssClass:"e-findRib-close"}];i=new n.Toolbar({clicked:function(t){"e-findRib-next"===t.item.cssClass?(r.parent.notify("findHandler",{findOption:"next"}),e={countOpt:"count",findCount:""},r.parent.notify("findHandler",{countArgs:e}),l.textContent=e.findCount):"e-findRib-prev"===t.item.cssClass?(r.parent.notify("findHandler",{findOption:"prev"}),e={countOpt:"count",findCount:""},r.parent.notify("findHandler",{countArgs:e}),l.textContent=e.findCount):"e-findRib-more"===t.item.cssClass&&(r.parent.notify(fr,null),r.findDialog.hide())},width:"auto",height:"auto",items:d,cssClass:"e-find-toolObj"});var p=this.parent.createElement("div",{className:"e-find-toolbar"}),c=this.parent.createElement("div",{className:"e-dlg-div"});this.findDialog=new h.Dialog({isModal:!1,showCloseIcon:!1,cssClass:"e-findtool-dlg",content:p,visible:!1,allowDragging:!0,target:this.parent.element.querySelector(".e-sheet"),beforeOpen:function(){t.EventHandler.add(document,"click",r.closeDialog,r)},open:function(){r.textFocus(i.element)},beforeClose:function(){r.findValue=r.parent.element.querySelector(".e-text-findNext-short").value,i.destroy();var e=document.querySelector(".e-find-toolbar");t.EventHandler.remove(e,"focus",r.textFocus),t.EventHandler.remove(document,"click",r.closeDialog),Et(r.parent.element)},created:function(){i.createElement=r.parent.createElement,i.appendTo(p),r.findDialog.width=getComputedStyle(document.querySelector(".e-findtool-dlg")).width;var e=r.parent.element.querySelector(".e-main-panel").getBoundingClientRect(),t=r.findDialog.width.toString();r.findDialog.position={X:e.width-parseInt(t,10)-(r.parent.allowScrolling?_e():0),Y:r.parent.getActiveSheet().showHeaders?31:0},r.findDialog.dataBind(),r.findDialog.show()}}),this.findDialog.createElement=this.parent.createElement,this.findDialog.appendTo(c)}else t.isNullOrUndefined(this.parent.element.querySelector(".e-findtool-dlg"))||(this.findDialog.hide(),t.detach(this.parent.element.querySelector(".e-findtool-dlg")),this.findDialog=null,Et(this.parent.element))},e.prototype.findOnKeyDown=function(e,t){if(document.querySelector(".e-text-findNext-short").value&&"0 of 0"!==t)if(e.shiftKey){if(13===e.keyCode){var r={findOption:"prev"};this.parent.notify("findHandler",r)}}else if(13===e.keyCode){var n={findOption:"next"};this.parent.notify("findHandler",n)}},e.prototype.closeDialog=function(e){!t.closest(e.target,".e-findRib-close")&&t.closest(e.target,".e-spreadsheet")||t.isNullOrUndefined(this.findDialog)||(this.findDialog.hide(),t.detach(this.parent.element.querySelector(".e-findtool-dlg")),this.findDialog=null)},e.prototype.textFocus=function(e){document.querySelector(".e-find-toolbar").addEventListener("focus",function(){var e=document.querySelector(".e-text-findNext-short");e.focus(),e.classList.add("e-input-focus"),e.setSelectionRange(0,e.value.length)})},e.prototype.getClearDDB=function(e){var t=this,r=this.parent.serviceLocator.getService(Hi);return this.clearDdb=new l.DropDownButton({cssClass:"e-clear-ddb",iconCss:"e-icons e-clear-icon",items:[{text:r.getConstant("ClearAll")},{text:r.getConstant("ClearFormats")},{text:r.getConstant("ClearContents")},{text:r.getConstant("ClearHyperlinks")}],select:function(e){t.parent.notify(mr,{options:{type:e.item.text}})},close:function(){return Et(t.parent.element)}}),this.clearDdb.createElement=this.parent.createElement,this.clearDdb.appendTo(this.parent.createElement("button",{id:e+"_clear"})),this.clearDdb.element},e.prototype.ribbonCreated=function(){this.ribbon.element.querySelector(".e-drop-icon").title=this.parent.serviceLocator.getService(Hi).getConstant("CollapseToolbar")},e.prototype.alignItemRender=function(e){var t=e.item.iconCss.split(" e-")[1].split("-icon")[0];t=t[0].toUpperCase()+t.slice(1,t.length),e.element.title=this.parent.serviceLocator.getService(Hi).getConstant("Align"+t)},e.prototype.toggleBtnClicked=function(e){var r,n,i,a,o,s=t.closest(e.target,".e-btn"),l=this.parent.element.id,h=s.id,d=Tt;switch(h){case l+"_bold":n={fontWeight:"normal"},i={fontWeight:"bold"},o="fontWeight";break;case l+"_italic":n={fontStyle:"normal"},i={fontStyle:"italic"},o="fontStyle";break;case l+"_line-through":d="textDecorationUpdate",i=n={textDecoration:"line-through"},o="textDecoration";break;case l+"_underline":d="textDecorationUpdate",i=n={textDecoration:"underline"},o="textDecoration"}s.classList.contains("e-active")?(r=i[o],a={style:i,onActionUpdate:!0},this.parent.notify(d,a),a.cancel&&s.classList.remove("e-active")):(r=n[o],a={style:n,onActionUpdate:!0},this.parent.notify(d,a),a.cancel&&s.classList.add("e-active")),a.cancel||r===a.style[o]||this.refreshToggleBtn(u(this.parent.getActiveSheet().activeCell)),Et(this.parent.element)},e.prototype.getCellStyleValue=function(e,t){var r=J(t[0],t[1],this.parent.getActiveSheet()),n=this.parent.cellStyle[e];return r&&r.style&&r.style[e]&&(n=r.style[e]),n},e.prototype.refreshSelected=function(e,t,r,n){void 0===n&&(n=r);for(var i=0;i<e.items.length;i++)if(e.items[i][n]===e[r]){t.children[i].classList.add("e-selected");break}},e.prototype.expandCollapseHandler=function(e){var t=this.ribbon.element.querySelector(".e-drop-icon"),r=this.parent.serviceLocator.getService(Hi);e.expanded?t.title=r.getConstant("CollapseToolbar"):t.title=r.getConstant("ExpandToolbar"),this.parent.setPanelSize()},e.prototype.getChartThemeDdbItems=function(){var e=this.parent.serviceLocator.getService(Hi);return[{id:"Material",text:e.getConstant("Material")},{id:"Fabric",text:e.getConstant("Fabric")},{id:"Bootstrap",text:e.getConstant("Bootstrap")},{id:"HighContrastLight",text:e.getConstant("HighContrastLight")},{id:"MaterialDark",text:e.getConstant("MaterialDark")},{id:"FabricDark",text:e.getConstant("FabricDark")},{id:"HighContrast",text:e.getConstant("HighContrast")},{id:"BootstrapDark",text:e.getConstant("BootstrapDark")},{id:"Bootstrap4",text:e.getConstant("Bootstrap4")}]},e.prototype.getNumFormatDdbItems=function(e){var t=this.parent.serviceLocator.getService(Hi);return[{id:e+"_General",text:t.getConstant("General")},{id:e+"_Number",text:t.getConstant("Number")},{id:e+"_Currency",text:t.getConstant("Currency")},{id:e+"_Accounting",text:t.getConstant("Accounting")},{id:e+"_ShortDate",text:t.getConstant("ShortDate")},{id:e+"_LongDate",text:t.getConstant("LongDate")},{id:e+"_Time",text:t.getConstant("Time")},{id:e+"_Percentage",text:t.getConstant("Percentage")},{id:e+"_Fraction",text:t.getConstant("Fraction")},{id:e+"_Scientific",text:t.getConstant("Scientific")},{id:e+"_Text",text:t.getConstant("Text")}]},e.prototype.getFontFamilyItems=function(){return[{text:"Arial"},{text:"Arial Black"},{text:"Axettac Demo"},{text:"Batang"},{text:"Book Antiqua"},{text:"Calibri",iconCss:"e-icons e-selected-icon"},{text:"Courier"},{text:"Courier New"},{text:"Din Condensed"},{text:"Georgia"},{text:"Helvetica"},{text:"Helvetica New"},{text:"Roboto"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Verdana"}]},e.prototype.numDDBSelect=function(e){var t={format:O(e.item.id.split(this.parent.element.id+"_")[1]),range:this.parent.getActiveSheet().selectedRange,cancel:!1,requestType:"NumberFormat"},r={range:this.parent.getActiveSheet().name+"!"+t.range,format:t.format,requestType:"NumberFormat"};this.parent.trigger("beforeCellFormat",t),this.parent.notify(cr,{eventArgs:t,action:"format"}),t.cancel||(this.parent.notify("applyNumber",t),this.parent.notify("selectionComplete",{type:"mousedown"}),this.refreshNumFormatSelection(e.item.text),this.parent.notify(pr,{eventArgs:r,action:"format"}))},e.prototype.chartThemeDDBSelect=function(e){this.parent.notify("selectionComplete",{type:"mousedown"}),this.refreshChartThemeSelection(e.item.id),this.parent.notify("chartDesignTab",{chartTheme:e.item.id})},e.prototype.tBarDdbBeforeOpen=function(e,t,r){void 0===r&&(r=0);var n=this.parent.viewport.height,i=parseInt(getComputedStyle(e.firstElementChild).height,10)*(t.length-r)+2*parseInt(getComputedStyle(e).paddingTop,10);if(r){var a=getComputedStyle(e.querySelector(".e-separator"));i+=r*(parseInt(a.borderBottomWidth,10)+2*parseInt(a.marginTop,10))}i>n?(e.style.height=n+"px",e.style.overflowY="auto"):e.style.height&&(e.style.height="",e.style.overflowY="")},e.prototype.numDDBOpen=function(e){this.numPopupWidth=0;for(var t=e.element.querySelectorAll("span.e-numformat-preview-text"),r=0,n=t.length;r<n;r++)this.numPopupWidth<t[r].offsetWidth&&(this.numPopupWidth=t[r].offsetWidth);var i=this.numPopupWidth+160;document.querySelector(".e-numformat-ddb.e-dropdown-popup").style.width=i+"px"},e.prototype.previewNumFormat=function(e){var t=u(this.parent.getActiveSheet().activeCell),r=J(t[0],t[1],this.parent.getActiveSheet()),n={type:e.item.text,formattedText:"",value:r&&r.value?r.value:"",format:O(e.item.id.split(this.parent.element.id+"_")[1]),sheetIndex:this.parent.activeSheetIndex,onLoad:!0},i=this.parent.createElement("div",{className:"e-numformat-text",styles:"width:100%",innerHTML:e.element.innerHTML});e.element.innerHTML="",this.parent.notify("getFormattedCell",n);var a=this.parent.createElement("span",{className:"e-numformat-preview-text",styles:"float:right;",innerHTML:n.formattedText.toString()});i.appendChild(a),e.element.appendChild(i)},e.prototype.refreshRibbonContent=function(e){if(this.ribbon){t.isNullOrUndefined(e)&&(e=this.ribbon.selectedTab);var r=this.parent.serviceLocator.getService(Hi),n=this.parent.getActiveSheet();switch(this.ribbon.items[e].header.text){case r.getConstant("Home"):this.refreshHomeTabContent(u(n.activeCell));break;case r.getConstant("Insert"):case r.getConstant("Formulas"):break;case r.getConstant("Data"):this.refreshDataTabContent(e);break;case r.getConstant("View"):this.refreshViewTabContent(e)}}},e.prototype.refreshHomeTabContent=function(e){t.isNullOrUndefined(document.getElementById(this.parent.element.id+"_number_format"))||(this.numFormatDDB=t.getComponent(document.getElementById(this.parent.element.id+"_number_format"),l.DropDownButton));var r=this.parent.getActiveSheet(),n=u(this.parent.getActiveSheet().activeCell),i=this.parent.serviceLocator.getService(Hi),a=J(n[0],n[1],this.parent.getActiveSheet())||{},o=H(a.format?a.format:"General");if(this.numFormatDDB&&(r.isProtected&&!r.protectSettings.formatCells?(o="General",this.refreshNumFormatSelection(o)):this.refreshNumFormatSelection(i.getConstant(o))),this.fontNameDdb&&(r.isProtected&&!r.protectSettings.formatCells?this.refreshFontNameSelection("Calibri"):this.refreshFontNameSelection(this.getCellStyleValue("fontFamily",e))),this.fontSizeDdb){h=this.getCellStyleValue("fontSize",e);r.isProtected&&!r.protectSettings.formatCells?this.fontSizeDdb.content="11":(h=h.includes("pt")?h.split("pt")[0]:"11")!==this.fontSizeDdb.content&&(this.fontSizeDdb.content=h,this.fontSizeDdb.dataBind())}if(this.textAlignDdb){var s=this.getCellStyleValue("textAlign",e);r.isProtected&&!r.protectSettings.formatCells?this.textAlignDdb.iconCss="e-icons e-left-icon":(void 0===a.value||"left"!==s||"Accounting"!==o&&!L(a.value)||(s="right"),(h="e-icons e-"+s.toLowerCase()+"-icon")!==this.textAlignDdb.iconCss&&(this.textAlignDdb.iconCss=h,this.textAlignDdb.dataBind()))}if(this.verticalAlignDdb){var h="e-icons e-"+this.getCellStyleValue("verticalAlign",e).toLowerCase()+"-icon";r.isProtected&&!r.protectSettings.formatCells?this.verticalAlignDdb.iconCss="e-icons e-bottom-icon":h!==this.verticalAlignDdb.iconCss&&(this.verticalAlignDdb.iconCss=h,this.verticalAlignDdb.dataBind())}if(this.refreshToggleBtn(e),!r.isProtected&&(a.rowSpan>1||a.colSpan>1))this.enableToolbarItems([{tab:i.getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:!0}]),this.toggleActiveState(!0);else{var d=c(r.selectedRange);this.enableToolbarItems([{tab:i.getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:d[0]!==d[2]||d[1]!==d[3]}]),this.toggleActiveState(!1)}},e.prototype.toggleActiveState=function(e){var t=this.parent.serviceLocator.getService(Hi);this.parent.getActiveSheet().isProtected||(e?(this.mergeSplitBtn.element.classList.add("e-active"),this.mergeSplitBtn.element.title=t.getConstant("UnmergeCells")):(this.mergeSplitBtn.element.classList.contains("e-active")&&this.mergeSplitBtn.element.classList.remove("e-active"),this.mergeSplitBtn.element.title=t.getConstant("MergeCells")))},e.prototype.refreshToggleBtn=function(e){var t,r,n,i=this,a=this.parent.getActiveSheet(),o=this.parent.element.id,s=J(e[0],e[1],a),l=["fontWeight","fontStyle","textDecoration","textDecoration"];["bold","italic","line-through","underline","wrap"].forEach(function(h,d){(t=document.getElementById(o+"_"+h))&&(a.isProtected&&!a.protectSettings.formatCells?t.classList.remove("e-active"):"wrap"===h?n=s&&s.wrap:(r=i.getCellStyleValue(l[d],e).toLowerCase(),n=r.indexOf(h)>-1),n?t.classList.add("e-active"):t.classList.contains("e-active")&&t.classList.remove("e-active"))})},e.prototype.refreshFontNameSelection=function(e){e=e.split('"').join(""),this.fontNameDdb.element.firstElementChild.textContent=e;for(var t=0;t<this.fontNameDdb.items.length;t++)if(this.fontNameDdb.items[t].text===e){this.fontNameDdb.items[t].iconCss="e-icons e-selected-icon",t!==this.fontNameIndex&&(this.fontNameDdb.items[this.fontNameIndex].iconCss=""),this.fontNameDdb.setProperties({items:this.fontNameDdb.items},!0),this.fontNameIndex=t;break}["Arial","Arial Black","Axettac Demo","Batang","Book Antiqua","Calibri","Courier","Courier New","Din Condensed","Georgia","Helvetica","Helvetica New","Roboto","Tahoma","Times New Roman","Verdana"].indexOf(e)<0&&(this.fontNameDdb.items[this.fontNameIndex].iconCss="")},e.prototype.refreshNumFormatSelection=function(e){for(var t=0;t<this.numFormatDDB.items.length;t++)""!==this.numFormatDDB.items[t].iconCss&&(this.numFormatDDB.items[t].iconCss=""),this.numFormatDDB.items[t].text===e&&(this.numFormatDDB.items[t].iconCss="e-icons e-selected-icon");this.numFormatDDB.element.firstElementChild.textContent=e,this.numFormatDDB.setProperties({items:this.numFormatDDB.items},!0)},e.prototype.refreshChartThemeSelection=function(e){if(e!==this.chartThemeDDB.items[this.chartThemeIndex].text){this.chartThemeDDB.element.firstElementChild.textContent=this.getChartThemeText(e);for(var t=0;t<this.chartThemeDDB.items.length;t++)if(this.chartThemeDDB.items[t].id===e){this.chartThemeDDB.items[t].iconCss="e-icons e-selected-icon",this.chartThemeDDB.items[this.chartThemeIndex].iconCss="",this.chartThemeDDB.setProperties({items:this.chartThemeDDB.items},!0),this.chartThemeIndex=t;break}}},e.prototype.getChartThemeText=function(e){var t=this.parent.serviceLocator.getService(Hi),r="";switch(e){case"Material":r=t.getConstant("Material");break;case"Fabric":r=t.getConstant("Fabric");break;case"Bootstrap":r=t.getConstant("Bootstrap");break;case"HighContrastLight":r=t.getConstant("HighContrastLight");break;case"MaterialDark":r=t.getConstant("MaterialDark");break;case"FabricDark":r=t.getConstant("FabricDark");break;case"HighContrast":r=t.getConstant("HighContrast");break;case"BootstrapDark":r=t.getConstant("BootstrapDark");break;case"Bootstrap4":r=t.getConstant("Bootstrap4")}return r},e.prototype.fileMenuItemSelect=function(e){var r=this,n=t.extend({cancel:!1},e);this.parent.trigger("fileMenuItemSelect",n);var i,a=this.parent.element.id;if(!n.cancel)switch(e.item.id){case a+"_Open":t.select("#"+a+"_fileUpload",this.parent.element).click();break;case a+"_Xlsx":case a+"_Xls":case a+"_Csv":case a+"_Pdf":this.parent.save({saveType:e.item.id.split(a+"_")[1]});break;case a+"_New":(i=this.parent.serviceLocator.getService(Bi)).show({height:200,width:400,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(Hi).getConstant("DestroyAlert"),beforeOpen:function(e){var t={dialogName:"DestroySheetDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0),Et(r.parent.element)},buttons:[{buttonModel:{content:this.parent.serviceLocator.getService(Hi).getConstant("Ok"),isPrimary:!0},click:function(){r.parent.sheets.length=0,r.parent.createSheet(),i.hide(),r.parent.activeSheetIndex=r.parent.sheets.length-1,r.parent.notify("refreshSheetTabs",{}),r.parent.notify("sheetsDestroyed",{}),r.parent.renderModule.refreshSheet()}}]})}},e.prototype.toolbarClicked=function(e){if("spreadsheet_find"!==e.item.id){var t=this.parent.element.id,r=this.parent.getActiveSheet(),n=void 0,i=void 0,a=void 0,o=void 0,s=void 0;switch(e.item.id){case t+"_headers":if(n={isShow:!r.showHeaders,sheetIdx:this.parent.activeSheetIndex,cancel:!1},this.parent.notify(pr,{eventArgs:n,action:"headers"}),n.cancel)return;this.parent.setSheetPropertyOnMute(r,"showHeaders",!r.showHeaders),this.parent.serviceLocator.getService("sheet").showHideHeaders(),this.toggleRibbonItems({props:"Headers",activeTab:this.ribbon.selectedTab}),Et(this.parent.element);break;case t+"_gridlines":if(i={isShow:!r.showGridLines,sheetIdx:this.parent.activeSheetIndex,cancel:!1},this.parent.notify(pr,{eventArgs:i,action:"gridLines"}),i.cancel)return;this.parent.setSheetPropertyOnMute(r,"showGridLines",!r.showGridLines),this.toggleRibbonItems({props:"GridLines",activeTab:this.ribbon.selectedTab}),Et(this.parent.element);break;case t+"_protect":this.parent.setSheetPropertyOnMute(r,"isProtected",!r.isProtected),a=!r.isProtected,this.parent.notify("applyProtect",{isActive:a,id:t+"_protect"});break;case t+"_undo":this.parent.notify("performUndoRedo",{isUndo:!0});break;case t+"_redo":this.parent.notify("performUndoRedo",{isUndo:!1});break;case t+"_freezepanes":o=u(r.topLeftCell),s=r.frozenRows||r.frozenColumns?o:u(r.activeCell),this.parent.notify("freeze",{row:s[0]-o[0],column:s[1]-o[1],isAction:!0});break;case t+"_freezerows":this.parent.notify("freeze",{row:r.frozenRows?0:u(r.activeCell)[0]-u(r.topLeftCell)[0],column:r.frozenColumns,isAction:!0});break;case t+"_freezecolumns":this.parent.notify("freeze",{row:r.frozenRows,column:r.frozenColumns?0:u(r.activeCell)[1]-u(r.topLeftCell)[1],isAction:!0});break;case t+"_protectworkbook":this.parent.password.length>0?this.parent.notify("unProtectWorkbook",null):this.parent.isProtected?(this.parent.isProtected=!1,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled")),this.toggleRibbonItems({props:"Protectworkbook",activeTab:this.ribbon.selectedTab})):this.parent.element.querySelector(".e-add-sheet-tab").classList.contains("e-disabled")?this.toggleRibbonItems({props:"Protectworkbook",activeTab:this.ribbon.selectedTab}):this.parent.notify("protectWorkbook",null)}this.parent.notify("ribboClick",e)}},e.prototype.toggleRibbonItems=function(e){var r="",n=this.parent.serviceLocator.getService(Hi).getConstant("View"),i=this.parent.serviceLocator.getService(Hi).getConstant("Data");if(this.ribbon.items[this.ribbon.selectedTab].header.text===n){if(t.isNullOrUndefined(e.activeTab))for(var a=0,o=this.ribbon.items.length;a<o;a++)if(this.ribbon.items[a].header.text===n){e.activeTab=a;break}for(var s=this.getLocaleText(e.props,"GridLines"===e.props),l=this.parent.element.id+"_"+e.props.toLowerCase(),h=this.ribbon.items[e.activeTab].content.length,a=void 0;a<h;a++)"Separator"!==this.ribbon.items[e.activeTab].content[a].type&&this.ribbon.items[e.activeTab].content[a].id===l&&(this.ribbon.items[e.activeTab].content[a].text=s,this.ribbon.setProperties({items:this.ribbon.items},!0));this.ribbon.items[this.ribbon.selectedTab].header.text===n&&this.updateToggleText(e.props.toLowerCase(),s)}if(this.ribbon.items[this.ribbon.selectedTab].header.text===i){if(t.isNullOrUndefined(e.activeTab))for(var a=0,d=this.ribbon.items.length;a<d;a++)if(this.ribbon.items[a].header.text===i){e.activeTab=a;break}if((l=this.parent.element.id+"_"+e.props.toLowerCase())===this.parent.element.id+"_protect"){var p=this.ribbon.items[this.ribbon.selectedTab].content.length,c=void 0;for(c=0;c<p&&this.ribbon.items[this.ribbon.selectedTab].content[c].id!==this.parent.element.id+"_protect";c++);r=this.getLocaleProtectText("Sheet",!0)}else if(l===this.parent.element.id+"_protectworkbook"){var u=this.ribbon.items[this.ribbon.selectedTab].content.length,c=void 0;for(c=0;c<u&&this.ribbon.items[this.ribbon.selectedTab].content[c].id!==this.parent.element.id+"_protectworkbook";c++);this.parent.isProtected||this.parent.password.length>0?r=this.getLocaleProtectWorkbook("UnProtectWorkbook"):this.parent.isProtected||(r=this.getLocaleProtectWorkbook("ProtectWorkbook"))}for(var h=this.ribbon.items[e.activeTab].content.length,a=void 0;a<h;a++)"Separator"!==this.ribbon.items[e.activeTab].content[a].type&&this.ribbon.items[e.activeTab].content[a].id===l&&(this.ribbon.items[e.activeTab].content[a].text=r,this.ribbon.setProperties({items:this.ribbon.items},!0));this.ribbon.items[this.ribbon.selectedTab].header.text===i&&this.updateToggleText(e.props.toLowerCase(),r)}},e.prototype.enableFileMenuItems=function(e){this.ribbon.enableMenuItems(e.items,e.enable,e.isUniqueId)},e.prototype.hideRibbonTabs=function(e){this.ribbon.hideTabs(e.tabs,e.hide)},e.prototype.addRibbonTabs=function(e){this.ribbon.addTabs(e.items,e.insertBefore),t.select(".e-ribbon .e-tab-header .e-toolbar-item:not(.e-menu-tab).e-hide",this.parent.element)&&this.parent.updateActiveBorder(t.selectAll(".e-ribbon .e-tab-header .e-toolbar-item:not(.e-menu-tab)",this.parent.element)[this.ribbon.selectedTab])},e.prototype.updateToggleText=function(e,r){var n=this;Be(function(){var i=t.select("#"+n.parent.element.id+"_"+e+" .e-tbar-btn-text",n.ribbon.element);i&&(i.textContent=r)}),"headers"===e&&this.findDialog&&(this.findDialog.position.Y=this.parent.getActiveSheet().showHeaders?31:0,this.findDialog.dataBind())},e.prototype.refreshViewTabContent=function(e){for(var t=this.parent.element.id,r=this.parent.getActiveSheet(),n=this.parent.serviceLocator.getService(Hi),i=0;i<this.ribbon.items[e].content.length;i++)"Separator"!==this.ribbon.items[e].content[i].type&&(this.ribbon.items[e].content[i].id===t+"_headers"&&this.updateViewTabContent(e,"Headers",i),this.ribbon.items[e].content[i].id===t+"_gridlines"&&this.updateViewTabContent(e,"GridLines",i),this.ribbon.items[e].content[i].id===t+"_freezepanes"&&(r.frozenRows||r.frozenColumns?this.ribbon.items[e].content[i].text===n.getConstant("FreezePanes")&&this.updateToggleText("freezepanes",this.updateRibbonItemText("Unfreeze","Panes",i,e)):this.ribbon.items[e].content[i].text===n.getConstant("UnfreezePanes")&&this.updateToggleText("freezepanes",this.updateRibbonItemText("Freeze","Panes",i,e))),this.ribbon.items[e].content[i].id===t+"_freezerows"&&(r.frozenRows?this.ribbon.items[e].content[i].text===n.getConstant("FreezeRows")&&this.updateToggleText("freezerows",this.updateRibbonItemText("Unfreeze","Rows",i,e)):this.ribbon.items[e].content[i].text===n.getConstant("UnfreezeRows")&&this.updateToggleText("freezerows",this.updateRibbonItemText("Freeze","Rows",i,e))),this.ribbon.items[e].content[i].id===t+"_freezecolumns"&&(r.frozenColumns?this.ribbon.items[e].content[i].text===n.getConstant("FreezeColumns")&&this.updateToggleText("freezecolumns",this.updateRibbonItemText("Unfreeze","Columns",i,e)):this.ribbon.items[e].content[i].text===n.getConstant("UnfreezeColumns")&&this.updateToggleText("freezecolumns",this.updateRibbonItemText("Freeze","Columns",i,e))))},e.prototype.updateViewTabContent=function(e,t,r){var n=this.parent.getActiveSheet(),i=this.parent.serviceLocator.getService(Hi);n["show"+t]?this.ribbon.items[e].content[r].text===i.getConstant("Show"+t)&&this.updateToggleText(t.toLowerCase(),this.updateRibbonItemText("Hide",t,r,e)):this.ribbon.items[e].content[r].text===i.getConstant("Hide"+t)&&this.updateToggleText(t.toLowerCase(),this.updateRibbonItemText("Show",t,r,e))},e.prototype.updateRibbonItemText=function(e,t,r,n){var i=this.parent.serviceLocator.getService(Hi).getConstant(e+t);return this.ribbon.items[n].content[r].text=i,this.ribbon.setProperties({items:this.ribbon.items},!0),i},e.prototype.refreshDataTabContent=function(e){for(var t,r=this.parent.element.id,n=0;n<this.ribbon.items[e].content.length;n++)if("Separator"!==this.ribbon.items[e].content[n].type){if(this.ribbon.items[e].content[n].id===r+"_protect"){if(this.updateDataTabContent(e,"Sheet",n),t)break;t=!0}this.ribbon.items[e].content[n].id===r+"_protectworkbook"&&this.updateDataTabContent(e,"Workbook",n)}},e.prototype.updateDataTabContent=function(e,t,r){var n=this.parent.getActiveSheet(),i=this.parent.serviceLocator.getService(Hi);if("Sheet"===t)n.isProtected?this.ribbon.items[e].content[r].text===i.getConstant("Protect"+t)&&(this.ribbon.items[e].content[r].cssClass="e-active",this.updateProtectBtn("Unprotect",t,r,e)):this.updateProtectBtn("Protect",t,r,e);else if("Workbook"===t){var a=this.parent.serviceLocator.getService(Hi);this.parent.isProtected?this.ribbon.items[e].content[r].text===a.getConstant("Protect"+t)&&this.updateToggleText("protectworkbook",this.updateRibbonItemText("UnProtect",t,r,e)):this.ribbon.items[e].content[r].text===a.getConstant("UnProtect"+t)&&this.updateToggleText("protectworkbook",this.updateRibbonItemText("Protect",t,r,e))}},e.prototype.updateProtectBtn=function(e,t,r,n){var i=this.parent.serviceLocator.getService(Hi).getConstant(e+t);this.ribbon.items[n].content[r].text=i,this.ribbon.setProperties({items:this.ribbon.items},!0),this.updateToggleText("protect",i)},e.prototype.updateProtectWorkbookBtn=function(e,t,r,n){var i=this.parent.serviceLocator.getService(Hi).getConstant(e);this.ribbon.items[n].content[r].text=i,this.ribbon.setProperties({items:this.ribbon.items},!0),this.updateToggleText("protectworkbook",i)},e.prototype.addToolbarItems=function(e){this.ribbon.addToolbarItems(e.tab,e.items,e.index)},e.prototype.enableToolbarItems=function(e){var t=this;e.forEach(function(e){t.ribbon.enableItems(e.tab||t.ribbon.items[t.ribbon.selectedTab].header.text,e.items,e.enable)})},e.prototype.createMobileView=function(){var e=this,t=this.parent.element.id,r=this.parent.createElement("div",{className:"e-header-toolbar"}),i=this.parent.createElement("ul");r.appendChild(i);var a=new n.Toolbar({items:[{prefixIcon:"e-tick-icon",align:"Left",id:t+"focused_tick",cssClass:"e-focused-tick"},{template:i,align:"Right",id:t+"file_menu"}],clicked:function(r){switch(r.item.id){case t+"focused_tick":e.parent.element.classList.remove("e-mobile-focused"),e.parent.renderModule.setSheetPanelSize()}},created:function(){var t=new n.Menu({cssClass:"e-mobile e-file-menu",enableRtl:!0,showItemOnClick:!0,items:e.getRibbonMenuItems(),select:e.fileMenuItemSelect.bind(e),beforeOpen:function(t){t.element.parentElement.classList.remove("e-rtl"),e.fileMenuBeforeOpen(t)},beforeClose:e.fileMenuBeforeClose.bind(e)});t.createElement=e.parent.createElement,t.appendTo(i)}});a.createElement=this.parent.createElement,a.appendTo(r),this.parent.element.insertBefore(r,this.parent.element.firstElementChild),this.renderMobileToolbar()},e.prototype.renderMobileToolbar=function(){var e=this,t=this.parent.createElement("div",{className:"e-toolbar-panel e-ribbon"}),r=this.parent.createElement("div"),i=this.parent.createElement("button");t.appendChild(r),t.appendChild(i),t.style.display="block",this.parent.element.appendChild(t);var a=new l.DropDownButton({cssClass:"e-caret-hide",content:this.ribbon.items[0].header.text,items:[{text:this.ribbon.items[0].header.text},{text:this.ribbon.items[1].header.text},{text:this.ribbon.items[2].header.text},{text:this.ribbon.items[3].header.text}],select:function(t){t.item.text!==a.content&&(o.element.style.display="none",a.content=t.item.text,a.dataBind(),o.items=e.ribbon.items[a.items.indexOf(t.item)+1].content,o.width="calc(100% - "+i.getBoundingClientRect().width+"px)",o.element.style.display="",o.dataBind(),o.items[0].text=t.item.text,o.dataBind())},open:function(e){var t=e.element.parentElement,r=t.getBoundingClientRect(),n=h.calculatePosition(a.element,"right","bottom");t.style.left=n.left-r.width+"px",t.style.top=n.top-r.height+"px";for(var i=0;i<a.items.length;i++)if(a.content===a.items[i].text){e.element.children[i].classList.add("e-selected");break}},close:function(){return Et(e.parent.element)}});a.createElement=this.parent.createElement,a.appendTo(i);var o=new n.Toolbar({width:"calc(100% - "+i.getBoundingClientRect().width+"px)",items:this.ribbon.items[0].content,clicked:this.toolbarClicked.bind(this)});o.createElement=this.parent.createElement,o.appendTo(r),t.style.display=""},e.prototype.fileMenuBeforeOpen=function(e){var t,r=this,n=this.parent.serviceLocator.getService(Hi),i=[".xlsx",".xls",".csv",".pdf"];e.parentItem.text===n.getConstant("SaveAs")&&[].slice.call(e.element.children).forEach(function(e,n){t=r.parent.createElement("div",{innerHTML:e.innerHTML}),e.innerHTML="",t.appendChild(r.parent.createElement("span",{className:"e-extension",innerHTML:i[n]})),e.appendChild(t)}),this.parent.trigger("fileMenuBeforeOpen",e)},e.prototype.enableRibbonTabs=function(e){this.ribbon.enableTabs(e.tabs,e.enable)},e.prototype.fileMenuBeforeClose=function(e){this.parent.trigger("fileMenuBeforeClose",e)},e.prototype.hideFileMenuItems=function(e){this.ribbon.hideMenuItems(e.items,e.hide,e.isUniqueId)},e.prototype.addFileMenuItems=function(e){this.ribbon.addMenuItems(e.items,e.text,e.insertAfter,e.isUniqueId)},e.prototype.hideToolbarItems=function(e){this.ribbon.hideToolbarItems(e.tab,e.indexes,e.hide)},e.prototype.protectSheetHandler=function(e){var t=this.parent.getActiveSheet(),r=this.parent.serviceLocator.getService(Hi);t.isProtected&&t.protectSettings.formatCells||!t.isProtected?(this.enableToolbarItems([{tab:r.getConstant("Home"),items:e.enableHomeBtnId,enable:!0}]),this.parent.notify("setUndoRedo",null)):this.enableToolbarItems([{tab:r.getConstant("Home"),items:e.disableHomeBtnId,enable:!1}]),t.isProtected&&t.protectSettings.insertLink||!t.isProtected?this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.enableInsertBtnId,enable:!0}]):this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.enableInsertBtnId,enable:!1}]),t.isProtected&&t.protectSettings.selectCells||!t.isProtected?this.enableToolbarItems([{tab:r.getConstant("Home"),items:e.findBtnId,enable:!0}]):this.enableToolbarItems([{tab:r.getConstant("Home"),items:e.findBtnId,enable:!1}]);var n,i=this.ribbon.items[this.ribbon.selectedTab].content.length;for(n=0;n<i&&this.ribbon.items[this.ribbon.selectedTab].content[n].id!==this.parent.element.id+"_protectworkbook";n++);t.isProtected?(this.parent.isProtected&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook")&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook").querySelector(".e-tbar-btn-text").textContent===r.getConstant("UnProtectWorkbook")?this.ribbon.items[this.ribbon.selectedTab].header.text===r.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[n].text=r.getConstant("UnProtectWorkbook")):this.ribbon.items[this.ribbon.selectedTab].header.text===r.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[n].text=r.getConstant("ProtectWorkbook")),this.enableToolbarItems([{tab:r.getConstant("Data"),items:e.dataValidationBtnId,enable:!1}]),this.enableToolbarItems([{tab:r.getConstant("Formulas"),items:e.enableFrmlaBtnId,enable:!1}]),this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.imageBtnId,enable:!1}]),this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.chartBtnId,enable:!1}])):(this.parent.isProtected&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook")&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook").querySelector(".e-tbar-btn-text").textContent===r.getConstant("UnProtectWorkbook")?this.ribbon.items[this.ribbon.selectedTab].header.text===r.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[n].text=r.getConstant("UnProtectWorkbook")):this.ribbon.items[this.ribbon.selectedTab].header.text===r.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[n].text=r.getConstant("ProtectWorkbook")),this.enableToolbarItems([{tab:r.getConstant("Data"),items:e.dataValidationBtnId,enable:!0}]),this.enableToolbarItems([{tab:r.getConstant("Formulas"),items:e.enableFrmlaBtnId,enable:!0}]),this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.imageBtnId,enable:!0}]),this.enableToolbarItems([{tab:r.getConstant("Insert"),items:e.chartBtnId,enable:!0}]))},e.prototype.updateMergeItem=function(e){if("mousemove"===e.type||"pointermove"===e.type||e.shiftKey&&"mousedown"===e.type){var t=c(this.parent.getActiveSheet().selectedRange);t[1]===t[3]&&t[0]===t[2]||this.parent.getActiveSheet().isProtected||(this.enableToolbarItems([{tab:this.parent.serviceLocator.getService(Hi).getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:!0}]),this.toggleActiveState(!1))}},e.prototype.addEventListener=function(){this.parent.on("ribbon",this.initRibbon,this),this.parent.on("enableToolbarItems",this.enableToolbarItems,this),this.parent.on("activeCellChanged",this.refreshRibbonContent,this),this.parent.on("updateToggleItem",this.toggleRibbonItems,this),this.parent.on("enableFileMenuItems",this.enableFileMenuItems,this),this.parent.on("hideRibbonTabs",this.hideRibbonTabs,this),this.parent.on("addRibbonTabs",this.addRibbonTabs,this),this.parent.on("addToolbarItems",this.addToolbarItems,this),this.parent.on("hideFileMenuItems",this.hideFileMenuItems,this),this.parent.on("addFileMenuItems",this.addFileMenuItems,this),this.parent.on("hideToolbarItems",this.hideToolbarItems,this),this.parent.on("enableRibbonTabs",this.enableRibbonTabs,this),this.parent.on("protectCellFormat",this.protectSheetHandler,this),this.parent.on("selectionComplete",this.updateMergeItem,this),this.parent.on("refreshRibbonIcons",this.refreshRibbonContent,this),this.parent.on("insertDesignChart",this.insertDesignChart,this),this.parent.on("removeDesignChart",this.removeDesignChart,this),this.parent.on("ribbonFind",this.findToolDlg,this)},e.prototype.destroy=function(){var e=this.parent.element,r=this.ribbon.element,n=this.cPickerEle,i=e.id;["bold","italic","line-through","underline"].forEach(function(r){st(t.select("#"+i+"_"+r,e),a.Button)}),this.pasteSplitBtn.destroy(),this.pasteSplitBtn=null,this.mergeSplitBtn.destroy(),this.mergeSplitBtn=null,this.numFormatDDB.destroy(),this.numFormatDDB=null,this.fontSizeDdb.destroy(),this.fontSizeDdb=null,this.fontNameDdb.destroy(),this.fontNameDdb=null,this.textAlignDdb.destroy(),this.textAlignDdb=null,this.verticalAlignDdb.destroy(),this.verticalAlignDdb=null,this.sortingDdb.destroy(),this.sortingDdb=null,this.clearDdb.destroy(),this.clearDdb=null,this.colorPicker.destroy(),this.colorPicker=null,this.bordersMenu.destroy(),this.bordersMenu=null,this.bordersDdb.destroy(),this.bordersDdb=null,this.findDdb.destroy(),this.findDdb=null,this.chartDdb.destroy(),this.chartDdb=null,this.chartMenu.destroy(),this.chartMenu=null,this.cFDdb.destroy(),this.cFDdb=null,this.parent.notify("destroyRibbonComponents",null),this.ribbon.destroy(),r&&t.detach(r),this.ribbon=null,n&&t.detach(n),this.cPickerEle=null,this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("ribbon",this.initRibbon),this.parent.off("enableToolbarItems",this.enableToolbarItems),this.parent.off("activeCellChanged",this.refreshRibbonContent),this.parent.off("updateToggleItem",this.toggleRibbonItems),this.parent.off("enableFileMenuItems",this.enableFileMenuItems),this.parent.off("hideRibbonTabs",this.hideRibbonTabs),this.parent.off("addRibbonTabs",this.addRibbonTabs),this.parent.off("addToolbarItems",this.addToolbarItems),this.parent.off("hideFileMenuItems",this.hideFileMenuItems),this.parent.off("addFileMenuItems",this.addFileMenuItems),this.parent.off("hideToolbarItems",this.hideToolbarItems),this.parent.off("enableRibbonTabs",this.enableRibbonTabs),this.parent.off("protectCellFormat",this.protectSheetHandler),this.parent.off("selectionComplete",this.updateMergeItem),this.parent.off("refreshRibbonIcons",this.refreshRibbonContent),this.parent.off("insertDesignChart",this.insertDesignChart),this.parent.off("removeDesignChart",this.removeDesignChart),this.parent.on("ribbonFind",this.findToolDlg,this))},e}(),vi=function(){function e(e){this.categoryCollection=[],this.formulaCollection=[],this.isGoto=!1,this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"formulaBar"},e.prototype.createFormulaBar=function(e){if(!this.parent.showFormulaBar&&this.insertFnRipple)return void this.destroy();var r=this.parent.serviceLocator.getService(Hi),n=this.parent.element.id,i=this.parent.createElement("div",{className:"e-formula-bar-panel"});if(!this.parent.isMobileView()){var a=this.parent.createElement("input",{id:n+"_name_box",attrs:{type:"text"}});i.appendChild(a),this.comboBoxInstance=new o.ComboBox({value:"A1",cssClass:"e-name-box",width:"",noRecordsTemplate:"",fields:{text:"name",value:"refersTo"},beforeOpen:this.nameBoxBeforeOpen.bind(this),blur:this.nameBoxBlur.bind(this),select:this.nameBoxSelect.bind(this),change:function(){}}),this.comboBoxInstance.createElement=this.parent.createElement,this.comboBoxInstance.appendTo(a),this.comboBoxInstance.element.parentElement.title=r.getConstant("NameBox")}i.appendChild(this.parent.createElement("button",{className:"e-btn e-css e-flat e-icon-btn e-insert-function",attrs:{title:r.getConstant("InsertFunction")}})).appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons"})),this.insertFnRipple=t.rippleEffect(i,{selector:".e-insert-function"}),i.appendChild(this.parent.createElement("div",{className:"e-separator"}));var s=i.appendChild(this.parent.createElement("textarea",{className:"e-formula-bar e-css",id:n+"_formula_input",attrs:{title:r.getConstant("FormulaBar"),spellcheck:"false"}}));s.rows=1,this.parent.isMobileView()?(s.placeholder=r.getConstant("MobileFormulaBarPlaceHolder"),t.EventHandler.add(s,"focus",this.textAreaFocusIn,this),t.EventHandler.add(s,"blur",this.textAreaFocusOut,this)):i.appendChild(this.parent.createElement("span",{className:"e-drop-icon e-icons",attrs:{title:r.getConstant("ExpandFormulaBar")}})),e&&e.uiUpdate?this.parent.element.insertBefore(i,document.getElementById(n+"_sheet_panel")):this.parent.element.appendChild(i)},e.prototype.textAreaFocusIn=function(){var e=this.parent.element.querySelector(".e-formula-bar-panel"),t=this.parent.createElement("button",{className:"e-btn e-css e-flat e-icon-btn e-formula-submit"});t.appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons e-tick-icon"})),e.classList.add("e-focused"),e.appendChild(t)},e.prototype.textAreaFocusOut=function(){var e=this.parent.element.querySelector(".e-formula-bar-panel");e.classList.remove("e-focused"),t.detach(e.querySelector(".e-formula-submit"))},e.prototype.keyDownHandler=function(e){var t=e.target;if(this.parent.isEdit&&!this.parent.getActiveSheet().isProtected){if((q(t.value)||t.validity&&0===t.value.toString().indexOf("="))&&16===e.keyCode)return;t.classList.contains("e-formula-bar")&&this.parent.notify(Qt,{action:"refreshEditor",value:t.value,refreshEditorElem:!0})}},e.prototype.keyUpHandler=function(e){if(this.parent.isEdit){var t=e.target;if(t.classList.contains("e-formula-bar")){var r={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,r),r.editedValue!==t.value&&16!==e.keyCode&&this.parent.notify(Qt,{action:"refreshEditor",value:t.value,refreshEditorElem:!0})}}},e.prototype.nameBoxBeforeOpen=function(e){this.comboBoxInstance.element.classList.contains("e-name-editing")?e.cancel=!0:this.comboBoxInstance.element.select()},e.prototype.nameBoxBlur=function(){this.comboBoxInstance.element.classList.contains("e-name-editing")&&(this.comboBoxInstance.element.classList.remove("e-name-editing"),this.UpdateValueAfterMouseUp())},e.prototype.nameBoxSelect=function(e){if(e.isInteracted){var t=e.itemData.refersTo.substr(1),r=se(this.parent,he(t)),n=C(t),i=fe(this.parent,r);if(-1!==n.indexOf(":")){var a=n.indexOf(":"),o=n.substr(0,a),s=n.substr(a+1,n.length);o=o.replace("$",""),(s=s.replace("$","")).match(/\D/g)&&!s.match(/[0-9]/g)&&o.match(/\D/g)&&!o.match(/[0-9]/g)?n=(o+="1")+":"+(s+=i.rowCount):!s.match(/\D/g)&&s.match(/[0-9]/g)&&!o.match(/\D/g)&&o.match(/[0-9]/g)&&(n=(o=g(parseInt(o,10)-1,0))+":"+(s=g(parseInt(s,10)-1,i.colCount-1)))}r===this.parent.activeSheetIndex?(this.parent.selectRange(n),Et(this.parent.element)):(pe(this.parent,n,i),this.parent.activeSheetIndex=r)}},e.prototype.formulaBarUpdateHandler=function(e){var r,n=this,i=this.parent.getActiveSheet().selectedRange.split(":"),a={action:"getElement",element:null};this.parent.notify(Qt,a);var o=this.parent.element.querySelector(".e-formula-bar"),s=new t.Internationalization;if("mousemove"===e.type||"pointermove"===e.type){var l=c(i[0]),h=c(i[1]);r=Math.abs(l[0]-h[0])+1+"R x "+(Math.abs(l[1]-h[1])+1)+"C",this.parent.isEdit&&(e.target&&!e.target.classList.contains("e-spreadsheet-edit")?this.parent.notify("editValue",null):a.element&&(o.value=a.element.textContent))}else r=i[0],this.parent.getData(Ce(this.parent)+"!"+r).then(function(i){var l,h="";i.forEach(function(i){var d=i&&i.format?H(i.format):"General";i&&(t.isNullOrUndefined(i.value)||(l=A(Number(i.value)),h="Invalid Date"===l.toString()||"ShortDate"!==d&&"LongDate"!==d?"Invalid Date"!==l.toString()&&"Time"===d?s.formatDate(l,{type:"dateTime",skeleton:"yMd"})+" "+s.formatDate(l,{type:"dateTime",skeleton:"hms"}):i.value:s.formatDate(l,{type:"date",skeleton:"yMd"})),i.formula&&(h=i.formula));var p={action:"getCurrentEditValue",editedValue:""};n.parent.notify(Qt,p);var u=p.editedValue&&0===p.editedValue.toString().indexOf("=")||q(p.editedValue),f=document.getElementById(n.parent.element.id+"_formula_input"),g=c(r),m=n.parent.getCell(g[0],g[1]);i&&!i.formula&&m?f.value=m.textContent:f.value=h,t.isNullOrUndefined(h)||u||n.parent.notify(Qt,{action:"refreshEditor",value:f.value,refreshEditorElem:!0}),n.parent.isEdit&&(e.target&&!e.target.classList.contains("e-spreadsheet-edit")?n.parent.notify("editValue",null):a.element&&(o.value=a.element.textContent))})});this.updateComboBoxValue(r)},e.prototype.UpdateValueAfterMouseUp=function(){this.updateComboBoxValue(this.parent.getActiveSheet().selectedRange.split(":")[0])},e.prototype.updateComboBoxValue=function(e){var t=this.parent.getActiveSheet(),r={action:"getNameFromRange",range:Ce(this.parent)+"!"+t.selectedRange,definedName:null};if(this.parent.notify("formulaOperation",r),r.definedName&&(e=r.definedName.name),!this.parent.isMobileView()){if(this.comboBoxInstance.text===e)return;this.comboBoxInstance.text=e,this.comboBoxInstance.dataBind()}},e.prototype.disabletextarea=function(){var e=this.getFormulaBar();this.parent.getActiveSheet().isProtected?e.disabled=!0:e.disabled=!1},e.prototype.formulaBarScrollEdit=function(){var e=c(this.parent.getActiveSheet().selectedRange),t=u(this.parent.getActiveSheet().topLeftCell);e[0]<t[0]&&(this.parent.goTo(this.parent.getActiveSheet().selectedRange),this.isGoto=!0),this.parent.notify(Qt,{action:"startEdit",refreshCurPos:!1})},e.prototype.formulaBarClickHandler=function(e){var r=this,n=e.target,i=this.parent.getActiveSheet(),a=i.isProtected,l=u(i.activeCell),h=X(J(l[0],l[1],i),Te(i,l[1]));if(n.classList.contains("e-drop-icon")&&t.closest(n,".e-formula-bar-panel"))this.toggleFormulaBar(n);else if(n.classList.contains("e-formula-bar"))this.parent.isEdit||a&&(!a||h)?a&&h&&this.parent.notify("editAlert",null):this.formulaBarScrollEdit();else if(n.parentElement&&n.parentElement.classList.contains("e-name-box"))if(n.classList.contains("e-ddl-icon")){c={action:"getNames",names:[]};this.parent.notify("formulaOperation",c),this.comboBoxInstance.dataSource=c.names}else this.comboBoxInstance.element.classList.add("e-name-editing"),this.comboBoxInstance.element.select();if(!t.isNullOrUndefined(n.offsetParent)&&(n.offsetParent.classList.contains("e-insert-function")||n.classList.contains("e-insert-function")||this.parent.element.id+"_insert_function"===n.offsetParent.id||this.parent.element.id+"_insert_function"===n.id||n.parentElement.classList.contains("e-insert-function")||this.parent.element.id+"_insert_function"===n.parentElement.id)){if(a)return void this.parent.notify("editAlert",null);var d=!this.parent.isEdit,p={action:"getCurrentEditValue",editedValue:""};if(!d){var c={action:"isFormulaEditing",isFormulaEdit:!1};this.parent.notify("formulaOperation",c),d=c.isFormulaEdit,this.parent.notify(Qt,p)}if(d||""===p.editedValue){""===p.editedValue&&this.parent.notify(Qt,{action:"refreshEditor",value:"="});var f=this.parent.serviceLocator.getService(Hi),g=this.parent.createElement("div",{className:"e-formula-description",id:this.parent.element.id+"_description_content"}),m=this.parent.createElement("div",{className:"e-category-content",id:this.parent.element.id+"_category_content",innerHTML:f.getConstant("PickACategory")}),v=this.parent.createElement("input",{className:"e-formula-category",id:this.parent.element.id+"_formula_category"}),y=this.parent.createElement("div",{className:"e-formula-list",id:this.parent.element.id+"_formula_list"}),C=this.parent.createElement("div",{className:"e-description-content",innerHTML:f.getConstant("Description")}),b=this.parent.createElement("div",{className:"e-header-content",innerHTML:f.getConstant("InsertFunction")}),x={action:"getFormulaCategory",categoryCollection:[]};this.parent.notify(Lt,x),this.categoryCollection=x.categoryCollection,this.categoryList=new o.DropDownList({dataSource:this.categoryCollection,index:0,width:"285px",popupHeight:"210px",select:this.dropDownSelect.bind(this)});var S={action:"getLibraryFormulas",formulaCollection:[]};this.parent.notify(Lt,S),this.formulaCollection=S.formulaCollection,this.formulaList=new s.ListView({dataSource:this.formulaCollection.sort(),actionComplete:this.updateFormulaList.bind(this),select:this.listSelected.bind(this),width:"285px",height:"200px"}),this.dialog=this.parent.serviceLocator.getService("dialog"),this.dialog.show({header:b.outerHTML,content:m.outerHTML+v.outerHTML+y.outerHTML+C.outerHTML+g.outerHTML,width:"320px",height:"485px",cssClass:"e-spreadsheet-function-dlg",showCloseIcon:!0,isModal:!0,beforeOpen:function(e){var t={dialogName:"InsertFunctionDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0),Et(r.parent.element)},open:this.dialogOpen.bind(this),beforeClose:this.dialogBeforeClose.bind(this),close:this.dialogClose.bind(this),buttons:[{click:this.selectFormula.bind(this,this.dialog,this),buttonModel:{content:f.getConstant("Ok"),isPrimary:!0}}]}),this.categoryList.appendTo("#"+this.parent.element.id+"_formula_category"),this.formulaList.appendTo("#"+this.parent.element.id+"_formula_list"),t.EventHandler.add(this.formulaList.element,"dblclick",this.formulaClickHandler,this)}}},e.prototype.toggleFormulaBar=function(e){var t=e.parentElement,r=this.parent.serviceLocator.getService(Hi);t.classList.contains("e-expanded")?(t.classList.remove("e-expanded"),document.getElementById(this.parent.element.id+"_formula_input").rows=1,e.title=r.getConstant("ExpandFormulaBar")):(t.classList.add("e-expanded"),document.getElementById(this.parent.element.id+"_formula_input").rows=3,e.title=r.getConstant("CollapseFormulaBar")),this.parent.setPanelSize()},e.prototype.dialogOpen=function(){this.focusOkButton()},e.prototype.dialogClose=function(){var e={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,e),"="===e.editedValue.toString().trim()&&this.parent.notify(Qt,{action:"refreshEditor",value:""})},e.prototype.dialogBeforeClose=function(){t.EventHandler.remove(this.formulaList.element,"dblclick",this.formulaClickHandler);var e=document.getElementById("_dialog-content");e.parentNode.removeChild(e),this.dialog.dialogInstance.storeActiveElement=document.getElementById(this.parent.element.id+"_edit")},e.prototype.selectFormula=function(e,t){var r=t.formulaList.getSelectedItems().text,n=fe(this.parent,this.parent.activeSheetIndex);this.parent.isEdit?this.parent.notify(Qt,{action:"refreshEditor",value:r+"(",refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!0}):(this.parent.notify(Qt,{action:"startEdit",value:"="+r+"(",address:n.activeCell}),this.parent.notify("formulaBarOperation",{action:"refreshFormulabar",value:"="+r+"("})),e.hide()},e.prototype.listSelected=function(){this.updateFormulaDescription()},e.prototype.updateFormulaList=function(){this.activeListFormula(),this.updateFormulaDescription()},e.prototype.dropDownSelect=function(e){this.formulaCollection=[];var t={action:"getLibraryFormulas",formulaCollection:[]};if("All"===e.item.textContent)this.parent.notify(Lt,t),this.formulaCollection=t.formulaCollection;else{var r={action:"dropDownSelectFormulas",formulaCollection:[],selectCategory:e.item.textContent};this.parent.notify(Lt,r),this.formulaCollection=r.formulaCollection}this.formulaList.dataSource=this.formulaCollection.sort()},e.prototype.focusOkButton=function(){document.getElementById("_dialog-content").nextElementSibling.firstElementChild.focus()},e.prototype.activeListFormula=function(){var e=document.getElementById(this.parent.element.id+"_formula_list").children[0].children[0].firstElementChild;this.formulaList.selectItem(e)},e.prototype.updateFormulaDescription=function(){var e=this.formulaList.getSelectedItems().text,t={action:"getFormulaDescription",description:"",selectedList:e};this.parent.notify(Lt,t),this.focusOkButton();var r=document.getElementById(this.parent.element.id+"_description_content");e="AND"===e?"CalculateAND":"OR"===e?"CalculateOR":e,r.innerHTML=this.parent.serviceLocator.getService(Hi).getConstant(e)},e.prototype.formulaClickHandler=function(e){var t=e.target,r=fe(this.parent,this.parent.activeSheetIndex);(t.offsetParent.classList.contains("e-text-content")||t.classList.contains("e-list-item"))&&(this.parent.isEdit?this.parent.notify(Qt,{action:"refreshEditor",value:t.innerText+"(",refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!0}):(this.parent.notify(Qt,{action:"startEdit",value:"="+t.innerText+"(",address:r.activeCell}),this.parent.notify("formulaBarOperation",{action:"refreshFormulabar",value:"="+t.innerText+"("})),this.dialog.hide())},e.prototype.addEventListener=function(){this.parent.on("formulaBar",this.createFormulaBar,this),this.parent.on(er,this.formulaBarClickHandler,this),this.parent.on(rr,this.keyDownHandler,this),this.parent.on(tr,this.keyUpHandler,this),this.parent.on("selectionComplete",this.formulaBarUpdateHandler,this),this.parent.on("mouseUpAfterSelection",this.UpdateValueAfterMouseUp,this),this.parent.on("formulaBarOperation",this.editOperationHandler,this),this.parent.on("enableFormulaInput",this.disabletextarea,this),this.parent.on("isFormulaBarEdit",this.isFormulaBarEdit,this)},e.prototype.destroy=function(){this.removeEventListener(),this.comboBoxInstance.destroy(),this.comboBoxInstance=null,this.insertFnRipple(),this.insertFnRipple=null;var e=this.parent.element.querySelector(".e-formula-bar-panel");e&&t.detach(e)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("formulaBar",this.createFormulaBar),this.parent.off(er,this.formulaBarClickHandler),this.parent.off(rr,this.keyDownHandler),this.parent.off(tr,this.keyUpHandler),this.parent.off("selectionComplete",this.formulaBarUpdateHandler),this.parent.off("mouseUpAfterSelection",this.UpdateValueAfterMouseUp),this.parent.off("formulaBarOperation",this.editOperationHandler),this.parent.off("enableFormulaInput",this.disabletextarea),this.parent.off("isFormulaBarEdit",this.isFormulaBarEdit))},e.prototype.editOperationHandler=function(e){switch(e.action){case"refreshFormulabar":this.getFormulaBar().value=t.isUndefined(e.value)?"":e.value;break;case"getElement":e.element=this.getFormulaBar()}},e.prototype.isFormulaBarEdit=function(e){this.parent.isEdit&&this.isGoto?e.isEdit=!0:e.isEdit=!1},e.prototype.getFormulaBar=function(){return t.select("#"+this.parent.element.id+"_formula_input",this.parent.element)},e}(),yi=function(){function e(e){this.isFormulaBar=!1,this.isFormula=!1,this.isPopupOpened=!1,this.isPreventClose=!1,this.isSubFormula=!1,this.keyCodes={UP:38,DOWN:40,LEFT:37,RIGHT:39,FIRSTALPHABET:65,LASTALPHABET:90,SPACE:32,BACKSPACE:8,TAB:9,DELETE:46,ENTER:13,ESC:27},this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"formula"},e.prototype.destroy=function(){this.removeEventListener(),this.autocompleteInstance&&(this.autocompleteInstance.destroy(),this.autocompleteInstance.element&&this.autocompleteInstance.element.remove()),this.autocompleteInstance=null,this.parent=null},e.prototype.addEventListener=function(){this.parent.on("formulaOperation",this.performFormulaOperation,this),this.parent.on(tr,this.keyUpHandler,this),this.parent.on(rr,this.keyDownHandler,this),this.parent.on(er,this.formulaClick,this),this.parent.on("refreshFormulaDatasource",this.refreshFormulaDatasource,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("formulaOperation",this.performFormulaOperation),this.parent.off(tr,this.keyUpHandler),this.parent.off(rr,this.keyDownHandler),this.parent.off(er,this.formulaClick),this.parent.off("refreshFormulaDatasource",this.refreshFormulaDatasource))},e.prototype.performFormulaOperation=function(e){var t=this,r=e.action,n=this.parent.serviceLocator.getService(Hi);switch(r){case"renderAutoComplete":this.renderAutoComplete();break;case"endEdit":this.endEdit();break;case"addDefinedName":e.isAdded=this.addDefinedName(e.definedName);break;case"getNames":e.sheetName||(e.sheetName=Ce(this.parent)),e.names=this.getNames(e.sheetName);break;case"getNameFromRange":e.definedName=this.getNameFromRange(e.range);break;case"isFormulaEditing":e.isFormulaEdit=this.isFormula;break;case"isCircularReference":this.parent.serviceLocator.getService(Bi).show({height:180,width:400,isModal:!0,showCloseIcon:!0,content:n.getConstant("CircularReference"),beforeOpen:function(e){var r={dialogName:"CircularReferenceDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0)}}),e.argValue="0"}},e.prototype.renderAutoComplete=function(){if(!t.select("#"+this.parent.element.id+"_ac",this.parent.element)){var e=this.parent.createElement("input",{id:this.parent.element.id+"_ac",className:"e-ss-ac"});this.parent.element.appendChild(e);var r={action:"getLibraryFormulas",formulaCollection:[]};this.parent.notify(Lt,r);var n={dataSource:r.formulaCollection,cssClass:"e-ss-atc",popupWidth:"130px",allowFiltering:!0,filterType:"StartsWith",sortOrder:"Ascending",open:this.onSuggestionOpen.bind(this),close:this.onSuggestionClose.bind(this),select:this.onSelect.bind(this),actionComplete:this.onSuggestionComplete.bind(this)};this.autocompleteInstance=new o.AutoComplete(n,e),this.autocompleteInstance.createElement=this.parent.createElement}},e.prototype.onSuggestionOpen=function(e){var t=this;this.isPopupOpened=!0,e.popup.relateTo=this.getRelateToElem(),e.popup.element.firstChild.style.maxHeight="180px",new Promise(function(e,t){setTimeout(function(){e()},100)}).then(function(){t.triggerKeyDownEvent(t.keyCodes.DOWN)})},e.prototype.onSuggestionClose=function(e){this.isPreventClose?e.cancel=!0:this.isPopupOpened=!1},e.prototype.onSelect=function(e){var t="="+e.itemData.value+"(";if(this.isSubFormula){var r=this.getEditingValue(),n=r.lastIndexOf(this.getArgumentSeparator());n>-1?t=r.slice(0,n+1):(n=r.lastIndexOf("("))>-1&&(t=r.slice(0,n+1)),t+=e.itemData.value+"("}this.parent.notify(Qt,{action:"refreshEditor",value:t,refreshFormulaBar:!0,refreshEditorElem:!0,refreshCurPos:!this.isFormulaBar})},e.prototype.onSuggestionComplete=function(e){this.isPreventClose=e.result.length>0,this.isPreventClose||(e.cancel=!0,this.hidePopUp())},e.prototype.refreshFormulaDatasource=function(){var e={action:"getLibraryFormulas",formulaCollection:[]};this.parent.notify(Lt,e),this.autocompleteInstance.dataSource=e.formulaCollection},e.prototype.keyUpHandler=function(e){if(this.parent.isEdit){var t=this.getEditingValue();this.isFormula=q(t),(this.isFormula||this.isPopupOpened)&&(e.keyCode!==this.keyCodes.TAB&&this.isFormula&&(t=this.getSuggestionKeyFromFormula(t)),this.refreshFormulaSuggestion(e,t))}else this.isPopupOpened&&this.hidePopUp()},e.prototype.keyDownHandler=function(e){var t=e.keyCode;if(this.isFormula){if(this.isPopupOpened)switch(t){case this.keyCodes.UP:case this.keyCodes.DOWN:e.preventDefault(),this.triggerKeyDownEvent(t);break;case this.keyCodes.TAB:e.preventDefault(),this.triggerKeyDownEvent(this.keyCodes.ENTER)}}else{var r=e.target;if(r.id===this.parent.element.id+"_name_box")switch(t){case this.keyCodes.ENTER:this.addDefinedName({name:r.value}),Et(this.parent.element);break;case this.keyCodes.ESC:Et(this.parent.element)}}},e.prototype.formulaClick=function(e){if(this.parent.isEdit){var t=e.target;this.isFormulaBar=t.classList.contains("e-formula-bar")}},e.prototype.refreshFormulaSuggestion=function(e,t){if(t.length>0){var r=this.autocompleteInstance.element,n=e.keyCode,i=this.isPopupOpened;this.isNavigationKey(n)||(r.value=t,r.dispatchEvent(new Event("input")),r.dispatchEvent(new Event("keyup")),i&&this.triggerKeyDownEvent(this.keyCodes.DOWN))}else this.isPopupOpened&&(this.isPreventClose=!1,this.hidePopUp())},e.prototype.endEdit=function(){if(this.isSubFormula=!1,this.isPreventClose=!1,this.isFormula=!1,this.isFormulaBar=!1,this.isPopupOpened){this.hidePopUp();var e=t.select("#"+this.parent.element.id+"_ac_popup");e&&t.detach(e),this.isPopupOpened=!1}},e.prototype.hidePopUp=function(){this.autocompleteInstance.hidePopup()},e.prototype.getSuggestionKeyFromFormula=function(e){var t="";if(e=e.substr(1)){var r=e.lastIndexOf("("),n=(e=e.substr(r+1)).split(this.getArgumentSeparator());1===n.length?(t=n[0],this.isSubFormula=r>-1):(t=n[n.length-1],this.isSubFormula=!0);var i=t.match(/\w/);(!i||i&&0!==i.index)&&(t="")}return t},e.prototype.getRelateToElem=function(){var e={action:"getElement"};return this.isFormulaBar?this.parent.notify("formulaBarOperation",e):this.parent.notify(Qt,e),e.element},e.prototype.getEditingValue=function(){var e={action:"getCurrentEditValue",editedValue:""};return this.parent.notify(Qt,e),e.editedValue},e.prototype.isNavigationKey=function(e){return e===this.keyCodes.UP||e===this.keyCodes.DOWN||e===this.keyCodes.LEFT||e===this.keyCodes.RIGHT},e.prototype.triggerKeyDownEvent=function(e){var t=this.autocompleteInstance.element;t.dispatchEvent(new Event("input"));var r=new Event("keydown");r.keyCode=e,r.which=e,r.altKey=!1,r.shiftKey=!1,r.ctrlKey=!1,t.dispatchEvent(r)},e.prototype.getArgumentSeparator=function(){if(this.argumentSeparator)return this.argumentSeparator;var e={action:"getArgumentSeparator",argumentSeparator:""};return this.parent.notify(Lt,e),this.argumentSeparator=e.argumentSeparator,e.argumentSeparator},e.prototype.getNames=function(e){return this.parent.definedNames.filter(function(t){return"Workbook"===t.scope||""===t.scope||t.scope===e})},e.prototype.getNameFromRange=function(e){var t=e.slice(0,e.indexOf(":")),r=e.slice(e.indexOf("!")+1).split(":"),n=r.length>1&&r[0]===r[1],i=this.parent.definedNames.filter(function(r){return!(!n||r.refersTo!=="="+t)||r.refersTo==="="+e});return i&&i[0]},e.prototype.addDefinedName=function(e){var r=this,n=e.name,i=!1;if(n&&j(n.toUpperCase()))return this.parent.goTo(n),i;if(!e.refersTo){var a=fe(this.parent,this.parent.activeSheetIndex),o=Ce(this.parent);o=-1!==o.indexOf(" ")?"'"+o+"'":o;var s=a.selectedRange;if(!t.isNullOrUndefined(s)){var l=s.indexOf(":"),h=s.substr(0,l),d=s.substr(l+1,s.length);parseInt(d.replace(/\D/g,""),10)===a.rowCount&&1===parseInt(h.replace(/\D/g,""),10)?(d=d.replace(/[0-9]/g,""),s="$"+(h=h.replace(/[0-9]/g,""))+":$"+d):u(d)[1]===a.colCount-1&&0===u(h)[1]?(d=d.replace(/\D/g,""),s="$"+(h=h.replace(/\D/g,""))+":$"+d):s=h===d?h:s}e.refersTo=o+"!"+s,e.scope="Workbook"}if(n.length>0&&/^([a-zA-Z_0-9.]){0,255}$/.test(n)){var p={action:"addDefinedName",definedName:e,isAdded:!1};this.parent.notify(Lt,p),i=p.isAdded,p.isAdded||this.parent.serviceLocator.getService(Bi).show({content:this.parent.serviceLocator.getService(Hi).getConstant("DefineNameExists"),width:"300",beforeOpen:function(e){var t={dialogName:"DefineNameExistsDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}})}else this.parent.serviceLocator.getService(Bi).show({content:this.parent.serviceLocator.getService(Hi).getConstant("DefineNameInValid"),width:"300",beforeOpen:function(e){var t={dialogName:"DefineNameInValidDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}});return i},e}(),Ci=function(){function e(e){this.aggregateContent="",this.isSelectCancel=!1,this.selaggregateCnt="Sum",this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"sheetTabs"},e.prototype.createSheetTabs=function(){var e=this;if(!this.parent.showSheetTabs&&this.tabInstance)return void this.destroy();var r=this.parent.serviceLocator.getService(Hi),i=this.parent.createElement("div",{className:"e-sheet-tab-panel",id:this.parent.element.id+"_sheet_tab_panel"}),a=this.parent.createElement("button",{className:"e-add-sheet-tab e-btn e-css e-flat e-icon-btn"+(this.parent.allowInsert?"":" e-disabled"),attrs:{title:r.getConstant("AddSheet")}});a.appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons e-add-icon"})),a.addEventListener("click",this.addSheetTab.bind(this)),a.disabled=!this.parent.allowInsert,i.appendChild(a),this.addBtnRipple=t.rippleEffect(i,{selector:".e-add-sheet-tab"});var o=this.parent.createElement("button",{attrs:{title:r.getConstant("ListAllSheets")}});i.appendChild(o),this.parent.element.appendChild(i);var s=this.getSheetTabItems();this.dropDownInstance=new l.DropDownButton({iconCss:"e-icons",items:s.ddbItems,beforeItemRender:function(t){var r=e.parent.sheets[e.dropDownInstance.items.indexOf(t.item)];"Hidden"===r.state?t.element.classList.add("e-hide"):"VeryHidden"===r.state&&(t.element.style.display="none")},select:function(t){return e.updateSheetTab({idx:e.dropDownInstance.items.indexOf(t.item)})},beforeOpen:function(t){return e.beforeOpenHandler(e.dropDownInstance,t.element)},open:function(t){return e.openHandler(e.dropDownInstance,t.element,"left")},cssClass:"e-sheets-list e-flat e-caret-hide",close:function(){return Et(e.parent.element)}}),this.dropDownInstance.createElement=this.parent.createElement,this.dropDownInstance.appendTo(o);var h=this.parent.createElement("div",{className:"e-sheet-tab"});this.tabInstance=new n.Tab({selectedItem:this.parent.activeSheetIndex,overflowMode:"Scrollable",items:s.tabItems,scrollStep:250,selecting:function(t){var r={currentSheetIndex:t.selectingIndex,previousSheetIndex:t.selectedIndex,cancel:!1};e.isSelectCancel||e.parent.notify(cr,{eventArgs:r,action:"gotoSheet"}),e.isSelectCancel=r.cancel},selected:function(t){if(t.selectedIndex!==t.previousIndex){if(e.parent.notify("removeDesignChart",{}),e.parent.isEdit){var r=window.getSelection(),n={action:"getCurrentEditValue",editedValue:""};e.parent.notify(Qt,n);var i=!!n.editedValue&&q(n.editedValue,!0);!i&&r&&r.focusNode&&r.focusNode.classList&&r.focusNode.classList.contains("e-formula-bar-panel")&&(i=q(e.parent.element.querySelector(".e-formula-bar").value,!0)),i||e.parent.endEdit()}if(e.isSelectCancel)e.tabInstance.selectedItem=t.previousIndex,e.tabInstance.dataBind(),Et(e.parent.element);else{e.parent.activeSheetIndex=t.selectedIndex,e.parent.dataBind(),e.updateDropDownItems(t.selectedIndex,t.previousIndex),Et(e.parent.element);var a={previousSheetIndex:t.previousIndex,currentSheetIndex:t.selectedIndex};e.parent.notify(pr,{eventArgs:a,action:"gotoSheet"});var o={action:"registerGridInCalc",sheetID:(t.selectedIndex+1).toString()};e.parent.notify(Lt,o)}}},created:function(){var r=e.tabInstance.element.querySelector(".e-toolbar-items");r.classList.add("e-sheet-tabs-items"),t.EventHandler.add(r,"dblclick",e.renameSheetTab,e)}}),i.appendChild(h),this.tabInstance.createElement=this.parent.createElement,this.tabInstance.appendTo(h),t.EventHandler.remove(this.tabInstance.element,"keydown",this.tabInstance.spaceKeyDown);for(var d=s.tabItems.length,p=0;p<d;p++){var c={action:"addSheet",sheetName:"Sheet"+(p+1),index:p+1,visibleName:Ce(this.parent,p)};this.parent.notify(Lt,c)}this.parent.notify(Lt,{action:"initiateDefinedNames"}),this.parent.notify("protectSheet",null)},e.prototype.updateDropDownItems=function(e,t){t>-1&&(this.dropDownInstance.items[t].iconCss=""),this.dropDownInstance.items[e].iconCss="e-selected-icon e-icons",this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0)},e.prototype.beforeOpenHandler=function(e,t){var r=this.parent.viewport.height;parseInt(getComputedStyle(t.firstElementChild).height,10)*e.items.length+2*parseInt(getComputedStyle(t).paddingTop,10)>r&&(t.style.height=r+"px",t.style.overflowY="auto"),t.parentElement.style.visibility="hidden"},e.prototype.openHandler=function(e,t,r){var n,i=t.parentElement;if(-1===h.isCollide(i).indexOf("bottom")){n="auto"===t.style.overflowY?this.parent.viewport.height:i.getBoundingClientRect().height;var a=h.calculatePosition(e.element,r,"top");"right"===r&&(a.left-=i.getBoundingClientRect().width),i.style.left=a.left+"px",i.style.top=a.top-n+"px"}i.style.visibility=""},e.prototype.getSheetTabItems=function(){var e,t=this,r=[],n=[];return this.parent.sheets.forEach(function(i,a){e=Ce(t.parent,a),r.push({header:{text:e},visible:"Visible"===i.state}),n.push({text:e,iconCss:a===t.parent.activeSheetIndex?"e-selected-icon e-icons":""})}),{tabItems:r,ddbItems:n}},e.prototype.refreshSheetTab=function(){var e=this.getSheetTabItems();this.dropDownInstance.items=e.ddbItems,this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),this.tabInstance.items=e.tabItems,this.tabInstance.selectedItem=this.parent.activeSheetIndex,this.tabInstance.dataBind()},e.prototype.addSheetTab=function(){var e={action:"getCurrentEditValue",editedValue:""};this.parent.notify(Qt,e),this.parent.notify(Ht,{model:this.parent,start:this.parent.activeSheetIndex+1,end:this.parent.activeSheetIndex+1,modelType:"Sheet",isAction:!0,activeSheetIndex:this.parent.activeSheetIndex+1}),Et(this.parent.element)},e.prototype.insertSheetTab=function(e){this.parent.notify("removeDesignChart",{}),e.preventUpdate&&e.startIdx!==this.tabInstance.selectedItem||(this.dropDownInstance.items[this.tabInstance.selectedItem].iconCss="");for(var t=e.startIdx;t<=e.endIdx;t++){var r=this.parent.sheets[t].name;this.dropDownInstance.items.splice(t,0,{text:r}),this.tabInstance.addTab([{header:{text:r},content:""}],t)}e.preventUpdate&&e.startIdx!==this.tabInstance.selectedItem||(this.dropDownInstance.items[e.startIdx].iconCss="e-selected-icon e-icons"),this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),e.preventUpdate?e.startIdx!==this.tabInstance.selectedItem&&this.refreshSheetTab():this.updateSheetTab({idx:e.startIdx})},e.prototype.updateSheetTab=function(e){if("activeSheetChanged"===e.name)e.idx=this.parent.skipHiddenSheets(e.idx);else if("Hidden"===this.parent.sheets[e.idx].state){if(this.parent.isProtected)return;this.parent.setSheetPropertyOnMute(this.parent.sheets[e.idx],"state","Visible"),this.tabInstance.hideTab(e.idx,!1)}this.tabInstance.selectedItem=e.idx,this.tabInstance.dataBind(),this.parent.notify("protectSheet",null)},e.prototype.switchSheetTab=function(e){var r=t.closest(e.event.target,".e-toolbar-item");if(r){for(var n=r.querySelector(".e-tab-text").textContent,i=0,a=this.tabInstance.items.length;i<a;i++)if(this.tabInstance.items[i].header.text===n){this.parent.activeSheetIndex!==i&&this.updateSheetTab({idx:i});break}e.element.classList.contains("e-contextmenu")&&e.items[0]&&e.items[0].id===this.parent.element.id+"_cmenu_insert_sheet"&&(1===this.skipHiddenSheets()&&(e.element.children[1].classList.add("e-disabled"),e.element.children[3].classList.add("e-disabled")),this.parent.allowInsert||e.element.children[0].classList.add("e-disabled"),this.parent.allowDelete||e.element.children[1].classList.add("e-disabled")),(this.parent.password.length>0||this.parent.isProtected)&&(e.element.children[0].classList.add("e-disabled"),e.element.children[1].classList.add("e-disabled"),e.element.children[2].classList.add("e-disabled"),e.element.children[3].classList.add("e-disabled"))}},e.prototype.skipHiddenSheets=function(){var e=this.parent.sheets.length;return this.parent.sheets.forEach(function(t){"Visible"!==t.state&&--e}),e},e.prototype.renameSheetTab=function(){var e=this.tabInstance.element.querySelector(".e-toolbar-item.e-active");if(e){var r=(e=e.querySelector(".e-text-wrap")).querySelector(".e-tab-text").textContent,n={eventArgs:{name:r,index:this.parent.getActiveSheet().id},action:"renameSheet",cancel:!1};if(this.parent.trigger("actionBegin",n),n.cancel)return;var i=this.parent.createElement("input",{id:this.parent.element.id+"_rename_input",className:"e-input e-sheet-rename",styles:"width: "+e.getBoundingClientRect().width+"px",attrs:{type:"text",name:"Rename",required:"",value:r,spellcheck:"false",maxlength:"31"}});e.firstElementChild.style.display="none",e.appendChild(i),t.EventHandler.add(document,"mousedown touchstart",this.renameInputFocusOut,this),t.EventHandler.add(i,"input",this.updateWidth,this),i.focus(),i.setSelectionRange(0,r.length),t.EventHandler.remove(t.closest(e,".e-toolbar-items"),"dblclick",this.renameSheetTab)}},e.prototype.updateWidth=function(e){var t=e.target,r=t.value.length,n=t.value.split(" ");if(n.length){var i=n.length-1;r-=i,r+=.5*i}t.style.width=r+"ch"},e.prototype.renameInputFocusOut=function(e){var r=e.target;if("mousedown"!==e.type&&"touchstart"!==e.type||!r.classList.contains("e-sheet-rename")&&!t.closest(r,".e-dlg-container")){if(r=document.getElementById(this.parent.element.id+"_rename_input"),"keydown"===e.type&&27===e.keyCode)return this.removeRenameInput(r),void Et(this.parent.element);var n=r.value,i=this.parent.serviceLocator.getService(Hi);if(n){var a=this.tabInstance.selectedItem;if(n.match(new RegExp(".*[\\[\\]\\*\\\\/\\?].*")))this.showRenameDialog(r,i.getConstant("SheetRenameInvalidAlert"));else{if(this.tabInstance.items[a].header.text!==n)for(var o=0,s=this.parent.sheets.length;o<s;o++)if(o!==this.parent.activeSheetIndex&&this.parent.sheets[o].name.toLowerCase()===n.toLowerCase())return void this.showRenameDialog(r,i.getConstant("SheetRenameAlreadyExistsAlert"));var l=this.removeRenameInput(r);this.tabInstance.items[a].header.text!==n&&(this.parent.setSheetPropertyOnMute(this.parent.sheets[a],"name",n),this.updateSheetName({value:n,idx:a,items:l})),("keydown"===e.type||t.closest(e.target,".e-spreadsheet"))&&Et(this.parent.element)}}else this.showRenameDialog(r,i.getConstant("SheetRenameEmptyAlert"));var h=this.parent.getActiveSheet().id,d={action:"renameUpdation",value:n,sheetId:h};this.parent.notify(Lt,d);var p={index:h,value:n};this.parent.notify(pr,{eventArgs:p,action:"renameSheet"})}},e.prototype.updateSheetName=function(e){this.tabInstance.items[e.idx].header.text=e.value,this.dropDownInstance.items[e.idx].text=e.value,this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),e.value.indexOf(" ")>-1?(this.tabInstance.setProperties({items:this.tabInstance.items},!0),e.items.querySelector(".e-toolbar-item.e-active .e-tab-text").textContent=e.value):(e.items.querySelector(".e-toolbar-item.e-active .e-tab-text").textContent=e.value,this.tabInstance.dataBind())},e.prototype.hideSheet=function(){this.parent.setSheetPropertyOnMute(this.parent.getActiveSheet(),"state","Hidden"),this.tabInstance.hideTab(this.parent.activeSheetIndex)},e.prototype.removeRenameInput=function(e){var r=e.parentElement.querySelector(".e-tab-text"),n=t.closest(e,".e-toolbar-items");return t.EventHandler.add(n,"dblclick",this.renameSheetTab,this),t.EventHandler.remove(document,"mousedown touchstart",this.renameInputFocusOut),t.EventHandler.remove(e,"input",this.updateWidth),t.remove(e),r.style.display="",n},e.prototype.showRenameDialog=function(e,t){var r=this;this.parent.serviceLocator.getService(Bi).show({target:document.getElementById(this.parent.element.id+"_sheet_panel"),height:180,width:400,isModal:!0,showCloseIcon:!0,content:t,beforeOpen:function(t){var n={dialogName:"SheetRenameDialog",element:t.element,target:t.target,cancel:t.cancel};r.parent.trigger("dialogBeforeOpen",n),n.cancel&&(t.cancel=!0),e.focus()},close:function(){return e.setSelectionRange(0,e.value.length)}})},e.prototype.focusRenameInput=function(){var e=document.getElementById(this.parent.element.id+"_rename_input");e&&e.focus()},e.prototype.removeSheetTab=function(e){var t=this;if(!e.count||e.count!==this.parent.sheets.length){var r=this.parent.serviceLocator.getService(Hi);if(this.skipHiddenSheets()>1){var n=e.sheetName?fe(this.parent,se(this.parent,e.sheetName)):this.parent.getActiveSheet(),i=e.index||se(this.parent,n.name),a={index:i,sheetCount:this.parent.sheets.length,sheetName:n.name};if(!(!n.rows||!n.rows.length)&&(1!==n.rows.length||!(!n.rows[0].cells||!n.rows[0].cells.length))){var o=this.parent.serviceLocator.getService(Bi);e.clicked?this.forceDelete(i):o.show({height:200,width:400,isModal:!0,showCloseIcon:!0,content:r.getConstant("DeleteSheetAlert"),beforeOpen:function(e){var r={dialogName:"DeleteSheetDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0),Et(t.parent.element)},buttons:[{buttonModel:{content:r.getConstant("Ok"),isPrimary:!0},click:function(){o.hide(),t.forceDelete(i),t.parent.notify("clearUndoRedoCollection",null),e&&!e.isAction&&(a.sheetCount=t.parent.sheets.length,t.parent.notify(pr,{eventArgs:a,action:"removeSheet"}))}}]})}else{var s={action:"deleteSheetTab",sheetName:"",index:i+1};this.parent.notify(Lt,s),this.destroySheet(i),this.parent.notify("clearUndoRedoCollection",null),e&&!e.isAction&&(a.sheetCount=this.parent.sheets.length,this.parent.notify(pr,{eventArgs:a,action:"removeSheet"}))}}else this.parent.serviceLocator.getService(Bi).show({target:document.getElementById(this.parent.element.id+"_sheet_panel"),height:180,width:400,isModal:!0,showCloseIcon:!0,content:r.getConstant("DeleteSingleLastSheetAlert"),beforeOpen:function(e){var r={dialogName:"DeleteSingleSheetDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0),Et(t.parent.element)}})}},e.prototype.forceDelete=function(e){var t={action:"deleteSheetTab",sheetName:"",index:e+1};this.parent.notify("removeDesignChart",{}),this.parent.notify(Lt,t),this.destroySheet(e)},e.prototype.destroySheet=function(e){var t=e||this.parent.activeSheetIndex;this.parent.removeSheet(t),this.parent.notify("sheetsDestroyed",{sheetIndex:t}),this.dropDownInstance.items.splice(t,1),this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),this.tabInstance.removeTab(t);var r=this.parent.skipHiddenSheets(this.tabInstance.selectedItem);this.parent.activeSheetIndex=r,this.parent.setProperties({activeSheetIndex:r},!0),this.parent.renderModule.refreshSheet(),this.tabInstance.selectedItem=r,this.tabInstance.dataBind(),this.updateDropDownItems(r),this.parent.notify("protectSheet",null),Et(this.parent.element)},e.prototype.showAggregate=function(){var e=this;if(!I(c(this.parent.getActiveSheet().selectedRange))){var t={Count:0,Sum:"0",Avg:"0",Min:"0",Max:"0",countOnly:!0};if(this.parent.notify("aggregateComputation",t),t.Count>1){this.aggregateContent=t.countOnly?"Count":this.selaggregateCnt,t.countOnly&&(this.aggregateContent="Count",delete t.Sum,delete t.Avg,delete t.Min,delete t.Max);var r=t.countOnly?"e-aggregate-list e-flat e-aggregate-list-countonly e-caret-hide":"e-aggregate-list e-flat";delete t.countOnly;var n=this.aggregateContent,i=n+": "+t[n];if(this.aggregateDropDown)this.updateAggregateContent(i,t);else{var a=this.parent.createElement("button",{id:this.parent.element.id+"_aggregate"});document.getElementById(this.parent.element.id+"_sheet_tab_panel").appendChild(a),this.aggregateDropDown=new l.DropDownButton({content:i,items:this.getAggregateItems(t),select:function(r){e.parent.notify("aggregateComputation",t),e.updateAggregateContent(r.item.text,{Count:t.Count,Sum:t.Sum,Avg:t.Avg,Min:t.Min,Max:t.Max},!0)},beforeOpen:function(t){return e.beforeOpenHandler(e.aggregateDropDown,t.element)},open:function(t){return e.openHandler(e.aggregateDropDown,t.element,"right")},close:function(){return Et(e.parent.element)},cssClass:r}),this.aggregateDropDown.createElement=this.parent.createElement,this.aggregateDropDown.appendTo(a)}}else this.removeAggregate()}},e.prototype.getAggregateItems=function(e){var t,r,n=this,i=[];return Object.keys(e).forEach(function(a){"aggregateComputation"!==e[a]&&(t=a+": "+e[a],r=a===n.aggregateContent?"e-selected-icon e-icons":"",i.push({text:t,iconCss:r}))}),i},e.prototype.updateAggregateContent=function(e,t,r){this.aggregateContent=e.split(": ")[0],r&&(this.selaggregateCnt=e.split(": ")[0]),this.aggregateDropDown.content=e,this.aggregateDropDown.dataBind(),this.aggregateDropDown.setProperties({items:this.getAggregateItems(t)},!0)},e.prototype.removeAggregate=function(){t.isNullOrUndefined(this.aggregateDropDown)||(this.aggregateDropDown.destroy(),t.remove(this.aggregateDropDown.element),this.aggregateDropDown=null)},e.prototype.addEventListener=function(){this.parent.on("sheetTabs",this.createSheetTabs,this),this.parent.on("refreshSheetTabs",this.refreshSheetTab,this),this.parent.on("insertSheetTab",this.insertSheetTab,this),this.parent.on(ir,this.removeSheetTab,this),this.parent.on("renameSheetTab",this.renameSheetTab,this),this.parent.on(nr,this.switchSheetTab,this),this.parent.on("activeSheetChanged",this.updateSheetTab,this),this.parent.on("renameSheet",this.renameInputFocusOut,this),this.parent.on("activeCellChanged",this.removeAggregate,this),this.parent.on("verticalScroll",this.focusRenameInput,this),this.parent.on("horizontalScroll",this.focusRenameInput,this),this.parent.on("sheetNameUpdate",this.updateSheetName,this),this.parent.on("hideSheet",this.hideSheet,this),this.parent.on("showAggregate",this.showAggregate,this)},e.prototype.destroy=function(){this.removeEventListener(),this.dropDownInstance.destroy(),this.dropDownInstance=null,this.tabInstance.destroy(),this.tabInstance=null,this.removeAggregate(),this.aggregateContent=null,this.addBtnRipple(),this.addBtnRipple=null,t.EventHandler.remove(document,"mousedown touchstart",this.renameInputFocusOut);var e=document.getElementById(this.parent.element.id+"_sheet_tab_panel");e&&t.remove(e),this.parent=null},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("sheetTabs",this.createSheetTabs),this.parent.off("refreshSheetTabs",this.refreshSheetTab),this.parent.off("insertSheetTab",this.insertSheetTab),this.parent.off(ir,this.removeSheetTab),this.parent.off("renameSheetTab",this.renameSheetTab),this.parent.off(nr,this.switchSheetTab),this.parent.off("activeSheetChanged",this.updateSheetTab),this.parent.off("renameSheet",this.renameInputFocusOut),this.parent.off("activeCellChanged",this.removeAggregate),this.parent.off("verticalScroll",this.focusRenameInput),this.parent.off("horizontalScroll",this.focusRenameInput),this.parent.off("sheetNameUpdate",this.updateSheetName),this.parent.off("hideSheet",this.hideSheet),this.parent.off("showAggregate",this.showAggregate))},e}(),bi=function(){function e(e){this.parent=e,this.addEventListener(),this.renderFileUpload()}return e.prototype.addEventListener=function(){this.parent.on("openSuccess",this.openSuccess,this),this.parent.on("openFailure",this.openFailed,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("openSuccess",this.openSuccess),this.parent.off("openFailure",this.openFailed))},e.prototype.renderFileUpload=function(){var e=this.parent.element.id+"_fileUpload";this.parent.element.appendChild(this.parent.createElement("input",{id:e,attrs:{type:"file",accept:".xls, .xlsx, .csv, .xlsm",name:"fileUpload"}}));var t=document.getElementById(e);t.onchange=this.fileSelect.bind(this),t.onerror=this.openFailed.bind(this),t.style.display="none"},e.prototype.fileSelect=function(e){var t=e.target.files[0];if(!(t&&t.length<1)){var r={file:t};this.parent.open(r),document.getElementById(this.parent.element.id+"_fileUpload").value=""}},e.prototype.openSuccess=function(e){var t=this,r=["UnsupportedFile","InvalidUrl","NeedPassword","InCorrectPassword"];if(r.indexOf(e.data)>-1)if(r[2]===e.data)this.parent.element.querySelector(".e-importprotectworkbook-dlg")||this.parent.notify("importProtectWorkbook",e.eventArgs);else{if(r[3]!==e.data)return(a=this.parent.serviceLocator.getService(Bi)).hide(),this.parent.serviceLocator.getService(Bi).show({content:this.parent.serviceLocator.getService("spreadsheetLocale").getConstant(e.data),width:"300",beforeOpen:function(e){var r={dialogName:"OpenDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0)}}),void this.parent.hideSpinner();var n=this.parent.serviceLocator.getService(Hi),i=this.parent.createElement("span",{className:"e-importprotectpwd-alert-span",innerHTML:n.getConstant("InCorrectPassword")});this.parent.element.querySelector(".e-importprotectworkbook-dlg").querySelector(".e-dlg-content").appendChild(i)}else{var a=this.parent.serviceLocator.getService(Bi);a.hide(),this.parent.showSpinner()}this.parent.element&&(this.parent.trigger("openComplete",{response:e}),this.parent.notify(pr,{response:e,action:"import"}),this.parent.renderModule.refreshSheet(!0),this.parent.notify("refreshSheetTabs",this),this.parent.hideSpinner())},e.prototype.openFailed=function(e){this.parent.trigger("openFailure",e),this.parent.hideSpinner()},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"open"},e}(),xi=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("beginSave",this.initiateSave,this),this.parent.on("saveCompleted",this.saveCompleted,this),this.parent.on("saveError",this.showErrorDialog,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("beginSave",this.initiateSave),this.parent.off("saveCompleted",this.saveCompleted),this.parent.off("saveError",this.showErrorDialog))},e.prototype.getModuleName=function(){return"save"},e.prototype.initiateSave=function(){this.parent.showSpinner()},e.prototype.saveCompleted=function(){this.parent.hideSpinner()},e.prototype.showErrorDialog=function(e){var t=this;this.parent.serviceLocator.getService(Bi).show({target:this.parent.element,isModal:!0,showCloseIcon:!0,height:180,width:400,content:e.content,beforeOpen:function(){return Et(t.parent.element)}})},e}(),Si=function(){function e(e){this.parent=e,this.init()}return e.prototype.init=function(){this.initContextMenu(),this.addEventListener()},e.prototype.initContextMenu=function(){var e=document.createElement("ul");e.id=this.parent.element.id+"_contextmenu",this.parent.element.appendChild(e),this.contextMenuInstance=new n.ContextMenu({cssClass:"e-spreadsheet-contextmenu",target:"#"+this.parent.element.id,filter:"e-numericcontainer e-active-cell e-selection e-row e-header-row e-select-all-cell e-sheet-tabs-items",select:this.selectHandler.bind(this),beforeOpen:this.beforeOpenHandler.bind(this),beforeClose:this.beforeCloseHandler.bind(this)},e)},e.prototype.beforeCloseHandler=function(e){this.parent.trigger("contextMenuBeforeClose",e)},e.prototype.selectHandler=function(e){var r=t.extend({cancel:!1},e);this.parent.trigger("contextMenuItemSelect",r);var n,i,a,o=this.parent.element.id+"_cmenu";if(!r.cancel){var s=void 0;switch(e.item.id){case o+"_cut":this.parent.notify(ar,{isAction:!0,promise:Promise});break;case o+"_copy":this.parent.notify("copy",{isAction:!0,promise:Promise});break;case o+"_paste":this.parent.notify(or,{isAction:!0,isInternal:!0});break;case o+"_pastevalues":this.parent.notify(or,{type:"Values",isAction:!0,isInternal:!0});break;case o+"_pasteformats":this.parent.notify(or,{type:"Formats",isAction:!0,isInternal:!0});break;case o+"_rename":this.parent.notify("renameSheetTab",{});break;case o+"_delete_sheet":this.parent.notify(ir,{});break;case o+"_insert_sheet":this.parent.notify(Ht,{model:this.parent,start:this.parent.activeSheetIndex,end:this.parent.activeSheetIndex,modelType:"Sheet",isAction:!0});break;case o+"_hide_sheet":this.parent.notify("hideSheet",null);break;case o+"_duplicate":xe(this.parent,void 0,!0);break;case o+"_move_right":be(this.parent,this.parent.activeSheetIndex+1,null,!0);break;case o+"_move_left":be(this.parent,this.parent.activeSheetIndex-1,null,!0);break;case o+"_ascending":this.parent.notify("applySort",null);break;case o+"_descending":this.parent.notify("applySort",{sortOptions:{sortDescriptors:{order:"Descending"}}});break;case o+"_customsort":this.parent.notify("initiateCustomSort",null);break;case o+"_filtercellvalue":this.parent.notify("filterByCellValue",null);break;case o+"_clearfilter":n=v(u(this.parent.getActiveSheet().activeCell)[1]+1),this.parent.notify("clearFilter",{field:n});break;case o+"_reapplyfilter":this.parent.notify("reapplyFilter",null);break;case o+"_hide_row":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(lr,{startIndex:s[0],endIndex:s[2],hide:!0,isCol:!1,actionUpdate:!0}),Et(this.parent.element);break;case o+"_unhide_row":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(lr,{startIndex:s[0],endIndex:s[2],hide:!1,isCol:!1,actionUpdate:!0}),Et(this.parent.element);break;case o+"_hide_column":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(lr,{startIndex:s[1],endIndex:s[3],hide:!0,isCol:!0,actionUpdate:!0}),Et(this.parent.element);break;case o+"_unhide_column":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(lr,{startIndex:s[1],endIndex:s[3],hide:!1,isCol:!0,actionUpdate:!0}),Et(this.parent.element);break;case o+"_insert_row_above":case o+"_delete_row":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(e.item.id.substr(o.length+1,6)+"Model",{model:this.parent.getActiveSheet(),start:s[0],end:s[2],modelType:"Row",isAction:!0,insertType:"above"}),Et(this.parent.element);break;case o+"_insert_row_below":s=S(c(this.parent.getActiveSheet().selectedRange)),this.parent.notify(Ht,{model:this.parent.getActiveSheet(),start:s[2]+1,end:s[2]+1+(s[2]-s[0]),modelType:"Row",isAction:!0,insertType:"below"}),Et(this.parent.element);break;case o+"_insert_column_before":case o+"_delete_column":s=c(this.parent.getActiveSheet().selectedRange),this.parent.notify(e.item.id.substr(o.length+1,6)+"Model",{model:this.parent.getActiveSheet(),start:s[1],end:s[3],modelType:"Column",isAction:!0}),Et(this.parent.element);break;case o+"_insert_column_after":s=S(c(this.parent.getActiveSheet().selectedRange)),this.parent.notify(Ht,{model:this.parent.getActiveSheet(),start:s[3]+1,end:s[3]+1+(s[3]-s[1]),modelType:"Column",isAction:!0}),Et(this.parent.element);break;case o+"_hyperlink":this.parent.notify("initiateHyperlink",null);break;case o+"_editHyperlink":this.parent.notify("editHyperlink",null);break;case o+"_openHyperlink":this.parent.notify("openHyperlink",null);break;case o+"_removeHyperlink":this.parent.removeHyperlink(this.parent.getActiveSheet().selectedRange);break;case o+"_protect":i=this.parent.getActiveSheet(),this.parent.setSheetPropertyOnMute(i,"isProtected",!i.isProtected),a=!i.isProtected,this.parent.notify("applyProtect",{isActive:a})}}},e.prototype.getInsertModel=function(e,t){for(var r=[],n=e;n<=t;n++)n===e?r.push({index:n}):r.push({});return r},e.prototype.beforeOpenHandler=function(e){var r,n=this.getTarget(e.event.target);if(e.element.classList.contains("e-contextmenu")?(r=this.getDataSource(n),this.contextMenuInstance.items=r,this.contextMenuInstance.dataBind()):r=e.items,"ColumnHeader"===n||"RowHeader"===n){if(e.element&&e.element.childElementCount>0){var i="ColumnHeader"===n?e.element.querySelector("#"+this.parent.element.id+"_cmenu_insert_column"):e.element.querySelector("#"+this.parent.element.id+"_cmenu_insert_row"),a="ColumnHeader"===n?e.element.querySelector("#"+this.parent.element.id+"_cmenu_delete_column"):e.element.querySelector("#"+this.parent.element.id+"_cmenu_delete_row");this.parent.allowInsert&&i.classList.contains("e-disabled")?i.classList.remove("e-disabled"):this.parent.allowInsert||i.classList.contains("e-disabled")||i.classList.add("e-disabled"),this.parent.allowDelete&&a.classList.contains("e-disabled")?a.classList.remove("e-disabled"):this.parent.allowDelete||a.classList.contains("e-disabled")||a.classList.add("e-disabled")}}else if("Footer"===n){var o=se(this.parent,e.event.target.textContent);0===o&&e.element.querySelector("#"+this.parent.element.id+"_cmenu_move_left").classList.add("e-disabled"),o===this.parent.sheets.length-1&&e.element.querySelector("#"+this.parent.element.id+"_cmenu_move_right").classList.add("e-disabled")}this.parent.trigger("contextMenuBeforeOpen",e),this.parent.notify(nr,t.extend(e,{target:n,items:r}))},e.prototype.getTarget=function(e){return t.closest(e,".e-sheet-content")?"Content":t.closest(e,".e-column-header")?e.classList.contains("e-header-cell")?"ColumnHeader":"Content":t.closest(e,".e-row-header")?e.classList.contains("e-header-cell")?"RowHeader":"Content":t.closest(e,".e-sheet-tabs-items")?"Footer":t.closest(e,".e-selectall-container")?e.classList.contains("e-header-cell")?t.closest(e,".e-header-row")?"ColumnHeader":"RowHeader":t.closest(e,".e-select-all-cell")?"SelectAll":"Content":""},e.prototype.getDataSource=function(e){var t=this.parent.serviceLocator.getService(Hi),r=[],n=this.parent.element.id+"_cmenu";if("Content"===e)this.setClipboardData(r,t,n),r.push({separator:!0}),this.setFilterItems(r,n),this.setSortItems(r,n),r.push({separator:!0}),this.setHyperLink(r,n);else if("RowHeader"===e){this.setClipboardData(r,t,n);a=c((i=this.parent.getActiveSheet()).selectedRange);this.setInsertDeleteItems(r,t,"Row",n,[a[0],a[2]],["Above","Below"]),i.frozenRows||i.frozenColumns||this.setHideShowItems(r,t,"Row",n,[a[0],a[2]])}else if("ColumnHeader"===e){this.setClipboardData(r,t,n);var i=this.parent.getActiveSheet(),a=c(i.selectedRange);this.setInsertDeleteItems(r,t,"Column",n,[a[1],a[3]],["Before","After"]),i.frozenRows||i.frozenColumns||this.setHideShowItems(r,t,"Column",n,[a[1],a[3]])}else"SelectAll"===e?(this.setClipboardData(r,t,n),this.setFilterItems(r,n),this.setSortItems(r,n)):"Footer"===e&&(r.push({text:t.getConstant("Insert"),id:n+"_insert_sheet"}),r.push({text:t.getConstant("Delete"),iconCss:"e-icons e-delete",id:n+"_delete_sheet"}),r.push({text:t.getConstant("DuplicateSheet"),id:n+"_duplicate"}),r.push({text:t.getConstant("Rename"),id:n+"_rename"}),r.push({text:t.getConstant("Hide"),id:n+"_hide_sheet"}),this.setProtectSheetItems(r,n),r.push({text:t.getConstant("MoveRight"),id:n+"_move_right"}),r.push({text:t.getConstant("MoveLeft"),id:n+"_move_left"}));return r},e.prototype.setProtectSheetItems=function(e,t){var r=this.parent.serviceLocator.getService(Hi);this.parent.getActiveSheet().isProtected?e.push({text:r.getConstant("UnprotectSheet"),id:t+"_protect",iconCss:"e-icons e-protect-icon"}):e.push({text:r.getConstant("ProtectSheet"),id:t+"_protect",iconCss:"e-icons e-protect-icon"})},e.prototype.setFilterItems=function(e,t){if(this.parent.allowFiltering){var r=this.parent.serviceLocator.getService(Hi),n={clearFilterText:null,isFiltered:!1};this.parent.notify("getFilteredColumn",n),e.push({text:r.getConstant("Filter"),id:t+"_filter",iconCss:"",items:[{text:n.clearFilterText,iconCss:"e-icons e-filter-clear",id:t+"_clearfilter"},{text:r.getConstant("ReapplyFilter"),iconCss:"e-icons e-filter-reapply",id:t+"_reapplyfilter"},{separator:!0},{text:r.getConstant("FilterCellValue"),iconCss:"",id:t+"_filtercellvalue"}]})}},e.prototype.setSortItems=function(e,t){var r=this.parent.serviceLocator.getService(Hi);this.parent.allowSorting&&e.push({text:r.getConstant("Sort"),id:t+"_sort",iconCss:"e-icons e-sort-icon",items:[{text:r.getConstant("SortAscending"),iconCss:"e-icons e-sort-asc",id:t+"_ascending"},{text:r.getConstant("SortDescending"),iconCss:"e-icons e-sort-desc",id:t+"_descending"},{text:r.getConstant("CustomSort")+"...",iconCss:"e-icons e-sort-custom",id:t+"_customsort"}]})},e.prototype.setHyperLink=function(e,t){var r=this.parent.getActiveSheet();if(this.parent.allowHyperlink){var n=this.parent.serviceLocator.getService(Hi);!document.activeElement.getElementsByClassName("e-hyperlink")[0]&&!document.activeElement.classList.contains("e-hyperlink")||r.isProtected&&!r.protectSettings.insertLink?e.push({text:n.getConstant("Hyperlink"),iconCss:"e-icons e-hyperlink-icon",id:t+"_hyperlink"}):e.push({text:n.getConstant("EditHyperlink"),iconCss:"e-icons e-edithyperlink-icon",id:t+"_editHyperlink"},{text:n.getConstant("OpenHyperlink"),iconCss:"e-icons e-openhyperlink-icon",id:t+"_openHyperlink"},{text:n.getConstant("RemoveHyperlink"),iconCss:"e-icons e-removehyperlink-icon",id:t+"_removeHyperlink"})}},e.prototype.setClipboardData=function(e,t,r){this.parent.enableClipboard&&(e.push({text:t.getConstant("Cut"),iconCss:"e-icons e-cut-icon",id:r+"_cut"}),e.push({text:t.getConstant("Copy"),iconCss:"e-icons e-copy-icon",id:r+"_copy"}),e.push({text:t.getConstant("Paste"),iconCss:"e-icons e-paste-icon",id:r+"_paste"}),e.push({text:t.getConstant("PasteSpecial"),id:r+"_pastespecial",items:[{text:t.getConstant("Values"),id:r+"_pastevalues"},{text:t.getConstant("Formats"),id:r+"_pasteformats"}]}))},e.prototype.setInsertDeleteItems=function(e,t,r,n,i,a){e.push({separator:!0}),["Insert","Delete"].forEach(function(o){i[0]===i[1]?e.push({text:t.getConstant(""+o+r),id:n+"_"+o.toLowerCase()+"_"+r.toLowerCase()}):e.push({text:t.getConstant(""+o+r+"s"),id:n+"_"+o.toLowerCase()+"_"+r.toLowerCase()}),"Insert"===o&&(e[e.length-1].items=[],a.forEach(function(r){e[e.length-1].items.push({text:t.getConstant(r),id:e[e.length-1].id+"_"+r.toLowerCase()})}))})},e.prototype.setHideShowItems=function(e,t,r,n,i){if(i[0]===i[1])e.push({text:t.getConstant("Hide"+r),id:n+"_hide_"+r.toLowerCase()});else{var a=i[0];i[0]=i[0]>i[1]?i[1]:i[0],i[1]=i[1]>a?i[1]:a,e.push({text:t.getConstant("Hide"+r+"s"),id:n+"_hide_"+r.toLowerCase()})}this.parent.hiddenCount(i[0],i[1],r.toLowerCase()+"s")&&e.push({text:t.getConstant("UnHide"+r+"s"),id:n+"_unhide_"+r.toLowerCase()})},e.prototype.addEventListener=function(){this.parent.on("addContextMenuItems",this.addItemsHandler,this),this.parent.on("removeContextMenuItems",this.removeItemsHandler,this),this.parent.on("enableContextMenuItems",this.enableItemsHandler,this)},e.prototype.addItemsHandler=function(e){e.insertAfter?this.contextMenuInstance.insertAfter(e.items,e.text,e.isUniqueId):this.contextMenuInstance.insertBefore(e.items,e.text,e.isUniqueId)},e.prototype.removeItemsHandler=function(e){this.contextMenuInstance.removeItems(e.items,e.isUniqueId)},e.prototype.enableItemsHandler=function(e){this.contextMenuInstance.enableItems(e.items,e.enable,e.isUniqueId)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("addContextMenuItems",this.addItemsHandler),this.parent.off("removeContextMenuItems",this.removeItemsHandler),this.parent.off("enableContextMenuItems",this.enableItemsHandler))},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener(),this.contextMenuInstance.destroy();var e=document.getElementById(this.parent.element.id+"_contextmenu");e&&t.detach(e),this.parent=null},e}(),wi=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.refreshCellElement=function(e){var r=this.parent.getCell(e.rowIndex,e.colIndex);t.isNullOrUndefined(r)||this.parent.refreshNode(r,e)},e.prototype.addEventListener=function(){this.parent.on("refreshCellElem",this.refreshCellElement,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("refreshCellElem",this.refreshCellElement)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"numberFormat"},e}(),Ii=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on("applySort",this.applySortHandler,this),this.parent.on("sortComplete",this.sortCompleteHandler,this),this.parent.on("initiateCustomSort",this.initiateCustomSortHandler,this),this.parent.on("sortImport",this.sortImport,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("applySort",this.applySortHandler),this.parent.off("sortComplete",this.sortCompleteHandler),this.parent.off("initiateCustomSort",this.initiateCustomSortHandler),this.parent.off("sortImport",this.sortImport))},e.prototype.getModuleName=function(){return"sort"},e.prototype.isValidSortRange=function(){var e=this.parent.getActiveSheet(),t=S(y(e.selectedRange));return!(t[0]>e.usedRange.rowIndex||t[1]>e.usedRange.colIndex)},e.prototype.sortImport=function(e){for(var t,r=this.parent.sortCollection,n=this.parent.getActiveSheet().usedRange.rowIndex-1,i=e?e.sheetIdx:this.parent.activeSheetIndex,a=0;a<r.length;a++)if(r[a].sheetIndex===i)for(var o=0;o<n;o++)if((t=this.parent.getCell(o,r[a].columnIndex))&&t.querySelector(".e-filter-icon"))return void("Ascending"===r[a].order||"OnTop"===r[a].order?t.querySelector(".e-filter-icon").classList.contains("e-sortasc-filter")||t.querySelector(".e-filter-icon").classList.add("e-sortasc-filter"):t.querySelector(".e-filter-icon").classList.contains("e-sortdesc-filter")||t.querySelector(".e-filter-icon").classList.add("e-sortdesc-filter"))},e.prototype.sortRangeAlertHandler=function(e){var t=this;this.parent.serviceLocator.getService(Bi).show({height:180,width:400,isModal:!0,showCloseIcon:!0,content:e.error,beforeOpen:function(e){var r={dialogName:"SortRangeDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0)}}),this.parent.hideSpinner()},e.prototype.initiateCustomSortHandler=function(){var e=this,r=this.parent.serviceLocator.getService(Hi);if(!this.isValidSortRange())return void this.sortRangeAlertHandler({error:r.getConstant("SortOutOfRangeError")});var n=this.parent.serviceLocator.getService(Bi);n.show({height:400,width:560,isModal:!0,showCloseIcon:!0,cssClass:"e-customsort-dlg",header:r.getConstant("CustomSort"),beforeOpen:function(t){var r={dialogName:"CustomSortDialog",element:t.element,target:t.target,cancel:t.cancel};e.parent.trigger("dialogBeforeOpen",r),r.cancel&&(t.cancel=!0),n.dialogInstance.content=e.customSortContent(),n.dialogInstance.dataBind(),Et(e.parent.element)},buttons:[{buttonModel:{content:r.getConstant("Ok"),isPrimary:!0},click:function(){var r=n.dialogInstance.content,i=r.getElementsByClassName("e-list-sort e-listview e-lib")[0],a=t.getComponent(i,"listview").dataSource;e.clearError();var o=r.getElementsByClassName("e-sort-error")[0];if(o.style.display="block",!e.validateError(a,r,o)){n.hide();var s=r.getElementsByClassName("e-sort-checkheader")[0],l=t.getComponent(s,"checkbox"),h=t.getComponent(r.getElementsByClassName("e-sort-checkcase")[0],"checkbox"),d=l.checked;e.applySortHandler({sortOptions:{sortDescriptors:a,containsHeader:d,caseSensitive:h.checked}})}}}]})},e.prototype.validateError=function(e,r,n){var i=this.parent.serviceLocator.getService(Hi);if(e.some(function(e){return""===e.field.toString()}))return Array.prototype.some.call(r.getElementsByClassName("e-sort-field"),function(e){var r=!t.getComponent(e,"dropdownlist").value;return r&&e.parentElement.classList.add("e-error"),r}),n.innerText=i.getConstant("SortEmptyFieldError"),!0;var a=new Set,o="",s="";if(e.some(function(e){return o=e.field.toString(),a.size===a.add(e.field).size})){var l=0;return Array.prototype.some.call(r.getElementsByClassName("e-sort-field"),function(e){var r=t.getComponent(e,"dropdownlist");return r.value===o&&(e.parentElement.classList.add("e-error"),s=r.text,l++),2===l}),n.innerHTML="<strong>"+s+"</strong>"+i.getConstant("SortDuplicateFieldError"),!0}return!1},e.prototype.customSortContent=function(){var e=this.parent.createElement("div",{className:"e-sort-dialog"}),r=this.getFields(),n=t.getUniqueID("customSort"),i=this.getCustomListview(n);this.setHeaderTab(e,i,r);var a=this.parent.createElement("div",{className:"e-sort-listsection",styles:""});e.appendChild(a);var o=this.parent.createElement("div",{className:"e-list-sort",styles:""});a.appendChild(o),i.createElement=this.parent.createElement,i.appendTo(o),this.renderListItem(n,i,!0,r);var s=this.parent.createElement("div",{className:"e-sort-error"});return e.appendChild(s),e},e.prototype.getFields=function(){var e=this.parent.getActiveSheet(),t=S(y(e.selectedRange));if(t[0]===t[2]&&t[2]-t[0]==0){t[0]=0,t[1]=0,t[3]=e.usedRange.colIndex;var r={filterRange:[],hasFilter:!1};this.parent.notify("getFilterRange",r),r.hasFilter&&r.filterRange&&(t[0]=r.filterRange[0])}var n,i=[];for(t[1];t[1]<=t[3];t[1]++){var a=J(t[0],t[1],e);if(a&&a.value){var o={formattedText:a.value,value:a.value,format:a.format,onLoad:!0};a.format&&this.parent.notify("getFormattedCell",o),n=o.formattedText}else n="Column "+v(t[1]+1);i.push({text:n,value:"Column "+v(t[1]+1)})}return i},e.prototype.setHeaderTab=function(e,r,n){var i=this,o=this.parent.serviceLocator.getService(Hi),s=this.parent.createElement("div",{className:"e-sort-header",styles:"",innerHTML:""});e.appendChild(s);var l=this.parent.createElement("button",{className:"e-btn e-sort-addbtn e-flat",innerHTML:o.getConstant("AddColumn")}),h=this.parent.element.querySelector(".e-customsort-dlg .e-footer-content");h.insertBefore(l,h.firstElementChild),l.addEventListener("click",function(){if(r){var e=t.getUniqueID("customSort");r.addItem([{id:e,text:o.getConstant("ThenBy"),field:"",order:"ascending"}]),i.renderListItem(e,r,d.checked,n,!0)}});var d=new a.CheckBox({label:o.getConstant("ContainsHeader"),checked:!0,change:function(r){var i=r.checked?{text:"text",value:"value"}:{text:"value"};Array.prototype.forEach.call(e.getElementsByClassName("e-sort-field e-dropdownlist e-lib"),function(e){var r=t.getComponent(e,"dropdownlist");r.dataSource=null,r.dataSource=n,r.fields=i,r.dataBind()})},cssClass:"e-sort-headercheckbox"}),p=this.parent.createElement("input",{className:"e-sort-checkheader",attrs:{type:"checkbox"}});s.appendChild(p),d.createElement=this.parent.createElement,d.appendTo(p);var c=new a.CheckBox({label:o.getConstant("CaseSensitive"),checked:!1,cssClass:"e-sort-casecheckbox"}),u=this.parent.createElement("input",{className:"e-sort-checkcase",attrs:{type:"checkbox"}});s.appendChild(u),c.createElement=this.parent.createElement,c.appendTo(u)},e.prototype.getCustomListview=function(e){var r=[{id:e,text:this.parent.serviceLocator.getService(Hi).getConstant("SortBy"),field:"",order:"ascending"}];return t.enableRipple(!1),new s.ListView({dataSource:r,fields:{id:"id"},height:"100%",template:'<div class="e-sort-listwrapper"><span class="text">${text}</span><div class="e-sort-row"><div class="e-sort-field"></div><div class="e-sort-order"><span class="e-sort-ordertxt" style="display:none;">${order}</span></div><span class="e-icons e-sort-delete"></span></div>',cssClass:"e-sort-template"})},e.prototype.deleteHandler=function(e,t){e.getElementsByClassName("e-sort-delete")[0].addEventListener("click",function(){e&&t.removeItem(e)})},e.prototype.renderListItem=function(e,t,r,n,i){var s=this,l=this.parent.serviceLocator.getService(Hi),h=t.element.querySelector("li[data-uid="+e+"]"),d=r?{text:"text",value:"value"}:{text:"value"},p=h.getElementsByClassName("e-sort-field")[0],c=new o.DropDownList({dataSource:n,width:"auto",cssClass:"e-sort-field-ddl",fields:d,placeholder:l.getConstant("SelectAColumn"),change:function(r){r.value&&(Array.prototype.some.call(t.dataSource,function(t){return t.id===e&&(t.field=r.value.toString().replace("Column ","")),t.id===e}),s.clearError())}});c.createElement=this.parent.createElement,c.appendTo(p),i||(c.index=0);var u=h.getElementsByClassName("e-sort-order")[0],f="ascending"===u.getElementsByClassName("e-sort-ordertxt")[0].innerText.toLocaleLowerCase(),g=new a.RadioButton({label:l.getConstant("SortAscending"),name:"sortAZ_"+e,value:"ascending",checked:f,cssClass:"e-sort-radiobutton",change:function(r){s.setRadioBtnValue(t,e,r.value)}}),m=this.parent.createElement("input",{id:"orderAsc_"+e,className:"e-sort-radioasc",styles:"",attrs:{type:"radio"}});u.appendChild(m),g.createElement=this.parent.createElement,g.appendTo(m);var v=new a.RadioButton({label:l.getConstant("SortDescending"),name:"sortAZ_"+e,value:"descending",checked:!f,cssClass:"e-sort-radiobutton",change:function(r){s.setRadioBtnValue(t,e,r.value)}}),y=this.parent.createElement("input",{id:"orderDesc_"+e,className:"e-sort-radiodesc",styles:"",attrs:{type:"radio"}});u.appendChild(y),v.createElement=this.parent.createElement,v.appendTo(y),this.deleteHandler(h,t)},e.prototype.setRadioBtnValue=function(e,t,r){r&&Array.prototype.some.call(e.dataSource,function(e){return e.id===t&&(e.order=r),e.id===t})},e.prototype.clearError=function(){var e=document.getElementsByClassName("e-sort-dialog")[0],t=e.getElementsByClassName("e-sort-error")[0];"none"!==t.style.display&&""!==t.innerHTML&&(t.style.display="none",Array.prototype.forEach.call(e.getElementsByClassName("e-error"),function(e){e.classList.remove("e-error")}))},e.prototype.applySortHandler=function(e){var t=this,r=this.parent.getActiveSheet(),n={range:e&&e.range||r.selectedRange,sortOptions:e&&e.sortOptions||{sortDescriptors:{}},cancel:!1};if(this.parent.trigger("beforeSort",n),!n.cancel){this.parent.notify(cr,{eventArgs:n,action:"beforeSort"}),this.parent.showSpinner();var i=S(y(n.range)),a={filterRange:[],hasFilter:!1};i[0]===i[2]&&i[2]-i[0]==0&&(this.parent.notify("getFilterRange",a),a.hasFilter&&G(a.filterRange,i[0],i[1])&&(i[0]=a.filterRange[0],i[1]=0,i[2]=r.usedRange.rowIndex,i[3]=r.usedRange.colIndex,n.sortOptions.containsHeader=!0)),this.parent.sort(n.sortOptions,m(i)).then(function(e){return t.parent.trigger("sortComplete",e),t.parent.notify(pr,{eventArgs:e,action:"sorting"}),Promise.resolve(e)}).catch(function(e){return t.sortRangeAlertHandler({error:e}),Promise.reject(e)})}},e.prototype.sortCompleteHandler=function(e){for(var t=y(e.range),r=t[0];r<=t[2];r++)for(var n=t[1];n<=t[3];n++)this.parent.notify(Lt,{action:"refreshCalculate",rowIndex:r,colIndex:n});this.parent.serviceLocator.getService("cell").refreshRange(t,!0),this.parent.hideSpinner()},e}(),Ei=function(){function e(e){this.parent=e,this.filterCollection=new Map,this.filterRange=new Map,this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.filterRange=null,this.filterCollection=null,this.parent=null},e.prototype.addEventListener=function(){this.parent.on("filterRangeAlert",this.filterRangeAlertHandler,this),this.parent.on(dr,this.initiateFilterUIHandler,this),this.parent.on("mouseDown",this.filterMouseDownHandler,this),this.parent.on("renderFilterCell",this.renderFilterCellHandler,this),this.parent.on("clearAllFilter",this.clearAllFilterHandler,this),this.parent.on(d.beforeFltrcMenuOpen,this.beforeFilterMenuOpenHandler,this),this.parent.on(d.beforeCustomFilterOpen,this.beforeCustomFilterOpenHandler,this),this.parent.on("reapplyFilter",this.reapplyFilterHandler,this),this.parent.on("filterByCellValue",this.filterByCellValueHandler,this),this.parent.on("clearFilter",this.clearFilterHandler,this),this.parent.on("getFilteredColumn",this.getFilteredColumnHandler,this),this.parent.on(nr,this.cMenuBeforeOpenHandler,this),this.parent.on(d.filterCboxValue,this.filterCboxValueHandler,this),this.parent.on("getFilterRange",this.getFilterRangeHandler,this),this.parent.on("filterCellKeyDown",this.filterCellKeyDownHandler,this),this.parent.on("getFilteredCollection",this.getFilteredCollection,this),this.parent.on("contentLoaded",this.updateFilter,this),this.parent.on("updateFilter",this.updateFilter,this),this.parent.on("beforeInsert",this.beforeInsertHandler,this),this.parent.on("beforeDelete",this.beforeDeleteHandler,this),this.parent.on("sheetsDestroyed",this.deleteSheetHandler,this),this.parent.on("clear",this.clearHanlder,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("filterRangeAlert",this.filterRangeAlertHandler),this.parent.off(dr,this.initiateFilterUIHandler),this.parent.off("mouseDown",this.filterMouseDownHandler),this.parent.off("renderFilterCell",this.renderFilterCellHandler),this.parent.off("clearAllFilter",this.clearAllFilterHandler),this.parent.off(d.beforeFltrcMenuOpen,this.beforeFilterMenuOpenHandler),this.parent.off(d.beforeCustomFilterOpen,this.beforeCustomFilterOpenHandler),this.parent.off("reapplyFilter",this.reapplyFilterHandler),this.parent.off("filterByCellValue",this.filterByCellValueHandler),this.parent.off("clearFilter",this.clearFilterHandler),this.parent.off("getFilteredColumn",this.getFilteredColumnHandler),this.parent.off(nr,this.cMenuBeforeOpenHandler),this.parent.on(d.filterCboxValue,this.filterCboxValueHandler),this.parent.off("getFilterRange",this.getFilterRangeHandler),this.parent.off("filterCellKeyDown",this.filterCellKeyDownHandler),this.parent.off("getFilteredCollection",this.getFilteredCollection),this.parent.off("contentLoaded",this.updateFilter),this.parent.off("updateFilter",this.updateFilter),this.parent.off("beforeInsert",this.beforeInsertHandler),this.parent.off("beforeDelete",this.beforeDeleteHandler),this.parent.off("sheetsDestroyed",this.deleteSheetHandler),this.parent.off("clear",this.clearHanlder))},e.prototype.getModuleName=function(){return"filter"},e.prototype.isInValidFilterRange=function(e,t){var r=S(t?y(t):y(e.selectedRange));return r[0]>e.usedRange.rowIndex||r[1]>e.usedRange.colIndex},e.prototype.filterRangeAlertHandler=function(e){var t=this;this.parent.serviceLocator.getService(Bi).show({content:e.error,isModal:!0,height:180,width:400,showCloseIcon:!0,beforeOpen:function(e){var r={dialogName:"FilterRangeDialog",element:e.element,target:e.target,cancel:e.cancel};t.parent.trigger("dialogBeforeOpen",r),r.cancel&&(e.cancel=!0)}}),this.parent.hideSpinner()},e.prototype.beforeFilterMenuOpenHandler=function(e){var t=this.parent.serviceLocator.getService(Hi);e.element.classList.add("e-spreadsheet-contextmenu");var r=e.element.querySelector("ul");this.addMenuItem(r,t.getConstant("SortDescending"),"e-filter-sortdesc","e-sort-desc"),this.addMenuItem(r,t.getConstant("SortAscending"),"e-filter-sortasc","e-sort-asc"),e.element.appendChild(r)},e.prototype.addMenuItem=function(e,t,r,n){var i=this.parent.createElement("li",{className:r+" e-menu-item"});i.innerHTML=t,i.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+n}),i.firstChild),e.insertBefore(i,e.firstChild)},e.prototype.initiateFilterUIHandler=function(e){var t=this,n=e?e.predicates:null,i=e.sIdx;if(i||0===i||(i=this.parent.activeSheetIndex),!(this.filterRange.size>0&&this.filterRange.has(i))||(this.removeFilter(i),n)){var a=fe(this.parent,i);if(this.isInValidFilterRange(a,e.range)){var o=this.parent.serviceLocator.getService(Hi);return void this.filterRangeAlertHandler({error:o.getConstant("FilterOutOfRangeError")})}var s=a.selectedRange,l=c(s);l[0]===l[2]&&l[1]===l[3]&&(s=m(l=Z(l[0],l[1],a)));var h={range:e.range?e.range:s,filterOptions:{predicates:e.predicates},cancel:!1};if(e.isCut||this.parent.notify(cr,{action:"filter",eventArgs:h}),this.processRange(a,i,e.range?e.range:s),n){var d=this.filterRange.get(i).slice();d[0]=d[0]+1,d[2]=a.usedRange.rowIndex,re(this.parent,a.name+"!"+m(d),!0,!0).then(function(i){t.filterSuccessHandler(new r.DataManager(i),{action:"filtering",filterCollection:n,field:n[0]?n[0].field:null,sIdx:e.sIdx}),t.refreshFilterRange(null,!1,e.sIdx)})}e.isCut||this.parent.notify(pr,{action:"filter",eventArgs:h})}},e.prototype.processRange=function(e,t,r){var n=S(y(r||e.selectedRange));n[0]===n[2]&&n[1]===n[3]&&(n[0]=0,n[1]=0,n[2]=e.usedRange.rowIndex,n[3]=e.usedRange.colIndex),this.filterRange.set(t,n),this.filterCollection.set(t,[]),this.refreshFilterRange(n,!1,t)},e.prototype.removeFilter=function(e){this.filterCollection.get(e).length&&this.parent.clearFilter();var t=this.filterRange.get(e).slice();this.filterRange.delete(e),this.filterCollection.delete(e),this.refreshFilterRange(t,!0,e)},e.prototype.filterByCellValueHandler=function(){var e=this,t=this.parent.activeSheetIndex,n=this.parent.getActiveSheet();if(this.isInValidFilterRange(n)){var i=this.parent.serviceLocator.getService(Hi);return void this.filterRangeAlertHandler({error:i.getConstant("FilterOutOfRangeError")})}var a=u(n.activeCell);this.isFilterRange(t,a[0],a[1])||this.processRange(n,t);var o=this.filterRange.get(t).slice();o[0]=o[0]+1,o[2]=n.usedRange.rowIndex;var s=v(a[1]+1),l=this.getColumnType(n,a[1]+1,o),h=[{field:s,operator:"date"===l||"datetime"===l||"boolean"===l?"equal":"contains",value:J(a[0],a[1],n).value,matchCase:!1,type:l}];re(this.parent,n.name+"!"+m(o),!0,!0).then(function(t){e.filterSuccessHandler(new r.DataManager(t),{action:"filtering",filterCollection:h,field:s})})},e.prototype.renderFilterCellHandler=function(e){var r=e.sIdx;if(r||0===r||(r=this.parent.activeSheetIndex),this.filterRange.has(r)&&this.isFilterCell(r,e.rowIndex,e.colIndex)){if(!e.td)return;v(e.colIndex+1);if(e.td.querySelector(".e-filter-btn")){var n=e.td.querySelector(".e-filter-iconbtn");(o=t.getComponent(n,"btn")).iconCss="e-icons e-filter-icon"+this.getFilterSortClassName(e.colIndex,r)}else{var i=this.parent.createElement("div",{className:"e-filter-btn"}),o=new a.Button({iconCss:"e-icons e-filter-icon"+this.getFilterSortClassName(e.colIndex,r),cssClass:"e-filter-iconbtn"});e.td.insertBefore(i,e.td.firstChild),o.createElement=this.parent.createElement,o.appendTo(i)}}this.parent.sortCollection&&this.parent.notify("sortImport",{sheetIdx:r})},e.prototype.getFilterSortClassName=function(e,t){for(var r=v(e+1),n="",i=this.filterCollection.get(t),a=this.parent.sortCollection,o=0;o<i.length;o++)if(i[o].field===r){n=" e-filtered";break}if(a)for(o=0;o<a.length;o++)if(a[o].sheetIndex===t&&a[o].columnIndex===e){n+="Ascending"===a[o].order?" e-sortasc-filter":" e-sortdesc-filter";break}return n},e.prototype.refreshFilterRange=function(e,t,r){var n=r;n||0===n||(n=this.parent.activeSheetIndex);for(var i=e||this.filterRange.get(n).slice(),a=i[1];a<=i[3];a++){var o=this.parent.getCell(i[0],a);if(t){if(o&&o.hasChildNodes()){var s=o.querySelector(".e-filter-btn");s&&o.removeChild(s)}}else this.renderFilterCellHandler({td:o,rowIndex:i[0],colIndex:a,sIdx:n})}this.parent.sortCollection&&this.parent.notify("sortImport",null)},e.prototype.isFilterCell=function(e,t,r){var n=this.filterRange.get(e);return n&&n[0]===t&&n[1]<=r&&n[3]>=r},e.prototype.isFilterRange=function(e,t,r){var n=this.filterRange.get(e);return n&&n[0]<=t&&n[2]>=t&&n[1]<=r&&n[3]>=r},e.prototype.getFilteredColumnHandler=function(e){var t=this.parent.activeSheetIndex,r=this.parent.serviceLocator.getService(Hi);if(e.clearFilterText=r.getConstant("ClearFilter"),this.filterRange.has(t)){var n=this.filterCollection.get(t);if(e.isClearAll)return void(e.isFiltered=n&&n.length>0);var i=this.filterRange.get(t).slice(),a=this.parent.getActiveSheet(),o=u(a.activeCell);if(this.isFilterRange(t,o[0],o[1])){e.field=v(o[1]+1);var s=J(i[0],o[1],a),l=this.parent.getDisplayText(s);e.clearFilterText=r.getConstant("ClearFilterFrom")+'"'+(l?l.toString():"Column "+e.field)+'"',n.some(function(t){return e.isFiltered=t.field===e.field,e.isFiltered})}}},e.prototype.cMenuBeforeOpenHandler=function(e){var t=this.parent.element.id+"_cmenu";if(e.parentItem&&e.parentItem.id===t+"_filter"&&""===e.target){var r={isFiltered:!1};this.getFilteredColumnHandler(r),this.parent.enableContextMenuItems([t+"_clearfilter",t+"_reapplyfilter"],!!r.isFiltered,!0)}},e.prototype.closeDialog=function(){var e=document.querySelector(".e-filter-popup");if(e&&e.id.includes(this.parent.element.id)){var r=t.getComponent(e,"dialog");t.EventHandler.remove(e,Xe(),this.filterMouseDownHandler),r&&r.hide()}},e.prototype.isPopupOpened=function(){var e=document.querySelector(".e-filter-popup");return e&&e.id.includes(this.parent.element.id)&&"none"!==e.style.display},e.prototype.filterCellKeyDownHandler=function(e){var t=this.parent.activeSheetIndex,r=this.parent.getActiveSheet(),n=u(r.activeCell);if(this.isFilterCell(t,n[0],n[1])){e.isFilterCell=!0;var i=qe(r,n),a=this.parent.getCell(n[0],n[1]);this.isPopupOpened()&&this.closeDialog(),this.openDialog(a,i.left,i.top)}else e.isFilterCell=!1},e.prototype.filterMouseDownHandler=function(e){var t=e.target;if(t.classList.contains("e-filter-icon")){if(this.isPopupOpened())return void this.closeDialog();this.openDialog(t,e.x,e.y)}else this.isPopupOpened()&&(t.classList.contains("e-searchinput")||t.classList.contains("e-searchclear")||!t.offsetParent||t.offsetParent.classList.contains("e-filter-popup")?this.selectSortItemHandler(t):this.closeDialog())},e.prototype.openDialog=function(e,n,i){var a=this,o=d.parentsUntil(e,"e-cell"),s=parseInt(o.getAttribute("aria-colindex"),10),l=v(s);this.parent.showSpinner();var h=this.parent.activeSheetIndex,p=this.filterRange.get(h).slice(),c=this.parent.getActiveSheet(),u=J(p[0],s-1,c),f=this.parent.getDisplayText(u);p[0]=p[0]+1,p[2]=c.usedRange.rowIndex,re(this.parent,c.name+"!"+m(p),!0,!0,null,!0).then(function(o){var u;o.some(function(e,t){return e&&(u=new r.DataManager(o.slice(t))),!!e});var g={type:a.getColumnType(c,s,p),field:l,displayName:f||"Column "+l,dataSource:u,height:a.parent.element.classList.contains("e-bigger")?800:500,columns:[],hideSearchbox:!1,filteredColumns:a.filterCollection.get(h),column:{field:l,filter:{}},handler:a.filterSuccessHandler.bind(a,new r.DataManager(o)),target:e,position:{X:n,Y:i},localeObj:a.parent.serviceLocator.getService(Hi)};new d.ExcelFilterBase(a.parent,a.getLocalizedCustomOperators()).openDialog(g);var m=document.querySelector(".e-filter-popup");m&&m.id.includes(a.parent.element.id)&&t.EventHandler.add(m,Xe(),a.filterMouseDownHandler,a),a.parent.hideSpinner()})},e.prototype.filterCboxValueHandler=function(e){if(e.column&&e.data){var t=e.column.field;if(e.value){var r=u(t+e.data.dataObj.__rowIndex),n=J(r[0],r[1],this.parent.getActiveSheet());n&&n.format&&(e.value=this.parent.getDisplayText(n))}}},e.prototype.selectSortItemHandler=function(e){var t=e.classList.contains("e-filter-sortasc")?"Ascending":e.classList.contains("e-filter-sortdesc")?"Descending":null;if(t){var r=this.parent.getActiveSheet(),n=this.parent.activeSheetIndex,i=this.filterRange.get(n).slice();i[0]=i[0]+1,i[2]=r.usedRange.rowIndex,this.parent.notify("applySort",{sortOptions:{sortDescriptors:{order:t}},range:m(i)});var a=y(r.activeCell);this.parent.sortCollection=this.parent.sortCollection?this.parent.sortCollection:[];for(var o=0;o<this.parent.sortCollection.length;o++)this.parent.sortCollection[o]&&this.parent.sortCollection[o].sheetIndex===n&&this.parent.sortCollection.splice(o,1);this.parent.sortCollection.push({sortRange:m(i),columnIndex:a[1],order:t,sheetIndex:n}),this.refreshFilterRange(),this.closeDialog()}},e.prototype.filterSuccessHandler=function(e,t){var n=t.sIdx;n||0===n||(n=this.parent.activeSheetIndex);for(var i=this.filterCollection.get(n),a=new r.DataManager(i),o=new r.Query,s=a.executeLocal(o.where("field","equal",t.field)),l=0;l<s.length;l++){for(var h=-1,d=0;d<i.length;d++)if(i[d].field===s[l].field){h=d;break}-1!==h&&i.splice(h,1)}if("filtering"===t.action&&(i=i.concat(t.filterCollection)).length)for(var p=0;p<i.length;p++)t.field=i[p].field;this.filterCollection.set(n,i);var c={datasource:e,predicates:this.getPredicates(n)};this.filterRange.get(n)[2]=fe(this.parent,n).usedRange.rowIndex,this.applyFilter(c,m(this.filterRange.get(n)),n)},e.prototype.applyFilter=function(e,t,r){var n=this,i={range:t,predicates:[].slice.call(this.filterCollection.get(r)),cancel:!1};this.parent.notify(cr,{action:"filter",eventArgs:i}),i.cancel||(this.parent.showSpinner(),this.parent.filter(e,t).then(function(e){return n.refreshFilterRange(),n.parent.notify("getFilteredCollection",null),n.parent.hideSpinner(),delete i.cancel,n.parent.notify(pr,{action:"filter",eventArgs:i}),Promise.resolve(e)}).catch(function(e){return n.filterRangeAlertHandler({error:e}),Promise.reject(e)}))},e.prototype.getPredicates=function(e){for(var t=[],r=d.CheckBoxFilterBase.getPredicate(this.filterCollection.get(e)),n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];t.push(r[a])}return t},e.prototype.getColumnType=function(e,t,r){for(var n=0,i=0,a=0,o=r[0];o<=e.usedRange.rowIndex;o++){var s=J(o,t-1,e);if(s)if(s.format)switch(H(s.format).toLowerCase()){case"number":case"currency":case"accounting":case"percentage":n++;break;case"shortdate":case"longdate":a++;break;case"time":n++;break;default:i++}else"string"==typeof s.value?i++:n++;else i++}return n>i&&n>a&&n>0?"number":i>n&&i>a&&i>0?"string":a>n&&a>i&&a>0?"date":"datetime"},e.prototype.beforeCustomFilterOpenHandler=function(){this.closeDialog()},e.prototype.clearAllFilterHandler=function(){if(this.filterRange.has(this.parent.activeSheetIndex)){this.filterCollection.set(this.parent.activeSheetIndex,[]);for(var e=this.parent.filterCollection,t=0;t<e.length;t++)if(e[t].sheetIndex===this.parent.activeSheetIndex){e.splice(t,1);break}this.refreshFilterRange()}},e.prototype.clearFilterHandler=function(e){this.filterSuccessHandler(null,{action:"clear-filter",filterCollection:[],field:e.field})},e.prototype.reapplyFilterHandler=function(){var e=this.parent.activeSheetIndex;this.filterRange.has(e)&&this.applyFilter({predicates:this.getPredicates(e)},m(this.filterRange.get(e)),e)},e.prototype.getFilterRangeHandler=function(e){var t=e.sheetIdx;this.filterRange&&this.filterRange.has(t)?(e.hasFilter=!0,e.filterRange=this.filterRange.get(t)):(e.hasFilter=!1,e.filterRange=null)},e.prototype.getLocalizedCustomOperators=function(){var e=this.parent.serviceLocator.getService(Hi),t=[{value:"equal",text:e.getConstant("Equal")},{value:"greaterthan",text:e.getConstant("GreaterThan")},{value:"greaterthanorequal",text:e.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:e.getConstant("LessThan")},{value:"lessthanorequal",text:e.getConstant("LessThanOrEqual")},{value:"notequal",text:e.getConstant("NotEqual")}];return{stringOperator:[{value:"startswith",text:e.getConstant("StartsWith")},{value:"endswith",text:e.getConstant("EndsWith")},{value:"contains",text:e.getConstant("Contains")},{value:"equal",text:e.getConstant("Equal")},{value:"notequal",text:e.getConstant("NotEqual")}],numberOperator:t,dateOperator:t,datetimeOperator:t,booleanOperator:[{value:"equal",text:e.getConstant("Equal")},{value:"notequal",text:e.getConstant("NotEqual")}]}},e.prototype.getFilteredCollection=function(){for(var e,r=this.parent.sheets.length,n=[],i=0;i<r;i++){var a={sheetIdx:i,filterRange:void 0,hasFilter:void 0};if(this.getFilterRangeHandler(a),a.hasFilter){for(var o=[],s=[],l=[],h=[],d=[],p=this.filterCollection.get(a.sheetIdx),c=0;c<p.length;c++)if(p[c].field&&p[c].operator){var f=u(p[c].field+"1")[1];o.push(f),s.push(p[c].operator),l.push(t.isNullOrUndefined(p[c].value)?"":p[c].value),h.push(p[c].type),d.push(p[c].predicate)}var g=m(a.filterRange);e={sheetIndex:a.sheetIdx,filterRange:g,hasFilter:a.hasFilter,column:o,criteria:s,value:l,dataType:h,predicates:d},n.push(e)}}e&&(this.parent.filterCollection=n)},e.prototype.updateFilter=function(e){if(this.parent.filterCollection&&(e.initLoad||e.isOpen)){for(var t=0;t<this.parent.filterCollection.length;t++){var r=this.parent.filterCollection[t],n=r.sheetIndex;0===t&&(n=0);var i=[];if(r.column)for(var a=0;a<r.column.length;a++){var o={field:g(0,r.column[a]).charAt(0),operator:this.getFilterOperator(r.criteria[a]),value:r.value[a].toString().split("*").join(""),predicate:r.predicates&&r.predicates[a]};i.push(o)}for(var s=0;s<i.length-1;s++)i[s].field===i[s+1].field&&(i[s].predicate||(i[s].predicate="or"),i[s+1].predicate||(i[s+1].predicate="or"));this.parent.notify(dr,{predicates:i!==[]?i:null,range:r.filterRange,sIdx:n})}this.parent.sortCollection&&this.parent.notify("sortImport",null)}},e.prototype.getFilterOperator=function(e){switch(e){case"BeginsWith":e="startswith";break;case"Less":e="lessthan";break;case"EndsWith":e="endswith";break;case"Equal":e="equal";break;case"Notequal":e="notEqual";break;case"Greater":e="greaterthan";break;case"Contains":e="contains";break;case"LessOrEqual":e="lessthanorequal";break;case"GreaterOrEqual":e="greaterthanorequal"}return e},e.prototype.beforeInsertHandler=function(e){if("Column"===e.modelType){var r=t.isUndefined(e.activeSheetIndex)?this.parent.activeSheetIndex:e.activeSheetIndex;if(this.filterRange.size&&this.filterRange.has(r)){var n=this.filterRange.get(r);(this.isFilterCell(r,n[0],e.index)||e.index<n[1])&&(n[3]+=e.model.length,e.index<=n[1]&&(n[1]+=e.model.length),this.filterCollection.get(r).forEach(function(t){var r=f(t.field);e.index<=r&&(t.field=v(r+e.model.length+1))}),this.parent.sortCollection&&this.parent.sortCollection.forEach(function(t){t.sheetIndex===r&&e.index<=t.columnIndex&&(t.columnIndex+=e.model.length)}),this.getFilteredCollection())}}else if("Sheet"===e.modelType){for(var i=!1,a=0,o=Array.from(this.filterRange.keys()).sort().reverse();a<o.length;a++){var s=o[a];e.index<=s&&(i=!0,this.filterRange.set(s+e.model.length,this.filterRange.get(s)),this.filterRange.delete(s),this.filterCollection.set(s+e.model.length,this.filterCollection.get(s)),this.filterCollection.delete(s))}this.parent.sortCollection&&this.parent.sortCollection.forEach(function(t){e.index<=t.sheetIndex&&(t.sheetIndex+=e.model.length)}),i&&this.getFilteredCollection()}},e.prototype.beforeDeleteHandler=function(e){if("Column"===e.modelType){var t=this.parent.activeSheetIndex;if(this.filterRange.size&&this.filterRange.has(t)){var r=!0,n=this.filterRange.get(t);if(e.start>=n[1]&&e.end<=n[3]?n[3]-=e.end-e.start+1:e.start<n[1]&&e.end<n[1]?(n[1]-=e.end-e.start+1,n[3]-=e.end-e.start+1):e.start<n[1]&&e.end>n[1]&&e.end<n[3]?(n[1]=e.start,n[3]-=e.end-e.start+1):r=!1,r){for(var i=this.filterCollection.get(t),a=void 0,o=i.length-1;o>=0;o--){var s=f(i[o].field);e.end<s?i[o].field=v(s-(e.end-e.start+1)+1):e.start<=s&&e.end>=s&&(a=!0)}var l=this.parent.sortCollection;if(l)for(o=0;o<l.length;o++)if(l[o].sheetIndex===t){if(e.end<l[o].columnIndex){l[o].columnIndex=l[o].columnIndex-(e.end-e.start+1);break}if(e.start<=l[o].columnIndex&&e.end>=l[o].columnIndex){l.splice(o,1);break}}a&&this.parent.clearFilter(),this.getFilteredCollection()}}}},e.prototype.deleteSheetHandler=function(e){if(!t.isUndefined(e.sheetIndex)){for(var r=void 0,n=0,i=Array.from(this.filterRange.keys()).sort().reverse();n<i.length;n++){var a=i[n];r=!0,e.sheetIndex===a?(this.filterRange.delete(a),this.filterCollection.delete(a)):e.sheetIndex<a?(this.filterRange.set(a-1,this.filterRange.get(a)),this.filterRange.delete(a),this.filterCollection.set(a-1,this.filterCollection.get(a)),this.filterCollection.delete(a)):r=!1}var o=this.parent.sortCollection;if(o)for(var s=o.length-1;s>=0;s--)e.sheetIndex===o[s].sheetIndex?o.splice(s,1):e.sheetIndex<o[s].sheetIndex&&(o[s].sheetIndex-=1);r&&this.getFilteredCollection()}},e.prototype.clearHanlder=function(e){var t=this.parent.getAddressInfo(e.range);if(this.filterRange.has(t.sheetIndex)){var r=this.filterRange.get(t.sheetIndex).slice();G(t.indices,r[0],r[1])&&G(t.indices,r[0],r[3])&&this.removeFilter(t.sheetIndex)}},e}(),Ri=function(){function e(e){this.pictureCount=1,this.parent=e,this.addEventListener(),this.renderImageUpload()}return e.prototype.addEventListener=function(){this.parent.on("insertImage",this.insertImage,this),this.parent.on("refreshImgElem",this.refreshImgElem,this),this.parent.on(vr,this.refreshImgCellObj,this),this.parent.on(yr,this.createImageElement,this),this.parent.on(Cr,this.deleteImage,this),this.parent.on("refreshImagePosition",this.refreshInsDelImagePosition,this)},e.prototype.renderImageUpload=function(){var e=this.parent.element.id+"_imageUpload";this.parent.element.appendChild(this.parent.createElement("input",{id:e,attrs:{type:"file",accept:".image, .jpg, .png, .gif ,jpeg",name:"fileUpload"}}));var t=document.getElementById(e);t.onchange=this.imageSelect.bind(this),t.style.display="none"},e.prototype.imageSelect=function(e){var t=e.target.files[0];if(!(t&&t.length<1)){var r={file:t};0===r.file.type.indexOf("image")?this.insertImage(r):this.parent.serviceLocator.getService(Bi).show({content:this.parent.serviceLocator.getService("spreadsheetLocale").getConstant("UnsupportedFile"),width:"300"}),document.getElementById(this.parent.element.id+"_imageUpload").value=""}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("insertImage",this.insertImage),this.parent.off(vr,this.refreshImgCellObj),this.parent.off(yr,this.createImageElement),this.parent.off(Cr,this.deleteImage),this.parent.off("refreshImagePosition",this.refreshInsDelImagePosition))},e.prototype.insertImage=function(e,t){var r=this;this.binaryStringVal(e).then(function(e){return r.createImageElement({options:{src:e},range:t,isPublic:!0})})},e.prototype.binaryStringVal=function(e){return new Promise(function(t,r){var n=new FileReader;n.readAsDataURL(e.file),n.onload=function(){return t(n.result)},n.onerror=function(e){return r(e)}})},e.prototype.createImageElement=function(e){var t=e.range?e.range.indexOf("!")>0?e.range.split("!")[1]:e.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,r=e.range&&e.range.indexOf("!")>0?se(this.parent,e.range.split("!")[0]):this.parent.activeSheetIndex,n=this.parent.serviceLocator.getService(Mi),i=e.options.imageId?e.options.imageId:this.parent.element.id+"_overlay_picture_"+this.pictureCount,a=c(t),o=r?this.parent.sheets[r]:this.parent.getActiveSheet();if(!document.getElementById(i)){var s={requestType:"beforeInsertImage",range:o.name+"!"+t,imageData:e.options.src,sheetIndex:r};if(e.isPublic&&this.parent.notify("actionBegin",{eventArgs:s,action:"beforeInsertImage"}),!s.cancel){var l=n.insertOverlayElement(i,t,r);l.style.backgroundImage="url('"+e.options.src+"')",(e.options.height||e.options.left)&&(l.style.height=e.options.height+"px",l.style.width=e.options.width+"px",l.style.top=e.options.top+"px",l.style.left=e.options.left+"px"),e.options.imageId||this.pictureCount++;var h={src:e.options.src,id:i,height:parseFloat(l.style.height.replace("px","")),width:parseFloat(l.style.width.replace("px","")),top:o.frozenRows||o.frozenColumns?a[0]?Ae(o,0,a[0]-1):0:parseFloat(l.style.top.replace("px","")),left:o.frozenRows||o.frozenColumns?a[1]?Ne(o,0,a[1]-1):0:parseFloat(l.style.left.replace("px",""))};this.parent.setUsedRange(a[0],a[1]),(e.isPublic||e.isUndoRedo)&&this.parent.notify("setImage",{options:[h],range:o.name+"!"+t});var d=J(a[0],a[1],o);d.image[d.image.length-1].id||(d.image[d.image.length-1].id=h.id),s={requestType:"insertImage",range:o.name+"!"+t,imageHeight:e.options.height?e.options.height:300,imageWidth:e.options.width?e.options.width:400,imageData:e.options.src,id:i,sheetIndex:r},!e.isUndoRedo&&e.isPublic&&this.parent.notify("actionComplete",{eventArgs:s,action:"insertImage"})}}},e.prototype.refreshImgElem=function(){var e=document.getElementsByClassName("e-ss-overlay-active")[0];e&&t.removeClass([e],"e-ss-overlay-active")},e.prototype.refreshInsDelImagePosition=function(e){for(var t,r,n,i=e.count,a=e.sheetIdx,o=this.parent.sheets[a],s=J(e.rowIdx,e.colIdx,o),l=s.image.length,h=0;h<l;h++)t=document.getElementById(s.image[h].id),r="Row"===e.type?"insert"===e.status?s.image[h].top+20*i:s.image[h].top-20*i:s.image[h].top,n="Column"===e.type?"insert"===e.status?s.image[h].left+64*i:s.image[h].left-64*i:s.image[h].left,s.image[h].top=r,s.image[h].left=n,t.style.top=r+"px",t.style.left=n+"px"},e.prototype.refreshImgCellObj=function(e){var t,r,n=this.parent.getActiveSheet(),i=J(e.prevRowIdx,e.prevColIdx,n),a=J(e.currentRowIdx,e.currentColIdx,n),o=i?i.image:[],s=o&&o.length?o.length:0;if(i&&i.image&&o.length>0){for(var l=0;l<s;l++)o[l]&&o[l].id===e.id&&((t=o[l]).height=e.currentHeight,t.width=e.currentWidth,t.top=e.currentTop,t.left=e.currentLeft,o.splice(l,1));if(a&&a.image&&(r=a.image,t&&r.push(t)),r?Q(e.currentRowIdx,e.currentColIdx,n,{image:r},!0):Q(e.currentRowIdx,e.currentColIdx,n,{image:[t]},!0),"imageRefresh"===e.requestType&&!e.isUndoRedo){var h={requestType:"imageRefresh",currentRowIdx:e.currentRowIdx,currentColIdx:e.currentColIdx,prevRowIdx:e.prevRowIdx,prevColIdx:e.prevColIdx,prevTop:e.prevTop,prevLeft:e.prevLeft,currentTop:e.currentTop,currentLeft:e.currentLeft,currentHeight:e.currentHeight,currentWidth:e.currentWidth,prevHeight:e.prevHeight,prevWidth:e.prevWidth,id:e.id,sheetIdx:this.parent.activeSheetIndex};this.parent.notify("actionComplete",{eventArgs:h,action:"imageRefresh"})}}},e.prototype.deleteImage=function(e){var t,r,n=this.parent.getActiveSheet(),i=document.getElementById(e.id);if(i){var a=void 0,o=void 0;if(n.frozenRows||n.frozenColumns){var s=i.getBoundingClientRect();a={clientY:s.top},o={clientX:s.left},s.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(a.target=this.parent.getColumnHeaderContent()),s.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(o.target=this.parent.getRowHeaderTable())}else a={clientY:i.offsetTop,isImage:!0},o={clientX:i.offsetLeft,isImage:!0};this.parent.notify("getRowIdxFromClientY",a),this.parent.notify("getColIdxFromClientX",o),document.getElementById(e.id).remove(),t=a.clientY,r=o.clientX,n=this.parent.sheets[this.parent.activeSheetIndex]}else{var l=e.range?e.range.indexOf("!")>0?e.range.split("!")[1]:e.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,h=e.range&&e.range.indexOf("!")>0?se(this.parent,e.range.split("!")[0]):this.parent.activeSheetIndex,d=c(l);t=d[0],r=d[1],n=this.parent.sheets[h]}for(var p=J(t,r,n).image,u=p.length,f=0;f<u;f++)p[f].id===e.id&&p.splice(f,1);Q(t,r,n,{image:p},!0)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.getModuleName=function(){return"spreadsheetImage"},e}();p.Chart.Inject(p.ColumnSeries,p.LineSeries,p.BarSeries,p.AreaSeries,p.StackingColumnSeries,p.StackingLineSeries,p.StackingBarSeries,p.ScatterSeries),p.Chart.Inject(p.StackingAreaSeries,p.Category,p.Legend,h.Tooltip,p.DataLabel),p.AccumulationChart.Inject(p.PieSeries,p.AccumulationTooltip,p.AccumulationDataLabel,p.AccumulationLegend);var ki=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("initiateChart",this.initiateChartHandler,this),this.parent.on("refreshChartCellObj",this.refreshChartCellObj,this),this.parent.on("updateChart",this.updateChartHandler,this),this.parent.on(br,this.deleteChart,this),this.parent.on("clearChartBorder",this.clearBorder,this),this.parent.on("insertChart",this.insertChartHandler,this),this.parent.on("chartRangeSelection",this.chartRangeHandler,this),this.parent.on("chartDesignTab",this.chartDesignTabHandler,this),this.parent.on("addChartEle",this.updateChartElement,this)},e.prototype.insertChartHandler=function(e){var t="Column";switch(e.id){case"clusteredColumn":t="Column";break;case"stackedColumn":t="StackingColumn";break;case"stackedColumn100":t="StackingColumn100";break;case"clusteredBar":t="Bar";break;case"stackedBar":t="StackingBar";break;case"stackedBar100":t="StackingBar100";break;case"area":t="Area";break;case"stackedArea":t="StackingArea";break;case"stackedArea100":t="StackingArea100";break;case"line":t="Line";break;case"stackedLine":t="StackingLine";break;case"stackedLine100":t="StackingLine100";break;case"pie":t="Pie";break;case"doughnut":t="Doughnut";break;case"scatter":t="Scatter"}var r=[{type:t}];e.isChart?this.parent.notify(Gt,{chart:r}):this.parent.notify("chartDesignTab",{chartType:t})},e.prototype.chartRangeHandler=function(){var e=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active");if(e)for(var t=e.getElementsByClassName("e-control")[0].id,r=this.parent.chartColl,n=r.length,i=0;i<n;i++){var a=document.getElementById(r[i].id);e&&a&&r[i].id===t&&this.parent.notify("initiateChart",{option:r[i],chartCount:this.parent.chartCount,isRefresh:!0})}},e.prototype.getPropertyValue=function(e,r,n){var i=this.parent.sheets;if(i[n]&&i[n].rows[e]&&i[n].rows[e].cells[r]){var a=J(e,r,this.parent.sheets[n]),o="";if(a.format){var s={type:H(a.format),value:a&&a.value,format:a&&a.format?a.format:"General",formattedText:a&&a.value,onLoad:!0,isRightAlign:!1,cell:a,rowIdx:e.toString(),colIdx:r.toString()};if(a)if(this.parent.notify("getFormattedCell",s),"number"==typeof s.value){var l=new RegExp("[!@#$%^&()+=';,{}|\":<>~_-]","g");s.formattedText=s.formattedText.toString().replace(l,""),o=parseInt(s.formattedText.toString(),10)}else o=s.formattedText.toString()}else o=this.parent.sheets[n].rows[e].cells[r].value;return o=t.isNullOrUndefined(o)?"":o}return""},e.prototype.updateChartHandler=function(e){var r=this.initiateChartHandler({option:e.chart,isRefresh:!0}),n=this.parent.element.querySelector("."+e.chart.id);if(n){var i=t.getComponent(n,"chart");t.isNullOrUndefined(i)&&(i=t.getComponent(n,"accumulationchart")),i.series=r,i.refresh()}},e.prototype.refreshChartCellObj=function(e){var r,n,i=this.parent.sheets[this.parent.activeSheetIndex],a=J(e.prevRowIdx,e.prevColIdx,i),o=J(e.currentRowIdx,e.currentColIdx,i),s=a?a.chart:[],l=s&&s.length?s.length:0;if(a&&a.chart){for(var h=0;h<l;h++){var d=document.getElementsByClassName("e-datavisualization-chart e-ss-overlay-active")[0],p=document.getElementById(s[h].id);if(t.closest(p,"."+d.classList[1])===d){(r=s[h]).height=e.currentHeight,r.width=e.currentWidth,r.top=e.currentTop,r.left=e.currentLeft,s.splice(h,1);for(var c=0,u=this.parent.chartColl.length;c<u;c++)r.id===this.parent.chartColl[c].id&&(r.height=e.currentHeight,this.parent.chartColl[c].width=e.currentWidth,this.parent.chartColl[c].top=e.currentTop,this.parent.chartColl[c].left=e.currentLeft)}}if(o&&o.chart&&(n=o.chart,r&&n.push(r)),n?Q(e.currentRowIdx,e.currentColIdx,i,{chart:n},!0):Q(e.currentRowIdx,e.currentColIdx,i,{chart:[r]},!0),"chartRefresh"===e.requestType&&!e.isUndoRedo){var f={requestType:"chartRefresh",currentRowIdx:e.currentRowIdx,currentColIdx:e.currentColIdx,currentWidth:e.currentWidth,prevHeight:e.prevHeight,prevWidth:e.prevWidth,prevRowIdx:e.prevRowIdx,prevColIdx:e.prevColIdx,prevTop:e.prevTop,prevLeft:e.prevLeft,currentTop:e.currentTop,currentLeft:e.currentLeft,currentHeight:e.currentHeight,id:e.id,sheetIdx:this.parent.activeSheetIndex};this.parent.notify("actionComplete",{eventArgs:f,action:"chartRefresh"})}}},e.prototype.processChartRange=function(e,r,n){var i,a,o,s=e[0],l=e[1],h=!1,d=e[2],p=e[3],c=s===d,u=l===p,f=this.getPropertyValue(s,p,r),g=this.getPropertyValue(d,l,r),m=this.getPropertyValue(s,l,r);return L(g)&&m||(h=!0),t.isNullOrUndefined(m)&&!c&&!u||"Scatter"===n.type&&e[3]-e[1]==1?(i=[s+1,l,d,l],a=[s+1,l+1,d,p],o=[s,l+1,s,p]):t.isNullOrUndefined(g)||!h||c||u?(a=[s,l,d,p],t.isNullOrUndefined(f)||L(f)||F(f)?t.isNullOrUndefined(m)&&(c||u)&&(o=[s,l,s,p],c?(a[1]=a[1]+1,o[3]=o[1]):a[0]=a[0]+1):(o=[s,l,s,p],a[0]=a[0]+1)):t.isNullOrUndefined(f)||L(f)&&m?(i=[s,l,d,l],a=[s,l+1,d,p]):(i=[s+1,l,d,l],a=[s+1,l+1,d,p],o=[s,l+1,s,p]),{xRange:i,yRange:a,lRange:o}},e.prototype.toIntrnlRange=function(e,t){return e?"string"==typeof e&&(e=c[e]):e=c[this.parent.sheets[t].selectedRange],e},e.prototype.getRangeData=function(e){e.range=this.toIntrnlRange(e.range,e.sheetIdx);var t=[],r=[];return this.pushRowData(e,e.range[0],e.range[1],e.range[2],e.range[3],r,t,!0,e.isYvalue),r},e.prototype.pushRowData=function(e,r,n,i,a,o,s,l,h){for(var d=n,p=this.parent.sheets[e.sheetIdx];r<=i;)if(Ee(p,r))r++;else{for(n=d;n<=a;)if(De(p,n))n++;else{var c="",u=J(r,n,p);if(u&&u.format&&!h){var f={value:u&&u.value,format:u&&u.format?u.format:"General",formattedText:u&&u.value,onLoad:!0,type:u&&H(u.format),rowIdx:r.toString(),colIdx:n.toString(),isRightAlign:!1,cell:u};this.parent.notify("getFormattedCell",f),c=f.formattedText.toString()}else c=u?t.isNullOrUndefined(u.value)?"":u.value:"";o.push({value:c}),n++}r++}s.push(r)},e.prototype.toArrayData=function(e){for(var t,r=0,n=[],i=e.length;r<i;)t=e[r],Object.keys(t).length?"value"in t&&n.push(t.value):n.push(""),r++;return n},e.prototype.getVirtualXValues=function(e){for(var t=1,r=[];t<e;)r.push(t.toString()),t++;return r},e.prototype.processChartSeries=function(e,r,n,i,a){e=e||{};var o,s,l,h,d,p,c,u="",f={},g={},m=0,v=0,y=[];r=t.isNullOrUndefined(r)?this.parent.getActiveSheet().index:r;var C=this.parent.sheets[r],b=this.getRangeData({range:i,sheetIdx:r,skipFormula:!0,isYvalue:!0}),x=i[2]-i[0]+1-this.parent.hiddenCount(i[0],i[2],"rows",C),S=i[3]-i[1]+1-this.parent.hiddenCount(i[0],i[2],"columns",C);e.isSeriesInRows?(s=a?this.toArrayData(this.getRangeData({range:a,sheetIdx:r,skipFormula:!1,isYvalue:!1})):this.getVirtualXValues(S+1),n&&(l=this.toArrayData(this.getRangeData({range:n,sheetIdx:r,skipFormula:!1,isYvalue:!1}))),h=x):(s=n?this.toArrayData(this.getRangeData({range:n,sheetIdx:r,skipFormula:!1,isYvalue:!1})):this.getVirtualXValues(x+1),a&&(l=this.toArrayData(this.getRangeData({range:a,sheetIdx:r,skipFormula:!1,isYvalue:!1}))),h=S);var w=s.length,I=e.isSeriesInRows?1:h;for(t.isNullOrUndefined(e.dataLabelSettings)||(f.visible=e.dataLabelSettings.visible,f.position=e.dataLabelSettings.position);m<h;){for(p=0,d=[],v=e.isSeriesInRows?v:m;p<w;)b[v]&&(L(o=b[v].value)?o=Number(o):(c=T(o),o=isNaN(c)?0:c),d.push({x:s[p],y:o})),v+=I,p++;if(u=l&&l.length>0?l[m]:"series"+m,e.type){var E=e.type;if("Line"===E||"StackingLine"===E||"StackingLine100"===E)g={dataSource:d,type:e.type,xName:"x",yName:"y",name:u.toString(),marker:{visible:!0,width:10,height:10,dataLabel:f}};else if("Scatter"===E)g={dataSource:d,type:e.type,xName:"x",yName:"y",name:u.toString(),marker:{visible:!1,width:12,height:12,shape:"Circle",dataLabel:f}};else if("Pie"===E||"Doughnut"===E){var R="Pie"===e.type?"0%":"40%",k=f.visible,A=t.isNullOrUndefined(f.position)?"Inside":"Outer"===f.position?"Outside":"Inside";g={dataSource:d,dataLabel:{visible:!t.isNullOrUndefined(k)&&k,position:A,name:"text",font:{fontWeight:"600"}},radius:"100%",xName:"x",yName:"y",innerRadius:R}}else g={dataSource:d,type:e.type,xName:"x",yName:"y",name:u.toString(),marker:{dataLabel:f}}}y.push(g),m++}var F;return e.type&&(F={series:y,xRange:e.isSeriesInRows?a:n,yRange:i,lRange:e.isSeriesInRows?n:a}),F},e.prototype.primaryYAxisFormat=function(e){if(t.isNullOrUndefined(e))return"{value}";var r,n=J(e[0],e[1],this.parent.getActiveSheet());if(n&&n.format){if("Accounting"===(r=H(n.format)))return"${value}";if("Currency"===r)return"${value}";if("Percentage"===r)return"{value}%"}return"{value}"},e.prototype.focusChartRange=function(e,t,r){var n=["e-rcborderright","e-rcborderbottom","e-vcborderright","e-vcborderbottom","e-bcborderright","e-bcborderbottom"];this.clearBorder();var i,a=this.parent.getActiveSheet(),o=!(!a.frozenRows&&!a.frozenColumns);r&&(o?i=r:this.parent.notify("focusBorder",{startcell:{rowIndex:r[0],colIndex:r[1]},endcell:{rowIndex:r[2],colIndex:r[3]},classes:[n[0],n[1]]})),e&&(o?i?(i[0]=Math.min(r[0],e[0]),i[1]=Math.min(r[1],e[1]),i[2]=Math.max(r[2],e[2]),i[3]=Math.max(r[3],e[3])):i=e:this.parent.notify("focusBorder",{startcell:{rowIndex:e[0],colIndex:e[1]},endcell:{rowIndex:e[2],colIndex:e[3]},classes:[n[2],n[3]]})),o&&i?this.parent.notify("focusBorder",{startcell:{rowIndex:Math.min(i[0],t[0]),colIndex:Math.min(i[1],t[1])},endcell:{rowIndex:Math.max(i[2],t[2]),colIndex:Math.max(i[3],t[3])},classes:[n[4],n[5]]}):this.parent.notify("focusBorder",{startcell:{rowIndex:t[0],colIndex:t[1]},endcell:{rowIndex:t[2],colIndex:t[3]},classes:[n[4],n[5]]})},e.prototype.clearBorder=function(){var e=this.parent.getActiveSheet();if(e.frozenColumns||e.frozenRows)return void[].slice.call(this.parent.element.getElementsByClassName("e-chart-range")).forEach(function(e){t.detach(e)});for(var r=this.parent.getMainContent(),n=["e-rcborderright","e-rcborderbottom","e-vcborderright","e-vcborderbottom","e-bcborderright","e-bcborderbottom"],i=0,a=n.length;i<a;i++)for(var o=r.querySelectorAll("."+n[i]),s=0,l=o.length;s<l;s++)o[s].classList.remove(n[i])},e.prototype.initiateChartHandler=function(e){var r=e.option,n=!0;n=!!t.isNullOrUndefined(e.isInitCell)||!e.isInitCell,e.isUndoRedo=!!t.isNullOrUndefined(e.isUndoRedo)||e.isUndoRedo;e.isRefresh=!t.isNullOrUndefined(e.isRefresh)&&e.isRefresh;var i,a,o=this.parent.getActiveSheet(),s=r.range?r.range.indexOf("!")>0?r.range.split("!")[1]:r.range.split("!")[0]:this.parent.getActiveSheet().selectedRange,l=c(s),h={};if(this.parent.allowChart||!o.isProtected){var d=r.range&&r.range.indexOf("!")>0?se(this.parent,r.range.split("!")[0]):this.parent.activeSheetIndex,f={sheetIndex:d,reqType:"shape",type:"actionBegin",shapeType:"chart",action:"create",options:r,range:s,operation:"create"};h=f.options,s=f.range,h=h||{},l.length>0&&l[2]-l[0]<l[3]-l[1]&&(i=!0),h.isSeriesInRows=!!i||!!h.isSeriesInRows&&h.isSeriesInRows,e.dataSheetIdx=t.isNullOrUndefined(e.dataSheetIdx)?d:e.dataSheetIdx;var g=this.processChartRange(l,e.dataSheetIdx,h),m=g.xRange,v=g.yRange,y=g.lRange;d===this.parent.activeSheetIndex&&n&&this.focusChartRange(m,v,y);var C=this.processChartSeries(h,e.dataSheetIdx,m,v,y),b={majorGridLines:r.primaryXAxis&&r.primaryXAxis.majorGridLines&&!t.isNullOrUndefined(r.primaryXAxis.majorGridLines.width)?{width:r.primaryXAxis.majorGridLines.width}:{width:0},minorGridLines:r.primaryXAxis&&r.primaryXAxis.minorGridLines&&!t.isNullOrUndefined(r.primaryXAxis.minorGridLines.width)?{width:r.primaryXAxis.minorGridLines.width}:{width:0},minorTicksPerInterval:r.primaryXAxis&&r.primaryXAxis.minorGridLines&&r.primaryXAxis.minorGridLines.width>0?5:0,lineStyle:{width:0},valueType:"Category",visible:!r.primaryXAxis||r.primaryXAxis.visible,title:r.primaryXAxis?r.primaryXAxis.title:""},x={lineStyle:{width:0},majorGridLines:r.primaryYAxis&&r.primaryYAxis.majorGridLines&&!t.isNullOrUndefined(r.primaryYAxis.majorGridLines.width)?{width:r.primaryYAxis.majorGridLines.width}:{width:1},minorGridLines:r.primaryYAxis&&r.primaryYAxis.minorGridLines&&!t.isNullOrUndefined(r.primaryYAxis.minorGridLines.width)?{width:r.primaryYAxis.minorGridLines.width}:{width:0},minorTicksPerInterval:r.primaryYAxis&&r.primaryYAxis.minorGridLines&&r.primaryYAxis.minorGridLines.width>0?5:0,labelFormat:this.primaryYAxisFormat(v),visible:!r.primaryYAxis||r.primaryYAxis.visible,title:r.primaryYAxis?r.primaryYAxis.title:""};if(e.isRefresh)return C.series;if(e.isUndoRedo){if(a={type:r.type,theme:r.theme,isSeriesInRows:r.isSeriesInRows,range:r.range,id:r.id,height:r.height,width:r.width,posRange:e.range,isInitCell:e.isInitCell,cancel:!1},this.parent.notify(cr,{eventArgs:a,action:"beforeInsertChart"}),a.cancel)return[];r.type=a.type,r.theme=a.theme,r.isSeriesInRows=a.isSeriesInRows,r.range=a.range,r.id=a.id,r.height=a.height,r.width=a.width}var S=r.id+"_overlay",w=e.isPaste?this.parent.getActiveSheet().index:e.option.range&&e.option.range.indexOf("!")>0?se(this.parent,e.option.range.split("!")[0]):this.parent.activeSheetIndex,I=this.parent.serviceLocator.getService(Mi),E=!t.isNullOrUndefined(e.isInitCell)&&e.isInitCell?e.range:s,R=I.insertOverlayElement(S,E,w);if(R.classList.add("e-datavisualization-chart"),R.style.width=r.width+"px",R.style.height=r.height+"px",o.frozenRows||o.frozenColumns){var k=c(E),A=this.parent.frozenRowCount(o),T=this.parent.frozenColCount(o);if(k[0]<A||k[1]<T?(t.isNullOrUndefined(r.top)||(R.style.top=r.top+(o.showHeaders?31:0)-this.parent.viewport.beforeFreezeHeight+"px"),t.isNullOrUndefined(r.left)||(R.style.left=r.left+this.parent.sheetModule.getRowHeaderWidth(o,!0)-this.parent.viewport.beforeFreezeWidth+"px")):(t.isNullOrUndefined(r.top)||(R.style.top=r.top-this.parent.viewport.beforeFreezeHeight-(A?Ae(o,u(o.topLeftCell)[0],A-1):0)+"px"),t.isNullOrUndefined(r.left)||(R.style.left=r.left-this.parent.viewport.beforeFreezeWidth-(T?Ne(o,u(o.topLeftCell)[1],T-1):0)+"px")),t.isNullOrUndefined(r.top)){var F=u(o.topLeftCell)[0];r.top=this.parent.viewport.beforeFreezeHeight+(A&&F===k[0]?0:Ae(o,A?F:0,k[0]-1))}if(t.isNullOrUndefined(r.left)){var L=u(o.topLeftCell)[1];r.left=this.parent.viewport.beforeFreezeWidth+(T&&L===k[1]?0:Ne(o,T?L:0,k[1]-1))}}else R.style.top=t.isNullOrUndefined(r.top)?R.style.top:r.top+"px",R.style.left=t.isNullOrUndefined(r.left)?R.style.left:r.left+"px",r.top=parseInt(R.style.top.replace("px",""),10),r.left=parseInt(R.style.left.replace("px",""),10);this.parent.notify("overlayEleSize",{height:r.height,width:r.width});var N="Pie"===r.type||"Doughnut"===r.type?{position:"Bottom",visible:!0}:{};t.isNullOrUndefined(r.legendSettings)||(N.visible=r.legendSettings.visible,N.position=r.legendSettings.position);var D=this.parent.createElement("div",{id:r.id,className:r.id});"Pie"!==r.type&&"Doughnut"!==r.type?(this.chart=new p.Chart({primaryXAxis:b,primaryYAxis:x,chartArea:{border:{width:0}},title:r.title,legendSettings:N,theme:r.theme,series:C.series,tooltip:{enable:!0},width:R.style.width,height:R.style.height,load:function(e){var t=r.theme;t=t||"Material",e.chart.theme=t},beforeResize:function(e){e.cancelResizedEvent=!0}}),this.chart.appendTo(D)):(this.chart=new p.AccumulationChart({title:r.title,legendSettings:N,theme:r.theme,series:C.series,width:R.style.width,height:R.style.height,center:{x:"50%",y:"50%"},enableSmartLabels:!0,enableAnimation:!0,load:function(e){var t=r.theme;t=t||"Material",e.chart.theme=t},beforeResize:function(e){e.cancelResizedEvent=!0}}),this.chart.appendTo(D)),R.appendChild(D),e.isUndoRedo&&this.parent.notify(pr,{eventArgs:a,action:"insertChart"})}},e.prototype.deleteChart=function(e){this.clearBorder();var r=null,n=this.parent.getActiveSheet();if(t.isNullOrUndefined(e.id)?(r=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active"),e.id=r?r.getElementsByClassName("e-control")[0].id:null):(e.id=e.id.includes("overlay")?e.id:e.id+"_overlay",r=document.getElementById(e.id)),!t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(r)){e.id=e.id.includes("overlay")?e.id:e.id+"_overlay";for(var i,a,o,s,l=!1,h=0,d=this.parent.chartColl.length;h<d;h++)if(this.parent.chartColl[h].id===e.id.split("_overlay")[0]){s=this.parent.chartColl[h];break}var p={id:s.id,range:s.range,type:s.type,theme:s.theme,height:s.height,width:s.width,isSeriesInRows:s.isSeriesInRows,isInitCell:!0,posRange:null,top:s.top,left:s.left,cancel:!1};if(r){var u=void 0,f=void 0;if(n.frozenRows||n.frozenColumns){var m=r.getBoundingClientRect();u={clientY:m.top},f={clientX:m.left},m.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(u.target=this.parent.getColumnHeaderContent()),m.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(f.target=this.parent.getRowHeaderTable())}else u={clientY:r.offsetTop,isImage:!0},f={clientX:r.offsetLeft,isImage:!0};this.parent.notify("deleteChartColl",{id:e.id}),this.parent.notify("getRowIdxFromClientY",u),this.parent.notify("getColIdxFromClientX",f),l=!0,i=u.clientY,a=f.clientX,n=this.parent.sheets[this.parent.activeSheetIndex]}else{this.parent.notify("deleteChartColl",{id:e.id});var v=e.range&&e.range.indexOf("!")>0?se(this.parent,e.range.split("!")[0]):this.parent.activeSheetIndex,y=c(e.range?e.range.indexOf("!")>0?e.range.split("!")[1]:e.range.split("!")[0]:this.parent.getActiveSheet().selectedRange);i=y[0],a=y[1],n=this.parent.sheets[v]}var C=J(i,a,n);C&&(o=C.chart);for(var b=o?o.length:null,h=0;h<b;h++){var x=document.getElementById(e.id),S=document.getElementById(o[h].id);t.closest(S,"."+x.classList[1])===x&&o.splice(h,1)}l&&(document.getElementById(e.id).remove(),this.parent.notify("removeDesignChart",{})),Q(i,a,n,{chart:o},!0),p.posRange=g(i,a),e.isUndoRedo||this.parent.notify(pr,{eventArgs:p,action:"deleteChart"})}},e.prototype.updateChartModel=function(e,r,n,i,a){var o=r;r=r;var s=this.parent.chartColl[i].id;if(!(a&&["PHAxes","PVAxes","PHAxisTitle","PVAxisTitle","GLMajorHorizontal","GLMajorVertical","GLMinorHorizontal","GLMinorVertical"].indexOf(e)>-1))for(var l=0,h=n.chart.length;l<h;l++)if(n.chart[l].id===s)switch(e){case"PHAxes":case"PHAxisTitle":t.isNullOrUndefined(n.chart[l].primaryXAxis)&&(n.chart[l].primaryXAxis={},this.parent.chartColl[i].primaryXAxis={}),"PHAxes"===e?(n.chart[l].primaryXAxis.visible=r.primaryXAxis.visible,this.parent.chartColl[i].primaryXAxis.visible=r.primaryXAxis.visible):"PHAxisTitle"===e&&(n.chart[l].primaryXAxis.title=r.primaryXAxis.title,this.parent.chartColl[i].primaryXAxis.title=r.primaryXAxis.title);break;case"PVAxes":case"PVAxisTitle":t.isNullOrUndefined(n.chart[l].primaryYAxis)&&(n.chart[l].primaryYAxis={},this.parent.chartColl[i].primaryYAxis={}),"PVAxes"===e?(n.chart[l].primaryYAxis.visible=r.primaryYAxis.visible,this.parent.chartColl[i].primaryYAxis.visible=r.primaryYAxis.visible):"PVAxisTitle"===e&&(n.chart[l].primaryYAxis.title=r.primaryYAxis.title,this.parent.chartColl[i].primaryYAxis.title=r.primaryYAxis.title);break;case"ChartTitleNone":case"ChartTitleAbove":n.chart[l].title=r.title,this.parent.chartColl[i].title=r.title;break;case"DLNone":case"DLCenter":case"DLInsideend":case"DLInsidebase":case"DLOutsideend":if(t.isNullOrUndefined(n.chart[l].dataLabelSettings)&&(n.chart[l].dataLabelSettings={},this.parent.chartColl[i].dataLabelSettings={}),"DLNone"===e)n.chart[l].dataLabelSettings.visible=!1,this.parent.chartColl[i].dataLabelSettings.visible=!1;else{n.chart[l].dataLabelSettings.visible=!0,this.parent.chartColl[i].dataLabelSettings.visible=!0;var d=void 0;d=a?"Outside"===o.series[0].dataLabel.position?"Outer":"Middle":r.series[0].marker.dataLabel.position,n.chart[l].dataLabelSettings.position=d,this.parent.chartColl[i].dataLabelSettings.position=d}break;case"GLMajorHorizontal":t.isNullOrUndefined(n.chart[l].primaryYAxis)&&(n.chart[l].primaryYAxis={},this.parent.chartColl[i].primaryYAxis={}),t.isNullOrUndefined(n.chart[l].primaryYAxis.majorGridLines)&&(n.chart[l].primaryYAxis.majorGridLines={},this.parent.chartColl[i].primaryYAxis.majorGridLines={}),n.chart[l].primaryYAxis.majorGridLines.width=r.primaryYAxis.majorGridLines.width,this.parent.chartColl[i].primaryYAxis.majorGridLines.width=r.primaryYAxis.majorGridLines.width;break;case"GLMajorVertical":t.isNullOrUndefined(n.chart[l].primaryXAxis)&&(n.chart[l].primaryXAxis={},this.parent.chartColl[i].primaryXAxis={}),t.isNullOrUndefined(n.chart[l].primaryXAxis.majorGridLines)&&(n.chart[l].primaryXAxis.majorGridLines={},this.parent.chartColl[i].primaryXAxis.majorGridLines={}),n.chart[l].primaryXAxis.majorGridLines.width=r.primaryXAxis.majorGridLines.width,this.parent.chartColl[i].primaryXAxis.majorGridLines.width=r.primaryXAxis.majorGridLines.width;break;case"GLMinorHorizontal":t.isNullOrUndefined(n.chart[l].primaryYAxis)&&(n.chart[l].primaryYAxis={},this.parent.chartColl[i].primaryYAxis={}),t.isNullOrUndefined(n.chart[l].primaryYAxis.minorGridLines)&&(n.chart[l].primaryYAxis.minorGridLines={},this.parent.chartColl[i].primaryYAxis.minorGridLines={}),n.chart[l].primaryYAxis.minorGridLines.width=r.primaryYAxis.minorGridLines.width,this.parent.chartColl[i].primaryYAxis.minorGridLines.width=r.primaryYAxis.minorGridLines.width;break;case"GLMinorVertical":t.isNullOrUndefined(n.chart[l].primaryXAxis)&&(n.chart[l].primaryXAxis={},this.parent.chartColl[i].primaryXAxis={}),t.isNullOrUndefined(n.chart[l].primaryXAxis.minorGridLines)&&(n.chart[l].primaryXAxis.minorGridLines={},this.parent.chartColl[i].primaryXAxis.minorGridLines={}),n.chart[l].primaryXAxis.minorGridLines.width=r.primaryXAxis.minorGridLines.width,this.parent.chartColl[i].primaryXAxis.minorGridLines.width=r.primaryXAxis.minorGridLines.width;break;case"LegendNone":case"LegendsRight":case"LegendsLeft":case"LegendsBottom":case"LegendsTop":if(t.isNullOrUndefined(n.chart[l].legendSettings)&&(n.chart[l].legendSettings={},this.parent.chartColl[i].legendSettings={}),n.chart[l].legendSettings.visible=r.legendSettings.visible,this.parent.chartColl[i].legendSettings.visible=r.legendSettings.visible,"LegendNone"!==e){n.chart[l].legendSettings.position=r.legendSettings.position,this.parent.chartColl[i].legendSettings.position=r.legendSettings.position;break}}},e.prototype.updateChartElement=function(e,t,r,n,i,a){if(!(a&&["PHAxes","PVAxes","PHAxisTitle","PVAxisTitle","GLMajorHorizontal","GLMajorVertical","GLMinorHorizontal","GLMinorVertical"].indexOf(e)>-1)){var o;switch(e){case"PHAxes":(t=t).primaryXAxis.visible=!t.primaryXAxis.visible;break;case"PVAxes":(t=t).primaryYAxis.visible=!t.primaryYAxis.visible;break;case"PHAxisTitle":(t=t).primaryXAxis.title=i;break;case"PVAxisTitle":(t=t).primaryYAxis.title=i;break;case"ChartTitleNone":t.title="";break;case"ChartTitleAbove":t.title=i;break;case"DLNone":case"DLCenter":case"DLInsideend":case"DLInsidebase":case"DLOutsideend":if(t=t,o=t.series,"DLNone"===e)for(var s=0,l=o.length;s<l;s++)a?o[s].dataLabel.visible=!1:o[s].marker.dataLabel.visible=!1;else for(var s=0,l=o.length;s<l;s++)if(a){h="DLOutsideend"===e?"Outside":"Inside";o[s].dataLabel.visible=!0,o[s].dataLabel.position=h}else{var h="DLCenter"===e?"Middle":"DLInsideend"===e?"Top":"DLInsidebase"===e?"Bottom":"DLOutsideend"===e?"Outer":o[0].marker.dataLabel.position;o[s].marker.dataLabel.visible=!0,o[s].marker.dataLabel.position=h}t.series=o,a&&t.refresh();break;case"GLMajorHorizontal":(t=t).primaryYAxis.majorGridLines.width=0===t.primaryYAxis.majorGridLines.width?1:0;break;case"GLMajorVertical":(t=t).primaryXAxis.majorGridLines.width=0===t.primaryXAxis.majorGridLines.width?1:0;break;case"GLMinorHorizontal":(t=t).primaryYAxis.minorTicksPerInterval=0===t.primaryYAxis.minorGridLines.width?5:0,t.primaryYAxis.minorGridLines.width=0===t.primaryYAxis.minorGridLines.width?1:0;break;case"GLMinorVertical":(t=t).primaryXAxis.minorTicksPerInterval=0===t.primaryXAxis.minorGridLines.width?5:0,t.primaryXAxis.minorGridLines.width=0===t.primaryXAxis.minorGridLines.width?1:0;break;case"LegendNone":t.legendSettings.visible=!1;break;case"LegendsRight":case"LegendsLeft":case"LegendsBottom":case"LegendsTop":t.legendSettings.visible=!0,t.legendSettings.position="LegendsRight"===e?"Right":"LegendsLeft"===e?"Left":"LegendsBottom"===e?"Bottom":"LegendsTop"===e?"Top":t.legendSettings.position}this.updateChartModel(e,t,r,n,a)}},e.prototype.chartDesignTabHandler=function(e){var r,n=!1,i=this.parent.sheets[this.parent.activeSheetIndex],a=e.switchRowColumn,o=e.chartType,s=e.chartTheme,l=e.addChartEle,h=null,d=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active");if(d){var p,c;if(i.frozenRows||i.frozenColumns){var u=d.getBoundingClientRect();p={clientY:u.top},c={clientX:u.left},u.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(p.target=this.parent.getColumnHeaderContent()),u.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(c.target=this.parent.getRowHeaderTable())}else p={clientY:d.offsetTop,isImage:!0},c={clientX:d.offsetLeft,isImage:!0};this.parent.notify("getRowIdxFromClientY",p),this.parent.notify("getColIdxFromClientX",c);var f=J(p.clientY,c.clientX,i),g=d.querySelector(".e-chart");t.isNullOrUndefined(g)&&(g=d.querySelector(".e-accumulationchart"));for(var m=g.getAttribute("id"),v=0,y=this.parent.chartColl.length;v<y;v++)m===this.parent.chartColl[v].id&&(r=v);if(g&&(h=t.getComponent(g,"chart"),t.isNullOrUndefined(h)&&(h=t.getComponent(g,"accumulationchart"),n=!0)),a&&!n){this.parent.chartColl[r].isSeriesInRows=!!t.isNullOrUndefined(this.parent.chartColl[r].isSeriesInRows)||!this.parent.chartColl[r].isSeriesInRows;for(var v=0,C=f.chart.length;v<C;v++)f.chart[v].id===m&&(f.chart[v].isSeriesInRows=!!t.isNullOrUndefined(f.chart[v].isSeriesInRows)||!f.chart[v].isSeriesInRows);var b=this.initiateChartHandler({option:this.parent.chartColl[r],isRefresh:!0});h.series=b}if(o){var x=this.parent.chartColl[r].type;this.parent.chartColl[r].type=o;for(var v=0,C=f.chart.length;v<C;v++)f.chart[v].id===m&&(f.chart[v].type=o);if("Pie"!==o&&"Doughnut"!==o)if("Pie"===x||"Doughnut"===x)this.changeCharType(r);else{for(var v=0,S=(b=h.series).length;v<S;v++)b[v].type=o;h.series=b,h.refresh()}else if("Pie"===x||"Doughnut"===x){for(var v=0,S=(b=h.series).length;v<S;v++)b[v].innerRadius="Pie"===o?"0%":"40%";h.series=b,h.refresh()}else this.changeCharType(r)}if(s){this.parent.chartColl[r].theme=s;for(var v=0,C=f.chart.length;v<C;v++)f.chart[v].id===m&&(f.chart[v].theme=s);h.theme=s,h.refresh()}if(l)if("ChartTitleAbove"===l||"PHAxisTitle"===l||"PVAxisTitle"===l){if(this.parent.element.getElementsByClassName("e-title-dlg").length>0)return;this.titleDlgHandler(l,h,f,r,n)}else this.updateChartElement(l,h,f,r,"",n)}},e.prototype.changeCharType=function(e){var r=document.getElementById(this.parent.chartColl[e].id),n=t.closest(r,".e-datavisualization-chart");n.remove(),this.parent.notify("initiateChart",{option:this.parent.chartColl[e],isInitCell:!1,isUndoRedo:!0,isPaste:!1}),r=document.getElementById(this.parent.chartColl[e].id),(n=t.closest(r,".e-datavisualization-chart")).classList.contains("e-ss-overlay-active")||n.classList.add("e-ss-overlay-active")},e.prototype.titleDlgHandler=function(e,t,r,n,i){var a=this,o="";if(!i||"PHAxisTitle"!==e&&"PVAxisTitle"!==e){var s=this.parent.serviceLocator.getService(Hi),l=this.parent.serviceLocator.getService(Bi);l.show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-title-dlg",header:"chart_abovechart"===e?s.getConstant("ChartTitle"):"PHAxisTitle"===e?s.getConstant("HorizontalAxisTitle"):s.getConstant("VerticalAxisTitle"),target:document.querySelector(".e-control.e-spreadsheet"),beforeOpen:function(){l.dialogInstance.content=a.titleDlgContent(e,t),l.dialogInstance.dataBind(),a.parent.element.focus()},buttons:[{buttonModel:{content:s.getConstant("Ok"),isPrimary:!0,cssClass:"e-btn e-clearall-btn e-flat"},click:function(){var i=a.parent.element.querySelector(".e-title-dlg").getElementsByClassName("e-title-dlg-content")[0];o=i.getElementsByTagName("input")[0].value,l.hide(),a.updateChartElement(e,t,r,n,o)}}]}),l.dialogInstance.refresh()}},e.prototype.titleDlgContent=function(e,t){var r=this.parent.serviceLocator.getService(Hi).getConstant("EnterTitle"),n=this.parent.createElement("div",{className:"e-title-dlg-content"}),i=this.parent.createElement("span",{className:"e-header e-top-header",innerHTML:r}),a=this.parent.createElement("input",{className:"e-input",id:"titleInput",attrs:{type:"text"}});return n.appendChild(i),n.appendChild(a),t&&(a.value="PHAxisTitle"===e?t.primaryXAxis.title?t.primaryXAxis.title:a.value:"PVAxisTitle"===e?t.primaryYAxis.title?t.primaryYAxis.title:a.value:t.title?t.title:a.value),n},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiateChart",this.initiateChartHandler),this.parent.off("refreshChartCellObj",this.refreshChartCellObj),this.parent.off("updateChart",this.updateChartHandler),this.parent.off(br,this.deleteChart),this.parent.off("clearChartBorder",this.clearBorder),this.parent.off("insertChart",this.insertChartHandler),this.parent.off("chartRangeSelection",this.chartRangeHandler),this.parent.off("chartDesignTab",this.chartDesignTabHandler),this.parent.off("addChartEle",this.updateChartElement))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null;var e=null;this.chart&&(e=this.chart.element,this.chart.destroy()),e&&t.detach(e),this.chart=null},e.prototype.getModuleName=function(){return"spreadsheetChart"},e}(),Ai=function(){function e(){$i.Inject(mi,vi,Ci,jn,qn,Yn,Xn,zn,Zt,bi,Si,xi,wi,Kn,yi,Ii,Zn,ei,$n,Ei,Qn,ti,ri,ni,ai,ii,oi,si,li,Ri,ki)}return e.prototype.getModuleName=function(){return"basic"},e.prototype.destroy=function(){},e}(),Ti=function(){function e(){$i.Inject(mi,vi,Ci,jn,qn,Yn,Xn,zn,Zt,bi,xi,wi,Kn,yi,Ii,$n,Zn,ei,Ei,Qn,ti,ri,ni,ii,ai,oi,si,Ri,li,ki)}return e.prototype.getModuleName=function(){return"all"},e.prototype.destroy=function(){},e}(),Fi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Li=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},Ni=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Fi(r,e),Li([t.Property(!1)],r.prototype,"isFinite",void 0),Li([t.Property(!0)],r.prototype,"enableVirtualization",void 0),r}(t.ChildProperty),Di=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Fi(r,e),Li([t.Property("Multiple")],r.prototype,"mode",void 0),r}(t.ChildProperty),Oi="e-wraptext",Hi="spreadsheetLocale",Bi="dialog",Mi="shape",Pi={Custom:["#ffffff","#000000","#e7e6e6","#44546a","#4472c4","#ed7d31","#a5a5a5","#ffc000","#70ad47","#ff0000","#f2f2f2","#808080","#cfcdcd","#d5dce4","#d9e2f3","#fbe4d5","#ededed","#fff2cc","#e2efd9","#ffcccc","#d9d9d9","#595959","#aeaaaa","#acb9ca","#b4c6e7","#f7caac","#dbdbdb","#ffe599","#c5e0b3","#ff8080","#bfbfbf","#404040","#747070","#8496b0","#8eaadb","#f4b083","#c9c9c9","#ffd966","#a8d08d","#ff3333","#a6a6a6","#262626","#3b3838","#323e4f","#2f5496","#c45911","#7b7b7b","#bf8f00","#538135","#b30000","#7f7f7f","#0d0d0d","#161616","#212934","#1f3763","#823b0b","#525252","#7f5f00","#375623","#660000"]},_i={Custom:["#ffffff","#000000","#ffff00","#00ff00","#00ffff","#0000ff","#ff0000","#000080","#800080","#996633","#f2f2f2","#808080","#ffffcc","#b3ffb3","#ccffff","#ccccff","#ffcccc","#ccccff","#ff80ff","#f2e6d9","#d9d9d9","#595959","#ffff80","#80ff80","#b3ffff","#8080ff","#ff8080","#8080ff","#ff00ff","#dfbf9f","#bfbfbf","#404040","#ffff33","#33ff33","#33ffff","#3333ff","#ff3333","#0000b3","#b300b3","#c68c53","#a6a6a6","#262626","#e6e600","#00b300","#009999","#000099","#b30000","#000066","#660066","#86592d","#7f7f7f","#0d0d0d","#999900","#006600","#006666","#000066","#660000","#00004d","#4d004d","#734d26"]},Ui={FindValue:"Find value",ReplaceValue:"Replace value",FindReplaceTooltip:"Find & Replace",InsertingEmptyValue:"Reference value is not valid.",ReplaceAllEnd:" matches replaced with ",ByRow:"By Rows",ByColumn:"By Columns",MatchCase:"Match case ",MatchExactCellElements:"Match exact cell contents",Replace:"Replace...",Find:"Find and Replace...",Goto:"Goto...",EntercellAddress:"Enter cell address",GotoSpecial:"GotoSpecial...",FindAndReplace:"Find and Replace",FindNextBtn:"Find Next",FindPreviousBtn:"Find Previous",ReplaceBtn:"Replace",ReplaceAllBtn:"Replace All",GotoHeader:"Go To",GotoSpecialHeader:"Go To Special",Sheet:"Sheet",Workbook:"Workbook",NoElements:"We couldn't find what you were looking for.",FindWhat:"Find what",ReplaceWith:"Replace with",Cut:"Cut",Copy:"Copy",Paste:"Paste",PasteSpecial:"Paste Special",Link:"Link",SpreadsheetHyperlink:"SpreadsheetHyperlink",Hyperlink:"Hyperlink",EditHyperlink:"Edit Hyperlink",OpenHyperlink:"Open Hyperlink",RemoveHyperlink:"Remove Hyperlink",InvalidHyperlinkAlert:"The address of this site is not valid. Check the address and try again.",InsertLink:"Insert Link",EditLink:"Edit Link",All:"All",Values:"Values",Formats:"Formats",Bold:"Bold",Font:"Font",FontSize:"Font Size",Italic:"Italic",Underline:"Underline",Strikethrough:"Strikethrough",TextColor:"Text Color",FillColor:"Fill Color",HorizontalAlignment:"Horizontal Alignment",AlignLeft:"Align Left",AlignCenter:"Center",AlignRight:"Align Right",VerticalAlignment:"Vertical Alignment",AlignTop:"Align Top",AlignMiddle:"Align Middle",AlignBottom:"Align Bottom",WrapText:"Wrap Text",MergeCells:"Merge Cells",MergeAll:"Merge All",MergeHorizontally:"Merge Horizontally",MergeVertically:"Merge Vertically",Unmerge:"Unmerge",UnmergeCells:"Unmerge Cells",SelectMergeType:"Select Merge Type",MergeCellsAlert:"Merging cells will only preserve the top-leftmost(Uppermost) value. Merge anyway?",PasteMergeAlert:'We can"t do that to a merge cell.',Borders:"Borders",TopBorders:"Top Borders",LeftBorders:"Left Borders",RightBorders:"Right Borders",BottomBorders:"Bottom Borders",AllBorders:"All Borders",HorizontalBorders:"Horizontal Borders",VerticalBorders:"Vertical Borders",OutsideBorders:"Outside Borders",InsideBorders:"Inside Borders",NoBorders:"No Borders",BorderColor:"Border Color",BorderStyle:"Border Style",InsertFunction:"Insert Function",Insert:"Insert",Delete:"Delete",DuplicateSheet:"Duplicate",MoveRight:"Move Right",MoveLeft:"Move Left",Rename:"Rename",Hide:"Hide",Unhide:"Unhide",NameBox:"Name Box",ShowHeaders:"Show Headers",HideHeaders:"Hide Headers",ShowGridLines:"Show Gridlines",HideGridLines:"Hide Gridlines",FreezePanes:"Freeze Panes",FreezeRows:"Freeze Rows",FreezeColumns:"Freeze Columns",UnfreezePanes:"Unfreeze Panes",UnfreezeRows:"Unfreeze Rows",UnfreezeColumns:"Unfreeze Columns",AddSheet:"Add Sheet",ListAllSheets:"List All Sheets",FullScreen:"Full Screen",CollapseToolbar:"Collapse Toolbar",ExpandToolbar:"Expand Toolbar",CollapseFormulaBar:"Collapse Formula Bar",ExpandFormulaBar:"Expand Formula Bar",File:"File",Home:"Home",Formulas:"Formulas",View:"View",New:"New",Open:"Open",SaveAs:"Save As",Update:"Update",ExcelXlsx:"Microsoft Excel",ExcelXls:"Microsoft Excel 97-2003",CSV:"Comma-separated values",FormulaBar:"Formula Bar",Sort:"Sort",SortAscending:"Ascending",SortDescending:"Descending",CustomSort:"Custom Sort",AddColumn:"Add Column",ContainsHeader:"Data contains header",CaseSensitive:"Case sensitive",SortBy:"Sort by",ThenBy:"Then by",SelectAColumn:"Select a column",SortEmptyFieldError:"Sort criteria column should not be empty.",SortDuplicateFieldError:" is mentioned more than once. Duplicate columns must be removed.",SortOutOfRangeError:"Select a cell or range inside the used range and try again.",SortAndFilter:"Sort & Filter",Filter:"Filter",ClearAllFilter:"Clear",ClearFilterFrom:"Clear Filter From ",ReapplyFilter:"Reapply",FilterCellValue:"Filter by Value of Selected Cell",FilterOutOfRangeError:"Select a cell or range inside the used range and try again.",HideRow:"Hide Row",HideRows:"Hide Rows",UnHideRows:"UnHide Rows",HideColumn:"Hide Column",HideColumns:"Hide Columns",UnHideColumns:"UnHide Columns",InsertRow:"Insert Row",InsertRows:"Insert Rows",Above:"Above",Below:"Below",InsertColumn:"Insert Column",InsertColumns:"Insert Columns",Before:"Before",After:"After",DeleteRow:"Delete Row",DeleteRows:"Delete Rows",DeleteColumn:"Delete Column",DeleteColumns:"Delete Columns",Ok:"Ok",Close:"Close",Cancel:"CANCEL",Apply:"Apply",MoreColors:"More Colors",StandardColors:"Standard Colors",General:"General",Number:"Number",Currency:"Currency",Accounting:"Accounting",ShortDate:"Short Date",LongDate:"Long Date",Time:"Time",Percentage:"Percentage",Fraction:"Fraction",Scientific:"Scientific",Text:"Text",MobileFormulaBarPlaceHolder:"Enter value or Formula",NumberFormat:"Number Format",PasteAlert:"You can't paste this here, because the copy area and paste area aren't in the same size. Please try pasting in a different range.",DestroyAlert:"Are you sure you want to destroy the current workbook without saving and create a new workbook?",SheetRenameInvalidAlert:"Sheet name contains invalid character.",SheetRenameEmptyAlert:"Sheet name cannot be empty.",SheetRenameAlreadyExistsAlert:"Sheet name already exists. Please enter another name.",DeleteSheetAlert:"You can't undo deleting sheets, and you might be removing some data. If you don't need it, click OK to delete.",DeleteSingleLastSheetAlert:"A Workbook must contain at least one visible worksheet.",PickACategory:"Pick a category",Description:"Description",UnsupportedFile:"Unsupported File",InvalidUrl:"Invalid URL",SUM:"Adds a series of numbers and/or cells.",SUMIF:"Adds the cells based on specified condition.",SUMIFS:"Adds the cells based on specified conditions.",ABS:"Returns the value of a number without its sign.",RAND:"Returns a random number between 0 and 1.",RANDBETWEEN:"Returns a random integer based on specified values.",FLOOR:"Rounds a number down to the nearest multiple of a given factor.",CEILING:"Rounds a number up to the nearest multiple of a given factor.",PRODUCT:"Multiplies a series of numbers and/or cells.",INT:"Returns a number to the nearest integer.",ROUNDUP:"Rounds a number away from zero.",SUMPRODUCT:"Returns sum of the product of given ranges of arrays.",SORT:"Sorts a range of an array",TODAY:"Returns the current date as date value.",AVERAGE:"Calculates average for the series of numbers and/or cells excluding text.",AVERAGEIF:"Calculates average for the cells based on specified criterion.",AVERAGEIFS:"Calculates average for the cells based on specified conditions.",AVERAGEA:"Calculates the average for the cells evaluating TRUE as 1, text and FALSE as 0.",COUNT:"Counts the cells that contain numeric values in a range.",COUNTIF:"Counts the cells based on specified condition.",COUNTIFS:"Counts the cells based on specified conditions.",COUNTA:"Counts the cells that contains values in a range.",MIN:"Returns the smallest number of the given arguments.",MAX:"Returns the largest number of the given arguments.",DATE:"Returns the date based on given year, month, and day.",DAY:"Returns the day from the given date.",DAYS:"Returns the number of days between two dates.",IF:"Returns value based on the given expression.",IFS:"Returns value based on the given multiple expressions.",CalculateAND:"Returns TRUE if all the arguments are TRUE, otherwise returns FALSE.",CalculateOR:"Returns TRUE if any of the arguments are TRUE, otherwise returns FALSE.",IFERROR:"Returns value if no error found else it will return specified value.",CHOOSE:"Returns a value from list of values, based on index number.",INDEX:"Returns a value of the cell in a given range based on row and column number.",FIND:"Returns the position of a string within another string, which is case sensitive",TEXT:"Converts a value to text in specified number format.",CONCATENATE:"Combines two or more strings together.",CONCAT:"Concatenates a list or a range of text strings.",SUBTOTAL:"Returns subtotal for a range using the given function number.",RADIANS:"Converts degrees into radians.",MATCH:"Returns the relative position of a specified value in given range.",LN:"Returns the natural logarithm of a number.",INTERCEPT:"Calculates the point of the Y-intercept line via linear regression.",SLOPE:"Returns the slope of the line from linear regression of the data points.",DefineNameExists:"This name already exists, try different name.",DefineNameInValid:"The name that you entered is not valid.",CircularReference:"When a formula refers to one or more circular references, this may result in an incorrect calculation.",ShowRowsWhere:"Show rows where:",OR:"OR",AND:"AND",CustomFilterDatePlaceHolder:"Choose a date",CustomFilterPlaceHolder:"Enter the value",CustomFilter:"Custom Filter",Between:"Between",DateTimeFilter:"DateTime Filters",Undo:"Undo",Redo:"Redo",DateFilter:"Date Filters",TextFilter:"Text Filters",NumberFilter:"Number Filters",ClearFilter:"Clear Filter",NoResult:"No Matches Found",FilterFalse:"False",FilterTrue:"True",Blanks:"Blanks",SelectAll:"Select All",GreaterThanOrEqual:"Greater Than Or Equal",GreaterThan:"Greater Than",LessThanOrEqual:"Less Than Or Equal",LessThan:"Less Than",NotEqual:"Not Equal",Equal:"Equal",Contains:"Contains",EndsWith:"Ends With",StartsWith:"Starts With",ClearButton:"Clear",FilterButton:"Filter",CancelButton:"Cancel",OKButton:"OK",Search:"Search",ProtectSheet:"Protect Sheet",UnprotectSheet:"Unprotect Sheet",LockCells:"Lock Cells",SelectCells:"Select cells",FormatCells:"Format cells",FormatRows:"Format rows",FormatColumns:"Format columns",InsertLinks:"Insert links",ProtectContent:"Protect the contents of locked cells",ProtectAllowUser:" Allow all users of this worksheet to:",EditAlert:"The cell you're trying to change is protected. To make change, unprotect the sheet.",SearchWithin:"Search within",SearchBy:"Search by",Reference:"Reference",DataValidation:"Data Validation",CLEARALL:"Clear All",APPLY:"Apply",CellRange:"Cell Range",Allow:"Allow",Data:"Data",Minimum:"Minimum",Maximum:"Maximum",IgnoreBlank:"Ignore blank",WholeNumber:"Whole Number",Decimal:"Decimal",Date:"Date",TextLength:"Text Length",List:"List",NotBetween:"Not between",EqualTo:"Equal to",NotEqualTo:"Not equal to",Greaterthan:"Greater than",Lessthan:"Less than",GreaterThanOrEqualTo:"Greater than or equal to",LessThanOrEqualTo:"Less than or equal to",InCellDropDown:"In-cell-dropdown",Sources:"Sources",Value:"Value",Retry:"Retry",EnterValue:"Enter value",DialogError:"The list source must be a reference to single row or column.",ListLengthError:"The list values allows only upto 256 charcters",ValidationError:"This value doesn't match the data validation restrictions defined for the cell.",EmptyError:"You must enter a value",ClearHighlight:"Clear Highlight",HighlightInvalidData:"Highlight Invalid Data",ClearValidation:"Clear Validation",HighlightCellsRules:"Highlight Cells Rules",CFEqualTo:"Equal To",TextThatContains:"Text that Contains",ADateOccuring:"A Date Occuring",DuplicateValues:"Duplicate Values",TopBottomRules:"Top/Bottom Rules",Top10Items:"Top 10 Items",Top10:"Top 10",Bottom10Items:"Bottom 10 Items",Bottom10:"Bottom 10",AboveAverage:"Above Average",BelowAverage:"Below Average",FormatCellsGreaterThan:"Format cells that are GREATER THAN:",FormatCellsLessThan:"Format cells that are LESS THAN:",FormatCellsBetween:"Format cells that are BETWEEN:",FormatCellsEqualTo:"Format cells that are EQUAL TO:",FormatCellsThatContainTheText:"Format cells that contain the text:",FormatCellsThatContainADateOccurring:"Format cells that contain a date occurring:",FormatCellsDuplicate:"Format cells that contain:",FormatCellsTop:"Format cells that rank in the TOP:",FormatCellsBottom:"Format cells that rank in the BOTTOM:",FormatCellsAbove:"Format cells that are ABOVE AVERAGE:",FormatCellsBelow:"Format cells that are BELOW AVERAGE:",With:"with",DataBars:"Data Bars",ColorScales:"Color Scales",IconSets:"Icon Sets",ClearRules:"Clear Rules",SelectedCells:"Clear Rules from Selected Cells",EntireSheet:"Clear Rules from Entire Sheet",ISNUMBER:"Returns true when the value parses as a numeric value.",ROUND:"Rounds a number to a specified number of digits.",GEOMEAN:"Returns the geometric mean of an array or range of positive data.",POWER:"Returns the result of a number raised to power",LOG:"Returns the logarithm of a number to the base that you specify.",TRUNC:"Returns the truncated value of a number to a specified number of decimal places.",EXP:"Returns e raised to the power of the given number.",Clear:"Clear",ClearContents:"Clear Contents",ClearAll:"Clear All",ClearFormats:"Clear Formats",ClearHyperlinks:"Clear Hyperlinks",LightRedFillWithDarkRedText:"Light Red Fill with Dark Red Text",YellowFillWithDarkYellowText:"Yellow Fill with Dark Yellow Text",GreenFillWithDarkGreenText:"Green Fill with Dark Green Text",RedFill:"Red Fill",RedText:"Red Text",Duplicate:"Duplicate",Unique:"Unique",And:"and",WebPage:"WEB PAGE",ThisDocument:"THIS DOCUMENT",DisplayText:"Display Text",Url:"URL",CellReference:"Cell Reference",DefinedNames:"Defined Names",EnterTheTextToDisplay:"Enter the text to display",EnterTheUrl:"Enter the URL",Image:"Image",ConditionalFormatting:"Conditional Formatting",BlueDataBar:"Blue Data Bar",GreenDataBar:"Green Data Bar",RedDataBar:"Red Data Bar",OrangeDataBar:"Orange Data Bar",LightblueDataBar:"Light blue Data Bar",PurpleDataBar:"Purple Data Bar",GYRColorScale:"Green - Yellow - Red Color Scale",RYGColorScale:"Red - Yellow - Green Color Scale",GWRColorScale:"Green - White - Red Color Scale",RWGColorScale:"Red - White - Green Color Scale",BWRColorScale:"Blue - White - Red Color Scale",RWBColorScale:"Red - White - Blue Color Scale",WRColorScale:"White - Red Color Scale",RWColorScale:"Red - White Color Scale",GWColorScale:"Green - White Color Scale",WGColorScale:"White - Green Color Scale",GYColorScale:"Green - Yellow Color Scale",YGColorScale:"Yellow - Green Color Scale",ThreeArrowsColor:"3 Arrows (Colored)",ThreeArrowsGray:"3 Arrows (Gray)",ThreeTriangles:"3 Triangles",FourArrowsColor:"4 Arrows (Gray)",FourArrowsGray:"4 Arrows (Colored)",FiveArrowsColor:"5 Arrows (Gray)",FiveArrowsGray:"5 Arrows (Colored)",ThreeTrafficLights1:"3 Traffic Lights (Unrimmed)",ThreeTrafficLights2:"3 Traffic Lights (Rimmed)",ThreeSigns:"3 Signs",FourTrafficLights:"4 Traffic Lights",RedToBlack:"Red To Black",ThreeSymbols1:"3 Symbols (Circled)",ThreeSymbols2:"3 Symbols (Uncircled)",ThreeFlags:"3 Flags",ThreeStars:"3 Stars",FourRatings:"4 Ratings",FiveQuarters:"5 Quarters",FiveRatings:"5 Ratings",FiveBoxes:"5 Boxes",Chart:"Chart",Column:"Column",Bar:"Bar",Area:"Area",Pie:"Pie",Doughnut:"Doughnut",PieAndDoughnut:"Pie/Doughnut",Line:"Line",Radar:"Radar",Scatter:"Scatter",ChartDesign:"Chart Design",ClusteredColumn:"Clustered Column",StackedColumn:"Stacked Column",StackedColumn100:"100% Stacked Column",ClusteredBar:"Clustered Bar",StackedBar:"Stacked Bar",StackedBar100:"100% Stacked Bar",StackedArea:"Stacked Area",StackedArea100:"100% Stacked Area",StackedLine:"Stacked Line",StackedLine100:"100% Stacked Line",AddChartElement:"Add Chart Element",Axes:"Axes",AxisTitle:"Axis Title",ChartTitle:"Chart Title",DataLabels:"Data Labels",Gridlines:"Gridlines",Legends:"Legends",PrimaryHorizontal:"Primary Horizontal",PrimaryVertical:"Primary Vertical",None:"None",AboveChart:"Above Chart",Center:"Center",InsideEnd:"Inside End",InsideBase:"Inside Base",OutsideEnd:"OutSide End",PrimaryMajorHorizontal:"Primary Major Horizontal",PrimaryMajorVertical:"Primary Major Vertical",PrimaryMinorHorizontal:"Primary Minor Horizontal",PrimaryMinorVertical:"Primary Minor Vertical",Right:"Right",Left:"Left",Bottom:"Bottom",Top:"Top",SwitchRowColumn:"Switch Row/Column",ChartTheme:"Chart Theme",ChartType:"Chart Type",Material:"Material",Fabric:"Fabric",Bootstrap:"Bootstrap",HighContrastLight:"HighContrast Light",MaterialDark:"Material Dark",FabricDark:"Fabric Dark",HighContrast:"HighContrast",BootstrapDark:"Bootstrap Dark",Bootstrap4:"Bootstrap4",VerticalAxisTitle:"Vertical Axis Title",HorizontalAxisTitle:"Horizontal Axis Title",EnterTitle:"Enter Title",ProtectWorkbook:"Protect Workbook",Password:"Password (optional):",unProtectPassword:"Password",EnterThePassword:"Enter the password",ConfirmPassword:"Confirm Password",EnterTheConfirmPassword:"Re-enter your password",PasswordAlert:"Confirmation password is not identical",UnProtectWorkbook:"Unprotect Workbook",UnProtectPasswordAlert:"The password you supplied is not correct.",InCorrectPassword:"Unable to open the file or worksheet with the given password",PasswordAlertMsg:"Please enter the password",ConfirmPasswordAlertMsg:"Please enter the confirm password",IsProtected:"is protected",PDF:"PDF document"},Vi=function(){function e(e){this.colGroupWidth=30,this.parent=e,this.col=e.createElement("col"),this.rowRenderer=e.serviceLocator.getService("row"),this.cellRenderer=e.serviceLocator.getService("cell"),this.addEventListener()}return e.prototype.refreshSelectALLContent=function(){var e,t=this.parent.getActiveSheet();if(t.frozenColumns||t.frozenRows){var r=this.getSelectAllTable().querySelector("thead"),n=this.rowRenderer.render();r.appendChild(n),e=this.parent.createElement("th",{className:"e-select-all-cell"}),n.appendChild(e)}else(e=this.headerPanel.firstElementChild).classList.add("e-select-all-cell");e.appendChild(this.parent.createElement("button",{className:"e-selectall e-icons",id:this.parent.element.id+"_select_all"}))},e.prototype.updateLeftColGroup=function(e,t){e&&(this.colGroupWidth=e),t||(t=this.getRowHeaderPanel());var r,n=t.querySelector("table"),i=this.parent.getActiveSheet();if(e)n.querySelector("colgroup").firstElementChild.style.width=this.colGroupWidth+"px";else{r=this.parent.createElement("colgroup");var a=this.col.cloneNode();a.style.width=this.colGroupWidth+"px",r.appendChild(a),n.insertBefore(r,n.querySelector("tbody"))}(i.frozenRows||i.frozenColumns)&&(n=this.getSelectAllTable(),e?n.querySelector("colgroup").firstElementChild.style.width=this.colGroupWidth+"px":n.insertBefore(r.cloneNode(!0),n.querySelector("thead"))),this.setPanelWidth(i,t),this.setPanelHeight(i)},e.prototype.setPanelWidth=function(e,r){var n=this.getScrollSize(!0),i=this.getRowHeaderWidth(e),a=this.parent.enableRtl?"right":"left";if(e.frozenColumns){var o=document.getElementById(this.parent.element.id+"_sheet").getElementsByClassName("e-frozen-column")[0];o.style.height="calc(100% - "+n+"px)",o.style[a]=i-at(1)+"Px",o.style.display=""}this.setHeaderPanelWidth(this.getSelectAllContent(),i),this.getColHeaderPanel().style.width="calc(100% - "+i+"px)",this.getColHeaderPanel().style[a]=i+"px",this.setHeaderPanelWidth(r,i),this.getContentPanel().style.width="calc(100% - "+i+"px)",this.getContentPanel().style[a]=i+"px";var s=this.contentPanel.nextElementSibling?this.contentPanel.nextElementSibling:null;s&&(n?s.style.height=n+1+"px":(s.style.height="1px",s.style.borderTopWidth="0px"),(s=s.firstElementChild).style[a]=i+"px",s.style.width="calc(100% - "+i+"px)",t.Browser.userAgent.indexOf("Mac OS")>-1&&"safari"===t.Browser.info.name&&(s.style.height="7px",s.style.top="-7px"))},e.prototype.getScrollSize=function(e){var t=this.parent.enableRtl?"margin-left":"margin-right";return parseInt(this.headerPanel.style[t],10)?parseInt(this.headerPanel.style[t],10)+(e?1:0):0},e.prototype.setHeaderPanelWidth=function(e,t){[].slice.call(e.querySelectorAll("col.e-empty")).forEach(function(e){t+=parseInt(e.style.width,10)}),e.style.width=t+"px"},e.prototype.setPanelHeight=function(e){var r=this.getScrollSize(!0);if(e.frozenRows){var n=this.getColHeaderHeight(e);e.showHeaders||e.frozenColumns?this.headerPanel.style.height="":this.headerPanel.style.height=n+"px",this.contentPanel.style.height="calc(100% - "+(n+r)+"px)";var i=document.getElementById(this.parent.element.id+"_sheet").getElementsByClassName("e-frozen-row")[0];i.style.width=t.Browser.isDevice?"100%":"calc(100% - "+r+"px)",i.style.top=n-1-(e.showHeaders?1:0)+"px",i.style.display=""}else this.contentPanel.style.height="calc(100% - "+((e.showHeaders?at(31):0)+r)+"px)"},e.prototype.renderPanel=function(){this.contentPanel=this.parent.createElement("div",{className:"e-main-panel"});var e=this.parent.getActiveSheet(),r=this.parent.element.id;this.contentPanel.appendChild(this.parent.createElement("div",{className:"e-row-header",id:r+"_row_header"})),this.initHeaderPanel(),this.parent.allowScrolling&&this.parent.scrollModule.setPadding();var n=document.getElementById(this.parent.element.id+"_sheet");e.frozenColumns&&n.classList.add("e-frozen-columns"),e.frozenRows&&n.classList.add("e-frozen-rows"),this.updateHideHeaders(e,n),e.showGridLines||n.classList.add("e-hide-gridlines");var i=this.contentPanel.appendChild(this.parent.createElement("div",{className:"e-sheet-content",id:r+"_main_content"}));this.parent.allowScrolling||(i.style.overflow="hidden"),e.frozenRows&&n.appendChild(this.parent.createElement("div",{className:"e-frozen-row",styles:"display: none"})),e.frozenColumns&&n.appendChild(this.parent.createElement("div",{className:"e-frozen-column",styles:"display: none"})),t.Browser.userAgent.indexOf("Mac OS")>-1&&"safari"===t.Browser.info.name&&n.classList.add("e-mac-safari")},e.prototype.initHeaderPanel=function(){var e=this.parent.element.id;this.headerPanel=this.parent.createElement("div",{className:"e-header-panel"}),this.headerPanel.appendChild(this.parent.createElement("div",{className:"e-selectall-container",id:e+"_selectall"})),this.headerPanel.appendChild(this.parent.createElement("div",{className:"e-column-header",id:e+"_col_header"}))},e.prototype.createHeaderTable=function(){var e=this.contentPanel.querySelector(".e-row-header"),t=this.parent.getActiveSheet();(t.frozenRows||t.frozenColumns)&&this.updateTable(t.frozenRows?["thead","tbody"]:["thead"],"selectall",this.headerPanel.querySelector(".e-selectall-container")),this.updateTable(t.frozenRows?["thead","tbody"]:["thead"],"colhdr",this.headerPanel.querySelector(".e-column-header")),this.updateTable(["tbody"],"rowhdr",e),this.updateLeftColGroup(null,e)},e.prototype.updateTable=function(e,t,r){var n=this,i=this.parent.createElement("table",{className:"e-table",attrs:{role:"grid"}});i.classList.add("e-"+t+"-table"),r.appendChild(i),e.forEach(function(e){i.appendChild(n.parent.createElement(e))})},e.prototype.renderTable=function(e){var r,n,i,a=this,o=this.parent.getActiveSheet(),s=document.createDocumentFragment();if(s.appendChild(this.headerPanel),s.appendChild(this.contentPanel),this.parent.allowScrolling){var l=this.parent.createElement("div",{className:"e-scrollbar"});l.appendChild(this.parent.createElement("div",{className:"e-scroller"})),s.appendChild(l)}this.createHeaderTable(),this.updateTable(["tbody"],"content",this.contentPanel.lastElementChild);var h,d=this.parent.createElement("colgroup"),p=this.contentPanel.querySelector(".e-sheet-content tbody");this.refreshSelectALLContent();var u=this.getSelectAllContent().querySelector("colgroup"),f=this.getRowHeaderPanel().querySelector("colgroup"),g=this.getSelectAllContent().querySelector("thead .e-header-row"),m=this.contentPanel.querySelector(".e-row-header tbody"),v=this.getSelectAllContent().querySelector("tbody"),y=this.headerPanel.querySelector(".e-column-header thead"),C=this.headerPanel.querySelector(".e-column-header tbody"),b=this.rowRenderer.render();y.appendChild(b),this.getColHeaderTable().insertBefore(d,y);var x=this.parent.frozenRowCount(o),S=this.parent.frozenColCount(o);this.parent.notify("beforeContentLoaded",{top:e.top,left:e.left});var w=o.colCount.toString(),I=o.colCount.toString(),E=e.top&&e.left?"RowColumn":e.top?"Row":e.left?"Column":"";this.parent.getColHeaderTable().setAttribute("aria-colcount",w),this.parent.getRowHeaderTable().setAttribute("aria-rowcount",I);var R;t.attributes(this.parent.getContentTable(),{"aria-rowcount":I,"aria-colcount":w}),e.cells.forEach(function(t,s){if((r=c(s))[1]!==e.indexes[1]&&n||(i=a.rowRenderer.render(r[0],!0),S&&x&&r[1]<S&&r[0]<x?((R=v.querySelector(".e-empty"))?v.insertBefore(i,R):v.appendChild(i),n=i):S&&r[1]<S?(m.appendChild(i),n=i):(n=a.rowRenderer.render(r[0]),x&&r[0]<x?(R=C.querySelector(".e-empty"))?C.insertBefore(n,R):C.appendChild(n):p.appendChild(n),r[1]===e.indexes[1]&&(x&&r[0]<x?v.appendChild(i):m.appendChild(i))),r[1]===e.indexes[1]&&i.appendChild(a.cellRenderer.renderRowHeader(r[0]))),n.appendChild(a.cellRenderer.render({colIdx:r[1],rowIdx:r[0],cell:t,address:s,lastCell:r[1]===e.indexes[3],isHeightCheckNeeded:!0,row:n,hRow:i,pRow:n.previousSibling,pHRow:i.previousSibling,isRefreshing:e.isRefreshing,first:E?E.includes("Row")?r[0]===e.indexes[0]?"Row":E.includes("Column")&&r[1]===e.indexes[1]?"Column":"":r[1]===e.indexes[1]?"Column":"":""})),S&&r[1]===S-1&&(n=null),r[0]===e.indexes[0])if(S&&r[1]<S){h=a.updateCol(o,r[1],u);var l=f.querySelector(".e-empty");l?f.insertBefore(h.cloneNode(!0),l):f.appendChild(h.cloneNode(!0)),g.appendChild(a.cellRenderer.renderColHeader(r[1]))}else a.updateCol(o,r[1],d),b.appendChild(a.cellRenderer.renderColHeader(r[1]))}),this.parent.isReact&&this.parent.renderReactTemplates(),p.parentElement.insertBefore(d.cloneNode(!0),p),Be(function(){var t=a.parent.getMainContent(),r=document.getElementById(a.parent.element.id+"_sheet");if(r.appendChild(s),r.style.backgroundColor="",e.top&&(t.parentElement.scrollTop=e.top),e.left&&(t.scrollLeft=e.left,a.parent.getColumnHeaderContent().scrollLeft=e.left),a.parent.notify("contentLoaded",e),a.checkTableWidth(o),a.parent.notify(Qt,{action:"renderEditor"}),e.initLoad||a.parent.isOpen||a.parent.hideSpinner(),ot(t,{busy:!1}),a.parent.trigger("dataBound",{}),a.parent.isEdit&&a.parent.notify("initiateEdit",null),e.initLoad){var n=!0;if(a.parent.scrollSettings.enableVirtualization)for(var i=0;i<o.ranges.length;i++)if(o.ranges[i].info.count-1>a.parent.viewport.bottomIndex){n=!1;break}n&&(a.parent.isReact?setTimeout(function(){return a.triggerCreatedEvent()}):a.triggerCreatedEvent())}})},e.prototype.triggerCreatedEvent=function(){this.parent.isOpen||this.parent.hideSpinner(),this.parent.createdHandler&&(this.parent.createdHandler.observers?this.parent.created.observers=this.parent.createdHandler.observers:this.parent.setProperties({created:this.parent.createdHandler},!0),this.parent.createdHandler=void 0,this.parent.trigger("created",null),this.parent.notify("clearUndoRedoCollection",null))},e.prototype.checkTableWidth=function(e){if(this.parent.scrollSettings.isFinite&&!this.parent.scrollSettings.enableVirtualization&&e.colCount-1===this.parent.viewport.rightIndex){var t=Ne(e,this.parent.viewport.leftIndex+this.parent.frozenColCount(e),this.parent.viewport.rightIndex),r=this.getRowHeaderWidth(e),n=this.getScrollSize();t<this.contentPanel.getBoundingClientRect().width-r-n?(this.getContentPanel().style.width=t+"px",this.getColHeaderPanel().style.width=t+"px"):this.getContentPanel().style.width.includes("calc")||(this.getContentPanel().style.width="calc(100% - "+r+"px)",this.getColHeaderPanel().style.width="calc(100% - "+r+"px)")}},e.prototype.refreshColumnContent=function(e){var t,r,n,i,a,o=this,s=0,l=this.parent.getActiveSheet(),h=document.createDocumentFragment(),d=document.createDocumentFragment(),p=this.parent.element.querySelector(".e-sheet-content tbody"),u=this.parent.element.querySelector(".e-column-header tbody"),f=this.parent.element.querySelector(".e-sheet-content colgroup");f=f.cloneNode(),h.appendChild(f),p=h.appendChild(p.cloneNode(!0));var g=f.cloneNode();d.appendChild(g);var m;m=this.parent.element.querySelector(".e-column-header thead");var v=(m=d.appendChild(m.cloneNode(!0))).querySelector("tr");v.innerHTML="";var y=this.parent.frozenRowCount(l),C=this.parent.frozenColCount(l);y&&(u=d.appendChild(u.cloneNode(!0))),e.cells.forEach(function(n,h){if((t=c(h))[0]===e.indexes[0]&&(a=o.updateCol(l,t[1],g),f.appendChild(a.cloneNode()),v.appendChild(o.cellRenderer.renderColHeader(t[1]))),t[1]-C===e.indexes[1]){if(!(r=t[0]<y?u.children[s]:p.children[s]))return;r.innerHTML="",s++}i=r.appendChild(o.cellRenderer.render({colIdx:t[1],rowIdx:t[0],cell:n,address:h,row:r,pRow:r.previousSibling,first:e.skipUpdateOnFirst||t[1]!==e.indexes[1]?o.parent.scrollSettings.enableVirtualization&&t[0]===e.indexes[0]&&o.parent.viewport.topIndex!==It(l,0,!0)?"Row":"":"Column"})),o.checkColMerge(t,e.indexes,i,n),y&&t[0]===y-1&&(s=0)}),Be(function(){Me(n=o.getColHeaderTable()),n.appendChild(d),Me(n=o.getContentTable()),n.appendChild(h),o.parent.notify("virtualContentLoaded",{refresh:"Column",prevRowColCnt:e.prevRowColCnt}),o.parent.isEdit&&o.parent.notify("forRefSelRender",{}),o.parent.allowChart&&o.parent.notify("chartRangeSelection",null),o.parent.isOpen||o.parent.hideSpinner(),ot(o.parent.getMainContent(),{busy:!1})})},e.prototype.refreshRowContent=function(e){var r,n,i,a,o=this,s=this.colGroupWidth,l=this.parent.getActiveSheet(),h=document.createDocumentFragment(),d=this.parent.createElement("tbody"),p=document.createDocumentFragment(),u=d.cloneNode();p.appendChild(u),h.appendChild(d);var f=this.parent.frozenColCount(l);e.cells.forEach(function(t,h){(r=c(h))[1]!==e.indexes[1]&&n||(i=o.rowRenderer.render(r[0],!0),f&&r[1]<f?(u.appendChild(i),n=i):(r[1]===e.indexes[1]&&u.appendChild(i),n=o.rowRenderer.render(r[0]),d.appendChild(n)),r[1]===e.indexes[1]&&(i.appendChild(o.cellRenderer.renderRowHeader(r[0])),s=Pe(r[0]+1))),f&&(i=u.lastElementChild||i),a=n.appendChild(o.cellRenderer.render({rowIdx:r[0],colIdx:r[1],cell:t,address:h,lastCell:r[1]===e.indexes[3],row:n,hRow:i,pRow:n.previousSibling,pHRow:i.previousSibling,isHeightCheckNeeded:!0,first:e.skipUpdateOnFirst||r[0]!==e.indexes[0]?o.parent.scrollSettings.enableVirtualization&&r[1]===e.indexes[1]&&o.parent.viewport.leftIndex!==It(l,0,!0,"columns")?"Column":"":"Row"})),o.checkRowMerge(r,e.indexes,a,t),f&&r[1]===f-1&&(n=null)}),this.colGroupWidth!==s&&this.updateLeftColGroup(s),this.contentPanel.querySelector(".e-row-header tbody")&&(t.detach(this.contentPanel.querySelector(".e-row-header tbody")),this.getRowHeaderTable().appendChild(p)),this.contentPanel.querySelector(".e-sheet-content tbody")&&(t.detach(this.contentPanel.querySelector(".e-sheet-content tbody")),this.getContentTable().appendChild(h)),this.parent.notify("virtualContentLoaded",{refresh:"Row",prevRowColCnt:e.prevRowColCnt}),this.parent.allowChart&&this.parent.notify("chartRangeSelection",{}),this.parent.isEdit&&this.parent.notify("forRefSelRender",null),this.parent.isOpen||this.parent.hideSpinner(),ot(this.parent.getMainContent(),{busy:!1})},e.prototype.updateCol=function(e,r,n){var i=this.col.cloneNode();if(i.style.width=t.formatUnit(Le(e,r,null,!0)),n){var a=n.querySelector(".e-empty");return a?n.insertBefore(i,a):n.appendChild(i)}return i},e.prototype.updateColContent=function(e){var r=this;Be(function(){var n,i,a,o,s,l,h=0,d=r.parent.getActiveSheet(),p=r.parent.element.querySelector(".e-column-header .e-header-row"),u=p.firstElementChild,f=r.parent.element.querySelector(".e-sheet-content colgroup"),g=r.parent.element.querySelector(".e-column-header colgroup"),m=f.firstElementChild,v=g.firstElementChild,y=r.parent.element.querySelector(".e-sheet-content tbody"),C=r.parent.element.querySelector(".e-column-header tbody"),b=r.parent.frozenRowCount(d),x=r.parent.frozenColCount(d);e.cells.forEach(function(S,w){if(!l){if(n=c(w),"first"===e.direction&&n[1]===e.indexes[1]&&r.checkColMerge([n[0],r.parent.viewport.leftIndex+x],e.indexes,((n[0]<b?C:y).rows[h]||{cells:[]}).cells[e.indexes[3]-e.indexes[1]+1],J(n[0],r.parent.viewport.leftIndex+x,d)||{}),n[0]===e.indexes[0]&&("last"===e.direction?((s=r.col.cloneNode()).style.width=t.formatUnit(Le(d,n[1],null,!0)),f.insertBefore(s,m),g.insertBefore(s.cloneNode(),v),p.insertBefore(r.cellRenderer.renderColHeader(n[1]),u)):(s=r.updateCol(d,n[1],f),g.appendChild(s.cloneNode()),p.appendChild(r.cellRenderer.renderColHeader(n[1]))),r.parent.scrollSettings.enableVirtualization&&e.direction&&(t.detach(f[e.direction+"ElementChild"]),t.detach(g[e.direction+"ElementChild"]),t.detach(p[e.direction+"ElementChild"]))),n[1]===e.indexes[1]){if(n[0]<b)i=C.children[h];else if(!(i=y.children[h]))return void(l=!0);h++,a=i.firstElementChild}o=r.cellRenderer.render({colIdx:n[1],rowIdx:n[0],cell:S,address:w,lastCell:n[1]===e.indexes[3],isHeightCheckNeeded:"first"===e.direction,first:"last"!==e.direction||e.skipUpdateOnFirst||n[1]!==e.indexes[1]?"":"Column",checkNextBorder:"last"===e.direction&&n[3]===e.indexes[3]?"Column":""}),"last"===e.direction?(r.checkColMerge(n,e.indexes,o,S,((n[0]<b?C:y).rows[h-1]||{cells:[]}).cells[0]),i.insertBefore(o,a)):i.appendChild(o),r.parent.scrollSettings.enableVirtualization&&e.direction&&t.detach(i[e.direction+"ElementChild"]),b&&n[0]===b-1&&(h=0)}}),r.parent.notify("virtualContentLoaded",{refresh:"Column",prevRowColCnt:e.prevRowColCnt}),r.parent.allowChart&&r.parent.notify("chartRangeSelection",null),r.parent.isEdit&&r.parent.notify("forRefSelRender",{}),r.parent.isOpen||r.parent.hideSpinner(),ot(r.parent.getMainContent(),{busy:!1})})},e.prototype.updateRowContent=function(e){var r,n,i,a,o=this,s=this.colGroupWidth,l=this.parent.getActiveSheet(),h=0,d=this.parent.getMainContent().querySelector("tbody"),p=this.parent.getRowHeaderContent().querySelector("tbody"),u=document.createDocumentFragment(),f=document.createDocumentFragment();this.parent.showSpinner();var g,m=this.parent.frozenColCount(l),v=this.parent.frozenRowCount(l);e.cells.forEach(function(y,C){a=c(C),"first"===e.direction&&a[0]===e.indexes[0]&&(void 0===g&&(g=(a[1]<m?p:d).rows[e.indexes[2]-e.indexes[0]+1]||null),o.checkRowMerge([o.parent.viewport.topIndex+v,a[1]],e.indexes,(g||{cells:[]}).cells[a[1]<m?h+1:h],J(o.parent.viewport.topIndex+v,a[1],l)||{})),a[1]!==e.indexes[1]&&r||(n=o.rowRenderer.render(a[0],!0),m&&a[1]<m?(u.appendChild(n),r=n):(r=o.rowRenderer.render(a[0]),f.appendChild(r),a[1]===e.indexes[1]&&u.appendChild(n),o.parent.scrollSettings.enableVirtualization&&e.direction&&t.detach(d[e.direction+"ElementChild"])),a[1]===e.indexes[1]&&(n.appendChild(o.cellRenderer.renderRowHeader(a[0])),s=Pe(a[0]+1),o.parent.scrollSettings.enableVirtualization&&e.direction&&t.detach(p[e.direction+"ElementChild"]))),m&&(n=u.lastElementChild||n),i=r.appendChild(o.cellRenderer.render({colIdx:a[1],rowIdx:a[2],cell:y,address:C,lastCell:a[1]===e.indexes[3],row:r,pHRow:n.previousSibling,checkNextBorder:"last"===e.direction&&a[2]===e.indexes[2]?"Row":"",pRow:r.previousSibling,isHeightCheckNeeded:"first"===e.direction||""===e.direction,hRow:n,first:"last"!==e.direction||e.skipUpdateOnFirst||a[0]!==e.indexes[0]?"":"Row"})),"last"===e.direction&&d.rows.length&&o.checkRowMerge(a,e.indexes,i,y,(a[1]<m?p:d).rows[0].cells[a[1]<m?h+1:h]),h++,m&&a[1]===m-1&&(r=null,g=void 0,h=0)}),this.colGroupWidth!==s&&this.updateLeftColGroup(s),"last"===e.direction?(p.insertBefore(u,p.firstElementChild),d.insertBefore(f,d.firstElementChild)):(p.appendChild(u),d.appendChild(f)),this.parent.scrollSettings.enableVirtualization&&this.parent.notify("virtualContentLoaded",{refresh:"Row",prevRowColCnt:e.prevRowColCnt}),this.parent.isEdit&&this.parent.notify("forRefSelRender",null),this.parent.allowChart&&this.parent.notify("chartRangeSelection",{}),this.parent.isOpen||this.parent.hideSpinner(),ot(this.parent.getMainContent(),{busy:!1})},e.prototype.checkRowMerge=function(e,r,n,i,a){if(this.parent.scrollSettings.enableVirtualization&&n&&(!t.isNullOrUndefined(i.rowSpan)||!t.isNullOrUndefined(i.colSpan))){var o=this.parent.frozenRowCount(this.parent.getActiveSheet());if(e[0]===this.parent.viewport.topIndex+o){if(i.rowSpan<0){var s={td:n,rowIdx:e[0],colIdx:e[1],isRow:!0,isFreezePane:!0};if(this.parent.notify("checkMerge",s),s.insideFreezePane)return;this.parent.viewport.topIndex+o>=r[0]&&this.refreshPrevMerge(r[0]+1,e[1])}a&&(a.colSpan>1||a.rowSpan>1)&&this.cellRenderer.refresh(e[0]+(r[2]-r[0])+1,e[1],null,a)}else if(i.rowSpan>1){var l=r[2]+1;e[0]+i.rowSpan-1>l&&e[0]<l&&this.refreshPrevMerge(l,e[1],this.parent.viewport.topIndex+o)}}},e.prototype.refreshPrevMerge=function(e,t,r){var n=this.parent.getCell(e,t,this.parent.getRow(r||0,null,t));n&&n.rowSpan>1&&this.cellRenderer.refresh(e,t,null,n)},e.prototype.checkColMerge=function(e,r,n,i,a){if(this.parent.scrollSettings.enableVirtualization&&n&&e[1]===this.parent.viewport.leftIndex+this.parent.frozenColCount(this.parent.getActiveSheet())&&(!t.isNullOrUndefined(i.rowSpan)||!t.isNullOrUndefined(i.colSpan))){if(i.colSpan<0){var o={td:n,colIdx:e[1],rowIdx:e[0],isFreezePane:!0};if(this.parent.notify("checkMerge",o),o.insideFreezePane)return}a&&(a.colSpan>1||a.rowSpan>1)&&this.cellRenderer.refresh(e[0],e[1]+(r[3]-r[1])+1,null,a)}},e.prototype.showHideHeaders=function(){var e=this,t=this.parent.getActiveSheet();Be(function(){if(t.showHeaders){var r=e.getContentPanel();e.setPanelWidth(t,e.getRowHeaderPanel()),e.setPanelHeight(t),document.getElementById(e.parent.element.id+"_sheet").classList.remove("e-hide-headers"),e.getColHeaderPanel().scrollLeft=r.scrollLeft,e.parent.selectRange(t.selectedRange)}else{if(e.updateHideHeaders(t,document.getElementById(e.parent.element.id+"_sheet")),e.setPanelHeight(t),e.parent.frozenColCount(t)||e.parent.frozenRowCount(t))e.setPanelWidth(t,e.getRowHeaderPanel()),e.parent.selectRange(t.selectedRange);else{e.getContentPanel().style.width="";var n=e.parent.enableRtl?"right":"left";e.getContentPanel().style[n]=""}e.getScrollElement().style.left=e.getRowHeaderWidth(t)+"px"}})},e.prototype.updateHideHeaders=function(e,t){e.showHeaders||t.classList.add("e-hide-headers")},e.prototype.rowHeightChange=function(e){if(e.threshold){var t=this.parent.getActiveSheet();e.rowIdx<this.parent.frozenRowCount(t)&&this.setPanelHeight(t)}},e.prototype.colWidthChange=function(e){if(e.threshold){var t=this.parent.getActiveSheet();e.colIdx<this.parent.frozenColCount(t)&&this.setPanelWidth(t,this.getRowHeaderPanel()),this.checkTableWidth(t)}},e.prototype.getRowHeaderWidth=function(e,t){var r=0;if(!t&&e.frozenColumns){var n=u(e.topLeftCell)[1];r=Ne(e,n,n+e.frozenColumns-1,!0)}return r+=e.showHeaders?at(this.colGroupWidth):0},e.prototype.getColHeaderHeight=function(e,t){var r=u(e.topLeftCell)[0];return(e.showHeaders&&!t?at(31):0)+Ae(e,r,r+e.frozenRows-1,!0)},e.prototype.getSelectAllContent=function(){return this.headerPanel.getElementsByClassName("e-selectall-container")[0]},e.prototype.getScrollElement=function(){return(this.contentPanel.parentElement||this.contentPanel.nextElementSibling).querySelector(".e-scroller")},e.prototype.getSelectAllTable=function(){return this.headerPanel.getElementsByClassName("e-selectall-table")[0]},e.prototype.getColHeaderTable=function(){return this.headerPanel.getElementsByClassName("e-colhdr-table")[0]},e.prototype.getRowHeaderTable=function(){return this.contentPanel.getElementsByClassName("e-rowhdr-table")[0]},e.prototype.getContentTable=function(){return this.contentPanel.getElementsByClassName("e-content-table")[0]},e.prototype.getRowHeaderPanel=function(){return this.contentPanel.getElementsByClassName("e-row-header")[0]},e.prototype.getColHeaderPanel=function(){return this.headerPanel.getElementsByClassName("e-column-header")[0]},e.prototype.getContentPanel=function(){return this.contentPanel.getElementsByClassName("e-sheet-content")[0]},e.prototype.addEventListener=function(){this.parent.on("created",this.triggerCreatedEvent,this),this.parent.on(sr,this.rowHeightChange,this),this.parent.on("colWidthChanged",this.colWidthChange,this),this.parent.on("spreadsheetDestroyed",this.destroy,this)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.removeEventListener=function(){this.parent.off("created",this.triggerCreatedEvent),this.parent.off(sr,this.rowHeightChange),this.parent.off("colWidthChanged",this.colWidthChange),this.parent.off("spreadsheetDestroyed",this.destroy)},e}(),zi=function(){function e(e){this.parent=e,this.element=this.parent.createElement("tr",{attrs:{role:"row"}}),this.cellRenderer=e.serviceLocator.getService("cell")}return e.prototype.render=function(e,r,n){var i=this.element.cloneNode();if(void 0===e)return i.classList.add("e-header-row"),i;i.classList.add("e-row");var a=this.parent.getActiveSheet();return t.attributes(i,{"aria-rowindex":(e+1).toString()}),i.style.height=Re(a,e,!0)+"px",r&&!n&&(Ee(a,e+1)&&!Ee(a,e-1)&&i.classList.add("e-hide-start"),0!==e&&Ee(a,e-1)&&!Ee(a,e+1)&&i.classList.add("e-hide-end")),i},e.prototype.refresh=function(e,t,r,n){var i,a=this.parent.getActiveSheet();if(n)(i=this.render(e,!0,!0)).appendChild(this.cellRenderer.renderRowHeader(e));else{i=this.render(e);for(var o=this.parent.viewport.leftIndex+this.parent.viewport.colCount+2*this.parent.getThreshold("col"),s=this.parent.viewport.leftIndex;s<=o;s++)i.appendChild(this.cellRenderer.render({colIdx:s,rowIdx:e,cell:J(e,s,a),address:g(e,s),lastCell:s===o,row:i,hRow:r,isHeightCheckNeeded:!0,pRow:t,first:e===this.parent.viewport.topIndex&&It(a,e,!0)!==It(a,0,!0)?"Row":""}))}return i},e}(),qi=function(){function e(e){this.parent=e,this.element=this.parent.createElement("td"),this.th=this.parent.createElement("th",{className:"e-header-cell"}),this.tableRow=e.createElement("tr",{className:"e-row"}),this.parent.on("updateView",this.updateView,this),this.parent.on("calculateFormula",this.calculateFormula,this)}return e.prototype.renderColHeader=function(e){var r=this.th.cloneNode();t.attributes(r,{role:"columnheader","aria-colindex":(e+1).toString(),tabindex:"-1"}),r.innerHTML=v(e+1);var n=this.parent.getActiveSheet();return De(n,e+1)&&r.classList.add("e-hide-start"),0!==e&&De(n,e-1)&&r.classList.add("e-hide-end"),r},e.prototype.renderRowHeader=function(e){var r=this.element.cloneNode();return t.addClass([r],"e-header-cell"),t.attributes(r,{role:"rowheader",tabindex:"-1"}),r.innerHTML=(e+1).toString(),r},e.prototype.render=function(e){var r,n=this.parent.getActiveSheet(),i=J(e.rowIdx,e.colIdx,n),a=Te(n,e.colIdx);if(i&&i.validation?r=i.validation:a&&a.validation&&(r=a.validation),e.td=this.element.cloneNode(),e.td.className="e-cell",t.attributes(e.td,{role:"gridcell","aria-colindex":(e.colIdx+1).toString(),tabindex:"-1"}),this.checkMerged(e))return e.td;e.isRefresh=!1,this.update(e),e.cell&&e.td&&(r&&r.isHighlighted&&this.parent.notify("addHighlight",{range:m([e.rowIdx,e.colIdx]),td:e.td}),this.parent.notify("cFRender",{rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.cell,td:e.td,isChecked:!1}),e.td&&e.td.children[0]&&"e-cf-databar"===e.td.children[0].className&&(e.cell.style&&e.cell.style.fontSize&&(e.td.children[0].querySelector(".e-databar-value").style.fontSize=e.cell.style.fontSize),e.td.children[0].style.height="100%",e.td.children[0].firstElementChild.nextElementSibling.style.height="100%")),ct(this.parent,e.rowIdx,e.colIdx,this.parent.activeSheetIndex)||this.parent.notify("renderFilterCell",{td:e.td,rowIndex:e.rowIdx,colIndex:e.colIdx});var o={cell:e.cell,element:e.td,address:e.address};this.parent.trigger("beforeCellRender",o),this.updateRowHeight({rowIdx:e.rowIdx,cell:o.element,lastCell:e.lastCell,rowHgt:20,row:e.row,hRow:e.hRow});var s=e.td.classList.contains("e-wraptext"),l=e.td.innerHTML;return l.indexOf("\n")>-1&&!s&&l.split("\n").length>1&&(Q(e.rowIdx,e.colIdx,n,{wrap:!0},!0),this.parent.notify(Ot,{range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx],wrap:!0,initial:!0,sheet:this.parent.getActiveSheet(),td:e.td,row:e.row,hRow:e.hRow})),o.element},e.prototype.update=function(e){var r=this.parent.getActiveSheet(),n=this.processTemplates(e.cell,e.rowIdx,e.colIdx);if(n&&("string"==typeof n?e.td.innerHTML=n:(Me(e.td),e.td.appendChild(n))),e.isRefresh){if(e.td.rowSpan&&(this.mergeFreezeRow(r,e.rowIdx,e.colIdx,e.td.rowSpan,e.row,!0),e.td.removeAttribute("rowSpan")),e.td.colSpan&&(this.mergeFreezeCol(r,e.rowIdx,e.colIdx,e.td.colSpan,!0),e.td.removeAttribute("colSpan")),this.checkMerged(e))return;e.cell&&!e.cell.hyperlink&&e.td.querySelector(".e-hyperlink")&&e.td.removeChild(e.td.querySelector(".e-hyperlink"))}e.cell&&e.cell.formula&&(!e.cell.value||e.isRefreshing)&&this.calculateFormula(e);var i={type:e.cell&&H(e.cell.format),value:e.cell&&e.cell.value,format:e.cell&&e.cell.format?e.cell.format:"General",formattedText:e.cell&&e.cell.value,onLoad:!0,isRightAlign:!1,cell:e.cell,rowIdx:e.rowIdx.toString(),colIdx:e.colIdx.toString()};e.cell&&this.parent.notify("getFormattedCell",i),t.isNullOrUndefined(e.td)||this.parent.refreshNode(e.td,{type:i.type,result:i.formattedText,curSymbol:t.getNumberDependable(this.parent.locale,"USD"),isRightAlign:i.isRightAlign,value:i.value||""});var a={};if(e.cell){if(e.cell.style&&(a=e.cell.style.properties?ee(e.cell.style,!0):e.cell.style),e.cell.chart&&e.cell.chart.length>0&&this.parent.notify(Gt,{chart:e.cell.chart,isInitCell:!0,range:g(e.rowIdx,e.colIdx)}),e.cell.hyperlink&&this.parent.notify("createHyperlinkElement",{cell:e.cell,td:e.td,rowIdx:e.rowIdx,colIdx:e.colIdx}),e.cell.rowSpan>1){var o=e.cell.rowSpan-this.parent.hiddenCount(e.rowIdx,e.rowIdx+(e.cell.rowSpan-1));o>1&&(e.td.rowSpan=o,this.mergeFreezeRow(r,e.rowIdx,e.colIdx,o,e.row))}if(e.cell.colSpan>1){var s=e.cell.colSpan-this.parent.hiddenCount(e.colIdx,e.colIdx+(e.cell.colSpan-1),"columns");s>1&&(e.td.colSpan=s,this.mergeFreezeCol(r,e.rowIdx,e.colIdx,s))}if(e.cell.image)for(var l=0;l<e.cell.image.length;l++)e.cell.image[l]&&this.parent.notify(yr,{options:{src:e.cell.image[l].src,imageId:e.cell.image[l].id,height:e.cell.image[l].height,width:e.cell.image[l].width,top:e.cell.image[l].top,left:e.cell.image[l].left},range:m([e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]),isPublic:!1})}if(e.isRefresh&&this.removeStyle(e.td,e.rowIdx,e.colIdx),this.parent.allowChart&&e.lastCell&&this.parent.notify("refreshChart",{cell:e.cell,rIdx:e.rowIdx,cIdx:e.colIdx,sheetIdx:this.parent.activeSheetIndex}),(Object.keys(a).length||Object.keys(this.parent.commonCellStyle).length||e.lastCell)&&this.parent.notify(Ft,{style:t.extend({},this.parent.commonCellStyle,a),rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.td,first:e.first,row:e.row,lastCell:e.lastCell,hRow:e.hRow,pRow:e.pRow,isHeightCheckNeeded:e.isHeightCheckNeeded,manualUpdate:e.manualUpdate}),this.parent.allowConditionalFormat&&e.lastCell&&this.parent.notify("checkConditionalFormat",{rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.cell}),"Row"===e.checkNextBorder){var h=this.parent.getCellStyleValue(["borderTop"],[Number(this.parent.getContentTable().rows[0].getAttribute("aria-rowindex"))-1,e.colIdx]).borderTop;""===h||e.cell&&e.cell.style&&e.cell.style.bottomPriority||this.parent.notify(Ft,{style:{borderBottom:h},rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.td})}if("Column"===e.checkNextBorder){var d=this.parent.getCellStyleValue(["borderLeft"],[e.rowIdx,e.colIdx+1]).borderLeft;""===d||e.cell&&e.cell.style&&(e.cell.style.borderRight||e.cell.style.border)||this.parent.notify(Ft,{style:{borderRight:d},rowIdx:e.rowIdx,colIdx:e.colIdx,cell:e.td})}if(e.cell&&e.cell.hyperlink&&!ct(this.parent,e.rowIdx,e.colIdx,this.parent.activeSheetIndex)){var p=void 0;"string"==typeof e.cell.hyperlink?0!==(p=e.cell.hyperlink).indexOf("http://")&&0!==p.indexOf("https://")&&0!==p.indexOf("ftp://")&&(e.cell.hyperlink=0===p.toLowerCase().indexOf("www.")?"http://"+p:p):0!==(p=e.cell.hyperlink.address).indexOf("http://")&&0!==p.indexOf("https://")&&0!==p.indexOf("ftp://")&&(e.cell.hyperlink.address=0===p.toLowerCase().indexOf("www.")?"http://"+p:p),this.parent.notify("createHyperlinkElement",{cell:e.cell,td:e.td,rowIdx:e.rowIdx,colIdx:e.colIdx})}if(e.cell&&e.cell.wrap){var c=Re(r,e.rowIdx);this.parent.notify(Ot,{range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx],wrap:!0,sheet:r,initial:!0,td:e.td,row:e.row,hRow:e.hRow,isCustomHgt:!e.isRefresh&&c>20})}},e.prototype.calculateFormula=function(e){var r=q(e.cell.formula),n={action:"refreshCalculate",value:e.cell.formula,rowIndex:e.rowIdx,colIndex:e.colIdx,isFormula:r,sheetIndex:e.sheetIndex};this.parent.notify(Lt,n),e.cell.value=J(e.rowIdx,e.colIdx,t.isNullOrUndefined(e.sheetIndex)?this.parent.getActiveSheet():fe(this.parent,e.sheetIndex)).value},e.prototype.checkMerged=function(e){if(e.cell&&(e.cell.colSpan<0||e.cell.rowSpan<0)){var t=this.parent.getActiveSheet();if(t.frozenRows||t.frozenColumns){var r={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]};this.parent.notify("activeCellMergedRange",r);var n=this.parent.frozenRowCount(t),i=this.parent.frozenColCount(t);(t.frozenRows&&t.frozenColumns?r.range[0]<n&&r.range[1]<i?e.rowIdx<n&&e.colIdx<i:r.range[0]<n?e.rowIdx<n:!(r.range[1]<i)||e.colIdx<i:n?r.range[0]>=n||e.rowIdx<n:r.range[1]>=i||e.colIdx<i)&&(e.td.style.display="none")}else e.td.style.display="none";if(e.cell.colSpan<0&&this.parent.notify("checkPrevMerge",e),e.cell.rowSpan<0&&(e.isRow=!0,this.parent.notify("checkPrevMerge",e),e.cell&&e.cell.rowSpan&&e.cell.rowSpan<0)){var a=this.parent.getCell(e.rowIdx,e.colIdx-1,e.row),o="none";o=e.cell&&e.cell.style&&e.cell.style.borderLeft?e.cell.style.borderLeft:"none",a&&o&&(a.style.borderRight="none"===o?a.style.borderRight:o)}return!0}return!1},e.prototype.mergeFreezeRow=function(e,r,n,i,a,o){var s=this.parent.frozenRowCount(e);if(s&&r<s&&r+(i-1)>=s){var l=void 0,h=0,d=void 0,p=this.parent.frozenColCount(e),c=a||this.parent.getRow(r,null,n),f=[].slice.call(c.parentElement.querySelectorAll(".e-empty"));if(o){var g=r+i-s;if(g<f.length)return;var m=0;if(g===f.length){var v=void 0,y=void 0,C=void 0;for(p&&n<p?(y=u(e.topLeftCell)[1],C=p):(y=this.parent.viewport.leftIndex+p,C=this.parent.viewport.rightIndex),y;y<C;y++)y!==n&&(v=J(r,y,e,!1,!0)).rowSpan&&r+v.rowSpan-s>m&&(m=r+v.rowSpan-s);if(m===g)return}else m=g;for(var b=r+(i-1),y=m,C=f.length;y<C;y++)h+=Re(e,b),b--,t.detach(f.pop());return this.updateSpanTop(n,p,h,!0),void(f.length||this.updateColZIndex(n,p,!0))}this.updateColZIndex(n,p);for(var y=s,C=r+(i-1);y<=C;y++)h+=-(d=Re(e,y)),s+f.length>y||((l=c.cloneNode()).classList.add("e-empty"),l.style.visibility="hidden",l.style.height=d+"px",c.parentElement.appendChild(l));this.updateSpanTop(n,p,h)}},e.prototype.updateSpanTop=function(e,t,r,n){var i=this.parent.serviceLocator.getService("sheet").contentPanel;if(n){if(!parseInt(i.style.top,10))return;r=parseInt(i.style.top,10)+r}if(t&&e<t&&(n||!parseInt(i.style.top,10)||r<parseInt(i.style.top,10))){i.style.top=r+"px";var a=i.nextElementSibling;a&&(a.style.top=r+"px")}},e.prototype.mergeFreezeCol=function(e,r,n,i,a){var o=this.parent.frozenColCount(e);if(o&&n<o&&n+(i-1)>=o){var s=void 0,l=void 0,h=this.parent.frozenRowCount(e),d=(r<h?this.parent.getSelectAllContent():this.parent.getRowHeaderContent()).querySelector("colgroup"),p=[].slice.call(d.querySelectorAll(".e-empty"));if(a){var c=n+i-o;if(c<p.length)return;var f=0;if(c===p.length){var g=void 0,m=void 0,v=void 0;for(h&&r<o?(m=h,v=u(e.topLeftCell)[0]):(m=this.parent.viewport.bottomIndex,v=this.parent.viewport.topIndex+h),v;v<m;v++)v!==r&&(g=J(v,n,e,!1,!0)).colSpan&&n+g.colSpan-o>f&&(f=n+g.colSpan-o);if(f===c)return}else f=c;for(var v=f,m=p.length;v<m;v++)t.detach(p.pop());return this.parent.serviceLocator.getService("sheet").setPanelWidth(e,this.parent.getRowHeaderContent()),void(p.length||this.updateRowZIndex(r,h,!0))}this.updateRowZIndex(r,h);for(var v=o,m=n+(i-1);v<=m;v++)o+p.length>v||((s=d.childNodes[0].cloneNode()).classList.add("e-empty"),s.style.visibility="hidden",l=Le(e,v,null,!0),s.style.width=l+"px",d.appendChild(s),v===m&&this.parent.serviceLocator.getService("sheet").setPanelWidth(e,this.parent.getRowHeaderContent()))}},e.prototype.updateColZIndex=function(e,t,r){e<t?this.updateSelectAllZIndex(r):(this.parent.getColumnHeaderContent().style.zIndex=r?"":"2",this.updatedHeaderZIndex(r))},e.prototype.updateSelectAllZIndex=function(e){var t=this.parent.element.querySelector(".e-frozen-row"),r=this.parent.element.querySelector(".e-frozen-column");e?(this.parent.getSelectAllContent().style.zIndex="",t&&(t.style.zIndex=""),r&&(r.style.zIndex="")):this.parent.getRowHeaderContent().style.zIndex||this.parent.getColumnHeaderContent().style.zIndex?(this.parent.getSelectAllContent().style.zIndex="3",t&&(t.style.zIndex="4"),r&&(r.style.zIndex="4")):this.parent.getSelectAllContent().style.zIndex="2"},e.prototype.updatedHeaderZIndex=function(e){if(!e&&"2"===this.parent.getSelectAllContent().style.zIndex){this.parent.getSelectAllContent().style.zIndex="3";var t=this.parent.element.querySelector(".e-frozen-row"),r=this.parent.element.querySelector(".e-frozen-column");r&&(r.style.zIndex="4"),t&&(t.style.zIndex="4")}},e.prototype.updateRowZIndex=function(e,t,r){e<t?this.updateSelectAllZIndex(r):(this.parent.getRowHeaderContent().style.zIndex=r?"":"2",this.updatedHeaderZIndex(r))},e.prototype.processTemplates=function(e,t,r){for(var n,i=this.parent.getActiveSheet(),a=i.ranges,o=0,s=a.length;o<s;o++)if(a[o].template&&(n=c(a[o].address.length?a[o].address:a[o].startCell))[0]<=t&&n[1]<=r&&n[2]>=t&&n[3]>=r){if(e)return this.compileCellTemplate(a[o].template,e);if(!J(t,r,i,!0))return this.compileCellTemplate(a[o].template,J(t,r,i,null,!0))}return""},e.prototype.compileCellTemplate=function(e,r){if("string"==typeof e){var n=void 0;return n=0===e.trim().indexOf("#")?document.querySelector(e).innerHTML.trim():e,t.compile(n)(r,null,null,"",!0)[0].outerHTML}return t.compile(e)(r,this.parent,"ranges","")[0]},e.prototype.updateRowHeight=function(e){if(e.cell&&e.cell.children.length){var t=e.cell.cloneNode(!0);this.tableRow.appendChild(t)}if(e.lastCell&&this.tableRow.childElementCount){var r=this.parent.getActiveSheet(),n=e.row||this.parent.getRow(e.rowIdx),i=Re(r,e.rowIdx),a=this.getRowHeightOnInit();if(a>i){var o=at(a);n.style.height=o+"px",(e.hRow||this.parent.getRow(e.rowIdx,this.parent.getRowHeaderTable())).style.height=o+"px",ke(r,e.rowIdx,a)}this.tableRow.innerHTML=""}},e.prototype.getRowHeightOnInit=function(){var e=this.parent.createElement("table",{className:"e-table e-test-table"});e.appendChild(this.parent.createElement("tbody")).appendChild(this.tableRow),this.parent.element.appendChild(e);var t=Math.round(this.tableRow.getBoundingClientRect().height);return this.parent.element.removeChild(e),t<20?20:t},e.prototype.removeStyle=function(e,t,r){var n;if(e.style.length){var i=(n=this.parent.getCellStyleValue(["borderLeft","border"],[t,r+1])).borderLeft||n.border,a=(n=this.parent.getCellStyleValue(["borderTop","border"],[t+1,r])).borderTop||n.border;i||a?[].slice.call(e.style).forEach(function(t){(!i||t.indexOf("border-right")>-1||a&&"none"!==a)&&(!a||t.indexOf("border-bottom")>-1||i&&"none"!==i)||e.style.removeProperty(t)}):e.removeAttribute("style")}var o=this.parent.getCell(t-1,r);if(o&&o.style.borderBottom){var s=Number(o.parentElement.getAttribute("aria-rowindex"))-1;(n=this.parent.getCellStyleValue(["borderBottom","border"],[s,r])).borderBottom||n.border||(o.style.borderBottom="")}var l=e.previousElementSibling;l&&l.style.borderRight&&(r=Number(l.getAttribute("aria-colindex"))-1,(n=this.parent.getCellStyleValue(["borderRight","border"],[t,r])).borderRight||n.border||(l.style.borderRight=""))},e.prototype.refreshRange=function(e,t){var r=this.parent.getActiveSheet(),n=e.slice();if(ze(this.parent,n,!0))for(var i=n[0];i<=n[2];i++)if(!Ee(r,i))for(var a=n[1];a<=n[3];a++)if(!De(r,a)){var o=this.parent.getCell(i,a);o&&(this.update({rowIdx:i,colIdx:a,td:o,cell:J(i,a,r),isRefreshing:t,lastCell:a===n[3],isRefresh:!0,isHeightCheckNeeded:!0,manualUpdate:!0,first:""}),this.parent.notify("renderFilterCell",{td:o,rowIndex:i,colIndex:a}))}},e.prototype.refresh=function(e,t,r,n){var i=this.parent.getActiveSheet();if((n||!Ee(i,e)&&!De(i,t))&&(n||!this.parent.scrollSettings.enableVirtualization||this.parent.insideViewport(e,t))){var a=n||this.parent.getCell(e,t);this.update({rowIdx:e,colIdx:t,td:a,cell:J(e,t,i),lastCell:r,isRefresh:!0,isHeightCheckNeeded:!0,manualUpdate:!0,first:""}),this.parent.notify("renderFilterCell",{td:a,rowIndex:e,colIndex:t})}},e.prototype.updateView=function(e){t.isNullOrUndefined(e.sheetIndex)||e.sheetIndex===this.parent.activeSheetIndex?this.refreshRange(e.indexes,e.refreshing):e.refreshing&&this.calculateFormula({cell:J(e.indexes[0],e.indexes[1],fe(this.parent,e.sheetIndex),!0),rowIdx:e.indexes[0],colIdx:e.indexes[1],sheetIndex:e.sheetIndex})},e}(),ji=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.render=function(e){this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(this.parent.activeSheetIndex)},!0),this.parent.isMobileView()||(this.parent.notify("ribbon",null),this.parent.notify("formulaBar",null));var t=this.parent.createElement("div",{id:this.parent.element.id+"_sheet_panel",className:"e-sheet-panel"});if(this.parent.enableRtl&&t.classList.add("e-rtl"),this.parent.element.appendChild(t),this.parent.showSheetTabs)this.parent.notify("sheetTabs",null);else{var r={action:"addSheet",sheetName:"Sheet1",index:1,visibleName:Ce(this.parent,0)};this.parent.notify(Lt,r),this.parent.notify(Lt,{action:"initiateDefinedNames"})}this.parent.isMobileView()&&(this.parent.notify("formulaBar",null),this.parent.notify("ribbon",null)),(this.parent.password.length>0||this.parent.isProtected)&&(this.parent.isProtected=!0,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.parent.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled"))),this.setSheetPanelSize(),this.renderSheet(t),this.checkTopLeftCell(!0,e)},e.prototype.checkTopLeftCell=function(e,t){var r=this.parent.getActiveSheet();this.parent.showSpinner();var n,i="A1"===r.topLeftCell,a=u(r.topLeftCell);if(r.topLeftCell!==r.paneTopLeftCell&&(r.frozenRows||r.frozenColumns)){var o=u(r.paneTopLeftCell);n=this.parent.scrollSettings.enableVirtualization,i=r.frozenRows&&r.frozenColumns?a[0]+r.frozenRows===o[0]&&a[1]+r.frozenColumns===o[1]:r.frozenRows?a[0]+r.frozenRows===o[0]&&0===a[1]:a[1]+r.frozenColumns===o[1]&&0===a[0],a[0]&&o[0]>a[0]?this.parent.viewport.beforeFreezeHeight=Ae(r,0,a[0]-1,!0):this.parent.viewport.beforeFreezeHeight=0,a[1]&&o[1]>a[1]?this.parent.viewport.beforeFreezeWidth=Ne(r,0,a[1]-1,!0):this.parent.viewport.beforeFreezeWidth=0}else this.parent.viewport.beforeFreezeHeight=this.parent.viewport.beforeFreezeWidth=0;if(!this.parent.scrollSettings.enableVirtualization||i)this.refreshUI({rowIndex:a[0],colIndex:a[1],refresh:"All"},null,e,t),n&&(this.parent.viewport.topIndex=It(r,0,!0),this.parent.viewport.leftIndex=It(r,0,!0,"columns"));else{var s=r.paneTopLeftCell===r.topLeftCell?a:u(r.paneTopLeftCell),l=this.parent.frozenRowCount(r),h=this.parent.frozenColCount(r),d={preventScroll:!0};d.scrollTop=s[0]>l?Ae(r,l||0,s[0]-1):0,d.scrollLeft=s[1]>h?Ne(r,h||0,s[1]-1):0,this.parent.notify("onContentScroll",d);var p=this.parent.getThreshold("row"),c=r.frozenRows?a[0]:a[0]>p?It(r,a[0]-p,!0):0,f=[];r.frozenRows&&f.push(s[0]-p>l?s[0]-p:l),p=this.parent.getThreshold("col");var g=r.frozenColumns?a[1]:a[1]>p?It(r,a[1]-p,!0,"columns"):0;r.frozenColumns?(f.length||f.push(l),f.push(s[1]-p>h?s[1]-p:h)):f.length&&f.push(h),this.refreshUI({rowIndex:c,colIndex:g,refresh:"All",top:d.scrollTop,left:d.scrollLeft,frozenIndexes:f},null,e,t),n&&(f[0]>=l&&(this.parent.viewport.topIndex=It(r,f[0]-l,!0)),f[1]>=h&&(this.parent.viewport.leftIndex=It(r,f[1]-h,!0,"columns")))}},e.prototype.renderSheet=function(e){void 0===e&&(e=document.getElementById(this.parent.element.id+"_sheet_panel")),e.appendChild(this.parent.createElement("div",{className:"e-sheet",id:this.parent.element.id+"_sheet",styles:"background-color: #fff"})),this.parent.serviceLocator.getService("sheet").renderPanel()},e.prototype.refreshUI=function(e,r,n,i){var a=this;"All"!==e.refresh&&this.parent.showSpinner();var o=this.parent.serviceLocator.getService("sheet"),s=this.parent.getActiveSheet(),l=Ce(this.parent),h={rowCount:s.rowCount,colCount:s.colCount};if(e.frozenIndexes=e.frozenIndexes?e.frozenIndexes:[],!r)if(this.parent.scrollSettings.enableVirtualization){var d=e.rowIndex+this.parent.viewport.rowCount+2*this.parent.getThreshold("row"),p=e.colIndex+this.parent.viewport.colCount+2*this.parent.getThreshold("col"),c=this.parent.frozenRowCount(s),f=this.parent.frozenColCount(s);e.frozenIndexes.length&&(d+=e.frozenIndexes[0]-c,p+=e.frozenIndexes[1]-f),d+=s.frozenRows,p+=s.frozenColumns;var m=s.rowCount-1,v=0;this.parent.scrollSettings.isFinite&&d>m&&(v=d-m,d=m,v&&!t.isNullOrUndefined(this.parent.viewport.topIndex)&&(v=this.parent.viewport.topIndex-v>-1?this.parent.viewport.topIndex-v:0,this.parent.viewport.topIndex=e.rowIndex=this.skipHiddenIdx(v,!0))),m=s.colCount-1,v=0,this.parent.scrollSettings.isFinite&&p>m&&(v=p-m,p=m,v&&!t.isNullOrUndefined(this.parent.viewport.leftIndex)&&(v=this.parent.viewport.leftIndex-v>-1?this.parent.viewport.leftIndex-v:0,this.parent.viewport.leftIndex=e.colIndex=this.skipHiddenIdx(v,!0,"columns")));var y=this.parent.skipHidden(e.rowIndex,d);if(e.rowIndex!==y[0]){var C=u(s.topLeftCell);C[0]===e.rowIndex&&this.parent.updateTopLeftCell(y[0],C[1],"row"),e.rowIndex=y[0]}var b=e.rowIndex;d=y[1];S=u(s.topLeftCell);y=this.parent.skipHidden(e.colIndex,p,"columns"),e.colIndex!==y[0]&&(S[1]===e.colIndex&&this.parent.updateTopLeftCell(S[0],y[0],"col"),e.colIndex=y[0]);var x=e.colIndex;p=y[1],"Row"===e.refresh&&(b+=c,c&&(d+=S[0])),"Column"===e.refresh&&(x+=f,f&&(p+=S[1])),this.parent.viewport.topIndex=e.rowIndex,this.parent.viewport.bottomIndex=d,this.parent.viewport.leftIndex=e.colIndex,this.parent.viewport.rightIndex=p,r=g(b,x)+":"+g(d,p)}else{if("All"===e.refresh){var S=u(s.topLeftCell),w=u(s.paneTopLeftCell);if(s.frozenRows){c=this.parent.frozenRowCount(s);w[0]>c&&(e.top=Ae(s,c,w[0]-1))}else e.rowIndex=0,0!==S[0]&&(e.top=Ae(s,0,S[0]-1));if(s.frozenColumns){f=this.parent.frozenRowCount(s);w[1]>f&&(e.left=Ne(s,f,w[1]-1))}else e.colIndex=0,0!==S[1]&&(e.left=Ne(s,0,S[1]-1))}this.parent.viewport.bottomIndex=s.rowCount-1,this.parent.viewport.rightIndex=s.colCount-1,r=g(e.rowIndex,e.colIndex)+":"+g(this.parent.viewport.bottomIndex,this.parent.viewport.rightIndex)}"All"===e.refresh&&this.parent.trigger("beforeDataBound",{}),ot(this.parent.getMainContent(),{busy:!0});var I=this.parent.sheets.length;re(this.parent,l+"!"+r,null,null,e.frozenIndexes).then(function(t){if(!(I<a.parent.sheets.length)){var l=a.parent.sheets.indexOf(s);if(-1===l||l!==a.parent.activeSheetIndex)return void(l>-1&&a.checkTopLeftCell());var d,p=[e.rowIndex,e.colIndex].concat(u(r.split(":")[1]));switch(e.refresh){case"All":o.renderTable({cells:t,indexes:p,top:e.top,left:e.left,initLoad:n,isRefreshing:i});break;case"Row":o.refreshRowContent({cells:t,indexes:p,skipUpdateOnFirst:e.skipUpdateOnFirst,prevRowColCnt:h}),d={isEdit:!1},a.parent.notify("isFormulaBarEdit",d),d.isEdit&&a.parent.notify(Qt,{action:"startEdit",refreshCurPos:!1});break;case"Column":o.refreshColumnContent({cells:t,indexes:p,skipUpdateOnFirst:e.skipUpdateOnFirst,prevRowColCnt:h});break;case"RowPart":o.updateRowContent({cells:t,indexes:p,direction:e.direction,skipUpdateOnFirst:e.skipUpdateOnFirst,prevRowColCnt:h});break;case"ColumnPart":o.updateColContent({cells:t,indexes:p,direction:e.direction,skipUpdateOnFirst:e.skipUpdateOnFirst,prevRowColCnt:h})}a.parent.isReact&&a.parent.renderReactTemplates()}}),this.parent.notify("beforeVirtualContentLoaded",{refresh:e.refresh,skipTranslate:e.skipTranslate})},e.prototype.skipHiddenIdx=function(e,t,r,n){return void 0===r&&(r="rows"),void 0===n&&(n=this.parent.getActiveSheet()),n[r][e]&&n[r][e].hidden&&(e=t?++e:--e,e=this.skipHiddenIdx(e,t,r,n)),e},e.prototype.removeSheet=function(){t.remove(document.getElementById(this.parent.element.id+"_sheet"))},e.prototype.refreshSheet=function(e){this.removeSheet(),this.renderSheet(),this.parent.notify("deInitProperties",{}),this.checkTopLeftCell(!1,e)},e.prototype.setSheetPanelSize=function(){var e,t=document.getElementById(this.parent.element.id+"_sheet_panel"),r=this.parent.element.getBoundingClientRect();"auto"===this.parent.height?(t.style.height="260px",e=230):(e=r.height-Ue(t),t.style.height=e+"px",e-=32),this.parent.viewport.height=e,this.parent.viewport.width=r.width-32,this.parent.viewport.rowCount=this.roundValue(e,20),this.parent.viewport.colCount=this.roundValue(r.width,64)},e.prototype.roundValue=function(e,t){var r=e/t,n=Math.round(r);return Math.abs(r-n)<.5?n:n-1},e.prototype.moveOrDuplicateSheetHandler=function(e){this.parent.notify("refreshSheetTabs",null),e.refresh&&this.refreshSheet(e.isDuplicate)},e.prototype.instantiateRenderer=function(){this.parent.serviceLocator.register("cell",new qi(this.parent)),this.parent.serviceLocator.register("row",new zi(this.parent)),this.parent.serviceLocator.register("sheet",new Vi(this.parent))},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e.prototype.addEventListener=function(){this.parent.on(Jt,this.instantiateRenderer,this),this.parent.on("dataRefresh",this.refreshSheet,this),this.parent.on("spreadsheetDestroyed",this.destroy,this),this.parent.on(Xt,this.moveOrDuplicateSheetHandler,this)},e.prototype.removeEventListener=function(){this.parent.off(Jt,this.instantiateRenderer),this.parent.off("dataRefresh",this.refreshSheet),this.parent.off("spreadsheetDestroyed",this.destroy),this.parent.off(Xt,this.moveOrDuplicateSheetHandler)},e}(),Wi=function(){function e(e){this.parent=e}return e.prototype.show=function(e,r){var n,i=this;r=!!t.isNullOrUndefined(r);var a=e.close||null,o={header:"Spreadsheet",cssClass:this.parent.cssClass,target:this.parent.element,buttons:[]};e.close=function(){i.destroyDialog(),a&&a()},t.extend(o,e),r&&(n=this.parent.serviceLocator.getService(Hi).getConstant(o.buttons.length?"Cancel":"Ok"),o.buttons.push({buttonModel:{content:n,isPrimary:0===o.buttons.length},click:this.hide.bind(this)}));var s=this.parent.createElement("div");document.body.appendChild(s),this.dialogInstance=new h.Dialog(o),this.dialogInstance.createElement=this.parent.createElement,this.dialogInstance.appendTo(s),this.dialogInstance.refreshPosition()},e.prototype.destroyDialog=function(){this.dialogInstance.destroy(),t.remove(this.dialogInstance.element),this.dialogInstance=null},e.prototype.hide=function(){this.dialogInstance&&this.dialogInstance.hide()},e.prototype.destroy=function(){this.parent=null},e}(),Gi=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.initializeActionBegin=function(){var e=this,t=this.parent.beforeCellFormat;this.parent.beforeCellFormat=function(r){e.actionEventHandler({evtArgs:r,evtFunc:t,actionType:"begin",eventType:"format"})};var r=this.parent.beforeOpen;this.parent.beforeOpen=function(t){e.actionEventHandler({evtArgs:t,evtFunc:r,actionType:"begin",eventType:"beforeOpen"})};var n=this.parent.beforeSave;this.parent.beforeSave=function(t){e.actionEventHandler({evtArgs:t,evtFunc:n,actionType:"begin",eventType:"beforeSave"})};var i=this.parent.beforeSort;this.parent.beforeSort=function(t){e.actionEventHandler({evtArgs:t,evtFunc:i,actionType:"begin",eventType:"beforeSort"})}},e.prototype.initializeActionComplete=function(){var e=this,t=this.parent.sortComplete;this.parent.sortComplete=function(r){e.actionEventHandler({evtArgs:r,evtFunc:t,actionType:"complete",eventType:"sorting"})};var r=this.parent.cellSave;this.parent.cellSave=function(t){e.actionEventHandler({evtArgs:t,evtFunc:r,actionType:"complete",eventType:"cellSave"})}},e.prototype.actionEventHandler=function(e){e.evtFunc&&e.evtFunc.apply(this,[e]),"begin"===e.actionType?this.actionBeginHandler({eventArgs:e.evtArgs,action:e.eventType}):this.actionCompleteHandler({eventArgs:e.evtArgs,action:e.eventType})},e.prototype.actionBeginHandler=function(e){this.parent.trigger("actionBegin",{action:e.action,args:e}),"clipboard"!==e.action&&"beforeSort"!==e.action&&"format"!==e.action&&"cellSave"!==e.action&&"beforeWrap"!==e.action&&"beforeReplace"!==e.action&&"beforeClear"!==e.action&&"beforeInsertImage"!==e.action&&"beforeInsertChart"!==e.action&&"filter"!==e.action&&"cellDelete"!==e.action||this.parent.notify("setActionData",{args:e})},e.prototype.actionCompleteHandler=function(e){this.parent.notify("triggerDataChange",e),this.parent.trigger("actionComplete",e),"undoRedo"!==e.action&&"gotoSheet"!==e.action&&this.parent.notify("updateUndoRedoCollection",{args:e})},e.prototype.addEventListener=function(){this.parent.on(pr,this.actionCompleteHandler,this),this.parent.on(cr,this.actionBeginHandler,this)},e.prototype.removeEventListener=function(){this.parent.off(pr,this.actionCompleteHandler),this.parent.off(cr,this.actionBeginHandler)},e}(),Yi=function(){function e(e){this.minHeight="300px",this.minWidth="400px",this.isOverlayClicked=!1,this.isResizerClicked=!1,this.currentWidth=400,this.currenHeight=300,this.parent=e}return e.prototype.insertOverlayElement=function(e,t,r){var n=this.parent.createElement("div",{id:e,attrs:{class:"e-ss-overlay"},styles:"width: "+this.minWidth+"; height: "+this.minHeight}),i=c(t),a=this.parent.sheets[r],o=this.parent.frozenRowCount(a),s=this.parent.frozenColCount(a),l=qe(a,i,o,s,this.parent.viewport.beforeFreezeHeight,this.parent.viewport.beforeFreezeWidth,this.parent.sheetModule.colGroupWidth);if(i[0]>=o&&i[1]<s){var h=this.parent.sheetModule.contentPanel;h.scrollTop&&(l.top-=h.scrollTop,l.top+=this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height)}if(i[1]>=s&&i[0]<o){var d=this.parent.getScrollElement();d.scrollLeft&&(l.left-=d.scrollLeft,l.left+=this.parent.sheetModule.getRowHeaderWidth(a))}var p;return i[0]<o||i[1]<s?(p=document.getElementById(this.parent.element.id+"_sheet"),o&&(i[0]>=o?l.top+=(a.showHeaders?31:0)+Ae(a,u(a.topLeftCell)[0],o-1):s||(l.left+=this.parent.sheetModule.getRowHeaderWidth(a,!0))),s&&(i[1]>=s?l.left+=this.parent.sheetModule.getRowHeaderWidth(a):o||(l.left+=a.showHeaders?31:0))):p=this.parent.getMainContent(),n.style.top=l.top+"px",n.style.left=l.left+"px",p.appendChild(n),this.renderResizeHandles(n),this.addEventListener(n),this.originalWidth=parseFloat(getComputedStyle(n,null).getPropertyValue("width").replace("px","")),this.originalHeight=parseFloat(getComputedStyle(n,null).getPropertyValue("height").replace("px","")),n},e.prototype.addEventListener=function(e){var r=e;t.EventHandler.add(r,"mousedown",this.overlayClickHandler,this),t.EventHandler.add(r,"mousemove",this.overlayMouseMoveHandler,this),t.EventHandler.add(document.getElementById(this.parent.element.id+"_sheet"),"mousemove",this.overlayMouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.overlayMouseUpHandler,this),this.parent.on("overlayEleSize",this.setOriginalSize,this)},e.prototype.setOriginalSize=function(e){this.originalHeight=e.height,this.originalWidth=e.width},e.prototype.overlayMouseMoveHandler=function(e){var r,n,i,a,o,s,l=e.target,h=document.getElementsByClassName("e-ss-overlay-active")[0],d=this.parent.getActiveSheet(),p=d.frozenRows||d.frozenColumns?[29,this.parent.sheetModule.getRowHeaderWidth(d,!0)]:[-1,-1];if(this.isOverlayClicked&&this.isResizerClicked)switch(this.resizer){case"e-ss-overlay-t":r=Math.max(this.originalMouseY-e.clientY+this.originalHeight,20),n=e.clientY-(this.originalMouseY-this.originalResizeTop),r>180&&n>p[0]&&(h.style.height=r+"px",h.style.top=n+"px",this.resizedReorderTop=n,this.currenHeight=r,this.parent.notify(Yt,{height:h.style.height,width:h.style.width,overlayEle:h}));break;case"e-ss-overlay-r":(i=this.originalWidth+(e.pageX-this.originalMouseX))>180&&(h.style.width=i+"px",this.currentWidth=i,this.parent.notify(Yt,{height:h.style.height,width:h.style.width,overlayEle:h}));break;case"e-ss-overlay-b":(a=this.originalHeight+(e.pageY-this.originalMouseY))>180&&(h.style.height=a+"px",this.currenHeight=a,this.parent.notify(Yt,{height:h.style.height,width:h.style.width,overlayEle:h}));break;case"e-ss-overlay-l":o=Math.max(this.originalMouseX-e.clientX+this.originalWidth,20),s=e.clientX-(this.originalMouseX-this.originalResizeLeft),o>180&&s>p[1]&&(h.style.width=o+"px",h.style.left=s+"px",this.resizedReorderLeft=s,this.currentWidth=o,this.parent.notify(Yt,{height:h.style.height,width:h.style.width,overlayEle:h}))}else if(this.isOverlayClicked)if(t.closest(l,".e-sheet")&&!l.classList.contains("e-sheet-content")||l.classList.contains("e-cell")){if(!h)return;var c=e.clientX-this.diffX,u=e.clientY-this.diffY;c>p[1]&&(h.style.left=c+"px"),u>p[0]&&(h.style.top=u+"px"),this.resizedReorderLeft=c<0?0:c,this.resizedReorderTop=u<0?0:u}else this.overlayMouseUpHandler(e,!0)},e.prototype.overlayMouseUpHandler=function(e,r){if(!this.parent.getActiveSheet().isProtected){this.isResizerClicked=!1;var n=e.target,i=document.getElementsByClassName("e-datavisualization-chart e-ss-overlay-active");n.classList.contains("e-ss-overlay")||(n=t.closest(e.target,".e-datavisualization-chart")?t.closest(e.target,".e-datavisualization-chart"):n);var a=this.parent.getActiveSheet(),o={prevTop:a.frozenRows||a.frozenColumns?this.prevY:this.originalReorderTop,prevLeft:a.frozenRows||a.frozenColumns?this.prevX:this.originalReorderLeft,currentTop:this.resizedReorderTop>=0?this.resizedReorderTop:this.originalReorderTop,currentLeft:this.resizedReorderLeft>=0?this.resizedReorderLeft:this.originalReorderLeft,id:n.id,currentHeight:this.currenHeight,currentWidth:this.currentWidth,requestType:"imageRefresh",prevHeight:this.originalHeight,prevWidth:this.originalWidth};if(this.isOverlayClicked||r){var s=void 0,l=void 0,h={clientY:o.prevTop,isImage:!0},d={clientX:o.prevLeft,isImage:!0},p=this.parent.element.getElementsByClassName("e-ss-overlay-active")[0];if(a.frozenRows||a.frozenColumns){if(!p)return;h.isImage=!1,d.isImage=!1,h.target=p,d.target=p,o.prevTop<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(h.target=this.parent.getColumnHeaderContent()),o.prevLeft<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(d.target=this.parent.getRowHeaderTable());var c=p.getBoundingClientRect();s={clientY:c.top},l={clientX:c.left},c.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(s.target=this.parent.getColumnHeaderContent()),c.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(l.target=this.parent.getRowHeaderTable())}else s={clientY:o.currentTop,isImage:!0},l={clientX:o.currentLeft,isImage:!0};if(this.parent.notify("getRowIdxFromClientY",h),this.parent.notify("getRowIdxFromClientY",s),this.parent.notify("getColIdxFromClientX",d),this.parent.notify("getColIdxFromClientX",l),s.size&&(o.currentTop=s.size),l.size&&(o.currentLeft=l.size),o.prevRowIdx=h.clientY,o.prevColIdx=d.clientX,o.currentRowIdx=s.clientY,o.currentColIdx=l.clientX,(a.frozenColumns||a.frozenRows)&&!t.closest(p,".e-sheet-content")){var u=this.parent.frozenColCount(a),f=this.parent.frozenRowCount(a);if(o.currentRowIdx>=f&&o.currentColIdx>=u){var g=parseInt(p.style.top,10),m=parseInt(p.style.left,10);g+=this.parent.sheetModule.contentPanel.scrollTop,g-=this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height,m+=this.parent.getScrollElement().scrollLeft,m-=this.parent.sheetModule.getRowHeaderWidth(a),p.style.top=g+"px",p.style.left=m+"px",this.parent.getMainContent().appendChild(p)}}i&&i[0]&&i[0].querySelector(".e-control")&&(o.id=i[0].id),this.originalReorderTop!==this.resizedReorderTop||this.originalReorderLeft!==this.resizedReorderLeft?(o.id=p.id,i&&i[0]?(o.requestType="chartRefresh",this.parent.notify("refreshChartCellObj",o)):this.parent.notify(vr,o),this.resizedReorderTop=this.originalReorderTop,this.resizedReorderLeft=this.originalReorderLeft):this.currenHeight===this.originalHeight&&this.originalWidth===this.currentWidth||(o.id=n.id.indexOf("overlay")>0?n.id:n.parentElement?n.parentElement.id:"",i&&i[0]?(o.requestType="chartRefresh",this.parent.notify("refreshChartCellObj",o)):this.parent.notify(vr,o),this.originalHeight=this.currenHeight,this.originalWidth=this.currentWidth)}this.isOverlayClicked=!1}},e.prototype.overlayClickHandler=function(e){if(!this.parent.getActiveSheet().isProtected){this.isOverlayClicked=!0;var r=e.target,n=e.target;r.classList.contains("e-ss-overlay")||(n=r.parentElement,t.closest(e.target,".e-datavisualization-chart")&&(n=t.closest(e.target,".e-datavisualization-chart"),this.currentWidth=parseFloat(getComputedStyle(n,null).getPropertyValue("width").replace("px","")),this.currenHeight=parseFloat(getComputedStyle(n,null).getPropertyValue("height").replace("px",""))));var i=this.parent.getActiveSheet();if((i.frozenColumns||i.frozenRows)&&t.closest(n,".e-sheet-content")){var a=parseInt(n.style.top,10),o=parseInt(n.style.left,10);a-=this.parent.sheetModule.contentPanel.scrollTop,a+=this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height,o-=this.parent.getScrollElement().scrollLeft,o+=this.parent.sheetModule.getRowHeaderWidth(i),n.style.top=a+"px",n.style.left=o+"px",document.getElementById(this.parent.element.id+"_sheet").appendChild(n)}this.originalReorderLeft=parseInt(n.style.left,10),this.originalReorderTop=parseInt(n.style.top,10),this.resizedReorderLeft=parseInt(n.style.left,10),this.resizedReorderTop=parseInt(n.style.top,10),this.originalResizeTop=this.originalReorderTop,this.originalResizeLeft=this.originalReorderLeft,this.originalMouseX=e.clientX,this.originalMouseY=e.clientY,this.diffX=this.originalMouseX-this.originalReorderLeft,this.diffY=this.originalMouseY-this.originalReorderTop;var s=document.getElementsByClassName("e-ss-overlay-active")[0];s&&t.removeClass([s],"e-ss-overlay-active"),document.getElementById(n.id).classList.add("e-ss-overlay-active"),r.classList.contains("e-ss-resizer")&&(this.resizer=r.classList[0],this.originalWidth=parseFloat(getComputedStyle(n,null).getPropertyValue("width").replace("px","")),this.originalHeight=parseFloat(getComputedStyle(n,null).getPropertyValue("height").replace("px","")),this.isResizerClicked=!0),n.classList.contains("e-datavisualization-chart")&&(this.parent.notify("focusChartBorder",{id:n.id}),s||this.parent.notify("insertDesignChart",{id:n.id}));var l=n.getBoundingClientRect();this.prevX=l.left,this.prevY=l.top}},e.prototype.renderResizeHandles=function(e){for(var t,r=["e-ss-overlay-t","e-ss-overlay-r","e-ss-overlay-b","e-ss-overlay-l"],n=0,i=e;r.length>n;)t=this.parent.createElement("div",{attrs:{class:r[n]+" e-ss-resizer"},styles:"width: 8px; height: 8px; border-radius: 4px;"}),i.appendChild(t),n++},e.prototype.removeEventListener=function(){var e=document.getElementById(this.parent.element.id+"_overlay");e&&(t.EventHandler.remove(e,"mousedown",this.overlayClickHandler),t.EventHandler.remove(e,"mousemove",this.overlayMouseMoveHandler)),t.EventHandler.remove(document.getElementById(this.parent.element.id+"_sheet"),"mousemove",this.overlayMouseMoveHandler),t.EventHandler.remove(document,"mouseup",this.overlayMouseUpHandler),this.parent.off("overlayEleSize",this.setOriginalSize)},e.prototype.destroy=function(){this.removeEventListener(),this.parent=null},e}(),Xi=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ki=function(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o},$i=function(e){function r(t,r){var i=e.call(this,t)||this;return i.viewport={rowCount:0,colCount:0,height:0,topIndex:0,leftIndex:0,width:0,bottomIndex:0,rightIndex:0,beforeFreezeHeight:0,beforeFreezeWidth:0},i.needsID=!0,n.Inject(mi,vi,Ci,jn,qn,Yn,Xn,zn,Zt,bi,Si,xi,wi,Kn,yi,ti,zr,xr,Ir,Vr,$t,Br,Ii,Mr,$n,ei,Pr,Ei,Qn,qr,ri,ni,jr,Wr,ii,Gr,ai,Xr,oi,Yr,si,Kr,Ri,li,_r,$r,ki,Ur),r&&i.appendTo(r),i}Xi(r,e),n=r,r.prototype.getCell=function(e,t,r){return r||(r=this.getRow(e,null,t)),t=this.getViewportIndex(t,!0),r?r.cells[t]:r},r.prototype.getRow=function(e,r,n){if(!r){var i=this.getActiveSheet(),a=this.frozenRowCount(i),o=this.frozenColCount(i);r=t.isNullOrUndefined(n)||e>a-1&&n>o-1?this.getContentTable():e<a&&n<o?this.sheetModule.getSelectAllTable():e<a?this.getColHeaderTable():this.getRowHeaderTable()}return e=this.getViewportIndex(e),r?r.rows[e]:null},r.prototype.hiddenCount=function(e,t,r,n){void 0===r&&(r="rows"),void 0===n&&(n=this.getActiveSheet());for(var i=0,a=e;a<=t;a++)n[r][a]&&n[r][a].hidden&&i++;return i},r.prototype.getViewportIndex=function(e,t){var r=this.getActiveSheet();if(t){var n=this.frozenColCount(r);if(n){var i=u(r.topLeftCell)[1];if(e<n)return(e-=i)+1;e-=n}}else{var a=this.frozenRowCount(r);if(a){var o=u(r.topLeftCell)[0];if(e<a)return(e-=o)+1;e-=a}}return this.scrollSettings.enableVirtualization&&(t?(e-=this.hiddenCount(this.viewport.leftIndex,e,"columns"),e-=this.viewport.leftIndex):(e-=this.hiddenCount(this.viewport.topIndex,e),e-=this.viewport.topIndex)),e},r.prototype.preRender=function(){e.prototype.preRender.call(this),this.serviceLocator=new An,this.initServices()},r.prototype.initServices=function(){this.serviceLocator.register(Hi,new t.L10n(this.getModuleName(),Ui,this.locale)),this.serviceLocator.register(Bi,new Wi(this)),this.serviceLocator.register("actionEvents",new Gi(this)),this.serviceLocator.register(Mi,new Yi(this))},r.prototype.render=function(){e.prototype.render.call(this),this.element.setAttribute("tabindex","0"),ot(this.element,{role:"grid"}),this.renderModule=new ji(this),this.notify(Jt,null),this.renderSpreadsheet(),this.wireEvents(),this.created&&(this.created.observers?this.created.observers.length>0&&(this.createdHandler={observers:this.created.observers},this.created.observers=[]):(this.createdHandler=this.created,this.setProperties({created:void 0},!0)))},r.prototype.renderSpreadsheet=function(){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.setHeight(),this.setWidth(),h.createSpinner({target:this.element},this.createElement),this.isMobileView()&&-1===this.cssClass.indexOf("e-mobile-view")&&this.element.classList.add("e-mobile-view"),this.sheetModule=this.serviceLocator.getService("sheet"),this.allowScrolling&&(this.scrollModule=new Wn(this)),this.scrollSettings.enableVirtualization&&new Gn(this),this.renderModule.render(this.refreshing),new Jn(this)},r.prototype.showSpinner=function(){h.showSpinner(this.element)},r.prototype.hideSpinner=function(){h.hideSpinner(this.element)},r.prototype.protectSheet=function(t,r){"string"==typeof t&&(t=se(this,t)),t&&(this.setSheetPropertyOnMute(this.sheets[t],"isProtected",!0),this.setSheetPropertyOnMute(this.sheets[t],"protectSettings",r)),t=this.getActiveSheet().index,this.setSheetPropertyOnMute(this.getActiveSheet(),"isProtected",!0),e.prototype.protectSheet.call(this,t,r)},r.prototype.unprotectSheet=function(t){"string"==typeof t&&(t=se(this,t)),t?this.sheets[t].isProtected=!1:this.getActiveSheet().isProtected=!1,e.prototype.unprotectSheet.call(this,t)},r.prototype.find=function(t){e.prototype.findHandler.call(this,t)},r.prototype.replace=function(t){t={value:t.value,mode:t.mode?t.mode:"Sheet",isCSen:!!t.isCSen&&t.isCSen,isEMatch:!!t.isEMatch&&t.isEMatch,searchBy:t.searchBy?t.searchBy:"By Row",replaceValue:t.replaceValue,replaceBy:t.replaceBy,sheetIndex:t.sheetIndex?t.sheetIndex:this.activeSheetIndex,findOpt:t.findOpt?t.findOpt:""},e.prototype.replaceHandler.call(this,t)},r.prototype.findAll=function(e,t,r,n,i){var a=[],o={value:e,mode:t=t||"Sheet",sheetIndex:i=i||this.activeSheetIndex,isCSen:r=r||!1,isEMatch:n=n||!1,findCollection:a};return this.notify("findAllValues",o),a},r.prototype.goTo=function(e){if(e.includes("!")){var t=e.split("!"),r=se(this,t[0]);if(void 0===r)return;if(r!==this.activeSheetIndex){var n=t[1].split(":")[0],i=this.sheets[r];this.setSheetPropertyOnMute(i,"activeCell",n),this.setSheetPropertyOnMute(i,"selectedRange",t[1]);var a=u(n);if(i.frozenColumns||i.frozenRows){var o=u(i.topLeftCell);if(!(i.frozenRows&&a[0]<o[0]||i.frozenColumns&&a[1]<o[1])){var s=this.frozenRowCount(i),l=this.frozenColCount(i),h=[],d=[],p=u(i.paneTopLeftCell);s?(h.push(o[0]),a[0]>=s?d.push(a[0]):d.push(p[0])):(h.push(a[0]),d.push(a[0])),l?(h.push(o[1]),a[1]>=l?d.push(a[1]):d.push(p[1])):(h.push(a[1]),d.push(a[1])),this.setSheetPropertyOnMute(i,"topLeftCell",g(h[0],h[1])),this.setSheetPropertyOnMute(i,"paneTopLeftCell",g(d[0],d[1]))}}else a[0]<this.viewport.rowCount&&(a[0]=0),a[1]<this.viewport.colCount&&(a[1]=0),this.updateTopLeftCell(a[0],a[1],null,i);return this.activeSheetIndex=r,void this.dataBind()}}var f=c(e),m=this.getActiveSheet(),v=this.frozenRowCount(m),y=this.frozenColCount(m),C=this.insideViewport(f[0],f[1]);if(C){this.selectRange(e);var b=u(m.paneTopLeftCell),x=this.viewport.height-this.getScrollElement().parentElement.getBoundingClientRect().height,S=0,w=0;if(v)for(R=(E=u(m.topLeftCell))[0];R<v;R++)if((S+=Re(m,R))>x){w=R;break}if(0===w)for(R=b[0];R<this.viewport.bottomIndex;R++)if((S+=Re(m,R))>x){w=R;break}b[2]=w;var I=0;if(S=0,x=this.viewport.width-this.sheetModule.getScrollSize(),y)for(var E=u(m.topLeftCell),R=E[1];R<y;R++)if((S+=Le(m,R))>x){I=R;break}if(0===I)for(R=b[1];R<this.viewport.rightIndex;R++)if((S+=Le(m,R))>x){I=R;break}if(b[3]=I,f[0]>=b[0]&&f[0]<b[2]&&f[1]>=b[1]&&f[1]<b[3])return;if(v||y){if(b=[].concat(u(m.topLeftCell),[v,b[3]]),f[0]>=b[0]&&f[0]<b[2]&&f[1]>=b[1]&&f[1]<b[3])return;if(b[2]=w,b[3]=y,f[0]>=b[0]&&f[0]<b[2]&&f[1]>=b[1]&&f[1]<b[3])return}}var k,A,T,F,L,N,D=this.getMainContent().parentElement;f[0]===v?T=0:(T=Ae(m,v,f[0]-1,!0),this.scrollSettings.enableVirtualization&&(N=T+this.getContentTable().getBoundingClientRect().height)>(L=parseFloat(D.querySelector(".e-virtualtrack").style.height))&&(N+=10,(k=D.querySelector(".e-virtualtrack")).style.height=N+"px",Be(function(){k.style.height=L+"px"}))),D.scrollTop=T,D=this.element.getElementsByClassName("e-scroller")[0],f[1]===y?T=0:(T=Ne(m,y,f[1]-1,!0),this.scrollSettings.enableVirtualization&&(N=T+this.getContentTable().getBoundingClientRect().width)>(F=parseFloat(D.querySelector(".e-virtualtrack").style.width))&&(N+=10,(k=D.querySelector(".e-virtualtrack")).style.width=N+"px",(A=this.getColumnHeaderContent().querySelector(".e-virtualtrack")).style.width=N+"px",(k=this.getMainContent().querySelector(".e-virtualtrack")).style.width=N+"px",Be(function(){k.style.width=F+"px",A.style.width=F+"px"}))),D.scrollLeft=T,C||this.selectRange(e)},r.prototype.insideViewport=function(e,t){var r=this.getActiveSheet();if(r.frozenRows||r.frozenColumns){var n=this.frozenRowCount(r),i=this.frozenColCount(r),a=u(r.topLeftCell);return(e>=a[0]&&e<n||e>=this.viewport.topIndex+n&&e<=this.viewport.bottomIndex)&&(t>=a[1]&&t<i||t>=this.viewport.leftIndex+i&&t<=this.viewport.rightIndex)}return e>=this.viewport.topIndex&&e<=this.viewport.bottomIndex&&t>=this.viewport.leftIndex&&t<=this.viewport.rightIndex},r.prototype.resize=function(){this.renderModule.setSheetPanelSize(),this.scrollSettings.enableVirtualization&&this.renderModule.refreshSheet()},r.prototype.cut=function(e){var t=new Promise(function(e,t){e(void 0)});return this.notify(ar,e?{range:y(e),sId:this.sheets[se(this,he(e))].id,promise:t}:{promise:t}),t},r.prototype.copy=function(e){var t=new Promise(function(e,t){e(void 0)});return this.notify("copy",e?{range:y(e),sId:this.sheets[se(this,he(e))]?this.sheets[se(this,he(e))].id:this.activeSheetIndex,promise:t}:{promise:t}),t},r.prototype.paste=function(e,t){this.notify(or,{range:e?y(e):e,sIdx:e?se(this,he(e)):e,type:t,isAction:!1,isInternal:!0})},r.prototype.updateAction=function(e){pt(e,this)},r.prototype.setHeight=function(){this.height.toString().indexOf("%")>-1&&(this.element.style.minHeight="400px"),this.element.style.height=t.formatUnit(this.height)},r.prototype.setWidth=function(){(this.width.toString().indexOf("%")>-1||"auto"===this.width)&&(this.element.style.minWidth="300px"),this.element.style.width=t.formatUnit(this.width)},r.prototype.setColWidth=function(e,r,n){void 0===e&&(e=64),void 0===r&&(r=0);var i=this.getThreshold("col"),a=this.viewport.leftIndex+this.viewport.colCount+2*i,o=t.isNullOrUndefined(n)?this.getActiveSheet():this.sheets[n];if(o){var s=r,l="number"==typeof e?e+"px":e;if(r=t.isNullOrUndefined(r)?u(o.activeCell)[1]:r,o===this.getActiveSheet())if(r>=this.viewport.leftIndex&&r<=a){this.scrollSettings.enableVirtualization&&(r-=this.viewport.leftIndex);var h=void 0;h=o.showHeaders?this.getColumnHeaderContent().getElementsByClassName("e-header-cell")[r]:this.getContentTable().getElementsByClassName("e-row")[0].getElementsByClassName("e-cell")[r];var d=Le(o,r,null,!0);(f=at(parseInt(l,10))-d)<0&&d<-f&&(u(o.activeCell),f=-d);var p=parseInt(h.getAttribute("aria-colindex"),10)-1;this.getActiveSheet()===o&&(this.notify("colWidthChanged",{threshold:f,colIdx:p}),lt(r,r,l,!0,this))}else{var c=Le(o,r),f=void 0;f=parseInt(l,10)>0?-(c-parseInt(l,10)):-c,this.notify("colWidthChanged",{threshold:f,colIdx:r})}Te(o,s).width=parseInt(l,10)>0?parseInt(l,10):0,o.columns[s].customWidth=!0}},r.prototype.setRowHeight=function(e,r,n,i){void 0===e&&(e=20),void 0===r&&(r=0);var a=t.isNullOrUndefined(n)?this.getActiveSheet():this.sheets[n-1];if(a){var o=r,s="number"==typeof e?e+"px":e;if(r=t.isNullOrUndefined(r)?u(a.activeCell)[0]:r,a===this.getActiveSheet())if(r<=this.viewport.bottomIndex&&r>=this.viewport.topIndex){this.scrollSettings.enableVirtualization&&(r-=this.viewport.topIndex);var l=void 0;l=a.showHeaders?this.getRowHeaderContent().getElementsByClassName("e-header-cell")[r].parentElement:this.getContentTable().getElementsByClassName("e-row")[r];var h=Re(a,r,!0);(c=at(parseInt(s,10))-h)<0&&h<-c&&(c=-h);var d=parseInt(l.getAttribute("aria-rowindex"),10)-1;this.getActiveSheet()===a&&(this.notify(sr,{threshold:c,rowIdx:d}),t.isNullOrUndefined(i)&&(i=!1),i||(lt(r,r,s,!1,this),i=!1))}else{var p=Re(a,r),c=void 0;c=parseInt(s,10)>0?-(p-parseInt(s,10)):-p,this.notify(sr,{threshold:c,rowIdx:r})}ke(a,o,parseInt(s,10)>0?parseInt(s,10):0),a.rows[o].customHeight=!0}},r.prototype.autoFit=function(e){var t=this.getIndexes(e),r=t.startIdx,n=t.endIdx,i=t.isCol,a=i?f("XFD"):1048576;if(r<=a)for(n>a&&(n=a),r;r<=n;r++)this.notify("setAutoFit",{idx:r,isCol:i})},r.prototype.getIndexes=function(e){var r,n,i,a;if(-1!==e.indexOf(":")){var o=e.split(":");i=o[0],a=o[1]}else i=e,a=e;if(!t.isNullOrUndefined(i)){var s=this.getAddress(i);i=s.address,r=s.isCol}if(!t.isNullOrUndefined(a)){var l=this.getAddress(a);a=l.address,n=l.isCol}var h=!0===r&&!0===n;return{startIdx:h?f(i.toUpperCase()):parseInt(i,10),endIdx:h?f(a.toUpperCase()):parseInt(a,10),isCol:h}},r.prototype.getAddress=function(e){var t;return e.substring(0,1).match(/\D/g)?(t=!0,e=e.replace(/[0-9]/g,""),{address:e,isCol:t}):e.substring(0,1).match(/[0-9]/g)&&e.match(/\D/g)?{address:"",isCol:!1}:(e=(parseInt(e,10)-1).toString(),{address:e,isCol:t})},r.prototype.addHyperlink=function(e,t){this.insertHyperlink(e,t,"",!0)},r.prototype.removeHyperlink=function(e){var t,r,n=this.getActiveSheet();if(e&&-1!==e.indexOf("!")){t=e.split("!");for(var i=this.sheets,a=0;a<i.length;a++)i[a].name===t[0]&&(r=a);n=this.sheets[r],e=t[1]}for(var o=c(e?e:this.getActiveSheet().activeCell),s=o[0];s<=o[2];s++)for(var l=o[1];l<=o[3];l++)if(n&&n.rows[s]&&n.rows[s].cells[l]){for(var h=this.getCell(s,l),d=[],p=0;p<h.classList.length;p++)d.push(h.classList[p]);this.notify("deleteHyperlink",{sheet:n,rowIdx:s,colIdx:l});for(p=0;p<d.length;p++)this.getCell(s,l).classList.contains(d[p])||this.getCell(s,l).classList.add(d[p])}},r.prototype.insertHyperlink=function(r,n,i,a){if(this.allowHyperlink){var o=void 0,s=void 0,l=void 0,h=this.getActiveSheet();l=c(n=n||this.getActiveSheet().activeCell);for(var d=this.getCell(l[0],l[1]),p=[],u=0;u<d.classList.length;u++)p.push(d.classList[u]);var f={hyperlink:r,cell:n,cancel:!1},g={hyperlink:r,cell:n};if(a||this.trigger("beforeHyperlinkCreate",f),!f.cancel){if(r=f.hyperlink,n=f.cell,e.prototype.addHyperlink.call(this,r,n),n&&-1!==n.indexOf("!")){o=n.split("!");for(var m=this.sheets,v=0;v<m.length;v++)m[v].name===o[0]&&(s=v);h=this.sheets[s],n=o[1]}if(!h)return;l=c(n=n||this.getActiveSheet().activeCell);var y=h.rows[l[0]].cells[l[1]];if(t.isNullOrUndefined(y.value)||""===y.value?t.isNullOrUndefined(i)||""===i||(y.value=i):y.value!==i&&(y.value=i),a||this.trigger("afterHyperlinkCreate",g),h===this.getActiveSheet()){this.serviceLocator.getService("cell").refreshRange(l);for(u=0;u<p.length;u++)this.getCell(l[0],l[1]).classList.contains(p[u])||this.getCell(l[0],l[1]).classList.add(p[u]);this.notify("refreshRibbonIcons",null)}}}},r.prototype.addDataValidation=function(t,r){e.prototype.addDataValidation.call(this,t,r)},r.prototype.removeDataValidation=function(t){e.prototype.removeDataValidation.call(this,t)},r.prototype.addInvalidHighlight=function(t){e.prototype.addInvalidHighlight.call(this,t)},r.prototype.removeInvalidHighlight=function(t){e.prototype.removeInvalidHighlight.call(this,t)},r.prototype.conditionalFormat=function(t){e.prototype.conditionalFormat.call(this,t)},r.prototype.clearConditionalFormat=function(t){t=t||this.getActiveSheet().selectedRange,e.prototype.clearConditionalFormat.call(this,t)},r.prototype.setPanelSize=function(){if("auto"!==this.height){var e=document.getElementById(this.element.id+"_sheet_panel");e.style.height=this.element.getBoundingClientRect().height-Ue(e)+"px"}},r.prototype.open=function(t){this.isOpen=!0,e.prototype.open.call(this,t),this.isOpen&&this.showSpinner()},r.prototype.hideRow=function(t,r,n){void 0===r&&(r=t),void 0===n&&(n=!0);var i=this.getActiveSheet();!this.renderModule||i.frozenRows||i.frozenColumns?e.prototype.hideRow.call(this,t,r,n):this.notify(lr,{startIndex:t,endIndex:r,hide:n})},r.prototype.hideColumn=function(t,r,n){void 0===r&&(r=t),void 0===n&&(n=!0);var i=this.getActiveSheet();!this.renderModule||i.frozenRows||i.frozenColumns?e.prototype.hideColumn.call(this,t,r,n):this.notify(lr,{startIndex:t,endIndex:r,hide:n,isCol:!0})},r.prototype.clear=function(e){this.notify(mr,{options:e,isPublic:!0})},r.prototype.refresh=function(t){this.isReact&&this.clearTemplate(),t?this.notify("blankWorkbook",{}):e.prototype.refresh.call(this)},r.prototype.insertImage=function(e,t){var r;for(r=0;r<e.length;r++)this.notify(yr,{options:e[r],range:t||this.getActiveSheet().selectedRange,isPublic:!0})},r.prototype.deleteImage=function(e,t){this.notify(Cr,{id:e,range:t||this.getActiveSheet().selectedRange})},r.prototype.getRowHeaderContent=function(){return this.sheetModule.getRowHeaderPanel()},r.prototype.getColumnHeaderContent=function(){return this.sheetModule.getColHeaderPanel()},r.prototype.getMainContent=function(){return this.sheetModule.getContentPanel()},r.prototype.getSelectAllContent=function(){return this.sheetModule.getSelectAllContent()},r.prototype.getScrollElement=function(){return this.sheetModule.getScrollElement()},r.prototype.getContentTable=function(){return this.sheetModule.getContentTable()},r.prototype.getRowHeaderTable=function(){return this.sheetModule.getRowHeaderTable()},r.prototype.getColHeaderTable=function(){return this.sheetModule.getColHeaderTable()},r.prototype.getThreshold=function(e){var t=Math.round((this.viewport[e+"Count"]+1)/2);return t<15?15:t},r.prototype.isMobileView=function(){return(this.cssClass.indexOf("e-mobile-view")>-1||t.Browser.isDevice)&&-1===this.cssClass.indexOf("e-desktop-view")&&!1},r.prototype.getValueRowCol=function(t,r,n,i,a){return e.prototype.getValueRowCol.call(this,t,r,n,i,a)},r.prototype.updateCell=function(t,r){r=r||this.getActiveSheet().activeCell,e.prototype.updateCell.call(this,t,r),this.serviceLocator.getService("cell").refreshRange(y(r)),this.notify("activeCellChanged",null)},r.prototype.sort=function(t,r){var n=this;return this.allowSorting?e.prototype.sort.call(this,t,r).then(function(e){return n.notify("sortComplete",e),Promise.resolve(e)}):Promise.reject()},r.prototype.setValueRowCol=function(t,r,n,i){if("circular reference: "===r){var a={action:"isCircularReference",argValue:r};this.notify("formulaOperation",a),r=a.argValue}e.prototype.setValueRowCol.call(this,t,r,n,i),t=le(this,t),this.notify(Qt,{action:"refreshDependentCellValue",rowIdx:n,colIdx:i,sheetIdx:t})},r.prototype.getModuleName=function(){return"spreadsheet"},r.prototype.refreshNode=function(e,r){var n;if(e){var i=t.select("#"+this.element.id+"_currency",e),a="e-right-align";if(r){if(r.result=t.isNullOrUndefined(r.result)?"":r.result.toString(),i&&t.detach(i),"Accounting"===r.type&&L(r.value))return e.querySelector("a")?e.querySelector("a").textContent=r.result.split(r.curSymbol).join(""):e.innerHTML="",e.appendChild(this.createElement("span",{id:this.element.id+"_currency",innerHTML:""+r.curSymbol,styles:"float: left"})),e.querySelector("a")||(e.innerHTML+=r.result.split(r.curSymbol).join("")),void e.classList.add(a);!r.result||"true"!==r.result.toLowerCase()&&"false"!==r.result.toLowerCase()||(r.result=r.result.toUpperCase(),a="e-center-align",r.isRightAlign=!0),n=r.result,r.isRightAlign?e.classList.add(a):e.classList.remove(a)}if(n=t.isNullOrUndefined(n)?"":n,!t.isNullOrUndefined(e)){var o=e.lastChild,s=e.querySelector(".e-wrap-content");e.querySelector(".e-databar-value")&&(o=e.querySelector(".e-databar-value").lastChild),e.querySelector(".e-hyperlink")&&(o=e.querySelector(".e-hyperlink").lastChild),s&&(s.lastChild||s.appendChild(document.createTextNode("")),o=s.lastChild),!o||3!==o.nodeType&&1!==o.nodeType?e.appendChild(document.createTextNode(n)):o.nodeValue=n}}},r.prototype.calculateHeight=function(e,t,r){void 0===t&&(t=1),void 0===r&&(r=1);var n=e&&e.fontSize||this.cellStyle.fontSize,i="Arial Black"===e.fontFamily?1.44:1.24;return(n.indexOf("pt")>-1?1.33*parseInt(n,10):parseInt(n,10))*i*t+r*i},r.prototype.skipHidden=function(e,t,r){void 0===r&&(r="rows");var n,i=this.getActiveSheet();this.scrollSettings.isFinite&&(n=("rows"===r?i.rowCount:i.colCount)-1);for(var a=e;a<=t;a++)if(i[r][a]&&i[r][a].hidden){if(i.frozenColumns||i.frozenRows){"rows"===r?Ie(i,a,{hidden:!1}):Fe(i,a,{hidden:!1});continue}if(e===a&&e++,t++,n&&t>n){t=n;break}}return[e,t]},r.prototype.updateActiveBorder=function(e,r){void 0===r&&(r=".e-ribbon");var n=t.select(r+" .e-tab-header .e-indicator",this.element);n.style.display="none",t.setStyleAttribute(n,{left:"",right:""}),t.setStyleAttribute(n,{left:e.offsetLeft+"px",right:e.parentElement.offsetWidth-(e.offsetLeft+e.offsetWidth)+"px"}),n.style.display=""},r.prototype.undo=function(){this.notify("performUndoRedo",{isUndo:!0,isPublic:!0})},r.prototype.redo=function(){this.notify("performUndoRedo",{isUndo:!1,isPublic:!0})},r.prototype.updateUndoRedoCollection=function(e){this.notify("updateUndoRedoCollection",{args:e,isPublic:!0})},r.prototype.addDefinedName=function(e){var t={action:"addDefinedName",isAdded:!1,definedName:e};return this.notify("formulaOperation",t),t.isAdded},r.prototype.removeDefinedName=function(t,r){return e.prototype.removeDefinedName.call(this,t,r)},r.prototype.mouseClickHandler=function(e){this.notify(er,e)},r.prototype.mouseDownHandler=function(e){this.notify("mouseDown",e)},r.prototype.keyUpHandler=function(e){t.closest(e.target,".e-find-dlg")?this.notify("findKeyUp",e):this.notify(tr,e)},r.prototype.keyDownHandler=function(e){t.closest(e.target,".e-findtool-dlg")||this.notify(rr,e)},r.prototype.freeze=function(e){var t={row:e.row,column:e.column,cancel:!1,sheetIndex:this.activeSheetIndex};if(this.notify(cr,{eventArgs:t,action:"freezePanes"}),!t.cancel){if(this.on("contentLoaded",this.freezePaneUpdated,this),e.row||e.column){var r=!1;if(this.notify("getFilteredCollection",null),this.filterCollection)for(var n=0,i=this.filterCollection.length;n<i;n++)if(this.filterCollection[n].sheetIndex===this.activeSheetIndex){r=!0;break}r&&this.clearFilter()}this.freezePanes(e.row,e.column),this.notify("refreshRibbonIcons",null)}},r.prototype.freezePaneUpdated=function(){this.off("contentLoaded",this.freezePaneUpdated);var e=this.getActiveSheet();this.notify(pr,{eventArgs:{row:e.frozenRows,column:e.frozenColumns,sheetIndex:this.activeSheetIndex},action:"freezePanes"})},r.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,Xe(),this.mouseDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"noderefresh",this.refreshNode,this),this.on("freeze",this.freeze,this)},r.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unwireEvents(),this.notify("spreadsheetDestroyed",null),e.prototype.destroy.call(this),this.element.innerHTML="",this.element.removeAttribute("tabindex"),this.element.removeAttribute("role"),this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("min-height"),this.element.style.removeProperty("min-width")},r.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.mouseClickHandler),t.EventHandler.remove(this.element,Xe(),this.mouseDownHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"noderefresh",this.refreshNode),this.off("freeze",this.freeze)},r.prototype.addContextMenuItems=function(e,t,r,n){void 0===r&&(r=!0),this.notify("addContextMenuItems",{items:e,text:t,insertAfter:r,isUniqueId:n})},r.prototype.removeContextMenuItems=function(e,t){this.notify("removeContextMenuItems",{items:e,isUniqueId:t})},r.prototype.enableContextMenuItems=function(e,t,r){void 0===t&&(t=!0),this.notify("enableContextMenuItems",{items:e,enable:t,isUniqueId:r})},r.prototype.enableFileMenuItems=function(e,t,r){void 0===t&&(t=!0),this.notify("enableFileMenuItems",{items:e,enable:t,isUniqueId:r})},r.prototype.hideFileMenuItems=function(e,t,r){void 0===t&&(t=!0),this.notify("hideFileMenuItems",{items:e,hide:t,isUniqueId:r})},r.prototype.addFileMenuItems=function(e,t,r,n){void 0===r&&(r=!0),this.notify("addFileMenuItems",{items:e,text:t,insertAfter:r,isUniqueId:n})},r.prototype.hideRibbonTabs=function(e,t){void 0===t&&(t=!0),this.notify("hideRibbonTabs",{tabs:e,hide:t})},r.prototype.enableRibbonTabs=function(e,t){void 0===t&&(t=!0),this.notify("enableRibbonTabs",{tabs:e,enable:t})},r.prototype.addRibbonTabs=function(e,t){this.notify("addRibbonTabs",{items:e,insertBefore:t})},r.prototype.enableToolbarItems=function(e,t,r){this.notify("enableToolbarItems",[{tab:e,items:t,enable:void 0===r||r}])},r.prototype.hideToolbarItems=function(e,t,r){void 0===r&&(r=!0),this.notify("hideToolbarItems",{tab:e,indexes:t,hide:r})},r.prototype.addToolbarItems=function(e,t,r){this.notify("addToolbarItems",{tab:e,items:t,index:r})},r.prototype.selectRange=function(e){this.notify("selectRange",{address:e})},r.prototype.startEdit=function(){this.notify(Qt,{action:"startEdit",isNewValueEdit:!1})},r.prototype.closeEdit=function(){this.notify(Qt,{action:"cancelEdit"})},r.prototype.endEdit=function(){this.notify(Qt,{action:"endEdit"})},r.prototype.onPropertyChanged=function(r,n){var i=this;e.prototype.onPropertyChanged.call(this,r,n);for(var a=0,o=Object.keys(r);a<o.length;a++){var s=void 0,l=void 0;switch(o[a]){case"enableRtl":if((s=this.getColumnHeaderContent())&&(s=s.parentElement),!s)break;r.enableRtl?(s.style.marginLeft=_e()+"px",s.style.marginRight="",document.getElementById(this.element.id+"_sheet_panel").classList.add("e-rtl")):(s.style.marginRight=_e()+"px",s.style.marginLeft="",document.getElementById(this.element.id+"_sheet_panel").classList.remove("e-rtl")),this.renderModule.refreshSheet();break;case"cssClass":n.cssClass&&t.removeClass([this.element],n.cssClass.split(" ")),r.cssClass&&t.addClass([this.element],r.cssClass.split(" "));break;case"activeSheetIndex":this.renderModule.refreshSheet(),this.notify("activeSheetChanged",{idx:r.activeSheetIndex});break;case"width":this.setWidth(),this.resize();break;case"height":this.setHeight(),this.resize();break;case"showRibbon":this.notify("ribbon",{uiUpdate:!0});break;case"showFormulaBar":this.notify("formulaBar",{uiUpdate:!0});break;case"showSheetTabs":this.notify("sheetTabs",null);break;case"cellStyle":this.renderModule.refreshSheet();break;case"allowEditing":this.allowEditing&&this.notify(Qt,{action:"renderEditor"});break;case"allowInsert":(l=this.element.getElementsByClassName("e-add-sheet-tab")[0])&&(l.disabled=!this.allowInsert,this.allowInsert?l.classList.contains("e-disabled")&&l.classList.remove("e-disabled"):l.classList.contains("e-disabled")||l.classList.add("e-disabled"));break;case"sheets":if(r.sheets===this.sheets){this.renderModule.refreshSheet(),this.notify("refreshSheetTabs",null);break}Object.keys(r.sheets).forEach(function(e,a){var o=r.sheets[e];if(o.ranges&&Object.keys(o.ranges).length){var s,l=Object.keys(o.ranges);l.forEach(function(e,t){o.ranges[e].info||(s=t)}),l.forEach(function(r,n){o.ranges[r].dataSource&&(t.isUndefined(s)||!t.isUndefined(s)&&s===n)&&i.notify("dataSourceChanged",{sheetIdx:e,rangeIdx:r,isLastRange:l.length-1===n})})}else if(o.paneTopLeftCell&&n.sheets&&n.sheets[e]&&n.sheets[e].paneTopLeftCell){if(i.activeSheetIndex!==Number(e))return;var h=u(o.paneTopLeftCell),d=u(n.sheets[e].paneTopLeftCell);if(h[0]!=d[0]){var p=i.frozenRowCount(i.getActiveSheet()),c=h[0]>p?Ae(i.getActiveSheet(),p,h[0]-1):0;i.notify("updateScroll",{top:c})}if(h[1]!=d[1]){var f=i.frozenColCount(i.getActiveSheet()),g=h[1]>f?Ne(i.getActiveSheet(),f,h[1]-1):0;i.notify("updateScroll",{left:g})}}else 0===a&&i.renderModule.refreshSheet(),i.showSheetTabs&&o.name&&i.notify("sheetNameUpdate",{items:i.element.querySelector(".e-sheet-tabs-items").children[e],value:o.name,idx:e})});break;case"locale":this.refresh();break;case"password":this.password.length>0&&this.showSheetTabs&&(this.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled"));break;case"isProtected":if(this.isProtected){var h=this.element.getElementsByClassName("e-add-sheet-tab")[0];h&&(h.disabled=this.isProtected,this.isProtected?h.classList.contains("e-disabled")&&h.classList.add("e-disabled"):h.classList.contains("e-disabled")||h.classList.remove("e-disabled"))}}}},r.prototype.requiredModules=function(){return Oe(this)},r.prototype.appendTo=function(t){e.prototype.appendTo.call(this,t)},r.prototype.filter=function(t,r){return this.allowFiltering?(r=r||this.getActiveSheet().selectedRange,e.prototype.filter.call(this,t,r)):Promise.reject()},r.prototype.clearFilter=function(t){t?this.notify("clearFilter",{field:t}):e.prototype.clearFilter.call(this)},r.prototype.applyFilter=function(e,t){this.notify(dr,{predicates:e,range:t})},r.prototype.addCustomFunction=function(t,r){e.prototype.addCustomFunction.call(this,t,r),this.notify("refreshFormulaDatasource",null)};var n;return Ki([t.Property("")],r.prototype,"cssClass",void 0),Ki([t.Property(!0)],r.prototype,"allowScrolling",void 0),Ki([t.Property(!0)],r.prototype,"allowResizing",void 0),Ki([t.Property(!0)],r.prototype,"enableClipboard",void 0),Ki([t.Property(!0)],r.prototype,"enableContextMenu",void 0),Ki([t.Property(!0)],r.prototype,"enableKeyboardNavigation",void 0),Ki([t.Property(!0)],r.prototype,"enableKeyboardShortcut",void 0),Ki([t.Property(!0)],r.prototype,"allowUndoRedo",void 0),Ki([t.Property(!0)],r.prototype,"allowWrap",void 0),Ki([t.Complex({},Di)],r.prototype,"selectionSettings",void 0),Ki([t.Complex({},Ni)],r.prototype,"scrollSettings",void 0),Ki([t.Event()],r.prototype,"beforeCellRender",void 0),Ki([t.Event()],r.prototype,"beforeSelect",void 0),Ki([t.Event()],r.prototype,"select",void 0),Ki([t.Event()],r.prototype,"contextMenuBeforeOpen",void 0),Ki([t.Event()],r.prototype,"fileMenuBeforeOpen",void 0),Ki([t.Event()],r.prototype,"contextMenuBeforeClose",void 0),Ki([t.Event()],r.prototype,"dialogBeforeOpen",void 0),Ki([t.Event()],r.prototype,"fileMenuBeforeClose",void 0),Ki([t.Event()],r.prototype,"contextMenuItemSelect",void 0),Ki([t.Event()],r.prototype,"fileMenuItemSelect",void 0),Ki([t.Event()],r.prototype,"beforeDataBound",void 0),Ki([t.Event()],r.prototype,"dataBound",void 0),Ki([t.Event()],r.prototype,"dataSourceChanged",void 0),Ki([t.Event()],r.prototype,"cellEdit",void 0),Ki([t.Event()],r.prototype,"cellEditing",void 0),Ki([t.Event()],r.prototype,"cellSave",void 0),Ki([t.Event()],r.prototype,"beforeCellSave",void 0),Ki([t.Event()],r.prototype,"created",void 0),Ki([t.Event()],r.prototype,"beforeSort",void 0),Ki([t.Event()],r.prototype,"beforeHyperlinkCreate",void 0),Ki([t.Event()],r.prototype,"afterHyperlinkCreate",void 0),Ki([t.Event()],r.prototype,"beforeHyperlinkClick",void 0),Ki([t.Event()],r.prototype,"afterHyperlinkClick",void 0),Ki([t.Event()],r.prototype,"beforeConditionalFormat",void 0),Ki([t.Event()],r.prototype,"actionBegin",void 0),Ki([t.Event()],r.prototype,"actionComplete",void 0),Ki([t.Event()],r.prototype,"openComplete",void 0),Ki([t.Event()],r.prototype,"sortComplete",void 0),r=n=Ki([t.NotifyPropertyChanges],r)}(Nn);return $i.Inject(zn,qn,Yn,Xn,Zn,jn,Si,vi,mi,xi,bi,Ci,Zt,Ti,Ai,Kn,wi,yi),e.Workbook=Nn,e.Range=En,e.UsedRange=Rn,e.Sheet=kn,e.getSheetIndex=se,e.getSheetIndexFromId=le,e.getSheetNameFromAddress=he,e.getSheetIndexByName=de,e.updateSelectedRange=pe,e.getSelectedRange=ce,e.getSingleSelectedRange=ue,e.getSheet=fe,e.getSheetNameCount=ge,e.getMaxSheetId=me,e.initSheet=ve,e.getSheetName=Ce,e.moveSheet=be,e.duplicateSheet=xe,e.Row=Hn,e.getRow=we,e.setRow=Ie,e.isHiddenRow=Ee,e.getRowHeight=Re,e.setRowHeight=ke,e.getRowsHeight=Ae,e.Column=Pn,e.getColumn=Te,e.setColumn=Fe,e.getColumnWidth=Le,e.getColumnsWidth=Ne,e.isHiddenCol=De,e.Cell=Sn,e.getCell=J,e.setCell=Q,e.skipDefaultValue=ee,e.wrap=te,e.getData=re,e.getModel=ie,e.processIdx=ae,e.clearRange=oe,e.getRangeIndexes=c,e.getCellIndexes=u,e.getColIndex=f,e.getCellAddress=g,e.getRangeAddress=m,e.getColumnHeaderText=v,e.getIndexesFromAddress=y,e.getRangeFromAddress=C,e.getAddressFromSelectedRange=b,e.getAddressInfo=x,e.getSwapRange=S,e.isSingleCell=I,e.executeTaskAsync=E,e.WorkbookBasicModule=Zr,e.WorkbookAllModule=Jr,e.getWorkbookRequiredModules=z,e.CellStyle=tn,e.FilterCollection=rn,e.SortCollection=nn,e.DefineName=an,e.ProtectSettings=on,e.Hyperlink=sn,e.Validation=ln,e.Format=hn,e.ConditionalFormat=dn,e.LegendSettings=pn,e.DataLabelSettings=cn,e.MajorGridLines=un,e.MinorGridLines=fn,e.Axis=gn,e.Chart=mn,e.Image=vn,e.workbookDestroyed="workbookDestroyed",e.updateSheetFromDataSource=At,e.dataSourceChanged="dataSourceChanged",e.dataChanged="dataChanged",e.triggerDataChange="triggerDataChange",e.workbookOpen="workbookOpen",e.beginSave="beginSave",e.sortImport="sortImport",e.ribbonFind="ribbonFind",e.getFilteredCollection="getFilteredCollection",e.saveCompleted="saveCompleted",e.applyNumberFormatting="applyNumber",e.getFormattedCellObject="getFormattedCell",e.refreshCellElement="refreshCellElem",e.setCellFormat=Tt,e.findAllValues="findAllValues",e.textDecorationUpdate="textDecorationUpdate",e.applyCellFormat=Ft,e.updateUsedRange="updateUsedRange",e.workbookFormulaOperation=Lt,e.workbookEditOperation="workbookEditOperation",e.checkDateFormat=Nt,e.getFormattedBarText="getFormattedBarText",e.activeCellChanged="activeCellChanged",e.openSuccess="openSuccess",e.openFailure="openFailure",e.sheetCreated="sheetCreated",e.sheetsDestroyed="sheetsDestroyed",e.aggregateComputation="aggregateComputation",e.beforeSort="beforeSort",e.initiateSort=Dt,e.sortComplete="sortComplete",e.sortRangeAlert="sortRangeAlert",e.initiatelink="initiatelink",e.beforeHyperlinkCreate="beforeHyperlinkCreate",e.afterHyperlinkCreate="afterHyperlinkCreate",e.beforeHyperlinkClick="beforeHyperlinkClick",e.afterHyperlinkClick="afterHyperlinkClick",e.addHyperlink="addHyperlink",e.setLinkModel="setLinkModel",e.beforeFilter="beforeFilter",e.initiateFilter="initiateFilter",e.filterComplete="filterComplete",e.filterRangeAlert="filterRangeAlert",e.clearAllFilter="clearAllFilter",e.wrapEvent=Ot,e.onSave="onSave",e.insert="insert",e.deleteAction="delete",e.insertModel=Ht,e.deleteModel="deleteModel",e.isValidation="isValidation",e.setValidation=Bt,e.addHighlight="addHighlight",e.dataValidate="dataValidate",e.findNext="findNext",e.findPrevious="findPrevious",e.goto=Mt,e.findWorkbookHandler="findHandler",e.replaceHandler="replace",e.replaceAllHandler="replaceAll",e.showDialog=Pt,e.findUndoRedo="findUndoRedo",e.findKeyUp="findKeyUp",e.removeValidation=_t,e.removeHighlight="removeHighlight",e.queryCellInfo=Ut,e.count="count",e.findCount="findCount",e.protectSheetWorkBook="protectSheet",e.updateToggle="updateToggleItem",e.protectsheetHandler="protectsheetHandler",e.replaceAllDialog="replaceAllDialog",e.unprotectsheetHandler="unprotectsheetHandler",e.workBookeditAlert="editAlert",e.setLockCells="setLockCells",e.applyLockCells="applyLockCells",e.setMerge=Vt,e.applyMerge="applyMerge",e.mergedRange="mergedRange",e.activeCellMergedRange="activeCellMergedRange",e.insertMerge="insertMerge",e.pasteMerge="pasteMerge",e.setCFRule=zt,e.cFInitialCheck="cFInitialCheck",e.clearCFRule=qt,e.initiateClearCFRule="initiateClearCFRule",e.cFRender="cFRender",e.cFDelete=jt,e.clear="clear",e.clearCF="clearCF",e.clearCells=Wt,e.setImage="setImage",e.setChart=Gt,e.initiateChart="initiateChart",e.refreshRibbonIcons="refreshRibbonIcons",e.refreshChart="refreshChart",e.refreshChartSize=Yt,e.updateChart="updateChart",e.deleteChartColl="deleteChartColl",e.initiateChartModel="initiateChartModel",e.focusChartBorder="focusChartBorder",e.saveError="saveError",e.validationHighlight="validationHighlight",e.dataRefresh="dataRefresh",e.updateFilter="updateFilter",e.beforeInsert="beforeInsert",e.beforeDelete="beforeDelete",e.deleteHyperlink="deleteHyperlink",e.moveOrDuplicateSheet=Xt,e.cFUndo=Kt,e.checkIsFormula=q,e.isCellReference=j,e.isChar=W,e.inRange=G,e.isInRange=Y,e.isLocked=X,e.isValidCellReference=K,e.getUpdatedFormula=$,e.getDataRange=Z,e.toFraction=R,e.getGcd=k,e.intToDate=A,e.dateToInt=T,e.isDateTime=F,e.isNumber=L,e.toDate=N,e.parseIntValue=D,e.workbookLocale=yn,e.localeData=Cn,e.DataBind=Zt,e.WorkbookOpen=xr,e.WorkbookSave=Ir,e.WorkbookFormula=Br,e.WorkbookNumberFormat=$t,e.getFormatFromType=O,e.getTypeFromFormat=H,e.WorkbookSort=Mr,e.WorkbookFilter=Pr,e.WorkbookImage=_r,e.WorkbookChart=Ur,e.WorkbookCellFormat=Vr,e.WorkbookEdit=zr,e.WorkbookHyperlink=qr,e.WorkbookInsert=jr,e.WorkbookDelete=Wr,e.WorkbookDataValidation=Gr,e.WorkbookFindAndReplace=Yr,e.WorkbookProtectSheet=Xr,e.WorkbookMerge=Kr,e.WorkbookConditionalFormat=$r,e.getRequiredModules=Oe,e.ribbon="ribbon",e.formulaBar="formulaBar",e.sheetTabs="sheetTabs",e.refreshSheetTabs="refreshSheetTabs",e.isFormulaBarEdit="isFormulaBarEdit",e.initialLoad=Jt,e.contentLoaded="contentLoaded",e.mouseDown="mouseDown",e.spreadsheetDestroyed="spreadsheetDestroyed",e.editOperation=Qt,e.formulaOperation="formulaOperation",e.formulaBarOperation="formulaBarOperation",e.click=er,e.keyUp=tr,e.keyDown=rr,e.formulaKeyUp="formulaKeyUp",e.formulaBarUpdate="formulaBarUpdate",e.onVerticalScroll="verticalScroll",e.onHorizontalScroll="horizontalScroll",e.beforeContentLoaded="beforeContentLoaded",e.beforeVirtualContentLoaded="beforeVirtualContentLoaded",e.virtualContentLoaded="virtualContentLoaded",e.contextMenuOpen="contextMenuOpen",e.cellNavigate="cellNavigate",e.mouseUpAfterSelection="mouseUpAfterSelection",e.selectionComplete="selectionComplete",e.cMenuBeforeOpen=nr,e.insertSheetTab="insertSheetTab",e.removeSheetTab=ir,e.renameSheetTab="renameSheetTab",e.ribbonClick="ribboClick",e.refreshRibbon="ribbonRefresh",e.enableToolbarItems="enableToolbarItems",e.tabSwitch="tabSwitch",e.selectRange="selectRange",e.cut=ar,e.copy="copy",e.paste=or,e.clearCopy="clearCopy",e.dataBound="dataBound",e.beforeDataBound="beforeDataBound",e.addContextMenuItems="addContextMenuItems",e.removeContextMenuItems="removeContextMenuItems",e.enableContextMenuItems="enableContextMenuItems",e.enableFileMenuItems="enableFileMenuItems",e.hideFileMenuItems="hideFileMenuItems",e.addFileMenuItems="addFileMenuItems",e.hideRibbonTabs="hideRibbonTabs",e.enableRibbonTabs="enableRibbonTabs",e.addRibbonTabs="addRibbonTabs",e.addToolbarItems="addToolbarItems",e.hideToolbarItems="hideToolbarItems",e.beforeRibbonCreate="beforeRibbonCreate",e.rowHeightChanged=sr,e.colWidthChanged="colWidthChanged",e.onContentScroll="onContentScroll",e.deInitProperties="deInitProperties",e.activeSheetChanged="activeSheetChanged",e.renameSheet="renameSheet",e.initiateCustomSort="initiateCustomSort",e.applySort="applySort",e.collaborativeUpdate="collaborativeUpdate",e.hideShow=lr,e.autoFit=hr,e.updateToggleItem="updateToggleItem",e.initiateHyperlink="initiateHyperlink",e.editHyperlink="editHyperlink",e.openHyperlink="openHyperlink",e.removeHyperlink="removeHyperlink",e.createHyperlinkElement="createHyperlinkElement",e.sheetNameUpdate="sheetNameUpdate",e.hideSheet="hideSheet",e.performUndoRedo="performUndoRedo",e.updateUndoRedoCollection="updateUndoRedoCollection",e.setActionData="setActionData",e.getBeforeActionData="getBeforeActionData",e.clearUndoRedoCollection="clearUndoRedoCollection",e.initiateFilterUI=dr,e.renderFilterCell="renderFilterCell",e.reapplyFilter="reapplyFilter",e.filterByCellValue="filterByCellValue",e.clearFilter="clearFilter",e.getFilteredColumn="getFilteredColumn",e.completeAction=pr,e.beginAction=cr,e.filterCellKeyDown="filterCellKeyDown",e.getFilterRange="getFilterRange",e.setAutoFit="setAutoFit",e.refreshFormulaDatasource="refreshFormulaDatasource",e.setScrollEvent="setScrollEvent",e.initiateDataValidation="initiatedatavalidation",e.validationError="validationError",e.startEdit="startEdit",e.invalidData="invalidData",e.clearInvalid="clearInvalid",e.protectSheet="protectSheet",e.applyProtect="applyProtect",e.unprotectSheet="unprotectSheet",e.protectCellFormat="protectCellFormat",e.gotoDlg=ur,e.findDlg=fr,e.findHandler="findHandler",e.replace=gr,e.created="created",e.editAlert="editAlert",e.setUndoRedo="setUndoRedo",e.enableFormulaInput="enableFormulaInput",e.protectSelection="protectSelection",e.hiddenMerge="hiddenMerge",e.checkPrevMerge="checkPrevMerge",e.checkMerge="checkMerge",e.removeDataValidation="removeDataValidation",e.showAggregate="showAggregate",e.initiateConditionalFormat="initiateConditionalFormat",e.checkConditionalFormat="checkConditionalFormat",e.setCF="setCF",e.clearViewer=mr,e.initiateFormulaReference="initiateFormulaReference",e.initiateCur="initiateCur",e.clearCellRef="clearCellRef",e.editValue="editValue",e.addressHandle="addressHandle",e.initiateEdit="initiateEdit",e.forRefSelRender="forRefSelRender",e.blankWorkbook="blankWorkbook",e.insertImage="insertImage",e.refreshImgElem="refreshImgElem",e.refreshImgCellObj=vr,e.getRowIdxFromClientY="getRowIdxFromClientY",e.getColIdxFromClientX="getColIdxFromClientX",e.createImageElement=yr,e.deleteImage=Cr,e.deleteChart=br,e.refreshChartCellObj="refreshChartCellObj",e.refreshImagePosition="refreshImagePosition",e.updateTableWidth="updateTableWidth",e.focusBorder="focusBorder",e.clearChartBorder="clearChartBorder",e.insertChart="insertChart",e.chartRangeSelection="chartRangeSelection",e.insertDesignChart="insertDesignChart",e.removeDesignChart="removeDesignChart",e.chartDesignTab="chartDesignTab",e.addChartEle="addChartEle",e.isReact="isReact",e.renderReactTemplates="renderReactTemplates",e.clearTemplate="clearTemplate",e.protectWorkbook="protectWorkbook",e.unProtectWorkbook="unProtectWorkbook",e.getPassWord="getPassWord",e.importProtectWorkbook="importProtectWorkbook",e.selectionStatus="selectionStatus",e.freeze="freeze",e.overlayEleSize="overlayEleSize",e.updateScroll="updateScroll",e.getUpdateUsingRaf=Be,e.removeAllChildren=Me,e.getColGroupWidth=Pe,e.getScrollBarWidth=_e,e.getSiblingsHeight=Ue,e.inView=ze,e.getCellPosition=qe,e.setPosition=je,e.removeRangeEle=We,e.locateElem=Ge,e.setStyleAttribute=Ye,e.getStartEvent=Xe,e.getMoveEvent=Ke,e.getEndEvent=$e,e.isTouchStart=Ze,e.isTouchMove=Je,e.isTouchEnd=Qe,e.isMouseDown=et,e.isMouseMove=tt,e.isMouseUp=rt,e.getClientX=nt,e.getClientY=it,e.getDPRValue=at,e.setAriaOptions=ot,e.destroyComponent=st,e.setResize=lt,e.setWidthAndHeight=ht,e.findMaxValue=dt,e.updateAction=pt,e.hasTemplate=ct,e.setRowEleHeight=ut,e.getTextHeight=ft,e.getTextWidth=mt,e.getLines=vt,e.getBorderHeight=Ct,e.getExcludedColumnWidth=bt,e.getTextHeightWithBorder=xt,e.setMaxHgt=St,e.getMaxHgt=wt,e.skipHiddenIdx=It,e.focus=Et,e.isLockedCells=Rt,e.BasicModule=Ai,e.AllModule=Ti,e.ScrollSettings=Ni,e.SelectionSettings=Di,e.DISABLED="e-disabled",e.WRAPTEXT=Oi,e.locale=Hi,e.dialog=Bi,e.actionEvents="actionEvents",e.overlay=Mi,e.fontColor=Pi,e.fillColor=_i,e.defaultLocale=Ui,e.Spreadsheet=$i,e.Clipboard=zn,e.Edit=qn,e.Selection=jn,e.Scroll=Wn,e.VirtualScroll=Gn,e.KeyboardNavigation=Yn,e.KeyboardShortcut=Xn,e.CellFormat=Kn,e.Resize=$n,e.CollaborativeEditing=Zn,e.ShowHide=Jn,e.SpreadsheetHyperlink=Qn,e.UndoRedo=ei,e.WrapText=ti,e.Insert=ri,e.Delete=ni,e.DataValidation=ii,e.ProtectSheet=ai,e.FindAndReplace=oi,e.Merge=si,e.ConditionalFormatting=li,e.Ribbon=mi,e.FormulaBar=vi,e.Formula=yi,e.SheetTabs=Ci,e.Open=bi,e.Save=xi,e.ContextMenu=Si,e.NumberFormat=wi,e.Sort=Ii,e.Filter=Ei,e.SpreadsheetImage=Ri,e.SpreadsheetChart=ki,e.Render=ji,e.SheetRender=Vi,e.RowRenderer=zi,e.CellRenderer=qi,e.Calculate=Lr,e.FormulaError=Nr,e.FormulaInfo=Dr,e.CalcSheetFamilyItem=Or,e.getAlphalabel=V,e.ValueChangedArgs=Hr,e.Parser=Ar,e.CalculateCommon=Er,e.isUndefined=B,e.getSkeletonVal=M,e.getModules=P,e.getValue=_,e.setValue=U,e.ModuleLoader=Rr,e.BasicFormulas=kr,e}({},ej.base,ej.data,ej.navigations,ej.inputs,ej.buttons,ej.dropdowns,ej.lists,ej.splitbuttons,ej.popups,ej.grids,ej.charts),this.ejs=ej;
|