@refinitiv-ui/efx-grid 6.0.128 → 6.0.129

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Grid",(function(){return Sn}));let o={create:function(t,e){let n=document.createElement(t);return e&&(n.className=e),n},div:function(t){return o.create("div",t)},text:function(t,e){let n=o.create("span",e);return(t||0===t)&&(n.textContent=t),n},appendChild:function(t,e){if(!t)return null;let n,i;Array.isArray(arguments[1])?(i=arguments[1],n=0):(i=arguments,n=1);let o=i.length;for(;n<o;)t.appendChild(i[n]),++n;return t},buildTree:function(t,e){if(!t)return null;let n=arguments,i=n.length;for(let e=1;e<i;++e){let i=n[e];if(i){let e;Array.isArray(i)?e=o.buildTree.apply(null,i):1===i.nodeType&&(e=i),e&&t.appendChild(e)}}return t},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):o.removeParent(t):null},removeChildren:function(t,e){if(t){let n=t.childNodes.length;for((null==e||e>n)&&(e=n);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){let n=e.nodeType;1===n||3===n?e!==t.lastChild&&(o.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(o.removeChildren(t),o.appendChild(t,e)):t.textContent=e}else o.removeChildren(t)},toggleAttribute:function(t,e,n){n?t.setAttribute(e,"string"==typeof n?n:""):null==n?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,n){n?t.classList.add(e):null==n?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.add(i)}}},removeClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.remove(i)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let n=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},getRelativePosition:function(t,e,n){n=o.getClientPosition(t,n);let i=o.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},closestElement:function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},closestTagName:function(t,e){let n=t;for(;n;){if(n.tagName&&n.tagName==e)return n;n=n.parentNode||n.host}return null}};let r=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};r.prototype._data,r.prototype._func=null,r.prototype._delay=0,r.prototype._timerId=0,r.prototype._conflated=!1,r.prototype._disabled=!1,r.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},r.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},r.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},r.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},r.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},r.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},r.prototype.getData=function(){return this._data},r.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},r.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},r.prototype.getConflatingTime=function(){return this._delay},r.prototype.disable=function(t){this._disabled=!1!==t},r.prototype.isEnabled=function(){return!this._disabled},r.prototype.enable=function(t){this._disabled=!1===t};let s={inherits:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(t,n,i){n||(n="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[n].apply(t,r)}}};var l=s;let a=function(){};a.prototype._events=null,a.prototype._listenerCount=0,a.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let n=this._events[t];n?n.indexOf(e)<0&&(n.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},a.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(n){let t=n.indexOf(e);t>=0&&(n.splice(t,1),--this._listenerCount)}},a.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},a.prototype.hasListener=function(t){if(this._listenerCount){if(t){let e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},a.prototype.getListener=function(t,e){if(t){let n=this._events?this._events[t]:null;if(n)return e||(e=0),n[e]||null}return null},a.prototype.addListener=function(t,e){let n=t?t[e]:null;"function"==typeof n&&this.addEventListener(e,n)},a.prototype._prepareEventArguments=function(t,e){return e},a.prototype._dispatch=function(t,e){let n=this._events?this._events[t]:null;if(n){e=this._prepareEventArguments(t,e);let i=n.length;for(let t=0;t<i;++t)n[t](e)}};a.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var u=a;let h=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);let n=t.charAt(0),i=t.length>1?t.charAt(t.length-1):"";if('"'===n&&'"'===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===n&&"'"===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===n&&")"===i)return void this._resolveVariableGroup(t);if("["===n&&"]"===i)return void this._resolveArray(t);if(t.match(/TR\.\w+\(/))return void(this._type="dynamic");let o=t.match(/[\w._]+\(/g);if(o&&1===o.length)return void this._resolveFunction(t,o[0]);let r=t.match(/[\w._♦]+/g);if(r&&r.length>1)return void this._resolveVariableGroup(t);if("♦"===n)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};h.prototype._input="",h.prototype._index=-1,h.prototype._type="",h.prototype._subVars=null,h.prototype._funcName="",h.prototype._value,h.prototype._valueWithTokenField="",h.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},h.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},h.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},h.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},h.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let n=0;n<t;++n)e[n]=this._subVars[n].getInputWithTokenField();return e.join(", ")},h.prototype.toString=h.prototype.getExpression,h.prototype.getValue=function(){return this._value},h.prototype.getInput=function(){return this._input},h.prototype.getIndex=function(){return this._index},h.prototype.setIndex=function(t){this._index=t},h.prototype.getFunctionName=function(){return this._funcName},h.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let n=0;n<e;++n)this._subVars[n].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},h.prototype._resolveVariableGroup=function(t){let e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);let e=new h(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},h.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new h(e[t],t)}},h.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new h(e[t],t)}};var p=h;let d=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};l.inherits(d,u),d._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},d.prototype._input="",d.prototype._expression="",d.prototype._alias="",d.prototype._main=null,d.prototype.__F=null,d.prototype._fnTokens=null,d.prototype._fields=null,d.prototype._fieldMap=null,d.prototype._reference="",d.prototype._context=null,d.prototype._rtService=null,d.prototype._intervalServices=null,d.prototype._dataCache=null,d.prototype._dataLastError="",d.prototype._inputWithTokenField="",d.prototype._formulaCount=0,d._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},d.prototype.dispose=function(){this._rtService&&(this._rtService.dispose(),this._rtService=null);for(let t in this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},d.prototype.calculate=function(t){if(this._main){this._dataLastError="";let e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},d.prototype.getFunction=function(){return this._main},d.prototype.getFieldNames=function(){return this._fields},d.prototype._setReference=function(t){this._reference=t},d.prototype.getReference=function(){return this._reference},d.prototype.getExpression=function(){return this._expression},d.prototype.toString=d.prototype.getReference,d.prototype.getInput=function(){return this._input},d.prototype.getAlias=function(){return this._alias||this._input},d.prototype.setAlias=function(t){this._alias=t},d.prototype.addFormulaCount=function(){this._formulaCount++},d.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},d.prototype.updateContext=function(){if(!this._context)return;let t=this._fnTokens.length;for(let e=0;e<t;++e){let t=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[t]||d._emptyFunction,d._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},d.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},d._emptyFunction=function(){},d.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let n=t.match(/([^=]=+)/g)||[];for(let t=n.length;--t>=0;){let i=n[t],o=i.substring(i.length-2);if(d._invalidOps[o]){e=!0;break}}}return e},d.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],n=[];return t=(t=(t=d.tokenizeQuotes(t,e,n)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,d._encloseWithTR),t=d.resolveTokens(t,e,n)},d._encloseWithTR=function(t){return'TR("'+t+'")'},d.tokenizeQuotes=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,i=e.length,e.push(new p(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},d.tokenizeAdcWithParams=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,i=e.length,e.push(new p(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},d.replaceUnwantedCharacters=function(t,e,n){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},d.prototype._tokenizeParentheses=function(t,e,n){e||(e=[]),n||(n=[]);let i={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,n){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=i[t];return null==r&&(r=e.length,e.push(new p(t,r)),i[t]=r),o.push(r),"♦"+r+"♦"})),n.push(o)}return t},d.prototype._tokenizeConstants=function(t,e,n){e||(e=[]),n||(n=[]);let i=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let n=e.length;return e.push(new p(t,n)),i.push(n),"♦"+n+"♦"})),n.push(i),t},d.resolveTokens=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getExpression()}))}}return t},d._getInputWithTokenField=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},d.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;let e=[],n=[];t=d.tokenizeQuotes(t,e,n),t=d.tokenizeAdcWithParams(t,e,n),t=d.replaceUnwantedCharacters(t,e,n),t=this._tokenizeParentheses(t,e,n),t=this._tokenizeConstants(t,e,n),this._inputWithTokenField=d._getInputWithTokenField(t,e,n),t=d.resolveTokens(t,e,n);let i={},o=e.length;for(let n=0;n<o;++n){let o=e[n];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+n+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(i)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=i,this._fields=Object.keys(i),this._main):null},d.prototype._createFunction=function(t){let e=null;try{e=new Function("__R","return "+t+";"),e=e.bind(this),e({})}catch(t){e=null}return e},d.prototype.__D=function(t,e){return e[t]},d.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},d.prototype.changeField=function(t,e){let n=this._fields.indexOf(t);if(n<0)return!1;this._fields.splice(n,1),this._fields.indexOf(e)<0&&this._fields.push(e);let i=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},d.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let n=this._input;for(let n=t.length;--n>=0;){let i=t[n],o=e[n],r=this._fields.indexOf(i);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+i+"♥",l="♠"+o+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===s?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+i+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},d.prototype.getRealtimeService=function(){return this._rtService},d.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},d.prototype.getIntervalService=function(t){return this._intervalServices[t]},d.prototype.setIntervalService=function(t,e){if(!e)return;let n=this._intervalServices[t];n&&n.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},d.prototype.getCachedData=function(t){return this._dataCache[t]},d.prototype.setCachedData=function(t,e){this._dataCache[t]=e},d.prototype.setDataError=function(t){this._dataLastError=t},d.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},d.prototype._onDataCacheChanged=function(t){let e=t.ric,n=t.values,i=this._dataCache[e];if(i)for(let t in n)i[t]=n[t];else this._dataCache[e]=n;this._dispatch("dataCacheChanged",{})},d._proto=d.prototype;var c=d;var _={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}};let f={};const g=/\d+/g;let y=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(g);if(!e||e.length<3)return t;let n="#";for(let t=0;t<3;t++){let i=+e[t];i>=16||(n+="0"),n+=i?i.toString(16).toUpperCase():"0"}return n},m=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},C=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},S=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},w=function(t){if(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},b=function(t){if(!t||t<0)return 0;if(t>=255)return 1;let e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},R=function(t){return.2126*b(t[0])+.7152*b(t[1])+.0722*b(t[2])},v=function(t,e){if(t===e)return 1;let n=t,i=e;return t>e&&(i=t,n=e),(i+.05)/(n+.05)},I=function(t){let e=R(t),n=v(1,e);return v(0,e)>=n?"#000000":"#ffffff"},D=function(t,e,n){n>1?n=1:n<0&&(n=0);let i=S(t),o=S(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-i[t])*n;r.push(i[t]+e)}return r};f.rgb2Hex=y,f.num2Hex=m,f.num2Rgb=C,f.hex2Num=S,f.hex2Rgb=w,f.getColorLuminance=b,f.getRelativeLuminance=R,f.getContrastRatio=v,f.getContrastColor=I,f.blendColor=D;let x=function(t,e,n){if(!t)return null;if(!e||t===e)return t;let i;if(n){let o=n.length;for(let r=0;r<o;++r)i=n[r],i&&E(t,e,i)}else for(i in e)E(t,e,i);return t},A=function(t,e){return x({},t,e)},L=function(t){for(let e in t)return!1;return!0},T=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let n=t;t={};let i=n.length;for(let o=0;o<i;++o){let i=e[o];i&&void 0!==n[o]&&(t[i]=n[o])}return t},E=function(t,e,n){let i=e[n];if(null!=i){let e=t[n];Array.isArray(e)?t[n]=e.concat(i):Array.isArray(i)&&e?t[n]=i.concat(e):t[n]=i}},M=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!M(t[n],e[n]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let n in t)if(!M(t[n],e[n]))return!1}return!0}return!1},F=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},P=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},z=function(t,e){if(!t)return null;let n=document.createElement("style");n.textContent="\n"+t+"\n";let i,o=function(t){if(t){let e;if(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t)return e}return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(i=o.children[0]),i?o.insertBefore(n,i):o.appendChild(n),n},V=function(t,e){e||(e=[]);for(let n in t){let i=t[n];"object"==typeof i?V(i,e):e.push(i)}return e};let k=function(t,e,n){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=n&&(this._ctx=n),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};k.prototype.promise=null,k.prototype._resolve=null,k.prototype._reject=null,k.prototype._resolveHandler=null,k.prototype._rejectHandler=null,k.prototype._ctx=null,k.prototype._fulfilled=!1,k.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){let e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},k.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){let e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},k.prototype.isFulfilled=function(){return this._fulfilled},k.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let N={},O=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},H=function(t,e,n){"attributes"===n.type&&(null!=e?n.attributeName===e&&t(n.target.getAttribute(e)):t(n.target))};N._getNewId=function(){return"observer_"+ ++N._id},N._addObserver=function(t,e,n){let i=n;i||(i={}),i.attributes=!0,N._observer.observe(t,i),N._addListener(t,e)},N._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let n=t[e],i=N._listeners[n.target._observeId];for(let t=0;t<i.length;t++)i[t](n)}},N._addListener=function(t,e){let n=N._listeners;if(n||(n=N._listeners={}),!t._observeId){let e=N._getNewId();t._observeId=e}n[t._observeId]||(n[t._observeId]=[]);let i=n[t._observeId];i.indexOf(e)<0&&i.push(e)},N.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",N._addObserver(document.documentElement,O.bind(null,t)))},N.addAttributeListener=function(t,e,n){t&&e&&N._addObserver(t,H.bind(null,e,n))},N._observer=new MutationObserver(N._onMutationCallback),N._listeners={},N._id=0;let B={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},G={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};G.themeColors=G._defaultColors,G._components={},G._themeName="",G._elfVersion=0,G._dummyIcon=null,G._iconLoaded=!1,G._profileName=null,G._callbacks=[],G._observed=!1,G._pendingResolve=!1,G._themeLoaded=!1,G._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},G._icons["halo-theme"]=G._icons["elf-theme-halo"],G._icons["solar-theme"]=G._icons["elf-theme-solar"],G.getElfVersion=function(){if(!G._elfVersion){let t=0;if(window.EFX_GRID){let e=window.EFX_GRID.version;e=e.split("."),t=+e[0]}else if(window.elf)if(window.elf.version){let e=window.elf.version.match(/\d/);e&&e[0]&&(t=parseInt(e[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);G._elfVersion=t}return G._elfVersion},G.hasComponent=function(t){let e=G._components[t];if(null==e){e=0;let n=G.getElfVersion();if(t){let i;1===n?(i=document.createElement(t),i.is===t&&(e=n)):n>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=n),G._components[t]=e}}return e},G.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return B[e]?e:""},G.hasTheme=function(t){return t===G.getThemeName()},G.getThemeName=function(t){return G._themeName||(G._themeName=G.getCssVariable("--theme-name",document.documentElement)),G._themeName},G.setThemeName=function(t){G._themeName=t},G.isThemeLoaded=function(){return G._themeLoaded},G.getColors=function(){return G.themeColors},G.isHaloTheme=function(t){return null==t&&(t=G.getThemeName()),!!t&&t.indexOf("halo")>=0},G.injectIcons=function(t,e){if("object"!=typeof t)return;let n=G.getThemeName();t.themeName=n;let i=G.getElfVersion();t.elfVersion=i;let o=G._icons[n];o&&(t.icons=o)},G.getIconList=function(){let t=G._icons[G.getThemeName()];return t?V(t):[]},G._onIconPreloaded=function(){if(G._dummyIcon){let t=G._dummyIcon.parentNode;t&&t.removeChild(G._dummyIcon),G._dummyIcon=null}},G.prepareIconPreloading=function(){if(!G._iconLoaded){G._iconLoaded=!0;let t=G.getIconList();if(t.length){setTimeout(G._onIconPreloaded,10);let e=G._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},G.getCssVariable=function(t,e){let n="",i=e||document.body;return window&&"string"==typeof t&&1===i.nodeType&&t.match(/^--/)&&(n=window.getComputedStyle(i).getPropertyValue(t),n=n.replace(/[\"\']/g,"")),n},G.getCssVariables=function(t,e){let n=e||document.body;if(window&&1===n.nodeType){let e=window.getComputedStyle(n);for(let n in t){let i=t[n];i&&i.match(/^--/)&&(t[n]=e.getPropertyValue(i).replace(/\"/g,""))}}return t||null},G.setRTK=function(t){null!=t&&(G._rtk=t)},G.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},G._addThemeChangedCallback=function(t){let e=G._callbacks;e.indexOf(t)<0&&e.push(t)},G.reloadThemeColors=function(){return G._deferred&&G._deferred.isFulfilled()?(G._profileName="",G._themeLoaded=!1,G.themeReady=null,G.getThemeColors()):G.themeReady},G.getThemeColors=function(t){if("function"==typeof t&&G._addThemeChangedCallback(t),G.themeReady)return G.themeReady;let e=G._deferred=new k;G.themeReady=e.promise;let n=G.getMovementColorProfile();if(n)n!==G._profileName?setTimeout(G._profileNameRetrieved,100):G._deferred.resolve(G.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(G._themeLoaded=!1,G._rtk&&G._rtk.Settings)G._rtk.Settings.getAsync(t).then(G._loadingProfileSuccess).catch(G._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(G._loadingProfileSuccess,t)}catch(t){G._loadingProfileFailure()}else setTimeout(G._profileNameRetrieved,100)}return e.promise};let W=function(t){if(t!==G._profileName){G._retrieveThemeColors(t),G._pendingResolve&&(G._pendingResolve=!1,G._deferred.resolve(G.themeColors));let e=G._callbacks;for(let t=0;t<e.length;t++)e[t]()}};G._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),G._observed?G._pendingResolve=!0:G._profileNameRetrieved(t)},G._loadingProfileFailure=function(){G._retrieveThemeColors(),G._observed||(G._observed=!0,N.addAttributeListener(document.documentElement,W,"movement-color-profile")),G._deferred.reject("Failed to get movement color profile from settings.")},G._profileNameRetrieved=function(){let t=G.getMovementColorProfile();G._retrieveThemeColors(t),G._observed||(G._observed=!0,N.addAttributeListener(document.documentElement,W,"movement-color-profile")),G._deferred.resolve(G.themeColors)},G._retrieveThemeColors=function(t){G._themeLoaded=!0,G._profileName=t;let e=G.themeColors=G.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=G._defaultColors.up,e.down=G._defaultColors.down,e.level=G._defaultColors.level,e.tickUp=G._defaultColors.tickUp,e.tickDown=G._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let n=document.createElement("table");n.style.visibility="hidden",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.width="0";let i=n.insertRow(-1),o=i.insertCell(-1);document.body.appendChild(n);let r=window.getComputedStyle(i);e.tableBg=r.backgroundColor;let s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=G._defaultColors.baseGrid,e.tableText=G._defaultColors.baseText,e.tableBorder="")),e.tableBg=y(e.tableBg),e.tableText=y(e.tableText),e.tableBorder=y(e.tableBorder),document.body.removeChild(n),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||G._defaultColors.trackColor};var U=G;new Date(NaN);const Y=Date.UTC(1900,0,1),X=Date.UTC(1900,2,1),q=["sun","mon","tue","wed","thu","fri","sat"],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],K=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],J=["January","February","March","April","May","June","July","August","September","October","November","December"];let Q=function(t){return t>9?""+t:"0"+t},Z={D:function(t,e){return""+t.getDate()},DD:function(t,e){return Q(t.getDate())},DDD:function(t,e){return e[q[t.getDay()]]},D_:function(t,e){return e[j[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return Q(t.getMonth()+1)},MMM:function(t,e){return e[K[t.getMonth()]]},M_:function(t,e){return e[J[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).slice(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return Q(t.getHours())},h:function(t,e){let n=t.getHours()%12;return 0===n?"12":""+n},h_:function(t,e){let n=t.getHours()%12;return n=0===n?12:n,Q(n)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return Q(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return Q(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return Q(~~(t.getMilliseconds()/10))},S_:function(t,e){return(n=t.getMilliseconds())>99?""+n:n>9?"0"+n:"00"+n;var n},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},$={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){$._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=U.toLangString(t);$._localeSetting=_[e]?e:"en"},format:function(t,e,n){let i=null,o="",r=!(!n||"LOCAL"!==n.toUpperCase());if("number"==typeof t)t>1e8?i=new Date(t):(i=$.fromDateNumber(t),r=!0);else if(t instanceof Date)i=new Date(t);else{o=t+"";let e=o.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),e&&(o=o.replace(/T/g," ")),i=new Date(o)}return $.isInvalidDate(i)?t||"":(r||i.setTime(i.getTime()+6e4*i.getTimezoneOffset()),$.formatDateObject(i,e))},formatDateObject:function(t,e){if($.isInvalidDate(t))return"";e||(e=$._dateTimePattern),$._activeInput=t,$._activeLocaleMap=_[$._localeSetting]||DateTimeLocale.en;let n=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,$._parseDatePattern);return $._activeInput=null,n},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let n=Z[t];if(!n){let i=t;$._lowerCaseDatePatterns[e]&&(i=t.toUpperCase(),e=e.toUpperCase(),n=Z[i]),n||(i=e+"_",n=Z[i])}return n?n($._activeInput,$._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){let e=$.dateNumberToMs(t);if(e==e){let n=$.timeNumberToMs(t);return new Date(e+n)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;let e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);let e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){let e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):$.fromDateNumber(t);else if(t){let n=t+"",i=n.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);n=n.replace(/\-/g,"/"),i&&(n=n.replace(/T/g," ")),e=new Date(n)}else e=new Date(NaN);return e},toDateNumber:function(t){return $._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<Y)return NaN;{let e=t/864e5+25569;return t<X&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};var tt=$;let et={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(let e in t)return 0;return 1}}else if(""===t)return 1;return 0}};var nt=et;let it={AND:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,n){return t?e:n},NOT:function(t){return t?0:1},OR:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}};var ot=it;let rt={};rt.ABS=Math.abs,rt.ACOS=Math.acos,rt.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},rt.ASIN=Math.asin,rt.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},rt.ATAN=Math.atan,rt.ATAN2=function(t,e){return Math.atan2(e,t)},rt.ATANH=function(t){return Math.log((1+t)/(1-t))/2},rt.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},rt.CEIL=rt.CEILING,rt.COMBIN=function(t,e){let n=rt.FACT;return n(t)/(n(e)*n(t-e))},rt.COS=Math.cos,rt.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},rt.DEGREES=function(t){return t/(Math.PI/180)},rt.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},rt.EXP=Math.exp,rt.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},rt.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},rt.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},rt.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let n=t;t=e,e=n}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},rt.INT=Math.floor,rt.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,n=Math.abs(t[0]);for(let i=1;i<e;i++){let e=Math.abs(t[i]),o=n;for(;n&&e;)n>e?n%=e:e%=n;n=Math.abs(o*t[i])/(n+e)}return n},rt.LN=Math.log,rt.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},rt.LOG10=function(t){return Math.log(t)/Math.LN10},rt.MOD=function(t,e){return t%e},rt.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},rt.POWER=Math.pow,rt.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let n=t.length;--n>=1;)e*=t[n];return e},rt.PROD=rt.PRODUCT,rt.QUOTIENT=function(t,e){return Math.floor(t/e)},rt.RADIANS=function(t){return t*(Math.PI/180)},rt.RAND=Math.random,rt.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},rt.ROUND=function(t,e){if(!e)return Math.round(t);let n=Math.pow(10,e);return Math.round(t*n)/n},rt.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n},rt.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let n=Math.pow(10,e);return Math.ceil(t*n)/n},rt.SERIESSUM=function(t,e,n,i){let o=0;for(let r=i.length;--r>=0;)o+=i[r]*Math.pow(t,e+r*n);return o},rt.SIGN=function(t){return t>0?1:t<0?-1:0},rt.SIN=Math.sin,rt.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},rt.SQRT=Math.sqrt,rt.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},rt.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;)e+=t[n];return e},rt.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,n=e.length;if(0===n)return 0;let i=[];for(t=0;t<n;++t)i[t]=1;for(t=0;t<n;++t)i[t]*=e[t];let o=0;for(t=0;t<n;++t)o+=i[t];return o},rt.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];e+=i*i}return e},rt.TAN=Math.tan,rt.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;let e=Math.exp(2*t);return(e-1)/(e+1)},rt.TRUNC=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n};var st=rt;let lt={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let n=0;for(let i=e;--i>=0;)n+=t[i];return n/e}};lt.AVG=lt.AVERAGE,lt.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];null!=i&&i==i&&++e}return e},lt.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]>e&&(e=t[n]);return e},lt.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]<e&&(e=t[n]);return e},lt.STDEV=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let n=lt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/(e-1))},lt.STDEVP=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let n=lt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/e)};var at=lt;let ut={},ht=function(t){return t||0===t?t+"":""};ut.EXACT=function(t,e){return(t+="")===(e+="")?1:0},ut.FIND=function(t,e,n){if(!(t=ht(t)))return 0;if(!(e=ht(e)))return 0;return(!(n=+n)||n<0)&&(n=0),e.indexOf(t,n)},ut.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),ht(t).substr(0,e)},ut.LENGTH=function(t){return ht(t).length},ut.LEN=ut.LENGTH,ut.LOWER=function(t){return ht(t).toLowerCase()},ut.MID=function(t,e,n){return ht(t).substr(e,n)},ut.REPLACE=function(t,e,n,i){i+="";let o=(t=ht(t)).split("");return o.splice(n,e,i),o.join("")},ut.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let n=(t=ht(t)).length-e;return t.substr(n,e)},ut.TRIM=function(t){return ht(t).trim()},ut.UPPER=function(t){return ht(t).toUpperCase()},ut.VALUE=function(t){return+t},ut.CHAR=function(t){let e=+t;return String.fromCharCode(e)},ut.CLEAN=function(t){let e=ht(t).split("");for(let t=e.length;--t>=0;){let n=e[t].charCodeAt(0);(n<32||n>127)&&(e[t]="")}return e.join("")},ut.CODE=function(t){return ht(t).charCodeAt(0)},ut.PROPER=function(t){let e=(t=ht(t)).split(/[\W_]/g),n=t.match(/[\W_]/g),i=e.length,o="";for(let t=0;t<i;t++){let i=e[t],r=i.length;1===r?o+=i.toUpperCase():0!==r&&(o+=i.charAt(0).toUpperCase()+i.substr(1).toLowerCase());let s=n[t];s&&(o+=s)}return o},ut.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=ht(t)))return"";let n=t;for(let i=1;i<e;i++)n+=t;return n},ut.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var pt=ut;let dt=function(){this._context={},dt._addContext(this._context,dt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};l.inherits(dt,u),dt.prototype._context=null,dt.prototype._rowData=null,dt.prototype._setData=null,dt.prototype._formulas=null,dt.prototype._formulaMap=null,dt.prototype._referenceMap=null,dt._context=null,dt.getContext=function(){let t=dt._context;return t||(t={},dt._context=t,dt._addContext(t,tt),dt._addContext(t,nt),dt._addContext(t,ot),dt._addContext(t,st),dt._addContext(t,at),dt._addContext(t,pt)),t},dt.addContext=function(t){let e=dt.getContext();dt._addContext(e,t)},dt._addContext=function(t,e){for(let n in e)t[n]=e[n]},dt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},dt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},dt.prototype._defaultFormulaDataSetter=function(t,e,n,i){if("..."!==e){let o=t.getAlias();n[o]=e,i&&(i[o]=e)}},dt.prototype.addFormula=function(t){let e;return t instanceof c?e=t:(this._rowData={},e=new c(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},dt.prototype.mockFormula=function(t){let e;return e=new c(t instanceof c?t.getInput():t,this._context),e},dt.prototype.removeFormula=function(t){let e;if(t instanceof c&&(t=this._formulas.indexOf(t)),"number"==typeof t)e=this._formulas[t],e&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t],e)){let n=this._formulas.indexOf(e);n>=0&&(this._formulas.splice(n,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},dt.prototype.removeAllFormulas=function(){let t=this._formulas;for(let e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},dt.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},dt.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let n=0;n<e;++n){let e=this._formulas[n];if(e.getInput()===t)return e}return null},dt.prototype.getAllFormulas=function(){return this._formulas},dt.prototype.getAllFormulaReferences=function(){return this._referenceMap},dt.prototype.getFormulaCount=function(){return this._formulas.length},dt.prototype._generateUniqueReference=function(t){let e=t,n=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++n;return e},dt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let n="";if(t instanceof c){if(!this._setFormulaReference(t,e))return"";n=t.getAlias()}else n=t;return this._referenceMap[e]=n,e},dt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let n=this._formulaMap[t];if(n&&!this.isValidReference(n,e))return!1;for(let n=this._formulas.length;--n>=0;){let i=this._formulas[n];if(i.changeField(t,e)){let t=i.getReference();t&&(this._referenceMap[t]=i.getAlias())}}return n&&this._setFormulaReference(n,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},dt.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;let e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},dt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},dt.prototype._getData=function(t,e){if(!this._rowData)return null;let n=this._rowData[this.resolveReference(t)];if(n){let t=Number(n);t==t&&(n=t)}return n},dt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let n=t.getReference();if(n===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let i=this._sortDependencies(this._formulas,this._formulaMap);return i?(this._formulas=i,delete this._formulaMap[n],!0):(t._setReference(n),delete this._formulaMap[e],!1)},dt.prototype.calculate=function(t,e){this._rowData=t;let n=this._formulas.length;for(let i=0;i<n;++i){let n=this._formulas[i];if(e){let t=null!=e[n.getAlias()];if(!t){let i=n.getFieldNames();for(let n=i.length;--n>=0;)if(null!=e[this.resolveReference(i[n])]){t=!0;break}if(!t)continue}}let o=n.calculate(t);this._setData(n,o,t,e)}this._rowData=null},dt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let n=t.getReference(),i=this._createParentChildrenMap(this._formulas);if(n){delete i[n];for(let t in i){let o=i[t],r=o.indexOf(n);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),i[t]=o)}}return i[e]=t.getFieldNames(),!!this._sortParentChildrenMap(i)},dt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let n=this._createParentChildrenMap(t),i=this._sortParentChildrenMap(n);if(!i)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=i.length;--t>=0;){let n=e[i[t]];n&&r.push(n)}o.length>0&&(r=r.concat(o))}return r},dt.prototype._createParentChildrenMap=function(t){let e,n={};for(e=t.length;--e>=0;){let i=t[e],o=i.getReference();o&&(n[o]=i.getFieldNames())}return n},dt.prototype._sortParentChildrenMap=function(t){let e,n,i,o,r,s={};for(r in t){i=t[r],o=i.length;for(let t=0;t<o;++t)n=i[t],s[n]=s[n]+1||1}let l=[];for(r in t)s[r]||l.push(r);let a=[];for(;l.length>0;)for(r=l.shift(),a.push(r),i=t[r],o=i?i.length:0,e=0;e<o;++e)n=i[e],--s[n]>0||l.push(n);for(n in s)if(s[n])return null;return a},dt._proto=dt.prototype;let ct={};ct.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),ct.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),ct.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),ct.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ct.getElement=function(t){return ct.isElement(t)?t:t&&ct.isFunction(t.getElement)?t.getElement():null},ct.isElement=function(t){return!!t&&1===t.nodeType},ct.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||ct.isArray(t)&&0===t.length},ct.isNumber=function(t){return"number"==typeof t&&isFinite(t)},ct.isString=function(t){return"string"==typeof t},ct.isArray=Array.isArray,ct.isFunction=function(t){return"function"==typeof t},ct.getClientPosition=function(t,e){let n=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},ct.getRelativePosition=function(t,e,n){n=ct.getClientPosition(t,n);let i=ct.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},ct.moveArrayItem=function(t,e,n){if(!t)return null;let i=t.length;if(e>=i&&n>=i)return t;let o=t.splice(e,1)[0];return n<i?t.splice(n,0,o):t[n]=o,t},ct.pushArrayItems=function(t,e){let n=e?e.length:0;if(n>0)if(n<1e5)n>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let i=0,o=0;for(;i<n;)o+=1e5,Array.prototype.push.apply(t,e.slice(i,o)),i=o}return t},ct.insertEmptyItems=function(t,e,n){if(n>0)if(n>1){let i=t.slice(e);t.length=e,t.length+=n,ct.pushArrayItems(t,i)}else t.splice(e,0,null)},ct.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let n=t.splice(0,e);return t.concat(n)}return t||null},ct.lowerBound=function(t,e,n,i,o){(null==n||n<0)&&(n=0),(null==i||i<0||i>t.length)&&(i=t.length),n>i&&(n=i),null==o&&(o=ct._defaultLessComparator);let r=0;for(;i>n;)r=n+i>>1,o(t[r],e)?n=r+1:i=r;return n},ct.upperBound=function(t,e,n,i,o){let r=ct.lowerBound(t,e,n,i,o);for(;t[r]===e;)++r;return r},ct.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,n){return null!=e[n]?e[n]:t}))},ct._defaultLessComparator=function(t,e){return t<e},ct._deprecatedFunction=function(){console.warn("Calling deprecated method")},ct.calculatePercent=function(t,e,n){if(!t&&0!==t||!e&&0!==e||!n&&0!==n)return NaN;if(n===t)return 50;let i=(e-t)/(n-t);return i<0?0:i>1?100:100*i},ct.closestElement=function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},ct._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var _t=ct;let ft=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ft.prototype.listen=function(t,e){if(t&&_t.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let n=_t.lowerBound(this._listeners,t,0,this._listeners.length,ft.listenerComparer);this._listeners.splice(n,0,t)}},ft.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ft.prototype.unlistenAll=function(){this._listeners.length=0},ft.prototype.getListenerCount=function(){return this._listeners.length},ft.prototype.hasListener=function(){return this._listeners.length>0},ft.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ft.prototype.isDispatching=function(){return this._dispatching},ft.prototype.isEnabled=function(){return this._enabled},ft.prototype.enable=function(t){this._enabled=!1!==t},ft.prototype.disable=function(t){this._enabled=!1===t},ft.prototype.setSender=function(t){this._sender=t||null},ft.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ft.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ft.prototype._listeners=null,ft.prototype._sender=null,ft.prototype._extender=null,ft.prototype._enabled=!0,ft.prototype._dispatching=!1,ft._proto=ft.prototype;var gt=ft;let yt=function(){};yt.prototype._customEvents=null,yt.prototype.listen=function(t,e,n){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,n)},yt.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},yt.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},yt.prototype._addEvent=function(t){if(!t)return;this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new gt(this))},yt.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,n=e.length;for(let t=0;t<n;++t)this._addEvent(e[t])},yt.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},yt.prototype._disableEvent=function(t,e){let n=this._customEvents[t];n&&n.disable(e)},yt.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},yt.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},yt._proto=yt.prototype;var mt=yt;let Ct=function(){this._rows={},this._addEvent("dataComposed"),this._addEvent("dataChanged")};l.inherits(Ct,mt),Ct.prototype._rows,Ct.prototype._composing=!1,Ct.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0)},Ct.prototype.setSubscriptions=function(){},Ct.prototype.getSubscriptions=function(){return null},Ct.prototype.addSubscription=function(){},Ct.prototype.removeSubscription=function(){},Ct.prototype.startAllSubscriptions=function(){},Ct.prototype.stopAllSubscriptions=function(){},Ct.prototype.getSubscription=function(){return null},Ct.prototype.getPrimaryRic=function(){return""},Ct.prototype.clearAllData=function(t){this._rows={},t||this._dispatchDataChange({globalChange:!0})},Ct.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},Ct.prototype.getData=function(t,e){let n=this.getRowData(t);return n?n[e]:null},Ct.prototype.getAllRics=function(){return null},Ct.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},Ct.prototype.hasRowId=function(t){return!!this._rows[t]},Ct.prototype.getColumnData=function(t){let e=[];for(let n in this._rows)e.push(this._rows[n][t]);return e},Ct.prototype.getRowData=function(t){return this._rows[t]||null},Ct.prototype.getMultipleRowData=function(t,e,n){let i=t.length;null==n&&(n=i),n>i&&(n=i),e>0||(e=0);let o=new Array(i),r=this._rows;for(let i=e;i<n;++i)o[i]=r[t[i]]||null;return o},Ct.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let n in e)t.push(e[n]);return t},Ct.prototype.setData=function(t,e,n){let i={};return i[e]=n,this.setRowData(t,i)},Ct.prototype.hasDataCloudData=function(t){},Ct.prototype.setRowData=function(t,e,n){let i=this.getRowData(t),o=!1,r=null;if(e)if(i){for(let t in e)i[t]=e[t],o=!0;r=e}else i=e,this._rows[t]=i,o=!0;else i&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=n||{};e.rid=t,r&&(e.changes=r),e.rowData=i,this._dispatchDataChange(e)}return o},Ct.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let n={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(n[t]=e[t]);return n},Ct.prototype.addStaticFields=function(){},Ct.prototype.removeStaticFields=function(){},Ct.prototype.resetStaticFields=function(){},Ct.prototype.getStaticFields=function(){},Ct.prototype.dump=function(t){return Ct.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},Ct.prototype.log=function(t){console.table(this.dump(t))},Ct.prototype.setDataCloudSettings=function(){},Ct.prototype.getDataCloudFields=function(){},Ct.prototype.addDataCloudFields=function(){},Ct.prototype.removeDataCloudField=function(){},Ct.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},Ct._defaultPropertyGetter=function(t,e,n){let i=e[n];return i?i[t]:null},Ct._defaultGetter=function(t,e){return t[e]},Ct.constructTable=function(t,e,n){let i=0,o=t.length,r=o,s=null,l=n||null,a=Ct._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let n=0;n<t;++n)s[e.colNames[n]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?Ct._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(i=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=i;e<o&&!(h.length>=r);++e){let n=t[e],i=l?{rid:l[e]}:{};if(n){let t;if(s)for(t in s)null!=n[t]&&(i[t]=a(n,t));else for(t in n)i[t]=a(n,t)}h.push(i)}return h};var St=Ct;let wt=function(t,e){this._rid=t,this._children={},this._shared=e};l.inherits(wt,u),wt._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},wt._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},wt.prototype._shared=null,wt.prototype._rid,wt.prototype._children,wt.prototype._childCount=0,wt.prototype._collapsed=!1,wt.prototype._order=0,wt.prototype._disposed=!1,wt.prototype._subSegDef=null,wt.prototype._subSegLevel=0,wt.prototype._subSegMap=null,wt.prototype._subSegNames=null,wt.prototype._subSegName="",wt.prototype._subSegVal,wt.prototype._subSegParent=null,wt.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,n=this._subSegMap;for(let i=0;i<e;++i)n[t[i]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null},wt.prototype.getId=function(){return this._rid},wt.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},wt.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=e.length,i=this._subSegMap;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n.getId()),n.getSubSegmentIds(t)}return t}return null},wt.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},wt.prototype.addChildren=function(t,e){let n,i=Array.isArray(t)?t:[t],o=i.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],n=0;n<o;++n)r|=this.addChild(i[n],e[n]);else for(n=0;n<o;++n)r|=this.addChild(i[n]);return!!r},wt.prototype.containsChild=function(t){return!!this._children[t]},wt.prototype.removeChild=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;if(!this._children[t])return!1;return delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},wt.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.removeChild(e[t]);return!!i},wt.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let t=this._shared.childToSegment,e=this._children;for(let n in e)t[n]&&delete t[n];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},wt.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},wt.prototype.getChildren=function(){return this._children},wt.prototype.getChildCount=function(){return this._childCount},wt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},wt.prototype.setClassification=function(t){if(this._subSegLevel)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let n,i=null;t&&("string"==typeof t?i=[t]:Array.isArray(t)&&(i=t));let o=i?i.length:0;if(o){if((e?e.length:0)===o){for(n=0;n<o&&i[n]===e[n];++n);if(n>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=i,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},wt.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,n=e?e.length:0,i=this._subSegNames,o=i?i.length:0;if(!o&&this._subSegLevel>=n)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=i[r],a[l]=1,p=h[l],p._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<n&&t){h||(h=this._subSegMap={},i=this._subSegNames=[]);let n=e[this._subSegLevel];for(d in _){let e=_[d],o=t[e],r=o?o[n]:null;s.childToSegment[d]=this._rid,l="Uncategorized",(r||0===r||!1===r)&&(l=r+""),a[l]&&(a[l]=0,--u),p=h[l],p||(p=new wt(this._rid+"/"+l,s),p._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=r,p._subSegParent=this,h[l]=p,i.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,e)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(l in u>=i.length&&(i.length=0),a)if(a[l]){p=h[l],delete h[l];let t=i.indexOf(l);t>=0&&i.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}i.length||(i=this._subSegMap=this._subSegNames=null)}if(o=i?i.length:0,o)for(i.sort(wt._subSegSortLogic),r=0;r<o;++r)p=h[i[r]],p.classify(t);if(c&&this._subSegDef)if(o){let t=this._subSegDef.subSegments=[];this.getAllSubSegments(t),t.forEach(wt._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},wt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},wt.prototype.isSubSegment=function(){return!!this._subSegLevel},wt.prototype.getFirstAncestor=function(){if(this._subSegLevel&&this._subSegDef){return this._subSegDef.root||null}return null},wt.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=this._subSegMap,i=e.length;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i),i.getAllSubSegments(t)}}return t||null},wt.prototype.getSegmentLevel=function(){return this._subSegLevel},wt.prototype.setRowData=function(t,e){if(!t)return;let n=t[this._rid];n||(n=t[this._rid]={}),e||(e=t),n=e[this._rid],n||(n=e[this._rid]={});let i=this;for(;i&&i.isSubSegment();)i.getSubSegmentName(n),i=i._subSegParent},wt.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){let e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},wt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},wt.prototype.expand=function(t){return this.collapse(!1===t)},wt.prototype.isCollapsed=function(){return this._collapsed},wt.prototype.getCollapsingStates=function(t,e){let n=this._subSegNames;if(!this._subSegLevel&&!n&&!this._collapsed)return!1;t||(t={});let i=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,i=!0),this._childCount){let o=e||this._collapsed;if(n){let r=this._subSegMap,s=n.length;for(let l=0;l<s;++l){let s=r[n[l]];t[s.getId()]=!!e,s.getCollapsingStates(t,o)&&(i=!0)}}else if(o){let e=this._children;for(let n in e)t[n]=o;i=!0}}return i},wt.prototype.getOrder=function(){if(this._subSegLevel){let t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},wt.prototype.getLastOrder=function(){if(this._subSegDef){let t=this._subSegDef.subSegments;if(t){let e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},wt.prototype.setOrder=function(t){this._order=t},wt._tabs=null,wt.prototype.log=function(t){let e,n=wt._tabs;if(!n){n=wt._tabs=[];let t="";for(e=0;e<11;++e)n[e]=t,t+=" "}let i=this._collapsed?"+ ":"- ";t.push(n[this._subSegLevel]+i+this._rid);let o=this._subSegNames;if(o){let n=o.length,i=this._subSegMap;for(e=0;e<n;++e)i[o[e]].log(t)}else if(this._childCount){let e=n[this._subSegLevel+1];for(let n in this._children)t.push(e+"- "+n)}return t};var bt=wt;let Rt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};l.inherits(Rt,u),Rt.prototype._segments,Rt.prototype._segmentCount=0,Rt.prototype._collapsedRids=null,Rt.prototype._shared,Rt.prototype._segmentList=null,Rt.prototype._insertionList=null,Rt.prototype._removalList=null,Rt.prototype._classification=!1,Rt.prototype._classifierChanged=!1,Rt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},Rt.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;let n=this._segments[t]=new bt(t,this._shared);return n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&n.addChildren(e),!0}return!1},Rt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.addSegment(e[t]);return!!i},Rt.prototype.containsSegment=function(t){return!!this._segments[t]},Rt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},Rt.prototype.removeSegment=function(t){let e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());let n=e.getSubSegmentIds();if(n){let t=n.length;for(let e=0;e<t;++e){let t=n[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},Rt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},Rt.prototype.getSegmentCount=function(){return this._segmentCount},Rt.prototype.getSegment=function(t){return this._segments[t]||null},Rt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},Rt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},Rt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},Rt.prototype.collapseSegment=function(t,e){let n=this._segments[t];return!!n&&n.collapse(e)},Rt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Rt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let n in t)e|=t[n].expand();if(e)return!0}return!1},Rt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},Rt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let n=this._segments;t={};for(let i in n){let o=n[i];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},Rt.prototype.addSegmentChild=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&i.addChild(e,n)},Rt.prototype.addSegmentChildren=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&i.addChildren(e,n)},Rt.prototype.containsSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.containsChild(e)},Rt.prototype.removeSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.removeChild(e)},Rt.prototype.removeSegmentChildren=function(t,e){let n=this._segments[t];return!!n&&n.removeChildren(e)},Rt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let n in t){t[n].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},Rt.prototype.fillSegment=function(t,e){let n=Array.isArray(e)?e.length:0;if(!n)return;let i=this._segments,o=i[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<n;++t){let n=e[t];if(i[n])break;o.addChild(n)}}}},Rt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,n=this._segments,i=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=n[e];s&&!s.isSubSegment()?(i=s,i.removeAllChildren()):i&&!i.isSubSegment()&&(i.addChild(e),o=!0)}return o},Rt.prototype.calcSegmentOrder=function(t){let e=this._segmentList;e?e.length=0:e=this._segmentList=[];let n=t?t.length:0,i=this._segments,o=this._segmentCount,r=0;for(let e=0;e<n;++e){let n=i[t[e]];if(n&&(n.isSubSegment()||(this._segmentList.push(n),n.setOrder(++r)),--o<=0))break}},Rt.prototype.getSegmentValues=function(t,e){let n=t?t.length:0;if(!n)return null;let i=this._segments,o=this._shared.childToSegment,r=null,s=null,l=new Array(n),a=0,u=-10,h=0;for(let p=0;p<n;++p){let n=t[p];if(r=i[n],r)a=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{let t=o[n];t?(r=i[t],a=100*r.getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(a=u,h=10):a=h=0}l[p]=a+h}return s?l:null},Rt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,n=[];for(let i=0;i<e;++i)t[i].log(n);return n.join("\n")},Rt.prototype.logRowIdMap=function(){let t=[],e=this._shared.childToSegment;for(let n in e){let i=e[n];t.push(n+" > "+i)}return t.join("\n")},Rt.prototype.setSegmentClassification=function(t,e){let n=this._segments[t];return!(!n||!n.setClassification(e))&&(n.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},Rt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},Rt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let n in e){let e=this._segments[n];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},Rt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let n=t.segment;this._insertionList.push(n),this._segments[e]=n,this._segmentCount++,n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},Rt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)};var vt=Rt;let It=function(){It.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};l.inherits(It,St),It.prototype._prevData=null,It.prototype._rids,It.prototype._frozen=!1,It.prototype._runningId=0,It.prototype._compMap=null,It.prototype._segments=null,It.prototype._autoSegmentFilling=!1,It.prototype._removedRows=null,It.prototype._userSegmentComparer=null,It.prototype._segmentSortOrder=0,It.prototype._segmentSortContext=null,It.prototype._clsSource=null,It.prototype._classifyingTimer=0,It.SortLogic,It.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,It._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},It.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let n=this._rids.length;--n>=0;)e[n]=this._rows[this._rids[n]][t];return e},It.prototype.getRowId=function(t){return this._rids[t]||""},It.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},It.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},It.prototype.getRowCount=function(){return this._rids.length},It.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},It.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},It.prototype.getPreviousData=function(t,e){let n=this._prevData[t]||null;return n?n[e]:null},It.prototype.setData=function(t,e,n){if(!this._needFiring())return this._setData(t,e,n);let i={};return i[e]=n,this.setRowData(t,i)},It.prototype._removeRidFromSegments=function(t){if(this._segments){if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}}return!1},It.prototype.setRowData=function(t,e,n){if(!t)return!1;let i=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(i){let n=this._prevData[t];for(let t in e)n[t]=i[t],i[t]=e[t]}else if(r="inserted",i=e,this._rows[t]=i,this._prevData[t]={},n){let e=n.nextRid,i=e?this.getRowIndex(e):-1;i<0&&(i=n.fallback),null==i||i<0||i>=this._rids.length?this._rids.push(t):(this._rids.splice(i,0,t),s=!this._isLastSegment(i))}else this._rids.push(t);o=!0}else i&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),It._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=n||{};o.rid=t,o.changes=e,o.rowData=i,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},It.prototype.setColumnData=function(t,e,n){let i=e?e.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(i,n);for(let n=0;n<i;++n)this._setData(r[n],t,e[n]);this.freeze(o)},It.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},It.prototype.setDataFrom2DArray=function(t,e,n){let i=t?t.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(i,n);for(let n=0;n<i;++n){let i=t[n],o=s[n];if(e)for(r=i.length;--r>=0;)this._setData(o,e[r],i[r]);else for(r=i.length;--r>=0;)this._setData(o,""+r,i[r])}this.freeze(o)},It.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setData(i,e,n)},It.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setRowData(i,e,n)},It.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},It.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let n=t.length;if(!n)return;if(1===n)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let i=this._frozen;this.freeze();for(let i=0;i<n;++i)this.addRow(t[i],e[i]);this.freeze(i)},It.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},It.prototype.insertRow=function(t,e,n){let i=null;return"number"==typeof t?(i={},i.nextRid=this._rids[t],i.fallback=t):t&&(i={},i.nextRid=t),e||(e={}),n=this._generateUniqueRid(e,n),this.setRowData(n,e,i),n},It.prototype.insertAfter=function(t,e,n){let i="string"==typeof t?this.getRowIndex(t):t;return!(i>=0)||i>=this._rids.length-1?this.addRow(e,n):this.insertRow(i+1,e,n)},It.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},It.prototype.removeRows=function(t){let e,n;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let i=!1;for(this._removedRows={},n=t.length;--n>=0;){e=t[n],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),i=!0)}i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},It.prototype._removeRows=function(t){return!this._removedRows[t]},It._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&(n>=t.length?t.pop():t.splice(n,1),!0)},It.prototype.clearAllData=function(t){It.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},It.prototype.removeAllRows=It.prototype.clearAllData,It._ascendingOrder=function(t,e){return t-e},It.prototype.moveRow=function(t,e,n){let i=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let n=t;n.sort(It._ascendingOrder);let r=[];for(let t=n.length;--t>=0;){let i=n[t];o=this._rids[i],o&&(r.unshift(o),this._rids.splice(i,1),i<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),i=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),i=o));return i&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(n)),i},It.prototype._moveRow=function(t,e,n){let i=t.length;if(!i)return null;let o=new Array(i);for(let e=0;e<i;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return i>1?this.moveRow(o,r,n):this.moveRow(o[0],r,n)},It.prototype.moveRows=function(t,e,n,i){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),n||(n=1);let o=t+n-1,r=e;if(e>=t&&(r=e<=o?t:e-n),n>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,n),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(i),e}return null},It.prototype.swapRow=function(t,e){let n=this._rids.length;if(t<0||t>=n)return;if(e<0||e>=n)return;let i=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=i},It.prototype.clearRowData=It.prototype.removeRow,It.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},It.prototype.getDataSource=function(){return null},It.prototype.setDataSource=function(t){},It.prototype.getSortingLogics=function(){return this._compMap},It.prototype.sortOnce=function(t,e,n,i){let o=It._buildSortContext([],t,e,n||this._compMap,i);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},It.prototype.setSortingLogic=function(t){this._compMap._default=t},It.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},It.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},It.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},It.prototype.unfreeze=function(t){return this.freeze(!1===t)},It.prototype.isFrozen=function(){return this._frozen},It.prototype.setSegmentSeparator=function(t,e){let n=!1,i=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new vt,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),n=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(i=e.getChildCount(),this._segments.removeSegment(t)&&(n=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(n&&this._needFiring())if(this._autoFillSegments()||i)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return n},It.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},It.prototype.hasSegmentation=function(){return!!this._segments},It.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},It.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},It.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},It.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},It.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},It.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},It.prototype._isLastSegment=function(t){let e=this._segments;if(e){let n=this._rids,i=n.length;for(let o=t+1;o<i;++o)if(e.containsSegment(n[o]))return!1}return!0},It.prototype._getSegmentSeparators=function(){return this._segments},It.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},It.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},It.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},It.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},It.prototype.addSegmentChild=function(t,e,n){if(this._segments){if(this._segments.addSegmentChild(t,e,n))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},It.prototype.addSegmentChildren=function(t,e,n){if(this._segments){if(this._segments.addSegmentChildren(t,e,n))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},It.prototype.removeSegmentChild=function(t,e){if(this._segments){let n=this._segments.removeSegmentChild(t,e);return n&&(this.dispatchGlobalChange(),this.requestClassifying()),n}return!1},It.prototype.removeSegmentChildren=function(t,e){if(this._segments){let n=this._segments.removeSegmentChildren(t,e);return n&&(this.dispatchGlobalChange(),this.requestClassifying()),n}return!1},It.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},It.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},It.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},It.prototype.sortSeparators=function(t,e,n){let i=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);let o=It._buildSortContext([],n,e,t),r=o?o.length:0;if(!r)return i;let s,l,a=0;return r>1?(s=It._multiColumnSeparatorCompareLogic,l=o,a=1):(s=It._singleColumnSeparatorCompareLogic,l=o[0],a=l[3]),this._segmentSortOrder=a,this._segmentSortContext=l,i=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,i},It.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;let e,n=this._rids,i=this._segments,o=i.getSegmentCount(),r=[],s=[],l=0,a=n.length,u="",h=null;for(e=0;e<a&&(u=n[e],h=i.getSegment(u),!(h&&(s.push(e),r.push(h),++l>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;let p=!1;for(e=0;e<l;++e){let t=s[e];u=n[t],h=r[e];let i=h.getId();u!==i&&(n[t]=i,p=!0)}return!!p&&(this._segments.calcSegmentOrder(n),this._sort(null),this._dispatchPositionChange(),!0)},It.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},It.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},It.prototype.setSegmentClassification=function(t,e){if(this._segments){if(this._segments.setSegmentClassification(t,e))return this.classifySegments()}return!1},It.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},It.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},It.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},It.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=i.length,h={};for(e=0;e<u;e++){let t=i[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],It._removeArrayItem(l,t),o=!0)}let p=n.length;for(e=0;e<p;e++){let t=n[e],i=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(i);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},It.prototype._sort=function(t){let e=this._rids,n=this.getMultipleRowData(e),i=this.getSegmentValues(e),o=It._performMultiLevelSorting(n,t,i);return!!o&&(this._rids=It._reorderItems(e,o),!0)},It.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(It._globalChangeArg)},It.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",It._positionChangeArg)},It.prototype.dump=function(t){return St.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},It.prototype._setData=function(t,e,n){let i=this.getRowData(t);return i||(i={},this._rows[t]=i,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=i[e],i[e]=n,!0},It.prototype._generateRids=function(t,e){let n,i=0;if(e)n=e;else{n=[];let e=this._rids.length;for(;i<e&&i<t;)n.push(this._rids[i++])}for(i=n.length;i<t;)n.push(""+i++);return n},It.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},It.prototype._needFiring=function(){return!this._frozen&&!this._composing},It.getSortingDefinitions=_t._deprecatedFunction,It._globalChangeArg={globalChange:!0},It._positionChangeArg={globalChange:!0,positionChangeOnly:!0},It._buildSortContext=function(t,e,n,i,o){let r,s;Array.isArray(e)?(r=e,s=n):(r=[e],s=e?[n]:[0]);let l=null,a=null;"function"==typeof i?l=i:a=i;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let n=t[e];n||(n=t[e]=new Array(5));let i=r[e];n[0]=i,n[1]=null,n[2]=l||a[i]||a._default,n[2]||(n[2]=It._defaultComparer),n[3]=It._getSortOrder(s[e]),n[4]=o}return t},It._multiColumnCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=It._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},It._singleColumnCompareLogic=function(t,e,n,i){let o=i[1];return i[2](o[t],o[e],n,i[4])},It._multiColumnSeparatorCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=It._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},It._singleColumnSeparatorCompareLogic=function(t,e,n,i){let o=i[0];return i[2](t[o],e[o],n,i[4])},It._performMultiLevelSorting=function(t,e,n){let i,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let n=0;n<r;++n){let r,s=e[n],l=s[1];if(i=s[2],i.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(n){let t=["ROW_SEGMENT",n,It._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(i=It._multiColumnCompareLogic,s=e,l=1):(i=It._singleColumnCompareLogic,s=e[0],l=s[3]),It._mergeSort(o,l,i,s)},It._mergeSort=function(t,e,n,i){let o,r,s,l,a,u=!1,h=1,p=It._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(n(p[r],p[s],e,i)<=0){if(d[o++]=p[r],++r>=l){for(;s<a;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=a){for(;r<l;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;let c=p;p=d,d=c,h<<=1}return u?p:null},It._reorderItems=function(t,e){if(e){for(let n=t.length;--n>=0;)e[n]=t[e[n]];return e}return t},It._createIndexArray=function(t){let e=It._idxAryMap[t];if(!e){It._idxAryCount>50&&(It._idxAryMap={},It._idxAryCount=0),e=It._idxAryMap[t]=new Array(t),It._idxAryCount++;for(let n=0;n<t;++n)e[n]=n}return e.slice()},It._removeIndexArray=function(){It._idxAryMap={},It._idxAryCount=0},It._idxAryMap={},It._idxAryCount=0,It._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},It._defaultComparer=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},It._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},It._proto=It.prototype;var Dt=It;const xt="ROW_DEF",At="CONTENT",Lt="CHAIN",Tt="CONSTITUENT",Et="GROUP_HEADER",Mt="SUBGROUP_HEADER",Ft="GROUP_MEMBER",Pt=/^_[^_]+_$/;let zt=function(t){if(this._changes={},t&&t.segmentId)return this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+zt._runningId+++"_",t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};zt._runningId=0,zt._childDataField="CHILD_VALUES",zt.prototype._userInput="",zt.prototype._ric="",zt.prototype._permId="",zt.prototype._label=null,zt.prototype._isChain=null,zt.prototype._asSegment=!1,zt.prototype._realTime=!0,zt.prototype._rowId="",zt.prototype._userId=!1,zt.prototype._dc=null,zt.prototype._subs=null,zt.prototype._view=null,zt.prototype._subId="",zt.prototype._collapsed=null,zt.prototype._autoGenerated=!1,zt.prototype._subSegment=!1,zt.prototype._staticValues=null,zt.prototype._changes,zt.prototype._updateCount=0,zt.prototype._children=null,zt.prototype._parent=null,zt.prototype._groupOrder=0,zt.prototype._depthLevel=0,zt.prototype._userModel=null,zt.prototype._info=null,zt.prototype.dispose=function(){this.isDisposed()||(this._children&&(this._children.forEach(zt.dispose),this._children=null),this._dc&&(this._dc.setRowData(this._rowId,null),this._dc=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._subs=null,this._view=null,this._subId=this._rowId="",this._userId=!1,this._autoGenerated=!1,this._userModel=null)},zt.prototype.isDisposed=function(){return!this._rowId},zt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(e.match(Pt)?console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."):(this._rowId=e,this._userId=!0))}let e=zt.extractRowOptions(t),n=t.permId;null!=n&&(this._permId=n),n=t.ric,null!=n&&(this._ric=n),n=t.label,void 0!==n&&(this._label=n),n=t.chainRic,null!=n&&(this._chainRic=n),n=e.asChain,null!=n&&(this._isChain=!!n),n=t.realTime,null!=n&&(this._realTime=n),n=t.asSegment,null!=n&&(this._asSegment=!!n),(this._isChain||this._asSegment)&&(this._collapsed=e.collapsed),n=t.keepModel,n&&(this._userModel=t),n=t.info,n&&(this._info=n);let i=this._ric||this._chainRic;(i||this._permId)&&this.setContent(i,e),n=t.values,void 0!==n&&this.setStaticRowData(n,t.fields)},zt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;this.setParent(e)&&(this._ric=t.ric,this._dc=e._dc,this._subId=e._subId),this._staticValues=t.values||null,this.resetRowData()};let Vt=function(t,e){let n=t.getRowIndex(e);do{if((e=t.getRowId(++n))&&!t.getSegmentParentRowId(e))break}while(e);return e},kt=function(t,e,n){return!(!t||!t.isSorting())&&((e=!!e)!==n&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};zt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let n=this._userInput!==t,i=e.permId||"";if(this._permId!==i&&(this._permId=i,n=!0),!n)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=kt(s,r&&o,!1);this.unsubscribeForUpdates(),this._userInput=t;let a=e.collapsed;if(r){let n=e.chainRic;this._ric=!0===o?!0===a?t:t.replace("0#",""):t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=Vt(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),a!==this.isChainCollapsed()&&s.collapseSegment(this._rowId,a),this._collapsed=null,kt(s,!1,l),t&&s.addSegmentChild(t,this._rowId)}return this.subscribeForUpdates(),!0},zt.prototype.getRowId=function(){return this._rowId},zt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let n=this._ric;if(n&&(e.ric=n),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),n=this._realTime,n||(e.realTime=!1),n=this._permId,n&&(e.permId=n),n=this._chainRic,n&&(e.chainRic=n),n=this._label,n&&(e.label=n),n=this._userModel,n&&(e.keepModel=e),n=this._isChain,null!=n&&(e.asChain=n),n=this._collapsed,null!=n&&(e.collapsed=n),n=this._view.isHiddenRow(this._rowId),n&&(e.hidden=n),n=this._info,n&&(e.info=this._info),n=this._cloneStaticRowData(),n&&(e.values=n),this.isChain()){let t=this.getChildren();if(t){let i=n?n[zt._childDataField]:{};i||(i={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._cloneStaticRowData(),s&&(l=!0,i[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[zt._childDataField]=i)}}return e},zt.prototype.getDataId=function(){return""},zt.prototype.getType=function(){if(this._isChain)return Lt;if(this._parent)return Tt;{let t=this._view;if(!t)return"";{let e=this.getRowId(),n=t.isSegmentSeparator(e),i=t.getSegmentLevel(e);if(n)return 1===i?Et:Mt;if(t.getSegmentParentRowId(e))return Ft}}return At},zt.prototype.setDataSource=function(t,e){this._dc=t||null,this._dc&&(this.setRowData({}),this._staticValues&&this.setRowData(this._staticValues)),this._subs=e||null,this.subscribeForUpdates()},zt.prototype.getDataSource=function(){return this._dc},zt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._rowId):{}},zt.prototype.getData=function(t){return this._dc?this._dc.getData(this._rowId,t):null},zt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=T(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},zt.prototype._cloneStaticRowData=function(){return this._staticValues?function(t){let e={};for(let n in t)e[n]=t[n];return e}(this._staticValues):null},zt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},zt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=T(t,e)),t&&this.setRowData(t)},zt.prototype.copyRowData=function(t){if(t&&t!==this){let e=this.getRowData();t.cloneRowData(e,this._staticValues)}},zt.prototype.cloneRowData=function(t,e){let n,i=t||{},o={ROW_DEF:1,SUB_ID:1},r=this._staticValues;for(n in r)o[n]=1;for(n in e)o[n]=1;let s=this.getRowData();for(n in s)o[n]||(i[n]=s[n]);return i},zt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._rowId,t)},zt.prototype.resetRowData=function(){let t=this._dc;if(t){let e=this._rowId;t.setRowData(e,null),t.setRowData(e,{}),this._staticValues&&t.setRowData(e,this._staticValues)}},zt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._rowId,t,e)},zt.prototype._clearStaticData=function(){let t=this._staticValues;if(t){if(this._dc){let e={};for(let n in t)e[n]=null;this._dc.setRowData(this._rowId,e)}this._staticValues=null}},zt.prototype.getUserInput=function(){return this._userInput},zt.prototype.getRic=function(){return this._ric},zt.prototype.getPermId=function(){return this._permId},zt.prototype.getSymbol=function(){return this._ric||this._permId},zt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},zt.prototype.getLabel=function(){return this._label},zt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},zt.prototype.isChain=function(){return this._isChain},zt.prototype.isConstituent=function(){return!(!this._autoGenerated||!this._subId||this._rowId===this._subId)},zt.hasChain=function(t){return t.isChain()},zt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},zt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},zt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},zt.prototype.isAutoGenerated=function(){return this._autoGenerated},zt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},zt.prototype.subscribeForUpdates=function(t){if(t?this._subs=t:t=this._subs,!t)return!1;if(!this.isRealTimeRow()&&!this.getPermId())return!1;if(this.unsubscribeForUpdates(),this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));let e=this.getDisplayText();return this.setRowData({X_RIC_NAME:e}),!0},zt.prototype.unsubscribeForUpdates=function(){return this.isSubscribing()&&(this._subs.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this.resetRowData()),null},zt.prototype.isSubscribing=function(){return!(!this._subId||!this._subs)},zt.prototype.getSubId=function(){return this._subId},zt.prototype.addUpdate=function(t){if(t){let e=0;for(let n in t)this._changes[n]=e=1;if(e)return++this._updateCount,!0}return!1},zt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},zt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},zt.prototype.registerToView=function(t,e){if(!t||this._view===t)return!1;this._view=t;let n=this._rowId,i=t.getRowData(n);if(i&&i[xt])return console.warn("Duplicate row id detected"),!1;if(this._subSegment)return i&&(i[xt]=this),!0;i={},i[xt]=this;let o="",r=this._isChain||this._asSegment;if(e&&(o=t.getSegmentParentRowId(e),o))if(r)e=Vt(t,e);else if(!this.isConstituent()){t.getData(o,xt).isChain()&&(o=null,e=Vt(t,e))}let s=kt(t,r,!1);return t.insertRow(e,i,n),r?(t.setSegmentSeparator(n),kt(t,!1,s),null!=this._collapsed&&(t.collapseSegment(n,this._collapsed),this._collapsed=null)):!this._parent&&o&&t.addSegmentChild(o,n),!0},zt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},zt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},zt.prototype._getChildStaticRowData=function(t){if(this._staticValues){let e=this._staticValues[zt._childDataField];if(e)return e[t]||null}return null},zt.prototype.getConstituent=function(t){if(this._children&&t)for(let e=this._children.length;--e>=0;)if(this._children[e]._ric===t)return this._children[e];return null},zt.prototype.verifyConstituent=function(t){return!(!this._isChain||!t||this._ric===t||this._ric==="0#"+t)&&this._ric!=="/"+t},zt.prototype.addConstituent=function(t){if(!(this._rowId&&this._subId&&this._isChain))return null;this._children||(this._children=[]);let e={asConstituent:!0,ric:t,parent:this},n=this._getChildStaticRowData(t);return n&&(e.values=n),new zt(e)},zt.prototype.toRealTimeRow=function(){if(!this.isConstituent())return;let t=this._parent._subs;this._realTime=!0,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this.resetRowData(),this.subscribeForUpdates(t)},zt.prototype.unlinkChain=function(){if(!this._isChain)return;this.unsubscribeForUpdates();let t=this._view;if(t){let e=this.getRowId(),n=t.getSegment(e);n&&n.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},zt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!0)},zt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!1)},zt.prototype.toggleChain=function(){return this.isChainExpanded()?this.collapseChain():this.expandChain()},zt.prototype.addChild=function(t){return!!t&&t.setParent(this)},zt.prototype.getChildren=function(){return this._children},zt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,n=e.length;for(let i=0;i<n;++i){let n=e[i];t.push(n),n.getDescendants(t)}}return t},zt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(zt.toRowId):null},zt.prototype.getChildCount=function(){return this._children?this._children.length:0},zt.prototype.countChildInView=function(){if(this._children){let t=0,e=this._children.length;for(let n=0;n<e;++n)this._children[n]._view&&++t;return t}return 0},zt.prototype.getParent=function(){return this._parent},zt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},zt.prototype.getDepthLevel=function(){return this._depthLevel},zt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},zt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},zt.prototype.getUserModel=function(){return this._userModel},zt.prototype.setRowInfo=function(t){this._info=t},zt.prototype.getRowInfo=function(){return this._info},zt.toRowId=function(t){return t.getRowId()},zt.extractRowOptions=function(t){let e=t.ric,n=t.permId,i=t.chainRic,o=t.collapsed,r=t.asSegment,s=t.asChain;null==s&&i&&(s=!0);let l=null;e&&e.indexOf("0#")>=0?(null==s&&(s=!0),l=!0):s?l=!1:r&&(l=!0);let a={};return a.collapsed=null==o?!l:o,a.ric=e,a.permId=n||"",a.chainRic=i,a.asChain=s,a},zt.dispose=function(t){t.dispose()};const Nt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),Ot=/^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;let Ht={};function Bt(t){t.currentTarget._error={type:t.type}}function Gt(t){let e=t.currentTarget,n=e._defer,i=e._field;if(delete Ht._loadingField[i],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===i.toUpperCase()&&(o=Ht.get(i)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,Ht.set(i,o))}}o?n.resolve(o):n.reject("No definition for "+i)}else e._error?(e._error.field=i,n.reject(e._error)):n.reject({field:i,status:e.status,statusText:e.statusText,request:e})}Ht._defs={},Ht._defaults={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},Ht._timeSeriesChildren={},Ht._synapse="",Ht._lang="en",Ht._timeSeriesExpansion=!0,Ht._loadingField={},Ht.set=function(t,e){if(Ht._defs[t])for(let n in e)Ht._defs[t][n]=e[n];else Ht._defs[t]=e},Ht.resetAll=function(){let t=Ht._defs={},e=Ht._defaults;for(let n in e)t[n]=e[n]},Ht.get=function(t){return Ht._defs[t]||null},Ht.getFieldInfo=Ht.get,Ht.hasFieldInfo=function(t){let e=Ht.get(t);return!(!e||!e.field)},Ht.getTimeSeriesChildren=function(t){return Ht._timeSeriesChildren[t]||null},Ht.addTimeSeriesChild=function(t,e){Ht._timeSeriesChildren[t]||(Ht._timeSeriesChildren[t]=[]),Ht._timeSeriesChildren[t].push(e)},Ht.remove=function(t){delete Ht._defs[t]},Ht.setSynapseConfig=function(t){Ht._synapse=t},Ht.disableTimeSeriesExpansion=function(t){Ht._timeSeriesExpansion=!1===t},Ht.isFormula=function(t){return"="===t.charAt(0)},Ht.isAdc=function(t){return 0===t.indexOf("TR.")},Ht.isRealTimeField=function(t){return!!t&&(!Ht.isAdc(t)&&(!Ht.isFormula(t)&&(!Ht.isTimeSeriesChild(t)&&!1!==Ht.getFieldProperty(t,"IsRealtimeField"))))},Ht.isTimeSeriesChild=function(t){return!!Ht.getFieldProperty(t,"timeSeriesParent")},Ht.isTimeSeries=function(t){if(!t)return!1;if(!Ht._timeSeriesExpansion)return!1;let e=Ht.getFieldProperty(t,"timeSeries");return null!=e?!!e:Ot.test(t)},Ht.setFieldProperty=function(t,e,n){Ht._defs[t]||(Ht._defs[t]={}),Ht._defs[t][e]=n},Ht.getFieldProperty=function(t,e){let n=Ht._defs[t];return n?n[e]:null},Ht.loadFieldInfo=function(t){if(Ht._loadingField[t])return Ht._loadingField[t].promise;let e=new k,n=Ht._synapse;if(n)if(Ht.hasFieldInfo(t))e.resolve(Ht.get(t));else if(n.debug){let n=this._mockOnLoadEndData(t,e);setTimeout(Gt.bind(null,n),1e3)}else if(n.apiKey&&n.contextApp){let i=Nt+"&api-key="+encodeURIComponent(n.apiKey)+"&contextApp="+encodeURIComponent(n.contextApp)+"&language="+encodeURIComponent(Ht._lang)+"&query="+encodeURIComponent(t);n.auth&&(i+="&auth="+encodeURIComponent(n.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,Ht._loadingField[t]=e,o.addEventListener("loadend",Gt),o.addEventListener("timeout",Bt),o.addEventListener("error",Bt),o.open("GET",i,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},Ht._mockOnLoadEndData=function(t,e){let n,i=t.toUpperCase(),o=i.toLowerCase();n=2===o.indexOf("_")?i[3]+o.substring(4):i[0]+o.substring(1);let r=i.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+i+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:n,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:n,fn:i,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:n,title:"title mockup of "+i,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in Ht._defaults)Ht._defaults[t].field=t,Ht._defs[t]=Ht._defaults[t]}();var Wt=Ht;let Ut={_formulas:{},set:function(t,e){Ut._formulas[t]=e},get:function(t){return Ut._formulas[t]||""},remove:function(t){delete Ut._formulas[t]}};var Yt=Ut;const Xt={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let qt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};qt.prototype._field="",qt.prototype._dataType="",qt.prototype._name="",qt.prototype._defaultName=!0,qt.prototype._defaultField=!0,qt.prototype._tooltip=null,qt.prototype._requiredFields,qt.prototype._headerRenderer=null,qt.prototype._headerAlignment="",qt.prototype._internalRenderer,qt.prototype._userRenderers=null,qt.prototype._activatedRenderer=null,qt.prototype._rendererMap=null,qt.prototype._userSorter=null,qt.prototype._sortable=!0,qt.prototype._eventArg,qt.prototype._autoGenerated=!1,qt.prototype._classes,qt.prototype._fnEngine=null,qt.prototype._formula=null,qt.prototype._formulaRef="",qt.prototype._initialOrder="",qt.prototype._rowSorting=null,qt.prototype._textSelect=!1,qt.prototype._userModel=null,qt.prototype._parent=null,qt.prototype._children=null,qt.prototype._info=null,qt.prototype._coreColDef=null,qt.prototype._focusable=!1,qt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},qt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},qt.prototype.initialize=function(t){if(!t)return;let e,n,i,o,r=t.field,s=Wt.get(r);if(s&&s!==t){let e=t;for(i in t={},s)t[i]=s[i];for(i in e)t[i]=e[i]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name,null==o&&(o=t.title),null!=o&&(this._name="string"==typeof o?o:o+"",this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Wt.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(n=o.length,e=0;e<n;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.focusable,null!=o&&(this._focusable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},qt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},qt.prototype.getRequireFields=function(){return this._requiredFields},qt.prototype.getRequiredFields=qt.prototype.getRequireFields,qt.prototype.getRenderer=function(){return this._internalRenderer},qt.prototype.getHeaderRenderer=function(){return this._headerRenderer},qt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},qt.prototype.isDefaultName=function(){return this._defaultName},qt.prototype.getFieldDefinition=function(){return Wt.get(this.getField())},qt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},qt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Xt[t.toUpperCase()]:""},qt.prototype.setDataType=function(t){let e=Xt[t.toUpperCase()];e&&(t=e),this._dataType=t},qt.getDataType=function(t){let e=Wt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Xt[t]?Xt[t]:""}return""},qt.prototype.getTooltipValue=function(){return this._tooltip},qt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},qt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},qt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},qt.prototype.isRealTimeField=function(){return Wt.isRealTimeField(this.getField()||this._field)},qt.prototype.isTimeSeries=function(){return Wt.isTimeSeries(this.getField())},qt.prototype.isTimeSeriesChild=function(){return Wt.isTimeSeriesChild(this.getField())},qt.prototype.isFormulaField=function(){return!!this._formula},qt.isFormulaField=function(t){return Wt.isFormula(t)},qt.isAdcField=function(t){return Wt.isAdc(t)},qt.isRealTimeField=function(t){return Wt.isRealTimeField(t)},qt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let n=e.getRequiredFields(),i=n.length;for(let e=0;e<i;++e){let i=n[e];qt.isRealTimeField(i)&&t.push(i)}return t},qt.prototype.isSortable=function(){return this._sortable},qt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},qt.prototype.getInitialSortOrder=function(){return this._initialOrder},qt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},qt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},qt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},qt.prototype.isFieldEmpty=function(){return!this.getField()},qt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},qt.prototype.getClasses=function(){return this._classes},qt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let n=this.getDataType();n&&(e.dataType=n),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),n=!1===Wt.getFieldProperty(this.getField(),"IsRealtimeField"),n&&(e.notRealTimeField=n),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let i=this._classes;i&&i.length>0&&(e.className=i.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),l=o.getColumnCustomLaneSize(r);return!0===s&&1===l||(e.scalable=s,e.width=l),n=o.getMinimumColumnWidth(r),n>0&&(e.minWidth=n),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),n=o.getColumnAlignment(r),"default"!==n&&(e.textAlign=n),e},qt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},qt.prototype.isTextSelect=function(){return this._textSelect},qt.prototype.hide=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.hideColumn(n,!1!==t)},qt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},qt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},qt.prototype.getParent=function(){return this._parent},qt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},qt.prototype.getChildren=function(){return this._children},qt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},qt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},qt.prototype.activateRenderer=function(t,e){let n=null;if(null!=t){let i=this._rendererMap;i||(i=this._rendererMap={}),"function"==typeof e?n=i[t]=e:null==e?n=i[t]:e||(n=i[t]=null)}return this._activatedRenderer=n||null,n||(n=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(n),!!this._activatedRenderer},qt.prototype.getSorter=function(){return this._userSorter},qt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},qt.prototype.isRowSorting=function(){return null==this._rowSorting?!Wt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},qt.prototype.isAutoGenerated=function(){return this._autoGenerated},qt.prototype.setName=function(t){this._name=t,this._defaultName=!1},qt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let n=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),i=n||Yt.get(e);(i||qt.isFormulaField(t))&&(t=c.toUpperCase(t),this._formula=this._fnEngine.addFormula(i||t),i&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Wt.setFieldProperty(t,"timeSeries",!!Wt.isTimeSeries(t));let i=e.parent;e&&i&&Wt.setFieldProperty(t,"timeSeriesParent",i.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},qt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let n=t[e],i=n.toUpperCase(),o=Yt.get(i);if(o){let t=this._fnEngine.getFormula(n);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(n),this._fnEngine.addReference(t,n)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(n)}},qt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},qt.prototype._customRenderer=function(t){let e=t.dataValue,n=this._eventArg;if(e){let i=e.getRowData();n.rowDef=e,n.rowData=i,n.rowIndex=t.rowIndex,n.data=i?i[this._field]:null}else n.data=null;if(n.colIndex=t.colIndex,n.cell=t.cell,n.section=t.section,this._activatedRenderer)this._activatedRenderer(n);else{let t=this._userRenderers,e=t.length;for(let i=0;i<e;++i)t[i](n)}},qt.prototype._updateContext=function(t,e){this._eventArg[t]=e},qt.prototype.getUserModel=function(){return this._userModel},qt.prototype.clearUserModel=function(){this._userModel=null},qt.prototype.setColumnInfo=function(t){this._info=t},qt.prototype.getColumnInfo=function(){return this._info},qt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},qt.prototype.isFocusable=function(){return this._focusable},qt.prototype.getBackgroundColor=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnBackgroundColor(e)},qt.prototype.setBackgroundColor=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.setColumnBackgroundColor(n,t)};var jt=qt;let Kt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};s.inherits(Kt,a),Kt.prototype._timerId=0,Kt.prototype._rics,Kt.prototype._fields,Kt.prototype._rtk,Kt.prototype._adcOptions=null,Kt.prototype.setRTK=function(t){this._rtk=t},Kt._mockAdc=null,Kt.setMockAdc=function(t,e){Kt._mockAdc||(Kt._mockAdc={}),Kt._mockAdc[t]=e},Kt.getMockAdc=function(t){return Kt._mockAdc?Kt._mockAdc[t]:null},Kt.clearMockAdc=function(){Kt._mockAdc=null},Kt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Kt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Kt.prototype.addRics=function(t){let e=t?t.length:0,n=!1;for(let i=0;i<e;++i){let e=t[i];e&&!this._rics[e]&&(this._rics[e]=1,n=!0)}return!!n&&(this._request(),!0)},Kt.prototype.addField=function(t){this._addField(t)&&this._request()},Kt.prototype.addFields=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n|=this._addField(t[i]);return!!n&&(this._request(),!0)},Kt.prototype._addField=function(t){return Kt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Kt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Kt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Kt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,n=Object.keys(this._rics),i=[],o=[];for(let t in this._fields)Ht.isTimeSeries(t)?o.push(t):i.push(t);let r,s,l=i.length,a=o.length;if((l||a)&&n.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Kt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}i.length>0&&(t=i.join(","),s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,i),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<l;e++)o.push({name:i[e]});s={instruments:n,fields:o},r=this._onJETSuccess.bind(this,i),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Kt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(n=0;n<a&&l<u;n++)i=t[n],s[l].field===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=0;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];L(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Kt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(n=0;n<a&&l<u;n++)i=t[n],s[l].r.toUpperCase()===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=1;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&"object"!=typeof n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];L(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Kt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n=e.rows,i=e.rows&&e.rows[0];if(!Array.isArray(n)||!Array.isArray(i))return;let o=i.slice(2).map(t=>t.v),r={},s=0,l=n.length;for(let e=1;e<l;e++){let i=n[e][1];r[i]||(r[i]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=n[t],i=e[0],s=e[1];a[i]||(a[i]={});let l=a[i];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let n=r[s].replace("TR.","")+"_"+o[t],i=e[2+t];null!==i&&(u[n]=r[s],l[n]=i)}}let h={};for(let t in a){let e=a[t];L(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var Jt=Kt;let Qt=function(){this._groupMap={},this._childToParent={}};Qt.prototype._groupMap,Qt.prototype._childToParent,Qt.getGroupId=function(t){return t&&t.id||""},Qt.calcTreeDepth=function(t,e){let n=-1,i=e;for(;i;){if(++n>15){console.log("WARNING: Infinite loop detected during column group creation");break}i=t[i.parentId]}return n},Qt.getLeafDescendants=function(t,e){let n=t[e];if(!n)return null;let i=[],o=[n],r=0,s={};for(;r<o.length;){n=o[r++],s[n.id]=!0;let e=n.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];n=t[l],n?s[n.id]||o.push(n):i.push(l)}}return i},Qt._cloneObject=function(t){let e=A(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Qt._toGroupDefinition=function(t,e){let n=null;return t&&(n=Array.isArray(t)?{children:t.slice()}:Qt._cloneObject(t),e&&(n.name||(n.name=e),n.id=e)),n},Qt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let n in t){let i=t[n];e.push(n+": "+JSON.stringify(i,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Qt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Qt.prototype.getDefinition=Qt.prototype.getGroup,Qt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let n in e)t.push(e[n]);return t},Qt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Qt.prototype.getGroupMap=function(){return this._groupMap},Qt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let n in t){let i=t[n],o=Qt._cloneObject(i);e[n]=o}return e},Qt.prototype.rebuildMap=function(){let t,e,n=this._groupMap,i=this._childToParent={},o=Object.keys(n),r=o.length;for(t=0;t<r;++t){e=o[t];let r=n[e].children,s=r?r.length:0;for(let t=0;t<s;t++)i[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=i[e];r&&(n[e].parentId=r)}},Qt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Qt.prototype.getLeafDescendants=function(t){return Qt.getLeafDescendants(this._groupMap,t)},Qt.prototype.getGroupLevel=function(t){return Qt.calcTreeDepth(this._groupMap,this._groupMap[t])},Qt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,n=e[t]||null;if(n)for(;n.parentId;){let t=e[n.parentId];if(!t)break;n=t}return n},Qt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Qt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],n=this._groupMap[e];for(;n&&n.parentId;)n=this._groupMap[n.parentId],n&&t.push(n.id);return t}}return null},Qt.prototype.getParentId=function(t,e){let n=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(n);for(;t>e&&n;)n=this._childToParent[n],t--}return n||""},Qt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Qt.prototype.setGroups=function(t){let e=this._groupMap={},n=t?t.length:0;for(let i=0;i<n;i++){let n=t[i],o=n.id;o&&(e[o]=Qt._cloneObject(n))}this.rebuildMap()},Qt.prototype.addGroup=function(t){let e=Qt.getGroupId(t);return e?this.setGroup(e,t):e},Qt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Qt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let n=Qt._toGroupDefinition(e,t);this._ungroupChildren(n.children),this._groupMap[t]&&this.removeAllChildren(t);let i=this._childToParent[t];i&&(n.parentId=i),this._groupMap[t]=n;let o=n.children,r=o.length;for(let e=0;e<r;++e){let n=o[e];this._childToParent[n]=t;let i=this._groupMap[n];i&&(i.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Qt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n)this.unsetParent(t[n])}},Qt.prototype.hasGroupChild=function(t,e){let n=this._groupMap[t];if(e&&n){let t=n.children;if(t)return t.indexOf(e)>=0}return!1},Qt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let n=20,i=this._childToParent[e];for(;i&&n;){if(t===i)return!0;--n,i=this._childToParent[i]}}return!1},Qt.prototype.addGroupChild=function(t,e,n){let i=this._groupMap[t];if(e&&i){let o=i.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let i=this._groupMap[e];return i&&(i.parentId=t),null!=n&&n>=0?o.splice(n,0,e):o.push(e),!0}}return!1},Qt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Qt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let n=this._groupMap[t];n&&(n.parentId="");let i=this._groupMap[e];if(i){let e=i.children;if(e&&e.length){let n=e.indexOf(t);n>=0&&e.splice(n,1)}}return!0},Qt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,n=t?t.length:0;if(n){e.children=[];for(let e=0;e<n;++e){let n=t[e];this._childToParent[n]&&(this._childToParent[n]="");let i=this._groupMap[n];i&&(i.parentId="")}return!0}}return!1},Qt.prototype.setGroupChildren=function(t,e){let n=this._groupMap[t];if(n){if(Array.isArray(e)){let i=e.slice();this._ungroupChildren(i),this.removeAllChildren(t),n.children=i;let o=n.id,r=i.length;for(let t=0;t<r;++t){let e=i[t];this._childToParent[e]=o;let n=this._groupMap[e];n&&(n.parentId=o)}return!0}if(!e&&n.children.length)return this.removeAllChildren(t),!0}return!1},Qt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Qt.prototype.setGroupName=function(t,e){let n=this._groupMap[t];return!(!n||n.name===e)&&(n.name=e,!0)};let Zt=function(t){this._element=t||document.createElement("div")};l.inherits(Zt,mt),Zt.prototype._element=null,Zt.prototype._content=null,Zt.prototype._textSpan=null,Zt.prototype._nativeEvents=null,Zt._passiveEvents=null,Zt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Zt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(_t.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},Zt.prototype.addContent=function(t){return null==(t=_t.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Zt.prototype.removeContent=function(t){return null!=(t=_t.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Zt.prototype.listen=function(t,e,n){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,n);this._nativeEvents||(this._nativeEvents={});let i=this._nativeEvents[t];if(!i){if(i=new gt,this._nativeEvents[t]=i,i.dispatch=i.dispatch.bind(i),!Zt._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Zt._passiveEvents={touchstart:t,touchmove:t}}else Zt._passiveEvents={}}this._element.addEventListener(t,i.dispatch,Zt._passiveEvents[t]||!1)}i.listen(e,n)},Zt.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let n=this._nativeEvents[t];n&&n.unlisten(e)}},Zt.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Zt.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Zt.prototype.dispose=function(){this._dispose()},Zt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Zt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let n=this._customEvents[t];n&&n.setEventArgExtender(e)}},Zt.prototype.getElement=function(){return this._element},Zt.prototype.getNextSibling=function(){return this._element.nextSibling},Zt.prototype.getParent=function(){return this._element.parentNode},Zt.prototype.setParent=function(t,e){this._setParent(t,e)},Zt.prototype._setParent=function(t,e){null!==(t=_t.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Zt.prototype.insertBefore=function(t){this._insertBefore(t)},Zt.prototype._insertBefore=function(t){if(null==(t=_t.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Zt.prototype.insertAfter=function(t){(t=_t.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Zt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Zt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Zt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Zt.prototype.toggleClass=function(t,e){let n=this._element;n&&(null==e&&(e=!n.classList.contains(t)),e?n.classList.add(t):n.classList.remove(t))},Zt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Zt.prototype.getClass=function(){return this._element.className},Zt.prototype.setClass=function(t){this._element.className=t},Zt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Zt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Zt.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Zt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Zt.prototype.getStyle=function(t){return this._element.style[t]},Zt.prototype.setStyle=function(t,e){this._element.style[t]=e},Zt.prototype.setStyles=function(t){let e=this._element.style;for(let n in t)e[n]=t[n]},Zt.prototype.getId=function(){return this._element.id},Zt.prototype.setId=function(t){this._element.id=t},Zt.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Zt.prototype.getTextContent=function(){return this._element.textContent},Zt.prototype.setTextContent=function(t){this._element.textContent=t},Zt.prototype.getLeft=function(){return this._element.offsetLeft},Zt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Zt.prototype.getTop=function(){return this._element.offsetTop},Zt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Zt.prototype.getWidth=function(){return this._element.offsetWidth},Zt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Zt.prototype.getHeight=function(){return this._element.offsetHeight},Zt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Zt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Zt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Zt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Zt.prototype.getTooltip=function(){return this.getAttribute("title")},Zt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Zt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Zt.prototype.hide=function(t){this.show(!1===t)},Zt.prototype.isVisible=function(){return"none"!==this._element.style.display},Zt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Zt.prototype.disable=function(t){this.enable(!1===t)},Zt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Zt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Zt.prototype.getScrollTop=function(){return this._element.scrollTop},Zt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Zt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Zt._proto=Zt.prototype;var $t=Zt;let te=function(){this._items=[],this._element=null};l.inherits(te,$t),te.prototype._items=[],te.prototype.hasItem=function(){return!!this._items.length},te.prototype.containItem=function(t){return this._items.indexOf(t)>-1},te.prototype.insertItem=function(t,e){let n=this._items;n.indexOf(t)>-1||(n.push(t),e&&(t._order=e),n.length&&n.sort(te._iconComparer),this._updatePanelItems())},te.prototype.removeItem=function(t){let e=this._items,n=-1;if(t)for(let i=e.length;--i>=0;){let o=e[i];if("string"==typeof t){if(o.classList.contains(t)){n=i;break}}else if(o===t){n=i;break}}else n=e.length-1;let i=null;return n>-1&&(i=e.splice(n,1)[0]),this._updatePanelItems(),i},te.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},te._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},te.prototype._updatePanelItems=function(){let t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(let n=0;n<t.length;n++)e.appendChild(t[n])}};var ee=te;let ne=function(t,e){this._id=ne._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};l.inherits(ne,$t),ne.prototype._aligner=null,ne._runningId=0,ne.prototype._id=0,ne.prototype._width=-1,ne.prototype._height=-1,ne.prototype._visible=!0,ne.prototype._rawContent,ne.prototype._section=null,ne.prototype._contentLocked=!1,ne.prototype._collapsedState=0,ne.prototype._floatingPanel=null,ne.prototype._frontIcon=null,ne.prototype._tooltipInfo=null,ne.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},ne.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},ne.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},ne.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},ne.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},ne.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},ne.prototype.setParent=function(t,e){let n=_t.getElement(t);if(n){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=n.firstChild),t?n.insertBefore(this._element,t):n.appendChild(this._element)}else this.removeParent()},ne.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},ne.prototype.insertBefore=function(t){let e=_t.getElement(t);if(null==e)return void this.setParent(this.getParent());let n=e.parentNode;null!=n&&(this.initialize(),n.insertBefore(this._element,e))},ne.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},ne.prototype.getTextElement=function(){return this._textSpan},ne.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},ne.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},ne.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},ne.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},ne.prototype.fillParentWidth=function(t){return!1},ne.prototype.fillParentHeight=function(t){return!1},ne.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},ne.prototype.isVisible=function(){return this._visible},ne.prototype.getScrollLeft=function(){return 0},ne.prototype.getScrollTop=function(){return 0},ne.prototype.isEndOfHorizontalScroll=function(){return!0},ne.prototype.isEndOfVerticalScroll=function(){return!0},ne.prototype.hasElement=function(){return null!==this._element},ne.prototype.getSection=function(){return this._section},ne.prototype.initialize=function(){return null==this._aligner&&(_t.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._aligner.role="gridcell",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},ne.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},ne.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},ne.prototype.isFrozen=_t._deprecatedFunction,ne.prototype.freezeLayout=_t._deprecatedFunction,ne.prototype.setAutoContentClipping=_t._deprecatedFunction,ne.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},ne.prototype.lockContent=function(t){this._contentLocked=!1!==t},ne.prototype.reset=function(){if(!this._element)return;let t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();let n=this.blinkState;n&&(n.timerId>=0&&clearInterval(n.timerId),delete this.blinkState),delete this.trendState;let i=this.blinking;i&&(i.blinking>=0&&clearTimeout(i.blinking),i.cell=null,i.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},ne.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},ne.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},ne.prototype.insertFloatingIcon=function(t,e){if(!t)return;let n=this._floatingPanel;n||(n=this._floatingPanel=new ee),n.insertItem(t,e),n.addClass("floating-panel");let i=this._element;i.contains(n.getElement())||i.appendChild(n.getElement())},ne.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),n},ne.prototype.insertFrontIcon=function(t,e){if(!t)return;let n=this._frontIcon;n||(n=this._frontIcon=new ee),n.insertItem(t,e),n.addClass("front-panel");let i=this._element;i.contains(n.getElement())||i.insertBefore(n.getElement(),i.firstChild)},ne.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(n=e.getElement(),this._element.removeChild(n),this._frontIcon=null),n},ne.prototype.getCellId=function(){return this._id},ne.prototype.updatePadding=function(){},ne.prototype.collapse=function(t,e){let n,i=!1!==t;return n=i?e?2:1:0,this._collapsedState!==n&&(i?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=n,!0)},ne.prototype.isCollapsed=function(){return 0!==this._collapsedState},ne.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},ne.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},ne.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},ne.prototype.setTooltip=function(t){this.setTooltipInfo("userTooltip",t),this.updateTooltip()},ne.prototype.setTooltipInfo=function(t,e){let n=this._tooltipInfo;n||(n=this._tooltipInfo={}),n[t]=e},ne.prototype.updateTooltip=function(){let t=this._tooltipInfo;if(!t)return;let e="",n=null;t.clippedText&&(e=n=t.clippedTextTooltip),null==t.groupHeaderTooltip?!1!==t.columnDefault&&(null!=t.columnDefault?n=t.columnTooltip:e=t.columnTooltip):!1!==t.groupHeaderDefault&&(null!=t.groupHeaderDefault?n=t.groupHeaderTooltip:e=t.groupHeaderTooltip),null!=t.userTooltip&&(n=t.userTooltip),null==n&&(n=e),n?this.getAttribute("title")!==n&&this.setAttribute("title",n):null!=this.getAttribute("title")&&this.removeAttribute("title")},ne.prototype.getTooltipInfo=function(t){return this._tooltipInfo?this._tooltipInfo[t]:null},ne.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},ne.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},ne._proto=ne.prototype;var ie=ne;let oe=function(){this._ends=[],this._cols=[]};oe.prototype._laneCount=0,oe.prototype._defaultSize=10,oe.prototype._defaultScalability=!0,oe.prototype._homogeneous=!0,oe.prototype._visibility=!0,oe.prototype._ends,oe.prototype._cols,oe.prototype._bits=[1,2,4,8],oe.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,n=0;if(this._homogeneous){let i=this._defaultSize;e=Math.floor(t/i),n=(e+1)*i}else e=_t.upperBound(this._ends,t),n=this._ends[e];return(e>=this._laneCount||t>=n)&&(e=~e),e},oe.prototype.dispose=function(){this._cols=this._ends=null},oe.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},oe.prototype._isAtDefaultSize=function(t){let e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},oe.prototype.isHomogeneous=function(){return this._homogeneous},oe.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},oe.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},oe.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},oe.prototype.getLaneCount=function(){return this._laneCount},oe.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},oe.prototype.getDefaultLaneSize=function(){return this._defaultSize},oe.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},oe.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},oe.prototype.setLaneDefaultSize=function(t,e){if(!(t<0||t>=this._laneCount)&&e>=0){this._newColumn(t).defaultSize=e}},oe.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let n=this._cols[e];n&&(n.invisibility||(null!=n.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,n.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},oe.prototype.getDefaultScalability=function(){return this._defaultScalability},oe.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},oe.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},oe.prototype.setTrackSize=function(t){let e=0,n=0,i=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?i.push(e):n+=this._getFixedSize(t)):i.push(e)}if(i.length<=0)return null;let o=this._distributeLaneSize(t-n,i),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let n=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-n,r=!0)}}return r?s:null},oe.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,n=0;return e>0&&(t-=e,n=e*this._defaultSize),this._ends[t-1]+n},oe.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},oe.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},oe.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},oe.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let n=this._cols[t];return(null==n||n.customSize!==e)&&(n=this._newColumn(t),n.customSize=e,this._setCalculatedLaneSize(t,e))},oe.prototype.setLaneProperty=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(null==i||i[e]!==n)&&(i=this._newColumn(t),i[e]=n,!0)},oe.prototype.getLaneProperty=function(t,e){let n=this._cols[t];return n&&null!=n[e]?n[e]:null},oe.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},oe.prototype.setMinimumLaneSize=function(t,e,n){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let i=this._newColumn(t);return i.minSize=e,n&&this.getLaneScalability(t)&&(i.customSize=e),this._setCalculatedLaneSize(t)}return!1},oe.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},oe.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},oe.prototype.hideLane=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._newColumn(t),o=!i.invisibility,r=null!=n?this._bits[n]:1;return!1!==e?i.invisibility|=r:i.invisibility&=~r,o!==!i.invisibility&&this._setCalculatedLaneSize(t)},oe.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let n=this._cols[t];if(n){let t=null!=e?this._bits[e]:1;if(n.invisibility&t)return!1}}return!0},oe.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},oe.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},oe.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return(!n||n.scalability!==e)&&(n=this._newColumn(t),n.scalability=e,!0)},oe.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);let n=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,n},oe.prototype.insertLane=function(t,e){t<0&&(t=0);let n=1;if(_t.isNumber(e)){if(e<=0)return;n=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+n);else if(this._laneCount+=n,this._markDirtyIndex(t),_t.insertEmptyItems(this._cols,t,n),e){let i=t+n;for(let n=t;n<i;++n)this.deserializeLane(n,e)}},oe.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t===e)return;let n=t<e?t:e;this._markDirtyIndex(n),_t.moveArrayItem(this._cols,t,e)},oe.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let n=this._cols[t];return n?(e.size=n.customSize,e.minSize=n.minSize,e.visible=!n.invisibility,e.scalable=n.scalability,e):e},oe.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let n=e.size;null!=n&&this.setLaneSize(t,n),n=e.minSize,null!=n&&this.setMinimumLaneSize(t,n),n=e.visible,null!=n&&this.showLane(t,n),n=e.scalable,null!=n&&this.setLaneScalability(t,n)},oe.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let e=0,n=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)n+=this.getLaneSize(e),this._ends[e]=n},oe.prototype._setCalculatedLaneSize=function(t,e){let n=this._cols[t];if(this._visibility&&!n.invisibility){if(null==e&&(e=null!=n.customSize?n.customSize:this._defaultSize),!n.scalability){let t=null!=n.minSize?n.minSize:0;e<t&&(e=t)}}else e=0;return n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},oe.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},oe.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},oe.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},oe.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let n=0,i=0,o=0,r=0,s=[],l=[],a=[];for(n=e.length;--n>=0;)o=e[n],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),i+=l[o];let u=!0;for(;u;)for(u=!1,n=e.length;--n>=0;){o=e[n];let h=s[o],p=l[o];r=t*p/i,r<=h&&(u=!0,a[o]=h,t-=h,i-=p,e.splice(n,1))}let h=e.length-1,p=0,d=0;for(n=h;--n>=0;){o=e[n],r=t*l[o]/i;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},oe.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},oe.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},oe.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let n=t.getLaneCount(),i=this.getLaneCount(),o=e+n;o>i&&(o=i);let r=0;for(let n=e;n<o;++n){let e=t.getLaneSize(r++),i=this._newColumn(n);i.customSize!==e&&(i.customSize=e,i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(n)))}};var re=oe;let se=function(){};se.prototype.hitTest=function(t,e,n){},se.prototype.hitTestX=function(t){},se.prototype.hitTestY=function(t){},se.prototype.getDefaultColumnWidth=function(){},se.prototype.setDefaultColumnWidth=function(t){},se.prototype.getDefaultRowHeight=function(){},se.prototype.setDefaultRowHeight=function(t){},se.prototype.getColumnWidth=function(t){},se.prototype.setColumnWidth=function(t,e){},se.prototype.getRowHeight=function(t){},se.prototype.setRowHeight=function(t,e){},se.prototype.isColumnVisible=function(t){},se.prototype.hideColumn=function(t,e){},se.prototype.isRowVisible=function(t){},se.prototype.hideRow=function(t,e){},se.prototype.getMinimumColumnWidth=function(t){},se.prototype.setMinimumColumnWidth=function(t,e){},se.prototype.getMinimumRowHeight=function(t){},se.prototype.setMinimumRowHeight=function(t,e){},se.prototype.getCellLeft=function(t){},se.prototype.getCellTop=function(t){},se.prototype.getCellWidth=function(t,e){},se.prototype.getCellHeight=function(t,e){},se.prototype.hasCellSpan=function(){},se.prototype.getCellRowSpan=function(t,e){},se.prototype.setCellRowSpan=function(t,e,n){},se.prototype.getCellColSpan=function(t,e){},se.prototype.setCellColSpan=function(t,e,n){},se.prototype.clearCellSpans=function(){},se.prototype.clearColumnSpans=function(t){},se.prototype.clearColumnCustomizations=function(){},se.prototype.clearRowCustomizations=function(){},se.prototype.getColumnScalability=function(t){},se.prototype.setColumnScalability=function(t,e){},se.prototype.getRowScalability=function(t){},se.prototype.setRowScalability=function(t,e){},se.prototype.getCell=function(t,e,n){},se.prototype.getCellContent=function(t,e){},se.prototype.setCellContent=function(t,e,n){},se.prototype.getColumn=function(t){},se.prototype.getColumnCount=function(){},se.prototype.setColumnCount=function(t){},se.prototype.getRowCount=function(){},se.prototype.setRowCount=function(t,e){},se.prototype.getVisibleRowCount=function(){},se.prototype.addRow=function(t){},se.prototype.removeRow=function(t){},se.prototype.setBorders=function(t,e,n,i){},se.prototype.getColumnStyle=function(t,e){},se.prototype.setColumnStyle=function(t,e,n){},se.prototype.enableColumnClass=function(t,e,n){},se.prototype.hasColumnClass=function(t,e){},se.prototype.enableRowClass=function(t,e,n){},se.prototype.setRowStyle=function(t,e,n,i){},se.prototype.getRelativePosition=function(t){},se.prototype.getContentWidth=function(){},se.prototype.getContentHeight=function(){},se.prototype.getCellsByRowIndex=function(t){},se.prototype.disableHorizontalGridLine=function(t){},se.prototype.disableVerticalGridLine=function(t){},se.prototype.enableShading=function(t){},se.prototype.setTransposedShading=function(t){},se.prototype.enableRowHighlighting=function(t){},se.prototype.getRowHighlight=function(){},se.prototype.setRowHighlight=function(t){},se.prototype.getSelectedRows=function(){},se.prototype.getSelectedRowCount=function(){},se.prototype.isSelectedRow=function(t){},se.prototype.getRowAnchor=function(){},se.prototype.setRowAnchor=function(t){},se.prototype.setSelectedRow=function(t,e){},se.prototype.selectSingleRow=function(t){},se.prototype.selectRowRange=function(t,e){},se.prototype.clearSelectedRows=function(){},se.prototype.getFirstSelectedRow=function(){},se.prototype.getLastSelectedRow=function(){},se.prototype.activateColumn=function(t,e){},se.prototype.activateRows=function(t,e,n){},se.prototype.moveRowsToTop=function(t){},se.prototype.getFirstIndexInView=function(){},se.prototype.getLastIndexInView=function(){},se.prototype.isInCurrentView=function(t){},se.prototype.getFrozenLayout=function(){},se.prototype.setFrozenLayout=function(t){},se.prototype.insertColumn=function(t,e){},se.prototype.removeColumnAt=function(t){},se.prototype.moveColumn=function(t,e){},se.prototype.enableRowVirtualization=function(t){},se.prototype.enableColumnVirtualization=function(t){},se.prototype.getColumnIndex=function(t){},se.prototype.getCellIndex=function(t,e){},se.prototype.getIndex=function(){},se.prototype.setIndex=function(t){},se.prototype.getRowOffset=function(){},se.prototype.setRowOffset=function(t){},se.prototype.updateLayout=function(){},se.prototype.stretchCell=function(t,e,n,i){},se.prototype.unstretchCell=function(t,e){},se.prototype.unstretchAllCells=function(){},se.prototype.getStretchedCell=function(t,e){},se.prototype.getStretchedCells=function(){},se.prototype.updateStretchedCells=function(){},se.prototype.getColumnHost=function(){},se.prototype.setHidingMethod=function(t){},se.prototype.getHidingMethod=function(){},se.prototype.setColumnVisibility=function(t,e,n){},se.prototype.getRowLayout=function(){},se.prototype.reserveRightSpace=function(t){},se.prototype.getReservedSpace=function(){},se.prototype.getComputedStyle=function(){},se.prototype.isColumnActive=function(t){},se.prototype.setRowAttributes=function(t,e){},se.prototype.getContextRow=function(t){},se.prototype.selectColumn=function(t,e){},se.prototype.isSelectedColumn=function(t){},se.prototype.selectCell=function(t,e,n){},se.prototype.setCellBounds=function(t,e,n,i){},se.prototype.getHorizontalLayout=function(){},se.prototype.calculateColumnBounds=function(t,e,n,i){},se.prototype.updateColumnBounds=function(t,e,n){},se.prototype.updateColumnSeparators=function(){};let le=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};l.inherits(le,$t),le.prototype._nextSibling=null,le.prototype._parent=null,le.prototype._section=null,le.prototype._cells=null,le.prototype._cellStart=0,le.prototype._cellEnd=0,le.prototype._autoStyleUpdating=!1,le.prototype._deactivation=!1,le.prototype._sizeClasses=null,le.prototype._colLeft=0,le.prototype._absolute=!1,le.prototype._scrollFrame=null,le.prototype._invisibility=0,le.prototype._bits=[1,2,4,8],le.prototype._pinned=!0,le.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},le.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},le.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},le.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},le.prototype.setStyle=function(t,e){let n=this._element;n.style[t]=e,n.style.backgroundColor?n.classList.contains("no-shading")||n.classList.add("no-shading"):n.classList.contains("no-shading")&&n.classList.remove("no-shading")},le.prototype.setStyles=function(t){let e=this._element,n=e.style;for(let e in t)n[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},le.prototype.show=function(t){this.setVisibility(0,!1!==t)},le.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,n=0;t>0&&t<=24?n=3:t>24&&t<=40?n=2:t>40&&t<60&&(n=1);let i=this._sizeClasses;if(i){if(i.length>n){for(e=i.length;--e>=n;)this.removeClass(i[e]);i.length=n}n||(this._sizeClasses=null)}if(n)for(i||(i=[],this._sizeClasses=i),e=i.length;e<n;++e)i[e]=le._sizeClasses[e],this.addClass(i[e]);return this.setVisibility(1,t>0),!0},le._sizeClasses=["small-col","very-small-col","tiny-col"],le.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},le.prototype.getParent=function(){return this._parent},le.prototype.setParent=function(t,e){if(!this._element)return;this._parent=_t.getElement(t);let n=this._section?this._section.getHidingMethod():"";this._invisibility&&!n||this._setParent(this._parent,e)},le.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},le.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},le.prototype.setNextSibling=function(t){this._nextSibling=t},le.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},le.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},le.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},le.prototype.deactivate=function(t){this.activate(!1===t)},le.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new ie(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},le.prototype.getCell=function(t){return this._cells[t]||null},le.prototype.collapseCells=function(t,e,n,i,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!i&&(r|=s.collapse(n,o));for(let i=1;i<e&&(s=this._cells[t+i],s);++i)r|=s.collapse(n,o);r&&(n?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},le.prototype.uncollapseAllCells=_t._deprecatedFunction,le.prototype.activateCells=function(t,e){let n,i=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let i=this._cellEnd-e;if(i>0){for(n=this._cellEnd;--n>=e;)this._cells[n].removeParent();return void(this._cellEnd=e)}if(!(i<0))return;t=this._cellEnd,this._cellEnd=e}else{for(n=this._cellEnd;--n>=this._cellStart;)this._cells[n].removeParent();this._cellStart=t,this._cellEnd=e}for(n=t;n<e;++n){let t=this._cells[n];t.isKeptInDoc()&&(t.initialize(),i.appendChild(t.getElement()))}},le.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let n=0;n<t;++n){let t=this._cells[n];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=_t.cycleArray(this._cells,t)},le.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let n=this._cells[e];n.isKeptInDoc()?t.appendChild(n.getElement()):this._hasCollapsedCells=!0}},le.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},le.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e){if(this._cells[e].getElement()===t)return e}return-1},le.prototype.getSection=function(){return this._section},le.prototype.log=function(){let t=[],e=this._cells.length;for(let n=0;n<e;++n)t.push(this._cells[n].getTextContent());return t},le.prototype.getVisibility=function(){return!this._invisibility},le.prototype.setVisibility=function(t,e){let n=!this._invisibility,i=this._bits[t]||1;e?this._invisibility&=~i:this._invisibility|=i;let o=!this._invisibility;if(n!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},le.prototype.updateLayout=function(){},le.prototype.setScrollState=function(t,e,n){this._scrollFrame=t,this.enableAbsolutePosition(n),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},le._proto=le.prototype;var ae=le;let ue=function(){this._items=[]};ue.prototype._items=null,ue.prototype.dispose=function(){this._items=null},ue.prototype.setItemCount=function(t){let e=this._items,n=e.length;if(n!==t)for(e.length=t;n<t;)e[n++]={}},ue.prototype.getItem=function(t){return this._items[t]||null},ue.prototype.moveItemsToTop=function(t){this._items=_t.cycleArray(this._items,t)};var he=ue;let pe=function(t,e,n){t.setTop(e.getLaneStart(n)),t.setHeight(e.getLaneSize(n))},de=function(t,e,n,i){if(n){let o=e.getLaneStart(n);t.setLeft(o),t.setWidth(i-o)}else t.setStyle("left",""),t.setWidth(i)},ce=function(t,e,n){this._trackX=t,this._trackY=e,this._section=n,this._cells=[]};ce.prototype._trackX,ce.prototype._trackY,ce.prototype._section,ce.prototype._cells,ce.prototype._activeCount=0,ce.prototype._stretchSize=0,ce.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let n=t[e];n&&n.dispose()}}t.length=0},ce.prototype.setStretchSize=function(t){this._stretchSize=t},ce.prototype.getStretchSize=function(){return this._stretchSize},ce.prototype.setCellCount=function(t){let e=this._cells,n=e.length;if(n<t)for(e.length=t;n<t;)e[n++]=null;else if(n>t){for(;--n>=t;){let t=e[n];t&&t.dispose()}e.length=t}},ce.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ce.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},ce.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ce.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];if(n&&n.getParent()&&n.getElement()===t)return i}}}return-1},ce.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let n=this._cells[t]||null;n||(n=new ie(null,this._section),n.addClass("tr-stretched"),n.stretched=!0,this._cells[t]=n);let i=n.getElement();i.stretched=!0,i._colIndex!==e&&(i._colIndex=e,e>0?i.classList.add("right-stretching"):i.classList.remove("right-stretching")),i._rowIndex!==t&&(i._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return de(n,this._trackX,e,o),pe(n,this._trackY,t),n},ce.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ce.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let n=t[e];n&&n.setParent(null)}}},ce.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._trackY,r=this._stretchSize||i.getTrackSize();for(let s=0;s<n;++s){let n=e[s];n&&n.getParent()&&(++t,de(n,i,n.getElement()._colIndex,r),pe(n,o,s))}this._activeCount=t}},ce.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._stretchSize||i.getTrackSize();for(let r=0;r<n;++r){let n=e[r];n&&n.getParent()&&(++t,de(n,i,n.getElement()._colIndex,o))}this._activeCount=t}},ce.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackY;for(let o=0;o<n;++o){let n=e[o];n&&n.getParent()&&(++t,pe(n,i,o))}this._activeCount=t}},ce.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=_t.cycleArray(this._cells,t),this.updateYAxis())};var _e=ce;let fe=function(t,e){this.indexX=t,this.indexY=e};fe.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},fe.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},fe.prototype.register=function(t,e){this._register(t,e,!0)},fe.prototype.unregister=function(t,e){this._register(t,e,!1)},fe.prototype._register=function(t,e,n){let i=t.indexOf(this);n?i<0&&t.push(this):i>=0&&t.splice(i,1);let o=n?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let n=this.indexY;n<s;++n)e[t+","+n]=o},fe.prototype.indexX,fe.prototype.indexY,fe.prototype.colSpan=1,fe.prototype.rowSpan=1,fe.prototype.prevColSpan=1,fe.prototype.prevRowSpan=1,fe.prototype.retVal=0;var ge=fe;let ye=function(){this._spans=[],this._occupiedMap={}};ye.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},ye.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},ye.prototype._mapCellSpans=function(){let t,e,n=this._spans;for(this._spans=[],this._occupiedMap={},t=n.length;--t>=0;)e=n[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},ye.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let n=!1;for(let i=this._spans.length;--i>=0;){let o=this._spans[i];o.indexX>=t&&(n=!0,o.indexX+=e)}return!(!n||this._frozenMapping)&&(this._mapCellSpans(),!0)},ye.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let n=t+","+e,i=this._occupiedMap[n];return!i||i.isOccupiedIndices(t,e)?null:(i.unregister(this._spans,this._occupiedMap),i)},ye.prototype.removeSpanByColIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexX===t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},ye.prototype.removeSpanStartedFromRowIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexY>=t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},ye.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},ye.prototype.hasSpan=function(){return this._spans.length>0},ye.prototype.getSpan=function(t,e){let n=this.getOccupyingSpan(t,e);return n&&n.isSpanIndices(t,e)?n:null},ye.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},ye.prototype.getAllSpans=function(){return this._spans},ye.prototype.getColSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexX-t:n.colSpan},ye.prototype.getRowSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexY-e:n.rowSpan},ye.prototype.setColSpan=function(t,e,n){return this._updateSpan(t,e,!0,n)},ye.prototype.setRowSpan=function(t,e,n){return this._updateSpan(t,e,!1,n)},ye.prototype._updateSpan=function(t,e,n,i){i<1&&(i=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(n){if(c===i)return o;if(c>i)p=t+i,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+i}s=e+_}else{if(_===i)return o;if(_>i)d=e+i,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+i}r=t+c}if(f){let n=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;n.push(a)}for(null==o&&(o=new ge(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=n.length;--u>=0;)this._occupiedMap[n[u]]=o}else{if(n?i+_<=2:i+c<=2){a=t+","+e;let n=this._spans.indexOf(o);this._spans.splice(n,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return n?(o.prevColSpan=o.colSpan,o.colSpan=i):(o.prevRowSpan=o.rowSpan,o.rowSpan=i),o.retVal=f?1:-1,o},ye.prototype._spans,ye.prototype._occupiedMap,ye.prototype._frozenMapping=!1;var me=ye;let Ce=function(){this._selections=[]};Ce.prototype.clone=function(){let t=new Ce;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},Ce.prototype.toString=function(){return this._selections.join(", ")},Ce.prototype.select=function(t){return!(t<0)&&(!!this._select(t)&&(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),!0))},Ce.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},Ce.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,n=this._selections;for(let i=t;i<=e;++i)n[i]&&(n[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},Ce.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},Ce.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},Ce.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let n=t,i=n+e;if(e<0&&(i=n+1,n=i+e),!(n>=i)){this._anchor=t,(this._firstIndex<0||n<this._firstIndex)&&(this._firstIndex=n),(this._lastIndex<0||i>=this._lastIndex)&&(this._lastIndex=i-1);for(let t=n;t<i;++t)this._select(t)}},Ce.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let n=t+e;if(e<0&&(n=t+1,t=n+e),this._firstIndex>=t&&this._lastIndex<n)return void this.clearAllSelections();this._anchor>=t&&this._anchor<n&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<n&&(this._firstIndex=this._findNextSelection(n-1)),this._lastIndex>=t&&this._lastIndex<n&&(this._lastIndex=this._findPrevSelection(t));let i=0;for(i=t;i<n;++i)this._selections[i]&&(this._selections[i]=!1,--this._count)},Ce.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let n=t+e;if(e<0&&(n=t+1,t=n+e),n<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<n;++e)if(this._selections[e])return!0;return!1},Ce.prototype.getSelection=function(t){return!0===this._selections[t]},Ce.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},Ce.prototype.getSelectionAnchor=function(){return this._anchor},Ce.prototype.setSelectionAnchor=function(t){this._anchor=t},Ce.prototype.getSelectionCount=function(){return this._count},Ce.prototype.getFirstSelectedIndex=function(){return this._firstIndex},Ce.prototype.getLastSelectedIndex=function(){return this._lastIndex},Ce.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,n=this._selections,i=this._lastIndex;for(let o=this._firstIndex;o<=i;++o)n[o]&&(t[e++]=o);return t}return[]},Ce.prototype.getConnectedRanges=function(t,e){if(this._count>0){let n=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let i=null;for(let o=t;o<e;++o)this._selections[o]?i||(i=[o,-1]):i&&(i[1]=o-1,n.push(i),i=null);return i&&(i[1]=this._lastIndex,n.push(i),i=null),n}return[]},Ce.prototype.getSelectionMap=function(){return this._selections},Ce.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},Ce.prototype.copyFrom=function(t,e,n,i){if(i<=0)return;let o=e+n;if(null!=t)if(!1!==t.hasSelection(e,i)){for(let n=0;n<i;++n)t._selections[e+n]?this.select(o+n):this.deselect(o+n);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+i&&(this._anchor=t._anchor+n)}else this.deselectRange(o,i);else this.deselectRange(o,i)},Ce.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},Ce.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},Ce.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},Ce.prototype._selections=null,Ce.prototype._count=0,Ce.prototype._anchor=-1,Ce.prototype._firstIndex=-1,Ce.prototype._lastIndex=-1;var Se=Ce;let we=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};we.prototype._func=null,we.prototype._delay=0,we.prototype._timerId=0,we.prototype._pending=!1,we.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},we.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},we.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},we._proto=we.prototype;var be=we;let Re=function(){let t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new be(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),Re._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};l.inherits(Re,$t),Re.prototype._vertical=!0,Re.prototype._step=0,Re.prototype._parentNode=null,Re.prototype._hostClassName="",Re.prototype._trackContent=null,Re.prototype._panes=null,Re.prototype._paneSliders=null,Re.prototype._enabled=!0,Re.prototype._active=!1,Re.prototype._isFrozen=!1,Re.prototype._otherScrollbar=null,Re.prototype._autoHideScrollbar=!0,Re.prototype._trackSize=120,Re.prototype._tContentSize=0,Re.prototype._tScrollVal=0,Re.prototype._tPercentVal=0,Re.prototype._paneSize=0,Re.prototype._pContentSize=0,Re.prototype._pScrollVal=0,Re.prototype._footerCount=0,Re.prototype._fadingId=0,Re.prototype._postponeFading=!1,Re.prototype._layoutChanged=!1,Re.prototype._contentDirty=!0,Re.prototype._layoutDirty=!0,Re.prototype._touchInput=!0,Re.prototype._swiping=!1,Re.prototype._touchDrag=!1,Re.prototype._startPos,Re.prototype._endPos,Re.prototype._smoothing=!0,Re.prototype._smoothingId=0,Re.prototype._smoothingSpeed=0,Re.prototype._wheelScrolling="",Re.prototype._mouseWheelLogic=null,Re.prototype._onThicknessChanged=null,Re._trackThickness=0,Re._queryTimeout=0,Re._queryStarted=!1,Re._outerDummy=null,Re._innerDummy=null,Re._listeners=null,Re.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},Re._queryNativeTrackThickness=function(t){if(Re._queryStarted||Re._repeatQuery(),t&&Re._trackThickness<=0){let e=Re._listeners;e||(e=Re._listeners=[]),e.push(t)}},Re._repeatQuery=function(){Re._queryStarted=!0,Re._retrieveNativeTrackThinkness()||(Re._queryTimeout+=100,Re._queryTimeout<3e3?setTimeout(Re._repeatQuery,Re._queryTimeout):(Re._trackThickness=13,Re._clearStaticResources()))},Re._retrieveNativeTrackThinkness=function(){if(Re._trackThickness>0)return!0;let t=Re._innerDummy,e=Re._outerDummy;t||(t=Re._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=Re._outerDummy=document.createElement("div"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);let n=t.offsetWidth;e.style.overflow="scroll";let i=t.offsetWidth;return n==i&&(i=e.clientWidth),document.body.removeChild(e),(Re._trackThickness=n-i)>0&&(Re._clearStaticResources(),!0)},Re._clearStaticResources=function(){Re._innerDummy=Re._outerDummy=null;let t=Re._listeners;if(t){Re._listeners=null;let e={};for(let n=t.length;--n>=0;)t[n](e)}},Re.updateTrackThickness=function(){Re._trackThickness=0,Re._queryTimeout=0,Re._queryStarted=!1,Re._queryNativeTrackThickness()},Re.prototype.dispose=function(){let t=Re._listeners;if(t){let e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},Re.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},Re.prototype.getParent=function(){return this._parentNode},Re.prototype.setParent=function(t,e){let n=_t.getElement(t),i=this._parentNode!==n;i&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(n,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=n,i&&this.addWheelListener(this._parentNode)},Re.prototype.attachToExternalElement=function(t){this.setParent(t);let e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},Re.prototype._onActiveStateChange=function(){let t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);let n=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(n,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},Re.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},Re.prototype.isActive=function(){return this._active},Re.prototype.isEnabled=function(){return this._enabled},Re.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},Re.prototype.disable=function(t){this.enable(!1===t)},Re.prototype.getTrackSize=function(){return this._trackSize},Re.prototype.getPaneSize=function(){return this._paneSize},Re.prototype.getContentSize=function(){return this._pContentSize},Re.prototype.getTrackThickness=function(){return Re._trackThickness},Re.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},Re.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},Re.prototype.calculateContentSize=function(){return 0},Re.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},Re.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},Re.prototype.invalidateContent=function(){this._contentDirty=!0},Re.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),n=this._pScrollVal;return 0===n||n>0&&e>0&&n<e},Re.prototype.flash=function(){this.update(),this._flash()},Re.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},Re.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let n=!1;this._pScrollVal!==t&&(this._pScrollVal=t,n=!0),this._setTrackScrollVal(t),n?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})},Re.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let n=this._step;if(n){if((t=Math.round(t/n)*n)-n/2<=0)return 0;if(t+n/2>=e)return e}return Math.round(t)},Re.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let n=this.getScrollGap();return e===n?t:this._tPercentVal*n},Re.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),n=0;if(e>0){if(t>0){let i=this.getScrollGap();n=e===i?t:t/i*e,n=Math.round(n)}n>=e&&(n=e)}if(n!==this._tScrollVal){this._tScrollVal=n,this._tPercentVal=e?n/e:0;let t=this._element;return this._vertical?t.scrollTop=n:t.scrollLeft=n,!0}return!1},Re.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},Re.prototype._getScrollValue=function(){return this._pScrollVal},Re.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},Re.prototype._isStartOfScroll=function(){return!this._pScrollVal},Re.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},Re.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},Re.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let n=e.getElement();for(;null!==n.firstChild;)n.removeChild(n.firstChild)}},Re.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","-1"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},Re.prototype.disableTouchInput=function(t){this._touchInput=!1===t},Re.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},Re.prototype.getAutoHide=function(){return this._autoHideScrollbar},Re.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},Re.prototype.setFooterCount=function(t){this._footerCount=t},Re.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},Re.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let e=this.getTrackSize(),n=this.getPaneSize();if(this._tContentSize=this._pContentSize/n*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(n);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(n)}this._scrollTo(this._pScrollVal,!0)},Re.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},Re._preventVScrolling=function(t){t.currentTarget.scrollTop=0},Re._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},Re.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new $t(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",Re._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",Re._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let n=new $t(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},Re.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},Re.prototype._onTrackScroll=function(t){if(!this._element)return;let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,n=this._convertTrackToPane(e);n=this._calcProperScrollValue(n),n!==this._pScrollVal&&(this._pScrollVal=n,this._dispatchScrollEvent(t))},Re.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},Re.prototype._setSliderPosition=function(t,e){let n="",i="",o=this._vertical?"top":"left";t&&(e?i=t+"px":(n=this._vertical?"translateY":"translateX",n+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=n,s[o]=i)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},Re.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},Re.prototype._onKeyDown=function(t){if(this._isFrozen)return void _t._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let e=this.getScrollGap(),n=Math.round(.07*e);n<10?n=10:n>100&&(n=100),37!==t.keyCode&&38!==t.keyCode||(n*=-1),this._scroll(n),_t._preventDefault(t)}},Re.prototype._onTouchStart=function(t){this._isFrozen?_t._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},Re.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void _t._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let n=e._startPos,i=e._endPos;e._getTouchInfo(t,i);let o=this._vertical?n.y-i.y:n.x-i.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(n.scrollValue+o);else{i.timeStamp-n.timeStamp>30&&(e._touchDrag=!0)}t.cancelable&&t.preventDefault()}},Re.prototype._onTouchEnd=function(t){if(this._isFrozen)_t._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,n=this._getTouchInfo(t,this._endPos),i=n.timeStamp-e.timeStamp,o=this._vertical?e.y-n.y:e.x-n.x;this._smoothingSpeed=30*o/i,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},Re.prototype._getTouchInfo=function(t,e){let n=t.changedTouches[0];return e||(e={}),e.x=n.pageX,e.y=n.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},Re.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},Re.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},Re.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},Re.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},Re.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},Re.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},Re.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},Re.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},Re.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void _t._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(_t._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},Re.prototype.setScrollingStep=function(t){this._step=t>0?t:0},Re.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},Re.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},Re._proto=Re.prototype;var ve=Re;let Ie=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",Ie.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};l.inherits(Ie,ve),Ie.prototype._pinnedLeftColumnCount=0,Ie.prototype._pinnedRightColumnCount=0,Ie.prototype.setScrollContent=function(t,e,n,i){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=n>=0?n:0,this._pinnedRightColumnCount=i>0?i:0;let r=e[0],s=r.getColumnCount(),l=s-i;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let i,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(i=0;i<n;++i)o=r.getColumn(i),o.setScrollState(h,null,!1);let d=r.getColumnHost();a.setParent(d);let c=[],_=[];for(i=n;i<l;++i)o=r.getColumn(i),o.setScrollState(null,p,this.isActive()),c.push(o),_.push(o.getElement());for(i=l;i<s;++i)o=r.getColumn(i),o.setScrollState(null,null,!1);let f=r.getReservedSpace();f&&(this.isActive()&&!this._pinnedRightColumnCount?(u.addContent(f),_.push(f)):d.appendChild(f),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=c,u._content=_}this.invalidateContent()},Ie.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},Ie.prototype.getWidth=function(){return this.getPaneSize()},Ie.prototype.getScrollLeft=function(){return this._getScrollValue()},Ie.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},Ie.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},Ie.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},Ie.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},Ie.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},Ie.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let n=t._content;for(let t=n.length;--t>=0;){let i=n[t],o=i?i.style.width:0;o&&(e+=parseFloat(o))}}return e},Ie.prototype.calculateContentSize=function(){return this.getContentWidth()},Ie.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},Ie.prototype._onActivated=function(t){this._updateActivation(!0)},Ie.prototype._onDeactivated=function(t){this._updateActivation(!1)},Ie.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let n=0;n<e;++n){let e=this._paneSliders[n]._columns,i=e?e.length:0;for(let n=0;n<i;++n){let i=e[n];i.getElement()&&i.enableAbsolutePosition(t)}}},Ie._proto=Ie.prototype;var De=Ie;let xe=function(t,e){return t>e?e:t<0?0:t},Ae=function(t){this._boundLayer=t.boundLayer,this._layoutX=t.layoutX,this._layoutY=t.layoutY,this._hscrollbar=t.hscrollbar,this._calculateColumnBounds=t.calculateColumnBounds};Ae.prototype._boundLayer=null,Ae.prototype._layoutX,Ae.prototype._layoutY,Ae.prototype._hscrollbar,Ae.prototype._calculateColumnBounds,Ae.prototype._cellBound=null,Ae.prototype._cbLftIdx=0,Ae.prototype._cbRgtIdx=0,Ae.prototype._cbTopIdx=0,Ae.prototype._cbBtmIdx=0,Ae.prototype.dispose=function(){let t=this._cellBound;if(t){let e=t.parentNode;e&&e.removeChild(t),this._cellBound=null}this._boundLayer=null,this._layoutX=null,this._layoutY=null,this._hscrollbar=null,this._calculateColumnBounds=null},Ae.prototype.setCellBounds=function(t,e,n,i,o){let r=this._cellBound;r||(r=this._cellBound=document.createElement("div"),r.className="selection-bound");let s=t+n,l=e+i,a=this._layoutY.getLaneCount();this._cbLftIdx=xe(t,o),this._cbRgtIdx=xe(s,o),this._cbTopIdx=xe(e,a),this._cbBtmIdx=xe(l,a),this.updateCellBounds()},Ae.prototype.updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,n,i,o,r=this._layoutX,s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=n=i=o=0,l<a&&u<h&&(e=r.getLaneStart(l),n=r.getLaneEnd(a-1),i=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=n-e,d=o-i,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this._calculateColumnBounds(l,a-1,t,c),e=t[0],n=t[1],p=n-e}if(p>0)t.style.left=e+"px",t.style.top=i+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{let e=t.parentNode;e&&e.removeChild(t)}},Ae._proto=Ae.prototype;var Le=Ae;let Te=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new re,e._trackY=new re,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new me,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new he,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new _e(e._trackX,e._trackY,e),e._selectionList=new Se,t&&(e._virOwner=t.owner||null,t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar)),e._virOwner||e._element.classList.add("section"),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Te,$t),Te.prototype._index=-1,Te.prototype._availableRowCount=0,Te.prototype._activeRow=0,Te.prototype._activeRowEnd=0,Te.prototype._colCount=0,Te.prototype._rowCount=0,Te.prototype._hiddenRowCount=0,Te.prototype._trackX,Te.prototype._trackY,Te.prototype._cellSpans,Te.prototype._columns,Te.prototype._firstColumn,Te.prototype._lastColumn,Te.prototype._rightSpace,Te.prototype._rightSpaceSize=0,Te.prototype._frozenLayout=!1,Te.prototype._rowHighlightEnabled=!1,Te.prototype._rowHighlightIndex=-1,Te.prototype._highlightedCells,Te.prototype._coverLayer=null,Te.prototype._stretchedCells=null,Te.prototype._ctx=null,Te.prototype._selectionList,Te.prototype._colVir=!1,Te.prototype._initialized=!1,Te.prototype._hidingMethod="",Te.prototype._virOwner=null,Te.prototype._transformIETimer=0,Te.prototype._ctxRows,Te.prototype._boundLayer=null,Te.prototype._colBounds=null,Te.prototype._colBoundCache=null,Te.prototype._colSelDirty=!1,Te.prototype._hscrollbar=null,Te.prototype._leftColumnSeparator=null,Te.prototype._rightColumnSeparator=null,Te.prototype._cellBoundPainter=null,Te.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._cellBoundPainter&&this._cellBoundPainter.dispose(),this._dispose()},Te.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},Te.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},Te.prototype.setWidth=function(t){if(t<0)return!1;return null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0)},Te.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},Te.prototype.setHeight=function(t){if(t<0)return!1;return null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0},Te.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},Te.prototype.hitTest=function(t,e,n){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;let i=this._trackX.hitTest(t);if(i<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=i,r.rowIndex=o,!0!==n){let t=this._cellSpans.getOccupyingSpan(i,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},Te.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},Te.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},Te.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},Te.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},Te.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},Te.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},Te.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},Te.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},Te.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},Te.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},Te.prototype._startBindingSession=function(t){},Te.prototype._getTempRowHeights=function(){return null},Te.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},Te.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let n=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),n&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),n},Te.prototype._updateRowHeights=function(t,e){let n=0;for(let i=0;i<this._rowCount;++i){let o=t.getLaneSize(e);n|=this._trackY.setLaneSize(i,o),++e}return this._syncLayoutToRows(0,this._rowCount),n},Te.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},Te.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},Te.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},Te.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Te.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},Te.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},Te.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},Te.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Te.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},Te.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},Te.prototype.getCellWidth=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackX.getLaneStart(n.indexX);return this._trackX.getLaneEnd(n.indexX+n.colSpan-1)-t}return this.getColumnWidth(t)},Te.prototype.getCellHeight=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackY.getLaneStart(n.indexY);return this._trackY.getLaneEnd(n.indexY+n.rowSpan-1)-t}return this.getRowHeight(e)},Te.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},Te.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},Te.prototype.setCellRowSpan=function(t,e,n){let i=this._cellSpans.setRowSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Te.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},Te.prototype.setCellColSpan=function(t,e,n){let i=this._cellSpans.setColSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Te.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Te.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let n=e[t];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Te.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},Te.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},Te.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},Te.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},Te.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},Te.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},Te.prototype.getCell=function(t,e,n){if(n&&this._cellSpans.hasSpan()){let n=this._cellSpans.getColSpan(t,e),i=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),i<0&&(e+=i)}return this._getCell(t,e)},Te.prototype.getCellContent=function(t,e){let n=this.getCell(t,e);return null!==n?n.getContent():null},Te.prototype.setCellContent=function(t,e,n){let i=this.getCell(t,e);return null==i?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):i.setContent(n)},Te.prototype.getColumnCount=function(){return this._colCount},Te.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let n=0,i=null;if(e>t)for(n=e;--n>=t;)i=this._columns.pop(),i.dispose(),i===this._firstColumn&&(this._firstColumn=null),i===this._lastColumn&&(this._lastColumn=null);else for(n=e;n<t;++n)i=this._newColumn(n);for(this._updateColumnIndices(),n=e;n<t;++n)this._columns[n].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},Te.prototype.getRowCount=function(){return this._rowCount},Te.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let n,i=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),n=0;n<this._colCount;++n)this._columns[n].setCellCount(t);if(i>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(let e=t;e<i;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(i,t);let o={};o.prevCount=i,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),i<t&&this._insertCells(0,this._rowCount)},Te.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},Te.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},Te.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},Te.prototype.setBorders=function(t,e,n,i){},Te.prototype.getColumnStyle=function(t,e){let n=this._columns[t];return n?n.getStyle(e):null},Te.prototype.setColumnStyle=function(t,e,n){let i=this._columns[t];i&&i.setStyle(e,n)},Te.prototype.enableColumnClass=function(t,e,n){let i=this._columns[t];i&&i.enableClass(e,n)},Te.prototype.hasColumnClass=function(t,e){let n=this._columns[t];return!!n&&n.hasClass(e)},Te.prototype.enableRowClass=function(t,e,n){if(t>=0&&t<this._rowCount)for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).enableClass(e,n)},Te.prototype.setRowStyle=function(t,e,n,i){if(t>=0&&t<this._rowCount){n&&(null==i||i)||(n="");for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).setStyle(e,n)}},Te.prototype.getRelativePosition=function(t){return _t.getRelativePosition(t,this._element)},Te.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},Te.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},Te.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let n=0;n<this._colCount;++n)e[n]=this._columns[n].getCell(t);return e},Te.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},Te.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},Te.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},Te.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},Te.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},Te.prototype.getRowHighlight=function(){return this._rowHighlightIndex},Te.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let n=this._columns[e].getCell(t);this._highlightedCells[e]=n,n.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Te.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Te.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Te.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Te.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},Te.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},Te.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(let n=0;n<e;++n)this._addSelectionUI(n+t)}},Te.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let n=0;n<t;++n)this._removeSelectionUI(e[n]);return t}return 0},Te.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Te.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Te.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Te.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Te.prototype.activateColumn=function(t,e){let n=this._columns[t];if(n){let t=n.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},Te.prototype.activateRows=function(){this._onEnterDocument()},Te.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},Te.prototype.getFirstIndexInView=function(){return 0},Te.prototype.getLastIndexInView=function(){return this._availableRowCount-1},Te.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},Te.prototype.getFrozenLayout=function(){return this._frozenLayout},Te.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},Te.prototype.getColumn=function(t){return this._columns[t]||null},Te.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let n=t<this._colCount,i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let n=o.getCell(t[e]);n&&n.addClass("selected-row")}}return o.activate(n||!this._colVir),o},Te.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._colCount=this._trackX.getLaneCount();let i=this._columns.splice(t,1)[0];return i.dispose(),e.control=i,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},Te.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t===e)return;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.moveLane(t,e);let i=this._columns[t];if(_t.moveArrayItem(this._columns,t,e),i.getElement().offsetParent){let t=e+1,n=this._columns[t]||null;for(;n&&!n.getElement().offsetParent;)n=this._columns[++t];i.insertBefore(n)}this._updateColumnIndices(),this._updateCellSpans(n,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},Te.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},Te.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},Te.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let n=0;n<e;++n)if(this._columns[n].getElement()===t)return n}return-1},Te.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let n=this._columns[t];if(n)return n.getCellIndex(e)}return-1},Te.prototype.getIndex=function(){return this._index},Te.prototype.setIndex=function(t){this._index=t},Te.prototype.getRowOffset=function(){return this._rowOffset},Te.prototype.setRowOffset=function(t){this._rowOffset=t},Te.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},Te.prototype.stretchCell=function(t,e,n,i){let o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<0||e<0||null==e)return null;let r=null;if(!1!==n){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,i?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},Te.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},Te.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},Te.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},Te.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},Te.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},Te.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,n=t?0:this._stretchedCells.getStretchSize();if(!n&&e&&e.getWidth){let t=this.getContentWidth();return n=e.getWidth(),n?(t<n&&(n=t),this._stretchedCells.setStretchSize(n),n):t}return n},Te.prototype._enableStretchCellClass=function(t,e,n){let i=this.getStretchedCell(t);i&&i.enableClass(e,n)},Te.prototype._getViewSize=function(){return this._calculateViewSize()},Te.prototype.getColumnHost=function(){return this._element},Te.prototype.setHidingMethod=function(t){this._hidingMethod=t},Te.prototype.getHidingMethod=function(){return this._hidingMethod},Te.prototype.setColumnVisibility=function(t,e,n){return!!this._trackX.hideLane(t,!e,n)&&(this._syncLayoutToColumns(t),!0)},Te.prototype.getRowLayout=function(){return this._trackY},Te.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},Te.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let e=!1,n=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),n=this._hscrollbar.getPinnedRightColumnCount()),e&&!n?(t.style.top=this._trackY.getLaneStart(this._activeRow)+"px",t.style.left=this._trackX.getLaneStart(this._colCount)+"px",t.style.position="",t.style.display=""):(t.style.position="static",t.style.display="inline-block")},Te.prototype._updateLayers=function(){if(this._rightSpace){let t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._boundLayer&&this._element.appendChild(this._boundLayer),this._coverLayer&&this._element.appendChild(this._coverLayer)},Te.prototype.getReservedSpace=function(){return this._rightSpace},Te.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},Te.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},Te.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let n=0;n<this._colCount;++n){let i=e(n);for(let e=i.length;--e>=0;){let o=i[e],r=this._columns[n].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},Te.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},Te.prototype.selectColumn=function(t,e){if(this.enableColumnClass(t,"selected-column",e),e){this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers())}},Te.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},Te.prototype.selectCell=function(t,e,n){let i=this._getCell(t,e);i&&i.enableClass("selection",n)},Te.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Le({boundLayer:o,layoutX:this._trackX,layoutY:this._trackY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Te.prototype.getHorizontalLayout=function(){return this._trackX},Te.prototype.calculateColumnBounds=function(t,e,n,i){let o=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){let n,i,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),n=i=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,n=this._getViewSize()-i+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>n&&(o=n,s=!0)):t>=a&&(o=this._getViewSize()-i+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>n&&(r=n,l=!0)):e>=a&&(r=this._getViewSize()-i+this._trackX.getLaneEnd(e))}n[0]=o,n[1]=r,i[0]=s,i[1]=l},Te.prototype.updateColumnBounds=function(t,e,n){if(!this._colSelDirty)return;let i=this._colBounds,o=this._colBoundCache;i||(i=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=i.length;for(r=s;r<u;++r)a=i[r],l=a.parentNode,l&&l.removeChild(a);if(i.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",n=n||0,a.style.top=n+"px",a.style.height=this._trackY.getTrackSize()-n+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(i[r]||(i[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1},Te.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let n=!1;this._hscrollbar&&(n=this._hscrollbar.isActive());let i=this._boundLayer,o=this._leftColumnSeparator;if(n&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,n&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let t=this.getColumnCount(),n=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-n-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},Te.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},Te.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Te.prototype._getCell=function(t,e){let n=this._columns[t];return n?n.getCell(e):null},Te.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let n=this._trackY.getLaneStart(t);for(let i=0;i<this._colCount;++i){let o=this._columns[i];o.hasCollapsedCells()||o.setTop(n),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=n+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},Te.prototype._newColumn=function(t){let e=new ae(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let n=this._columns[t+1];e.insertBefore(n)}return e},Te.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},Te.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},Te.prototype._updateColumnIndices=function(){let t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));let n=this._columns[t-1];n!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=n,this._lastColumn&&this._lastColumn.addClass("last"));let i=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(i),i=e}},Te.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},Te.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let n=t;n<e;++n){let t=this._trackY.isAtDefaultSize(n)?-1:this._trackY.getLaneSize(n);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(n).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},Te.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let n={};n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n)},Te.prototype._updateCellSpanSize=function(t,e,n){let i=this._getCell(t,e);if(null!=i)if(n&&n.colSpan>1?(i.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):i.setWidth(-1),n&&n.rowSpan>1)i.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);i.setHeight(t)}},Te.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpanSize(n.indexX,n.indexY,n)}},Te.prototype._updateCellSpan=function(t,e,n,i){this._updateCellSpanSize(t,e,i?n:null),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,i)},Te.prototype._updateCellSpanClass=function(t,e,n,i,o){let r;for(let s=0;s<n&&(r=this._columns[t+s],r);++s)r.collapseCells(e,i,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?n:1,s._rowSpan=o?i:1)},Te.prototype._updateCellSpans=function(t,e){if(null!=t)for(let n=t.length;--n>=0;){let i=t[n];this._updateCellSpan(i.indexX,i.indexY,i,e)}},Te.prototype._onMouseMove=function(t){let e=t.target,n=_t.closestElement(e,"cell"),i=this._stretchedCells.getColumnIndex(n);if(i<0){let t=_t.closestElement(e,"column");i=this.getColumnIndex(t)}let o=this.getCellIndex(i,n);this.setRowHighlight(o)},Te.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},Te.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},Te.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},Te.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},Te.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},Te.prototype._setContext=function(t){this._ctx=t},Te.prototype._getContext=function(){return this._ctx},Te.prototype._resetTransformIETimer=function(){_t.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},Te.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},Te._proto=Te.prototype;var Ee=Te;let Me=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};Me.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},Me.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},Me.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},Me.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},Me.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},Me.prototype.getColumnDataGetter=function(){return this._colDataGetter},Me.prototype.getSum=function(){return this._updateStats(),this._sum},Me.prototype.getDataCount=function(){return this._updateStats(),this._count},Me.prototype.getMin=function(){return this._updateStats(),this._min},Me.prototype.getMax=function(){return this._updateStats(),this._max},Me.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},Me.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},Me.prototype.getMean=Me.prototype.getAverage,Me.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},Me.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},Me.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},Me.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},Me.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},Me.prototype._updateStats=function(){this._dirty&&this._recalculate()},Me.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,!this._dt||!this._field)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let n,i=Me._isDataNumeric,o=0;for(;o<e;)if(n=+t[o++],i(n)){this._sum=this._min=this._max=n,++this._count;break}for(;o<e;)n=+t[o],i(n)&&(this._sum+=n,n<this._min?this._min=n:n>this._max&&(this._max=n),++this._count),++o},Me.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;let e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},Me.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),n=this._dt.getData(t,this._field);if(e===n)return;let i=Me._isDataNumeric(n);if(Me._isDataNumeric(e)){if(this._min===e&&(!i||n>this._min))return void this._recalculate();if(this._max===e&&(!i||n<this._max))return void this._recalculate();this._sum-=e,--this._count}i&&(this._sum+=n,n>=this._min||(this._min=n),n<=this._max||(this._max=n),++this._count)},Me._isDataNumeric=function(t){return"number"==typeof t&&t==t},Me.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},Me.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},Me.prototype.getRefCount=function(){return this._refs.length},Me.prototype._dt=null,Me.prototype._field="",Me.prototype._onDemandMode=!0,Me.prototype._dirty=!0,Me.prototype._cacheData=null,Me.prototype._sum=0,Me.prototype._min=NaN,Me.prototype._max=NaN,Me.prototype._count=0,Me.prototype._colDataGetter=null,Me.prototype._refs;var Fe=Me;let Pe=function(t){this._onDataChanged=this._onDataChanged.bind(this),this._onWrapSizeChanged=this._onWrapSizeChanged.bind(this),this._dv=t.dataView,this._dt=this._dv.getDataTable(),this._dv.listen("dataChanged",this._onDataChanged),this._dv.listen("wrapSizeChanged",this._onWrapSizeChanged),this._wrapIndex=t.wrapIndex,this._refreshRids(t.rids),this._addEvents("dataChanged")};l.inherits(Pe,mt),Pe.prototype._dv=null,Pe.prototype._dt=null,Pe.prototype._wrapIndex=0,Pe.prototype._rids,Pe.prototype._dataConflator=null,Pe.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},Pe.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",Dt._globalChangeArg)},Pe.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let n=this.getWrapSize();if(n>0){let i=n*this._wrapIndex;i<t.length?(e=!0,this._rids=t.slice(i,i+n)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},Pe.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},Pe.prototype.getData=function(t,e){return this._dt.getData(t,e)},Pe.prototype.getRowData=function(t){return this._dt.getRowData(t)},Pe.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},Pe.prototype.getRowId=function(t){return this._rids[t]||""},Pe.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},Pe.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._rids;for(let o=0;o<e;++o){let e=t[o];n[o]="number"==typeof e?i[e]||"":e||""}return n},Pe.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},Pe.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},Pe.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},Pe.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},Pe.prototype.getRowCount=function(){return this._rids.length},Pe.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Pe.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Pe.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Pe.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},Pe.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Pe.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},Pe.prototype.setRowData=function(t,e,n){return this._dv.setRowData(t,e,n)},Pe.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},Pe.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},Pe.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},Pe.prototype.insertRow=function(t,e,n){let i=this._toRowId(t);return this._dv.insertRow(i,e,n)},Pe.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Pe.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Pe.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dv.moveRow(o,n)},Pe.prototype.getDataTable=function(){return this._dt},Pe.prototype.getDataSource=function(){return this._dv},Pe.prototype.setDataSource=function(t){},Pe.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},Pe.prototype.getConflationRate=function(){return this._dv.getConflationRate()},Pe.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Pe.prototype.sort=function(t,e,n,i){this._dv.sort(t,e,n,i)},Pe.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},Pe.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Pe.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Pe.prototype.isSorting=function(){return this._dv.isSorting()},Pe.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},Pe.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},Pe.prototype.showRows=function(t,e){let n=this._toRowIds(t);this._dv.showRows(n,e)},Pe.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},Pe.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},Pe.prototype.filterIn=function(t,e,n){return this._dv.filterIn(t,e,n)},Pe.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Pe.prototype.filterInOnce=function(t,e,n){this._dv.filterInOnce(t,e,n)},Pe.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Pe.prototype.clearFilter=function(){this._dv.clearFilter()},Pe.prototype.disablePageCorrection=function(t){},Pe.prototype.setPage=function(t){return!1},Pe.prototype.gotoPage=Pe.prototype.setPage,Pe.prototype.nextPage=function(){return!1},Pe.prototype.previousPage=function(){return!1},Pe.prototype.prevPage=Pe.prototype.previousPage,Pe.prototype.lastPage=function(){return!1},Pe.prototype.firstPage=function(){return!1},Pe.prototype.getCurrentPage=function(){return 1},Pe.prototype.getPageIndex=Pe.prototype.getCurrentPage,Pe.prototype.isOnLastPage=function(){return!0},Pe.prototype.isOnFirstPage=function(){return!0},Pe.prototype.getPageSize=function(){return 0},Pe.prototype.getPageCount=function(){return 1},Pe.prototype.getTotalPages=Pe.prototype.getPageCount,Pe.prototype.setPageSize=function(t){},Pe.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},Pe.prototype.addGroup=function(t){this._dv.addGroup(t)},Pe.prototype.sortGroups=function(t){this._dv.sortGroups(t)},Pe.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},Pe.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},Pe.prototype.addFooter=function(t){this._dv.addFooter(t)},Pe.prototype.removeFooter=function(){this._dv.removeFooter()},Pe.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},Pe.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},Pe.prototype.getGroup=function(t){return this._dv.getGroup(t)},Pe.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},Pe.prototype.getGroupList=function(){return this._dv.getGroupList()},Pe.prototype.getGroupId=function(){return this._dv.getGroupId()},Pe.prototype.getGroupValue=function(){return this._dv.getGroupValue()},Pe.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},Pe.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},Pe.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},Pe.prototype.hasGroup=function(){return this._dv.hasGroup()},Pe.prototype.getGroupRows=function(){return null},Pe.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},Pe.prototype.enableColumnStats=function(t,e,n){return this._dv.enableColumnStats(t,e,n)},Pe.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},Pe.prototype.hide=function(t){return this._dv.hide(t)},Pe.prototype.isHidden=function(){return this._dv.isHidden()},Pe.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},Pe.prototype.collapse=function(t){this._dv.collapse(t)},Pe.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},Pe.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Pe.prototype.isCollapsed=function(){return this._dv.isCollapsed()},Pe.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},Pe.prototype.getVisibleRowCount=function(){return this._rids.length},Pe.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},Pe.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},Pe.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},Pe.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},Pe.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);this._dv.toggleRowExpansion(i,e,n)},Pe.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},Pe.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},Pe.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},Pe.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},Pe.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},Pe.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},Pe.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},Pe.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},Pe.prototype.searchPrev=function(t,e){let n=this._toRowId(t);return this._dv.searchPrev(n,e)},Pe.prototype.searchNext=function(t,e){let n=this._toRowId(t);return this._dv.searchNext(n,e)},Pe.prototype.stall=function(t){return this._dv.stall(t)},Pe.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},Pe.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},Pe.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},Pe.prototype.setSegmentSeparator=function(t,e){let n=this._toRowId(t);return this._dv.setSegmentSeparator(n,e)},Pe.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Pe.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Pe.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Pe.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Pe.prototype.collapseSegment=function(t,e){let n=this._toRowId(t);return this._dv.collapseSegment(n,e)},Pe.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Pe.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},Pe.prototype.setSegmentCollapsingLogic=function(){},Pe.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},Pe.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},Pe.prototype.fillSegments=function(){this._dv.fillSegments()},Pe.prototype.addSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.addSegmentChild(n,i)},Pe.prototype.addSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.addSegmentChildren(n,i)},Pe.prototype.removeSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.removeSegmentChild(n,i)},Pe.prototype.removeSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.removeSegmentChildren(n,i)},Pe.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Pe.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Pe.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Pe.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Pe.prototype.getWrapSize=function(){return this._dv.getWrapSize()},Pe.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},Pe.prototype.wrapView=function(t){this._dv.wrapView(t)},Pe.prototype.dump=function(t){return St.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},Pe.prototype.log=function(t){console.table(this.dump(t))},Pe.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var ze=Pe;let Ve=function(t){let e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._updateWrapCount=e._updateWrapCount.bind(e),e._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new r(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};l.inherits(Ve,mt),Ve.prototype._rids,Ve.prototype._groupView=null,Ve.prototype._pageView=null,Ve.prototype._expansionView=null,Ve.prototype._hiddenRids=null,Ve.prototype._collapsedRids=null,Ve.prototype._excludedRids=null,Ve.prototype._emptySegmentFiltering=!1,Ve.prototype._separatorFiltering=!1,Ve.prototype._expansionMap=null,Ve.prototype._expansionChildren=null,Ve.prototype._expansionCount=0,Ve.prototype._dt=null,Ve.prototype._parent=null,Ve.prototype._shared=null,Ve.prototype._sortingDefs=null,Ve.prototype._userFilter=null,Ve.prototype._filteringOut=!1,Ve.prototype._refreshTimerId=0,Ve.prototype._groupSortingLogic=null,Ve.prototype._pageCorrection=!0,Ve.prototype._pageSize=0,Ve.prototype._pageIndex=1,Ve.prototype._lastPageIndex=0,Ve.prototype._groupCriteria=null,Ve.prototype._preDefGroups=null,Ve.prototype._preDefGroupsDirty=!1,Ve.prototype._groupMembers=null,Ve.prototype._groupList=null,Ve.prototype._groupRows=null,Ve.prototype._groupId="",Ve.prototype._groupColor="",Ve.prototype._groupValue,Ve.prototype._groupRowId="",Ve.prototype._footerRowIds=null,Ve.prototype._groupLevel=0,Ve.prototype._groupViewDirty=!1,Ve.prototype._columnStats,Ve.prototype._hidden=!1,Ve.prototype._hiddenHeaderRow=!1,Ve.prototype._collapsed=!1,Ve.prototype._collapsible=!0,Ve.prototype._showOnlyFirstMember=!1,Ve.prototype._beingAdded=!1,Ve.prototype._conflator=null,Ve.prototype._wrappedViews=null,Ve.prototype._wrapSize=0,Ve.prototype._wrapTimerId=0,Ve.prototype._stalledSorting=!1,Ve.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.wrapView(0),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._wrapTimerId&&(clearTimeout(this._wrapTimerId),this._wrapTimerId=0),this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},Ve.prototype.getData=function(t,e){return this._dt.getData(t,e)},Ve.prototype.getRowData=function(t){return this._dt.getRowData(t)},Ve.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},Ve.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},Ve.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},Ve.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),n[o]=i[e]||""):n[o]=e||""}return n},Ve.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let n=e?this._getRids():this._pageView||this._rids;return t?n:n.slice(0)},Ve.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},Ve.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},Ve.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},Ve.prototype.getRowCount=function(){return this._getRids().length},Ve.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Ve.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Ve.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Ve.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},Ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Ve.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},Ve.prototype.setRowData=function(t,e,n){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,n)},Ve.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},Ve.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},Ve.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},Ve.prototype.insertRow=function(t,e,n){this._rebuildRowIdsFromChildren();let i=this._toRowId(t);return this._dt?this._dt.insertRow(i,e,n):""},Ve.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Ve.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Ve.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,n)},Ve.prototype.swapRow=_t._deprecatedFunction,Ve.prototype.getDataTable=function(){return this._dt},Ve.prototype.getDataSource=function(){return this._parent},Ve.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(Dt._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},Ve.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},Ve.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},Ve.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},Ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Ve.prototype.sort=function(t,e,n,i){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(n))for(let e=n.length;--e>=0;)if("function"!=typeof n[e]){let i=Array.isArray(t)?t[e]:t;n[e]=o[i]||o._default}if(Dt._buildSortContext(r,t,e,n||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||i?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(Dt._positionChangeArg)},Ve.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},Ve.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Ve.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Ve.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},Ve.prototype.isSorting=function(){return this._sortingDefs.length>0},Ve.prototype.hideRow=function(t,e){this.hideRows([t],e)},Ve.prototype.hideRows=function(t,e){e=!1!==e;let n=this._hiddenRids;if(e)n||(n=this._hiddenRids={});else if(!n)return;let i=this._toRowIds(t),o=!1;for(let t=i.length;--t>=0;){let r=i[t];r&&(e?n[r]||(n[r]=!0,o=!0):n[r]&&(delete n[r],o=!0))}if(o){if(!e){let t=!1;for(let e in n){t=!0;break}t||(n=this._hiddenRids=null)}this._refreshAndNotify()}},Ve.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},Ve.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},Ve.prototype.hasHiddenRow=function(){return!!this._hiddenRids},Ve.prototype.filterIn=function(t,e,n){let i=this._getFilterLogic(t,e),o=!0===n;return!!(this._userFilter!==i||"function"==typeof t||i&&o!==this._filteringOut)&&(this._shared.filterLogic=i,this._userFilter=i,this._filteringOut=o,this._refreshAndNotify(),!0)},Ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Ve.prototype.filterInOnce=function(t,e,n){let i=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,i,!0===n))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},Ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Ve.prototype._removeRowIds=function(t){let e=Ve._removeArrayItems(this._rids,t);if(this._groupView&&(e=Ve._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n];this._groupMembers[e]._removeRowIds(t)}}return e},Ve.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},Ve.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},Ve.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},Ve.prototype.gotoPage=Ve.prototype.setPage,Ve.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},Ve.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},Ve.prototype.prevPage=Ve.prototype.previousPage,Ve.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},Ve.prototype.firstPage=function(){return this.gotoPage(0)},Ve.prototype.getCurrentPage=function(){return this._pageIndex},Ve.prototype.getPageIndex=Ve.prototype.getCurrentPage,Ve.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},Ve.prototype.isOnFirstPage=function(){return 1===this._pageIndex},Ve.prototype.getPageSize=function(){return this._pageSize},Ve.prototype.getPageCount=function(){return this._lastPageIndex},Ve.prototype.getTotalPages=Ve.prototype.getPageCount,Ve.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},Ve.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let n,i;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],i=e.length,n=0;n<i;++n){let t=e[n];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(i=this._footerRowIds.length,n=0;n<i;++n)delete this._groupRows[this._footerRowIds[n]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},Ve.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,n=e.length;for(let t=0;t<n;++t)this._addGroup(e[t])}else this._addGroup(t)},Ve.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?Ve._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},Ve.prototype.moveGroup=function(t,e){let n=this.getGroup(t);if(!n)return;let i=n.getDataSource(),o=n.getGroupId(),r=i._groupList.indexOf(o);r!==e&&r+1!==e&&(i._groupList.splice(r,1),r<e&&--e,i._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},Ve.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},Ve.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let n=t.length;--n>=0;)if(Array.isArray(t[n])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0},Ve.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},Ve.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},Ve.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},Ve.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},Ve.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let n=this._groupMembers[e];if(n)return n;let i=e;return n=this._groupRows[i],n||this._getGroupByContentRowId(i)},Ve.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let n=this._groupList[e],i=this._groupMembers[n]._getGroupByContentRowId(t);if(i)return i}else if(-1!==this._rids.indexOf(t))return this;return null},Ve.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n],i=this._groupMembers[e];t.push(i),i.getAllGroups(t)}}return t},Ve.prototype.getGroupList=function(){return this._groupList},Ve.prototype.getGroupId=function(){return this._groupId},Ve.prototype.getGroupValue=function(){return this._groupValue},Ve.prototype.getGroupRowId=function(){return this._groupRowId},Ve.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},Ve.prototype.getFooterRowIds=function(){return this._footerRowIds},Ve.prototype.hasGroup=function(){return!!this._groupMembers},Ve.prototype.getGroupRows=function(){return null},Ve.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),n=e[t];for(;n;){let i=this._groupRows[n];if(i)return i._groupLevel;n=e[--t]}}}return this._groupLevel},Ve.prototype.enableColumnStats=function(t,e,n){if(!t)return null;let i=!1!==e,o=this._columnStats[t];if(i?(o||(o=new Fe(this,t),this._columnStats[t]=o),o.addRef(n)):o&&(o.deRef(n)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let i=this._groupList.length;--i>=0;){let o=this._groupList[i];this._groupMembers[o].enableColumnStats(t,e,n)}return o||null},Ve.prototype.getColumnStats=function(t){return this._columnStats[t]||null},Ve.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},Ve.prototype.isHidden=function(){return this._hidden},Ve.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},Ve.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},Ve.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},Ve.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},Ve.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),n=e.length;if(n){let i=!1!==t;for(let t=0;t<n;++t){e[t]._setCollapse(i)}this._requestRebuildingRowIds(!1)}},Ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Ve.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},Ve.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},Ve.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},Ve.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},Ve.prototype.isCollapsible=function(){return this._collapsible},Ve.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},Ve.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},Ve.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},Ve.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},Ve.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},Ve.prototype.isRowDataInGroup=function(t,e){let n=this._groupCriteria,i=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=i;o<n.length;o++)if(n[o](t).indexOf(e)>=0)return!0;return!1},Ve.prototype.isRowIdInGroup=function(t,e){let n=this.getRowData(t);return!!n&&this.isRowDataInGroup(n,e)},Ve._getDataViewExpansionId=function(t,e){return t+"_ex"+e},Ve.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let n=this._rids.indexOf(t);if(n<0)return;let i=0;this._expansionMap?i=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=i+e;this._expansionMap[t]=o;for(let e=i;e<o;e++)this._expansionChildren[Ve._getDataViewExpansionId(t,e)]=t;if(i||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[n+1],e.fallback=n,this._dispatchDataChange(e)}},Ve.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let n=new Array(e);for(let i=0;i<e;++i)n[i]=Ve._getDataViewExpansionId(t,i),delete this._expansionChildren[n[i]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(n[0]):this._dispatchMultiRowRemoved(n))},Ve.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(i))?this.addRowExpansion(i,n):this.removeRowExpansion(i)},Ve.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},Ve.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let n=this._expansionView,i=n.length;(null==e||e>i)&&(e=i),t>0||(t=0);let o=this._expansionCount,r=new Array(i);for(let i=t;i<e;++i){let t=n[i];if(this._expansionMap[t]&&(r[i]=t,--o<=0))break}return r},Ve.prototype.getExpansionParents=function(t,e){let n=[];if(this._expansionMap){let i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)n[o]=this._expansionChildren[i[o]]||""}return n},Ve.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},Ve.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},Ve.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},Ve.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},Ve.prototype.getRowExpansionId=function(t,e){if(this._expansionMap){if(e||(e=0),e<(this._expansionMap[t]||0))return Ve._getDataViewExpansionId(t,e)}return""},Ve.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},Ve.prototype._updateExpansionView=function(){let t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;let e=this._pageView||this._groupView||this._rids,n=e.length,i=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=n:this._expansionView=new Array(n);let o=this._expansionCount;for(let i=0,r=0;i<n;++i){let n=e[i];if(this._expansionView[r++]=n,o){let e=t[n]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=Ve._getDataViewExpansionId(n,t);--o}}}return i!==this._expansionView.length}return!1},Ve.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},Ve.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let n=this._getRids(),i=n.length;for(let o=0;o<i;++o){let i=n[o],r=this._dt.getRowData(i);r&&t(r)&&e.push(i)}return e},Ve.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;"number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t);let o=-1,r=n.length;return i>0&&(o=this._searchRow(n,e,i-1,-1,-1),o>=0)||i>=0&&(o=this._searchRow(n,e,r-1,i,-1),o>=0)?o:-1},Ve.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;if("number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t),i<0)return-1;let o=-1,r=n.length;return i<r-1&&(o=this._searchRow(n,e,i+1,r,1),o>=0)||i>0&&(o=this._searchRow(n,e,0,i,1),o>=0)?o:-1},Ve.prototype._searchRow=function(t,e,n,i,o){for(;n!==i;){let i=t[n],r=this._dt.getRowData(i);if(r&&e(r))return n;n+=o}return-1},Ve.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let n=e.length;--n>=0;)t[e[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},Ve.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(Dt._positionChangeArg),!0)},Ve.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},Ve.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},Ve.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},Ve.prototype.setSegmentSeparator=function(t,e){let n="";return"number"==typeof t?n=this.getRowId(t):"string"==typeof t&&(n=t),!!n&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(n,e))},Ve.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Ve.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Ve.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Ve.prototype.getSegment=function(t){return this._dt.getSegment(t)},Ve.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},Ve.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},Ve.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Ve.prototype.collapseSegment=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();if(n){let i=this._toRowId(t);if(n.collapseSegment(i,e))return this._refreshAndNotify(),!0}return!1},Ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Ve.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},Ve.prototype.setSegmentCollapsingLogic=function(){},Ve.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},Ve.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},Ve.prototype.fillSegments=function(){this._dt.fillSegments()},Ve.prototype.addSegmentChild=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o,n)}return!1},Ve.prototype.addSegmentChildren=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o,n)}return!1},Ve.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowId(e);return this._dt.removeSegmentChild(n,i)}return!1},Ve.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowIds(e);return this._dt.removeSegmentChildren(n,i)}return!1},Ve.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Ve.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Ve.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Ve.prototype.sortSeparators=function(t,e,n){this._dt.sortSeparators(t,e,n)},Ve.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Ve.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},Ve.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},Ve.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},Ve.prototype._getSharedObject=function(){return this._shared},Ve.prototype.getWrapSize=function(){return this._wrapSize},Ve.prototype.getWrappedViews=function(){return this._wrappedViews},Ve.prototype.wrapView=function(t){null!=t&&((!t||t<0)&&(t=0),this._wrapSize!==t&&(this._wrapSize=t,this._dispatch("wrapSizeChanged",{wrapSize:t,rids:this.getVisibleRowIds(!0)}))),this._updateWrapCount()},Ve.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,n=this._wrappedViews,i=n?n.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),i<o)for(n||(n=this._wrappedViews=[]),t=i;t<o;++t)this._wrappedViews[t]=new ze({dataView:this,wrapIndex:t,rids:r})}if(o<i){for(t=i;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),i!==o&&this._dispatch("wrapCountChanged",{prevCount:i,newCount:o})},Ve.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return St.constructTable(this.getMultipleRowData(e),t,e)},Ve.prototype.log=function(t){console.table(this.dump(t))},Ve.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},Ve.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=Ve._copyValidObjectKeys(this._excludedRids,this._hiddenRids);let n=this._dt._getSegmentSeparators(),i=n?n.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:i);if(e+=o,this._collapsedRids=null,n&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,i)),this._collapsedRids=n.getCollapsedRows(),e+=Ve._copyValidObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{let t=this._updatePageCount();this._sort()||t||this._transformView()}},Ve.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],n=e.length;if(1===n){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let n=t.type;"inserted"===n?this._onRowInserted(t):"removed"===n?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let i=0;i<n;i++)if(!e[i].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},Ve.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let n,i=this._resolveGroupId(t.rowData),o=i.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(n=i[r],this._groupMembers[n])e=this._groupMembers[n]._onRowInserted(t);else{let i=this._addGroup(n);i&&(t.globalChange=!0,i._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let n=t.rid,i=t.rowData;if(!this._isAllowedInGroup(n,i))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(n):this._addDataRow(n,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:n,rowData:i,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},Ve.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,n=0,i=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!i&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(n+=this._groupMembers[r]._onRowRemoved(t));n>1&&(this._groupViewDirty=!0)}else{let i=this._groupList.length;for(e=0;e<i;++e)r=this._groupList[e],n+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(n=0,i){for(l=[],e=i.length;--e>=0;)o=i[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));n=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,n=1);if(n>0){this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)}return n},Ve.prototype._onRowUpdated=function(t){let e,n,i=t.rid,o=t.rowData;if(this.isRowFiltered(i,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let r=[],s=this._groupList.length;for(e=0;e<s;++e)n=this._groupList[e],r[this._groupMembers[n]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(i,o)||(l=1):r[4]&&(l=4),this._groupLevel>0){if(1===l)Ve._removeArrayItem(this._rids,i)>=0&&this._groupView&&Ve._removeArrayItem(this._groupView,i),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===l&&!this._hidden){this._rids.indexOf(i)<0&&this._rids.push(i),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let i=this._resolveGroupId(o);for(e=0;e<i.length;e++){n=i[e];let o=this._addGroup(n);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(i)<0&&this._addDataRow(i),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}if(this._isAllowedInGroup(i,o)){return this._rids.indexOf(i)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4)}return this._onRowRemoved(t)?1:0},Ve.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,n=e.getGroupRowId();this._groupView.push(n),this._groupViewDirty=!0,this._dispatch("groupAdded",t),_t.pushArrayItems(this._groupView,e.getFooterRowIds())}},Ve.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},Ve.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},Ve.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},Ve.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},Ve.prototype._addDataRow=function(t,e,n){let i=this._getRowIndex(this._rids,e,n);return this._insertItems(this._rids,i,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):i<0?this._insertItems(this._groupView,-1,t):(i=this._getRowIndex(this._groupView,e,n),this._insertItems(this._groupView,i,t)):i>=0?i:this._rids.length-1},Ve.prototype._insertItems=function(t,e,n){return e<0?(e=t.length,t.push(n)):t.splice(e,0,n),e},Ve.prototype._getRowIndex=function(t,e,n){if(null==e)return-1;let i=this._rids.indexOf(e);return i>=0?i:null==n||n>=t.length?-1:n},Ve.prototype._removeDataRow=function(t){let e=Ve._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=Ve._removeArrayItem(this._groupView,t)),e},Ve._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&t.splice(n,1),n},Ve._removeArrayItems=function(t,e){let n=NaN,i=0;for(let o=t.length;--o>=0;)e[t[o]]?++i:i&&(n=o+1,t.splice(n,i),i=0);return i&&(t.splice(0,i),n=0),n},Ve._copyValidObjectKeys=function(t,e){if(e){let n=0;for(let i in e)e[i]&&(t[i]=1,++n);return n}return 0},Ve.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let n=this;for(let i=this._groupLevel;--i>=0;){if(!n._groupFilterLogic(t,e))return!1;n=n.getDataSource()}}return!0},Ve.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||(!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut))},Ve.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),n=this._dt.getSegmentValues(t,!0),i=Dt._performMultiLevelSorting(e,this._sortingDefs,n);if(i)return this._rids=Dt._reorderItems(t,i),this._transformView(),!0}return!1},Ve.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},Ve.prototype._getRemovalMap=function(t,e,n,i){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(i)for(r=h;--r>=0;)o=l[r],i[o]||(s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u);return u},Ve.prototype._getEmptySegments=function(t,e){let n=this._dt._getSegmentSeparators(),i=0;for(let o in e){let e=n.getSegment(o);if(e){let n=e.getChildren(),r=!0;for(let e in n)if(!t[e]){r=!1;break}r&&(t[o]=1,++i)}}return i},Ve.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?Ve._defaultFilterLogic.bind(null,t,e):Ve._defaultFilterLogic.bind(null,t+"",e):null},Ve.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},Ve.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let n=this._pageSize*(this._pageIndex-1),i=this._pageSize+n;if(t<i){let t=this._groupView||this._rids;i>t.length&&(i=t.length);let o=i-n;this._pageView.length=o>=0?o:0;for(let e=n;e<i;++e)this._pageView[e-n]=t[e];e=!0}}return e},Ve.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let e=this._groupView||this._rids,n=e.length>0?e.length:0;t=Math.ceil(n/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},Ve.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},Ve.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},Ve.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(Dt._globalChangeArg)},Ve.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},Ve.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),n=this._parent.getColumnStats(e);t&&n&&t.setColumnDataGetter(n.getColumnDataGetter())}}},Ve.prototype._populateGroups=function(){let t,e,n,i,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],n=this._dt.getRowData(e);if(n){o=this._resolveGroupId(n),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){i=o[t];let n=l[i];n?n.push(e):(n=[e],l[i]=n,a.push(i))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)i=this._groupList[t],l[i]||(n=this._groupMembers[i],n&&!n._predefinedGroup&&this._removeGroupMember(t,i));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)i=this._groupList[t],n=this._groupMembers[i],n&&n._predefinedGroup&&(u?u.indexOf(n._groupId)<0&&this._removeGroupMember(t,i):this._removeGroupMember(t,i));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)i=this._groupList[t],n=this._groupMembers[i],n._updateRowIds(l[i]),n._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},Ve.prototype._removeGroupMember=function(t,e){let n=this._groupMembers[e];n&&(this._groupList.splice(t,1),delete this._groupMembers[e],n.dispose())},Ve.prototype._defaultGroupCriteria=function(t,e){let n=e[t];return Array.isArray(n)?n.map((function(t){return t+""})):[n+""]},Ve.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},Ve.prototype._internalGroupSortingLogic=function(t,e){let n=this._groupMembers[t],i=this._groupMembers[e];return this._groupSortingLogic(t,e,n,i)},Ve.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let n=this._groupMembers[e];if(n)return null;let i,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(i={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",i),i.cancel))return null;n=new Ve;let r=this._shared.defaultCollapse;return null!=r&&(n._collapsed=r),n._groupId=e,"string"==typeof t?"null"==t?n._groupValue=null:"undefined"!=t&&(n._groupValue=t):n._groupValue=t,i&&!0===i.hideHeaderRow&&(n._hiddenHeaderRow=!0),n._groupRowId=o,n._groupLevel=this._groupLevel+1,n._groupCriteria=this._groupCriteria,n._preDefGroups=this._preDefGroups,n._groupLevel<n._groupCriteria.length&&(n._groupMembers={},n._groupList=[],n._groupView=[]),n._groupRows=this._groupRows,n._setParent(this),n._sortingDefs=this._sortingDefs,this._groupMembers[e]=n,this._groupList.push(e),this._groupRows[n._groupRowId]=n,this._hidden||(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),this._groupViewDirty=!0,n._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:n}),n._beingAdded=!1),n.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&n.listen("beforeGroupAdded",this._onBeforeGroupAdded),n},Ve.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},Ve.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],n=this._groupMembers[t];if(n._rebuildRowIdsFromChildren(),_t.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){let t=n._getFirstHiddenRids()||n._groupView||n._rids;_t.pushArrayItems(this._groupView,t),_t.pushArrayItems(this._groupView,n._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},Ve.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},Ve.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},Ve._defaultFilterLogic=function(t,e,n,i){return i[t]===e},Ve._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var ke=Ve;let Ne=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};Ne.prototype._data,Ne.prototype._func=null,Ne.prototype._delay=0,Ne.prototype._timerId=0,Ne.prototype._conflated=!1,Ne.prototype._disabled=!1,Ne.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Ne.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},Ne.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Ne.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},Ne.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Ne.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},Ne.prototype.getData=function(){return this._data},Ne.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Ne.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Ne.prototype.disable=function(t){this._disabled=!1!==t},Ne.prototype.isEnabled=function(){return!this._disabled},Ne.prototype.enable=function(t){this._disabled=!1===t},Ne._proto=Ne.prototype;var Oe=Ne;let He=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new Oe(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};l.inherits(He,mt),He._runningId=0,He.prototype._id="",He.prototype._type="",He.prototype._grid=null,He.prototype._snapshot=null,He.prototype._dataView=null,He.prototype._dataArg=null,He.prototype._autoSyncRowCount,He.prototype._bindingEnabled=!0,He.prototype._parent=null,He.prototype._children=null,He.prototype._dataChangedConflator,He.prototype.getId=function(){return this._id},He.prototype.setId=function(t){return this._id=t||"section"+He._runningId++,this._grid.setAttribute("id",this._id),this._id},He.prototype.getSection=function(){return this._snapshot||this._grid},He.prototype.getSectionName=function(){return this._grid.getId()},He.prototype.getIndex=function(){return this._grid.getIndex()},He.prototype.getType=function(){return this._type},He.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},He.prototype.getDataSource=function(){return this._dataView},He.prototype.setDataSource=function(t){let e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},He.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},He.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},He.prototype.setData=function(t,e,n){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,n),!0)},He.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},He.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let n=e.getRowIndex(t);return!(n<0)&&(e.removeRow(n),!0)},He.prototype.activateColumns=function(t,e,n){if("content"===this._type)for(let i=n+1;--i>=e;){let e=t[i];null!=e&&this._grid.activateColumn(i,e)}},He.prototype.getChildren=function(){return this._children},He.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},He.prototype.getParent=function(){return this._parent},He.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},He.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},He.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},He.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},He.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},He.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},He.prototype.dispose=function(){let t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},He.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},He.prototype.extendRenderEventArg=function(t,e,n){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,n=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=n,t},He.prototype.extendDataEventArg=function(t,e,n){let i,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=n,this._snapshot?(i=0,o=this._grid.getRowCount()):(i=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>i?e:i,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=n+1<o?n+1:o,this.extendEventArg(t),t},He.prototype.setIndex=function(t){this._grid.setIndex(t)},He.prototype.getRowOffset=function(){return this._grid.getRowOffset()},He.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},He.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},He.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},He.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},He.prototype._dispatchDataChanged=function(t,e){let n=this.getAutoSyncRowCount(),i=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();n?i!==o&&this._grid.setRowCount(i,!0):i>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},He.prototype.updateRowData=function(t,e,n){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(n=this.extendDataEventArg(n,t,e)).fromRowIndex<n.toRowIndex&&this._dispatch("dataChanged",n))},He.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},He.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},He.prototype._getRowId=function(t){return _t.isNumber(t)?this._dataView.getRowId(t):t},He.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),e.globalChange)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let n=t.rids;if(n)for(let t=n.length;--t>=0;)e.updatedRids[n[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},He.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},He._proto=He.prototype;var Be=He;let Ge=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};l.inherits(Ge,mt),Ge.prototype._layout,Ge.prototype._viewSize=0,Ge.prototype._viewOffset=0,Ge.prototype._startOffsetCount=0,Ge.prototype._endOffsetCount=0,Ge.prototype._bufferSize=0,Ge.prototype._arg=null,Ge.prototype._enabled=!0,Ge.prototype._active=!0,Ge.prototype._virtualizable=!1,Ge.prototype._getMinIndex=function(){return this._startOffsetCount},Ge.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Ge.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Ge.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Ge.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Ge.prototype.getViewSize=function(){return this._viewSize},Ge.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Ge.prototype.getIndexOffset=function(){return this._startOffsetCount},Ge.prototype.isVirtualizable=function(){return this._virtualizable},Ge.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Ge.prototype.getLastIndexInView=function(){if(this._virtualizable){let t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},Ge.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Ge.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Ge.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),n=this.getLastIndexInView(),i=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==n;return(t||i)&&(this._arg.firstIndex=e,this._arg.lastIndex=n,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=n),i},Ge.prototype.isEnabled=function(){return this._enabled},Ge.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Ge.prototype.disable=function(t){this.enable(!1===t)},Ge.prototype.isActive=function(){return this._active},Ge.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Ge.prototype.deactivate=function(t){this.activate(!1===t)},Ge.prototype.getBufferSize=function(){return this._bufferSize},Ge.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Ge.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Ge.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Ge.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Ge.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Ge.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Ge._proto=Ge.prototype;var We=Ge;let Ue=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Ue.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};l.inherits(Ue,ve),Ue.prototype.setScrollContent=function(t,e,n){this._clearAllPanes();let i,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<n;)i=e[l++],i.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)i=e[l++],i.setParent(s);for(;l<o;)i=e[l++],i.setParent(t);this.invalidateContent()},Ue.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Ue.prototype.getHeight=function(){return this.getPaneSize()},Ue.prototype.getScrollTop=function(){return this._getScrollValue()},Ue.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Ue.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Ue.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let n=t.length;--n>=0;)e+=t[n].offsetHeight;return e},Ue.prototype.calculateContentSize=function(){return this.getContentHeight()},Ue.prototype.getPane=function(){return this._panes[0]},Ue.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Ue._proto=Ue.prototype;var Ye=Ue;let Xe=function(t){let e=this;e._onRestingPosition=e._onRestingPosition.bind(e),e._updateRowBounds=e._updateRowBounds.bind(e),e._element=document.createElement("div"),e._element.className="tr-vlg section",t||(t={}),t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar),t.owner=this,e._grid=new Ee(t),e._grid.setParent(e._element),e._layoutY=new re,e._selectionList=new Se,e._reverter=new be(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Xe,$t),Xe.prototype._index=-1,Xe.prototype._rowOffset=0,Xe.prototype._firstIndex=0,Xe.prototype._grid,Xe.prototype._layoutY,Xe.prototype._selectionList=null,Xe.prototype._reverter=null,Xe.prototype._rowBounds=null,Xe.prototype._rowBoundCache=null,Xe.prototype._rowSelDirty=!1,Xe.prototype._cellBoundPainter=null,Xe.prototype._rowBoundTimer=0,Xe.prototype._boundLayer=null,Xe.prototype._hscrollbar=null,Xe.prototype._session="A",Xe.prototype._tempRowHeights=null,Xe.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Xe.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Xe.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0),this._cellBoundPainter&&this._cellBoundPainter.dispose()},Xe.prototype.setWidth=function(t){return this._grid.setWidth(t)},Xe.prototype.setHeight=function(t){return console.log("unsupported"),!1},Xe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Xe.prototype.hitTest=function(t,e){let n=[];return n.colIndex=this._grid.hitTestX(t),n.rowIndex=this._layoutY.hitTest(e),n},Xe.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Xe.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Xe.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Xe.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Xe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Xe.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},Xe.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Xe.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Xe.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Xe.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Xe.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,n=[];for(let e in this._tempRowHeights){let i=+e,o=this._layoutY.getLaneProperty(i,"sizeSession");o&&o!=this._session&&(this.setRowHeight(i,t),this._layoutY.setLaneProperty(i,"sizeSession",null),n.push(i))}let i=n.length;for(let t=0;t<i;t++)delete this._tempRowHeights[n[t]];if(i)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Xe.prototype._getTempRowHeights=function(){return this._tempRowHeights},Xe.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Xe.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatchRowHeightChangedEvent(t,t+1))},Xe.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Xe.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Xe.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Xe.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Xe.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Xe.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Xe.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Xe.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Xe.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Xe.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Xe.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Xe.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Xe.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Xe.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Xe.prototype.setCellRowSpan=function(t,e,n){return this._grid.setCellRowSpan(t,e-this._firstIndex,n)},Xe.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Xe.prototype.setCellColSpan=function(t,e,n){return this._grid.setCellColSpan(t,e-this._firstIndex,n)},Xe.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Xe.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Xe.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Xe.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Xe.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Xe.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Xe.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Xe.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Xe.prototype.getCell=function(t,e,n){return this._grid.getCell(t,e-this._firstIndex,n)},Xe.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Xe.prototype.setCellContent=function(t,e,n){return this._grid.setCellContent(t,e-this._firstIndex,n)},Xe.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Xe.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Xe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Xe.prototype.setRowCount=function(t,e){let n=this._layoutY.getLaneCount();n!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:n,noBinding:e}))},Xe.prototype.getVisibleRowCount=function(){return this.getRowCount()},Xe.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},Xe.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Xe.prototype.setBorders=function(t,e,n,i){this._grid.setBorders(t,e,n,i)},Xe.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Xe.prototype.setColumnStyle=function(t,e,n){this._grid.setColumnStyle(t,e,n)},Xe.prototype.enableColumnClass=function(t,e,n){this._grid.enableColumnClass(t,e,n)},Xe.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Xe.prototype.enableRowClass=function(t,e,n){this._grid.enableRowClass(t-this._firstIndex,e,n)},Xe.prototype.setRowStyle=function(t,e,n,i){this._grid.setRowStyle(t-this._firstIndex,e,n,i)},Xe.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Xe.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Xe.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Xe.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Xe.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Xe.prototype.enableShading=function(t){this._grid.enableShading(t)},Xe.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Xe.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Xe.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Xe.prototype.setRowHighlight=function(t){let e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Xe.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Xe.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Xe.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Xe.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let n=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,n),n&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Xe.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Xe.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Xe.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Xe.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Xe.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Xe.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Xe.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Xe.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Xe.prototype.activateRows=function(t,e,n){let i=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+i),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>i&&(s=i);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>i&&(l=i-s),this._firstIndex=s;let a=s+l,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,n&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(n){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),n[0]=s,n[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),n[0]=t,n[1]=a):s===r&&a===t?(n[0]=0,n[1]=0):p=!0}p&&(n[0]=s,n[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},Xe.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Xe.prototype.getFirstIndexInView=function(){return this._firstIndex},Xe.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),n=e?e.getRowCount()-1:-1;return t>n?n:t},Xe.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Xe.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Xe.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Xe.prototype.getColumn=function(t){return this._grid.getColumn(t)},Xe.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Xe.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Xe.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Xe.prototype.enableRowVirtualization=function(t){},Xe.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Xe.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Xe.prototype.getCellIndex=function(t,e){let n=this._grid.getCellIndex(t,e);return n<0?-1:n+this._firstIndex},Xe.prototype.getIndex=function(){return this._index},Xe.prototype.setIndex=function(t){this._index=t},Xe.prototype.setRowOffset=function(t){this._rowOffset=t},Xe.prototype.getRowOffset=function(){return this._rowOffset},Xe.prototype.updateLayout=function(){this._grid.updateLayout()},Xe.prototype.stretchCell=function(t,e,n,i){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,n,i);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Xe.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Xe.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Xe.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Xe.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Xe.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Xe.prototype.getColumnHost=function(){return this._grid.getElement()},Xe.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Xe.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Xe.prototype.setColumnVisibility=function(t,e,n){return this._grid.setColumnVisibility(t,e,n)},Xe.prototype.getRowLayout=function(){return this._layoutY},Xe.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Xe.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Xe.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Xe.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Xe.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Xe.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Xe.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Xe.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Xe.prototype.selectCell=function(t,e,n){this._grid.selectCell(t,e-this._firstIndex,n)},Xe.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Le({boundLayer:o,layoutX:this.getHorizontalLayout(),layoutY:this._layoutY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Xe.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Xe.prototype.calculateColumnBounds=function(t,e,n,i){this._grid.calculateColumnBounds(t,e,n,i)},Xe.prototype.updateColumnBounds=function(t,e,n){this._grid.updateColumnBounds(t,e,n),this._updateRowBounds()},Xe.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Xe.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Xe.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Xe.prototype._updateRowBounds=function(){this._rowBoundTimer=0;let t=this._cellBoundPainter;if(t&&t.updateCellBounds(),!this._rowSelDirty)return;let e=this._rowBounds,n=this._rowBoundCache;e||(e=this._rowBounds=[]),n||(n=this._rowBoundCache=[]);let i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);let r,s=i.getConnectedRanges(),l=s.length,a=null,u=null,h=e.length;for(r=l;r<h;++r)u=e[r],a=u.parentNode,a&&a.removeChild(u);if(e.length=h=l,!l){return void(i.getSelectionCount()||(this._rowSelDirty=!1))}let p=0,d=0,c=0,_=!1;this._hscrollbar&&(p=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount(),_=this._hscrollbar.isEndOfHorizontalScroll());let f=!d&&p>0,g=!c&&!_,y=this._grid._getViewSize();for(r=0;r<l;++r){let t=s[r],i=t[0],o=t[1],l=this._layoutY.getLaneStart(i),a=this._layoutY.getLaneEnd(o);u=n[r],u||(u=n[r]=document.createElement("div"),u.className="selection-bound"),u.style.top=l+"px",u.style.height=a-l+"px",u.style.width=y+"px",u.classList.toggle("no-left-bound",f),u.classList.toggle("no-right-bound",g),this._boundLayer&&(e[r]||(e[r]=u,this._boundLayer.appendChild(u)))}},Xe.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Xe.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,n=e.getSelectionCount();if(n<=0)return;let i=this._firstIndex,o=i+this._getInnerRowCount();if(1===n)t=e.getFirstSelectedIndex(),i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0);else if(n>=o-i)for(t=i;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-i,!0);else{let r=e.getAllSelections();for(let e=0;e<n;++e)t=r[e],i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0)}},Xe.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let n={};return n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n),!0},Xe.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Xe.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Xe.prototype._updateLayers=function(){this._grid._updateLayers()},Xe.prototype._setContext=function(t){this._grid._setContext(t)},Xe.prototype._getContext=function(){return this._grid._getContext()},Xe._proto=Xe.prototype;var qe=Xe;let je=function(t,e){return t-e},Ke=function(){let t=document.createElement("input"),e=t.style;return e.position="absolute",e.width=e.height=e.padding=e.border="0",t.value="0",t.role="grid",t},Je=function(t){if(t){if(!t.getRootNode)return document.activeElement;{let e=t.getRootNode();if(e&&e!==t)return e.activeElement||null}}return null},Qe=function(t){Qe._sectionType||(Qe._sectionType={},Qe._sectionType.title=!0,Qe._sectionType.header=!0,Qe._sectionType.content=!0,Qe._sectionType.footer=!0);let e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.bind(e),e._onKeyDown=e._onKeyDown.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e._onSyncHScroll=e._onSyncHScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),e.updateColumnBounds=e.updateColumnBounds.bind(e),e._dispatchColumnPositionChanged=e._dispatchColumnPositionChanged.bind(e),e._dispatchRowPositionChanged=e._dispatchRowPositionChanged.bind(e),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(let e=t.childNodes.length;--e>=0;)_t.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new re,e._layoutY=new re,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new We(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new We(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Ye,e._vscrollbar.disable(),e._vscrollbar.setParent(e.getParent()||e.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new De,e._hscrollbar.disable(),e._hscrollbar.setParent(e.getParent()||e.getElement()),e._hscrollbar.listen("scroll",e._onHScroll),e._hscrollbar.listen("layoutChanged",e._onHScroll),e._hscrollbar.listen("activated",e.updateLayout),e._hscrollbar.listen("deactivated",e.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),e._element.addEventListener("keydown",e._onKeyDown),_t.isMobile||_t.isTouchDevice?e._element.addEventListener("touchmove",e._onMouseMove,!1):e._element.addEventListener("mousemove",e._onMouseMove,!1),_t.isSafari&&e._element.addEventListener("click",e._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new Oe(e._onRowHeightChanged,50),e._vScrollbarConflator=new Oe(e._updateVScrollbar,200),e._columnBoundConflator=new Oe(e.updateColumnBounds,10),e._columnPositionConflator=new Oe(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new Oe(e._dispatchRowPositionChanged,10),e._firstHiddenInput=Ke(),e._firstHiddenInput.className="first-input",e._lastHiddenInput=Ke(),e._lastHiddenInput.className="last-input",e._element.insertBefore(e._firstHiddenInput,e._element.firstChild),e._element.appendChild(e._lastHiddenInput),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged","tabNavigation");let n=Qe.map;n||(n={},Qe.map=n),e._element._control=e;let i=e._element.id||e._element.name;i&&!n[i]||(i="_grid"+Qe._runningGridId),e._id=i,n[i]=e,Qe._runningGridId++,Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};l.inherits(Qe,$t),Qe.SectionReference,Qe.MouseInfo,Qe.BatchInfo,Qe.CellReference,Qe.ColumnOptions,Qe._runningGridId=0,Qe._runningColumnId=0,Qe._sectionType,Qe.prototype._plugins,Qe.prototype._dataSource=null,Qe.prototype._layoutX,Qe.prototype._layoutY,Qe.prototype._vscrollbar,Qe.prototype._hscrollbar,Qe.prototype._tempFrozenSectionRef="",Qe.prototype._startVScrollbarIndex=-1,Qe.prototype._hScrollbarEnabled=!0,Qe.prototype._pinnedLeftColumnCount=0,Qe.prototype._pinnedRightColumnCount=0,Qe.prototype._frozenFooterCount=0,Qe.prototype._fixFrozenTopSections=!1,Qe.prototype._fixFrozenBottomSection=!1,Qe.prototype._sectionStarts,Qe.prototype._settings,Qe.prototype._firstSettings,Qe.prototype._lastSettings,Qe.prototype._fitContentWidth=!1,Qe.prototype._columnDefs,Qe.prototype._rowVirtualizer,Qe.prototype._colVirtualizer,Qe.prototype._autoSetDataSource=!0,Qe.prototype._renderingHandler=null,Qe.prototype._dataBindingHandler=null,Qe.prototype._frozenLayout=!1,Qe.prototype._noBinding=!1,Qe.prototype._rowHeightSync=!0,Qe.prototype._rowHighlighting=!1,Qe.prototype._dispatchingDataChanged=!1,Qe.prototype._rowHeightException="",Qe.prototype._rowScrollingStep=0,Qe.prototype._zoomFactor=1,Qe.prototype._reservedSpace=0,Qe.prototype._hidingMethod="",Qe.prototype._rowHeightConflator=null,Qe.prototype._vScrollbarConflator=null,Qe.prototype._columnBoundConflator=null,Qe.prototype._rowRefreshTimer=0,Qe.prototype._layoutUpdating=!1,Qe.prototype._firstHiddenInput,Qe.prototype._lastHiddenInput,Qe.prototype._bottomPadding=6,Qe.prototype._bottomPaddingSect=null,Qe.prototype._preserveProportion=!1,Qe.prototype._preserveGridSize=!1,Qe.prototype._rowHeightTimerId=0,Qe.prototype._groupDefs=null,Qe.prototype._batches=null,Qe.prototype._firstRendered=!1,Qe.prototype._hasPendingRowChange=!1,Qe.getVersion=function(){return"5.1.125"},Qe.prototype.dispose=function(){let t=this._id,e=Qe.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let n=this._vscrollbar._mainScrollbar;n&&(n.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),n=this._hscrollbar._mainScrollbar,n&&(n.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.dispose();let i=this._element;i&&(i._control&&delete i._control,i.removeChild(this._firstHiddenInput),i.removeChild(this._lastHiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},Qe.prototype.isDisposed=function(){return this._disposed},Qe.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Qe.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Qe.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Qe.prototype.getConfigObject=function(t){let e=t||{},n=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<n;t++){let n=e.columns[t];n||(n=e.columns[t]={});let i=this._getColumnDef(t);i.userId&&(n.id=i.userId),i.field&&(n.field=i.field),i.styles&&(n.styles=i.styles),i.stationary&&(n.stationary=i.stationary),i.leftPinned&&(n.leftPinned=i.leftPinned),i.rightPinned&&(n.rightPinned=i.rightPinned),i.backgroundColor&&(n.backgroundColor=i.backgroundColor)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep);let i=this._vscrollbar.getAutoHide();!0!==i&&(e.autoHideScrollbar=i);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let n=this._plugins[t];"function"==typeof n.getConfigObject&&n.getConfigObject(e)}return e},Qe.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,n=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(n-this._reservedSpace)},Qe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Qe.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Qe.prototype.getSectionCount=function(){return this._settings.length},Qe.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Qe.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Qe.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,n=0;for(let i=0;i<e;i++){let e=t[i].getType();if("header"!==e&&"title"!==e)break;n++}return n},Qe.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let n=t.length-1;n>=0;n--){if("footer"!==t[n].getType())break;e++}return e},Qe.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Qe.prototype.addSectionAt=function(t,e,n){let i=this._settings.length;t<0&&(t=0),t>i&&(t=i);let o=this._toSectionType(e),r="bottomPadding"===n,s=this._newSection(r?"footer":o,n);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=i?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},Qe.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Qe.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],n=e.getIndex(),i=e.getSection(),o=e.getType();return i.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),i}return null},Qe.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Qe.prototype.removeAllSections=function(){let t=this._settings.length;for(let e=0;e<t;++e){this._settings[e].dispose()}this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},Qe.prototype.setBottomPaddingSection=function(t){let e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},Qe.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let n=e;--n>=0;){let e=this._settings[n];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},Qe.prototype.moveSection=function(t,e){let n=this.getSectionCount();if(t<0)t=0;else if(t>=n)return;if(e<0?e=0:e>=n&&(e=n-1),t===e)return;let i=this._settings[t],o=this._settings[e];_t.moveArrayItem(this._settings,t,e),o?i.getSection().insertBefore(o.getSection()):this._putToLast(i.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},Qe.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},Qe.prototype.getSectionSettings=function(t){if(_t.isString(t)){if(Qe._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():_t.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},Qe.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),n=e;for(let t=n.length;--t>=0;)n[t]=e[t].getSection();return n},Qe.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,n=[];t=this._toSectionType(t);for(let i=0;i<e;++i){let e=this._settings[i];t===e.getType()&&n.push(e)}return n},Qe.prototype.getSectionIndex=function(t){if(_t.isNumber(t))return t;if(t instanceof MouseEvent){let e=_t.getRelativePosition(t,this._element),n={};return this._hitTestY(e.y,n),n.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},Qe.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let n=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(n-=this._vscrollbar.getScrollTop()),n},Qe.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let n=this._getNextSection(-1,t,e);return null!==n?n.getSection():null},Qe.prototype.getNextSection=function(t,e){let n=this._getNextSection(1,t,e);return null!==n?n.getSection():null},Qe.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Qe.prototype.getCell=function(t,e,n,i){let o=this.getSection(t);return o?o.getCell(e,n,i):null},Qe.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,n=t.rowIndex,i=t.sectionName,o=null;if(null==e||null==n)o=this.getRelativePosition(t),o.hit||(o=null);else{i||(i="content");let t=this.getSectionSettings(i);if(t){t.getSection().getCell(e,n)&&(o={},o.colIndex=e,o.rowIndex=n,t.extendEventArg(o))}}return o},Qe.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Qe.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Qe.prototype._getNextCellInRow=function(t,e){let n=this.getCellInfo(t);if(n){let t=n.colIndex+e,i=n.rowIndex,o=n.section;n.colIndex=t,n.cell=o.getCell(t,i)}return n},Qe.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e){if(!e.cell){let t=e.section,n=e.colIndex=0,i=e.rowIndex;e.rowIndex=++i,e.cell=t.getCell(n,i)}}return e},Qe.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e){if(!e.cell){let t=e.section,n=e.colIndex=t.getColumnCount()-1,i=e.rowIndex;e.rowIndex=--i,e.cell=t.getCell(n,i)}}return e},Qe.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Qe.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().setColumnCount(t)}this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},Qe.prototype.insertColumn=function(t,e){let n=this.getColumnCount();t<n||(t=n),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().insertColumn(t)}this._columnDefs.splice(t,0,null),this._deserializeColumn(t,e),this._onColumnCountChanged(),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<n,e)},Qe.prototype.insertColumns=function(t,e){let n=this.getColumnCount();t<n||(t=n);let i,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);i=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let n=t+e;this._layoutX.insertLane(n);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().insertColumn(n)}let o=i&&i[e];this._deserializeColumn(n,o)}this._dispatchColumnAddedEvent(t,o,t<n,i),this.freezeLayout(r)},Qe.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let i=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=i,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=n&&n===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},Qe.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Qe.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Qe.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let n=this.getStationaryColumnIndex();if(n>-1){if(e<=n)return!1;for(let e=0;e<t.length;e++)if(t[e]<=n)return!1}return!0},Qe.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Qe.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let n,i=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(n=0;n<i;++n)r=t[n],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),i=o.length,!i)return!1;if(1===i)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(je),l[e]){let t=!0;for(r=o[0],n=1;n<i;++n)if(++r!==o[n]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(n=0;n<i;++n)a=o[n],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=i-p;for(u=p?e-1:e,n=0;n<d;++n)a=o[n]-n,this._moveColumn(a,u);return this.freezeLayout(h),!0},Qe.prototype._moveColumn=function(t,e){let n=this.getColumnCount();if(t<0?t=0:t>=n&&(t=n-1),e<0?e=0:e>=n&&(e=n-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let n=0;n<r;++n){this._settings[n].getSection().moveColumn(t,e)}let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(_t.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=n-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<n-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=n-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let n=this._colVirtualizer.getFirstIndexInView();t<n&&e<n||t>i&&e>i||this._activateColumns(n,i,n,i)}if(this._hasListener("columnMoved")){let n={};n.fromColIndex=t,n.toColIndex=e,n.colId=o,this._dispatchColumnEvent("columnMoved",n)}return i===this._colVirtualizer.getLastIndexInView()&&(t<=i&&e>i||e<=i&&t>i)&&this._colVirtualizer.update(),this.updateColumnBounds(),this._updateColumnSeparators(),!0},Qe.prototype.moveColumnById=function(t,e){let n=this.getColumnCount(),i=this.getColumnIndex(t);if(i<0||i>=n)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=n),this._moveColumnByIndex(i,o)},Qe.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Qe.prototype.reorderColumns=function(t,e){let n="";"number"==typeof e?n=this.getColumnId(e):e&&(n=e),this.startBatch("move");let i=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),n===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(n),l>=0)for(;++l<u&&(n=a[l],!(h.indexOf(n)<0)););(l<0||l>=u)&&(n="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(n),l<0&&(l=u),i|=this._moveColumnByIndex(s,l),n=r}else i=this.moveColumnById(t[0],n)}else null!=t&&(i=this.moveColumnById(t,n));return this.stopBatch("move"),!!i},Qe.prototype.getColumnLayout=function(){return this._layoutX},Qe.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Qe.prototype._deserializeColumn=function(t,e){if(!e)return;let n,i=e.layout||e,o=e.width;null!=o&&(i.size=o),o=e.scalable,null!=o&&(i.scalable=o),o=e.minWidth,null!=o&&(i.minSize=o),null==i.scalable&&(i.scalable=null==i.size),this._layoutX.deserializeLane(t,i);let r=e.styles;for(n in r)this.setColumnStyle(t,n,r[n]);let s=e.classes;for(n in s)this.enableColumnClass(t,n,s[n]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),h=e.backgroundColor,null!=h&&this.setColumnBackgroundColor(t,h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},Qe.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},Qe.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Qe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Qe.prototype.setSectionRowCount=function(t,e){let n=this.getSection(t);null!=n&&n.setRowCount(e)},Qe.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Qe.prototype.getRelativeIndex=_t._deprecatedFunction,Qe.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},Qe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Qe.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let n=this._settings.length;for(let e=0;e<n;++e){let n=this._settings[e];n.getType()!==this._rowHeightException&&"bottomPadding"!==n.getId()&&n.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Qe.prototype.getDataSource=function(){return this._dataSource},Qe.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Qe.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Qe.prototype.setDataSource=function(t){t&&t instanceof Dt&&(t=new ke(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let n=0;n<e;++n)this._settings[n].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},Qe.prototype.setColumnTemplate=_t._deprecatedFunction,Qe.prototype.getColumnTemplate=_t._deprecatedFunction,Qe.prototype.getColumnRenderEvent=_t._deprecatedFunction,Qe.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(n){e.setColumnDataBindingHandler(t,n)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},Qe.prototype.setColumnStyle=function(t,e,n,i){if(!e)return;let o;_t.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==i?o=this._getNestedColumnDef(t,"styles"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"styles")),o[e]=n;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];if(null==i||i===r.getType()){r.getSection().setColumnStyle(t,e,n)}}},Qe.prototype.getColumnBackgroundColor=function(t){return this._getColumnDef(t).backgroundColor||""},Qe.prototype.setColumnBackgroundColor=function(t,e){if(null==t||"number"!=typeof t)return;let n=this._getColumnDef(t);if(n.backgroundColor===e)return;n.backgroundColor=e,e=null!=e?e:"";let i=this._settings.length;for(let n=0;n<i;++n){let i=this._settings[n],o=i.getSection();if(o)if("content"!==i.getType()){let n=o.getRowCount();for(let i=0;i<n;i++){if(o.getCellColSpan(t,i)>1)continue;let n=o.getCell(t,i);n&&n.setStyle("backgroundColor",e)}}else{o.getColumn(t).setStyle("backgroundColor",e)}}},Qe.prototype.enableColumnClass=function(t,e,n,i){let o;"number"!=typeof t&&(t=0),null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes"));let r=!1;if((n=!1!==n)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().enableColumnClass(t,e,n)}return r},Qe.prototype.hasColumnClass=function(t,e,n){let i;return null==n?i=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),i=this._getNestedColumnDef(t,n,"classes")),!(!i||!i[e])},Qe.prototype.setColumnAlignment=function(t,e){let n=e?e.charAt(0).toLowerCase():"",i=0;i|=this.enableColumnClass(t,"tr-align-left","l"===n),i|=this.enableColumnClass(t,"tr-align-right","r"===n),i|=this.enableColumnClass(t,"tr-align-center","c"===n),i&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:n})},Qe.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},Qe.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),i=n<e?n:e;for(let e=this.getColumnCount()-1;e>=t;--e)i-=this._layoutX.getLaneSize(e);return i}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Qe.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Qe.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Qe.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Qe.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let n,i=0,o={},r=t.length,s=new Array(r);for(n=0;n<r;n++)o[t[n]]=!0,s[n]=e[n],i+=e[n];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?(l+=h.getMinimumLaneSize(n),a++):l+=h.getLaneSize(n));let p=this.getContentWidth(),d=i+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?l+=h.getMinimumLaneSize(n):l+=h.getLaneSize(n));if(d=i+l-p,d>0)for(d/=r,n=0;n<r;n++)s[n]-=d}return s},Qe.prototype.setColumnWidth=function(t,e,n){let i=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,i[0],n);return o&&this._syncLayoutToColumns(t,t+1),o},Qe.prototype.setColumnWidths=function(t,e){let n,i=0,o=[],r=[],s=[];for(n=t.length;--n>=0;){let i=t[n];null!=i&&(o.push(n),r.push(i));let l=Array.isArray(e)?e[n]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(n=0;n<l.length;n++)i|=this._setColumnWidth(o[n],l[n],s[n]);return i&&this._syncLayoutToColumns(0,t.length),!!i},Qe.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Qe.prototype.hideColumn=function(t,e){let n=!1===e;this.setColumnVisibility(t,n,0)},Qe.prototype.hideColumns=function(t,e){let n=Array.isArray(t)?t.length:0,i=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<n;++r){let n=t[r];n>=0&&n<o&&this._layoutX.hideLane(n,e,0)&&i.push(n)}if(i.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=i,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},Qe.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let n=0;n<e;++n)this._layoutX.hideLane(n,!1,0)&&t.push(n);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},Qe.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Qe.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Qe.prototype.setMinimumColumnWidths=function(t,e){let n=0,i=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),i=r,n|=this._layoutX.setMinimumLaneSize(r,s,e))}return n&&this._syncLayoutToColumns(i,o+1),!!n},Qe.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Qe.prototype.setColumnScalability=function(t,e){let n=!1;return _t.isNumber(t)?(e=!1!==e,n=this._layoutX.setLaneScalability(t,e),n&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),n},Qe.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Qe.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Qe.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Qe.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Qe.prototype.isProportionPreserved=function(){return this._preserveProportion},Qe.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Qe.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Qe.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Qe.prototype.newColumnData=Qe.prototype.getColumnData,Qe.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Qe.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Qe.prototype.getFitContentWidth=function(){return this._fitContentWidth},Qe.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Qe.prototype.loadPlugin=function(t,e){let n=null;if("string"==typeof t){let e=window.tr,i=e?e.grid:null;if(!i)return null;if(i[t])n=new i[t];else{if(!i[t+"Plugin"])return null;n=new i[t+"Plugin"]}}else n=t;if(!n||!n.getName)return null;let i=n.getName();if(!i)return null;let o=this._plugins[i];if(o){if(o===n)return o;console.log("WARNING: Two of the same "+i+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(i)}return n.initialize&&n.initialize(this,e),this._plugins[i]=n,n},Qe.prototype.unloadPlugin=function(t){let e;if(t){let n="";"string"==typeof t?n=t:t.getName&&(n=t.getName()),e=this._plugins[n],e||(n+="Plugin",e=this._plugins[n]),e&&(e.unload&&e.unload(this),delete this._plugins[n])}return e||null},Qe.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Qe.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},Qe.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},Qe.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Qe.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Qe.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},Qe.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Qe.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Qe.prototype.getFooterCount=function(){return this._frozenFooterCount},Qe.prototype.freezeColumn=function(t,e){let n,i,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),n=0;n<o;++n)i=this._getColumnDef(n),i.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),n=o;--n>=0;)i=this._getColumnDef(n),i.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Qe.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let n=this._columnDefs[e];if(n&&n.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},Qe.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,n=this._columnDefs.length;for(e=0;e<n;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=n-e}return this._pinnedRightColumnCount=t,t},Qe.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Qe.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Qe.prototype.getPinnedLeftColumnCount=Qe.prototype.getFrozenColumnCount,Qe.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Qe.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Qe.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Qe.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Qe.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,n,i=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&i&&i.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)n=this._settings[e].getSection(),n.setFrozenLayout(this._frozenLayout);if(!this._frozenLayout){this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),i&&i.freezeIndicator(!1)}this._rowHeightSync=!0}return e},Qe.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Qe.prototype.isLayoutFrozen=function(){return this._frozenLayout},Qe.prototype.showBorders=_t._deprecatedFunction,Qe.prototype.hideBorders=_t._deprecatedFunction,Qe.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Qe.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Qe.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Qe.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Qe.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Qe.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Qe.prototype.setDataColumnMap=function(t){let e,n;if(t)for(e=t.length;--e>=0;)n=this._getColumnDef(e),n.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)n=this._columnDefs[e],n&&null!=n.dataColumnName&&(n.dataColumnName=null)},Qe.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Qe.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Qe.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Qe.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Qe.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Qe.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Qe.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Qe.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Qe.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},Qe.prototype._getTarget=function(t){let e=t.target;if(e){let n=null;return this._element.contains(e)||(n=t.composedPath?t.composedPath():t.path),n?n[0]||null:e}return t.getElement?t.getElement():_t.isElement(t)?t:null},Qe.prototype.getRelativePosition=function(t,e){if(!t)return{};let n=e||{},i=this._getTarget(t);t.target?_t.getRelativePosition(t,this.getElement(),n):i&&_t.getRelativePosition(i,this.getElement(),n),1!==this._zoomFactor&&(n.x/=this._zoomFactor,n.y/=this._zoomFactor),n.hit=!1,n.grid=this,n.clientX=t.clientX,n.clientY=t.clientY,n.zoomFactor=this._zoomFactor;let o=_t.closestElement(i,"cell");if(!o)return n;n.cellElement=o;let r=_t.closestElement(o,"column");n.columnElement=r;let s=null;if(s=r?_t.closestElement(r,"tr-lg"):_t.closestElement(o,"tr-lg"),!s)return n;n.sectionName=s.id||_t.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(n.sectionName);if(!l)return n;l.extendEventArg(n);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0?n:(n.colIndex=u,!1===this._hitTestY(-1,n)||(o.stretched?n.cell=a.getStretchedCell(u,n.rowIndex):n.cell=a.getCell(u,n.rowIndex),n.hit=!0),n)},Qe.prototype.getVScrollbar=function(){return this._vscrollbar},Qe.prototype.getHScrollbar=function(){return this._hscrollbar},Qe.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Qe.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Qe.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Qe.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let n=this._layoutX.getLaneCount();if(t<=0?t=0:t>=n&&(t=n-1),this.isPinnedColumn(t))return!1;let i=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+i,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=l){let t=a-i;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},Qe.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Qe.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Qe.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Qe.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Qe.prototype.getYScrollVal=function(t,e,n){if(!this._updateScrollbar(this._vscrollbar))return null;let i=null;t&&(i=this.getSection(t));let o=i?i.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],r=this._layoutY.getLaneStart(this._startVScrollbarIndex),s=this._layoutY.getLaneCount();if(e<=0?e=0:e>=s&&(e=s-1),n)return this._layoutY.getLaneStart(e+o)-r;let l=this.getVerticalViewInfo();if(e<l.firstFullRow){let t=e-2;return t<0&&(t=0),this._layoutY.getLaneStart(t+o)-r}if(e>l.lastFullRow){return this._layoutY.getLaneStart(e+o+2+1)-l.viewHeight-r}return null},Qe.prototype.scrollToRow=function(t,e,n){let i=this.getYScrollVal(t,e,n);null!==i&&this._vscrollbar.setScrollTop(i)},Qe.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),n=this._vscrollbar.getHeight(),i=this._vscrollbar.getScrollTop()+e,o=i+n,r=this._layoutY.hitTest(i)-t,s=this._layoutY.hitTest(o-.1);return s<0&&(s=this._layoutY.getLaneCount()-1),s-=t,{topRowIndex:r,firstFullRow:this._layoutY.getLaneStart(r+t)<i?r+1:r,lastFullRow:this._layoutY.getLaneEnd(s+t)>o?s-1:s,bottomRowIndex:s,viewHeight:n,viewTop:i,viewBottom:o}},Qe.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],n=this._layoutY.getLaneStart(e),i=this._vscrollbar.getScrollTop()+n,o=this._vscrollbar.getHeight(),r=i+o,s=this._layoutY.hitTest(i),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s+e),u=this._layoutY.getLaneEnd(l+e),h=i-o,p=h<=n?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,l-=e;let _={};return _.viewTop=i-n,_.viewBottom=r-n,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<i?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Qe.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Qe.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Qe.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Qe.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Qe.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Qe.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Qe.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Qe.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Qe.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Qe.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Qe.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;){this._settings[t].enableColumnVirtualization(e)}},Qe.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Qe.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Qe.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Qe.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},Qe.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},Qe.prototype.updateRowData=function(t,e,n,i){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,n,i)},Qe.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},Qe.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Qe.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Qe.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},Qe.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Qe.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Qe.prototype.getData=function(t,e,n){let i=this.getSectionSettings(t);if(!i)return null;let o=this._toDataColumnName(e);return i.getData(o,n)},Qe.prototype.setData=function(t,e,n,i){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,n,i)}return!1},Qe.prototype.removeRowData=function(t,e){let n=this.getSectionSettings(t);return!(!n||!n.isDataBindable())&&n.removeRowData(e)},Qe.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let n=e.length;--n>=0;)e[n].setHidingMethod(t)}},Qe.prototype.getHorizontalLayout=function(){return this._layoutX},Qe.prototype.setColumnVisibility=function(t,e,n){if(this._layoutX.hideLane(t,!e,n)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){let n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Qe.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Qe.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},Qe.prototype.getHiddenInput=function(t){return t?this._firstHiddenInput:this._lastHiddenInput},Qe.prototype.focus=function(){let t=this._lastHiddenInput,e=Je(t);if(t&&t!==e){let e=window.pageXOffset,n=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});n===window.pageYOffset&&e===window.pageXOffset||window.scrollTo(e,n)}},Qe.prototype.isBinding=function(){return this._dispatchingDataChanged},Qe.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Qe.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Qe.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Qe.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Qe.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Qe.prototype.initSimpleTable=function(t){let e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));let n=this.addSection("title");if(n.addRow(1),!this._renderingHandler)for(let i=0;i<e;++i)n.setCellContent(i,0,t[i]);this.addSection("content");let i=this.getSectionSettings("title");i.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(i),this._dataBindingHandler||this.setDefaultDataBindingHandler(Qe._defaultDataBinding)},Qe._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Qe.prototype.selectColumn=function(t,e){for(let n=this._settings.length;--n>=0;)this._settings[n].getSection().selectColumn(t,e);this.updateColumnBounds()},Qe.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Qe.prototype.updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,n=[],i=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),i||(i=[e,-1])):i&&(i[1]=e-1,n.push(i),i=null);i&&(i[1]=o-1,n.push(i),i=null);let s={selectedColumns:r,selectionRanges:n};this._dispatch("beforeColumnBoundUpdate",s);let l=n.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){i=n[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(i[0],i[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},Qe.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},Qe.prototype.getColumnRect=function(t,e){let n=this.getElement().clientWidth,i=n,o=this._hscrollbar;o.isActive()&&(i=o.getTrackSize());let r=0,s=0;if(this._settings.length){let n=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,n,[]),r=n[0],s=n[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:i,gridWidth:n}},Qe.prototype.getRowRect=function(t,e){let n=this._layoutX.getTrackSize(),i=this.getElement().clientWidth;n=n<i?n:i;let o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(a=h.getScrollTop(),u=h.getTrackSize());let p=u+l,d=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return d<l?d=l:d>p&&(d=p),c<l?c=l:c>p&&(c=p),d-=l,c-=l,{top:d,left:0,width:n,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},Qe.prototype.normalizeConfig=function(t){t||(t={});let e,n,i=t.columns,o=i?i.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=o;--e>=0;)--s>=0&&(n=i[e],n&&(n.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&i&&(n=i[r],n&&(n.leftPinned=!0))),t},Qe.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Qe.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Qe.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Qe.prototype.getValidColumnList=function(t,e){let n=[];if(!t)return n;e||(e=this.createColumnMap(t));let i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t).id;null!=e[i]&&n.push({index:t,id:i})}return n},Qe.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},n=t.length;for(let i=0;i<n;i++){let n=t[i];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},Qe.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},Qe.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],L(this._batches)&&(this._batches=null),!0)},Qe.prototype._dispatchColumnEvent=function(t,e){let n=this._batches;n&&(e.batches=n),this._dispatch(t,e)},Qe.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Qe.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Qe.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let n=0;n<e;n++)t.push(this._settings[n].getSection());return t},Qe.prototype._getNextSection=function(t,e,n){let i=this.getSectionIndex(e)+t;if(null==n)return this.getSectionSettings(i);n=this._toSectionType(n);let o=this._settings.length;for(;i>=0&&i<o;){let e=this._settings[i];if(n===e.getType())return e;i+=t}return null},Qe.prototype._toSectionType=function(t){if(Qe._sectionType[t])return t;if(_t.isString(t)){switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}}return"content"},Qe.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let n={horizontalScrollbar:this._hscrollbar},i="content"===t?new qe(n):new Ee(n);i._setContext(this);let o=new Be(i);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return i.enableRowHighlighting(r),i.enableShading(!1),i.setHidingMethod(this._hidingMethod),o.enableColumnVirtualization(this._colVirtualizer.isEnabled()),i.setColumnCount(this._layoutX.getLaneCount()),i.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(i),this._syncStyleToSectionColumns(i,t),t!==this._rowHeightException&&i.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),i.listen("rowHighlighted",this._onRowHightlighted),i.listen("rowCountChanged",this._onRowCountChanged),i.listen("rowHeightChanged",this._onRowHeightChanged),o},Qe.prototype._putToLast=function(t){if(0===this._settings.length)t.insertBefore(this._lastHiddenInput);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.insertBefore(this._lastHiddenInput)}},Qe.prototype._syncStyleToSectionColumns=function(t,e){let n;for(let i=this._columnDefs.length;--i>=0;){let o=this._getColumnDef(i),r=o.styles;for(n in r)t.setColumnStyle(i,n,r[n]);let s=o.classes;for(n in s)t.enableColumnClass(i,n,!0);let l=o[e];if(l){for(n in r=l.styles,r)t.setColumnStyle(i,n,r[n]);for(n in s=l.classes,s)t.enableColumnClass(i,n,!0)}}},Qe.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},Qe.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Qe.prototype._setColumnWidth=function(t,e,n){let i=!1,o=this._layoutX;if(null!=n)i=o.setLaneScalability(t,!!n);else{let n=o.getLaneScalability(t);if(this._preserveProportion){if(n){let n=this.getColumnCount(),i=0,r=0;for(let t=0;t<n;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);i+=o.getCustomLaneSize(t),r+=e}(!(e=(e*i-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=i)}}else i=o.setLaneScalability(t,!1)}return i=o.setLaneSize(t,e)||i,i},Qe.prototype._dispatchColumnAddedEvent=function(t,e,n,i){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=n,1===e)o.colIndex=t,o.context=i,this._dispatchColumnEvent("columnAdded",o);else{let n=Array.isArray(i)?i:[];for(let i=0;i<e;++i)o.colIndex=t+i,o.context=n[i],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Qe.prototype._dispatchColumnRenderEvent=function(t,e,n,i,o,r,s){if(!(i<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=n,this._hasListener("preSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<n;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=i;l<o;++l){let n=this._settings[l];n.extendRenderEventArg(t,r,s);let i=n.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let n=o;n<u;++n)t.rowIndex=n,t.cell=i.getCell(a,n,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=i;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},Qe.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let n=t.fromRowIndex,i=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=i-1;l>=n;--l){let n=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(n);if(t>0){l=l+t+1,s=!0;continue}}let i=r.getContextRow(l);if(!i)continue;let a=e.getExpansionParentByRowId(n);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=i.rowExpansion=!0;else{if(!i.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=i.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},Qe.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let n=e-t;this._layoutX.setLaneCount(n);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().setColumnCount(n)}let i=this._columnDefs.slice(n);if(this._columnDefs.length=n,this._onColumnCountChanged(),this._syncLayoutToColumns(n,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=n;){let e=i[o-n];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},Qe.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let n,i,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(n=l.getVisibleRowIds(!0),i=l.getMultipleRowData(n,o,r),t.dataRows=i);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){let o=a?i[h]:null;o&&(t.rowData=o,t.rowId=n[h],t.dataValue=o?o[u]:null,t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(t))}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1},Qe.prototype.resetInternalState=function(){this._firstRendered=!1},Qe.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Qe.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Qe.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this.updateColumnBounds(),this._dispatchColumnPositionChanged()},Qe.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Qe.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Qe.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,n=t.lastIndex+1,i=this._settings.length,o=[0,0];for(let t=0;t<i;++t){let i=this._settings[t],r=i.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,n,o),this.updateRowData(i,o[0],o[1]-1))}},Qe.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,n=t.prevLastIndex,i=t.firstIndex,o=t.lastIndex,r=e<i?e:i,s=n>o?n:o;this._activateColumns(i,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},Qe.prototype._activateColumns=function(t,e,n,i){null==n&&(n=0),null==i&&(i=this.getColumnCount()-1);let o=this._getColActivationList(t,e,n,i);for(let t=this.getSectionCount();--t>=0;){this._settings[t].activateColumns(o,n,i)}},Qe.prototype._getColActivationList=function(t,e,n,i){null==n&&(n=0);let o=this.getColumnCount();null==i&&(i=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(i+1);for(let o=n;o<=i;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},Qe.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Qe._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Qe.prototype._getNestedColumnDef=function(t,e,n){let i=this._getColumnDef(t);if(e){let t=i;i=t[e],i||(i=t[e]={}),n&&(t=i,i=t[n],i||(i=t[n]={}))}return i},Qe.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Qe.prototype._getColumnId=Qe.prototype.getColumnId,Qe.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).id||"";return e},Qe.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Qe.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Qe.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).field||"";return e},Qe.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,n=-1,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id)return t;e===i.field&&n<0&&(n=t)}return n}return-1},Qe.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Qe.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},n="";for(let i=0;i<t;++i){let t=this._getColumnDef(i);n=t.field,n&&(e[n]=i),n=t.id,n&&(e[n]=i)}return e},Qe.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Qe.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Qe.prototype._onGridClicked=function(){window.getSelection().toString()||this._element.contains(Je(this._element))||this.focus()},Qe.prototype._onKeyDown=function(t){if(!function(t){return 9===t.keyCode&&(!t.ctrlKey&&!t.altKey&&!t.metaKey)}(t))return;let e=Je(this._element),n=!1;this._firstHiddenInput===e?n=-1:this._lastHiddenInput===e&&(n=1),this._dispatch("tabNavigation",{activeElement:e,firstHiddenInput:this._firstHiddenInput,lastHiddenInput:this._lastHiddenInput,onTheEdge:n,shiftKey:t.shiftKey,event:t}),n&&!t.defaultPrevented&&(n>0&&t.shiftKey?this._firstHiddenInput.focus():n<0&&!t.shiftKey&&this._lastHiddenInput.focus())},Qe.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,n=this.getSectionSettings(e.getId());if(null==n)return;n.extendEventArg(t);let i=n.getDataSource();null!==i&&(t.rowId=i.getRowId(t.rowIndex),t.dataRow=i.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},Qe.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,n=t.prevCount,i=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(n>i)this._layoutY.removeLaneAt(r,n-i),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+n,i-n),o!==t)for(s=n;s<i;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),n<i?this._dispatch("rowAdded",t):n>i&&this._dispatch("rowRemoved",t)},Qe.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),n=e.length,i=NaN;for(let t=0;t<n;++t){let n=e[t],o=n.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=n.rowIndex,l=this.getRowIndex(r,s),a=n.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=i||(i=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):i>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(i<this._startVScrollbarIndex,i>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},Qe.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Qe.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},Qe.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),this._element.appendChild(this._lastHiddenInput),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},Qe.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this.updateColumnBounds(),this._updateColumnSeparators(),this._hScrollbarEnabled&&t+e<this.getColumnCount()?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),t,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate(),t=e=0),this._element.classList.toggle("right-pinning",e>0),this._dispatchColumnPositionChanged()},Qe.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Qe.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Qe.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Qe.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Qe.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Qe.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let n=this._layoutY.getLaneStart(this._sectionStarts[t]),i=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[i]):0)-n},Qe.prototype._updateScrollbarHeight=function(t,e,n){if(!this._vscrollbar.isEnabled())return!1;let i=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,i=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),n=this._vscrollbar.getParent();n?n!==e&&n.firstElementChild&&(n=n.firstElementChild):(n=t,this._vscrollbar.setParent(n));let i=this._getVScrollStart(),o=this._getFooterSize();n!==t&&(i+=t.clientTop),this._vscrollbar.resetPaneSize();let r=n.clientHeight-(i+o)*this._zoomFactor;this._vscrollbar.setTop(i*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return n||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(i),s},Qe.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),i=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(i)-this._layoutX.getLaneStart(i-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(n+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Qe.prototype._hitTestY=function(t,e){let n;if(e.sectionSettings)n=e.sectionSettings;else{let i;i="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=i>=0?i:~i,r=_t.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,n=this._settings[r],!n)return!1;n.extendEventArg(e)}let i=n.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=i.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+i.getRowOffset(),!0},Qe.prototype._syncLayoutToColumns=function(t,e,n){if(this._frozenLayout)return;let i=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=i,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let n=0;n<r;++n)s=this._syncLayoutToSectionColumns(this._settings[n].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this.updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||n)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},Qe.prototype._syncLayoutToSectionColumns=function(t,e,n){null==e&&(e=0),null==n&&(n=this._layoutX.getLaneCount());let i=0;for(let o=e;o<n;++o)i|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!i||this._frozenLayout)&&(t._updateColumnLayout(),!0)},Qe.prototype._toDataColumnName=function(t){return _t.isNumber(t)?this.getDataColumnName(t):t},Qe.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let e=this._settings.length,n=this._settings[0]||null;n!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=n,this._firstSettings&&this._firstSettings.getSection().addClass("first"));let i=this._settings[e-1]||null;i!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=i,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let n=t;n<e;++n){let t=this._settings[n].getSection();t.setIndex(n),t.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+t.getRowCount()}return this._sectionStarts[t]},Qe.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t){this._settings[t].getSection().updateLayout()}this._updateColumnSeparators()},Qe.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Qe._proto=Qe.prototype;let Ze={chainIcon:""};Ze.styles=function(t){if(t){let e="";if(Array.isArray(t)){e=t.map(F).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {")}else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,P)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),Ze.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,z(Ze.styles,t.getElement()))};var $e=Ze;let tn=function(){this._counter={},this._session={},this._referers={}};tn.prototype._counter=null,tn.prototype._session=null,tn.prototype._referers=null,tn.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},tn.prototype.newSession=function(){this._session={}},tn.prototype.getAllReferences=function(){return Object.keys(this._counter)},tn.prototype.hasReference=function(){for(const t in this._counter)return!0;return!1},tn.prototype.getAllReferers=function(){return Object.keys(this._referers)},tn.prototype.getAllReferrers=tn.prototype.getAllReferers,tn.prototype.getSession=function(){let t=[],e=[];for(let n in this._session){let i=this._session[n];i>0?t.push(n):i<0&&e.push(n)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},tn.prototype.addReference=function(t,e){if(t){if(e){let n=this._referers[e];if(n){if(n[t])return!1}else n=this._referers[e]={};n[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},tn.prototype.addRef=tn.prototype.addReference,tn.prototype.removeReference=function(t,e,n){if(!t)return!1;let i=this._counter[t];if(!i)return!1;if(null==n)n=1;else if(n<0)n=i;else if(!n)return!1;if(e){let n=this._referers[e];if(!n)return!1;if(!n[t])return!1;delete n[t]}return i-=n,!i||i<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=i,!1)},tn.prototype.release=tn.prototype.removeReference,tn.prototype.addReferences=function(t,e){if(!t)return 0;let n=0;if(Array.isArray(t)){let i=t.length;for(let o=0;o<i;++o)this.addReference(t[o],e)&&++n}else if("string"==typeof t)this.addReference(t,e)&&++n;else for(let i in t)this.addReference(i,e)&&++n;return n},tn.prototype.removeReferer=function(t){let e=0;if(t){let n=this._referers[t];if(n){for(let i in n)this.removeReference(i,t)&&++e;delete this._referers[t]}}return e},tn.prototype.removeReferrer=tn.prototype.removeReferer,tn.prototype.log=function(){console.log(this._counter)};var en=tn;let nn=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new r(0,t._commitFieldsChanges),t._ricChangedConflator=new r(0,t._commitRicsChanges),t._fields=new en,t._rics=new en,t._rowDefMap={}};s.inherits(nn,a),nn.prototype._fieldChangedConflator=null,nn.prototype._ricChangedConflator=null,nn.prototype._rowDefMap=null,nn.prototype._rics=null,nn.prototype._fields=null,nn.prototype.getAllRics=function(){return this._rics.getAllReferences()},nn.prototype.hasRic=function(){return this._rics.hasReference()},nn.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},nn.prototype.getAllFields=function(){return this._fields.getAllReferences()},nn.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},nn.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let n=this._rowDefMap,i=n[e];i?i.indexOf(t)<0&&i.push(t):i=n[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},nn.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let n=this._rowDefMap[e];if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},nn.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},nn.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"ricRemoved",removedRics:n}),i.length&&this._doDispatch({type:"ricAdded",addedRics:i}),t.newSession()},nn.prototype.addFields=function(t,e){if(!t)return;let n=this._fields;t instanceof jt?n.addReferences(t.getAllFields(),t.getId()):n.addReferences(t,e),this._commitFieldsChanges()},nn.prototype.removeFields=function(t,e){t&&(t instanceof jt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},nn.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},nn.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},nn.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"fieldRemoved",removedFields:n}),i.length&&this._doDispatch({type:"fieldAdded",addedFields:i}),t.newSession()},nn.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},nn.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var on=nn;let rn=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},sn=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};sn.prototype._globalContext,sn.prototype._sortParams,sn.prototype._ctxCaches,sn.prototype._primaryParams,sn.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},sn.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:sn._noSorting},sn.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},sn.prototype.setContext=function(t,e){this._globalContext[t]=e},sn.prototype.addColumnContext=function(t,e,n,i,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=A(this._globalContext));let a=0;"a"===i?a=1:"d"===i&&(a=-1);let u=[t,"function"==typeof e?e:null,l,n,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},sn._noSorting=function(t,e,n){return 0},sn.prototype._defaultSorter=function(t,e,n){let i=this._primaryParams[0];return rn(t.getData(i),e.getData(i),n)},sn.prototype._dataSorter=function(t,e,n){let i=this._primaryParams,o=i[0];return(0,i[1])(t.getData(o),e.getData(o),n,i[2])},sn.prototype._rowDefSorter=function(t,e,n){let i=this._primaryParams;return(0,i[1])(t,e,n,i[2])},sn.prototype._multiColumnsSorter=function(t,e,n){let i=this._sortParams,o=i.length;for(let n=0;n<o;++n){let o=i[n],r=o[0],s=o[1],l=o[2],a=o[3],u=o[4],h=0;if(h=s?a?s(t,e,u,l):s(t.getData(r),e.getData(r),u,l):rn(t.getData(r),e.getData(r),u),h)return h}return 0};var ln=sn;let an=function(t){let e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};l.inherits(an,mt),an.prototype._hosts=null,an.prototype._sortStates,an.prototype._maxCount=1,an.prototype._dataSorting=!0,an.prototype._dblClickAllowed=!1,an.prototype._clickTimer=0,an.prototype._delayInterval=0,an.prototype._lastMouseDown=0,an.prototype._initialSort=null,an.prototype._mode="",an.prototype._sortableColumns=!0,an.prototype._sortableIndicator=!1,an.prototype._solarTheme=!1,an.prototype._sortLogic,an.prototype._userManagedLogic=!1,an.prototype._disabled=!1,an.prototype._frozenIndicator=!1,an.prototype._rowDefMode=!1,an._icons={},an.prototype._sortingSequence,an.prototype._sortingSequenceMap=null;an.prototype.getName=function(){return"SortableTitlePlugin"},an.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},an.prototype.unload=function(t){let e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},an.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},an.prototype.config=function(t){if(!t)return;let e=this,n=t.icons;null!=n&&n.sorting&&(an._icons=n.sorting);let i=t.themeName;!i||i.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},an.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i=this._hosts[0];if(!i)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=n[e],o||(o=n[e]={}),o.sortOrder=t.sortOrder}for(s=i.getColumnCount(),r=0;r<s;++r)o=n[r],o||(o=n[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),L(e.sorting)&&delete e.sorting,e},an.prototype.getColumnMenu=function(t,e){e||(e={});let n=e.menus;n||(n=e.menus=[]);let i=n[0];i||(i=n[0]={menuItems:[]});let o=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return i.menuItems.push(r),e},an.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,n=e.colIndex,i=e.sortOrder;this.sortColumn(n,i)},an.prototype.getIcons=function(){return an._icons},an.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let n=e.getDataSource();for(let e in t)this._setSortLogic(n,e,t[e])}}},an.prototype.setSortLogic=function(t,e){if("string"==typeof t){let n=this._hosts[0];if(n){let i=n.getDataSource();this._setSortLogic(i,t,e)}}},an.prototype._setSortLogic=function(t,e,n){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(n):t.setColumnSortingLogic(e,n))},an.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,n=this._sortStates[e];return(n?n.sortOrder:"")||"n"},an.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},an.prototype.getSortPriority=function(t,e){let n=this._hosts[0];if(n){let i,o=this._sortStates.length;if(t>=0){let e=n.getColumnId(t);if(e)for(i=0;i<o;++i)if(this._sortStates[i].colId===e)return i}else if(e)for(i=0;i<o;++i){let t=this._sortStates[i];if(t.colId===e)return i;if(t.field===e)return i}}return-1},an.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},an.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let n=0;n<t;++n){let t=this.getSortedColumnIndex(n),i=this._sortStates[n],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=i.field||"";s&&(o.field=s),o.sortOrder=i.sortOrder||"n",e[n]=o}return e},an.prototype.isSorting=function(){return!!this._sortStates.length},an.prototype.sortColumn=function(t,e,n){this._sortColumn(this._prepareSorting(t,e),n)},an.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let n=t.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=this._prepareSorting(t[e]);this._sortColumn(i,e)}},an.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},an.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},an.prototype.restoreUserActions=an.prototype.refresh,an.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},an.prototype.getSortingStates=function(){return this._sortStates},an.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},an.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let n=t.getColumnCount();for(let t=0;t<n;++t)e[t]=this.getColumnSortingField(t)}return e},an.prototype.getDataColumnNames=an.prototype.getDataColumnMap,an.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},an.prototype.setDataColumnNames=an.prototype.setDataColumnMap,an.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),n=e?e.field:null;if(null==n&&!this._rowDefMode){let i=this._hosts[0];i&&(n=i.getColumnField(t),n||(n=i.getDataColumnName(t)),n&&e&&(e.field=n))}return n||""},an.prototype.setColumnSortingField=function(t,e,n,i){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==n||this._userManagedLogic||o.sortLogic!==n&&(o.sortLogic=n||null,i&&n&&(n.rowSorting=!0))}};let un=function(t){return t.field||""};an.prototype.getColumnSortingFields=function(){return this._sortStates.map(un)},an.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?an._toSortOrder(e):"a")&&"d"!==e&&(e="a");let n=null;n=Array.isArray(t)?t:[t];let i=n.length;for(let t=0;t<i;++t){let i=n[t],o=this.getSortingSequence(i).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,i)}},an.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},an.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},an.prototype.disableSortSymbols=function(t){},an.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},an.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},an.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},an.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let n=t.length;for(let i=0;i<n;++i)this._disableColumnSorting(t[i]||0,e)}},an.prototype._disableColumnSorting=function(t,e){let n=this._newSortOptions(t);n.disabled!==e&&(n.disabled=e)},an.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},an.prototype._initialSortByColumnField=function(t){let e=t.columns,n=e?e.length:0;for(let t=0;t<n;t++){let n=e[t].defaultSort;if(n)return{colIndex:t,sortOrder:n}}return null},an.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},an.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},an.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let n=this._getPlugin("CellEditingPlugin");if(n&&n.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let i=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,i,r)},an.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let n=t.grid;if(n&&n.focus&&n.focus(),this._hasListener("clicked")){let t={};t.colIndex=e,t.sortOrder=this.getSortOrder(e),t.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",t)}}},an.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},an.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},an.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},an.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let n=t.getRelativePosition(e);if(!n.hit)return;let i=this._getPlugin("ColumnSelectionPlugin");if(i&&i.isEnabled()){let t=n.colIndex;if(!i.isSelectedColumn(t))return}n.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,n),this._delayInterval)):this._proceedSorting(n)},an.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let n=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),n=!0;return this._sortStates.length=t,this._sortDataView(e),n},an._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},an.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},an.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let n;if(null!=e&&("string"==typeof e?n=e:"number"==typeof e&&(n=this.getColumnSortingField(e))),t){let e=t.map(an._toSortOrder);n?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[n]=e):this._sortingSequence=e}else n?this._sortingSequenceMap&&delete this._sortingSequenceMap[n]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},an.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},an.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{let t=e.getSortingLogics(),n=[],i=[],o=this._sortStates.length,r=an._toRowDefField();for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?r:e.field;n.push(e.sortOrder),i.push(o)}e.sortSeparators(t,n,i)}},an.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let n=this._hosts[0];if(!n)return null;let i=-1,o="";"number"==typeof t?i=t:"string"==typeof t?(o=t,i=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?i=this._getColumnIndex(o):"number"==typeof t.colIndex&&(i=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(i>=0){r=this.getColumnSortingField(i);let t=this._getSortOptions(i);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(i,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=an._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(i<0&&!r)return null;if(!a){a={};let t=n.getColumnId(i);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:i,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},an.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let n=null;if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i){let e=t[i];e&&(n?(n.colIndices||(n.colIndices=[],n.sortedFields=[],n.sortOrders=[],n.prevOrders=[]),n.colIndices.push(e.colIndex),n.sortedFields.push(e.sortedField),n.sortOrders.push(e.sortOrder),n.prevOrders.push(e.prevOrder)):n=e)}n=t[0]}else n=t;this._dispatch("columnSorted",n)},an.prototype._onColumnAdded=function(t){let e=this,n=t.colIndex,i=t.context||{},o=!!e._sortableColumns,r=i.field,s=i.sortBy;null!=s&&(o=!!s,r=s),null!=i.sortable&&(o=!!i.sortable);let l=i.sortLogic||i.sortingLogic||i.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=i.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(n,r,l,i.rowSorting):e.disableColumnSorting(n,!0);let u=i.sortOrder||i.sort;null!=u&&(u=an._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(n,u)))},an.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let n=t.colId;if(n)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===n){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},an._toRowDefField=function(t){return"ROW_DEF"},an.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let n=null,i=null,o=null;if(e){n=new Array(e),i=new Array(e);for(let t=0;t<e;++t)n[t]=this._sortStates[t].sortOrder,i[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(an._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,n,i,e)}}},an.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let n=null;for(let t=e.length;--t>=0;){let i,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==n&&(i=o.getSection())&&(n=i.getColumnIndex(o.getParent()))}return e.length=0,n},an.prototype._updateSortableIndicator=function(t){let e=this,n=e._hosts[t];if(!n||this._frozenIndicator)return;let i=n.getSection("title");if(null!=i)for(let n=i.getColumnCount();--n>=0;){let o=i.getRowCount();for(let r=0;r<o;r++){let s=i.getCell(n,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(i,n,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(n),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=an._icons.ascending):(t="▼",a=an._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=an._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},an.prototype._createIconElem=function(t,e){let n;return t&&"string"==typeof t?(n=document.createElement("ef-icon"),n.setAttribute("icon",t)):(n=document.createElement("span"),n.textContent=e),n},an.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},an.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},an.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},an.prototype._newSortOptions=function(t){let e=this._hosts[0],n=null;if(e&&t>=0){let i=e.getColumnData(t);n=i.sortableTitle,n||(n=i.sortableTitle={})}return n||{}},an.prototype._isCellSortable=function(t,e,n){let i=this._getSortOptions(e);if(i){if(i.disabled)return!1;let t=i.field;if(null!=t&&!t)return!1}let o=t.getCell(e,n,!0);return!o.hasClass("no-sort")&&(o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed"))},an._proto=an.prototype;let hn=function(t){return t?t.getRowData():null},pn=function(t){return!t.isAutoGenerated()},dn=function(t){return!t.autoGenerated},cn=function(t,e,n,i){return(t.getData(i)-e.getData(i))*n},_n=function(t,e,n){let i=t.getParent();if(!i)return 0;let o=e.getParent();if(!o)return 0;if(i!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*n},fn=function(t){return t?t.getName():""},gn=function(t,e){return t.getField()===e||t.getId()===e},yn=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},mn=function(t){t&&t.preventDefault()},Cn=function(t){return t&&clearTimeout(t),0},Sn=function(t,e){let n=this;if(n._onDataChanged=n._onDataChanged.bind(n),n._onQuote2PostUpdate=n._onQuote2PostUpdate.bind(n),n._onQ2DataChanged=n._onQ2DataChanged.bind(n),n._onDataComposed=n._onDataComposed.bind(n),n._onSubSegmentChanged=n._onSubSegmentChanged.bind(n),n._recalculateFormulas=n._recalculateFormulas.bind(n),n.updateColumnTitle=n.updateColumnTitle.bind(n),n._populateTimeSeriesChildren=n._populateTimeSeriesChildren.bind(n),n._onPostSectionDataBinding=n._onPostSectionDataBinding.bind(n),n._asyncClearDataUpdates=n._asyncClearDataUpdates.bind(n),n._clearDataUpdates=n._clearDataUpdates.bind(n),n._onPreDataSorting=n._onPreDataSorting.bind(n),n._mainSorter=n._mainSorter.bind(n),n._updateRowData=n._updateRowData.bind(n),n._onFormulaDataChanged=n._onFormulaDataChanged.bind(n),n._onFormulaDataRequired=n._onFormulaDataRequired.bind(n),n._registerConstituents=n._registerConstituents.bind(n),n._onColumnAdded=n._onColumnAdded.bind(n),n._onRowExpansionBinding=n._onRowExpansionBinding.bind(n),n._onColumnHeaderBinding=n._onColumnHeaderBinding.bind(n),n._getRowId=n._getRowId.bind(n),n._onFieldLoadedError=n._onFieldLoadedError.bind(n),n._snapshotFillerDataChanged=n._snapshotFillerDataChanged.bind(n),n._onPollingInterval=n._onPollingInterval.bind(n),n._onTabNavigation=n._onTabNavigation.bind(n),n._requestScroll=n._requestScroll.bind(n),n._onVScroll=n._onVScroll.bind(n),n._selfScrollToRow=n._selfScrollToRow.bind(n),n._dcConflator=new r(50,n._onDataChanged),n._formulaConflator=new r(300,n._onFormulaDataChanged),n._chainConflator=new r(100,n._registerConstituents),n._columnTitleConflator=new r(0,n.updateColumnTitle),n._timeSeriesChildConflator=new r(0,n._populateTimeSeriesChildren),n._defaultColumnOptions={},n._topNode=t||o.div(),n._topNode.classList.add("rt-grid"),n._grid=new Qe,n._grid._wrapper=this,n._sorter=new ln,n._sorter.setContext("grid",this),n._sorter.setContext("core",n._grid),n._dateTimeUtil=$,n._grid.listen("columnAdded",n._onColumnAdded),e){if(e.dataView){n._sharedDataSource=!0,n._dv=e.dataView,n._dt=n._dv.getDataTable(),n._mainGrid=e.grid;let t=n._mainGrid.getCoreGrid();n._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(n._stp=e.SortableTitle),!1===e.topSection&&(n._topSection=!1)}n._sharedDataSource||(n._dc=new Ct,n._dc.listen("dataChanged",n._onDataChanged),n._dc.listen("dataComposed",n._onDataComposed),n._dt=new It,n._dt.setSortingLogic(n._mainSorter),n._dt.setClassificationSource(n._dc),n._dt.listen("subSegmentChanged",n._onSubSegmentChanged),n._dv=new Ve(n._dt),n._dv.listen("pageIndexChanged",n._dispatch.bind(n,"pageIndexChanged")),n._dv.listen("pageCountChanged",n._dispatch.bind(n,"pageCountChanged"))),n._grid.setDataSource(n._dv),n._stp?(n._sharedSorter=!0,n._stp.listen("preDataSorting",n._onPreDataSorting),n._grid.loadPlugin(n._stp)):(n._stp=new an({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),n._stp.listen("preDataSorting",n._onPreDataSorting),n._grid.loadPlugin(n._stp,e)),n._grid.listen("beforeContentBinding",n._dispatch.bind(n,"beforeContentBinding")),n._grid.listen("preSectionRender",n._onColumnHeaderBinding),n._grid.listen("postSectionDataBinding",n._onPostSectionDataBinding),n._grid.listen("firstRendered",n._dispatch.bind(n,"firstRendered")),n._grid.listen("afterContentBinding",n._dispatch.bind(n,"afterContentBinding")),n._grid.listen("tabNavigation",n._onTabNavigation),n._grid.getVScrollbar().listen("scroll",n._onVScroll),n._grid.enableRowHighlighting(!0),n._addGridSections(),n._grid.setParent(n._topNode),n._snapshot=new Jt,n._snapshot.addEventListener("adcDataReceived",n._dispatch.bind(n,"adcDataReceived")),n._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),n._connector=new on,n._connector.addEventListener("ricAdded",n._onRicAdded.bind(n)),n._connector.addEventListener("ricRemoved",n._onRicRemoved.bind(n)),n._connector.addEventListener("fieldAdded",n._onFieldAdded.bind(n)),n._connector.addEventListener("fieldRemoved",n._onFieldRemoved.bind(n)),n.initialize(e),$e.applyStyle(n._grid)};s.inherits(Sn,a),Sn.prototype._topNode=null,Sn.prototype._mainGrid=null,Sn.prototype._grid=null,Sn.prototype._dc=null,Sn.prototype._dt=null,Sn.prototype._dv=null,Sn.prototype._sharedDataSource=!1,Sn.prototype._sharedSorter=!1,Sn.prototype._subs=null,Sn.prototype._stp=null,Sn.prototype._columnSorter=null,Sn.prototype._dcConflator=null,Sn.prototype._snapshot=null,Sn.prototype._connector=null,Sn.prototype._sorter=null,Sn.prototype._fnEngine=null,Sn.prototype._formulaConflator=null,Sn.prototype._chainConflator=null,Sn.prototype._clientWidth=NaN,Sn.prototype._autoLayoutTimer=0,Sn.prototype._defaultColumnOptions=null,Sn.prototype._RTK=null,Sn.prototype._ADCOptions=null,Sn.prototype._synapse=null,Sn.prototype._autoDateConversion=!1,Sn.prototype._textSelect=!1,Sn.prototype._lang=null,Sn.prototype._dateTimeUtil=null,Sn.prototype._initializing=!1,Sn.prototype._pollingInterval=0,Sn.prototype._pollingTimerId=0,Sn.prototype._lastPollingRequest=0,Sn.prototype._pollingEnabled=!0,Sn.prototype._fieldCaching=!1,Sn.prototype._timeSeriesExpansion=!0,Sn.prototype._childDataField="",Sn.prototype._topSection=!0,Sn.prototype._focusingArgs=null,Sn.prototype._unlinking=!1,Sn.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId=Cn(this._pollingTimerId),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._subs&&(this._subs.removeEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.removeEventListener("dataChanged",this._onQ2DataChanged),this._subs.dispose()),this._dc&&this._dc.dispose(),this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dc=this._dt=this._dv=this._subs=null,this._focusingArgs&&(Cn(this._focusingArgs.id),Cn(this._focusingArgs.timeoutId),this._focusingArgs=null)},Sn.prototype.getElement=function(){return this._topNode},Sn.prototype.removeEventListeners=Sn.prototype.removeAllEventListeners,Sn.prototype.listen=Sn.prototype.addEventListener,Sn.prototype.initSubscription=function(){if(this._subs)return;if(this._sharedDataSource)return void(this._subs=this._mainGrid._subs);let t,e,n;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(n=e.create(),this._RTK&&this._RTK.prefetchWorkaround&&n.addRic("DUMMY.WORKAROUND","DUMMY.WORKAROUND")),!n)return;n.filter&&n.filter(-2,-1),this._subs=n,this._subs.start(),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.addEventListener("dataChanged",this._onQ2DataChanged);let i=this._getAllRowDefinitions(),o=i.length;for(let t=0;t<o;++t){let e=i[t];e&&e.subscribeForUpdates(n)}},Sn.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},Sn.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},Sn.prototype.updateRowData=Sn.prototype._updateRowData,Sn.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let n=this._grid.getSectionSettings("content");n.setAutoSyncRowCount(!0),n.setParent(e)},Sn.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),n=this._grid.addSectionAt(e.length,"title",t);if(n){n.setRowCount(1),this._grid.getSectionSettings(n).disableDataBinding()}return n},Sn.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},Sn.prototype.setParent=function(t){o.appendChild(t,this._topNode),this.updateLayout()},Sn.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},Sn.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},Sn.prototype.getCoreGrid=function(){return this._grid},Sn.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let n=e._grid;n.resetInternalState();let i=(t=n.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(i,"beforeInit",[n.getElement(),t]),t.textSelect&&(e._textSelect=!0,n.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Wt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Wt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&($e.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new dt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&n.toggleBorders(r);let s=t.gridlines;null!=s&&n.toggleGridlines(s);let l=t.verticalLines;null!=l&&n.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&n.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&n.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&n.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&n.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&n.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(n.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),this.addListener(t,"tabNavigation"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&n.setRowScrollingStep(1),t.linearWheelScrolling&&n.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&n.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let f=t.adcPollingInterval;null!=f&&(e._pollingInterval=f?+f:0),e.setColumns(o);let g=!0;null!=t.rowVirtualRendering&&(g=t.rowVirtualRendering),null!=t.rowVirtualization&&(g=t.rowVirtualization),n.enableRowVirtualization(!!g);let y=!1;null!=t.columnVirtualRendering&&(y=t.columnVirtualRendering),null!=t.columnVirtualization&&(y=t.columnVirtualization),n.enableColumnVirtualization(!!y),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(n.freezeSection(null),e._topNode.style.overflow="");let m=t.topFreezingCount;if("number"==typeof m){m=m>0?m:0;let t=m-1;n.freezeSection(t)}else!1===m&&n.freezeSection(null);let C=t.bottomFreezingCount;if("number"==typeof C&&(C=C>0?C:0,n.freezeFooter(C)),e.addDataFields(t.dataFields),t[xt]=!0,Array.isArray(i)){for(let o=0;o<i.length;++o){let r=i[o],s=null;if(r){let e=r.name;s=e?n.loadPlugin(e,r):n.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let S=t.lang;null!=S&&(e._lang=S,e._dateTimeUtil.setLocale(S)),null!=t.childDataField&&(this._childDataField=zt._childDataField=t.childDataField);let w=t.rows;w||(w=t.rics||null);let b=t.bodies;if(!b&&(b=[],t.body&&b.push(t.body),w)){for(let t=0;t<w.length;t++)"string"==typeof w[t]&&(w[t]={ric:w[t]});b.push({rows:w})}let R=t.staticDataRows||t.dataModel;if(w&&R){let t,n,i=R.data?R.data:R,o=R.fields||e.getColumnFields(),r=w.length;for(let e=0;e<r;e++)w[e].values?(t=T(w[e].values,o),n=T(i[e],o),w[e].values=x(t,n)):w[e].values=i[e];i=i.slice(r,i.length),R.data?R.data=i:R=i}for(let t=0;t<b.length;++t)e.insertRows(b[t].rows);e.addStaticDataRows(R),t.contentBottomPadding&&n.setBottomPaddingSection(t.contentBottomPadding);let v=t.contentRightPadding;v&&("number"!=typeof v&&(v=6),n.reserveRightSpace(v));let I=t.dataConflationRate;null!=I&&n.setDataConflationRate(I);let D=n.getPluginList().map(n.getPlugin.bind(n));e._processExtension(D,"afterInit"),e.initSubscription()},Sn.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),i=0;i<o;++i){let t=n[i];t||(t=n[i]={});let e=this.getColumnDefinition(i);e.getConfigObject(t);let o=Wt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=n=n.filter(dn),""===this._topNode.style.overflow&&(e.scrollbar=!1);let l=this._dv.getPageSize();l>0&&(e.pageSize=l),l=s.getDefaultRowHeight(),28!==l&&(e.rowHeight=l),l=s.getSection("title").getDefaultRowHeight(),28!==l&&(e.headerRowHeight=l),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),l=L(this._defaultColumnOptions),l||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let a,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,i=0;i<o;i++)a=h[i],u=a.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,i=0;i<o;i++)a=h[i],c=p[i],d.getRowConfigObject(c,a.getRowId());return e},Sn.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},Sn.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},Sn.prototype._defaultColumnSetup=function(t,e){let n=e.length;for(let i=0;i<n;i++){let n=e[i];if("object"==typeof n)for(let e in t)null==n[e]&&(n[e]=t[e])}},Sn.prototype._processExtension=function(t,e,n){if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i][e]&&t[i][e].apply(t[i],n)},Sn.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let n=e.length;for(let t=0;t<n;++t){let n=e[t],i=this._connector.getRowDefByRic(n),o=i?i.length:0;for(let t=0;t<o;++t){i[t].getSymbol()===n&&this._snapshot.addRic(n)}}this._dispatch(t.type,t)},Sn.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},Sn.prototype._onFieldAdded=function(t){let e=t.rowDefs,n=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(n),this._subs){let t=n.filter(Wt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},Sn.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},Sn.prototype.insertColumn=function(t,e){let n=this.getColumnCount();(null==e||e>n)&&(e=n);let i=this._initializing?{}:A(this._defaultColumnOptions);if("string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];this._fnEngine&&(i.formulaEngine=this._fnEngine);let o=new qt(i,this);i.COL_DEF=o,this._grid.insertColumn(e,i)},Sn.prototype._updateTimeSeriesFields=function(t){let e,n,i,o,r,s,l=t.data,a={};for(let t in l){for(e in l[t])a[e]=!0;this.setRicData(t,l[t])}let u={};for(i in a)n=t.childrenFieldToParent[i],u[n]?u[n].push(i):u[n]=[i];for(n in u){let t,i,l=u[n];for(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),i=l.length,t=0;t<i;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Wt.addTimeSeriesChild(n,e));this.removeColumn(n)}},Sn.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,n,i,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let l=t.getField(),a=Wt.getTimeSeriesChildren(l);if(!a)return;if(i=a.length,i<1)return;for(n=0;n<i;n++)r=this.getColumnIndex(t),o=a[n],this._cloneTimeSeriesColumn(t,o,r)}},Sn.prototype._cloneTimeSeriesColumn=function(t,e,n){let i,o;i=t.getConfigObject(),o=A(i),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,n++)},Sn.prototype.replaceColumn=function(t,e){let n=this.getColumnIndex(e);if(n<0)return;let i={},o=this._grid,r=o._getColumnDef(n),s=o.getColumnScalability(n);if(i.scalable=s,s=o.getColumnCustomLaneSize(n),i.width=s,s=o.getMinimumColumnWidth(n),s>0&&(i.minWidth=s),s=o.getColumnVisibility(n,0),s||(i.hidden=!0),s=r.stationary,s&&(i.stationary=s),s=r.leftPinned,s&&(i.leftPinned=s),s=r.rightPinned,s&&(i.rightPinned=s),"string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];t.width&&!t.scalable&&(i.scalable=!1),t.scalable&&!t.width&&(i.width=1);let l=this.getColumnDefinition(n);l&&null==i.id&&(i.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(n),this.insertColumn(i,n),this._grid.stopBatch("reset")},Sn.prototype._onFieldLoadedSuccess=function(t,e,n){if(n&&n.id){let i=n;e&&e.getField()===t&&e.isDefaultName()&&i.name&&(e.setName(i.name),this.updateColumnTitle())}},Sn.prototype._onFieldLoadedError=function(t){},Sn.prototype._onFieldLoaded=function(t,e){if(Wt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},Sn.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},Sn.prototype.getFieldInfo=function(t){return Wt.getFieldInfo(t)},Sn.prototype.loadFieldInfo=function(t){return Wt.loadFieldInfo(t)},Sn.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Wt.hasFieldInfo(t),!e&&(e=Wt.isAdc(t)||Wt.isRealTimeField(t),!!e)))},Sn.prototype.setColumns=function(t){let e=this._grid,n=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),n>0){let i=!1;n>1&&(i=e.freezeLayout(!0));for(let e=0;e<n;++e)this.insertColumn(t[e],e);n>1&&e.freezeLayout(i)}e.stopBatch("reset")},Sn.prototype.restoreColumns=function(t,e){let n=this._grid;n.startBatch("reset");let i,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?yn:M,h=[],p=[],d=[];for(i=0;i<l;i++){for(r=!1,o=0;o<a;o++)if(u(s[i],t[o])){p.push(s[i]),r=!0;break}r||h.push(i)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),i=0;i<a;i++){for(r=!1,o=0;o<c;o++)if(u(t[i],p[o])){r=!0;let e=this.getColumnIndex(t[i].id||t[i].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[i],i),d.push(this.getColumnId(i)))}a>1&&this._grid.freezeLayout(_),n.reorderColumns(d),n.stopBatch("reset")},Sn.prototype.setFields=Sn.prototype.setColumns,Sn.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let n=t.colIndex,i=this._grid._getColumnDef(n);e._setCoreColumnDef(i);let o=this._grid.getColumnData(n);o||(o=this._grid.setColumnData(n,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(n,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(n,s,t)}else this._grid.setColumnWidth(n,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(n,s),s=r.hidden,s&&this._grid.hideColumn(n,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(n,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(n,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(n,a[l]);let u=e.getField();this._grid.setDataColumnName(n,xt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(l=0;l<g;l++)h=_[l],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():qt.getDataType(h),d=Wt.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},Sn.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let n=this.getColumnDefinition(e);this._grid.removeColumnAt(e),this._connector.removeFields(n),n.dispose()},Sn.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),n=e.length;if(n<=1)return void(1===n&&this.removeColumn(e[0]));e.sort(Sn._descendingOrder);let i=this._grid.freezeLayout();for(let t=0;t<n;++t){let n=e[t],i=this.getColumnDefinition(n);i.dispose(),this._grid.removeColumnAt(n),this._connector.removeFields(i)}this._grid.freezeLayout(i)},Sn.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0)}},Sn.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},Sn.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},Sn.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},Sn.prototype.hideColumn=function(t,e){let n=this.getColumnIndex(t);n<0||this._grid.hideColumn(n,e)},Sn.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},Sn.prototype.showAllColumns=function(){this._grid.showAllColumns()},Sn._descendingOrder=function(t,e){return e-t},Sn.prototype.addDataFields=function(t,e){if(!t)return!1;let n,i,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(n=0;n<a;n++)i=l[n],this._shouldLoadFieldInfo(i)?(o=qt.getDataType(i),r=Wt.loadFieldInfo(i).catch(this._onFieldLoadedError),o?this._connector.addFields(i,e||"grid"):(s=this._onFieldLoaded.bind(this,i,e),r=r.then(s).catch(s))):this._connector.addFields(i,e||"grid");return!0},Sn.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},Sn.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},Sn.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let n=this.getColumnIndex(t);n<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(n,e)},Sn.prototype.setColumnName=function(t,e){let n=this.getColumnDefinition(t);n&&(n.setName(e),this.updateColumnTitle())},Sn.prototype.getColumnBackgroundColor=function(t){let e=this.getColumnDefinition(t);return e?e.getBackgroundColor():""},Sn.prototype.setColumnBackgroundColor=function(t,e){let n=this.getColumnDefinition(t);n&&n.setBackgroundColor(e)},Sn.prototype.setColumnRenderer=function(t,e){let n=this.getColumnIndex(t);this.setColumnFormatter(n,e)},Sn.prototype.activateColumnRenderer=function(t,e,n){let i=this.getColumnIndex(t);if(null==i)return;let o=this.getColumnDefinition(i);o&&(o.activateRenderer(e,n),this._grid.setColumnDataBindingHandler(i,o.getRenderer()),this._grid.requestRowRefresh())},Sn.prototype.setColumnFormatter=function(t,e){if(null==t)return;let n=this.getColumnDefinition(t);if(!n)return;let i=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(n.getConfigObject(),this._grid),i=e.binding):i=e,"function"!=typeof i&&(i=null)),i!==n.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),n.setRenderer(i),this._grid.setColumnDataBindingHandler(t,n.getRenderer()),this._grid.requestRowRefresh()}},Sn.prototype.setColumnSorter=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnDefinition(n);if(i){i.setSorter(e),this.getSortedColumnIndex()===n&&this._stp.refresh()}},Sn.prototype._initDuplicateRicData=function(t){if(!t)return;let e=this._connector.getRowDefByRic(t.getSymbol());if(e&&e.length>0){let n=e[0];if(t.copyRowData(n),t.isChain()){let e=n.getChildren();e&&e.length>0&&setTimeout(this._cloneChain.bind(this,t),0)}}},Sn.prototype._cloneChain=function(t){let e=this._connector.getRowDefByRic(t.getSymbol()),n=e?e[0]:null,i=n?n.getChildren():null,o=i?i.length:0;if(o<0)return;let r=t.getSubId();if(!r)return;let s={subId:r};for(let t=0;t<o;t++){let e=i[t];s.ric=e.getRic(),s.values=e.cloneRowData(),s.values.SUB_ID=r,this._onQ2DataChanged(s)}},Sn.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let n=new zt(t);return n.registerToView(this._dv,this._getRowId(e)),n.setDataSource(this._dc,this._subs),this._initDuplicateRicData(n),t&&t.hidden&&this._dv.hideRow(n.getRowId()),this._connector.addRic(n),n},Sn.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},Sn.prototype.insertRows=function(t,e,n){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let i=this._dt.freeze(),o=n||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let n=t[e];n&&("string"==typeof n&&(n={ric:n}),n.fields=o),this.insertRow(n,r)}this._dt.freeze(i)},Sn.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let n=t;t=null,n&&(n.fields&&!e&&(e=n.fields),Array.isArray(n.data)&&(t=n.data))}t&&this.insertRows(t.map(Sn._dataToRowOptions),null,e)}},Sn.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let n,i,o,r,s=t.length,l={},a=this.getAllRowDefinitions(),u=a.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)n=a[r],n&&(i=n.getRowData()[e],i||0===i?l[i]=n:this.removeRow(n));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],i=o[e],n=l[i],d[i]=o,o.ROW_ORDER=r,p[i]||(p[i]=!0,n?n.setRowData(o):this.insertRow({values:o}));for(let t in l)l[t]&&!d[t]&&this.removeRow(l[t]);this._dt.sortOnce(xt,"a",cn,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?l[r]=a[r]:this.removeRow(a[r]);for(r=0;r<s;r++)o=t[r],n=l[r],n?n.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},Sn._dataToRowOptions=function(t){return{values:t}},Sn.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},Sn.prototype.removeRows=function(t){let e,n;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let i=[],o=t.length;for(n=0;n<o;++n)e=this._getRowDefinitionByRef(t[n]),e&&(e.isAutoGenerated()||i.push(e));o=i.length;let r=!1;for(o>1&&(r=this._dt.freeze()),n=0;n<o;++n)this._removeRow(i[n]);return o>1&&this._dt.freeze(r),i},Sn.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates(),t.forEach(zt.dispose),this._dcConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},Sn.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=t.getDescendants();e&&this._removeConstituentRows(e),this._connector.removeRic(t),this._dt.removeRow(t.getRowId()),t.dispose()},Sn.prototype._removeConstituentRows=function(t){let e=this._connector,n=[];for(let i=0;i<t.length;i++){let o=t[i];n.push(o.getRowId()),e.removeRic(o),o.dispose()}this._dt.removeRows(n)},Sn.prototype.hideRow=function(t,e){let n=this._getRowId(t);(this._mainGrid||this._grid).hideRow(n,e)},Sn.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let n=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(n,e)},Sn.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},Sn.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},Sn.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},Sn.prototype.setRic=function(t,e,n){if(this._mainGrid)return this._mainGrid.setRic(this._toRowId(t),e,n);let i=this._getRowDefinitionByRef(t);if(i){let t=n||{};"string"==typeof e?t.ric=e:(e&&!n&&(t=e),e=t.ric?t.ric:"");let o=zt.extractRowOptions(t),r=i.getSymbol();i.setContent(e,o)&&(this._connector.removeRic(i,r),this._initDuplicateRicData(i),this._connector.addRic(i));let s=t.values;null!=s&&i.setStaticRowData(s,t.fields)}return i},Sn.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);if(!e)return;if(!e.isChain())return;this._unlinking=!0;let n=e.getDescendants();if(n)if(e.isChainExpanded())for(let t=0;t<n.length;t++)n[t].toRealTimeRow();else this._removeConstituentRows(n);e.unlinkChain(),this._unlinking=!1},Sn.prototype.setRowContent=Sn.prototype.setRic,Sn.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},Sn.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},Sn.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},Sn.prototype.getRowCount=function(){return this._dv.getRowCount()},Sn.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},Sn.prototype.getDataRowCount=function(){return this._dt.getRowCount()},Sn.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Sn.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},Sn.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},Sn.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;n++)e[n]=this.getColumnDefinition(n);return e},Sn.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},Sn.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let n,i,o=new Array(e);for(n=0;n<e;n++)i=t[n],o[n]=this.getColumnDefinitionById(i);return o}return null},Sn.prototype._getColumnDefinition=function(t){if(t instanceof qt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let n=0;n<e;++n){let e=this.getColumnDefinition(n);if(gn(e,t))return e}}return null},Sn.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},Sn.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},Sn.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,xt)||null},Sn.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,xt)||null},Sn.prototype._getRowDefinitionByRef=function(t){return t instanceof zt&&t.getRowId()?t:this.getRowDefinition(t)},Sn.prototype.getRowDefinitions=function(){return this._dv.getColumnData(xt,!0)},Sn.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(xt)},Sn.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(xt).filter(pn)},Sn.prototype.getRowData=function(t){return hn(this._getRowDefinitionByIndex(t))},Sn.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let n=t,i=n.length,o=new Array(i);e=this.getRowDefinitions();for(let t=0;t<i;++t){let i=n[t];"number"==typeof i?o[t]=hn(e[i]):i&&i.getRowData&&(o[t]=hn(i))}return o}return e=t&&t.getColumnData?t.getColumnData(xt,!1):this.getRowDefinitions(),e.map(hn)},Sn.prototype.setRicData=function(t,e){let n=this._connector.getRowDefByRic(t),i=n?n.length:0;for(let o=0;o<i;++o){let i=n[o];i&&i.getSymbol()===t&&i.setRowData(e)}},Sn.prototype.getAllRics=function(){return this._connector.getAllRics()},Sn.prototype.hasRic=function(){return this._connector.hasRic()},Sn.prototype.setRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setRowData(e)},Sn.prototype.setStaticRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setStaticRowData(e)},Sn.prototype.setStaticData=function(t,e,n){let i=this._getRowDefinitionByRef(t);i&&i.setStaticData(e,n)},Sn.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof zt?t.getRowId():""},Sn.prototype.getColumnIndex=function(t){if(t&&t instanceof qt){let e=this.getColumnCount();for(let n=0;n<e;++n){if(this.getColumnDefinition(n)===t)return n}return-1}return this._grid.getColumnIndex(t)},Sn.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Sn.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},Sn.prototype.getColumnIds=function(){return this._grid.getColumnIds()},Sn.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},Sn.prototype.getColumnFields=function(){return this._grid.getColumnFields()},Sn.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(fn)},Sn.prototype.getAllFields=function(){return this._connector.getAllFields()},Sn.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},Sn.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=n.length,o=0;for(let t=0;t<i;++t)o|=this._pinColumn(n[t],e);return!!o}return this._pinColumn(t,e)},Sn.prototype._pinColumn=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnCount();if(n<0||n>i)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(n>=t)return!1;if(s>=0&&n<=s)return!1;this.moveColumnById(n,t),r+=1,o-=1}else{if(n<o)return!1;o||s>=0&&(o=s,n>s&&o++),this.moveColumnById(n,o)}return this._grid.freezeColumn(o,r),!0},Sn.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=0;for(let t=n.length;--t>=0;)i|=this._unpinColumn(n[t],e);return!!i}return this._unpinColumn(t,e)},Sn.prototype._unpinColumn=function(t,e){let n=this.getColumnIndex(t);if(n<0)return!1;let i=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(n>=i&&n<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(n)}let a=this._grid.getStationaryColumnIndex();return n<i?(n>a&&this.moveColumnById(n,i),this._grid.freezeColumn(i-2,o)):n>=r&&(n>a&&this.moveColumnById(n,r),this._grid.freezeColumn(i-1,o-1)),n>a&&null!=l&&this.moveColumnById(s,l),!0},Sn.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},Sn.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,n=t.toColIndex;for(;e<n;)this._renderColumnHeader(e++,t)},Sn.prototype._renderColumnHeader=function(t,e){let n=this.getColumnDefinition(t);if(!n)return;let i=n.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=n;let s=n.getName(),l=n.getTooltip(),a=n.getHeaderAlignment(),u=n.getTooltipValue();for(let n=0;n<r;++n){let r=o.getCell(t,n,!1);r.setContent(s),r.setTooltipInfo("columnDefault",u),r.setTooltipInfo("columnTooltip",l),r.updateTooltip(),r.setStyle("textAlign",a),i&&(e.rowIndex=n,e.cell=r,i(e))}},Sn.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},Sn.prototype.isSorting=function(){return this._stp.isSorting()},Sn.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},Sn.prototype.getSortOrder=function(){return this._stp.getSortOrder()},Sn.prototype.clearSort=function(){this._stp.clearSortState()},Sn.prototype.getSortingStates=function(){let t=[],e=this._stp.getSortingStates(),n=e.length;for(let i=0;i<n;i++){let n=e[i],o=this._stp.getSortedColumnIndex(i);t.push({colId:this.getColumnId(o),colIndex:o,order:n.sortOrder})}return t},Sn.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",_n))},Sn.prototype._onQ2DataChanged=function(t){let e=t.subId,n=this._getRowDefinitionById(e);if(!n)return;let i=t.values;if(i){let e=t.ric;if(n.verifyConstituent(e)){let t=n,i=t.getConstituent(e);if(i)n=i;else{if(n=i=t.addConstituent(e),!i)return;this._connector.addRic(i),this._registerConstituents(i)}}n.setRowData(i)}else n.isConstituent()&&(n.setParent(null),this._removeRow(n))},Sn.prototype._registerConstituents=function(t){if(this._chainConflator.conflate(t))return;let e=this._dv,n=e?e.getDataSource():null;if(!n)return;let i,o=this._chainConflator.popAllData(),r=o?o.length:0,s=[],l={};for(i=0;i<r;++i){let t=o[i],e=t.getParent();if(!e)break;let n=e.getRowId(),r=l[n];null==r&&(r=l[n]=e.countChildInView()),s.push(t)}if(r=s.length,!r)return;let a=!1;for(r>1&&(a=this._dt.freeze()),i=0;i<r;++i){let t=s[i],o=t.getParent().getRowId(),r=l[o];e.addSegmentChild(o,t.getRowId());let a=n.getRowIndex(o)+1,u=t.getData("CHILD_ORDER");a+=null!=u&&u<r?u:r;let h=n.getRowId(a);t.registerToView(e,h),l[o]=r+1}r>1&&this._dt.freeze(a)},Sn.prototype._onDataChanged=function(t){if(this._dt&&t&&t.rid&&t.changes){let e=this._getRowDefinitionById(t.rid);e&&e.addUpdate(t.changes)&&(this._dt._hasNewUpdates=!0)}this._dcConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},Sn.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let n=0;n<t;++n){let t=e[n],i=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(i=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(i,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},Sn.prototype._mainSorter=function(t,e,n){return this._columnSorter(t,e,n)},Sn.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},Sn.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},Sn.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[xt].resetUpdates()}},Sn.prototype.getDataView=function(){return this._dv},Sn.prototype.setPage=function(t){return this._dv.setPage(t)},Sn.prototype.setPageSize=function(t){this._dv.setPageSize(t)},Sn.prototype.getPageIndex=function(){return this._dv.getPageIndex()},Sn.prototype.getPageSize=function(){return this._dv.getPageSize()},Sn.prototype.getPageCount=function(){return this._dv.getPageCount()},Sn.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},Sn.prototype.setClassification=function(t,e){let n=this._getRowDefinitionByRef(t);return!!n&&this._dt.setSegmentClassification(n.getRowId(),e)},Sn.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},Sn.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},Sn.prototype.focus=function(){this._grid.focus()},Sn.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},Sn.prototype.updateLayout=function(){this._grid.updateLayout()},Sn.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},Sn.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},Sn.prototype._onFormulaDataRequired=function(t){},Sn.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;if(!t.rowData)return;let n=this._getRowDefinitionById(t.rid);if(n){if(this._autoDateConversion){let t,i,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():qt.getDataType(t),"datetime"===o&&(i=e[t],n.setData(t+"_RAW",i),i=$.toDateObject(i),n.setData(t,i))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=n,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)}},Sn.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=t.removedRows,r=i.length,s=null;for(e=0;e<r;e++){let t=o[i[e]];t&&(s=t[xt],s&&(s.dispose(),t[xt]=null))}let l=n.length;for(e=0;e<l;e++){let t=n[e].getId();s=new zt({segmentId:t}),s.registerToView(this._dv),s.setDataSource(this._dc)}},Sn.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let n=0;n<e;++n)this._fnEngine.calculate(t[n])}},Sn.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},Sn.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},Sn.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},Sn.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},Sn.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},Sn.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},Sn.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},Sn.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},Sn.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let n=Ct.constructTable(t.map(hn),e);console.table(n)},Sn.prototype.replaceRow=function(t,e){let n=this._getRowId(t),i=this._getRowDefinitionById(n);if(i){if(i.isAutoGenerated())return null;let t=i.getConfigObject();if(i.getRowId()===e.rowId)return null;if(M(t,e))return null}let o=this.insertRow(e,n);return i&&this.removeRow(n),o},Sn.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},Sn.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},Sn.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},Sn.prototype.getScrollTop=function(){return this._grid.getScrollTop()},Sn.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},Sn.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},Sn.prototype.scrollRight=function(t){this._grid.scrollRight(t)},Sn.prototype.scrollDown=function(t){this._grid.scrollDown(t)},Sn.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},Sn.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},Sn.prototype.getVScrollView=function(){return this._grid.getVScrollView()},Sn.prototype._focusCell=function(t,e){if(t){let n=t.getContent();if(n){let i=null;if(this.hasListener("tabNavigation")){let o={shiftKey:e.shiftKey,activeElement:e.activeElement,cellContent:n,cell:t,colIndex:e.colIndex,rowIndex:e.rowIndex,field:e.fields?e.fields[e.colIndex]:""};this._dispatch("tabNavigation",o),i=o.nextFocusableElement}else"SPAN"!==n.tagName&&(i=n);if(i&&i!==e.activeElement&&!i.disabled)return i.focus(),!0}}return!1},Sn.prototype._onVScroll=function(){let t=this._focusingArgs;if(t){t.timeoutId=Cn(t.timeoutId),this._focusingArgs=null;let e=this._grid.getCell("content",t.colIndex,t.rowIndex);this._focusCell(e,t)||(t.shiftKey?this._focusPrevCellContent(t):this._focusNextCellContent(t))}},Sn.prototype._onScrollTimeout=function(){this._focusingArgs=null},Sn.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},Sn.prototype._requestScroll=function(t){this._focusingArgs||(this._focusingArgs=t,t.event=null,t.id=setTimeout(this._selfScrollToRow,0),t.timeoutId=setTimeout(this._onScrollTimeout,100))},Sn.prototype._focusNextCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=0;if(e>=0)for(i=1;i<r&&!(e<o[i]);i++)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().lastFullRow,h=this.getRowCount();t.fields=l.getColumnFields();for(let e=n;e<h;e++){for(t.rowIndex=e,i=s;i<r;i++){let n=o[i];if(t.colIndex=n,e>u)return mn(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void mn(t.event)}}s=0}this._grid.getHiddenInput().focus()},Sn.prototype._focusPrevCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=r-1;if(e>=0)for(i=r-1;--i>=0&&!(e>o[i]);)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().firstFullRow;t.fields=this.getColumnFields();for(let e=n;e>=0;e--){for(t.rowIndex=e,i=s;i>=0;i--){let n=o[i];if(t.colIndex=n,e<u)return mn(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void mn(t.event)}}s=r-1}this._grid.getHiddenInput(!0).focus()},Sn.prototype._onTabNavigation=function(t){if(this._focusingArgs)return;let e=this.getColumnDefinitions(),n=e.length,i=[];for(let t=0;t<n;t++)e[t].isFocusable()&&i.push(t);if(!i.length)return;let o=t.event,r=this.getRelativePosition(o),s=r.rowIndex;if(t.onTheEdge){let t=this._grid.getVerticalViewInfo();s=o.shiftKey?t.lastFullRow:t.firstFullRow}let l={event:o,shiftKey:o.shiftKey,colIndex:r.colIndex,rowIndex:s,focusableColIndices:i,activeElement:t.activeElement};o.shiftKey?this._focusPrevCellContent(l):this._focusNextCellContent(l)},Sn.prototype._getEventHandlers=function(){return{tabNavigation:this._onTabNavigation}};let wn={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};wn.words=wn.texts.join(" ").split(" ").filter((function(t){return t.length>1})),wn.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],wn.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],wn.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],wn.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var bn=wn;let Rn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],vn={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?Fn(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:bn.companyName},industry:{type:"set",members:bn.industry},market:{type:"set",members:bn.market},country:{type:"set",members:bn.country}},In=function(t,e){if(t){let n=e;"function"==typeof e&&(n={type:"function",generate:e}),vn[t]=n}},Dn=function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()},xn=function(t,e,n,i){t||(t=0),null==e&&(e=100);let o=(e-t)*Dn(i)+t;if(n>0){let t=Rn[n];return Math.floor(o*t)/t}return null!=n?Math.floor(o):o},An=function(t,e,n){return xn(t,e+1,0,n)},Ln=function(t,e,n){return xn(t,e,0,n)},Tn=function(t,e){return Ln(0,t,e)},En=function(t){return 0===An(0,1,t)},Mn=function(t,e){if(t){return t[Tn(t.length,e)]}return String.fromCharCode(An(65,90,e))},Fn=function(t,e,n){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let i=An(0,(e-t)/1e3,n);return new Date(t+1e3*i)},Pn=function(t,e,n){let i=t<e?Ln(t,e,n):t,o=new Array(i);for(let t=0;t<i;++t){null!=n&&(n*=1.17*(t+1));let e=Tn(bn.words.length,n);o[t]=bn.words[e]}return o.join(" ")},zn=function(t,e,n){let i=kn(t,e,n),o=i.value+"";return i.prefix&&("string"==typeof i.prefix?o=i.prefix+o:e.prefix&&(o=e.prefix+" "+o)),i.suffix&&(o+=i.suffix),"string"===i.type&&(i.value=o),i.formattedValue=o,i},Vn=function(t,e,n){let i={},o=0;e&&("number"==typeof e?o=i.numRows=e:(i=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(n=e.seed)&&(n=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let i=0;i<o;++i){let i=[];for(let o=0;o<r;++o){let r=t[o];i.push(kn(r,e,n).value)}null!=n&&++n,s.push(i)}return{data:s,seed:n,fields:t}},kn=function(t,e,n){let i,o=function(t){return vn[t]||{}}(t);if(o.type||(o.type="number",In(t,o)),o.fixedValue)return o.value=i,o;null!=n&&(null==o.hash&&(o.hash=function(t){let e=0,n=t?t.length:0;for(;--n>=0;)e+=t.charCodeAt(n)*(n+.9879);return e}(t)),n+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)i=null!=o.min||null!=o.max?Pn(r,s,n):e&&e.text||"";else if("set"===o.type)i=Mn(o.members,n);else if("date"===o.type)i=Fn(r,s,n);else if("isoDate"===o.type){i=Fn(r,s,n).toISOString().slice(0,10)}else if("isoDateObject"===o.type)i=Fn(r,s,n),i=new Date(i.toISOString().slice(0,10));else if("boolean"===o.type)i=En(n);else if("function"===o.type)o.field=t,i=o.generate(o,n);else{let t=null!=o.prec?o.prec:0;i=xn(r,s,t,n)}return o.value=i,o},Nn=function(t){this._seed=null!=t?t:null};Nn.prototype._seed=null,Nn.prototype.generate=function(t,e){let n=Vn(t,e,this._seed);return this._seed=n.seed,n.data},Nn.prototype.generateRecords=function(t,e){let n=Vn(t,e,this._seed);this._seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e){r[t[e]]=n[e]}o[e]=r}return o},Nn.prototype.generateQuoteData=function(t,e){let n=zn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.getSeed=function(){return this._seed},Nn.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},Nn.prototype.randBetween=function(t,e){let n=Ln(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randInt=function(t,e){let n=An(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randIndex=function(t){let e=Tn(t,this._seed);return null!=this._seed&&++this._seed,e},Nn.prototype.randNumber=function(t,e,n){let i=xn(t,e,n,this._seed);return null!=this._seed&&++this._seed,i},Nn.prototype.randBoolean=function(){let t=En(this._seed);return null!=this._seed&&++this._seed,t},Nn.prototype.randMember=function(t){let e=Mn(t,this._seed);return null!=this._seed&&++this._seed,e},Nn.prototype.randDate=function(t,e){let n=Fn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randString=function(t,e){let n=Pn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.seed=null,Nn.generate=function(t,e){let n=Vn(t,e,Nn.seed);return Nn.seed=n.seed,n.data},Nn.generateRecord=function(t,e,n){Array.isArray(t)||(t=[t+""]);let i={};null!=e&&("number"==typeof e?n=e:e&&(i=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=kn(o,i,n).value}return r},Nn.generateRecords=function(t,e){let n=Vn(t,e,Nn.seed);Nn.seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e){r[t[e]]=n[e]}o[e]=r}return o},Nn.addFieldInfo=In,Nn.randNumber=xn,Nn.randInt=An,Nn.randBetween=Ln,Nn.randIndex=Tn,Nn.randBoolean=En,Nn.randMember=Mn,Nn.randDate=Fn,Nn.randString=Pn,Nn.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let n=i[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let i=r[t];if(void 0!==i){let o=e[t];o||0===o||(o=t+""),n[o]=i}}}return i};let On=function(){};On.prototype.create=function(t){return new Hn(t)};let Hn=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Hn._runningId++};Hn.prototype._rics=null,Hn.prototype._isChain=!1,Hn.prototype._fieldMap=null,Hn.prototype._prevData=null,Hn.prototype._updateHandler=null,Hn.prototype._updateTimerId=0,Hn.prototype._updateInterval=1e3,Hn._runningId=0,Hn.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Hn.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Hn.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Hn.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Hn.prototype.start=function(){return this._onRowUpdated(),this},Hn.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Hn.prototype.onNewRow=function(t){return this},Hn.prototype.onUpdate=function(t){return this._updateHandler=t,this},Hn.prototype.onRemoveRow=function(t){return this},Hn.prototype._onRowUpdated=function(){if(!this._updateHandler)return;let t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(let n=0;n<e;++n)Tn(3)||(t=this._rics[n],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Hn.prototype._getUpdateData=function(t){let e={id:this.id},n={text:t};for(let t in this._fieldMap){let i=zn(t,n),o=i.value,r=i.formattedValue;i.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let Bn=function(){this._dict={}};Bn.prototype._dict,Bn.prototype._count=0,Bn.prototype.addItem=function(t,e){if(t&&null!=e){let n=this._dict[t];return n?n.push(e):this._dict[t]=[e],++this._count,!0}return!1},Bn.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let n=e?e.length:0;if(n){let i=this._dict[t];return i||(i=this._dict[t]=[]),Array.prototype.push.apply(i,e),this._count+=n,!0}}return!1},Bn.prototype.removeItem=function(t,e){let n=this._dict[t];if(n){let i=n.indexOf(e);if(i>=0)return n.length>1?n.splice(i,1):delete this._dict[t],--this._count,!0}return!1},Bn.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},Bn.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},Bn.prototype.getItems=function(t){return this._dict[t]||null},Bn.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let n in e)Array.prototype.push.apply(t,e[n]);return t}return null},Bn.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},Bn.prototype.getAllKeys=function(){return Object.keys(this._dict)};let Gn=function(t,e){return t.ric+"_"+e.ric},Wn=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Un=function(t){let e,n,i,o=t;for(e=o.length-1;e>0;e--)n=Math.floor(Math.random()*(e+1)),i=o[e],o[e]=o[n],o[n]=i;return o.forEach(Yn),o=o.sort(Xn),o},Yn=function(t,e){t.CHILD_ORDER=e},Xn=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},qn=function(){};qn.prototype._lastSub=null,qn.prototype._configObj=null,qn.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},qn.prototype.create=function(t){return this._lastSub=new jn(t||this._configObj),this._lastSub},qn.prototype.isSkipHeaderSupported=function(){return!0},qn.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},qn.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let jn=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new Bn,this._fields={},this._events={},this._dataGen=new Nn,this.config(t)};jn.prototype._minInterval=750,jn.prototype._maxInterval=850,jn.prototype._percentageDataUpdate=.1,jn.prototype._constituentCache=!1,jn.prototype.config=function(t){if(!t)return;let e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),e=t.maxInterval,"number"==typeof e&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),e=t.percentageDataUpdate,"number"==typeof e&&(this._percentageDataUpdate=e/100);let n=t.constituentCache;null!=n&&(this._constituentCache=n)},jn.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},jn.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},jn.prototype.setSeed=function(t){this._dataGen.setSeed(t)},jn.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},jn.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},jn.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n)this._fields[t[n]]=!0},jn.prototype.removeSubscription=function(t){let e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){let t=e.children,n=t.length;for(let i=0;i<n;++i){let n=t[i];this._dataMap.removeItem(Gn(e,n),n),n.parent=null}e.children=null,e.ricList=null}},jn.prototype.removeRic=jn.prototype.removeSubscription,jn.prototype.removeChain=jn.prototype.removeSubscription,jn.prototype.removeAllSubscriptions=function(){let t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){let t=[];for(let e in this._subMap)t.push(this._subMap[e]);t.length>0&&this._dispatch("subscriptionRemoved",{subs:t})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},jn.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n){let e=t[n];this._fields[e]&&delete this._fields[e]}},jn.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},jn.prototype.start=function(){this._working=!0,this._connect()},jn.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},jn.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},jn.prototype.addEventListener=function(t,e){if(!e)return;let n=this._events[t];n?n.indexOf(e)<0&&n.push(e):this._events[t]=[e]},jn.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(!n)return;let i=n.indexOf(e);i>=0&&n.splice(i,1)},jn.prototype.removeAllEventListeners=function(){this._events={}},jn.prototype.getSubscription=function(t){return this._subMap[t]||null},jn.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},jn.prototype.getAllFields=function(){return this._fields},jn.prototype.hasField=function(t){return this._fields[t]||!1},jn.prototype.filter=function(t,e){return this};let Kn=function(t,e){for(let n in t)e[n]=t[n];return e};jn.prototype._addSymbol=function(t,e,n){if(!t)return null;if(n||0===n)n+="";else do{n="_"+this._runningSubId+++"_"}while(this._subMap[n]);if(this._subMap[n])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let i={};i.ric=t,i.chain=e,i.id=n,i.dataId=n+t,this._subMap[n]=i,this._dataMap.addItem(t,i);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[i]});let s,l=null,a=0;if(e)if(1===r)for(i.children=[],a=jn.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=n,l.dataId=n+l.ric,l.parent=i,i.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(Gn(i,l),l);else{let t=o[0].children;for(a=t.length,i.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=n,l.dataId=n+l.ric,l.parent=i,i.children[s]=l,this._dataMap.addItem(Gn(i,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),n},jn.simpleDigest=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n+=t.charCodeAt(i);return n},jn.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},jn.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let n=(this._percentageDataUpdate-.02)*e;n=n>0?n:1;let i=(this._percentageDataUpdate+.02)*e;i=i<e?i:e;let o=this._dataGen.randInt(n,i),r=this._fields;for(let n=0;n<o;n++){let n,i,o,s=t[this._dataGen.randIndex(e)],l=this._dataMap.getItems(s),a=l[0],u=a.parent,h=this._dataGen.randBoolean();if(Wn(s)&&u&&h){let t=u.children;t=Un(t);let e=t.length,s=t.indexOf(a);for(a.CHILD_ORDER=s,n=this._generateQuoteData(a,r),o=l.length,i=0;i<o;++i){for(let o=0;o<e;o++){let e=t[o];if(l[i]===e)n.CHILD_ORDER=e.CHILD_ORDER,this._dispatchDataChanged(l[i],n);else{let t=e.CHILD_ORDER;this._dispatchDataChanged(e,{X_RIC_NAME:e.ric,CHILD_ORDER:t})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(n=this._generateQuoteData(a,r),o=l.length,i=0;i<o;++i){let t=l[i].CHILD_ORDER;null!=t&&(n.CHILD_ORDER=t),this._dispatchDataChanged(l[i],n)}}this._connect()},jn.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},jn.prototype._generateQuoteData=function(t,e){let n=t.ric,i=t.prevData,o={},r={text:n,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r),n=t+"_FORMATTED";if(i){if(e.changeOnly&&i[t]===e.value)continue;i[t]=e.value,i[n]=e.formattedValue}o[t]=e.value,o[n]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},jn.prototype._getChildSubByRic=function(t,e){let n=t.children;if(n){let t=n.length;for(let i=0;i<t;++i){let t=n[i];if(t.ric===e)return t}}return null},jn.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let n=e.length;if(n<2)return;let i,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(i=1;i<n;++i){let t=e[i];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;if(!this._constituentCache)return;let l=o.ricList;if(!l)return;let a=l.length;for(i=1;i<n;++i){let t=e[i],n=t.ricList;for(let e=n?n.length:0;e<a;++e){let n=l[e],i=this._getChildSubByRic(o,n),r=this._getChildSubByRic(t,n);i&&r&&i.prevData&&this._dispatchDataChanged(r,i.prevData)}}},jn.prototype._dispatchDataChanged=function(t,e){let n=Kn(e,{}),i={};i.ric=t.ric,i.values=n,i.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,i.type="statusUpdated",n.STATUS=1,n.STATUS_FORMATTED=this._statusMap[1],n.SUB_ID=t.id,Kn(n,o);let e=t.parent;if(e){let n=e.ricList;n||(n=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",i)},jn.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},jn.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},jn.prototype._dispatch=function(t,e){let n=this._events[t];if(!n)return;let i=n.length;for(let t=0;t<i;++t)n[t](e)},jn.prototype._subMap=null,jn.prototype._fields=null,jn.prototype._events=null,jn.prototype._working=!1,jn.prototype._timerId=0,jn.prototype._runningSubId=0,jn.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};let Jn=function(){this._data={}};Jn.prototype._data=null,Jn.prototype.clear=function(){this._data={}},Jn.prototype.put=function(t,e){t&&(this._data[t]=e)},Jn.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Jn.prototype.getAllKeys=function(){return Object.keys(this._data)},Jn.prototype.save=function(){},Jn.prototype.filter=function(t){let e=[];if(t)for(let n in this._data){let i=this._data[n];t(i)&&e.push(i)}return e};let Qn={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};let Zn=new Nn,$n={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s,l,a,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(l=t.identifiers,a=t.formula.trim().split(/(?=,TR.)/),u=[],h=Qn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);let e=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(let t=0;t<e;t++){let e,i=u[t],o=/TR.(.*)(?=\()/,r=i.match(o)[0].replace("TR.",""),a=i.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:$.format(new Date,"YYYY-MM-DD"),g=_[1];f>g&&(e=f,f=g,g=e);let y=(+new Date(g)-+new Date(f))/864e5;for(n=0;n<=y;n++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+n)),i={h:!0,v:$.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(i)}let m=l;for(n=0;n<m.length;n++){let t=[m[n],r];for(s=1;s<=y+1;s++){let e=Nn.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=$n.splitFields(t.formula),u=[],h=Qn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],n=0;n<u.length;n++)i=u[n],p[0].push({h:!0,r:i.toUpperCase().trim()});let e={};o=l.length;let s=Zn.generate(u,o);for(n=0;n<o;++n){let t=l[n];r=e[t],r||(r=e[t]=s[n],r.unshift(t)),p.push(r)}if(p.length>0){if(Zn.randInt(1,10)<=3){let t=Zn.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";p.splice(t+1,0,e)}}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];let e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()})),e}},ti=new Nn,ei={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s=t.instruments,l=t.fields,a=Qn;for(l=[],n=0;n<t.fields.length;n++)i=t.fields[n],a[i.name]||l.push(i);let u={};o=s.length;let h=[],p=ti.generate(l,o);for(n=0;n<o;++n){let t=s[n];r=u[t],r||(r=u[t]=p[n],r.unshift(t)),h.push(r)}if(h.length>0){if(ti.randInt(1,10)<=3){let t=ti.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";h.splice(t+1,0,e)}}let d=[{displayName:"Instrument"}];for(n=0;n<l.length;n++)i=l[n],d.push({displayName:i.name,field:i.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},ni=function(t){return"datagrid"===t?Promise.resolve(ei):"adc"===t?Promise.resolve($n):Promise.reject(t+" is not supported.")};ni.setInvalidFields=function(t){if(t&&"string"==typeof t)Qn[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Qn[t[e]]=!0};let ii=function(t){this.Quotes=new On,this.Quotes2=new qn,this.Archive=new Jn,this.ContainerDescription=!0,this.Data=ni,t&&this.Quotes2.config(t)};ii.prototype.init=function(t){return t&&this.Quotes2.config(t),this},ii.prototype.onLoad=function(t){return setTimeout(t,2e3),this},ii.prototype.navigate=function(t){return this},ii.prototype.appHit=function(t,e,n){},ii.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},ii.prototype.contextChange=function(t){};let oi={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},ri={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1};let si={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},li={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},ai={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},ui=function(t,e,n,i){let o={value:e,type:n};return i&&(o.dataType=i),"operator"===n?o.precedence=si[e]:"parenthesis"===n&&(o.precedence=0),t.push(o),t.length-1},hi={_tokens:[],_withString:function(t){return" #"+ui(hi._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+ui(hi._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return hi._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;if(e==e){return" #"+ui(hi._tokens,e,"literal","number")+"#"}return""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:hi._withNegativeNumber(t)},_withOperator:function(t){if(si[t]){return"="!=t&&"==="!=t||(t="=="),"#"+ui(hi._tokens,t,"operator")+"#"}return""},_withParenthesis:function(t){return"#"+ui(hi._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,n=e.length,i=0,o=0;for(let t=0;t<n;++t){let n=e[t];if("literal"!==n.type){let t=ai[n.value];if(!(i>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;i-=t}i++,i>o&&(o=i)}return 1!==i||(t._stackSize=o,!1)},_filter:function(t,e){let n,i=t._rpn,o=new Array(t._stackSize),r=i.length,s=0;for(let t=0;t<r;++t){let r=i[t],l=r.value;"literal"===r.type?n="variable"!==r.dataType?l:e?e[l]:null:1===ai[l]?(n=li[l](o[s-1]),s-=1):(n=li[l](o[s-2],o[s-1]),s-=2),o[s++]=n}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;let e=t.trim();if(!e)return null;hi._tokens.length=0,e=e.replace(/".+?"/g,hi._withString),e=e.replace(/'.+?'/g,hi._withString),e=e.replace(/\[.+?\]/g,hi._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,hi._withNegativeNumber),e=e.replace(/[0-9.#]+/g,hi._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,hi._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,hi._withOperator),e=e.replace(/[()]/g,hi._withParenthesis);let n=hi._tokens,i=n.length;if(!i)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<i;++o){let t=a[o];if(r=n[+t.substring(1,t.length-1)],s=r.type,"literal"===s){let t=l[l.length-1];if(t&&"literal"===t.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;ui(l,"-","operator"),r.value*=-1}}l.push(r)}hi._tokens.length=0,i=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<i;++o)if(r=l[o],s=r.type,"literal"===s)u.push(r);else if("parenthesis"===s)if("("===r.value)h.push(r);else{for(d=!1;h.length;){if(p=h.pop(),"("===p.value&&"parenthesis"===p.type){d=!0;break}u.push(p)}d||console.warn("No left parenthesis paired with the right one")}else{for(;h.length&&!(r.precedence>h[h.length-1].precedence);)u.push(h.pop());h.push(r)}for(d=!1;h.length;)p=h.pop(),"("===p.value&&"parenthesis"===p.type?d=!0:u.push(p);if(d&&console.warn("No right parenthesis paired with the left one"),!u.length)return null;let c={_rpn:u};return hi._tester(c)?null:hi._filter.bind(null,c)}};let pi=function(){this._conditions=[],this._scopes=[],pi._painters.push(this)};pi.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},pi.prototype._coloringType=0,pi.prototype._conditions=null,pi.prototype._effectiveStyles=null,pi.prototype._blinkCondition=null,pi.prototype._scopes,pi.prototype._columnStats=null,pi.prototype._blinkingDuration=250,pi._runningBlinkId=0,pi._painters=[],pi._emptyAry=[],pi._emptyObj={},pi._bgObj={backgroundColor:"",color:""},pi._colorObj={color:""},pi.bgStyles=["backgroundColor","color"],pi.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],pi.supportedStyles=pi.bgStyles.concat(pi.nonBgStyles),pi.themeReady=null,pi._contrastColors={},pi.parse=hi.parse,pi.prototype.dispose=function(){let t=pi._painters.indexOf(this);t>=0&&pi._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},pi.prototype.reset=function(){this._setColoringType(0);let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];pi._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}this._blinkCondition=null},pi.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},pi.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},pi.prototype.clearBlinking=function(){this._blinkCondition=null;let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];pi._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}},pi.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},pi.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},pi.prototype.applyThemeColor=function(){let t=G.getColors();if(this._coloringType===pi.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let n=t.up,i=t.down,o=t.level===t.baseText?"":t.level;pi._setUpDownColors(e,n,i,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&pi._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},pi.prototype.getConditions=function(){return this._conditions},pi.prototype.getColoringType=function(){return this._coloringType},pi.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},pi.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},pi.prototype.getEffectiveStyles=function(){return this._effectiveStyles},pi.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(pi.ColoringTypes.CONDITIONAL);let e=t.length;for(let n=0;n<e;n++)this._addCondition(t[n])},pi.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},pi.prototype.getColumnStats=function(){return this._columnStats},pi.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=hi.parse(e.text||e),this._conditions.push(t))},pi.prototype.addHeatmap=function(t,e,n,i,o,r){this._setColoringType(pi.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=pi._heatMapCondition.bind(s),s.midPoint=e,pi._setUpDownColors(s,n,i),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},pi.prototype.addHeatmapWithTheme=function(t,e,n){let i=G.themeColors,o=this.addHeatmap(t,e,i.up,i.down,i.baseGrid,n);return!0!==n&&"text"!==n||(o.baseColor=i.baseText),o.useThemeColor=!0,o},pi.prototype._addColorText=function(t,e,n,i,o){this._setColoringType(pi.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=n,r.downClass=i,r.levelClass=o,this._addCondition(r),r},pi.prototype.addColorText=function(t,e,n,i){return this._addColorText(ri[t]?pi._tickColorTextCondition:pi._colorTextCondition,t,e,n,i)},pi.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},pi.prototype.addTickColorText=function(t,e,n){return this.addColorText("CF_TICK",t,e,n)},pi.prototype.addTickColorTextWithTheme=function(){let t=G.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},pi.prototype.addTickBlink=function(t,e,n,i){return this.addBlink("CF_TICK",t,e,n,i)},pi.prototype.addTickBlinkWithTheme=function(t){let e=G.themeColors,n=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return n.useThemeColor=!0,n},pi.prototype.addBlink=function(t,e,n,i,o){return this._addBlink(ri[t]?pi._tickBlinkCondition:pi._fieldBlinkCondition,t,e,n,i,o)},pi.prototype.addBlinkWithTheme=function(t,e){let n=G.themeColors,i=this.addBlink(t,n.up,n.down,n.level,e);return i.useThemeColor=!0,i},pi.prototype._addBlink=function(t,e,n,i,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=pi._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),pi._setUpDownColors(s,n,i,o,!0),s},pi.prototype.renderForPrinting=function(t,e,n,i){if(!t)return;let o=this._getStyles(e,n,i),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},pi._colorTextCondition=function(t,e){let n=e[t];if(n||0===n){if(n>0)return 1;if(n<0)return-1}return"u"},pi._tickColorTextCondition=function(t,e){return oi[e[t]]},pi._heatMapCondition=function(t,e,n){let i,o=t[this.field],r=o||0===o?o-this.midPoint:NaN;if(0===r||r!=r)return 0;let s=1;return r>0?(s=n-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=n-this.midPoint)),s<0&&(s=-s),i=r/s,i},pi._tickBlinkCondition=function(t){return oi[t]},pi._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},pi._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},pi._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let n=t.rowData,i=NaN,o=NaN;if(this._coloringType===pi.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(i=t.getMin(),o=t.getMax())}let r=this._getStyles(n,i,o),s=r.cssClass;null!=s?(e._coloringCssClass&&e._coloringCssClass!==s&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},pi.prototype._getStyles=function(t,e,n){if(!t)return pi._emptyObj;let i=this._conditions.length;for(let o=0;o<i;++o){let i,r=this._conditions[o],s=r._fn;try{i=s&&s(t,e,n)}catch(t){}if(i){if(this._coloringType===pi.ColoringTypes.HEATMAP){let t;return t=i>0?D(r.baseColor,r.upColor,i):D(r.baseColor,r.downColor,-i),r.textMode?(pi._colorObj.color=m(t),pi._colorObj):(pi._bgObj.backgroundColor=m(t),pi._bgObj.color=I(t),pi._bgObj)}return this._coloringType===pi.ColoringTypes.TEXT?(r.cssClass=i>0?r.upClass:i<0?r.downClass:r.levelClass,r.cssClass=r.cssClass||"",r):r}}return pi._emptyObj},pi.blendColor=D,pi.blackAndWhite=I,pi.rgb2Hex=y,pi.num2Hex=m,pi.num2Rgb=C,pi.hex2Num=S,pi.hex2Rgb=w,pi.themeChanged=function(){},pi.setThemeColors=function(){},pi._onThemeChanged=function(){let t=pi._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},pi.loadThemeColors=function(){return pi.themeReady||(pi.themeReady=G.getThemeColors(pi._onThemeChanged).then(pi._onThemeChanged).catch(pi._onThemeChanged)),pi.themeReady},pi.reloadThemeColors=function(){return pi.themeReady=G.reloadThemeColors().then(pi._onThemeChanged).catch(pi._onThemeChanged),pi.themeReady},pi.clearCellStyle=function(t,e){let n=t.getElement();if(!n)return;let i=t.blinking;if(i&&(pi._clearBlinkTimer(i),delete t.blinking,i.cell=null),n._coloringCssClass&&n.classList.remove(n._coloringCssClass),e||(e=pi.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)n.style[e[t]]="";else for(let t in e)n.style[t]=""},pi._setUpDownColors=function(t,e,n,i,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=pi.getOppositeColor(e)),t.downColor=n,null!=n&&o&&(t.contrastDownColor=pi.getOppositeColor(n)),t.levelColor=i,null!=i&&o&&(t.contrastLevelColor=pi.getOppositeColor(i))},pi._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},pi.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=pi._contrastColors[t];if(!e){let n=S(t);e=pi._contrastColors[t]=I(n)}return e}}else if(Array.isArray(t))return I(t);return""},pi.prototype.render=function(t,e,n,i,o){null!=n&&n==n?this._paintCell(t,e,n,i):this._conditions.length&&this._coloringType===pi.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},pi.prototype.renderHeatMap=function(t,e,n,i){this._paintCell(t,e,n,i)},pi.prototype.renderColoring=function(t,e){this._paintCell(t,e)},pi.prototype._paintCell=function(t,e,n,i){if(!t)return;let o=t.getElement();if(!o)return;let r,s=this._blinkCondition;if(s&&(r=t.blinking,r&&r.blinkTimer&&!s.border))return;let l=this._getStyles(e,n,i),a=o.style,u=l.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(l.backgroundColor?a.backgroundColor=l.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(a.backgroundColor=""),l.color?a.color=l.color:this._effectiveStyles&&!this._effectiveStyles.color||(a.color=""))},pi.prototype._prepareScope=function(t){let e=t.blinking;e||(e={},e.cell=t,t.blinking=e,this._scopes.push(e));let n=this._blinkCondition;if(e.blinkId!==n.blinkId){e.blinkId=n.blinkId,e.field=n.field;let t=n.border?pi._borderRestorer:pi._cellRestorer;e._restorer=t.bind(this,e)}return e},pi.prototype.blink=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=this._prepareScope(t);return l.rowData=n,e>0?(r=o.upColor,s=o.contrastUpColor):e<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor),this._blink(l,i,r,s)},pi.prototype.flash=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;if(!this._blinkCondition)return!1;let o=this._prepareScope(t);return o.rowData=n,"string"!=typeof e&&(e=G.themeColors.level),this._blink(o,i,e,pi.getOppositeColor(e))},pi.prototype._blink=function(t,e,n,i){let o=!0;return this._blinkCondition.border?(e.style.border="1px solid "+n,o=!1):(e.style.backgroundColor=n,e.style.color=i),pi._clearBlinkTimer(t),t.blinkTimer=setTimeout(t._restorer,this._blinkingDuration),o},pi.prototype.blinkCell=function(t,e,n,i){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,n);return this.blink(t,o,i)},pi.prototype.calcBlinkSignal=function(t,e){return this._blinkCondition?this._blinkCondition._fn(t,e):0},pi.prototype.verifyBlinking=function(t,e){let n=t.blinking;n&&n.blinkTimer&&n.rowData!==e&&(n.rowData=e,pi._clearBlinkTimer(n)&&n._restorer())},pi.prototype.disableLevelColor=function(t){},pi.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var di=window.tr;di||(di=window.tr={});var ci=di.rt;ci||(ci=di.rt={});var _i=di.grid;_i||(_i=di.grid={}),di.MockJET||(di.MockJET=ii),di.closestElement||(di.closestElement=o.closestElement),di.CellPainter||(di.CellPainter=pi),ci.Grid||(ci.Grid=Sn),_i.CellPainter||(_i.CellPainter=pi)}e.default=Sn}]);
1
+ !function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Grid",(function(){return Sn}));let o={create:function(t,e){let n=document.createElement(t);return e&&(n.className=e),n},div:function(t){return o.create("div",t)},text:function(t,e){let n=o.create("span",e);return(t||0===t)&&(n.textContent=t),n},appendChild:function(t,e){if(!t)return null;let n,i;Array.isArray(arguments[1])?(i=arguments[1],n=0):(i=arguments,n=1);let o=i.length;for(;n<o;)t.appendChild(i[n]),++n;return t},buildTree:function(t,e){if(!t)return null;let n=arguments,i=n.length;for(let e=1;e<i;++e){let i=n[e];if(i){let e;Array.isArray(i)?e=o.buildTree.apply(null,i):1===i.nodeType&&(e=i),e&&t.appendChild(e)}}return t},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):o.removeParent(t):null},removeChildren:function(t,e){if(t){let n=t.childNodes.length;for((null==e||e>n)&&(e=n);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){let n=e.nodeType;1===n||3===n?e!==t.lastChild&&(o.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(o.removeChildren(t),o.appendChild(t,e)):t.textContent=e}else o.removeChildren(t)},toggleAttribute:function(t,e,n){n?t.setAttribute(e,"string"==typeof n?n:""):null==n?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,n){n?t.classList.add(e):null==n?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.add(i)}}},removeClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.remove(i)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let n=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},getRelativePosition:function(t,e,n){n=o.getClientPosition(t,n);let i=o.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},closestElement:function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},closestTagName:function(t,e){let n=t;for(;n;){if(n.tagName&&n.tagName==e)return n;n=n.parentNode||n.host}return null}};let r=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};r.prototype._data,r.prototype._func=null,r.prototype._delay=0,r.prototype._timerId=0,r.prototype._conflated=!1,r.prototype._disabled=!1,r.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},r.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},r.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},r.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},r.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},r.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},r.prototype.getData=function(){return this._data},r.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},r.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},r.prototype.getConflatingTime=function(){return this._delay},r.prototype.disable=function(t){this._disabled=!1!==t},r.prototype.isEnabled=function(){return!this._disabled},r.prototype.enable=function(t){this._disabled=!1===t};let s={inherits:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(t,n,i){n||(n="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[n].apply(t,r)}}};var l=s;let a=function(){};a.prototype._events=null,a.prototype._listenerCount=0,a.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let n=this._events[t];n?n.indexOf(e)<0&&(n.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},a.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(n){let t=n.indexOf(e);t>=0&&(n.splice(t,1),--this._listenerCount)}},a.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},a.prototype.hasListener=function(t){if(this._listenerCount){if(t){let e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},a.prototype.getListener=function(t,e){if(t){let n=this._events?this._events[t]:null;if(n)return e||(e=0),n[e]||null}return null},a.prototype.addListener=function(t,e){let n=t?t[e]:null;"function"==typeof n&&this.addEventListener(e,n)},a.prototype._prepareEventArguments=function(t,e){return e},a.prototype._dispatch=function(t,e){let n=this._events?this._events[t]:null;if(n){e=this._prepareEventArguments(t,e);let i=n.length;for(let t=0;t<i;++t)n[t](e)}};a.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var u=a;let h=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);let n=t.charAt(0),i=t.length>1?t.charAt(t.length-1):"";if('"'===n&&'"'===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===n&&"'"===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===n&&")"===i)return void this._resolveVariableGroup(t);if("["===n&&"]"===i)return void this._resolveArray(t);if(t.match(/TR\.\w+\(/))return void(this._type="dynamic");let o=t.match(/[\w._]+\(/g);if(o&&1===o.length)return void this._resolveFunction(t,o[0]);let r=t.match(/[\w._♦]+/g);if(r&&r.length>1)return void this._resolveVariableGroup(t);if("♦"===n)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};h.prototype._input="",h.prototype._index=-1,h.prototype._type="",h.prototype._subVars=null,h.prototype._funcName="",h.prototype._value,h.prototype._valueWithTokenField="",h.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},h.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},h.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},h.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},h.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let n=0;n<t;++n)e[n]=this._subVars[n].getInputWithTokenField();return e.join(", ")},h.prototype.toString=h.prototype.getExpression,h.prototype.getValue=function(){return this._value},h.prototype.getInput=function(){return this._input},h.prototype.getIndex=function(){return this._index},h.prototype.setIndex=function(t){this._index=t},h.prototype.getFunctionName=function(){return this._funcName},h.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let n=0;n<e;++n)this._subVars[n].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},h.prototype._resolveVariableGroup=function(t){let e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);let e=new h(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},h.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new h(e[t],t)}},h.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new h(e[t],t)}};var p=h;let d=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};l.inherits(d,u),d._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},d.prototype._input="",d.prototype._expression="",d.prototype._alias="",d.prototype._main=null,d.prototype.__F=null,d.prototype._fnTokens=null,d.prototype._fields=null,d.prototype._fieldMap=null,d.prototype._reference="",d.prototype._context=null,d.prototype._rtService=null,d.prototype._intervalServices=null,d.prototype._dataCache=null,d.prototype._dataLastError="",d.prototype._inputWithTokenField="",d.prototype._formulaCount=0,d._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},d.prototype.dispose=function(){this._rtService&&(this._rtService.dispose(),this._rtService=null);for(let t in this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},d.prototype.calculate=function(t){if(this._main){this._dataLastError="";let e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},d.prototype.getFunction=function(){return this._main},d.prototype.getFieldNames=function(){return this._fields},d.prototype._setReference=function(t){this._reference=t},d.prototype.getReference=function(){return this._reference},d.prototype.getExpression=function(){return this._expression},d.prototype.toString=d.prototype.getReference,d.prototype.getInput=function(){return this._input},d.prototype.getAlias=function(){return this._alias||this._input},d.prototype.setAlias=function(t){this._alias=t},d.prototype.addFormulaCount=function(){this._formulaCount++},d.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},d.prototype.updateContext=function(){if(!this._context)return;let t=this._fnTokens.length;for(let e=0;e<t;++e){let t=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[t]||d._emptyFunction,d._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},d.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},d._emptyFunction=function(){},d.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let n=t.match(/([^=]=+)/g)||[];for(let t=n.length;--t>=0;){let i=n[t],o=i.substring(i.length-2);if(d._invalidOps[o]){e=!0;break}}}return e},d.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],n=[];return t=(t=(t=d.tokenizeQuotes(t,e,n)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,d._encloseWithTR),t=d.resolveTokens(t,e,n)},d._encloseWithTR=function(t){return'TR("'+t+'")'},d.tokenizeQuotes=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,i=e.length,e.push(new p(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},d.tokenizeAdcWithParams=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,i=e.length,e.push(new p(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},d.replaceUnwantedCharacters=function(t,e,n){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},d.prototype._tokenizeParentheses=function(t,e,n){e||(e=[]),n||(n=[]);let i={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,n){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=i[t];return null==r&&(r=e.length,e.push(new p(t,r)),i[t]=r),o.push(r),"♦"+r+"♦"})),n.push(o)}return t},d.prototype._tokenizeConstants=function(t,e,n){e||(e=[]),n||(n=[]);let i=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let n=e.length;return e.push(new p(t,n)),i.push(n),"♦"+n+"♦"})),n.push(i),t},d.resolveTokens=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getExpression()}))}}return t},d._getInputWithTokenField=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},d.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;let e=[],n=[];t=d.tokenizeQuotes(t,e,n),t=d.tokenizeAdcWithParams(t,e,n),t=d.replaceUnwantedCharacters(t,e,n),t=this._tokenizeParentheses(t,e,n),t=this._tokenizeConstants(t,e,n),this._inputWithTokenField=d._getInputWithTokenField(t,e,n),t=d.resolveTokens(t,e,n);let i={},o=e.length;for(let n=0;n<o;++n){let o=e[n];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+n+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(i)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=i,this._fields=Object.keys(i),this._main):null},d.prototype._createFunction=function(t){let e=null;try{e=new Function("__R","return "+t+";"),e=e.bind(this),e({})}catch(t){e=null}return e},d.prototype.__D=function(t,e){return e[t]},d.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},d.prototype.changeField=function(t,e){let n=this._fields.indexOf(t);if(n<0)return!1;this._fields.splice(n,1),this._fields.indexOf(e)<0&&this._fields.push(e);let i=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},d.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let n=this._input;for(let n=t.length;--n>=0;){let i=t[n],o=e[n],r=this._fields.indexOf(i);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+i+"♥",l="♠"+o+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===s?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+i+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},d.prototype.getRealtimeService=function(){return this._rtService},d.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},d.prototype.getIntervalService=function(t){return this._intervalServices[t]},d.prototype.setIntervalService=function(t,e){if(!e)return;let n=this._intervalServices[t];n&&n.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},d.prototype.getCachedData=function(t){return this._dataCache[t]},d.prototype.setCachedData=function(t,e){this._dataCache[t]=e},d.prototype.setDataError=function(t){this._dataLastError=t},d.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},d.prototype._onDataCacheChanged=function(t){let e=t.ric,n=t.values,i=this._dataCache[e];if(i)for(let t in n)i[t]=n[t];else this._dataCache[e]=n;this._dispatch("dataCacheChanged",{})},d._proto=d.prototype;var c=d;var _={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}};let f={};const g=/\d+/g;let y=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(g);if(!e||e.length<3)return t;let n="#";for(let t=0;t<3;t++){let i=+e[t];i>=16||(n+="0"),n+=i?i.toString(16).toUpperCase():"0"}return n},m=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},C=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},S=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},w=function(t){if(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},b=function(t){if(!t||t<0)return 0;if(t>=255)return 1;let e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},R=function(t){return.2126*b(t[0])+.7152*b(t[1])+.0722*b(t[2])},v=function(t,e){if(t===e)return 1;let n=t,i=e;return t>e&&(i=t,n=e),(i+.05)/(n+.05)},I=function(t){let e=R(t),n=v(1,e);return v(0,e)>=n?"#000000":"#ffffff"},D=function(t,e,n){n>1?n=1:n<0&&(n=0);let i=S(t),o=S(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-i[t])*n;r.push(i[t]+e)}return r};f.rgb2Hex=y,f.num2Hex=m,f.num2Rgb=C,f.hex2Num=S,f.hex2Rgb=w,f.getColorLuminance=b,f.getRelativeLuminance=R,f.getContrastRatio=v,f.getContrastColor=I,f.blendColor=D;let x=function(t,e,n){if(!t)return null;if(!e||t===e)return t;let i;if(n){let o=n.length;for(let r=0;r<o;++r)i=n[r],i&&E(t,e,i)}else for(i in e)E(t,e,i);return t},A=function(t,e){return x({},t,e)},L=function(t){for(let e in t)return!1;return!0},T=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let n=t;t={};let i=n.length;for(let o=0;o<i;++o){let i=e[o];i&&void 0!==n[o]&&(t[i]=n[o])}return t},E=function(t,e,n){let i=e[n];if(null!=i){let e=t[n];Array.isArray(e)?t[n]=e.concat(i):Array.isArray(i)&&e?t[n]=i.concat(e):t[n]=i}},M=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!M(t[n],e[n]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let n in t)if(!M(t[n],e[n]))return!1}return!0}return!1},F=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},P=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},z=function(t,e){if(!t)return null;let n=document.createElement("style");n.textContent="\n"+t+"\n";let i,o=function(t){if(t){let e;if(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t)return e}return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(i=o.children[0]),i?o.insertBefore(n,i):o.appendChild(n),n},V=function(t,e){e||(e=[]);for(let n in t){let i=t[n];"object"==typeof i?V(i,e):e.push(i)}return e};let k=function(t,e,n){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=n&&(this._ctx=n),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};k.prototype.promise=null,k.prototype._resolve=null,k.prototype._reject=null,k.prototype._resolveHandler=null,k.prototype._rejectHandler=null,k.prototype._ctx=null,k.prototype._fulfilled=!1,k.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){let e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},k.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){let e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},k.prototype.isFulfilled=function(){return this._fulfilled},k.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let N={},O=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},H=function(t,e,n){"attributes"===n.type&&(null!=e?n.attributeName===e&&t(n.target.getAttribute(e)):t(n.target))};N._getNewId=function(){return"observer_"+ ++N._id},N._addObserver=function(t,e,n){let i=n;i||(i={}),i.attributes=!0,N._observer.observe(t,i),N._addListener(t,e)},N._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let n=t[e],i=N._listeners[n.target._observeId];for(let t=0;t<i.length;t++)i[t](n)}},N._addListener=function(t,e){let n=N._listeners;if(n||(n=N._listeners={}),!t._observeId){let e=N._getNewId();t._observeId=e}n[t._observeId]||(n[t._observeId]=[]);let i=n[t._observeId];i.indexOf(e)<0&&i.push(e)},N.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",N._addObserver(document.documentElement,O.bind(null,t)))},N.addAttributeListener=function(t,e,n){t&&e&&N._addObserver(t,H.bind(null,e,n))},N._observer=new MutationObserver(N._onMutationCallback),N._listeners={},N._id=0;let B={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},G={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};G.themeColors=G._defaultColors,G._components={},G._themeName="",G._elfVersion=0,G._dummyIcon=null,G._iconLoaded=!1,G._profileName=null,G._callbacks=[],G._observed=!1,G._pendingResolve=!1,G._themeLoaded=!1,G._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},G._icons["halo-theme"]=G._icons["elf-theme-halo"],G._icons["solar-theme"]=G._icons["elf-theme-solar"],G.getElfVersion=function(){if(!G._elfVersion){let t=0;if(window.EFX_GRID){let e=window.EFX_GRID.version;e=e.split("."),t=+e[0]}else if(window.elf)if(window.elf.version){let e=window.elf.version.match(/\d/);e&&e[0]&&(t=parseInt(e[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);G._elfVersion=t}return G._elfVersion},G.hasComponent=function(t){let e=G._components[t];if(null==e){e=0;let n=G.getElfVersion();if(t){let i;1===n?(i=document.createElement(t),i.is===t&&(e=n)):n>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=n),G._components[t]=e}}return e},G.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return B[e]?e:""},G.hasTheme=function(t){return t===G.getThemeName()},G.getThemeName=function(t){return G._themeName||(G._themeName=G.getCssVariable("--theme-name",document.documentElement)),G._themeName},G.setThemeName=function(t){G._themeName=t},G.isThemeLoaded=function(){return G._themeLoaded},G.getColors=function(){return G.themeColors},G.isHaloTheme=function(t){return null==t&&(t=G.getThemeName()),!!t&&t.indexOf("halo")>=0},G.injectIcons=function(t,e){if("object"!=typeof t)return;let n=G.getThemeName();t.themeName=n;let i=G.getElfVersion();t.elfVersion=i;let o=G._icons[n];o&&(t.icons=o)},G.getIconList=function(){let t=G._icons[G.getThemeName()];return t?V(t):[]},G._onIconPreloaded=function(){if(G._dummyIcon){let t=G._dummyIcon.parentNode;t&&t.removeChild(G._dummyIcon),G._dummyIcon=null}},G.prepareIconPreloading=function(){if(!G._iconLoaded){G._iconLoaded=!0;let t=G.getIconList();if(t.length){setTimeout(G._onIconPreloaded,10);let e=G._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},G.getCssVariable=function(t,e){let n="",i=e||document.body;return window&&"string"==typeof t&&1===i.nodeType&&t.match(/^--/)&&(n=window.getComputedStyle(i).getPropertyValue(t),n=n.replace(/[\"\']/g,"")),n},G.getCssVariables=function(t,e){let n=e||document.body;if(window&&1===n.nodeType){let e=window.getComputedStyle(n);for(let n in t){let i=t[n];i&&i.match(/^--/)&&(t[n]=e.getPropertyValue(i).replace(/\"/g,""))}}return t||null},G.setRTK=function(t){null!=t&&(G._rtk=t)},G.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},G._addThemeChangedCallback=function(t){let e=G._callbacks;e.indexOf(t)<0&&e.push(t)},G.reloadThemeColors=function(){return G._deferred&&G._deferred.isFulfilled()?(G._profileName="",G._themeLoaded=!1,G.themeReady=null,G.getThemeColors()):G.themeReady},G.getThemeColors=function(t){if("function"==typeof t&&G._addThemeChangedCallback(t),G.themeReady)return G.themeReady;let e=G._deferred=new k;G.themeReady=e.promise;let n=G.getMovementColorProfile();if(n)n!==G._profileName?setTimeout(G._profileNameRetrieved,100):G._deferred.resolve(G.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(G._themeLoaded=!1,G._rtk&&G._rtk.Settings)G._rtk.Settings.getAsync(t).then(G._loadingProfileSuccess).catch(G._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(G._loadingProfileSuccess,t)}catch(t){G._loadingProfileFailure()}else setTimeout(G._profileNameRetrieved,100)}return e.promise};let W=function(t){if(t!==G._profileName){G._retrieveThemeColors(t),G._pendingResolve&&(G._pendingResolve=!1,G._deferred.resolve(G.themeColors));let e=G._callbacks;for(let t=0;t<e.length;t++)e[t]()}};G._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),G._observed?G._pendingResolve=!0:G._profileNameRetrieved(t)},G._loadingProfileFailure=function(){G._retrieveThemeColors(),G._observed||(G._observed=!0,N.addAttributeListener(document.documentElement,W,"movement-color-profile")),G._deferred.reject("Failed to get movement color profile from settings.")},G._profileNameRetrieved=function(){let t=G.getMovementColorProfile();G._retrieveThemeColors(t),G._observed||(G._observed=!0,N.addAttributeListener(document.documentElement,W,"movement-color-profile")),G._deferred.resolve(G.themeColors)},G._retrieveThemeColors=function(t){G._themeLoaded=!0,G._profileName=t;let e=G.themeColors=G.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=G._defaultColors.up,e.down=G._defaultColors.down,e.level=G._defaultColors.level,e.tickUp=G._defaultColors.tickUp,e.tickDown=G._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let n=document.createElement("table");n.style.visibility="hidden",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.width="0";let i=n.insertRow(-1),o=i.insertCell(-1);document.body.appendChild(n);let r=window.getComputedStyle(i);e.tableBg=r.backgroundColor;let s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=G._defaultColors.baseGrid,e.tableText=G._defaultColors.baseText,e.tableBorder="")),e.tableBg=y(e.tableBg),e.tableText=y(e.tableText),e.tableBorder=y(e.tableBorder),document.body.removeChild(n),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||G._defaultColors.trackColor};var U=G;new Date(NaN);const Y=Date.UTC(1900,0,1),X=Date.UTC(1900,2,1),q=["sun","mon","tue","wed","thu","fri","sat"],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],K=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],J=["January","February","March","April","May","June","July","August","September","October","November","December"];let Q=function(t){return t>9?""+t:"0"+t},Z={D:function(t,e){return""+t.getDate()},DD:function(t,e){return Q(t.getDate())},DDD:function(t,e){return e[q[t.getDay()]]},D_:function(t,e){return e[j[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return Q(t.getMonth()+1)},MMM:function(t,e){return e[K[t.getMonth()]]},M_:function(t,e){return e[J[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).slice(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return Q(t.getHours())},h:function(t,e){let n=t.getHours()%12;return 0===n?"12":""+n},h_:function(t,e){let n=t.getHours()%12;return n=0===n?12:n,Q(n)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return Q(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return Q(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return Q(~~(t.getMilliseconds()/10))},S_:function(t,e){return(n=t.getMilliseconds())>99?""+n:n>9?"0"+n:"00"+n;var n},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},$={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){$._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=U.toLangString(t);$._localeSetting=_[e]?e:"en"},format:function(t,e,n){let i=null,o="",r=!(!n||"LOCAL"!==n.toUpperCase());if("number"==typeof t)t>1e8?i=new Date(t):(i=$.fromDateNumber(t),r=!0);else if(t instanceof Date)i=new Date(t);else{o=t+"";let e=o.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),e&&(o=o.replace(/T/g," ")),i=new Date(o)}return $.isInvalidDate(i)?t||"":(r||i.setTime(i.getTime()+6e4*i.getTimezoneOffset()),$.formatDateObject(i,e))},formatDateObject:function(t,e){if($.isInvalidDate(t))return"";e||(e=$._dateTimePattern),$._activeInput=t,$._activeLocaleMap=_[$._localeSetting]||DateTimeLocale.en;let n=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,$._parseDatePattern);return $._activeInput=null,n},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let n=Z[t];if(!n){let i=t;$._lowerCaseDatePatterns[e]&&(i=t.toUpperCase(),e=e.toUpperCase(),n=Z[i]),n||(i=e+"_",n=Z[i])}return n?n($._activeInput,$._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){let e=$.dateNumberToMs(t);if(e==e){let n=$.timeNumberToMs(t);return new Date(e+n)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;let e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);let e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){let e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):$.fromDateNumber(t);else if(t){let n=t+"",i=n.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);n=n.replace(/\-/g,"/"),i&&(n=n.replace(/T/g," ")),e=new Date(n)}else e=new Date(NaN);return e},toDateNumber:function(t){return $._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<Y)return NaN;{let e=t/864e5+25569;return t<X&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};var tt=$;let et={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(let e in t)return 0;return 1}}else if(""===t)return 1;return 0}};var nt=et;let it={AND:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,n){return t?e:n},NOT:function(t){return t?0:1},OR:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}};var ot=it;let rt={};rt.ABS=Math.abs,rt.ACOS=Math.acos,rt.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},rt.ASIN=Math.asin,rt.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},rt.ATAN=Math.atan,rt.ATAN2=function(t,e){return Math.atan2(e,t)},rt.ATANH=function(t){return Math.log((1+t)/(1-t))/2},rt.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},rt.CEIL=rt.CEILING,rt.COMBIN=function(t,e){let n=rt.FACT;return n(t)/(n(e)*n(t-e))},rt.COS=Math.cos,rt.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},rt.DEGREES=function(t){return t/(Math.PI/180)},rt.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},rt.EXP=Math.exp,rt.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},rt.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},rt.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},rt.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let n=t;t=e,e=n}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},rt.INT=Math.floor,rt.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,n=Math.abs(t[0]);for(let i=1;i<e;i++){let e=Math.abs(t[i]),o=n;for(;n&&e;)n>e?n%=e:e%=n;n=Math.abs(o*t[i])/(n+e)}return n},rt.LN=Math.log,rt.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},rt.LOG10=function(t){return Math.log(t)/Math.LN10},rt.MOD=function(t,e){return t%e},rt.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},rt.POWER=Math.pow,rt.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let n=t.length;--n>=1;)e*=t[n];return e},rt.PROD=rt.PRODUCT,rt.QUOTIENT=function(t,e){return Math.floor(t/e)},rt.RADIANS=function(t){return t*(Math.PI/180)},rt.RAND=Math.random,rt.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},rt.ROUND=function(t,e){if(!e)return Math.round(t);let n=Math.pow(10,e);return Math.round(t*n)/n},rt.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n},rt.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let n=Math.pow(10,e);return Math.ceil(t*n)/n},rt.SERIESSUM=function(t,e,n,i){let o=0;for(let r=i.length;--r>=0;)o+=i[r]*Math.pow(t,e+r*n);return o},rt.SIGN=function(t){return t>0?1:t<0?-1:0},rt.SIN=Math.sin,rt.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},rt.SQRT=Math.sqrt,rt.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},rt.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;)e+=t[n];return e},rt.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,n=e.length;if(0===n)return 0;let i=[];for(t=0;t<n;++t)i[t]=1;for(t=0;t<n;++t)i[t]*=e[t];let o=0;for(t=0;t<n;++t)o+=i[t];return o},rt.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];e+=i*i}return e},rt.TAN=Math.tan,rt.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;let e=Math.exp(2*t);return(e-1)/(e+1)},rt.TRUNC=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n};var st=rt;let lt={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let n=0;for(let i=e;--i>=0;)n+=t[i];return n/e}};lt.AVG=lt.AVERAGE,lt.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];null!=i&&i==i&&++e}return e},lt.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]>e&&(e=t[n]);return e},lt.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]<e&&(e=t[n]);return e},lt.STDEV=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let n=lt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/(e-1))},lt.STDEVP=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let n=lt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/e)};var at=lt;let ut={},ht=function(t){return t||0===t?t+"":""};ut.EXACT=function(t,e){return(t+="")===(e+="")?1:0},ut.FIND=function(t,e,n){if(!(t=ht(t)))return 0;if(!(e=ht(e)))return 0;return(!(n=+n)||n<0)&&(n=0),e.indexOf(t,n)},ut.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),ht(t).substr(0,e)},ut.LENGTH=function(t){return ht(t).length},ut.LEN=ut.LENGTH,ut.LOWER=function(t){return ht(t).toLowerCase()},ut.MID=function(t,e,n){return ht(t).substr(e,n)},ut.REPLACE=function(t,e,n,i){i+="";let o=(t=ht(t)).split("");return o.splice(n,e,i),o.join("")},ut.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let n=(t=ht(t)).length-e;return t.substr(n,e)},ut.TRIM=function(t){return ht(t).trim()},ut.UPPER=function(t){return ht(t).toUpperCase()},ut.VALUE=function(t){return+t},ut.CHAR=function(t){let e=+t;return String.fromCharCode(e)},ut.CLEAN=function(t){let e=ht(t).split("");for(let t=e.length;--t>=0;){let n=e[t].charCodeAt(0);(n<32||n>127)&&(e[t]="")}return e.join("")},ut.CODE=function(t){return ht(t).charCodeAt(0)},ut.PROPER=function(t){let e=(t=ht(t)).split(/[\W_]/g),n=t.match(/[\W_]/g),i=e.length,o="";for(let t=0;t<i;t++){let i=e[t],r=i.length;1===r?o+=i.toUpperCase():0!==r&&(o+=i.charAt(0).toUpperCase()+i.substr(1).toLowerCase());let s=n[t];s&&(o+=s)}return o},ut.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=ht(t)))return"";let n=t;for(let i=1;i<e;i++)n+=t;return n},ut.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var pt=ut;let dt=function(){this._context={},dt._addContext(this._context,dt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};l.inherits(dt,u),dt.prototype._context=null,dt.prototype._rowData=null,dt.prototype._setData=null,dt.prototype._formulas=null,dt.prototype._formulaMap=null,dt.prototype._referenceMap=null,dt._context=null,dt.getContext=function(){let t=dt._context;return t||(t={},dt._context=t,dt._addContext(t,tt),dt._addContext(t,nt),dt._addContext(t,ot),dt._addContext(t,st),dt._addContext(t,at),dt._addContext(t,pt)),t},dt.addContext=function(t){let e=dt.getContext();dt._addContext(e,t)},dt._addContext=function(t,e){for(let n in e)t[n]=e[n]},dt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},dt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},dt.prototype._defaultFormulaDataSetter=function(t,e,n,i){if("..."!==e){let o=t.getAlias();n[o]=e,i&&(i[o]=e)}},dt.prototype.addFormula=function(t){let e;return t instanceof c?e=t:(this._rowData={},e=new c(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},dt.prototype.mockFormula=function(t){let e;return e=new c(t instanceof c?t.getInput():t,this._context),e},dt.prototype.removeFormula=function(t){let e;if(t instanceof c&&(t=this._formulas.indexOf(t)),"number"==typeof t)e=this._formulas[t],e&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t],e)){let n=this._formulas.indexOf(e);n>=0&&(this._formulas.splice(n,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},dt.prototype.removeAllFormulas=function(){let t=this._formulas;for(let e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},dt.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},dt.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let n=0;n<e;++n){let e=this._formulas[n];if(e.getInput()===t)return e}return null},dt.prototype.getAllFormulas=function(){return this._formulas},dt.prototype.getAllFormulaReferences=function(){return this._referenceMap},dt.prototype.getFormulaCount=function(){return this._formulas.length},dt.prototype._generateUniqueReference=function(t){let e=t,n=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++n;return e},dt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let n="";if(t instanceof c){if(!this._setFormulaReference(t,e))return"";n=t.getAlias()}else n=t;return this._referenceMap[e]=n,e},dt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let n=this._formulaMap[t];if(n&&!this.isValidReference(n,e))return!1;for(let n=this._formulas.length;--n>=0;){let i=this._formulas[n];if(i.changeField(t,e)){let t=i.getReference();t&&(this._referenceMap[t]=i.getAlias())}}return n&&this._setFormulaReference(n,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},dt.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;let e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},dt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},dt.prototype._getData=function(t,e){if(!this._rowData)return null;let n=this._rowData[this.resolveReference(t)];if(n){let t=Number(n);t==t&&(n=t)}return n},dt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let n=t.getReference();if(n===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let i=this._sortDependencies(this._formulas,this._formulaMap);return i?(this._formulas=i,delete this._formulaMap[n],!0):(t._setReference(n),delete this._formulaMap[e],!1)},dt.prototype.calculate=function(t,e){this._rowData=t;let n=this._formulas.length;for(let i=0;i<n;++i){let n=this._formulas[i];if(e){let t=null!=e[n.getAlias()];if(!t){let i=n.getFieldNames();for(let n=i.length;--n>=0;)if(null!=e[this.resolveReference(i[n])]){t=!0;break}if(!t)continue}}let o=n.calculate(t);this._setData(n,o,t,e)}this._rowData=null},dt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let n=t.getReference(),i=this._createParentChildrenMap(this._formulas);if(n){delete i[n];for(let t in i){let o=i[t],r=o.indexOf(n);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),i[t]=o)}}return i[e]=t.getFieldNames(),!!this._sortParentChildrenMap(i)},dt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let n=this._createParentChildrenMap(t),i=this._sortParentChildrenMap(n);if(!i)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=i.length;--t>=0;){let n=e[i[t]];n&&r.push(n)}o.length>0&&(r=r.concat(o))}return r},dt.prototype._createParentChildrenMap=function(t){let e,n={};for(e=t.length;--e>=0;){let i=t[e],o=i.getReference();o&&(n[o]=i.getFieldNames())}return n},dt.prototype._sortParentChildrenMap=function(t){let e,n,i,o,r,s={};for(r in t){i=t[r],o=i.length;for(let t=0;t<o;++t)n=i[t],s[n]=s[n]+1||1}let l=[];for(r in t)s[r]||l.push(r);let a=[];for(;l.length>0;)for(r=l.shift(),a.push(r),i=t[r],o=i?i.length:0,e=0;e<o;++e)n=i[e],--s[n]>0||l.push(n);for(n in s)if(s[n])return null;return a},dt._proto=dt.prototype;let ct={};ct.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),ct.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),ct.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),ct.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ct.getElement=function(t){return ct.isElement(t)?t:t&&ct.isFunction(t.getElement)?t.getElement():null},ct.isElement=function(t){return!!t&&1===t.nodeType},ct.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||ct.isArray(t)&&0===t.length},ct.isNumber=function(t){return"number"==typeof t&&isFinite(t)},ct.isString=function(t){return"string"==typeof t},ct.isArray=Array.isArray,ct.isFunction=function(t){return"function"==typeof t},ct.getClientPosition=function(t,e){let n=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},ct.getRelativePosition=function(t,e,n){n=ct.getClientPosition(t,n);let i=ct.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},ct.moveArrayItem=function(t,e,n){if(!t)return null;let i=t.length;if(e>=i&&n>=i)return t;let o=t.splice(e,1)[0];return n<i?t.splice(n,0,o):t[n]=o,t},ct.pushArrayItems=function(t,e){let n=e?e.length:0;if(n>0)if(n<1e5)n>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let i=0,o=0;for(;i<n;)o+=1e5,Array.prototype.push.apply(t,e.slice(i,o)),i=o}return t},ct.insertEmptyItems=function(t,e,n){if(n>0)if(n>1){let i=t.slice(e);t.length=e,t.length+=n,ct.pushArrayItems(t,i)}else t.splice(e,0,null)},ct.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let n=t.splice(0,e);return t.concat(n)}return t||null},ct.lowerBound=function(t,e,n,i,o){(null==n||n<0)&&(n=0),(null==i||i<0||i>t.length)&&(i=t.length),n>i&&(n=i),null==o&&(o=ct._defaultLessComparator);let r=0;for(;i>n;)r=n+i>>1,o(t[r],e)?n=r+1:i=r;return n},ct.upperBound=function(t,e,n,i,o){let r=ct.lowerBound(t,e,n,i,o);for(;t[r]===e;)++r;return r},ct.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,n){return null!=e[n]?e[n]:t}))},ct._defaultLessComparator=function(t,e){return t<e},ct._deprecatedFunction=function(){console.warn("Calling deprecated method")},ct.calculatePercent=function(t,e,n){if(!t&&0!==t||!e&&0!==e||!n&&0!==n)return NaN;if(n===t)return 50;let i=(e-t)/(n-t);return i<0?0:i>1?100:100*i},ct.closestElement=function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},ct._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var _t=ct;let ft=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ft.prototype.listen=function(t,e){if(t&&_t.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let n=_t.lowerBound(this._listeners,t,0,this._listeners.length,ft.listenerComparer);this._listeners.splice(n,0,t)}},ft.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ft.prototype.unlistenAll=function(){this._listeners.length=0},ft.prototype.getListenerCount=function(){return this._listeners.length},ft.prototype.hasListener=function(){return this._listeners.length>0},ft.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ft.prototype.isDispatching=function(){return this._dispatching},ft.prototype.isEnabled=function(){return this._enabled},ft.prototype.enable=function(t){this._enabled=!1!==t},ft.prototype.disable=function(t){this._enabled=!1===t},ft.prototype.setSender=function(t){this._sender=t||null},ft.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ft.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ft.prototype._listeners=null,ft.prototype._sender=null,ft.prototype._extender=null,ft.prototype._enabled=!0,ft.prototype._dispatching=!1,ft._proto=ft.prototype;var gt=ft;let yt=function(){};yt.prototype._customEvents=null,yt.prototype.listen=function(t,e,n){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,n)},yt.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},yt.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},yt.prototype._addEvent=function(t){if(!t)return;this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new gt(this))},yt.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,n=e.length;for(let t=0;t<n;++t)this._addEvent(e[t])},yt.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},yt.prototype._disableEvent=function(t,e){let n=this._customEvents[t];n&&n.disable(e)},yt.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},yt.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},yt._proto=yt.prototype;var mt=yt;let Ct=function(){this._rows={},this._addEvent("dataComposed"),this._addEvent("dataChanged")};l.inherits(Ct,mt),Ct.prototype._rows,Ct.prototype._composing=!1,Ct.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0)},Ct.prototype.setSubscriptions=function(){},Ct.prototype.getSubscriptions=function(){return null},Ct.prototype.addSubscription=function(){},Ct.prototype.removeSubscription=function(){},Ct.prototype.startAllSubscriptions=function(){},Ct.prototype.stopAllSubscriptions=function(){},Ct.prototype.getSubscription=function(){return null},Ct.prototype.getPrimaryRic=function(){return""},Ct.prototype.clearAllData=function(t){this._rows={},t||this._dispatchDataChange({globalChange:!0})},Ct.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},Ct.prototype.getData=function(t,e){let n=this.getRowData(t);return n?n[e]:null},Ct.prototype.getAllRics=function(){return null},Ct.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},Ct.prototype.hasRowId=function(t){return!!this._rows[t]},Ct.prototype.getColumnData=function(t){let e=[];for(let n in this._rows)e.push(this._rows[n][t]);return e},Ct.prototype.getRowData=function(t){return this._rows[t]||null},Ct.prototype.getMultipleRowData=function(t,e,n){let i=t.length;null==n&&(n=i),n>i&&(n=i),e>0||(e=0);let o=new Array(i),r=this._rows;for(let i=e;i<n;++i)o[i]=r[t[i]]||null;return o},Ct.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let n in e)t.push(e[n]);return t},Ct.prototype.setData=function(t,e,n){let i={};return i[e]=n,this.setRowData(t,i)},Ct.prototype.hasDataCloudData=function(t){},Ct.prototype.setRowData=function(t,e,n){let i=this.getRowData(t),o=!1,r=null;if(e)if(i){for(let t in e)i[t]=e[t],o=!0;r=e}else i=e,this._rows[t]=i,o=!0;else i&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=n||{};e.rid=t,r&&(e.changes=r),e.rowData=i,this._dispatchDataChange(e)}return o},Ct.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let n={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(n[t]=e[t]);return n},Ct.prototype._replaceRowId=function(t,e){let n=this._rows;return!!n[t]&&(n[e]=n[t],delete n[t],!0)},Ct.prototype.replaceRowIds=function(t){if("object"==typeof t)for(let e in t)this._replaceRowId(e,t[e])},Ct.prototype.addStaticFields=function(){},Ct.prototype.removeStaticFields=function(){},Ct.prototype.resetStaticFields=function(){},Ct.prototype.getStaticFields=function(){},Ct.prototype.dump=function(t){return Ct.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},Ct.prototype.log=function(t){console.table(this.dump(t))},Ct.prototype.setDataCloudSettings=function(){},Ct.prototype.getDataCloudFields=function(){},Ct.prototype.addDataCloudFields=function(){},Ct.prototype.removeDataCloudField=function(){},Ct.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},Ct._defaultPropertyGetter=function(t,e,n){let i=e[n];return i?i[t]:null},Ct._defaultGetter=function(t,e){return t[e]},Ct.constructTable=function(t,e,n){let i=0,o=t.length,r=o,s=null,l=n||null,a=Ct._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let n=0;n<t;++n)s[e.colNames[n]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?Ct._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(i=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=i;e<o&&!(h.length>=r);++e){let n=t[e],i=l?{rid:l[e]}:{};if(n){let t;if(s)for(t in s)null!=n[t]&&(i[t]=a(n,t));else for(t in n)i[t]=a(n,t)}h.push(i)}return h};var St=Ct;let wt=function(t,e){this._rid=t,this._children={},this._shared=e};l.inherits(wt,u),wt._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},wt._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},wt.prototype._shared=null,wt.prototype._rid,wt.prototype._children,wt.prototype._childCount=0,wt.prototype._collapsed=!1,wt.prototype._order=0,wt.prototype._disposed=!1,wt.prototype._subSegDef=null,wt.prototype._subSegLevel=0,wt.prototype._subSegMap=null,wt.prototype._subSegNames=null,wt.prototype._subSegName="",wt.prototype._subSegVal,wt.prototype._subSegParent=null,wt.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,n=this._subSegMap;for(let i=0;i<e;++i)n[t[i]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null},wt.prototype.getId=function(){return this._rid},wt.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},wt.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=e.length,i=this._subSegMap;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n.getId()),n.getSubSegmentIds(t)}return t}return null},wt.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},wt.prototype.addChildren=function(t,e){let n,i=Array.isArray(t)?t:[t],o=i.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],n=0;n<o;++n)r|=this.addChild(i[n],e[n]);else for(n=0;n<o;++n)r|=this.addChild(i[n]);return!!r},wt.prototype.containsChild=function(t){return!!this._children[t]},wt.prototype.removeChild=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;if(!this._children[t])return!1;return delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},wt.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.removeChild(e[t]);return!!i},wt.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let t=this._shared.childToSegment,e=this._children;for(let n in e)t[n]&&delete t[n];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},wt.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},wt.prototype.getChildren=function(){return this._children},wt.prototype.getChildCount=function(){return this._childCount},wt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},wt.prototype.setClassification=function(t){if(this._subSegLevel)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let n,i=null;t&&("string"==typeof t?i=[t]:Array.isArray(t)&&(i=t));let o=i?i.length:0;if(o){if((e?e.length:0)===o){for(n=0;n<o&&i[n]===e[n];++n);if(n>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=i,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},wt.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,n=e?e.length:0,i=this._subSegNames,o=i?i.length:0;if(!o&&this._subSegLevel>=n)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=i[r],a[l]=1,p=h[l],p._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<n&&t){h||(h=this._subSegMap={},i=this._subSegNames=[]);let n=e[this._subSegLevel];for(d in _){let e=_[d],o=t[e],r=o?o[n]:null;s.childToSegment[d]=this._rid,l="Uncategorized",(r||0===r||!1===r)&&(l=r+""),a[l]&&(a[l]=0,--u),p=h[l],p||(p=new wt(this._rid+"/"+l,s),p._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=r,p._subSegParent=this,h[l]=p,i.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,e)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(l in u>=i.length&&(i.length=0),a)if(a[l]){p=h[l],delete h[l];let t=i.indexOf(l);t>=0&&i.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}i.length||(i=this._subSegMap=this._subSegNames=null)}if(o=i?i.length:0,o)for(i.sort(wt._subSegSortLogic),r=0;r<o;++r)p=h[i[r]],p.classify(t);if(c&&this._subSegDef)if(o){let t=this._subSegDef.subSegments=[];this.getAllSubSegments(t),t.forEach(wt._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},wt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},wt.prototype.isSubSegment=function(){return!!this._subSegLevel},wt.prototype.getFirstAncestor=function(){if(this._subSegLevel&&this._subSegDef){return this._subSegDef.root||null}return null},wt.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=this._subSegMap,i=e.length;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i),i.getAllSubSegments(t)}}return t||null},wt.prototype.getSegmentLevel=function(){return this._subSegLevel},wt.prototype.setRowData=function(t,e){if(!t)return;let n=t[this._rid];n||(n=t[this._rid]={}),e||(e=t),n=e[this._rid],n||(n=e[this._rid]={});let i=this;for(;i&&i.isSubSegment();)i.getSubSegmentName(n),i=i._subSegParent},wt.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){let e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},wt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},wt.prototype.expand=function(t){return this.collapse(!1===t)},wt.prototype.isCollapsed=function(){return this._collapsed},wt.prototype.getCollapsingStates=function(t,e){let n=this._subSegNames;if(!this._subSegLevel&&!n&&!this._collapsed)return!1;t||(t={});let i=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,i=!0),this._childCount){let o=e||this._collapsed;if(n){let r=this._subSegMap,s=n.length;for(let l=0;l<s;++l){let s=r[n[l]];t[s.getId()]=!!e,s.getCollapsingStates(t,o)&&(i=!0)}}else if(o){let e=this._children;for(let n in e)t[n]=o;i=!0}}return i},wt.prototype.getOrder=function(){if(this._subSegLevel){let t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},wt.prototype.getLastOrder=function(){if(this._subSegDef){let t=this._subSegDef.subSegments;if(t){let e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},wt.prototype.setOrder=function(t){this._order=t},wt._tabs=null,wt.prototype.log=function(t){let e,n=wt._tabs;if(!n){n=wt._tabs=[];let t="";for(e=0;e<11;++e)n[e]=t,t+=" "}let i=this._collapsed?"+ ":"- ";t.push(n[this._subSegLevel]+i+this._rid);let o=this._subSegNames;if(o){let n=o.length,i=this._subSegMap;for(e=0;e<n;++e)i[o[e]].log(t)}else if(this._childCount){let e=n[this._subSegLevel+1];for(let n in this._children)t.push(e+"- "+n)}return t};var bt=wt;let Rt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};l.inherits(Rt,u),Rt.prototype._segments,Rt.prototype._segmentCount=0,Rt.prototype._collapsedRids=null,Rt.prototype._shared,Rt.prototype._segmentList=null,Rt.prototype._insertionList=null,Rt.prototype._removalList=null,Rt.prototype._classification=!1,Rt.prototype._classifierChanged=!1,Rt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},Rt.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;let n=this._segments[t]=new bt(t,this._shared);return n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&n.addChildren(e),!0}return!1},Rt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.addSegment(e[t]);return!!i},Rt.prototype.containsSegment=function(t){return!!this._segments[t]},Rt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},Rt.prototype.removeSegment=function(t){let e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());let n=e.getSubSegmentIds();if(n){let t=n.length;for(let e=0;e<t;++e){let t=n[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},Rt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},Rt.prototype.getSegmentCount=function(){return this._segmentCount},Rt.prototype.getSegment=function(t){return this._segments[t]||null},Rt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},Rt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},Rt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},Rt.prototype.collapseSegments=function(t,e){if(this._segmentCount){let n=0,i=t.length;for(let o=0;o<i;o++){let i=t[o];n|=this._segments[i].collapse(e)}if(n)return!0}return!1},Rt.prototype.collapseSegment=function(t,e){let n=this._segments[t];return!!n&&n.collapse(e)},Rt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Rt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let n in t)e|=t[n].expand();if(e)return!0}return!1},Rt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},Rt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let n=this._segments;t={};for(let i in n){let o=n[i];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},Rt.prototype.addSegmentChild=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&i.addChild(e,n)},Rt.prototype.addSegmentChildren=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&i.addChildren(e,n)},Rt.prototype.containsSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.containsChild(e)},Rt.prototype.removeSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.removeChild(e)},Rt.prototype.removeSegmentChildren=function(t,e){let n=this._segments[t];return!!n&&n.removeChildren(e)},Rt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let n in t){t[n].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},Rt.prototype.fillSegment=function(t,e){let n=Array.isArray(e)?e.length:0;if(!n)return;let i=this._segments,o=i[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<n;++t){let n=e[t];if(i[n])break;o.addChild(n)}}}},Rt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,n=this._segments,i=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=n[e];s&&!s.isSubSegment()?(i=s,i.removeAllChildren()):i&&!i.isSubSegment()&&(i.addChild(e),o=!0)}return o},Rt.prototype.calcSegmentOrder=function(t){let e=this._segmentList;e?e.length=0:e=this._segmentList=[];let n=t?t.length:0,i=this._segments,o=this._segmentCount,r=0;for(let e=0;e<n;++e){let n=i[t[e]];if(n&&(n.isSubSegment()||(this._segmentList.push(n),n.setOrder(++r)),--o<=0))break}},Rt.prototype.getSegmentValues=function(t,e){let n=t?t.length:0;if(!n)return null;let i=this._segments,o=this._shared.childToSegment,r=null,s=null,l=new Array(n),a=0,u=-10,h=0;for(let p=0;p<n;++p){let n=t[p];if(r=i[n],r)a=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{let t=o[n];t?(r=i[t],a=100*r.getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(a=u,h=10):a=h=0}l[p]=a+h}return s?l:null},Rt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,n=[];for(let i=0;i<e;++i)t[i].log(n);return n.join("\n")},Rt.prototype.logRowIdMap=function(){let t=[],e=this._shared.childToSegment;for(let n in e){let i=e[n];t.push(n+" > "+i)}return t.join("\n")},Rt.prototype.setSegmentClassification=function(t,e){let n=this._segments[t];return!(!n||!n.setClassification(e))&&(n.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},Rt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},Rt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let n in e){let e=this._segments[n];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},Rt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let n=t.segment;this._insertionList.push(n),this._segments[e]=n,this._segmentCount++,n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},Rt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)};var vt=Rt;let It=function(){It.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};l.inherits(It,St),It.prototype._prevData=null,It.prototype._rids,It.prototype._frozen=!1,It.prototype._runningId=0,It.prototype._compMap=null,It.prototype._segments=null,It.prototype._autoSegmentFilling=!1,It.prototype._removedRows=null,It.prototype._userSegmentComparer=null,It.prototype._segmentSortOrder=0,It.prototype._segmentSortContext=null,It.prototype._clsSource=null,It.prototype._classifyingTimer=0,It.SortLogic,It.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,It._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},It.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let n=this._rids.length;--n>=0;)e[n]=this._rows[this._rids[n]][t];return e},It.prototype.getRowId=function(t){return this._rids[t]||""},It.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},It.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},It.prototype.getRowCount=function(){return this._rids.length},It.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},It.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},It.prototype.getPreviousData=function(t,e){let n=this._prevData[t]||null;return n?n[e]:null},It.prototype.setData=function(t,e,n){if(!this._needFiring())return this._setData(t,e,n);let i={};return i[e]=n,this.setRowData(t,i)},It.prototype._removeRidFromSegments=function(t){if(this._segments){if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}}return!1},It.prototype.setRowData=function(t,e,n){if(!t)return!1;let i=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(i){let n=this._prevData[t];for(let t in e)n[t]=i[t],i[t]=e[t]}else if(r="inserted",i=e,this._rows[t]=i,this._prevData[t]={},n){let e=n.nextRid,i=e?this.getRowIndex(e):-1;i<0&&(i=n.fallback),null==i||i<0||i>=this._rids.length?this._rids.push(t):(this._rids.splice(i,0,t),s=!this._isLastSegment(i))}else this._rids.push(t);o=!0}else i&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),It._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=n||{};o.rid=t,o.changes=e,o.rowData=i,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},It.prototype.setColumnData=function(t,e,n){let i=e?e.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(i,n);for(let n=0;n<i;++n)this._setData(r[n],t,e[n]);this.freeze(o)},It.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},It.prototype.setDataFrom2DArray=function(t,e,n){let i=t?t.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(i,n);for(let n=0;n<i;++n){let i=t[n],o=s[n];if(e)for(r=i.length;--r>=0;)this._setData(o,e[r],i[r]);else for(r=i.length;--r>=0;)this._setData(o,""+r,i[r])}this.freeze(o)},It.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setData(i,e,n)},It.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setRowData(i,e,n)},It.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},It.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let n=t.length;if(!n)return;if(1===n)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let i=this._frozen;this.freeze();for(let i=0;i<n;++i)this.addRow(t[i],e[i]);this.freeze(i)},It.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},It.prototype.insertRow=function(t,e,n){let i=null;return"number"==typeof t?(i={},i.nextRid=this._rids[t],i.fallback=t):t&&(i={},i.nextRid=t),e||(e={}),n=this._generateUniqueRid(e,n),this.setRowData(n,e,i),n},It.prototype.insertAfter=function(t,e,n){let i="string"==typeof t?this.getRowIndex(t):t;return!(i>=0)||i>=this._rids.length-1?this.addRow(e,n):this.insertRow(i+1,e,n)},It.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},It.prototype.removeRows=function(t){let e,n;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let i=!1;for(this._removedRows={},n=t.length;--n>=0;){e=t[n],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),i=!0)}i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},It.prototype._removeRows=function(t){return!this._removedRows[t]},It._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&(n>=t.length?t.pop():t.splice(n,1),!0)},It.prototype.clearAllData=function(t){It.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},It.prototype.removeAllRows=It.prototype.clearAllData,It._ascendingOrder=function(t,e){return t-e},It.prototype.moveRow=function(t,e,n){let i=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let n=t;n.sort(It._ascendingOrder);let r=[];for(let t=n.length;--t>=0;){let i=n[t];o=this._rids[i],o&&(r.unshift(o),this._rids.splice(i,1),i<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),i=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),i=o));return i&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(n)),i},It.prototype._moveRow=function(t,e,n){let i=t.length;if(!i)return null;let o=new Array(i);for(let e=0;e<i;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return i>1?this.moveRow(o,r,n):this.moveRow(o[0],r,n)},It.prototype.moveRows=function(t,e,n,i){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),n||(n=1);let o=t+n-1,r=e;if(e>=t&&(r=e<=o?t:e-n),n>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,n),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(i),e}return null},It.prototype.swapRow=function(t,e){let n=this._rids.length;if(t<0||t>=n)return;if(e<0||e>=n)return;let i=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=i},It.prototype._replaceRowId=function(t,e){let n=this._rids,i=n.indexOf(t);return i>=0&&(n[i]=e,this._rows[e]=this._rows[t],delete this._rows[t],this._prevData[e]=this._prevData[t],delete this._prevData[t],!0)},It.prototype.replaceRowIds=function(t){if("object"==typeof t){let e=!1;for(let n in t)e|=this._replaceRowId(n,t[n]);e&&this.dispatchGlobalChange()}},It.prototype.clearRowData=It.prototype.removeRow,It.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},It.prototype.getDataSource=function(){return null},It.prototype.setDataSource=function(t){},It.prototype.getSortingLogics=function(){return this._compMap},It.prototype.sortOnce=function(t,e,n,i){let o=It._buildSortContext([],t,e,n||this._compMap,i);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},It.prototype.setSortingLogic=function(t){this._compMap._default=t},It.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},It.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},It.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},It.prototype.unfreeze=function(t){return this.freeze(!1===t)},It.prototype.isFrozen=function(){return this._frozen},It.prototype.setSegmentSeparators=function(t,e){let n=!1;if(t){let i=t.length,o=!1;for(let r=0;r<i;r++)if(!1!==e){let e=t[r];if(this._segments||(this._segments=new vt,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){let t=this._segments.getParentRowId(e);t&&this._segments.removeSegmentChild(t,e)}o=this._segments.addSegment(e)}else if(this._segments){this._segments.getSegment(rid)&&this._segments.removeSegment(rid)&&(n=!0,this._segments.getSegmentCount()||(this._segments=null))}!1!==e&&o&&(this._segments.calcSegmentOrder(this._rids),n=!0),n&&this.dispatchGlobalChange()}return n},It.prototype.setSegmentSeparator=function(t,e){let n=!1,i=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new vt,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),n=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(i=e.getChildCount(),this._segments.removeSegment(t)&&(n=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(n&&this._needFiring())if(this._autoFillSegments()||i)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return n},It.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},It.prototype.hasSegmentation=function(){return!!this._segments},It.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},It.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},It.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},It.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},It.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},It.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},It.prototype._isLastSegment=function(t){let e=this._segments;if(e){let n=this._rids,i=n.length;for(let o=t+1;o<i;++o)if(e.containsSegment(n[o]))return!1}return!0},It.prototype._getSegmentSeparators=function(){return this._segments},It.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},It.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},It.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},It.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},It.prototype.addSegmentChild=function(t,e,n){if(this._segments){if(this._segments.addSegmentChild(t,e,n))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},It.prototype.addSegmentChildren=function(t,e,n){if(this._segments){if(this._segments.addSegmentChildren(t,e,n))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},It.prototype.setSegmentChildren=function(t){if(!this._segments)return!1;this.removeAllSegmentChildren();let e,n=t.length;for(let i=0;i<n;i++){let n=t[i];this._segments.addSegmentChildren(n.segmentId,n.rowIds)&&(e=!0)}return!!e&&(this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0)},It.prototype.removeSegmentChild=function(t,e){if(this._segments){let n=this._segments.removeSegmentChild(t,e);return n&&(this.dispatchGlobalChange(),this.requestClassifying()),n}return!1},It.prototype.removeSegmentChildren=function(t,e){if(this._segments){let n=this._segments.removeSegmentChildren(t,e);return n&&(this.dispatchGlobalChange(),this.requestClassifying()),n}return!1},It.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},It.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},It.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},It.prototype.sortSeparators=function(t,e,n){let i=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);let o=It._buildSortContext([],n,e,t),r=o?o.length:0;if(!r)return i;let s,l,a=0;return r>1?(s=It._multiColumnSeparatorCompareLogic,l=o,a=1):(s=It._singleColumnSeparatorCompareLogic,l=o[0],a=l[3]),this._segmentSortOrder=a,this._segmentSortContext=l,i=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,i},It.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;let e,n=this._rids,i=this._segments,o=i.getSegmentCount(),r=[],s=[],l=0,a=n.length,u="",h=null;for(e=0;e<a&&(u=n[e],h=i.getSegment(u),!(h&&(s.push(e),r.push(h),++l>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;let p=!1;for(e=0;e<l;++e){let t=s[e];u=n[t],h=r[e];let i=h.getId();u!==i&&(n[t]=i,p=!0)}return!!p&&(this._segments.calcSegmentOrder(n),this._sort(null),this._dispatchPositionChange(),!0)},It.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},It.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},It.prototype.setSegmentClassification=function(t,e){if(this._segments){if(this._segments.setSegmentClassification(t,e))return this.classifySegments()}return!1},It.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},It.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},It.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},It.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=i.length,h={};for(e=0;e<u;e++){let t=i[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],It._removeArrayItem(l,t),o=!0)}let p=n.length;for(e=0;e<p;e++){let t=n[e],i=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(i);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},It.prototype._sort=function(t){let e=this._rids,n=this.getMultipleRowData(e),i=this.getSegmentValues(e),o=It._performMultiLevelSorting(n,t,i);return!!o&&(this._rids=It._reorderItems(e,o),!0)},It.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(It._globalChangeArg)},It.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",It._positionChangeArg)},It.prototype.dump=function(t){return St.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},It.prototype._setData=function(t,e,n){let i=this.getRowData(t);return i||(i={},this._rows[t]=i,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=i[e],i[e]=n,!0},It.prototype._generateRids=function(t,e){let n,i=0;if(e)n=e;else{n=[];let e=this._rids.length;for(;i<e&&i<t;)n.push(this._rids[i++])}for(i=n.length;i<t;)n.push(""+i++);return n},It.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},It.prototype._needFiring=function(){return!this._frozen&&!this._composing},It.getSortingDefinitions=_t._deprecatedFunction,It._globalChangeArg={globalChange:!0},It._positionChangeArg={globalChange:!0,positionChangeOnly:!0},It._buildSortContext=function(t,e,n,i,o){let r,s;Array.isArray(e)?(r=e,s=n):(r=[e],s=e?[n]:[0]);let l=null,a=null;"function"==typeof i?l=i:a=i;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let n=t[e];n||(n=t[e]=new Array(5));let i=r[e];n[0]=i,n[1]=null,n[2]=l||a[i]||a._default,n[2]||(n[2]=It._defaultComparer),n[3]=It._getSortOrder(s[e]),n[4]=o}return t},It._multiColumnCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=It._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},It._singleColumnCompareLogic=function(t,e,n,i){let o=i[1];return i[2](o[t],o[e],n,i[4])},It._multiColumnSeparatorCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=It._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},It._singleColumnSeparatorCompareLogic=function(t,e,n,i){let o=i[0];return i[2](t[o],e[o],n,i[4])},It._performMultiLevelSorting=function(t,e,n){let i,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let n=0;n<r;++n){let r,s=e[n],l=s[1];if(i=s[2],i.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(n){let t=["ROW_SEGMENT",n,It._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(i=It._multiColumnCompareLogic,s=e,l=1):(i=It._singleColumnCompareLogic,s=e[0],l=s[3]),It._mergeSort(o,l,i,s)},It._mergeSort=function(t,e,n,i){let o,r,s,l,a,u=!1,h=1,p=It._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(n(p[r],p[s],e,i)<=0){if(d[o++]=p[r],++r>=l){for(;s<a;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=a){for(;r<l;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;let c=p;p=d,d=c,h<<=1}return u?p:null},It._reorderItems=function(t,e){if(e){for(let n=t.length;--n>=0;)e[n]=t[e[n]];return e}return t},It._createIndexArray=function(t){let e=It._idxAryMap[t];if(!e){It._idxAryCount>50&&(It._idxAryMap={},It._idxAryCount=0),e=It._idxAryMap[t]=new Array(t),It._idxAryCount++;for(let n=0;n<t;++n)e[n]=n}return e.slice()},It._removeIndexArray=function(){It._idxAryMap={},It._idxAryCount=0},It._idxAryMap={},It._idxAryCount=0,It._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},It._defaultComparer=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},It._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},It._proto=It.prototype;var Dt=It;const xt="ROW_DEF",At="CONTENT",Lt="CHAIN",Tt="CONSTITUENT",Et="GROUP_HEADER",Mt="SUBGROUP_HEADER",Ft="GROUP_MEMBER",Pt=/^_[^_]+_$/;let zt=function(t){if(this._changes={},t&&t.segmentId)return this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+zt._runningId+++"_",t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};zt._runningId=0,zt._childDataField="CHILD_VALUES",zt.prototype._userInput="",zt.prototype._ric="",zt.prototype._permId="",zt.prototype._label=null,zt.prototype._isChain=null,zt.prototype._asSegment=!1,zt.prototype._realTime=!0,zt.prototype._rowId="",zt.prototype._userId=!1,zt.prototype._dc=null,zt.prototype._subs=null,zt.prototype._view=null,zt.prototype._subId="",zt.prototype._collapsed=null,zt.prototype._autoGenerated=!1,zt.prototype._subSegment=!1,zt.prototype._staticValues=null,zt.prototype._changes,zt.prototype._updateCount=0,zt.prototype._children=null,zt.prototype._parent=null,zt.prototype._groupOrder=0,zt.prototype._depthLevel=0,zt.prototype._userModel=null,zt.prototype._info=null,zt.prototype.dispose=function(){this.isDisposed()||(this._children&&(this._children.forEach(zt.dispose),this._children=null),this._dc&&(this._dc.setRowData(this._rowId,null),this._dc=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._subs=null,this._view=null,this._subId=this._rowId="",this._userId=!1,this._autoGenerated=!1,this._userModel=null)},zt.prototype.isDisposed=function(){return!this._rowId},zt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(e.match(Pt)?console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."):(this._rowId=e,this._userId=!0))}let e=zt.extractRowOptions(t),n=t.permId;null!=n&&(this._permId=n),n=t.ric,null!=n&&(this._ric=n),n=t.label,void 0!==n&&(this._label=n),n=t.chainRic,null!=n&&(this._chainRic=n),n=e.asChain,null!=n&&(this._isChain=!!n),n=t.realTime,null!=n&&(this._realTime=n),n=t.asSegment,null!=n&&(this._asSegment=!!n),(this._isChain||this._asSegment)&&(this._collapsed=e.collapsed),n=t.keepModel,n&&(this._userModel=t),n=t.info,n&&(this._info=n);let i=this._ric||this._chainRic;(i||this._permId)&&this.setContent(i,e),n=t.values,void 0!==n&&this.setStaticRowData(n,t.fields)},zt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;this.setParent(e)&&(this._ric=t.ric,this._dc=e._dc,this._subId=e._subId),this._staticValues=t.values||null,this.resetRowData()};let Vt=function(t,e){let n=t.getRowIndex(e);do{if((e=t.getRowId(++n))&&!t.getSegmentParentRowId(e))break}while(e);return e},kt=function(t,e,n){return!(!t||!t.isSorting())&&((e=!!e)!==n&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};zt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let n=this._userInput!==t,i=e.permId||"";if(this._permId!==i&&(this._permId=i,n=!0),!n)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=kt(s,r&&o,!1);this.unsubscribeForUpdates(),this._userInput=t;let a=e.collapsed;if(r){let n=e.chainRic;this._ric=!0===o?!0===a?t:t.replace("0#",""):t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=Vt(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),a!==this.isChainCollapsed()&&s.collapseSegment(this._rowId,a),this._collapsed=null,kt(s,!1,l),t&&s.addSegmentChild(t,this._rowId)}return this.subscribeForUpdates(),!0},zt.prototype.getRowId=function(){return this._rowId},zt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let n=this._ric;if(n&&(e.ric=n),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),n=this._realTime,n||(e.realTime=!1),n=this._permId,n&&(e.permId=n),n=this._chainRic,n&&(e.chainRic=n),n=this._label,n&&(e.label=n),n=this._userModel,n&&(e.keepModel=e),n=this._isChain,null!=n&&(e.asChain=n),n=this._collapsed,null!=n&&(e.collapsed=n),n=this._view.isHiddenRow(this._rowId),n&&(e.hidden=n),n=this._info,n&&(e.info=this._info),n=this._cloneStaticRowData(),n&&(e.values=n),this.isChain()){let t=this.getChildren();if(t){let i=n?n[zt._childDataField]:{};i||(i={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._cloneStaticRowData(),s&&(l=!0,i[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[zt._childDataField]=i)}}return e},zt.prototype.getDataId=function(){return""},zt.prototype.getType=function(){if(this._isChain)return Lt;if(this._parent)return Tt;{let t=this._view;if(!t)return"";{let e=this.getRowId(),n=t.isSegmentSeparator(e),i=t.getSegmentLevel(e);if(n)return 1===i?Et:Mt;if(t.getSegmentParentRowId(e))return Ft}}return At},zt.prototype.setDataSource=function(t,e){this._dc=t||null,this._dc&&(this.setRowData({}),this._staticValues&&this.setRowData(this._staticValues)),this._subs=e||null,this.subscribeForUpdates()},zt.prototype.getDataSource=function(){return this._dc},zt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._rowId):{}},zt.prototype.getData=function(t){return this._dc?this._dc.getData(this._rowId,t):null},zt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=T(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},zt.prototype._cloneStaticRowData=function(){return this._staticValues?function(t){let e={};for(let n in t)e[n]=t[n];return e}(this._staticValues):null},zt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},zt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=T(t,e)),t&&this.setRowData(t)},zt.prototype.copyRowData=function(t){if(t&&t!==this){let e=this.getRowData();t.cloneRowData(e,this._staticValues)}},zt.prototype.cloneRowData=function(t,e){let n,i=t||{},o={ROW_DEF:1,SUB_ID:1},r=this._staticValues;for(n in r)o[n]=1;for(n in e)o[n]=1;let s=this.getRowData();for(n in s)o[n]||(i[n]=s[n]);return i},zt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._rowId,t)},zt.prototype.resetRowData=function(){let t=this._dc;if(t){let e=this._rowId;t.setRowData(e,null),t.setRowData(e,{}),this._staticValues&&t.setRowData(e,this._staticValues)}},zt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._rowId,t,e)},zt.prototype._clearStaticData=function(){let t=this._staticValues;if(t){if(this._dc){let e={};for(let n in t)e[n]=null;this._dc.setRowData(this._rowId,e)}this._staticValues=null}},zt.prototype.getUserInput=function(){return this._userInput},zt.prototype.getRic=function(){return this._ric},zt.prototype.getPermId=function(){return this._permId},zt.prototype.getSymbol=function(){return this._ric||this._permId},zt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},zt.prototype.getLabel=function(){return this._label},zt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},zt.prototype.isChain=function(){return this._isChain},zt.prototype.isConstituent=function(){return!(!this._autoGenerated||!this._subId||this._rowId===this._subId)},zt.hasChain=function(t){return t.isChain()},zt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},zt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},zt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},zt.prototype.isAutoGenerated=function(){return this._autoGenerated},zt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},zt.prototype.subscribeForUpdates=function(t){if(t?this._subs=t:t=this._subs,!t)return!1;if(!this.isRealTimeRow()&&!this.getPermId())return!1;if(this.unsubscribeForUpdates(),this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));let e=this.getDisplayText();return this.setRowData({X_RIC_NAME:e}),!0},zt.prototype.unsubscribeForUpdates=function(){return this.isSubscribing()&&(this._subs.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this.resetRowData()),null},zt.prototype.isSubscribing=function(){return!(!this._subId||!this._subs)},zt.prototype.getSubId=function(){return this._subId},zt.prototype.addUpdate=function(t){if(t){let e=0;for(let n in t)this._changes[n]=e=1;if(e)return++this._updateCount,!0}return!1},zt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},zt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},zt.prototype.registerToView=function(t,e){if(!t||this._view===t)return!1;this._view=t;let n=this._rowId,i=t.getRowData(n);if(i&&i[xt])return console.warn("Duplicate row id detected"),!1;if(this._subSegment)return i&&(i[xt]=this),!0;i={},i[xt]=this;let o="",r=this._isChain||this._asSegment;if(e&&(o=t.getSegmentParentRowId(e),o))if(r)e=Vt(t,e);else if(!this.isConstituent()){t.getData(o,xt).isChain()&&(o=null,e=Vt(t,e))}let s=kt(t,r,!1);return t.insertRow(e,i,n),r?(t.setSegmentSeparator(n),kt(t,!1,s),null!=this._collapsed&&(t.collapseSegment(n,this._collapsed),this._collapsed=null)):!this._parent&&o&&t.addSegmentChild(o,n),!0},zt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},zt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},zt.prototype._getChildStaticRowData=function(t){if(this._staticValues){let e=this._staticValues[zt._childDataField];if(e)return e[t]||null}return null},zt.prototype.getConstituent=function(t){if(this._children&&t)for(let e=this._children.length;--e>=0;)if(this._children[e]._ric===t)return this._children[e];return null},zt.prototype.verifyConstituent=function(t){return!(!this._isChain||!t||this._ric===t||this._ric==="0#"+t)&&this._ric!=="/"+t},zt.prototype.addConstituent=function(t){if(!(this._rowId&&this._subId&&this._isChain))return null;this._children||(this._children=[]);let e={asConstituent:!0,ric:t,parent:this},n=this._getChildStaticRowData(t);return n&&(e.values=n),new zt(e)},zt.prototype.toRealTimeRow=function(){if(!this.isConstituent())return;let t=this._parent._subs;this._realTime=!0,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this.resetRowData(),this.subscribeForUpdates(t)},zt.prototype.unlinkChain=function(){if(!this._isChain)return;this.unsubscribeForUpdates();let t=this._view;if(t){let e=this.getRowId(),n=t.getSegment(e);n&&n.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},zt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!0)},zt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!1)},zt.prototype.toggleChain=function(){return this.isChainExpanded()?this.collapseChain():this.expandChain()},zt.prototype.addChild=function(t){return!!t&&t.setParent(this)},zt.prototype.getChildren=function(){return this._children},zt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,n=e.length;for(let i=0;i<n;++i){let n=e[i];t.push(n),n.getDescendants(t)}}return t},zt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(zt.toRowId):null},zt.prototype.getChildCount=function(){return this._children?this._children.length:0},zt.prototype.countChildInView=function(){if(this._children){let t=0,e=this._children.length;for(let n=0;n<e;++n)this._children[n]._view&&++t;return t}return 0},zt.prototype.getParent=function(){return this._parent},zt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},zt.prototype.getDepthLevel=function(){return this._depthLevel},zt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},zt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},zt.prototype.getUserModel=function(){return this._userModel},zt.prototype.setRowInfo=function(t){this._info=t},zt.prototype.getRowInfo=function(){return this._info},zt.toRowId=function(t){return t.getRowId()},zt.extractRowOptions=function(t){let e=t.ric,n=t.permId,i=t.chainRic,o=t.collapsed,r=t.asSegment,s=t.asChain;null==s&&i&&(s=!0);let l=null;e&&e.indexOf("0#")>=0?(null==s&&(s=!0),l=!0):s?l=!1:r&&(l=!0);let a={};return a.collapsed=null==o?!l:o,a.ric=e,a.permId=n||"",a.chainRic=i,a.asChain=s,a},zt.dispose=function(t){t.dispose()};const Nt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),Ot=/^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;let Ht={};function Bt(t){t.currentTarget._error={type:t.type}}function Gt(t){let e=t.currentTarget,n=e._defer,i=e._field;if(delete Ht._loadingField[i],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===i.toUpperCase()&&(o=Ht.get(i)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,Ht.set(i,o))}}o?n.resolve(o):n.reject("No definition for "+i)}else e._error?(e._error.field=i,n.reject(e._error)):n.reject({field:i,status:e.status,statusText:e.statusText,request:e})}Ht._defs={},Ht._defaults={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},Ht._timeSeriesChildren={},Ht._synapse="",Ht._lang="en",Ht._timeSeriesExpansion=!0,Ht._loadingField={},Ht.set=function(t,e){if(Ht._defs[t])for(let n in e)Ht._defs[t][n]=e[n];else Ht._defs[t]=e},Ht.resetAll=function(){let t=Ht._defs={},e=Ht._defaults;for(let n in e)t[n]=e[n]},Ht.get=function(t){return Ht._defs[t]||null},Ht.getFieldInfo=Ht.get,Ht.hasFieldInfo=function(t){let e=Ht.get(t);return!(!e||!e.field)},Ht.getTimeSeriesChildren=function(t){return Ht._timeSeriesChildren[t]||null},Ht.addTimeSeriesChild=function(t,e){Ht._timeSeriesChildren[t]||(Ht._timeSeriesChildren[t]=[]),Ht._timeSeriesChildren[t].push(e)},Ht.remove=function(t){delete Ht._defs[t]},Ht.setSynapseConfig=function(t){Ht._synapse=t},Ht.disableTimeSeriesExpansion=function(t){Ht._timeSeriesExpansion=!1===t},Ht.isFormula=function(t){return"="===t.charAt(0)},Ht.isAdc=function(t){return 0===t.indexOf("TR.")},Ht.isRealTimeField=function(t){return!!t&&(!Ht.isAdc(t)&&(!Ht.isFormula(t)&&(!Ht.isTimeSeriesChild(t)&&!1!==Ht.getFieldProperty(t,"IsRealtimeField"))))},Ht.isTimeSeriesChild=function(t){return!!Ht.getFieldProperty(t,"timeSeriesParent")},Ht.isTimeSeries=function(t){if(!t)return!1;if(!Ht._timeSeriesExpansion)return!1;let e=Ht.getFieldProperty(t,"timeSeries");return null!=e?!!e:Ot.test(t)},Ht.setFieldProperty=function(t,e,n){Ht._defs[t]||(Ht._defs[t]={}),Ht._defs[t][e]=n},Ht.getFieldProperty=function(t,e){let n=Ht._defs[t];return n?n[e]:null},Ht.loadFieldInfo=function(t){if(Ht._loadingField[t])return Ht._loadingField[t].promise;let e=new k,n=Ht._synapse;if(n)if(Ht.hasFieldInfo(t))e.resolve(Ht.get(t));else if(n.debug){let n=this._mockOnLoadEndData(t,e);setTimeout(Gt.bind(null,n),1e3)}else if(n.apiKey&&n.contextApp){let i=Nt+"&api-key="+encodeURIComponent(n.apiKey)+"&contextApp="+encodeURIComponent(n.contextApp)+"&language="+encodeURIComponent(Ht._lang)+"&query="+encodeURIComponent(t);n.auth&&(i+="&auth="+encodeURIComponent(n.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,Ht._loadingField[t]=e,o.addEventListener("loadend",Gt),o.addEventListener("timeout",Bt),o.addEventListener("error",Bt),o.open("GET",i,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},Ht._mockOnLoadEndData=function(t,e){let n,i=t.toUpperCase(),o=i.toLowerCase();n=2===o.indexOf("_")?i[3]+o.substring(4):i[0]+o.substring(1);let r=i.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+i+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:n,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:n,fn:i,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:n,title:"title mockup of "+i,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in Ht._defaults)Ht._defaults[t].field=t,Ht._defs[t]=Ht._defaults[t]}();var Wt=Ht;let Ut={_formulas:{},set:function(t,e){Ut._formulas[t]=e},get:function(t){return Ut._formulas[t]||""},remove:function(t){delete Ut._formulas[t]}};var Yt=Ut;const Xt={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let qt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};qt.prototype._field="",qt.prototype._dataType="",qt.prototype._name="",qt.prototype._defaultName=!0,qt.prototype._defaultField=!0,qt.prototype._tooltip=null,qt.prototype._requiredFields,qt.prototype._headerRenderer=null,qt.prototype._headerAlignment="",qt.prototype._internalRenderer,qt.prototype._userRenderers=null,qt.prototype._activatedRenderer=null,qt.prototype._rendererMap=null,qt.prototype._userSorter=null,qt.prototype._sortable=!0,qt.prototype._eventArg,qt.prototype._autoGenerated=!1,qt.prototype._classes,qt.prototype._fnEngine=null,qt.prototype._formula=null,qt.prototype._formulaRef="",qt.prototype._initialOrder="",qt.prototype._rowSorting=null,qt.prototype._textSelect=!1,qt.prototype._userModel=null,qt.prototype._parent=null,qt.prototype._children=null,qt.prototype._info=null,qt.prototype._coreColDef=null,qt.prototype._focusable=!1,qt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},qt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},qt.prototype.initialize=function(t){if(!t)return;let e,n,i,o,r=t.field,s=Wt.get(r);if(s&&s!==t){let e=t;for(i in t={},s)t[i]=s[i];for(i in e)t[i]=e[i]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name,null==o&&(o=t.title),null!=o&&(this._name="string"==typeof o?o:o+"",this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Wt.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(n=o.length,e=0;e<n;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.focusable,null!=o&&(this._focusable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},qt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},qt.prototype.getRequireFields=function(){return this._requiredFields},qt.prototype.getRequiredFields=qt.prototype.getRequireFields,qt.prototype.getRenderer=function(){return this._internalRenderer},qt.prototype.getHeaderRenderer=function(){return this._headerRenderer},qt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},qt.prototype.isDefaultName=function(){return this._defaultName},qt.prototype.getFieldDefinition=function(){return Wt.get(this.getField())},qt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},qt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Xt[t.toUpperCase()]:""},qt.prototype.setDataType=function(t){let e=Xt[t.toUpperCase()];e&&(t=e),this._dataType=t},qt.getDataType=function(t){let e=Wt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Xt[t]?Xt[t]:""}return""},qt.prototype.getTooltipValue=function(){return this._tooltip},qt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},qt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},qt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},qt.prototype.isRealTimeField=function(){return Wt.isRealTimeField(this.getField()||this._field)},qt.prototype.isTimeSeries=function(){return Wt.isTimeSeries(this.getField())},qt.prototype.isTimeSeriesChild=function(){return Wt.isTimeSeriesChild(this.getField())},qt.prototype.isFormulaField=function(){return!!this._formula},qt.isFormulaField=function(t){return Wt.isFormula(t)},qt.isAdcField=function(t){return Wt.isAdc(t)},qt.isRealTimeField=function(t){return Wt.isRealTimeField(t)},qt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let n=e.getRequiredFields(),i=n.length;for(let e=0;e<i;++e){let i=n[e];qt.isRealTimeField(i)&&t.push(i)}return t},qt.prototype.isSortable=function(){return this._sortable},qt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},qt.prototype.getInitialSortOrder=function(){return this._initialOrder},qt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},qt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},qt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},qt.prototype.isFieldEmpty=function(){return!this.getField()},qt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},qt.prototype.getClasses=function(){return this._classes},qt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let n=this.getDataType();n&&(e.dataType=n),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),n=!1===Wt.getFieldProperty(this.getField(),"IsRealtimeField"),n&&(e.notRealTimeField=n),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let i=this._classes;i&&i.length>0&&(e.className=i.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),l=o.getColumnCustomLaneSize(r);return!0===s&&1===l||(e.scalable=s,e.width=l),n=o.getMinimumColumnWidth(r),n>0&&(e.minWidth=n),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),n=o.getColumnAlignment(r),"default"!==n&&(e.textAlign=n),e},qt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},qt.prototype.isTextSelect=function(){return this._textSelect},qt.prototype.hide=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.hideColumn(n,!1!==t)},qt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},qt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},qt.prototype.getParent=function(){return this._parent},qt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},qt.prototype.getChildren=function(){return this._children},qt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},qt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},qt.prototype.activateRenderer=function(t,e){let n=null;if(null!=t){let i=this._rendererMap;i||(i=this._rendererMap={}),"function"==typeof e?n=i[t]=e:null==e?n=i[t]:e||(n=i[t]=null)}return this._activatedRenderer=n||null,n||(n=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(n),!!this._activatedRenderer},qt.prototype.getSorter=function(){return this._userSorter},qt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},qt.prototype.isRowSorting=function(){return null==this._rowSorting?!Wt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},qt.prototype.isAutoGenerated=function(){return this._autoGenerated},qt.prototype.setName=function(t){this._name=t,this._defaultName=!1},qt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let n=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),i=n||Yt.get(e);(i||qt.isFormulaField(t))&&(t=c.toUpperCase(t),this._formula=this._fnEngine.addFormula(i||t),i&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Wt.setFieldProperty(t,"timeSeries",!!Wt.isTimeSeries(t));let i=e.parent;e&&i&&Wt.setFieldProperty(t,"timeSeriesParent",i.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},qt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let n=t[e],i=n.toUpperCase(),o=Yt.get(i);if(o){let t=this._fnEngine.getFormula(n);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(n),this._fnEngine.addReference(t,n)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(n)}},qt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},qt.prototype._customRenderer=function(t){let e=t.dataValue,n=this._eventArg;if(e){let i=e.getRowData();n.rowDef=e,n.rowData=i,n.rowIndex=t.rowIndex,n.data=i?i[this._field]:null}else n.data=null;if(n.colIndex=t.colIndex,n.cell=t.cell,n.section=t.section,this._activatedRenderer)this._activatedRenderer(n);else{let t=this._userRenderers,e=t.length;for(let i=0;i<e;++i)t[i](n)}},qt.prototype._updateContext=function(t,e){this._eventArg[t]=e},qt.prototype.getUserModel=function(){return this._userModel},qt.prototype.clearUserModel=function(){this._userModel=null},qt.prototype.setColumnInfo=function(t){this._info=t},qt.prototype.getColumnInfo=function(){return this._info},qt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},qt.prototype.isFocusable=function(){return this._focusable},qt.prototype.getBackgroundColor=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnBackgroundColor(e)},qt.prototype.setBackgroundColor=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.setColumnBackgroundColor(n,t)};var jt=qt;let Kt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};s.inherits(Kt,a),Kt.prototype._timerId=0,Kt.prototype._rics,Kt.prototype._fields,Kt.prototype._rtk,Kt.prototype._adcOptions=null,Kt.prototype.setRTK=function(t){this._rtk=t},Kt._mockAdc=null,Kt.setMockAdc=function(t,e){Kt._mockAdc||(Kt._mockAdc={}),Kt._mockAdc[t]=e},Kt.getMockAdc=function(t){return Kt._mockAdc?Kt._mockAdc[t]:null},Kt.clearMockAdc=function(){Kt._mockAdc=null},Kt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Kt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Kt.prototype.addRics=function(t){let e=t?t.length:0,n=!1;for(let i=0;i<e;++i){let e=t[i];e&&!this._rics[e]&&(this._rics[e]=1,n=!0)}return!!n&&(this._request(),!0)},Kt.prototype.addField=function(t){this._addField(t)&&this._request()},Kt.prototype.addFields=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n|=this._addField(t[i]);return!!n&&(this._request(),!0)},Kt.prototype._addField=function(t){return Kt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Kt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Kt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Kt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,n=Object.keys(this._rics),i=[],o=[];for(let t in this._fields)Ht.isTimeSeries(t)?o.push(t):i.push(t);let r,s,l=i.length,a=o.length;if((l||a)&&n.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Kt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}i.length>0&&(t=i.join(","),s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,i),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<l;e++)o.push({name:i[e]});s={instruments:n,fields:o},r=this._onJETSuccess.bind(this,i),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Kt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(n=0;n<a&&l<u;n++)i=t[n],s[l].field===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=0;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];L(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Kt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(n=0;n<a&&l<u;n++)i=t[n],s[l].r.toUpperCase()===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=1;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&"object"!=typeof n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];L(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Kt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n=e.rows,i=e.rows&&e.rows[0];if(!Array.isArray(n)||!Array.isArray(i))return;let o=i.slice(2).map(t=>t.v),r={},s=0,l=n.length;for(let e=1;e<l;e++){let i=n[e][1];r[i]||(r[i]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=n[t],i=e[0],s=e[1];a[i]||(a[i]={});let l=a[i];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let n=r[s].replace("TR.","")+"_"+o[t],i=e[2+t];null!==i&&(u[n]=r[s],l[n]=i)}}let h={};for(let t in a){let e=a[t];L(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var Jt=Kt;let Qt=function(){this._groupMap={},this._childToParent={}};Qt.prototype._groupMap,Qt.prototype._childToParent,Qt.getGroupId=function(t){return t&&t.id||""},Qt.calcTreeDepth=function(t,e){let n=-1,i=e;for(;i;){if(++n>15){console.log("WARNING: Infinite loop detected during column group creation");break}i=t[i.parentId]}return n},Qt.getLeafDescendants=function(t,e){let n=t[e];if(!n)return null;let i=[],o=[n],r=0,s={};for(;r<o.length;){n=o[r++],s[n.id]=!0;let e=n.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];n=t[l],n?s[n.id]||o.push(n):i.push(l)}}return i},Qt._cloneObject=function(t){let e=A(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Qt._toGroupDefinition=function(t,e){let n=null;return t&&(n=Array.isArray(t)?{children:t.slice()}:Qt._cloneObject(t),e&&(n.name||(n.name=e),n.id=e)),n},Qt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let n in t){let i=t[n];e.push(n+": "+JSON.stringify(i,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Qt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Qt.prototype.getDefinition=Qt.prototype.getGroup,Qt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let n in e)t.push(e[n]);return t},Qt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Qt.prototype.getGroupMap=function(){return this._groupMap},Qt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let n in t){let i=t[n],o=Qt._cloneObject(i);e[n]=o}return e},Qt.prototype.rebuildMap=function(){let t,e,n=this._groupMap,i=this._childToParent={},o=Object.keys(n),r=o.length;for(t=0;t<r;++t){e=o[t];let r=n[e].children,s=r?r.length:0;for(let t=0;t<s;t++)i[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=i[e];r&&(n[e].parentId=r)}},Qt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Qt.prototype.getLeafDescendants=function(t){return Qt.getLeafDescendants(this._groupMap,t)},Qt.prototype.getGroupLevel=function(t){return Qt.calcTreeDepth(this._groupMap,this._groupMap[t])},Qt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,n=e[t]||null;if(n)for(;n.parentId;){let t=e[n.parentId];if(!t)break;n=t}return n},Qt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Qt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],n=this._groupMap[e];for(;n&&n.parentId;)n=this._groupMap[n.parentId],n&&t.push(n.id);return t}}return null},Qt.prototype.getParentId=function(t,e){let n=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(n);for(;t>e&&n;)n=this._childToParent[n],t--}return n||""},Qt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Qt.prototype.setGroups=function(t){let e=this._groupMap={},n=t?t.length:0;for(let i=0;i<n;i++){let n=t[i],o=n.id;o&&(e[o]=Qt._cloneObject(n))}this.rebuildMap()},Qt.prototype.addGroup=function(t){let e=Qt.getGroupId(t);return e?this.setGroup(e,t):e},Qt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Qt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let n=Qt._toGroupDefinition(e,t);this._ungroupChildren(n.children),this._groupMap[t]&&this.removeAllChildren(t);let i=this._childToParent[t];i&&(n.parentId=i),this._groupMap[t]=n;let o=n.children,r=o.length;for(let e=0;e<r;++e){let n=o[e];this._childToParent[n]=t;let i=this._groupMap[n];i&&(i.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Qt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n)this.unsetParent(t[n])}},Qt.prototype.hasGroupChild=function(t,e){let n=this._groupMap[t];if(e&&n){let t=n.children;if(t)return t.indexOf(e)>=0}return!1},Qt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let n=20,i=this._childToParent[e];for(;i&&n;){if(t===i)return!0;--n,i=this._childToParent[i]}}return!1},Qt.prototype.addGroupChild=function(t,e,n){let i=this._groupMap[t];if(e&&i){let o=i.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let i=this._groupMap[e];return i&&(i.parentId=t),null!=n&&n>=0?o.splice(n,0,e):o.push(e),!0}}return!1},Qt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Qt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let n=this._groupMap[t];n&&(n.parentId="");let i=this._groupMap[e];if(i){let e=i.children;if(e&&e.length){let n=e.indexOf(t);n>=0&&e.splice(n,1)}}return!0},Qt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,n=t?t.length:0;if(n){e.children=[];for(let e=0;e<n;++e){let n=t[e];this._childToParent[n]&&(this._childToParent[n]="");let i=this._groupMap[n];i&&(i.parentId="")}return!0}}return!1},Qt.prototype.setGroupChildren=function(t,e){let n=this._groupMap[t];if(n){if(Array.isArray(e)){let i=e.slice();this._ungroupChildren(i),this.removeAllChildren(t),n.children=i;let o=n.id,r=i.length;for(let t=0;t<r;++t){let e=i[t];this._childToParent[e]=o;let n=this._groupMap[e];n&&(n.parentId=o)}return!0}if(!e&&n.children.length)return this.removeAllChildren(t),!0}return!1},Qt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Qt.prototype.setGroupName=function(t,e){let n=this._groupMap[t];return!(!n||n.name===e)&&(n.name=e,!0)};let Zt=function(t){this._element=t||document.createElement("div")};l.inherits(Zt,mt),Zt.prototype._element=null,Zt.prototype._content=null,Zt.prototype._textSpan=null,Zt.prototype._nativeEvents=null,Zt._passiveEvents=null,Zt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Zt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(_t.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},Zt.prototype.addContent=function(t){return null==(t=_t.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Zt.prototype.removeContent=function(t){return null!=(t=_t.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Zt.prototype.listen=function(t,e,n){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,n);this._nativeEvents||(this._nativeEvents={});let i=this._nativeEvents[t];if(!i){if(i=new gt,this._nativeEvents[t]=i,i.dispatch=i.dispatch.bind(i),!Zt._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Zt._passiveEvents={touchstart:t,touchmove:t}}else Zt._passiveEvents={}}this._element.addEventListener(t,i.dispatch,Zt._passiveEvents[t]||!1)}i.listen(e,n)},Zt.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let n=this._nativeEvents[t];n&&n.unlisten(e)}},Zt.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Zt.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Zt.prototype.dispose=function(){this._dispose()},Zt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Zt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let n=this._customEvents[t];n&&n.setEventArgExtender(e)}},Zt.prototype.getElement=function(){return this._element},Zt.prototype.getNextSibling=function(){return this._element.nextSibling},Zt.prototype.getParent=function(){return this._element.parentNode},Zt.prototype.setParent=function(t,e){this._setParent(t,e)},Zt.prototype._setParent=function(t,e){null!==(t=_t.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Zt.prototype.insertBefore=function(t){this._insertBefore(t)},Zt.prototype._insertBefore=function(t){if(null==(t=_t.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Zt.prototype.insertAfter=function(t){(t=_t.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Zt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Zt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Zt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Zt.prototype.toggleClass=function(t,e){let n=this._element;n&&(null==e&&(e=!n.classList.contains(t)),e?n.classList.add(t):n.classList.remove(t))},Zt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Zt.prototype.getClass=function(){return this._element.className},Zt.prototype.setClass=function(t){this._element.className=t},Zt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Zt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Zt.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Zt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Zt.prototype.getStyle=function(t){return this._element.style[t]},Zt.prototype.setStyle=function(t,e){this._element.style[t]=e},Zt.prototype.setStyles=function(t){let e=this._element.style;for(let n in t)e[n]=t[n]},Zt.prototype.getId=function(){return this._element.id},Zt.prototype.setId=function(t){this._element.id=t},Zt.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Zt.prototype.getTextContent=function(){return this._element.textContent},Zt.prototype.setTextContent=function(t){this._element.textContent=t},Zt.prototype.getLeft=function(){return this._element.offsetLeft},Zt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Zt.prototype.getTop=function(){return this._element.offsetTop},Zt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Zt.prototype.getWidth=function(){return this._element.offsetWidth},Zt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Zt.prototype.getHeight=function(){return this._element.offsetHeight},Zt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Zt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Zt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Zt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Zt.prototype.getTooltip=function(){return this.getAttribute("title")},Zt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Zt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Zt.prototype.hide=function(t){this.show(!1===t)},Zt.prototype.isVisible=function(){return"none"!==this._element.style.display},Zt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Zt.prototype.disable=function(t){this.enable(!1===t)},Zt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Zt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Zt.prototype.getScrollTop=function(){return this._element.scrollTop},Zt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Zt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Zt._proto=Zt.prototype;var $t=Zt;let te=function(){this._items=[],this._element=null};l.inherits(te,$t),te.prototype._items=[],te.prototype.hasItem=function(){return!!this._items.length},te.prototype.containItem=function(t){return this._items.indexOf(t)>-1},te.prototype.insertItem=function(t,e){let n=this._items;n.indexOf(t)>-1||(n.push(t),e&&(t._order=e),n.length&&n.sort(te._iconComparer),this._updatePanelItems())},te.prototype.removeItem=function(t){let e=this._items,n=-1;if(t)for(let i=e.length;--i>=0;){let o=e[i];if("string"==typeof t){if(o.classList.contains(t)){n=i;break}}else if(o===t){n=i;break}}else n=e.length-1;let i=null;return n>-1&&(i=e.splice(n,1)[0]),this._updatePanelItems(),i},te.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},te._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},te.prototype._updatePanelItems=function(){let t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(let n=0;n<t.length;n++)e.appendChild(t[n])}};var ee=te;let ne=function(t,e){this._id=ne._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};l.inherits(ne,$t),ne.prototype._aligner=null,ne._runningId=0,ne.prototype._id=0,ne.prototype._width=-1,ne.prototype._height=-1,ne.prototype._visible=!0,ne.prototype._rawContent,ne.prototype._section=null,ne.prototype._contentLocked=!1,ne.prototype._collapsedState=0,ne.prototype._floatingPanel=null,ne.prototype._frontIcon=null,ne.prototype._tooltipInfo=null,ne.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},ne.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},ne.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},ne.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},ne.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},ne.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},ne.prototype.setParent=function(t,e){let n=_t.getElement(t);if(n){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=n.firstChild),t?n.insertBefore(this._element,t):n.appendChild(this._element)}else this.removeParent()},ne.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},ne.prototype.insertBefore=function(t){let e=_t.getElement(t);if(null==e)return void this.setParent(this.getParent());let n=e.parentNode;null!=n&&(this.initialize(),n.insertBefore(this._element,e))},ne.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},ne.prototype.getTextElement=function(){return this._textSpan},ne.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},ne.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},ne.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},ne.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},ne.prototype.fillParentWidth=function(t){return!1},ne.prototype.fillParentHeight=function(t){return!1},ne.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},ne.prototype.isVisible=function(){return this._visible},ne.prototype.getScrollLeft=function(){return 0},ne.prototype.getScrollTop=function(){return 0},ne.prototype.isEndOfHorizontalScroll=function(){return!0},ne.prototype.isEndOfVerticalScroll=function(){return!0},ne.prototype.hasElement=function(){return null!==this._element},ne.prototype.getSection=function(){return this._section},ne.prototype.initialize=function(){return null==this._aligner&&(_t.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._aligner.role="gridcell",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},ne.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},ne.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},ne.prototype.isFrozen=_t._deprecatedFunction,ne.prototype.freezeLayout=_t._deprecatedFunction,ne.prototype.setAutoContentClipping=_t._deprecatedFunction,ne.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},ne.prototype.lockContent=function(t){this._contentLocked=!1!==t},ne.prototype.reset=function(){if(!this._element)return;let t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();let n=this.blinkState;n&&(n.timerId>=0&&clearInterval(n.timerId),delete this.blinkState),delete this.trendState;let i=this.blinking;i&&(i.blinking>=0&&clearTimeout(i.blinking),i.cell=null,i.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},ne.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},ne.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},ne.prototype.insertFloatingIcon=function(t,e){if(!t)return;let n=this._floatingPanel;n||(n=this._floatingPanel=new ee),n.insertItem(t,e),n.addClass("floating-panel");let i=this._element;i.contains(n.getElement())||i.appendChild(n.getElement())},ne.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),n},ne.prototype.insertFrontIcon=function(t,e){if(!t)return;let n=this._frontIcon;n||(n=this._frontIcon=new ee),n.insertItem(t,e),n.addClass("front-panel");let i=this._element;i.contains(n.getElement())||i.insertBefore(n.getElement(),i.firstChild)},ne.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(n=e.getElement(),this._element.removeChild(n),this._frontIcon=null),n},ne.prototype.getCellId=function(){return this._id},ne.prototype.updatePadding=function(){},ne.prototype.collapse=function(t,e){let n,i=!1!==t;return n=i?e?2:1:0,this._collapsedState!==n&&(i?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=n,!0)},ne.prototype.isCollapsed=function(){return 0!==this._collapsedState},ne.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},ne.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},ne.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},ne.prototype.setTooltip=function(t){this.setTooltipInfo("userTooltip",t),this.updateTooltip()},ne.prototype.setTooltipInfo=function(t,e){let n=this._tooltipInfo;n||(n=this._tooltipInfo={}),n[t]=e},ne.prototype.updateTooltip=function(){let t=this._tooltipInfo;if(!t)return;let e="",n=null;t.clippedText&&(e=n=t.clippedTextTooltip),null==t.groupHeaderTooltip?!1!==t.columnDefault&&(null!=t.columnDefault?n=t.columnTooltip:e=t.columnTooltip):!1!==t.groupHeaderDefault&&(null!=t.groupHeaderDefault?n=t.groupHeaderTooltip:e=t.groupHeaderTooltip),null!=t.userTooltip&&(n=t.userTooltip),null==n&&(n=e),n?this.getAttribute("title")!==n&&this.setAttribute("title",n):null!=this.getAttribute("title")&&this.removeAttribute("title")},ne.prototype.getTooltipInfo=function(t){return this._tooltipInfo?this._tooltipInfo[t]:null},ne.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},ne.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},ne._proto=ne.prototype;var ie=ne;let oe=function(){this._ends=[],this._cols=[]};oe.prototype._laneCount=0,oe.prototype._defaultSize=10,oe.prototype._defaultScalability=!0,oe.prototype._homogeneous=!0,oe.prototype._visibility=!0,oe.prototype._ends,oe.prototype._cols,oe.prototype._bits=[1,2,4,8],oe.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,n=0;if(this._homogeneous){let i=this._defaultSize;e=Math.floor(t/i),n=(e+1)*i}else e=_t.upperBound(this._ends,t),n=this._ends[e];return(e>=this._laneCount||t>=n)&&(e=~e),e},oe.prototype.dispose=function(){this._cols=this._ends=null},oe.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},oe.prototype._isAtDefaultSize=function(t){let e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},oe.prototype.isHomogeneous=function(){return this._homogeneous},oe.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},oe.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},oe.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},oe.prototype.getLaneCount=function(){return this._laneCount},oe.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},oe.prototype.getDefaultLaneSize=function(){return this._defaultSize},oe.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},oe.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},oe.prototype.setLaneDefaultSize=function(t,e){if(!(t<0||t>=this._laneCount)&&e>=0){this._newColumn(t).defaultSize=e}},oe.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let n=this._cols[e];n&&(n.invisibility||(null!=n.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,n.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},oe.prototype.getDefaultScalability=function(){return this._defaultScalability},oe.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},oe.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},oe.prototype.setTrackSize=function(t){let e=0,n=0,i=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?i.push(e):n+=this._getFixedSize(t)):i.push(e)}if(i.length<=0)return null;let o=this._distributeLaneSize(t-n,i),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let n=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-n,r=!0)}}return r?s:null},oe.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,n=0;return e>0&&(t-=e,n=e*this._defaultSize),this._ends[t-1]+n},oe.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},oe.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},oe.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},oe.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let n=this._cols[t];return(null==n||n.customSize!==e)&&(n=this._newColumn(t),n.customSize=e,this._setCalculatedLaneSize(t,e))},oe.prototype.setLaneProperty=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(null==i||i[e]!==n)&&(i=this._newColumn(t),i[e]=n,!0)},oe.prototype.getLaneProperty=function(t,e){let n=this._cols[t];return n&&null!=n[e]?n[e]:null},oe.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},oe.prototype.setMinimumLaneSize=function(t,e,n){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let i=this._newColumn(t);return i.minSize=e,n&&this.getLaneScalability(t)&&(i.customSize=e),this._setCalculatedLaneSize(t)}return!1},oe.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},oe.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},oe.prototype.hideLane=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._newColumn(t),o=!i.invisibility,r=null!=n?this._bits[n]:1;return!1!==e?i.invisibility|=r:i.invisibility&=~r,o!==!i.invisibility&&this._setCalculatedLaneSize(t)},oe.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let n=this._cols[t];if(n){let t=null!=e?this._bits[e]:1;if(n.invisibility&t)return!1}}return!0},oe.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},oe.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},oe.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return(!n||n.scalability!==e)&&(n=this._newColumn(t),n.scalability=e,!0)},oe.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);let n=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,n},oe.prototype.insertLane=function(t,e){t<0&&(t=0);let n=1;if(_t.isNumber(e)){if(e<=0)return;n=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+n);else if(this._laneCount+=n,this._markDirtyIndex(t),_t.insertEmptyItems(this._cols,t,n),e){let i=t+n;for(let n=t;n<i;++n)this.deserializeLane(n,e)}},oe.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t===e)return;let n=t<e?t:e;this._markDirtyIndex(n),_t.moveArrayItem(this._cols,t,e)},oe.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let n=this._cols[t];return n?(e.size=n.customSize,e.minSize=n.minSize,e.visible=!n.invisibility,e.scalable=n.scalability,e):e},oe.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let n=e.size;null!=n&&this.setLaneSize(t,n),n=e.minSize,null!=n&&this.setMinimumLaneSize(t,n),n=e.visible,null!=n&&this.showLane(t,n),n=e.scalable,null!=n&&this.setLaneScalability(t,n)},oe.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let e=0,n=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)n+=this.getLaneSize(e),this._ends[e]=n},oe.prototype._setCalculatedLaneSize=function(t,e){let n=this._cols[t];if(this._visibility&&!n.invisibility){if(null==e&&(e=null!=n.customSize?n.customSize:this._defaultSize),!n.scalability){let t=null!=n.minSize?n.minSize:0;e<t&&(e=t)}}else e=0;return n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},oe.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},oe.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},oe.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},oe.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let n=0,i=0,o=0,r=0,s=[],l=[],a=[];for(n=e.length;--n>=0;)o=e[n],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),i+=l[o];let u=!0;for(;u;)for(u=!1,n=e.length;--n>=0;){o=e[n];let h=s[o],p=l[o];r=t*p/i,r<=h&&(u=!0,a[o]=h,t-=h,i-=p,e.splice(n,1))}let h=e.length-1,p=0,d=0;for(n=h;--n>=0;){o=e[n],r=t*l[o]/i;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},oe.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},oe.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},oe.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let n=t.getLaneCount(),i=this.getLaneCount(),o=e+n;o>i&&(o=i);let r=0;for(let n=e;n<o;++n){let e=t.getLaneSize(r++),i=this._newColumn(n);i.customSize!==e&&(i.customSize=e,i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(n)))}};var re=oe;let se=function(){};se.prototype.hitTest=function(t,e,n){},se.prototype.hitTestX=function(t){},se.prototype.hitTestY=function(t){},se.prototype.getDefaultColumnWidth=function(){},se.prototype.setDefaultColumnWidth=function(t){},se.prototype.getDefaultRowHeight=function(){},se.prototype.setDefaultRowHeight=function(t){},se.prototype.getColumnWidth=function(t){},se.prototype.setColumnWidth=function(t,e){},se.prototype.getRowHeight=function(t){},se.prototype.setRowHeight=function(t,e){},se.prototype.isColumnVisible=function(t){},se.prototype.hideColumn=function(t,e){},se.prototype.isRowVisible=function(t){},se.prototype.hideRow=function(t,e){},se.prototype.getMinimumColumnWidth=function(t){},se.prototype.setMinimumColumnWidth=function(t,e){},se.prototype.getMinimumRowHeight=function(t){},se.prototype.setMinimumRowHeight=function(t,e){},se.prototype.getCellLeft=function(t){},se.prototype.getCellTop=function(t){},se.prototype.getCellWidth=function(t,e){},se.prototype.getCellHeight=function(t,e){},se.prototype.hasCellSpan=function(){},se.prototype.getCellRowSpan=function(t,e){},se.prototype.setCellRowSpan=function(t,e,n){},se.prototype.getCellColSpan=function(t,e){},se.prototype.setCellColSpan=function(t,e,n){},se.prototype.clearCellSpans=function(){},se.prototype.clearColumnSpans=function(t){},se.prototype.clearColumnCustomizations=function(){},se.prototype.clearRowCustomizations=function(){},se.prototype.getColumnScalability=function(t){},se.prototype.setColumnScalability=function(t,e){},se.prototype.getRowScalability=function(t){},se.prototype.setRowScalability=function(t,e){},se.prototype.getCell=function(t,e,n){},se.prototype.getCellContent=function(t,e){},se.prototype.setCellContent=function(t,e,n){},se.prototype.getColumn=function(t){},se.prototype.getColumnCount=function(){},se.prototype.setColumnCount=function(t){},se.prototype.getRowCount=function(){},se.prototype.setRowCount=function(t,e){},se.prototype.getVisibleRowCount=function(){},se.prototype.addRow=function(t){},se.prototype.removeRow=function(t){},se.prototype.setBorders=function(t,e,n,i){},se.prototype.getColumnStyle=function(t,e){},se.prototype.setColumnStyle=function(t,e,n){},se.prototype.enableColumnClass=function(t,e,n){},se.prototype.hasColumnClass=function(t,e){},se.prototype.enableRowClass=function(t,e,n){},se.prototype.setRowStyle=function(t,e,n,i){},se.prototype.getRelativePosition=function(t){},se.prototype.getContentWidth=function(){},se.prototype.getContentHeight=function(){},se.prototype.getCellsByRowIndex=function(t){},se.prototype.disableHorizontalGridLine=function(t){},se.prototype.disableVerticalGridLine=function(t){},se.prototype.enableShading=function(t){},se.prototype.setTransposedShading=function(t){},se.prototype.enableRowHighlighting=function(t){},se.prototype.getRowHighlight=function(){},se.prototype.setRowHighlight=function(t){},se.prototype.getSelectedRows=function(){},se.prototype.getSelectedRowCount=function(){},se.prototype.isSelectedRow=function(t){},se.prototype.getRowAnchor=function(){},se.prototype.setRowAnchor=function(t){},se.prototype.setSelectedRow=function(t,e){},se.prototype.selectSingleRow=function(t){},se.prototype.selectRowRange=function(t,e){},se.prototype.clearSelectedRows=function(){},se.prototype.getFirstSelectedRow=function(){},se.prototype.getLastSelectedRow=function(){},se.prototype.activateColumn=function(t,e){},se.prototype.activateRows=function(t,e,n){},se.prototype.moveRowsToTop=function(t){},se.prototype.getFirstIndexInView=function(){},se.prototype.getLastIndexInView=function(){},se.prototype.isInCurrentView=function(t){},se.prototype.getFrozenLayout=function(){},se.prototype.setFrozenLayout=function(t){},se.prototype.insertColumn=function(t,e){},se.prototype.removeColumnAt=function(t){},se.prototype.moveColumn=function(t,e){},se.prototype.enableRowVirtualization=function(t){},se.prototype.enableColumnVirtualization=function(t){},se.prototype.getColumnIndex=function(t){},se.prototype.getCellIndex=function(t,e){},se.prototype.getIndex=function(){},se.prototype.setIndex=function(t){},se.prototype.getRowOffset=function(){},se.prototype.setRowOffset=function(t){},se.prototype.updateLayout=function(){},se.prototype.stretchCell=function(t,e,n,i){},se.prototype.unstretchCell=function(t,e){},se.prototype.unstretchAllCells=function(){},se.prototype.getStretchedCell=function(t,e){},se.prototype.getStretchedCells=function(){},se.prototype.updateStretchedCells=function(){},se.prototype.getColumnHost=function(){},se.prototype.setHidingMethod=function(t){},se.prototype.getHidingMethod=function(){},se.prototype.setColumnVisibility=function(t,e,n){},se.prototype.getRowLayout=function(){},se.prototype.reserveRightSpace=function(t){},se.prototype.getReservedSpace=function(){},se.prototype.getComputedStyle=function(){},se.prototype.isColumnActive=function(t){},se.prototype.setRowAttributes=function(t,e){},se.prototype.getContextRow=function(t){},se.prototype.selectColumn=function(t,e){},se.prototype.isSelectedColumn=function(t){},se.prototype.selectCell=function(t,e,n){},se.prototype.setCellBounds=function(t,e,n,i){},se.prototype.getHorizontalLayout=function(){},se.prototype.calculateColumnBounds=function(t,e,n,i){},se.prototype.updateColumnBounds=function(t,e,n){},se.prototype.updateColumnSeparators=function(){};let le=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};l.inherits(le,$t),le.prototype._nextSibling=null,le.prototype._parent=null,le.prototype._section=null,le.prototype._cells=null,le.prototype._cellStart=0,le.prototype._cellEnd=0,le.prototype._autoStyleUpdating=!1,le.prototype._deactivation=!1,le.prototype._sizeClasses=null,le.prototype._colLeft=0,le.prototype._absolute=!1,le.prototype._scrollFrame=null,le.prototype._invisibility=0,le.prototype._bits=[1,2,4,8],le.prototype._pinned=!0,le.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},le.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},le.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},le.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},le.prototype.setStyle=function(t,e){let n=this._element;n.style[t]=e,n.style.backgroundColor?n.classList.contains("no-shading")||n.classList.add("no-shading"):n.classList.contains("no-shading")&&n.classList.remove("no-shading")},le.prototype.setStyles=function(t){let e=this._element,n=e.style;for(let e in t)n[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},le.prototype.show=function(t){this.setVisibility(0,!1!==t)},le.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,n=0;t>0&&t<=24?n=3:t>24&&t<=40?n=2:t>40&&t<60&&(n=1);let i=this._sizeClasses;if(i){if(i.length>n){for(e=i.length;--e>=n;)this.removeClass(i[e]);i.length=n}n||(this._sizeClasses=null)}if(n)for(i||(i=[],this._sizeClasses=i),e=i.length;e<n;++e)i[e]=le._sizeClasses[e],this.addClass(i[e]);return this.setVisibility(1,t>0),!0},le._sizeClasses=["small-col","very-small-col","tiny-col"],le.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},le.prototype.getParent=function(){return this._parent},le.prototype.setParent=function(t,e){if(!this._element)return;this._parent=_t.getElement(t);let n=this._section?this._section.getHidingMethod():"";this._invisibility&&!n||this._setParent(this._parent,e)},le.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},le.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},le.prototype.setNextSibling=function(t){this._nextSibling=t},le.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},le.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},le.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},le.prototype.deactivate=function(t){this.activate(!1===t)},le.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new ie(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},le.prototype.getCell=function(t){return this._cells[t]||null},le.prototype.collapseCells=function(t,e,n,i,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!i&&(r|=s.collapse(n,o));for(let i=1;i<e&&(s=this._cells[t+i],s);++i)r|=s.collapse(n,o);r&&(n?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},le.prototype.uncollapseAllCells=_t._deprecatedFunction,le.prototype.activateCells=function(t,e){let n,i=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let i=this._cellEnd-e;if(i>0){for(n=this._cellEnd;--n>=e;)this._cells[n].removeParent();return void(this._cellEnd=e)}if(!(i<0))return;t=this._cellEnd,this._cellEnd=e}else{for(n=this._cellEnd;--n>=this._cellStart;)this._cells[n].removeParent();this._cellStart=t,this._cellEnd=e}for(n=t;n<e;++n){let t=this._cells[n];t.isKeptInDoc()&&(t.initialize(),i.appendChild(t.getElement()))}},le.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let n=0;n<t;++n){let t=this._cells[n];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=_t.cycleArray(this._cells,t)},le.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let n=this._cells[e];n.isKeptInDoc()?t.appendChild(n.getElement()):this._hasCollapsedCells=!0}},le.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},le.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e){if(this._cells[e].getElement()===t)return e}return-1},le.prototype.getSection=function(){return this._section},le.prototype.log=function(){let t=[],e=this._cells.length;for(let n=0;n<e;++n)t.push(this._cells[n].getTextContent());return t},le.prototype.getVisibility=function(){return!this._invisibility},le.prototype.setVisibility=function(t,e){let n=!this._invisibility,i=this._bits[t]||1;e?this._invisibility&=~i:this._invisibility|=i;let o=!this._invisibility;if(n!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},le.prototype.updateLayout=function(){},le.prototype.setScrollState=function(t,e,n){this._scrollFrame=t,this.enableAbsolutePosition(n),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},le._proto=le.prototype;var ae=le;let ue=function(){this._items=[]};ue.prototype._items=null,ue.prototype.dispose=function(){this._items=null},ue.prototype.setItemCount=function(t){let e=this._items,n=e.length;if(n!==t)for(e.length=t;n<t;)e[n++]={}},ue.prototype.getItem=function(t){return this._items[t]||null},ue.prototype.moveItemsToTop=function(t){this._items=_t.cycleArray(this._items,t)};var he=ue;let pe=function(t,e,n){t.setTop(e.getLaneStart(n)),t.setHeight(e.getLaneSize(n))},de=function(t,e,n,i){if(n){let o=e.getLaneStart(n);t.setLeft(o),t.setWidth(i-o)}else t.setStyle("left",""),t.setWidth(i)},ce=function(t,e,n){this._trackX=t,this._trackY=e,this._section=n,this._cells=[]};ce.prototype._trackX,ce.prototype._trackY,ce.prototype._section,ce.prototype._cells,ce.prototype._activeCount=0,ce.prototype._stretchSize=0,ce.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let n=t[e];n&&n.dispose()}}t.length=0},ce.prototype.setStretchSize=function(t){this._stretchSize=t},ce.prototype.getStretchSize=function(){return this._stretchSize},ce.prototype.setCellCount=function(t){let e=this._cells,n=e.length;if(n<t)for(e.length=t;n<t;)e[n++]=null;else if(n>t){for(;--n>=t;){let t=e[n];t&&t.dispose()}e.length=t}},ce.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ce.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},ce.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ce.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];if(n&&n.getParent()&&n.getElement()===t)return i}}}return-1},ce.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let n=this._cells[t]||null;n||(n=new ie(null,this._section),n.addClass("tr-stretched"),n.stretched=!0,this._cells[t]=n);let i=n.getElement();i.stretched=!0,i._colIndex!==e&&(i._colIndex=e,e>0?i.classList.add("right-stretching"):i.classList.remove("right-stretching")),i._rowIndex!==t&&(i._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return de(n,this._trackX,e,o),pe(n,this._trackY,t),n},ce.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ce.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let n=t[e];n&&n.setParent(null)}}},ce.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._trackY,r=this._stretchSize||i.getTrackSize();for(let s=0;s<n;++s){let n=e[s];n&&n.getParent()&&(++t,de(n,i,n.getElement()._colIndex,r),pe(n,o,s))}this._activeCount=t}},ce.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._stretchSize||i.getTrackSize();for(let r=0;r<n;++r){let n=e[r];n&&n.getParent()&&(++t,de(n,i,n.getElement()._colIndex,o))}this._activeCount=t}},ce.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackY;for(let o=0;o<n;++o){let n=e[o];n&&n.getParent()&&(++t,pe(n,i,o))}this._activeCount=t}},ce.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=_t.cycleArray(this._cells,t),this.updateYAxis())};var _e=ce;let fe=function(t,e){this.indexX=t,this.indexY=e};fe.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},fe.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},fe.prototype.register=function(t,e){this._register(t,e,!0)},fe.prototype.unregister=function(t,e){this._register(t,e,!1)},fe.prototype._register=function(t,e,n){let i=t.indexOf(this);n?i<0&&t.push(this):i>=0&&t.splice(i,1);let o=n?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let n=this.indexY;n<s;++n)e[t+","+n]=o},fe.prototype.indexX,fe.prototype.indexY,fe.prototype.colSpan=1,fe.prototype.rowSpan=1,fe.prototype.prevColSpan=1,fe.prototype.prevRowSpan=1,fe.prototype.retVal=0;var ge=fe;let ye=function(){this._spans=[],this._occupiedMap={}};ye.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},ye.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},ye.prototype._mapCellSpans=function(){let t,e,n=this._spans;for(this._spans=[],this._occupiedMap={},t=n.length;--t>=0;)e=n[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},ye.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let n=!1;for(let i=this._spans.length;--i>=0;){let o=this._spans[i];o.indexX>=t&&(n=!0,o.indexX+=e)}return!(!n||this._frozenMapping)&&(this._mapCellSpans(),!0)},ye.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let n=t+","+e,i=this._occupiedMap[n];return!i||i.isOccupiedIndices(t,e)?null:(i.unregister(this._spans,this._occupiedMap),i)},ye.prototype.removeSpanByColIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexX===t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},ye.prototype.removeSpanStartedFromRowIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexY>=t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},ye.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},ye.prototype.hasSpan=function(){return this._spans.length>0},ye.prototype.getSpan=function(t,e){let n=this.getOccupyingSpan(t,e);return n&&n.isSpanIndices(t,e)?n:null},ye.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},ye.prototype.getAllSpans=function(){return this._spans},ye.prototype.getColSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexX-t:n.colSpan},ye.prototype.getRowSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexY-e:n.rowSpan},ye.prototype.setColSpan=function(t,e,n){return this._updateSpan(t,e,!0,n)},ye.prototype.setRowSpan=function(t,e,n){return this._updateSpan(t,e,!1,n)},ye.prototype._updateSpan=function(t,e,n,i){i<1&&(i=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(n){if(c===i)return o;if(c>i)p=t+i,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+i}s=e+_}else{if(_===i)return o;if(_>i)d=e+i,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+i}r=t+c}if(f){let n=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;n.push(a)}for(null==o&&(o=new ge(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=n.length;--u>=0;)this._occupiedMap[n[u]]=o}else{if(n?i+_<=2:i+c<=2){a=t+","+e;let n=this._spans.indexOf(o);this._spans.splice(n,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return n?(o.prevColSpan=o.colSpan,o.colSpan=i):(o.prevRowSpan=o.rowSpan,o.rowSpan=i),o.retVal=f?1:-1,o},ye.prototype._spans,ye.prototype._occupiedMap,ye.prototype._frozenMapping=!1;var me=ye;let Ce=function(){this._selections=[]};Ce.prototype.clone=function(){let t=new Ce;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},Ce.prototype.toString=function(){return this._selections.join(", ")},Ce.prototype.select=function(t){return!(t<0)&&(!!this._select(t)&&(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),!0))},Ce.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},Ce.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,n=this._selections;for(let i=t;i<=e;++i)n[i]&&(n[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},Ce.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},Ce.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},Ce.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let n=t,i=n+e;if(e<0&&(i=n+1,n=i+e),!(n>=i)){this._anchor=t,(this._firstIndex<0||n<this._firstIndex)&&(this._firstIndex=n),(this._lastIndex<0||i>=this._lastIndex)&&(this._lastIndex=i-1);for(let t=n;t<i;++t)this._select(t)}},Ce.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let n=t+e;if(e<0&&(n=t+1,t=n+e),this._firstIndex>=t&&this._lastIndex<n)return void this.clearAllSelections();this._anchor>=t&&this._anchor<n&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<n&&(this._firstIndex=this._findNextSelection(n-1)),this._lastIndex>=t&&this._lastIndex<n&&(this._lastIndex=this._findPrevSelection(t));let i=0;for(i=t;i<n;++i)this._selections[i]&&(this._selections[i]=!1,--this._count)},Ce.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let n=t+e;if(e<0&&(n=t+1,t=n+e),n<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<n;++e)if(this._selections[e])return!0;return!1},Ce.prototype.getSelection=function(t){return!0===this._selections[t]},Ce.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},Ce.prototype.getSelectionAnchor=function(){return this._anchor},Ce.prototype.setSelectionAnchor=function(t){this._anchor=t},Ce.prototype.getSelectionCount=function(){return this._count},Ce.prototype.getFirstSelectedIndex=function(){return this._firstIndex},Ce.prototype.getLastSelectedIndex=function(){return this._lastIndex},Ce.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,n=this._selections,i=this._lastIndex;for(let o=this._firstIndex;o<=i;++o)n[o]&&(t[e++]=o);return t}return[]},Ce.prototype.getConnectedRanges=function(t,e){if(this._count>0){let n=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let i=null;for(let o=t;o<e;++o)this._selections[o]?i||(i=[o,-1]):i&&(i[1]=o-1,n.push(i),i=null);return i&&(i[1]=this._lastIndex,n.push(i),i=null),n}return[]},Ce.prototype.getSelectionMap=function(){return this._selections},Ce.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},Ce.prototype.copyFrom=function(t,e,n,i){if(i<=0)return;let o=e+n;if(null!=t)if(!1!==t.hasSelection(e,i)){for(let n=0;n<i;++n)t._selections[e+n]?this.select(o+n):this.deselect(o+n);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+i&&(this._anchor=t._anchor+n)}else this.deselectRange(o,i);else this.deselectRange(o,i)},Ce.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},Ce.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},Ce.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},Ce.prototype._selections=null,Ce.prototype._count=0,Ce.prototype._anchor=-1,Ce.prototype._firstIndex=-1,Ce.prototype._lastIndex=-1;var Se=Ce;let we=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};we.prototype._func=null,we.prototype._delay=0,we.prototype._timerId=0,we.prototype._pending=!1,we.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},we.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},we.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},we._proto=we.prototype;var be=we;let Re=function(){let t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new be(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),Re._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};l.inherits(Re,$t),Re.prototype._vertical=!0,Re.prototype._step=0,Re.prototype._parentNode=null,Re.prototype._hostClassName="",Re.prototype._trackContent=null,Re.prototype._panes=null,Re.prototype._paneSliders=null,Re.prototype._enabled=!0,Re.prototype._active=!1,Re.prototype._isFrozen=!1,Re.prototype._otherScrollbar=null,Re.prototype._autoHideScrollbar=!0,Re.prototype._trackSize=120,Re.prototype._tContentSize=0,Re.prototype._tScrollVal=0,Re.prototype._tPercentVal=0,Re.prototype._paneSize=0,Re.prototype._pContentSize=0,Re.prototype._pScrollVal=0,Re.prototype._footerCount=0,Re.prototype._fadingId=0,Re.prototype._postponeFading=!1,Re.prototype._layoutChanged=!1,Re.prototype._contentDirty=!0,Re.prototype._layoutDirty=!0,Re.prototype._touchInput=!0,Re.prototype._swiping=!1,Re.prototype._touchDrag=!1,Re.prototype._startPos,Re.prototype._endPos,Re.prototype._smoothing=!0,Re.prototype._smoothingId=0,Re.prototype._smoothingSpeed=0,Re.prototype._wheelScrolling="",Re.prototype._mouseWheelLogic=null,Re.prototype._onThicknessChanged=null,Re._trackThickness=0,Re._queryTimeout=0,Re._queryStarted=!1,Re._outerDummy=null,Re._innerDummy=null,Re._listeners=null,Re.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},Re._queryNativeTrackThickness=function(t){if(Re._queryStarted||Re._repeatQuery(),t&&Re._trackThickness<=0){let e=Re._listeners;e||(e=Re._listeners=[]),e.push(t)}},Re._repeatQuery=function(){Re._queryStarted=!0,Re._retrieveNativeTrackThinkness()||(Re._queryTimeout+=100,Re._queryTimeout<3e3?setTimeout(Re._repeatQuery,Re._queryTimeout):(Re._trackThickness=13,Re._clearStaticResources()))},Re._retrieveNativeTrackThinkness=function(){if(Re._trackThickness>0)return!0;let t=Re._innerDummy,e=Re._outerDummy;t||(t=Re._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=Re._outerDummy=document.createElement("div"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);let n=t.offsetWidth;e.style.overflow="scroll";let i=t.offsetWidth;return n==i&&(i=e.clientWidth),document.body.removeChild(e),(Re._trackThickness=n-i)>0&&(Re._clearStaticResources(),!0)},Re._clearStaticResources=function(){Re._innerDummy=Re._outerDummy=null;let t=Re._listeners;if(t){Re._listeners=null;let e={};for(let n=t.length;--n>=0;)t[n](e)}},Re.updateTrackThickness=function(){Re._trackThickness=0,Re._queryTimeout=0,Re._queryStarted=!1,Re._queryNativeTrackThickness()},Re.prototype.dispose=function(){let t=Re._listeners;if(t){let e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},Re.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},Re.prototype.getParent=function(){return this._parentNode},Re.prototype.setParent=function(t,e){let n=_t.getElement(t),i=this._parentNode!==n;i&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(n,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=n,i&&this.addWheelListener(this._parentNode)},Re.prototype.attachToExternalElement=function(t){this.setParent(t);let e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},Re.prototype._onActiveStateChange=function(){let t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);let n=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(n,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},Re.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},Re.prototype.isActive=function(){return this._active},Re.prototype.isEnabled=function(){return this._enabled},Re.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},Re.prototype.disable=function(t){this.enable(!1===t)},Re.prototype.getTrackSize=function(){return this._trackSize},Re.prototype.getPaneSize=function(){return this._paneSize},Re.prototype.getContentSize=function(){return this._pContentSize},Re.prototype.getTrackThickness=function(){return Re._trackThickness},Re.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},Re.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},Re.prototype.calculateContentSize=function(){return 0},Re.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},Re.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},Re.prototype.invalidateContent=function(){this._contentDirty=!0},Re.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),n=this._pScrollVal;return 0===n||n>0&&e>0&&n<e},Re.prototype.flash=function(){this.update(),this._flash()},Re.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},Re.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let n=!1;this._pScrollVal!==t&&(this._pScrollVal=t,n=!0),this._setTrackScrollVal(t),n?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})},Re.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let n=this._step;if(n){if((t=Math.round(t/n)*n)-n/2<=0)return 0;if(t+n/2>=e)return e}return Math.round(t)},Re.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let n=this.getScrollGap();return e===n?t:this._tPercentVal*n},Re.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),n=0;if(e>0){if(t>0){let i=this.getScrollGap();n=e===i?t:t/i*e,n=Math.round(n)}n>=e&&(n=e)}if(n!==this._tScrollVal){this._tScrollVal=n,this._tPercentVal=e?n/e:0;let t=this._element;return this._vertical?t.scrollTop=n:t.scrollLeft=n,!0}return!1},Re.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},Re.prototype._getScrollValue=function(){return this._pScrollVal},Re.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},Re.prototype._isStartOfScroll=function(){return!this._pScrollVal},Re.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},Re.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},Re.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let n=e.getElement();for(;null!==n.firstChild;)n.removeChild(n.firstChild)}},Re.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","-1"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},Re.prototype.disableTouchInput=function(t){this._touchInput=!1===t},Re.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},Re.prototype.getAutoHide=function(){return this._autoHideScrollbar},Re.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},Re.prototype.setFooterCount=function(t){this._footerCount=t},Re.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},Re.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let e=this.getTrackSize(),n=this.getPaneSize();if(this._tContentSize=this._pContentSize/n*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(n);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(n)}this._scrollTo(this._pScrollVal,!0)},Re.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},Re._preventVScrolling=function(t){t.currentTarget.scrollTop=0},Re._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},Re.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new $t(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",Re._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",Re._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let n=new $t(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},Re.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},Re.prototype._onTrackScroll=function(t){if(!this._element)return;let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,n=this._convertTrackToPane(e);n=this._calcProperScrollValue(n),n!==this._pScrollVal&&(this._pScrollVal=n,this._dispatchScrollEvent(t))},Re.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},Re.prototype._setSliderPosition=function(t,e){let n="",i="",o=this._vertical?"top":"left";t&&(e?i=t+"px":(n=this._vertical?"translateY":"translateX",n+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=n,s[o]=i)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},Re.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},Re.prototype._onKeyDown=function(t){if(this._isFrozen)return void _t._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let e=this.getScrollGap(),n=Math.round(.07*e);n<10?n=10:n>100&&(n=100),37!==t.keyCode&&38!==t.keyCode||(n*=-1),this._scroll(n),_t._preventDefault(t)}},Re.prototype._onTouchStart=function(t){this._isFrozen?_t._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},Re.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void _t._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let n=e._startPos,i=e._endPos;e._getTouchInfo(t,i);let o=this._vertical?n.y-i.y:n.x-i.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(n.scrollValue+o);else{i.timeStamp-n.timeStamp>30&&(e._touchDrag=!0)}t.cancelable&&t.preventDefault()}},Re.prototype._onTouchEnd=function(t){if(this._isFrozen)_t._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,n=this._getTouchInfo(t,this._endPos),i=n.timeStamp-e.timeStamp,o=this._vertical?e.y-n.y:e.x-n.x;this._smoothingSpeed=30*o/i,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},Re.prototype._getTouchInfo=function(t,e){let n=t.changedTouches[0];return e||(e={}),e.x=n.pageX,e.y=n.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},Re.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},Re.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},Re.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},Re.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},Re.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},Re.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},Re.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},Re.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},Re.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void _t._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(_t._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},Re.prototype.setScrollingStep=function(t){this._step=t>0?t:0},Re.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},Re.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},Re._proto=Re.prototype;var ve=Re;let Ie=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",Ie.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};l.inherits(Ie,ve),Ie.prototype._pinnedLeftColumnCount=0,Ie.prototype._pinnedRightColumnCount=0,Ie.prototype.setScrollContent=function(t,e,n,i){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=n>=0?n:0,this._pinnedRightColumnCount=i>0?i:0;let r=e[0],s=r.getColumnCount(),l=s-i;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let i,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(i=0;i<n;++i)o=r.getColumn(i),o.setScrollState(h,null,!1);let d=r.getColumnHost();a.setParent(d);let c=[],_=[];for(i=n;i<l;++i)o=r.getColumn(i),o.setScrollState(null,p,this.isActive()),c.push(o),_.push(o.getElement());for(i=l;i<s;++i)o=r.getColumn(i),o.setScrollState(null,null,!1);let f=r.getReservedSpace();f&&(this.isActive()&&!this._pinnedRightColumnCount?(u.addContent(f),_.push(f)):d.appendChild(f),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=c,u._content=_}this.invalidateContent()},Ie.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},Ie.prototype.getWidth=function(){return this.getPaneSize()},Ie.prototype.getScrollLeft=function(){return this._getScrollValue()},Ie.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},Ie.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},Ie.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},Ie.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},Ie.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},Ie.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let n=t._content;for(let t=n.length;--t>=0;){let i=n[t],o=i?i.style.width:0;o&&(e+=parseFloat(o))}}return e},Ie.prototype.calculateContentSize=function(){return this.getContentWidth()},Ie.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},Ie.prototype._onActivated=function(t){this._updateActivation(!0)},Ie.prototype._onDeactivated=function(t){this._updateActivation(!1)},Ie.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let n=0;n<e;++n){let e=this._paneSliders[n]._columns,i=e?e.length:0;for(let n=0;n<i;++n){let i=e[n];i.getElement()&&i.enableAbsolutePosition(t)}}},Ie._proto=Ie.prototype;var De=Ie;let xe=function(t,e){return t>e?e:t<0?0:t},Ae=function(t){this._boundLayer=t.boundLayer,this._layoutX=t.layoutX,this._layoutY=t.layoutY,this._hscrollbar=t.hscrollbar,this._calculateColumnBounds=t.calculateColumnBounds};Ae.prototype._boundLayer=null,Ae.prototype._layoutX,Ae.prototype._layoutY,Ae.prototype._hscrollbar,Ae.prototype._calculateColumnBounds,Ae.prototype._cellBound=null,Ae.prototype._cbLftIdx=0,Ae.prototype._cbRgtIdx=0,Ae.prototype._cbTopIdx=0,Ae.prototype._cbBtmIdx=0,Ae.prototype.dispose=function(){let t=this._cellBound;if(t){let e=t.parentNode;e&&e.removeChild(t),this._cellBound=null}this._boundLayer=null,this._layoutX=null,this._layoutY=null,this._hscrollbar=null,this._calculateColumnBounds=null},Ae.prototype.setCellBounds=function(t,e,n,i,o){let r=this._cellBound;r||(r=this._cellBound=document.createElement("div"),r.className="selection-bound");let s=t+n,l=e+i,a=this._layoutY.getLaneCount();this._cbLftIdx=xe(t,o),this._cbRgtIdx=xe(s,o),this._cbTopIdx=xe(e,a),this._cbBtmIdx=xe(l,a),this.updateCellBounds()},Ae.prototype.updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,n,i,o,r=this._layoutX,s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=n=i=o=0,l<a&&u<h&&(e=r.getLaneStart(l),n=r.getLaneEnd(a-1),i=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=n-e,d=o-i,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this._calculateColumnBounds(l,a-1,t,c),e=t[0],n=t[1],p=n-e}if(p>0)t.style.left=e+"px",t.style.top=i+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{let e=t.parentNode;e&&e.removeChild(t)}},Ae._proto=Ae.prototype;var Le=Ae;let Te=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new re,e._trackY=new re,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new me,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new he,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new _e(e._trackX,e._trackY,e),e._selectionList=new Se,t&&(e._virOwner=t.owner||null,t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar)),e._virOwner||e._element.classList.add("section"),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Te,$t),Te.prototype._index=-1,Te.prototype._availableRowCount=0,Te.prototype._activeRow=0,Te.prototype._activeRowEnd=0,Te.prototype._colCount=0,Te.prototype._rowCount=0,Te.prototype._hiddenRowCount=0,Te.prototype._trackX,Te.prototype._trackY,Te.prototype._cellSpans,Te.prototype._columns,Te.prototype._firstColumn,Te.prototype._lastColumn,Te.prototype._rightSpace,Te.prototype._rightSpaceSize=0,Te.prototype._frozenLayout=!1,Te.prototype._rowHighlightEnabled=!1,Te.prototype._rowHighlightIndex=-1,Te.prototype._highlightedCells,Te.prototype._coverLayer=null,Te.prototype._stretchedCells=null,Te.prototype._ctx=null,Te.prototype._selectionList,Te.prototype._colVir=!1,Te.prototype._initialized=!1,Te.prototype._hidingMethod="",Te.prototype._virOwner=null,Te.prototype._transformIETimer=0,Te.prototype._ctxRows,Te.prototype._boundLayer=null,Te.prototype._colBounds=null,Te.prototype._colBoundCache=null,Te.prototype._colSelDirty=!1,Te.prototype._hscrollbar=null,Te.prototype._leftColumnSeparator=null,Te.prototype._rightColumnSeparator=null,Te.prototype._cellBoundPainter=null,Te.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._cellBoundPainter&&this._cellBoundPainter.dispose(),this._dispose()},Te.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},Te.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},Te.prototype.setWidth=function(t){if(t<0)return!1;return null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0)},Te.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},Te.prototype.setHeight=function(t){if(t<0)return!1;return null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0},Te.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},Te.prototype.hitTest=function(t,e,n){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;let i=this._trackX.hitTest(t);if(i<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=i,r.rowIndex=o,!0!==n){let t=this._cellSpans.getOccupyingSpan(i,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},Te.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},Te.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},Te.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},Te.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},Te.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},Te.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},Te.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},Te.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},Te.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},Te.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},Te.prototype._startBindingSession=function(t){},Te.prototype._getTempRowHeights=function(){return null},Te.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},Te.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let n=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),n&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),n},Te.prototype._updateRowHeights=function(t,e){let n=0;for(let i=0;i<this._rowCount;++i){let o=t.getLaneSize(e);n|=this._trackY.setLaneSize(i,o),++e}return this._syncLayoutToRows(0,this._rowCount),n},Te.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},Te.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},Te.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},Te.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Te.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},Te.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},Te.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},Te.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Te.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},Te.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},Te.prototype.getCellWidth=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackX.getLaneStart(n.indexX);return this._trackX.getLaneEnd(n.indexX+n.colSpan-1)-t}return this.getColumnWidth(t)},Te.prototype.getCellHeight=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackY.getLaneStart(n.indexY);return this._trackY.getLaneEnd(n.indexY+n.rowSpan-1)-t}return this.getRowHeight(e)},Te.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},Te.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},Te.prototype.setCellRowSpan=function(t,e,n){let i=this._cellSpans.setRowSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Te.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},Te.prototype.setCellColSpan=function(t,e,n){let i=this._cellSpans.setColSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Te.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Te.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let n=e[t];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Te.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},Te.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},Te.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},Te.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},Te.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},Te.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},Te.prototype.getCell=function(t,e,n){if(n&&this._cellSpans.hasSpan()){let n=this._cellSpans.getColSpan(t,e),i=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),i<0&&(e+=i)}return this._getCell(t,e)},Te.prototype.getCellContent=function(t,e){let n=this.getCell(t,e);return null!==n?n.getContent():null},Te.prototype.setCellContent=function(t,e,n){let i=this.getCell(t,e);return null==i?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):i.setContent(n)},Te.prototype.getColumnCount=function(){return this._colCount},Te.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let n=0,i=null;if(e>t)for(n=e;--n>=t;)i=this._columns.pop(),i.dispose(),i===this._firstColumn&&(this._firstColumn=null),i===this._lastColumn&&(this._lastColumn=null);else for(n=e;n<t;++n)i=this._newColumn(n);for(this._updateColumnIndices(),n=e;n<t;++n)this._columns[n].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},Te.prototype.getRowCount=function(){return this._rowCount},Te.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let n,i=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),n=0;n<this._colCount;++n)this._columns[n].setCellCount(t);if(i>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(let e=t;e<i;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(i,t);let o={};o.prevCount=i,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),i<t&&this._insertCells(0,this._rowCount)},Te.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},Te.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},Te.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},Te.prototype.setBorders=function(t,e,n,i){},Te.prototype.getColumnStyle=function(t,e){let n=this._columns[t];return n?n.getStyle(e):null},Te.prototype.setColumnStyle=function(t,e,n){let i=this._columns[t];i&&i.setStyle(e,n)},Te.prototype.enableColumnClass=function(t,e,n){let i=this._columns[t];i&&i.enableClass(e,n)},Te.prototype.hasColumnClass=function(t,e){let n=this._columns[t];return!!n&&n.hasClass(e)},Te.prototype.enableRowClass=function(t,e,n){if(t>=0&&t<this._rowCount)for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).enableClass(e,n)},Te.prototype.setRowStyle=function(t,e,n,i){if(t>=0&&t<this._rowCount){n&&(null==i||i)||(n="");for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).setStyle(e,n)}},Te.prototype.getRelativePosition=function(t){return _t.getRelativePosition(t,this._element)},Te.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},Te.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},Te.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let n=0;n<this._colCount;++n)e[n]=this._columns[n].getCell(t);return e},Te.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},Te.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},Te.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},Te.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},Te.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},Te.prototype.getRowHighlight=function(){return this._rowHighlightIndex},Te.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let n=this._columns[e].getCell(t);this._highlightedCells[e]=n,n.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Te.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Te.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Te.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Te.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},Te.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},Te.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(let n=0;n<e;++n)this._addSelectionUI(n+t)}},Te.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let n=0;n<t;++n)this._removeSelectionUI(e[n]);return t}return 0},Te.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Te.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Te.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Te.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Te.prototype.activateColumn=function(t,e){let n=this._columns[t];if(n){let t=n.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},Te.prototype.activateRows=function(){this._onEnterDocument()},Te.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},Te.prototype.getFirstIndexInView=function(){return 0},Te.prototype.getLastIndexInView=function(){return this._availableRowCount-1},Te.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},Te.prototype.getFrozenLayout=function(){return this._frozenLayout},Te.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},Te.prototype.getColumn=function(t){return this._columns[t]||null},Te.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let n=t<this._colCount,i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let n=o.getCell(t[e]);n&&n.addClass("selected-row")}}return o.activate(n||!this._colVir),o},Te.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._colCount=this._trackX.getLaneCount();let i=this._columns.splice(t,1)[0];return i.dispose(),e.control=i,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},Te.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t===e)return;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.moveLane(t,e);let i=this._columns[t];if(_t.moveArrayItem(this._columns,t,e),i.getElement().offsetParent){let t=e+1,n=this._columns[t]||null;for(;n&&!n.getElement().offsetParent;)n=this._columns[++t];i.insertBefore(n)}this._updateColumnIndices(),this._updateCellSpans(n,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},Te.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},Te.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},Te.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let n=0;n<e;++n)if(this._columns[n].getElement()===t)return n}return-1},Te.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let n=this._columns[t];if(n)return n.getCellIndex(e)}return-1},Te.prototype.getIndex=function(){return this._index},Te.prototype.setIndex=function(t){this._index=t},Te.prototype.getRowOffset=function(){return this._rowOffset},Te.prototype.setRowOffset=function(t){this._rowOffset=t},Te.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},Te.prototype.stretchCell=function(t,e,n,i){let o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<0||e<0||null==e)return null;let r=null;if(!1!==n){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,i?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},Te.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},Te.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},Te.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},Te.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},Te.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},Te.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,n=t?0:this._stretchedCells.getStretchSize();if(!n&&e&&e.getWidth){let t=this.getContentWidth();return n=e.getWidth(),n?(t<n&&(n=t),this._stretchedCells.setStretchSize(n),n):t}return n},Te.prototype._enableStretchCellClass=function(t,e,n){let i=this.getStretchedCell(t);i&&i.enableClass(e,n)},Te.prototype._getViewSize=function(){return this._calculateViewSize()},Te.prototype.getColumnHost=function(){return this._element},Te.prototype.setHidingMethod=function(t){this._hidingMethod=t},Te.prototype.getHidingMethod=function(){return this._hidingMethod},Te.prototype.setColumnVisibility=function(t,e,n){return!!this._trackX.hideLane(t,!e,n)&&(this._syncLayoutToColumns(t),!0)},Te.prototype.getRowLayout=function(){return this._trackY},Te.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},Te.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let e=!1,n=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),n=this._hscrollbar.getPinnedRightColumnCount()),e&&!n?(t.style.top=this._trackY.getLaneStart(this._activeRow)+"px",t.style.left=this._trackX.getLaneStart(this._colCount)+"px",t.style.position="",t.style.display=""):(t.style.position="static",t.style.display="inline-block")},Te.prototype._updateLayers=function(){if(this._rightSpace){let t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._boundLayer&&this._element.appendChild(this._boundLayer),this._coverLayer&&this._element.appendChild(this._coverLayer)},Te.prototype.getReservedSpace=function(){return this._rightSpace},Te.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},Te.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},Te.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let n=0;n<this._colCount;++n){let i=e(n);for(let e=i.length;--e>=0;){let o=i[e],r=this._columns[n].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},Te.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},Te.prototype.selectColumn=function(t,e){if(this.enableColumnClass(t,"selected-column",e),e){this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers())}},Te.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},Te.prototype.selectCell=function(t,e,n){let i=this._getCell(t,e);i&&i.enableClass("selection",n)},Te.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Le({boundLayer:o,layoutX:this._trackX,layoutY:this._trackY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Te.prototype.getHorizontalLayout=function(){return this._trackX},Te.prototype.calculateColumnBounds=function(t,e,n,i){let o=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){let n,i,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),n=i=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,n=this._getViewSize()-i+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>n&&(o=n,s=!0)):t>=a&&(o=this._getViewSize()-i+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>n&&(r=n,l=!0)):e>=a&&(r=this._getViewSize()-i+this._trackX.getLaneEnd(e))}n[0]=o,n[1]=r,i[0]=s,i[1]=l},Te.prototype.updateColumnBounds=function(t,e,n){if(!this._colSelDirty)return;let i=this._colBounds,o=this._colBoundCache;i||(i=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=i.length;for(r=s;r<u;++r)a=i[r],l=a.parentNode,l&&l.removeChild(a);if(i.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",n=n||0,a.style.top=n+"px",a.style.height=this._trackY.getTrackSize()-n+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(i[r]||(i[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1},Te.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let n=!1;this._hscrollbar&&(n=this._hscrollbar.isActive());let i=this._boundLayer,o=this._leftColumnSeparator;if(n&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,n&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let t=this.getColumnCount(),n=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-n-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},Te.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},Te.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Te.prototype._getCell=function(t,e){let n=this._columns[t];return n?n.getCell(e):null},Te.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let n=this._trackY.getLaneStart(t);for(let i=0;i<this._colCount;++i){let o=this._columns[i];o.hasCollapsedCells()||o.setTop(n),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=n+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},Te.prototype._newColumn=function(t){let e=new ae(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let n=this._columns[t+1];e.insertBefore(n)}return e},Te.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},Te.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},Te.prototype._updateColumnIndices=function(){let t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));let n=this._columns[t-1];n!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=n,this._lastColumn&&this._lastColumn.addClass("last"));let i=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(i),i=e}},Te.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},Te.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let n=t;n<e;++n){let t=this._trackY.isAtDefaultSize(n)?-1:this._trackY.getLaneSize(n);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(n).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},Te.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let n={};n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n)},Te.prototype._updateCellSpanSize=function(t,e,n){let i=this._getCell(t,e);if(null!=i)if(n&&n.colSpan>1?(i.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):i.setWidth(-1),n&&n.rowSpan>1)i.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);i.setHeight(t)}},Te.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpanSize(n.indexX,n.indexY,n)}},Te.prototype._updateCellSpan=function(t,e,n,i){this._updateCellSpanSize(t,e,i?n:null),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,i)},Te.prototype._updateCellSpanClass=function(t,e,n,i,o){let r;for(let s=0;s<n&&(r=this._columns[t+s],r);++s)r.collapseCells(e,i,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?n:1,s._rowSpan=o?i:1)},Te.prototype._updateCellSpans=function(t,e){if(null!=t)for(let n=t.length;--n>=0;){let i=t[n];this._updateCellSpan(i.indexX,i.indexY,i,e)}},Te.prototype._onMouseMove=function(t){let e=t.target,n=_t.closestElement(e,"cell"),i=this._stretchedCells.getColumnIndex(n);if(i<0){let t=_t.closestElement(e,"column");i=this.getColumnIndex(t)}let o=this.getCellIndex(i,n);this.setRowHighlight(o)},Te.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},Te.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},Te.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},Te.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},Te.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},Te.prototype._setContext=function(t){this._ctx=t},Te.prototype._getContext=function(){return this._ctx},Te.prototype._resetTransformIETimer=function(){_t.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},Te.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},Te._proto=Te.prototype;var Ee=Te;let Me=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};Me.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},Me.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},Me.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},Me.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},Me.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},Me.prototype.getColumnDataGetter=function(){return this._colDataGetter},Me.prototype.getSum=function(){return this._updateStats(),this._sum},Me.prototype.getDataCount=function(){return this._updateStats(),this._count},Me.prototype.getMin=function(){return this._updateStats(),this._min},Me.prototype.getMax=function(){return this._updateStats(),this._max},Me.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},Me.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},Me.prototype.getMean=Me.prototype.getAverage,Me.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},Me.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},Me.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},Me.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},Me.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},Me.prototype._updateStats=function(){this._dirty&&this._recalculate()},Me.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,!this._dt||!this._field)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let n,i=Me._isDataNumeric,o=0;for(;o<e;)if(n=+t[o++],i(n)){this._sum=this._min=this._max=n,++this._count;break}for(;o<e;)n=+t[o],i(n)&&(this._sum+=n,n<this._min?this._min=n:n>this._max&&(this._max=n),++this._count),++o},Me.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;let e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},Me.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),n=this._dt.getData(t,this._field);if(e===n)return;let i=Me._isDataNumeric(n);if(Me._isDataNumeric(e)){if(this._min===e&&(!i||n>this._min))return void this._recalculate();if(this._max===e&&(!i||n<this._max))return void this._recalculate();this._sum-=e,--this._count}i&&(this._sum+=n,n>=this._min||(this._min=n),n<=this._max||(this._max=n),++this._count)},Me._isDataNumeric=function(t){return"number"==typeof t&&t==t},Me.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},Me.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},Me.prototype.getRefCount=function(){return this._refs.length},Me.prototype._dt=null,Me.prototype._field="",Me.prototype._onDemandMode=!0,Me.prototype._dirty=!0,Me.prototype._cacheData=null,Me.prototype._sum=0,Me.prototype._min=NaN,Me.prototype._max=NaN,Me.prototype._count=0,Me.prototype._colDataGetter=null,Me.prototype._refs;var Fe=Me;let Pe=function(t){this._onDataChanged=this._onDataChanged.bind(this),this._onWrapSizeChanged=this._onWrapSizeChanged.bind(this),this._dv=t.dataView,this._dt=this._dv.getDataTable(),this._dv.listen("dataChanged",this._onDataChanged),this._dv.listen("wrapSizeChanged",this._onWrapSizeChanged),this._wrapIndex=t.wrapIndex,this._refreshRids(t.rids),this._addEvents("dataChanged")};l.inherits(Pe,mt),Pe.prototype._dv=null,Pe.prototype._dt=null,Pe.prototype._wrapIndex=0,Pe.prototype._rids,Pe.prototype._dataConflator=null,Pe.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},Pe.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",Dt._globalChangeArg)},Pe.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let n=this.getWrapSize();if(n>0){let i=n*this._wrapIndex;i<t.length?(e=!0,this._rids=t.slice(i,i+n)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},Pe.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},Pe.prototype.getData=function(t,e){return this._dt.getData(t,e)},Pe.prototype.getRowData=function(t){return this._dt.getRowData(t)},Pe.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},Pe.prototype.getRowId=function(t){return this._rids[t]||""},Pe.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},Pe.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._rids;for(let o=0;o<e;++o){let e=t[o];n[o]="number"==typeof e?i[e]||"":e||""}return n},Pe.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},Pe.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},Pe.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},Pe.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},Pe.prototype.getRowCount=function(){return this._rids.length},Pe.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Pe.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Pe.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Pe.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},Pe.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Pe.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},Pe.prototype.setRowData=function(t,e,n){return this._dv.setRowData(t,e,n)},Pe.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},Pe.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},Pe.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},Pe.prototype.insertRow=function(t,e,n){let i=this._toRowId(t);return this._dv.insertRow(i,e,n)},Pe.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Pe.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Pe.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dv.moveRow(o,n)},Pe.prototype.getDataTable=function(){return this._dt},Pe.prototype.getDataSource=function(){return this._dv},Pe.prototype.setDataSource=function(t){},Pe.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},Pe.prototype.getConflationRate=function(){return this._dv.getConflationRate()},Pe.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Pe.prototype.sort=function(t,e,n,i){this._dv.sort(t,e,n,i)},Pe.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},Pe.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Pe.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Pe.prototype.isSorting=function(){return this._dv.isSorting()},Pe.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},Pe.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},Pe.prototype.showRows=function(t,e){let n=this._toRowIds(t);this._dv.showRows(n,e)},Pe.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},Pe.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},Pe.prototype.filterIn=function(t,e,n){return this._dv.filterIn(t,e,n)},Pe.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Pe.prototype.filterInOnce=function(t,e,n){this._dv.filterInOnce(t,e,n)},Pe.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Pe.prototype.clearFilter=function(){this._dv.clearFilter()},Pe.prototype.disablePageCorrection=function(t){},Pe.prototype.setPage=function(t){return!1},Pe.prototype.gotoPage=Pe.prototype.setPage,Pe.prototype.nextPage=function(){return!1},Pe.prototype.previousPage=function(){return!1},Pe.prototype.prevPage=Pe.prototype.previousPage,Pe.prototype.lastPage=function(){return!1},Pe.prototype.firstPage=function(){return!1},Pe.prototype.getCurrentPage=function(){return 1},Pe.prototype.getPageIndex=Pe.prototype.getCurrentPage,Pe.prototype.isOnLastPage=function(){return!0},Pe.prototype.isOnFirstPage=function(){return!0},Pe.prototype.getPageSize=function(){return 0},Pe.prototype.getPageCount=function(){return 1},Pe.prototype.getTotalPages=Pe.prototype.getPageCount,Pe.prototype.setPageSize=function(t){},Pe.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},Pe.prototype.addGroup=function(t){this._dv.addGroup(t)},Pe.prototype.sortGroups=function(t){this._dv.sortGroups(t)},Pe.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},Pe.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},Pe.prototype.addFooter=function(t){this._dv.addFooter(t)},Pe.prototype.removeFooter=function(){this._dv.removeFooter()},Pe.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},Pe.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},Pe.prototype.getGroup=function(t){return this._dv.getGroup(t)},Pe.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},Pe.prototype.getGroupList=function(){return this._dv.getGroupList()},Pe.prototype.getGroupId=function(){return this._dv.getGroupId()},Pe.prototype.getGroupValue=function(){return this._dv.getGroupValue()},Pe.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},Pe.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},Pe.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},Pe.prototype.hasGroup=function(){return this._dv.hasGroup()},Pe.prototype.getGroupRows=function(){return null},Pe.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},Pe.prototype.enableColumnStats=function(t,e,n){return this._dv.enableColumnStats(t,e,n)},Pe.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},Pe.prototype.hide=function(t){return this._dv.hide(t)},Pe.prototype.isHidden=function(){return this._dv.isHidden()},Pe.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},Pe.prototype.collapse=function(t){this._dv.collapse(t)},Pe.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},Pe.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Pe.prototype.isCollapsed=function(){return this._dv.isCollapsed()},Pe.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},Pe.prototype.getVisibleRowCount=function(){return this._rids.length},Pe.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},Pe.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},Pe.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},Pe.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},Pe.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);this._dv.toggleRowExpansion(i,e,n)},Pe.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},Pe.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},Pe.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},Pe.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},Pe.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},Pe.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},Pe.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},Pe.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},Pe.prototype.searchPrev=function(t,e){let n=this._toRowId(t);return this._dv.searchPrev(n,e)},Pe.prototype.searchNext=function(t,e){let n=this._toRowId(t);return this._dv.searchNext(n,e)},Pe.prototype.stall=function(t){return this._dv.stall(t)},Pe.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},Pe.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},Pe.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},Pe.prototype.setSegmentSeparator=function(t,e){let n=this._toRowId(t);return this._dv.setSegmentSeparator(n,e)},Pe.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Pe.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Pe.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Pe.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Pe.prototype.collapseSegment=function(t,e){let n=this._toRowId(t);return this._dv.collapseSegment(n,e)},Pe.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Pe.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},Pe.prototype.setSegmentCollapsingLogic=function(){},Pe.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},Pe.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},Pe.prototype.fillSegments=function(){this._dv.fillSegments()},Pe.prototype.addSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.addSegmentChild(n,i)},Pe.prototype.addSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.addSegmentChildren(n,i)},Pe.prototype.removeSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.removeSegmentChild(n,i)},Pe.prototype.removeSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.removeSegmentChildren(n,i)},Pe.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Pe.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Pe.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Pe.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Pe.prototype.getWrapSize=function(){return this._dv.getWrapSize()},Pe.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},Pe.prototype.wrapView=function(t){this._dv.wrapView(t)},Pe.prototype.dump=function(t){return St.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},Pe.prototype.log=function(t){console.table(this.dump(t))},Pe.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var ze=Pe;let Ve=function(t){let e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._updateWrapCount=e._updateWrapCount.bind(e),e._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new r(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};l.inherits(Ve,mt),Ve.prototype._rids,Ve.prototype._groupView=null,Ve.prototype._pageView=null,Ve.prototype._expansionView=null,Ve.prototype._hiddenRids=null,Ve.prototype._collapsedRids=null,Ve.prototype._excludedRids=null,Ve.prototype._emptySegmentFiltering=!1,Ve.prototype._separatorFiltering=!1,Ve.prototype._expansionMap=null,Ve.prototype._expansionChildren=null,Ve.prototype._expansionCount=0,Ve.prototype._dt=null,Ve.prototype._parent=null,Ve.prototype._shared=null,Ve.prototype._sortingDefs=null,Ve.prototype._userFilter=null,Ve.prototype._filteringOut=!1,Ve.prototype._refreshTimerId=0,Ve.prototype._groupSortingLogic=null,Ve.prototype._pageCorrection=!0,Ve.prototype._pageSize=0,Ve.prototype._pageIndex=1,Ve.prototype._lastPageIndex=0,Ve.prototype._groupCriteria=null,Ve.prototype._preDefGroups=null,Ve.prototype._preDefGroupsDirty=!1,Ve.prototype._groupMembers=null,Ve.prototype._groupList=null,Ve.prototype._groupRows=null,Ve.prototype._groupId="",Ve.prototype._groupColor="",Ve.prototype._groupValue,Ve.prototype._groupRowId="",Ve.prototype._footerRowIds=null,Ve.prototype._groupLevel=0,Ve.prototype._groupViewDirty=!1,Ve.prototype._columnStats,Ve.prototype._hidden=!1,Ve.prototype._hiddenHeaderRow=!1,Ve.prototype._collapsed=!1,Ve.prototype._collapsible=!0,Ve.prototype._showOnlyFirstMember=!1,Ve.prototype._beingAdded=!1,Ve.prototype._conflator=null,Ve.prototype._wrappedViews=null,Ve.prototype._wrapSize=0,Ve.prototype._wrapTimerId=0,Ve.prototype._stalledSorting=!1,Ve.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.wrapView(0),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._wrapTimerId&&(clearTimeout(this._wrapTimerId),this._wrapTimerId=0),this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},Ve.prototype.getData=function(t,e){return this._dt.getData(t,e)},Ve.prototype.getRowData=function(t){return this._dt.getRowData(t)},Ve.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},Ve.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},Ve.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},Ve.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),n[o]=i[e]||""):n[o]=e||""}return n},Ve.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let n=e?this._getRids():this._pageView||this._rids;return t?n:n.slice(0)},Ve.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},Ve.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},Ve.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},Ve.prototype.getRowCount=function(){return this._getRids().length},Ve.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Ve.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Ve.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Ve.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},Ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Ve.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},Ve.prototype.setRowData=function(t,e,n){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,n)},Ve.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},Ve.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},Ve.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},Ve.prototype.insertRow=function(t,e,n){this._rebuildRowIdsFromChildren();let i=this._toRowId(t);return this._dt?this._dt.insertRow(i,e,n):""},Ve.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Ve.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Ve.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,n)},Ve.prototype.swapRow=_t._deprecatedFunction,Ve.prototype.getDataTable=function(){return this._dt},Ve.prototype.getDataSource=function(){return this._parent},Ve.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(Dt._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},Ve.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},Ve.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},Ve.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},Ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Ve.prototype.sort=function(t,e,n,i){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(n))for(let e=n.length;--e>=0;)if("function"!=typeof n[e]){let i=Array.isArray(t)?t[e]:t;n[e]=o[i]||o._default}if(Dt._buildSortContext(r,t,e,n||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||i?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(Dt._positionChangeArg)},Ve.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},Ve.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Ve.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Ve.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},Ve.prototype.isSorting=function(){return this._sortingDefs.length>0},Ve.prototype.hideRow=function(t,e){this.hideRows([t],e)},Ve.prototype.hideRows=function(t,e){e=!1!==e;let n=this._hiddenRids;if(e)n||(n=this._hiddenRids={});else if(!n)return;let i=this._toRowIds(t),o=!1;for(let t=i.length;--t>=0;){let r=i[t];r&&(e?n[r]||(n[r]=!0,o=!0):n[r]&&(delete n[r],o=!0))}if(o){if(!e){let t=!1;for(let e in n){t=!0;break}t||(n=this._hiddenRids=null)}this._refreshAndNotify()}},Ve.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},Ve.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},Ve.prototype.hasHiddenRow=function(){return!!this._hiddenRids},Ve.prototype.filterIn=function(t,e,n){let i=this._getFilterLogic(t,e),o=!0===n;return!!(this._userFilter!==i||"function"==typeof t||i&&o!==this._filteringOut)&&(this._shared.filterLogic=i,this._userFilter=i,this._filteringOut=o,this._refreshAndNotify(),!0)},Ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Ve.prototype.filterInOnce=function(t,e,n){let i=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,i,!0===n))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},Ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Ve.prototype._removeRowIds=function(t){let e=Ve._removeArrayItems(this._rids,t);if(this._groupView&&(e=Ve._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n];this._groupMembers[e]._removeRowIds(t)}}return e},Ve.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},Ve.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},Ve.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},Ve.prototype.gotoPage=Ve.prototype.setPage,Ve.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},Ve.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},Ve.prototype.prevPage=Ve.prototype.previousPage,Ve.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},Ve.prototype.firstPage=function(){return this.gotoPage(0)},Ve.prototype.getCurrentPage=function(){return this._pageIndex},Ve.prototype.getPageIndex=Ve.prototype.getCurrentPage,Ve.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},Ve.prototype.isOnFirstPage=function(){return 1===this._pageIndex},Ve.prototype.getPageSize=function(){return this._pageSize},Ve.prototype.getPageCount=function(){return this._lastPageIndex},Ve.prototype.getTotalPages=Ve.prototype.getPageCount,Ve.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},Ve.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let n,i;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],i=e.length,n=0;n<i;++n){let t=e[n];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(i=this._footerRowIds.length,n=0;n<i;++n)delete this._groupRows[this._footerRowIds[n]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},Ve.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,n=e.length;for(let t=0;t<n;++t)this._addGroup(e[t])}else this._addGroup(t)},Ve.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?Ve._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},Ve.prototype.moveGroup=function(t,e){let n=this.getGroup(t);if(!n)return;let i=n.getDataSource(),o=n.getGroupId(),r=i._groupList.indexOf(o);r!==e&&r+1!==e&&(i._groupList.splice(r,1),r<e&&--e,i._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},Ve.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},Ve.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let n=t.length;--n>=0;)if(Array.isArray(t[n])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0},Ve.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},Ve.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},Ve.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},Ve.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},Ve.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let n=this._groupMembers[e];if(n)return n;let i=e;return n=this._groupRows[i],n||this._getGroupByContentRowId(i)},Ve.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let n=this._groupList[e],i=this._groupMembers[n]._getGroupByContentRowId(t);if(i)return i}else if(-1!==this._rids.indexOf(t))return this;return null},Ve.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n],i=this._groupMembers[e];t.push(i),i.getAllGroups(t)}}return t},Ve.prototype.getGroupList=function(){return this._groupList},Ve.prototype.getGroupId=function(){return this._groupId},Ve.prototype.getGroupValue=function(){return this._groupValue},Ve.prototype.getGroupRowId=function(){return this._groupRowId},Ve.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},Ve.prototype.getFooterRowIds=function(){return this._footerRowIds},Ve.prototype.hasGroup=function(){return!!this._groupMembers},Ve.prototype.getGroupRows=function(){return null},Ve.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),n=e[t];for(;n;){let i=this._groupRows[n];if(i)return i._groupLevel;n=e[--t]}}}return this._groupLevel},Ve.prototype.enableColumnStats=function(t,e,n){if(!t)return null;let i=!1!==e,o=this._columnStats[t];if(i?(o||(o=new Fe(this,t),this._columnStats[t]=o),o.addRef(n)):o&&(o.deRef(n)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let i=this._groupList.length;--i>=0;){let o=this._groupList[i];this._groupMembers[o].enableColumnStats(t,e,n)}return o||null},Ve.prototype.getColumnStats=function(t){return this._columnStats[t]||null},Ve.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},Ve.prototype.isHidden=function(){return this._hidden},Ve.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},Ve.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},Ve.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},Ve.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},Ve.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),n=e.length;if(n){let i=!1!==t;for(let t=0;t<n;++t){e[t]._setCollapse(i)}this._requestRebuildingRowIds(!1)}},Ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Ve.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},Ve.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},Ve.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},Ve.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},Ve.prototype.isCollapsible=function(){return this._collapsible},Ve.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},Ve.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},Ve.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},Ve.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},Ve.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},Ve.prototype.isRowDataInGroup=function(t,e){let n=this._groupCriteria,i=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=i;o<n.length;o++)if(n[o](t).indexOf(e)>=0)return!0;return!1},Ve.prototype.isRowIdInGroup=function(t,e){let n=this.getRowData(t);return!!n&&this.isRowDataInGroup(n,e)},Ve._getDataViewExpansionId=function(t,e){return t+"_ex"+e},Ve.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let n=this._rids.indexOf(t);if(n<0)return;let i=0;this._expansionMap?i=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=i+e;this._expansionMap[t]=o;for(let e=i;e<o;e++)this._expansionChildren[Ve._getDataViewExpansionId(t,e)]=t;if(i||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[n+1],e.fallback=n,this._dispatchDataChange(e)}},Ve.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let n=new Array(e);for(let i=0;i<e;++i)n[i]=Ve._getDataViewExpansionId(t,i),delete this._expansionChildren[n[i]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(n[0]):this._dispatchMultiRowRemoved(n))},Ve.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(i))?this.addRowExpansion(i,n):this.removeRowExpansion(i)},Ve.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},Ve.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let n=this._expansionView,i=n.length;(null==e||e>i)&&(e=i),t>0||(t=0);let o=this._expansionCount,r=new Array(i);for(let i=t;i<e;++i){let t=n[i];if(this._expansionMap[t]&&(r[i]=t,--o<=0))break}return r},Ve.prototype.getExpansionParents=function(t,e){let n=[];if(this._expansionMap){let i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)n[o]=this._expansionChildren[i[o]]||""}return n},Ve.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},Ve.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},Ve.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},Ve.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},Ve.prototype.getRowExpansionId=function(t,e){if(this._expansionMap){if(e||(e=0),e<(this._expansionMap[t]||0))return Ve._getDataViewExpansionId(t,e)}return""},Ve.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},Ve.prototype._updateExpansionView=function(){let t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;let e=this._pageView||this._groupView||this._rids,n=e.length,i=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=n:this._expansionView=new Array(n);let o=this._expansionCount;for(let i=0,r=0;i<n;++i){let n=e[i];if(this._expansionView[r++]=n,o){let e=t[n]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=Ve._getDataViewExpansionId(n,t);--o}}}return i!==this._expansionView.length}return!1},Ve.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},Ve.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let n=this._getRids(),i=n.length;for(let o=0;o<i;++o){let i=n[o],r=this._dt.getRowData(i);r&&t(r)&&e.push(i)}return e},Ve.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;"number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t);let o=-1,r=n.length;return i>0&&(o=this._searchRow(n,e,i-1,-1,-1),o>=0)||i>=0&&(o=this._searchRow(n,e,r-1,i,-1),o>=0)?o:-1},Ve.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;if("number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t),i<0)return-1;let o=-1,r=n.length;return i<r-1&&(o=this._searchRow(n,e,i+1,r,1),o>=0)||i>0&&(o=this._searchRow(n,e,0,i,1),o>=0)?o:-1},Ve.prototype._searchRow=function(t,e,n,i,o){for(;n!==i;){let i=t[n],r=this._dt.getRowData(i);if(r&&e(r))return n;n+=o}return-1},Ve.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let n=e.length;--n>=0;)t[e[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},Ve.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(Dt._positionChangeArg),!0)},Ve.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},Ve.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},Ve.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},Ve.prototype.setSegmentSeparators=function(t,e){return!!t&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparators(t,e))},Ve.prototype.setSegmentSeparator=function(t,e){let n="";return"number"==typeof t?n=this.getRowId(t):"string"==typeof t&&(n=t),!!n&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(n,e))},Ve.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Ve.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Ve.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Ve.prototype.getSegment=function(t){return this._dt.getSegment(t)},Ve.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},Ve.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},Ve.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Ve.prototype.collapseSegment=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();if(n){let i=this._toRowId(t);if(n.collapseSegment(i,e))return this._refreshAndNotify(),!0}return!1},Ve.prototype.collapseSegments=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();return!(!n||!n.collapseSegments(t,e))&&(this._refreshAndNotify(),!0)},Ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Ve.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},Ve.prototype.setSegmentCollapsingLogic=function(){},Ve.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},Ve.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},Ve.prototype.fillSegments=function(){this._dt.fillSegments()},Ve.prototype.addSegmentChild=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o,n)}return!1},Ve.prototype.addSegmentChildren=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o,n)}return!1},Ve.prototype.setSegmentChildren=function(t){return!!this._dt._getSegmentSeparators()&&this._dt.setSegmentChildren(t)},Ve.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowId(e);return this._dt.removeSegmentChild(n,i)}return!1},Ve.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowIds(e);return this._dt.removeSegmentChildren(n,i)}return!1},Ve.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Ve.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Ve.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Ve.prototype.sortSeparators=function(t,e,n){this._dt.sortSeparators(t,e,n)},Ve.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Ve.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},Ve.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},Ve.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},Ve.prototype._getSharedObject=function(){return this._shared},Ve.prototype.getWrapSize=function(){return this._wrapSize},Ve.prototype.getWrappedViews=function(){return this._wrappedViews},Ve.prototype.wrapView=function(t){null!=t&&((!t||t<0)&&(t=0),this._wrapSize!==t&&(this._wrapSize=t,this._dispatch("wrapSizeChanged",{wrapSize:t,rids:this.getVisibleRowIds(!0)}))),this._updateWrapCount()},Ve.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,n=this._wrappedViews,i=n?n.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),i<o)for(n||(n=this._wrappedViews=[]),t=i;t<o;++t)this._wrappedViews[t]=new ze({dataView:this,wrapIndex:t,rids:r})}if(o<i){for(t=i;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),i!==o&&this._dispatch("wrapCountChanged",{prevCount:i,newCount:o})},Ve.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return St.constructTable(this.getMultipleRowData(e),t,e)},Ve.prototype.log=function(t){console.table(this.dump(t))},Ve.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},Ve.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=Ve._copyValidObjectKeys(this._excludedRids,this._hiddenRids);let n=this._dt._getSegmentSeparators(),i=n?n.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:i);if(e+=o,this._collapsedRids=null,n&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,i)),this._collapsedRids=n.getCollapsedRows(),e+=Ve._copyValidObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{let t=this._updatePageCount();this._sort()||t||this._transformView()}},Ve.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],n=e.length;if(1===n){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let n=t.type;"inserted"===n?this._onRowInserted(t):"removed"===n?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let i=0;i<n;i++)if(!e[i].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},Ve.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let n,i=this._resolveGroupId(t.rowData),o=i.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(n=i[r],this._groupMembers[n])e=this._groupMembers[n]._onRowInserted(t);else{let i=this._addGroup(n);i&&(t.globalChange=!0,i._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let n=t.rid,i=t.rowData;if(!this._isAllowedInGroup(n,i))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(n):this._addDataRow(n,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:n,rowData:i,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},Ve.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,n=0,i=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!i&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(n+=this._groupMembers[r]._onRowRemoved(t));n>1&&(this._groupViewDirty=!0)}else{let i=this._groupList.length;for(e=0;e<i;++e)r=this._groupList[e],n+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(n=0,i){for(l=[],e=i.length;--e>=0;)o=i[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));n=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,n=1);if(n>0){this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)}return n},Ve.prototype._onRowUpdated=function(t){let e,n,i=t.rid,o=t.rowData;if(this.isRowFiltered(i,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let r=[],s=this._groupList.length;for(e=0;e<s;++e)n=this._groupList[e],r[this._groupMembers[n]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(i,o)||(l=1):r[4]&&(l=4),this._groupLevel>0){if(1===l)Ve._removeArrayItem(this._rids,i)>=0&&this._groupView&&Ve._removeArrayItem(this._groupView,i),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===l&&!this._hidden){this._rids.indexOf(i)<0&&this._rids.push(i),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let i=this._resolveGroupId(o);for(e=0;e<i.length;e++){n=i[e];let o=this._addGroup(n);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(i)<0&&this._addDataRow(i),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}if(this._isAllowedInGroup(i,o)){return this._rids.indexOf(i)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4)}return this._onRowRemoved(t)?1:0},Ve.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,n=e.getGroupRowId();this._groupView.push(n),this._groupViewDirty=!0,this._dispatch("groupAdded",t),_t.pushArrayItems(this._groupView,e.getFooterRowIds())}},Ve.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},Ve.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},Ve.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},Ve.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},Ve.prototype._addDataRow=function(t,e,n){let i=this._getRowIndex(this._rids,e,n);return this._insertItems(this._rids,i,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):i<0?this._insertItems(this._groupView,-1,t):(i=this._getRowIndex(this._groupView,e,n),this._insertItems(this._groupView,i,t)):i>=0?i:this._rids.length-1},Ve.prototype._insertItems=function(t,e,n){return e<0?(e=t.length,t.push(n)):t.splice(e,0,n),e},Ve.prototype._getRowIndex=function(t,e,n){if(null==e)return-1;let i=this._rids.indexOf(e);return i>=0?i:null==n||n>=t.length?-1:n},Ve.prototype._removeDataRow=function(t){let e=Ve._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=Ve._removeArrayItem(this._groupView,t)),e},Ve._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&t.splice(n,1),n},Ve._removeArrayItems=function(t,e){let n=NaN,i=0;for(let o=t.length;--o>=0;)e[t[o]]?++i:i&&(n=o+1,t.splice(n,i),i=0);return i&&(t.splice(0,i),n=0),n},Ve._copyValidObjectKeys=function(t,e){if(e){let n=0;for(let i in e)e[i]&&(t[i]=1,++n);return n}return 0},Ve.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let n=this;for(let i=this._groupLevel;--i>=0;){if(!n._groupFilterLogic(t,e))return!1;n=n.getDataSource()}}return!0},Ve.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||(!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut))},Ve.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),n=this._dt.getSegmentValues(t,!0),i=Dt._performMultiLevelSorting(e,this._sortingDefs,n);if(i)return this._rids=Dt._reorderItems(t,i),this._transformView(),!0}return!1},Ve.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},Ve.prototype._getRemovalMap=function(t,e,n,i){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(i)for(r=h;--r>=0;)o=l[r],i[o]||(s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u);return u},Ve.prototype._getEmptySegments=function(t,e){let n=this._dt._getSegmentSeparators(),i=0;for(let o in e){let e=n.getSegment(o);if(e){let n=e.getChildren(),r=!0;for(let e in n)if(!t[e]){r=!1;break}r&&(t[o]=1,++i)}}return i},Ve.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?Ve._defaultFilterLogic.bind(null,t,e):Ve._defaultFilterLogic.bind(null,t+"",e):null},Ve.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},Ve.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let n=this._pageSize*(this._pageIndex-1),i=this._pageSize+n;if(t<i){let t=this._groupView||this._rids;i>t.length&&(i=t.length);let o=i-n;this._pageView.length=o>=0?o:0;for(let e=n;e<i;++e)this._pageView[e-n]=t[e];e=!0}}return e},Ve.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let e=this._groupView||this._rids,n=e.length>0?e.length:0;t=Math.ceil(n/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},Ve.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},Ve.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},Ve.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(Dt._globalChangeArg)},Ve.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},Ve.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),n=this._parent.getColumnStats(e);t&&n&&t.setColumnDataGetter(n.getColumnDataGetter())}}},Ve.prototype._populateGroups=function(){let t,e,n,i,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],n=this._dt.getRowData(e);if(n){o=this._resolveGroupId(n),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){i=o[t];let n=l[i];n?n.push(e):(n=[e],l[i]=n,a.push(i))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)i=this._groupList[t],l[i]||(n=this._groupMembers[i],n&&!n._predefinedGroup&&this._removeGroupMember(t,i));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)i=this._groupList[t],n=this._groupMembers[i],n&&n._predefinedGroup&&(u?u.indexOf(n._groupId)<0&&this._removeGroupMember(t,i):this._removeGroupMember(t,i));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)i=this._groupList[t],n=this._groupMembers[i],n._updateRowIds(l[i]),n._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},Ve.prototype._removeGroupMember=function(t,e){let n=this._groupMembers[e];n&&(this._groupList.splice(t,1),delete this._groupMembers[e],n.dispose())},Ve.prototype._defaultGroupCriteria=function(t,e){let n=e[t];return Array.isArray(n)?n.map((function(t){return t+""})):[n+""]},Ve.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},Ve.prototype._internalGroupSortingLogic=function(t,e){let n=this._groupMembers[t],i=this._groupMembers[e];return this._groupSortingLogic(t,e,n,i)},Ve.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let n=this._groupMembers[e];if(n)return null;let i,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(i={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",i),i.cancel))return null;n=new Ve;let r=this._shared.defaultCollapse;return null!=r&&(n._collapsed=r),n._groupId=e,"string"==typeof t?"null"==t?n._groupValue=null:"undefined"!=t&&(n._groupValue=t):n._groupValue=t,i&&!0===i.hideHeaderRow&&(n._hiddenHeaderRow=!0),n._groupRowId=o,n._groupLevel=this._groupLevel+1,n._groupCriteria=this._groupCriteria,n._preDefGroups=this._preDefGroups,n._groupLevel<n._groupCriteria.length&&(n._groupMembers={},n._groupList=[],n._groupView=[]),n._groupRows=this._groupRows,n._setParent(this),n._sortingDefs=this._sortingDefs,this._groupMembers[e]=n,this._groupList.push(e),this._groupRows[n._groupRowId]=n,this._hidden||(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),this._groupViewDirty=!0,n._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:n}),n._beingAdded=!1),n.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&n.listen("beforeGroupAdded",this._onBeforeGroupAdded),n},Ve.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},Ve.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],n=this._groupMembers[t];if(n._rebuildRowIdsFromChildren(),_t.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){let t=n._getFirstHiddenRids()||n._groupView||n._rids;_t.pushArrayItems(this._groupView,t),_t.pushArrayItems(this._groupView,n._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},Ve.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},Ve.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},Ve._defaultFilterLogic=function(t,e,n,i){return i[t]===e},Ve._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var ke=Ve;let Ne=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};Ne.prototype._data,Ne.prototype._func=null,Ne.prototype._delay=0,Ne.prototype._timerId=0,Ne.prototype._conflated=!1,Ne.prototype._disabled=!1,Ne.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Ne.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},Ne.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Ne.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},Ne.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Ne.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},Ne.prototype.getData=function(){return this._data},Ne.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Ne.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Ne.prototype.disable=function(t){this._disabled=!1!==t},Ne.prototype.isEnabled=function(){return!this._disabled},Ne.prototype.enable=function(t){this._disabled=!1===t},Ne._proto=Ne.prototype;var Oe=Ne;let He=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new Oe(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};l.inherits(He,mt),He._runningId=0,He.prototype._id="",He.prototype._type="",He.prototype._grid=null,He.prototype._snapshot=null,He.prototype._dataView=null,He.prototype._dataArg=null,He.prototype._autoSyncRowCount,He.prototype._bindingEnabled=!0,He.prototype._parent=null,He.prototype._children=null,He.prototype._dataChangedConflator,He.prototype.getId=function(){return this._id},He.prototype.setId=function(t){return this._id=t||"section"+He._runningId++,this._grid.setAttribute("id",this._id),this._id},He.prototype.getSection=function(){return this._snapshot||this._grid},He.prototype.getSectionName=function(){return this._grid.getId()},He.prototype.getIndex=function(){return this._grid.getIndex()},He.prototype.getType=function(){return this._type},He.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},He.prototype.getDataSource=function(){return this._dataView},He.prototype.setDataSource=function(t){let e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},He.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},He.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},He.prototype.setData=function(t,e,n){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,n),!0)},He.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},He.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let n=e.getRowIndex(t);return!(n<0)&&(e.removeRow(n),!0)},He.prototype.activateColumns=function(t,e,n){if("content"===this._type)for(let i=n+1;--i>=e;){let e=t[i];null!=e&&this._grid.activateColumn(i,e)}},He.prototype.getChildren=function(){return this._children},He.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},He.prototype.getParent=function(){return this._parent},He.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},He.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},He.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},He.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},He.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},He.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},He.prototype.dispose=function(){let t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},He.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},He.prototype.extendRenderEventArg=function(t,e,n){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,n=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=n,t},He.prototype.extendDataEventArg=function(t,e,n){let i,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=n,this._snapshot?(i=0,o=this._grid.getRowCount()):(i=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>i?e:i,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=n+1<o?n+1:o,this.extendEventArg(t),t},He.prototype.setIndex=function(t){this._grid.setIndex(t)},He.prototype.getRowOffset=function(){return this._grid.getRowOffset()},He.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},He.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},He.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},He.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},He.prototype._dispatchDataChanged=function(t,e){let n=this.getAutoSyncRowCount(),i=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();n?i!==o&&this._grid.setRowCount(i,!0):i>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},He.prototype.updateRowData=function(t,e,n){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(n=this.extendDataEventArg(n,t,e)).fromRowIndex<n.toRowIndex&&this._dispatch("dataChanged",n))},He.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},He.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},He.prototype._getRowId=function(t){return _t.isNumber(t)?this._dataView.getRowId(t):t},He.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),e.globalChange)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let n=t.rids;if(n)for(let t=n.length;--t>=0;)e.updatedRids[n[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},He.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},He._proto=He.prototype;var Be=He;let Ge=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};l.inherits(Ge,mt),Ge.prototype._layout,Ge.prototype._viewSize=0,Ge.prototype._viewOffset=0,Ge.prototype._startOffsetCount=0,Ge.prototype._endOffsetCount=0,Ge.prototype._bufferSize=0,Ge.prototype._arg=null,Ge.prototype._enabled=!0,Ge.prototype._active=!0,Ge.prototype._virtualizable=!1,Ge.prototype._getMinIndex=function(){return this._startOffsetCount},Ge.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Ge.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Ge.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Ge.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Ge.prototype.getViewSize=function(){return this._viewSize},Ge.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Ge.prototype.getIndexOffset=function(){return this._startOffsetCount},Ge.prototype.isVirtualizable=function(){return this._virtualizable},Ge.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Ge.prototype.getLastIndexInView=function(){if(this._virtualizable){let t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},Ge.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Ge.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Ge.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),n=this.getLastIndexInView(),i=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==n;return(t||i)&&(this._arg.firstIndex=e,this._arg.lastIndex=n,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=n),i},Ge.prototype.isEnabled=function(){return this._enabled},Ge.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Ge.prototype.disable=function(t){this.enable(!1===t)},Ge.prototype.isActive=function(){return this._active},Ge.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Ge.prototype.deactivate=function(t){this.activate(!1===t)},Ge.prototype.getBufferSize=function(){return this._bufferSize},Ge.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Ge.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Ge.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Ge.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Ge.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Ge.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Ge._proto=Ge.prototype;var We=Ge;let Ue=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Ue.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};l.inherits(Ue,ve),Ue.prototype.setScrollContent=function(t,e,n){this._clearAllPanes();let i,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<n;)i=e[l++],i.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)i=e[l++],i.setParent(s);for(;l<o;)i=e[l++],i.setParent(t);this.invalidateContent()},Ue.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Ue.prototype.getHeight=function(){return this.getPaneSize()},Ue.prototype.getScrollTop=function(){return this._getScrollValue()},Ue.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Ue.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Ue.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let n=t.length;--n>=0;)e+=t[n].offsetHeight;return e},Ue.prototype.calculateContentSize=function(){return this.getContentHeight()},Ue.prototype.getPane=function(){return this._panes[0]},Ue.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Ue._proto=Ue.prototype;var Ye=Ue;let Xe=function(t){let e=this;e._onRestingPosition=e._onRestingPosition.bind(e),e._updateRowBounds=e._updateRowBounds.bind(e),e._element=document.createElement("div"),e._element.className="tr-vlg section",t||(t={}),t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar),t.owner=this,e._grid=new Ee(t),e._grid.setParent(e._element),e._layoutY=new re,e._selectionList=new Se,e._reverter=new be(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Xe,$t),Xe.prototype._index=-1,Xe.prototype._rowOffset=0,Xe.prototype._firstIndex=0,Xe.prototype._grid,Xe.prototype._layoutY,Xe.prototype._selectionList=null,Xe.prototype._reverter=null,Xe.prototype._rowBounds=null,Xe.prototype._rowBoundCache=null,Xe.prototype._rowSelDirty=!1,Xe.prototype._cellBoundPainter=null,Xe.prototype._rowBoundTimer=0,Xe.prototype._boundLayer=null,Xe.prototype._hscrollbar=null,Xe.prototype._session="A",Xe.prototype._tempRowHeights=null,Xe.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Xe.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Xe.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0),this._cellBoundPainter&&this._cellBoundPainter.dispose()},Xe.prototype.setWidth=function(t){return this._grid.setWidth(t)},Xe.prototype.setHeight=function(t){return console.log("unsupported"),!1},Xe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Xe.prototype.hitTest=function(t,e){let n=[];return n.colIndex=this._grid.hitTestX(t),n.rowIndex=this._layoutY.hitTest(e),n},Xe.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Xe.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Xe.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Xe.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Xe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Xe.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},Xe.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Xe.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Xe.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Xe.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Xe.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,n=[];for(let e in this._tempRowHeights){let i=+e,o=this._layoutY.getLaneProperty(i,"sizeSession");o&&o!=this._session&&(this.setRowHeight(i,t),this._layoutY.setLaneProperty(i,"sizeSession",null),n.push(i))}let i=n.length;for(let t=0;t<i;t++)delete this._tempRowHeights[n[t]];if(i)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Xe.prototype._getTempRowHeights=function(){return this._tempRowHeights},Xe.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Xe.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatchRowHeightChangedEvent(t,t+1))},Xe.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Xe.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Xe.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Xe.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Xe.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Xe.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Xe.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Xe.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Xe.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Xe.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Xe.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Xe.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Xe.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Xe.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Xe.prototype.setCellRowSpan=function(t,e,n){return this._grid.setCellRowSpan(t,e-this._firstIndex,n)},Xe.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Xe.prototype.setCellColSpan=function(t,e,n){return this._grid.setCellColSpan(t,e-this._firstIndex,n)},Xe.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Xe.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Xe.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Xe.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Xe.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Xe.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Xe.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Xe.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Xe.prototype.getCell=function(t,e,n){return this._grid.getCell(t,e-this._firstIndex,n)},Xe.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Xe.prototype.setCellContent=function(t,e,n){return this._grid.setCellContent(t,e-this._firstIndex,n)},Xe.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Xe.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Xe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Xe.prototype.setRowCount=function(t,e){let n=this._layoutY.getLaneCount();n!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:n,noBinding:e}))},Xe.prototype.getVisibleRowCount=function(){return this.getRowCount()},Xe.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},Xe.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Xe.prototype.setBorders=function(t,e,n,i){this._grid.setBorders(t,e,n,i)},Xe.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Xe.prototype.setColumnStyle=function(t,e,n){this._grid.setColumnStyle(t,e,n)},Xe.prototype.enableColumnClass=function(t,e,n){this._grid.enableColumnClass(t,e,n)},Xe.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Xe.prototype.enableRowClass=function(t,e,n){this._grid.enableRowClass(t-this._firstIndex,e,n)},Xe.prototype.setRowStyle=function(t,e,n,i){this._grid.setRowStyle(t-this._firstIndex,e,n,i)},Xe.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Xe.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Xe.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Xe.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Xe.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Xe.prototype.enableShading=function(t){this._grid.enableShading(t)},Xe.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Xe.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Xe.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Xe.prototype.setRowHighlight=function(t){let e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Xe.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Xe.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Xe.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Xe.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let n=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,n),n&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Xe.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Xe.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Xe.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Xe.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Xe.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Xe.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Xe.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Xe.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Xe.prototype.activateRows=function(t,e,n){let i=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+i),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>i&&(s=i);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>i&&(l=i-s),this._firstIndex=s;let a=s+l,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,n&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(n){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),n[0]=s,n[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),n[0]=t,n[1]=a):s===r&&a===t?(n[0]=0,n[1]=0):p=!0}p&&(n[0]=s,n[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},Xe.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Xe.prototype.getFirstIndexInView=function(){return this._firstIndex},Xe.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),n=e?e.getRowCount()-1:-1;return t>n?n:t},Xe.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Xe.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Xe.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Xe.prototype.getColumn=function(t){return this._grid.getColumn(t)},Xe.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Xe.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Xe.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Xe.prototype.enableRowVirtualization=function(t){},Xe.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Xe.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Xe.prototype.getCellIndex=function(t,e){let n=this._grid.getCellIndex(t,e);return n<0?-1:n+this._firstIndex},Xe.prototype.getIndex=function(){return this._index},Xe.prototype.setIndex=function(t){this._index=t},Xe.prototype.setRowOffset=function(t){this._rowOffset=t},Xe.prototype.getRowOffset=function(){return this._rowOffset},Xe.prototype.updateLayout=function(){this._grid.updateLayout()},Xe.prototype.stretchCell=function(t,e,n,i){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,n,i);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Xe.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Xe.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Xe.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Xe.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Xe.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Xe.prototype.getColumnHost=function(){return this._grid.getElement()},Xe.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Xe.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Xe.prototype.setColumnVisibility=function(t,e,n){return this._grid.setColumnVisibility(t,e,n)},Xe.prototype.getRowLayout=function(){return this._layoutY},Xe.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Xe.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Xe.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Xe.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Xe.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Xe.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Xe.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Xe.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Xe.prototype.selectCell=function(t,e,n){this._grid.selectCell(t,e-this._firstIndex,n)},Xe.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Le({boundLayer:o,layoutX:this.getHorizontalLayout(),layoutY:this._layoutY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Xe.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Xe.prototype.calculateColumnBounds=function(t,e,n,i){this._grid.calculateColumnBounds(t,e,n,i)},Xe.prototype.updateColumnBounds=function(t,e,n){this._grid.updateColumnBounds(t,e,n),this._updateRowBounds()},Xe.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Xe.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Xe.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Xe.prototype._updateRowBounds=function(){this._rowBoundTimer=0;let t=this._cellBoundPainter;if(t&&t.updateCellBounds(),!this._rowSelDirty)return;let e=this._rowBounds,n=this._rowBoundCache;e||(e=this._rowBounds=[]),n||(n=this._rowBoundCache=[]);let i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);let r,s=i.getConnectedRanges(),l=s.length,a=null,u=null,h=e.length;for(r=l;r<h;++r)u=e[r],a=u.parentNode,a&&a.removeChild(u);if(e.length=h=l,!l){return void(i.getSelectionCount()||(this._rowSelDirty=!1))}let p=0,d=0,c=0,_=!1;this._hscrollbar&&(p=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount(),_=this._hscrollbar.isEndOfHorizontalScroll());let f=!d&&p>0,g=!c&&!_,y=this._grid._getViewSize();for(r=0;r<l;++r){let t=s[r],i=t[0],o=t[1],l=this._layoutY.getLaneStart(i),a=this._layoutY.getLaneEnd(o);u=n[r],u||(u=n[r]=document.createElement("div"),u.className="selection-bound"),u.style.top=l+"px",u.style.height=a-l+"px",u.style.width=y+"px",u.classList.toggle("no-left-bound",f),u.classList.toggle("no-right-bound",g),this._boundLayer&&(e[r]||(e[r]=u,this._boundLayer.appendChild(u)))}},Xe.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Xe.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,n=e.getSelectionCount();if(n<=0)return;let i=this._firstIndex,o=i+this._getInnerRowCount();if(1===n)t=e.getFirstSelectedIndex(),i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0);else if(n>=o-i)for(t=i;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-i,!0);else{let r=e.getAllSelections();for(let e=0;e<n;++e)t=r[e],i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0)}},Xe.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let n={};return n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n),!0},Xe.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Xe.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Xe.prototype._updateLayers=function(){this._grid._updateLayers()},Xe.prototype._setContext=function(t){this._grid._setContext(t)},Xe.prototype._getContext=function(){return this._grid._getContext()},Xe._proto=Xe.prototype;var qe=Xe;let je=function(t,e){return t-e},Ke=function(){let t=document.createElement("input"),e=t.style;return e.position="absolute",e.width=e.height=e.padding=e.border="0",t.value="0",t.role="grid",t},Je=function(t){if(t){if(!t.getRootNode)return document.activeElement;{let e=t.getRootNode();if(e&&e!==t)return e.activeElement||null}}return null},Qe=function(t){Qe._sectionType||(Qe._sectionType={},Qe._sectionType.title=!0,Qe._sectionType.header=!0,Qe._sectionType.content=!0,Qe._sectionType.footer=!0);let e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.bind(e),e._onKeyDown=e._onKeyDown.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e._onSyncHScroll=e._onSyncHScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),e.updateColumnBounds=e.updateColumnBounds.bind(e),e._dispatchColumnPositionChanged=e._dispatchColumnPositionChanged.bind(e),e._dispatchRowPositionChanged=e._dispatchRowPositionChanged.bind(e),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(let e=t.childNodes.length;--e>=0;)_t.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new re,e._layoutY=new re,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new We(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new We(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Ye,e._vscrollbar.disable(),e._vscrollbar.setParent(e.getParent()||e.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new De,e._hscrollbar.disable(),e._hscrollbar.setParent(e.getParent()||e.getElement()),e._hscrollbar.listen("scroll",e._onHScroll),e._hscrollbar.listen("layoutChanged",e._onHScroll),e._hscrollbar.listen("activated",e.updateLayout),e._hscrollbar.listen("deactivated",e.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),e._element.addEventListener("keydown",e._onKeyDown),_t.isMobile||_t.isTouchDevice?e._element.addEventListener("touchmove",e._onMouseMove,!1):e._element.addEventListener("mousemove",e._onMouseMove,!1),_t.isSafari&&e._element.addEventListener("click",e._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new Oe(e._onRowHeightChanged,50),e._vScrollbarConflator=new Oe(e._updateVScrollbar,200),e._columnBoundConflator=new Oe(e.updateColumnBounds,10),e._columnPositionConflator=new Oe(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new Oe(e._dispatchRowPositionChanged,10),e._firstHiddenInput=Ke(),e._firstHiddenInput.className="first-input",e._lastHiddenInput=Ke(),e._lastHiddenInput.className="last-input",e._element.insertBefore(e._firstHiddenInput,e._element.firstChild),e._element.appendChild(e._lastHiddenInput),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged","tabNavigation");let n=Qe.map;n||(n={},Qe.map=n),e._element._control=e;let i=e._element.id||e._element.name;i&&!n[i]||(i="_grid"+Qe._runningGridId),e._id=i,n[i]=e,Qe._runningGridId++,Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};l.inherits(Qe,$t),Qe.SectionReference,Qe.MouseInfo,Qe.BatchInfo,Qe.CellReference,Qe.ColumnOptions,Qe._runningGridId=0,Qe._runningColumnId=0,Qe._sectionType,Qe.prototype._plugins,Qe.prototype._dataSource=null,Qe.prototype._layoutX,Qe.prototype._layoutY,Qe.prototype._vscrollbar,Qe.prototype._hscrollbar,Qe.prototype._tempFrozenSectionRef="",Qe.prototype._startVScrollbarIndex=-1,Qe.prototype._hScrollbarEnabled=!0,Qe.prototype._pinnedLeftColumnCount=0,Qe.prototype._pinnedRightColumnCount=0,Qe.prototype._frozenFooterCount=0,Qe.prototype._fixFrozenTopSections=!1,Qe.prototype._fixFrozenBottomSection=!1,Qe.prototype._sectionStarts,Qe.prototype._settings,Qe.prototype._firstSettings,Qe.prototype._lastSettings,Qe.prototype._fitContentWidth=!1,Qe.prototype._columnDefs,Qe.prototype._rowVirtualizer,Qe.prototype._colVirtualizer,Qe.prototype._autoSetDataSource=!0,Qe.prototype._renderingHandler=null,Qe.prototype._dataBindingHandler=null,Qe.prototype._frozenLayout=!1,Qe.prototype._noBinding=!1,Qe.prototype._rowHeightSync=!0,Qe.prototype._rowHighlighting=!1,Qe.prototype._dispatchingDataChanged=!1,Qe.prototype._rowHeightException="",Qe.prototype._rowScrollingStep=0,Qe.prototype._zoomFactor=1,Qe.prototype._reservedSpace=0,Qe.prototype._hidingMethod="",Qe.prototype._rowHeightConflator=null,Qe.prototype._vScrollbarConflator=null,Qe.prototype._columnBoundConflator=null,Qe.prototype._rowRefreshTimer=0,Qe.prototype._layoutUpdating=!1,Qe.prototype._firstHiddenInput,Qe.prototype._lastHiddenInput,Qe.prototype._bottomPadding=6,Qe.prototype._bottomPaddingSect=null,Qe.prototype._preserveProportion=!1,Qe.prototype._preserveGridSize=!1,Qe.prototype._rowHeightTimerId=0,Qe.prototype._groupDefs=null,Qe.prototype._batches=null,Qe.prototype._firstRendered=!1,Qe.prototype._hasPendingRowChange=!1,Qe.getVersion=function(){return"5.1.129"},Qe.prototype.dispose=function(){let t=this._id,e=Qe.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let n=this._vscrollbar._mainScrollbar;n&&(n.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),n=this._hscrollbar._mainScrollbar,n&&(n.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.dispose();let i=this._element;i&&(i._control&&delete i._control,i.removeChild(this._firstHiddenInput),i.removeChild(this._lastHiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},Qe.prototype.isDisposed=function(){return this._disposed},Qe.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Qe.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Qe.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Qe.prototype.getConfigObject=function(t){let e=t||{},n=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<n;t++){let n=e.columns[t];n||(n=e.columns[t]={});let i=this._getColumnDef(t);i.userId&&(n.id=i.userId),i.field&&(n.field=i.field),i.styles&&(n.styles=i.styles),i.stationary&&(n.stationary=i.stationary),i.leftPinned&&(n.leftPinned=i.leftPinned),i.rightPinned&&(n.rightPinned=i.rightPinned),i.backgroundColor&&(n.backgroundColor=i.backgroundColor)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep);let i=this._vscrollbar.getAutoHide();!0!==i&&(e.autoHideScrollbar=i);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let n=this._plugins[t];"function"==typeof n.getConfigObject&&n.getConfigObject(e)}return e},Qe.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,n=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(n-this._reservedSpace)},Qe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Qe.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Qe.prototype.getSectionCount=function(){return this._settings.length},Qe.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Qe.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Qe.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,n=0;for(let i=0;i<e;i++){let e=t[i].getType();if("header"!==e&&"title"!==e)break;n++}return n},Qe.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let n=t.length-1;n>=0;n--){if("footer"!==t[n].getType())break;e++}return e},Qe.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Qe.prototype.addSectionAt=function(t,e,n){let i=this._settings.length;t<0&&(t=0),t>i&&(t=i);let o=this._toSectionType(e),r="bottomPadding"===n,s=this._newSection(r?"footer":o,n);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=i?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},Qe.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Qe.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],n=e.getIndex(),i=e.getSection(),o=e.getType();return i.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),i}return null},Qe.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Qe.prototype.removeAllSections=function(){let t=this._settings.length;for(let e=0;e<t;++e){this._settings[e].dispose()}this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},Qe.prototype.setBottomPaddingSection=function(t){let e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},Qe.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let n=e;--n>=0;){let e=this._settings[n];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},Qe.prototype.moveSection=function(t,e){let n=this.getSectionCount();if(t<0)t=0;else if(t>=n)return;if(e<0?e=0:e>=n&&(e=n-1),t===e)return;let i=this._settings[t],o=this._settings[e];_t.moveArrayItem(this._settings,t,e),o?i.getSection().insertBefore(o.getSection()):this._putToLast(i.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},Qe.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},Qe.prototype.getSectionSettings=function(t){if(_t.isString(t)){if(Qe._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():_t.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},Qe.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),n=e;for(let t=n.length;--t>=0;)n[t]=e[t].getSection();return n},Qe.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,n=[];t=this._toSectionType(t);for(let i=0;i<e;++i){let e=this._settings[i];t===e.getType()&&n.push(e)}return n},Qe.prototype.getSectionIndex=function(t){if(_t.isNumber(t))return t;if(t instanceof MouseEvent){let e=_t.getRelativePosition(t,this._element),n={};return this._hitTestY(e.y,n),n.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},Qe.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let n=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(n-=this._vscrollbar.getScrollTop()),n},Qe.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let n=this._getNextSection(-1,t,e);return null!==n?n.getSection():null},Qe.prototype.getNextSection=function(t,e){let n=this._getNextSection(1,t,e);return null!==n?n.getSection():null},Qe.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Qe.prototype.getCell=function(t,e,n,i){let o=this.getSection(t);return o?o.getCell(e,n,i):null},Qe.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,n=t.rowIndex,i=t.sectionName,o=null;if(null==e||null==n)o=this.getRelativePosition(t),o.hit||(o=null);else{i||(i="content");let t=this.getSectionSettings(i);if(t){t.getSection().getCell(e,n)&&(o={},o.colIndex=e,o.rowIndex=n,t.extendEventArg(o))}}return o},Qe.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Qe.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Qe.prototype._getNextCellInRow=function(t,e){let n=this.getCellInfo(t);if(n){let t=n.colIndex+e,i=n.rowIndex,o=n.section;n.colIndex=t,n.cell=o.getCell(t,i)}return n},Qe.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e){if(!e.cell){let t=e.section,n=e.colIndex=0,i=e.rowIndex;e.rowIndex=++i,e.cell=t.getCell(n,i)}}return e},Qe.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e){if(!e.cell){let t=e.section,n=e.colIndex=t.getColumnCount()-1,i=e.rowIndex;e.rowIndex=--i,e.cell=t.getCell(n,i)}}return e},Qe.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Qe.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().setColumnCount(t)}this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},Qe.prototype.insertColumn=function(t,e){let n=this.getColumnCount();t<n||(t=n),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().insertColumn(t)}this._columnDefs.splice(t,0,null),this._deserializeColumn(t,e),this._onColumnCountChanged(),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<n,e)},Qe.prototype.insertColumns=function(t,e){let n=this.getColumnCount();t<n||(t=n);let i,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);i=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let n=t+e;this._layoutX.insertLane(n);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().insertColumn(n)}let o=i&&i[e];this._deserializeColumn(n,o)}this._dispatchColumnAddedEvent(t,o,t<n,i),this.freezeLayout(r)},Qe.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let i=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=i,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=n&&n===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},Qe.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Qe.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Qe.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let n=this.getStationaryColumnIndex();if(n>-1){if(e<=n)return!1;for(let e=0;e<t.length;e++)if(t[e]<=n)return!1}return!0},Qe.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Qe.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let n,i=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(n=0;n<i;++n)r=t[n],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),i=o.length,!i)return!1;if(1===i)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(je),l[e]){let t=!0;for(r=o[0],n=1;n<i;++n)if(++r!==o[n]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(n=0;n<i;++n)a=o[n],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=i-p;for(u=p?e-1:e,n=0;n<d;++n)a=o[n]-n,this._moveColumn(a,u);return this.freezeLayout(h),!0},Qe.prototype._moveColumn=function(t,e){let n=this.getColumnCount();if(t<0?t=0:t>=n&&(t=n-1),e<0?e=0:e>=n&&(e=n-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let n=0;n<r;++n){this._settings[n].getSection().moveColumn(t,e)}let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(_t.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=n-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<n-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=n-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let n=this._colVirtualizer.getFirstIndexInView();t<n&&e<n||t>i&&e>i||this._activateColumns(n,i,n,i)}if(this._hasListener("columnMoved")){let n={};n.fromColIndex=t,n.toColIndex=e,n.colId=o,this._dispatchColumnEvent("columnMoved",n)}return i===this._colVirtualizer.getLastIndexInView()&&(t<=i&&e>i||e<=i&&t>i)&&this._colVirtualizer.update(),this.updateColumnBounds(),this._updateColumnSeparators(),!0},Qe.prototype.moveColumnById=function(t,e){let n=this.getColumnCount(),i=this.getColumnIndex(t);if(i<0||i>=n)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=n),this._moveColumnByIndex(i,o)},Qe.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Qe.prototype.reorderColumns=function(t,e){let n="";"number"==typeof e?n=this.getColumnId(e):e&&(n=e),this.startBatch("move");let i=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),n===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(n),l>=0)for(;++l<u&&(n=a[l],!(h.indexOf(n)<0)););(l<0||l>=u)&&(n="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(n),l<0&&(l=u),i|=this._moveColumnByIndex(s,l),n=r}else i=this.moveColumnById(t[0],n)}else null!=t&&(i=this.moveColumnById(t,n));return this.stopBatch("move"),!!i},Qe.prototype.getColumnLayout=function(){return this._layoutX},Qe.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Qe.prototype._deserializeColumn=function(t,e){if(!e)return;let n,i=e.layout||e,o=e.width;null!=o&&(i.size=o),o=e.scalable,null!=o&&(i.scalable=o),o=e.minWidth,null!=o&&(i.minSize=o),null==i.scalable&&(i.scalable=null==i.size),this._layoutX.deserializeLane(t,i);let r=e.styles;for(n in r)this.setColumnStyle(t,n,r[n]);let s=e.classes;for(n in s)this.enableColumnClass(t,n,s[n]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),h=e.backgroundColor,null!=h&&this.setColumnBackgroundColor(t,h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},Qe.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},Qe.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Qe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Qe.prototype.setSectionRowCount=function(t,e){let n=this.getSection(t);null!=n&&n.setRowCount(e)},Qe.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Qe.prototype.getRelativeIndex=_t._deprecatedFunction,Qe.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},Qe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Qe.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let n=this._settings.length;for(let e=0;e<n;++e){let n=this._settings[e];n.getType()!==this._rowHeightException&&"bottomPadding"!==n.getId()&&n.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Qe.prototype.getDataSource=function(){return this._dataSource},Qe.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Qe.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Qe.prototype.setDataSource=function(t){t&&t instanceof Dt&&(t=new ke(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let n=0;n<e;++n)this._settings[n].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},Qe.prototype.setColumnTemplate=_t._deprecatedFunction,Qe.prototype.getColumnTemplate=_t._deprecatedFunction,Qe.prototype.getColumnRenderEvent=_t._deprecatedFunction,Qe.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(n){e.setColumnDataBindingHandler(t,n)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},Qe.prototype.setColumnStyle=function(t,e,n,i){if(!e)return;let o;_t.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==i?o=this._getNestedColumnDef(t,"styles"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"styles")),o[e]=n;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];if(null==i||i===r.getType()){r.getSection().setColumnStyle(t,e,n)}}},Qe.prototype.getColumnBackgroundColor=function(t){return this._getColumnDef(t).backgroundColor||""},Qe.prototype.setColumnBackgroundColor=function(t,e){if(null==t||"number"!=typeof t)return;let n=this._getColumnDef(t);if(n.backgroundColor===e)return;n.backgroundColor=e,e=null!=e?e:"";let i=this._settings.length;for(let n=0;n<i;++n){let i=this._settings[n],o=i.getSection();if(o)if("content"!==i.getType()){let n=o.getRowCount();for(let i=0;i<n;i++){if(o.getCellColSpan(t,i)>1)continue;let n=o.getCell(t,i);n&&n.setStyle("backgroundColor",e)}}else{o.getColumn(t).setStyle("backgroundColor",e)}}},Qe.prototype.enableColumnClass=function(t,e,n,i){let o;"number"!=typeof t&&(t=0),null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes"));let r=!1;if((n=!1!==n)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().enableColumnClass(t,e,n)}return r},Qe.prototype.hasColumnClass=function(t,e,n){let i;return null==n?i=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),i=this._getNestedColumnDef(t,n,"classes")),!(!i||!i[e])},Qe.prototype.setColumnAlignment=function(t,e){let n=e?e.charAt(0).toLowerCase():"",i=0;i|=this.enableColumnClass(t,"tr-align-left","l"===n),i|=this.enableColumnClass(t,"tr-align-right","r"===n),i|=this.enableColumnClass(t,"tr-align-center","c"===n),i&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:n})},Qe.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},Qe.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),i=n<e?n:e;for(let e=this.getColumnCount()-1;e>=t;--e)i-=this._layoutX.getLaneSize(e);return i}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Qe.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Qe.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Qe.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Qe.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let n,i=0,o={},r=t.length,s=new Array(r);for(n=0;n<r;n++)o[t[n]]=!0,s[n]=e[n],i+=e[n];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?(l+=h.getMinimumLaneSize(n),a++):l+=h.getLaneSize(n));let p=this.getContentWidth(),d=i+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?l+=h.getMinimumLaneSize(n):l+=h.getLaneSize(n));if(d=i+l-p,d>0)for(d/=r,n=0;n<r;n++)s[n]-=d}return s},Qe.prototype.setColumnWidth=function(t,e,n){let i=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,i[0],n);return o&&this._syncLayoutToColumns(t,t+1),o},Qe.prototype.setColumnWidths=function(t,e){let n,i=0,o=[],r=[],s=[];for(n=t.length;--n>=0;){let i=t[n];null!=i&&(o.push(n),r.push(i));let l=Array.isArray(e)?e[n]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(n=0;n<l.length;n++)i|=this._setColumnWidth(o[n],l[n],s[n]);return i&&this._syncLayoutToColumns(0,t.length),!!i},Qe.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Qe.prototype.hideColumn=function(t,e){let n=!1===e;this.setColumnVisibility(t,n,0)},Qe.prototype.hideColumns=function(t,e){let n=Array.isArray(t)?t.length:0,i=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<n;++r){let n=t[r];n>=0&&n<o&&this._layoutX.hideLane(n,e,0)&&i.push(n)}if(i.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=i,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},Qe.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let n=0;n<e;++n)this._layoutX.hideLane(n,!1,0)&&t.push(n);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},Qe.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Qe.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Qe.prototype.setMinimumColumnWidths=function(t,e){let n=0,i=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),i=r,n|=this._layoutX.setMinimumLaneSize(r,s,e))}return n&&this._syncLayoutToColumns(i,o+1),!!n},Qe.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Qe.prototype.setColumnScalability=function(t,e){let n=!1;return _t.isNumber(t)?(e=!1!==e,n=this._layoutX.setLaneScalability(t,e),n&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),n},Qe.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Qe.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Qe.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Qe.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Qe.prototype.isProportionPreserved=function(){return this._preserveProportion},Qe.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Qe.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Qe.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Qe.prototype.newColumnData=Qe.prototype.getColumnData,Qe.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Qe.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Qe.prototype.getFitContentWidth=function(){return this._fitContentWidth},Qe.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Qe.prototype.loadPlugin=function(t,e){let n=null;if("string"==typeof t){let e=window.tr,i=e?e.grid:null;if(!i)return null;if(i[t])n=new i[t];else{if(!i[t+"Plugin"])return null;n=new i[t+"Plugin"]}}else n=t;if(!n||!n.getName)return null;let i=n.getName();if(!i)return null;let o=this._plugins[i];if(o){if(o===n)return o;console.log("WARNING: Two of the same "+i+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(i)}return n.initialize&&n.initialize(this,e),this._plugins[i]=n,n},Qe.prototype.unloadPlugin=function(t){let e;if(t){let n="";"string"==typeof t?n=t:t.getName&&(n=t.getName()),e=this._plugins[n],e||(n+="Plugin",e=this._plugins[n]),e&&(e.unload&&e.unload(this),delete this._plugins[n])}return e||null},Qe.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Qe.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},Qe.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},Qe.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Qe.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Qe.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},Qe.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Qe.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Qe.prototype.getFooterCount=function(){return this._frozenFooterCount},Qe.prototype.freezeColumn=function(t,e){let n,i,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),n=0;n<o;++n)i=this._getColumnDef(n),i.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),n=o;--n>=0;)i=this._getColumnDef(n),i.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Qe.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let n=this._columnDefs[e];if(n&&n.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},Qe.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,n=this._columnDefs.length;for(e=0;e<n;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=n-e}return this._pinnedRightColumnCount=t,t},Qe.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Qe.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Qe.prototype.getPinnedLeftColumnCount=Qe.prototype.getFrozenColumnCount,Qe.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Qe.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Qe.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Qe.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Qe.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,n,i=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&i&&i.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)n=this._settings[e].getSection(),n.setFrozenLayout(this._frozenLayout);if(!this._frozenLayout){this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),i&&i.freezeIndicator(!1)}this._rowHeightSync=!0}return e},Qe.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Qe.prototype.isLayoutFrozen=function(){return this._frozenLayout},Qe.prototype.showBorders=_t._deprecatedFunction,Qe.prototype.hideBorders=_t._deprecatedFunction,Qe.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Qe.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Qe.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Qe.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Qe.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Qe.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Qe.prototype.setDataColumnMap=function(t){let e,n;if(t)for(e=t.length;--e>=0;)n=this._getColumnDef(e),n.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)n=this._columnDefs[e],n&&null!=n.dataColumnName&&(n.dataColumnName=null)},Qe.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Qe.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Qe.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Qe.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Qe.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Qe.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Qe.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Qe.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Qe.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},Qe.prototype._getTarget=function(t){let e=t.target;if(e){let n=null;return this._element.contains(e)||(n=t.composedPath?t.composedPath():t.path),n?n[0]||null:e}return t.getElement?t.getElement():_t.isElement(t)?t:null},Qe.prototype.getRelativePosition=function(t,e){if(!t)return{};let n=e||{},i=this._getTarget(t);t.target?_t.getRelativePosition(t,this.getElement(),n):i&&_t.getRelativePosition(i,this.getElement(),n),1!==this._zoomFactor&&(n.x/=this._zoomFactor,n.y/=this._zoomFactor),n.hit=!1,n.grid=this,n.clientX=t.clientX,n.clientY=t.clientY,n.zoomFactor=this._zoomFactor;let o=_t.closestElement(i,"cell");if(!o)return n;n.cellElement=o;let r=_t.closestElement(o,"column");n.columnElement=r;let s=null;if(s=r?_t.closestElement(r,"tr-lg"):_t.closestElement(o,"tr-lg"),!s)return n;n.sectionName=s.id||_t.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(n.sectionName);if(!l)return n;l.extendEventArg(n);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0?n:(n.colIndex=u,!1===this._hitTestY(-1,n)||(o.stretched?n.cell=a.getStretchedCell(u,n.rowIndex):n.cell=a.getCell(u,n.rowIndex),n.hit=!0),n)},Qe.prototype.getVScrollbar=function(){return this._vscrollbar},Qe.prototype.getHScrollbar=function(){return this._hscrollbar},Qe.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Qe.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Qe.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Qe.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let n=this._layoutX.getLaneCount();if(t<=0?t=0:t>=n&&(t=n-1),this.isPinnedColumn(t))return!1;let i=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+i,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=l){let t=a-i;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},Qe.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Qe.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Qe.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Qe.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Qe.prototype.getYScrollVal=function(t,e,n){if(!this._updateScrollbar(this._vscrollbar))return null;let i=null;t&&(i=this.getSection(t));let o=i?i.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],r=this._layoutY.getLaneStart(this._startVScrollbarIndex),s=this._layoutY.getLaneCount();if(e<=0?e=0:e>=s&&(e=s-1),n)return this._layoutY.getLaneStart(e+o)-r;let l=this.getVerticalViewInfo();if(e<l.firstFullRow){let t=e-2;return t<0&&(t=0),this._layoutY.getLaneStart(t+o)-r}if(e>l.lastFullRow){return this._layoutY.getLaneStart(e+o+2+1)-l.viewHeight-r}return null},Qe.prototype.scrollToRow=function(t,e,n){let i=this.getYScrollVal(t,e,n);null!==i&&this._vscrollbar.setScrollTop(i)},Qe.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),n=this._vscrollbar.getHeight(),i=this._vscrollbar.getScrollTop()+e,o=i+n,r=this._layoutY.hitTest(i)-t,s=this._layoutY.hitTest(o-.1);return s<0&&(s=this._layoutY.getLaneCount()-1),s-=t,{topRowIndex:r,firstFullRow:this._layoutY.getLaneStart(r+t)<i?r+1:r,lastFullRow:this._layoutY.getLaneEnd(s+t)>o?s-1:s,bottomRowIndex:s,viewHeight:n,viewTop:i,viewBottom:o}},Qe.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],n=this._layoutY.getLaneStart(e),i=this._vscrollbar.getScrollTop()+n,o=this._vscrollbar.getHeight(),r=i+o,s=this._layoutY.hitTest(i),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s+e),u=this._layoutY.getLaneEnd(l+e),h=i-o,p=h<=n?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,l-=e;let _={};return _.viewTop=i-n,_.viewBottom=r-n,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<i?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Qe.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Qe.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Qe.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Qe.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Qe.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Qe.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Qe.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Qe.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Qe.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Qe.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Qe.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;){this._settings[t].enableColumnVirtualization(e)}},Qe.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Qe.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Qe.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Qe.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},Qe.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},Qe.prototype.updateRowData=function(t,e,n,i){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,n,i)},Qe.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},Qe.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Qe.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Qe.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},Qe.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Qe.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Qe.prototype.getData=function(t,e,n){let i=this.getSectionSettings(t);if(!i)return null;let o=this._toDataColumnName(e);return i.getData(o,n)},Qe.prototype.setData=function(t,e,n,i){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,n,i)}return!1},Qe.prototype.removeRowData=function(t,e){let n=this.getSectionSettings(t);return!(!n||!n.isDataBindable())&&n.removeRowData(e)},Qe.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let n=e.length;--n>=0;)e[n].setHidingMethod(t)}},Qe.prototype.getHorizontalLayout=function(){return this._layoutX},Qe.prototype.setColumnVisibility=function(t,e,n){if(this._layoutX.hideLane(t,!e,n)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){let n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Qe.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Qe.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},Qe.prototype.getHiddenInput=function(t){return t?this._firstHiddenInput:this._lastHiddenInput},Qe.prototype.focus=function(){let t=this._lastHiddenInput,e=Je(t);if(t&&t!==e){let e=window.pageXOffset,n=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});n===window.pageYOffset&&e===window.pageXOffset||window.scrollTo(e,n)}},Qe.prototype.isBinding=function(){return this._dispatchingDataChanged},Qe.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Qe.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Qe.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Qe.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Qe.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Qe.prototype.initSimpleTable=function(t){let e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));let n=this.addSection("title");if(n.addRow(1),!this._renderingHandler)for(let i=0;i<e;++i)n.setCellContent(i,0,t[i]);this.addSection("content");let i=this.getSectionSettings("title");i.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(i),this._dataBindingHandler||this.setDefaultDataBindingHandler(Qe._defaultDataBinding)},Qe._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Qe.prototype.selectColumn=function(t,e){for(let n=this._settings.length;--n>=0;)this._settings[n].getSection().selectColumn(t,e);this.updateColumnBounds()},Qe.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Qe.prototype.updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,n=[],i=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),i||(i=[e,-1])):i&&(i[1]=e-1,n.push(i),i=null);i&&(i[1]=o-1,n.push(i),i=null);let s={selectedColumns:r,selectionRanges:n};this._dispatch("beforeColumnBoundUpdate",s);let l=n.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){i=n[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(i[0],i[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},Qe.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},Qe.prototype.getColumnRect=function(t,e){let n=this.getElement().clientWidth,i=n,o=this._hscrollbar;o.isActive()&&(i=o.getTrackSize());let r=0,s=0;if(this._settings.length){let n=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,n,[]),r=n[0],s=n[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:i,gridWidth:n}},Qe.prototype.getRowRect=function(t,e){let n=this._layoutX.getTrackSize(),i=this.getElement().clientWidth;n=n<i?n:i;let o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(a=h.getScrollTop(),u=h.getTrackSize());let p=u+l,d=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return d<l?d=l:d>p&&(d=p),c<l?c=l:c>p&&(c=p),d-=l,c-=l,{top:d,left:0,width:n,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},Qe.prototype.normalizeConfig=function(t){t||(t={});let e,n,i=t.columns,o=i?i.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=o;--e>=0;)--s>=0&&(n=i[e],n&&(n.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&i&&(n=i[r],n&&(n.leftPinned=!0))),t},Qe.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Qe.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Qe.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Qe.prototype.getValidColumnList=function(t,e){let n=[];if(!t)return n;e||(e=this.createColumnMap(t));let i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t).id;null!=e[i]&&n.push({index:t,id:i})}return n},Qe.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},n=t.length;for(let i=0;i<n;i++){let n=t[i];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},Qe.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},Qe.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],L(this._batches)&&(this._batches=null),!0)},Qe.prototype._dispatchColumnEvent=function(t,e){let n=this._batches;n&&(e.batches=n),this._dispatch(t,e)},Qe.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Qe.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Qe.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let n=0;n<e;n++)t.push(this._settings[n].getSection());return t},Qe.prototype._getNextSection=function(t,e,n){let i=this.getSectionIndex(e)+t;if(null==n)return this.getSectionSettings(i);n=this._toSectionType(n);let o=this._settings.length;for(;i>=0&&i<o;){let e=this._settings[i];if(n===e.getType())return e;i+=t}return null},Qe.prototype._toSectionType=function(t){if(Qe._sectionType[t])return t;if(_t.isString(t)){switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}}return"content"},Qe.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let n={horizontalScrollbar:this._hscrollbar},i="content"===t?new qe(n):new Ee(n);i._setContext(this);let o=new Be(i);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return i.enableRowHighlighting(r),i.enableShading(!1),i.setHidingMethod(this._hidingMethod),o.enableColumnVirtualization(this._colVirtualizer.isEnabled()),i.setColumnCount(this._layoutX.getLaneCount()),i.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(i),this._syncStyleToSectionColumns(i,t),t!==this._rowHeightException&&i.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),i.listen("rowHighlighted",this._onRowHightlighted),i.listen("rowCountChanged",this._onRowCountChanged),i.listen("rowHeightChanged",this._onRowHeightChanged),o},Qe.prototype._putToLast=function(t){if(0===this._settings.length)t.insertBefore(this._lastHiddenInput);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.insertBefore(this._lastHiddenInput)}},Qe.prototype._syncStyleToSectionColumns=function(t,e){let n;for(let i=this._columnDefs.length;--i>=0;){let o=this._getColumnDef(i),r=o.styles;for(n in r)t.setColumnStyle(i,n,r[n]);let s=o.classes;for(n in s)t.enableColumnClass(i,n,!0);let l=o[e];if(l){for(n in r=l.styles,r)t.setColumnStyle(i,n,r[n]);for(n in s=l.classes,s)t.enableColumnClass(i,n,!0)}}},Qe.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},Qe.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Qe.prototype._setColumnWidth=function(t,e,n){let i=!1,o=this._layoutX;if(null!=n)i=o.setLaneScalability(t,!!n);else{let n=o.getLaneScalability(t);if(this._preserveProportion){if(n){let n=this.getColumnCount(),i=0,r=0;for(let t=0;t<n;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);i+=o.getCustomLaneSize(t),r+=e}(!(e=(e*i-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=i)}}else i=o.setLaneScalability(t,!1)}return i=o.setLaneSize(t,e)||i,i},Qe.prototype._dispatchColumnAddedEvent=function(t,e,n,i){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=n,1===e)o.colIndex=t,o.context=i,this._dispatchColumnEvent("columnAdded",o);else{let n=Array.isArray(i)?i:[];for(let i=0;i<e;++i)o.colIndex=t+i,o.context=n[i],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Qe.prototype._dispatchColumnRenderEvent=function(t,e,n,i,o,r,s){if(!(i<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=n,this._hasListener("preSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<n;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=i;l<o;++l){let n=this._settings[l];n.extendRenderEventArg(t,r,s);let i=n.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let n=o;n<u;++n)t.rowIndex=n,t.cell=i.getCell(a,n,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=i;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},Qe.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let n=t.fromRowIndex,i=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=i-1;l>=n;--l){let n=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(n);if(t>0){l=l+t+1,s=!0;continue}}let i=r.getContextRow(l);if(!i)continue;let a=e.getExpansionParentByRowId(n);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=i.rowExpansion=!0;else{if(!i.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=i.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},Qe.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let n=e-t;this._layoutX.setLaneCount(n);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().setColumnCount(n)}let i=this._columnDefs.slice(n);if(this._columnDefs.length=n,this._onColumnCountChanged(),this._syncLayoutToColumns(n,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=n;){let e=i[o-n];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},Qe.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let n,i,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(n=l.getVisibleRowIds(!0),i=l.getMultipleRowData(n,o,r),t.dataRows=i);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){let o=a?i[h]:null;o&&(t.rowData=o,t.rowId=n[h],t.dataValue=o?o[u]:null,t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(t))}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1},Qe.prototype.resetInternalState=function(){this._firstRendered=!1},Qe.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Qe.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Qe.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this.updateColumnBounds(),this._dispatchColumnPositionChanged()},Qe.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Qe.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Qe.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,n=t.lastIndex+1,i=this._settings.length,o=[0,0];for(let t=0;t<i;++t){let i=this._settings[t],r=i.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,n,o),this.updateRowData(i,o[0],o[1]-1))}},Qe.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,n=t.prevLastIndex,i=t.firstIndex,o=t.lastIndex,r=e<i?e:i,s=n>o?n:o;this._activateColumns(i,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},Qe.prototype._activateColumns=function(t,e,n,i){null==n&&(n=0),null==i&&(i=this.getColumnCount()-1);let o=this._getColActivationList(t,e,n,i);for(let t=this.getSectionCount();--t>=0;){this._settings[t].activateColumns(o,n,i)}},Qe.prototype._getColActivationList=function(t,e,n,i){null==n&&(n=0);let o=this.getColumnCount();null==i&&(i=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(i+1);for(let o=n;o<=i;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},Qe.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Qe._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Qe.prototype._getNestedColumnDef=function(t,e,n){let i=this._getColumnDef(t);if(e){let t=i;i=t[e],i||(i=t[e]={}),n&&(t=i,i=t[n],i||(i=t[n]={}))}return i},Qe.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Qe.prototype._getColumnId=Qe.prototype.getColumnId,Qe.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).id||"";return e},Qe.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Qe.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Qe.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).field||"";return e},Qe.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,n=-1,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id)return t;e===i.field&&n<0&&(n=t)}return n}return-1},Qe.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Qe.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},n="";for(let i=0;i<t;++i){let t=this._getColumnDef(i);n=t.field,n&&(e[n]=i),n=t.id,n&&(e[n]=i)}return e},Qe.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Qe.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Qe.prototype._onGridClicked=function(){window.getSelection().toString()||this._element.contains(Je(this._element))||this.focus()},Qe.prototype._onKeyDown=function(t){if(!function(t){return 9===t.keyCode&&(!t.ctrlKey&&!t.altKey&&!t.metaKey)}(t))return;let e=Je(this._element),n=!1;this._firstHiddenInput===e?n=-1:this._lastHiddenInput===e&&(n=1),this._dispatch("tabNavigation",{activeElement:e,firstHiddenInput:this._firstHiddenInput,lastHiddenInput:this._lastHiddenInput,onTheEdge:n,shiftKey:t.shiftKey,event:t}),n&&!t.defaultPrevented&&(n>0&&t.shiftKey?this._firstHiddenInput.focus():n<0&&!t.shiftKey&&this._lastHiddenInput.focus())},Qe.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,n=this.getSectionSettings(e.getId());if(null==n)return;n.extendEventArg(t);let i=n.getDataSource();null!==i&&(t.rowId=i.getRowId(t.rowIndex),t.dataRow=i.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},Qe.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,n=t.prevCount,i=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(n>i)this._layoutY.removeLaneAt(r,n-i),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+n,i-n),o!==t)for(s=n;s<i;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),n<i?this._dispatch("rowAdded",t):n>i&&this._dispatch("rowRemoved",t)},Qe.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),n=e.length,i=NaN;for(let t=0;t<n;++t){let n=e[t],o=n.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=n.rowIndex,l=this.getRowIndex(r,s),a=n.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=i||(i=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):i>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(i<this._startVScrollbarIndex,i>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},Qe.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Qe.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},Qe.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),this._element.appendChild(this._lastHiddenInput),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},Qe.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this.updateColumnBounds(),this._updateColumnSeparators(),this._hScrollbarEnabled&&t+e<this.getColumnCount()?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),t,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate(),t=e=0),this._element.classList.toggle("right-pinning",e>0),this._dispatchColumnPositionChanged()},Qe.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Qe.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Qe.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Qe.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Qe.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Qe.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let n=this._layoutY.getLaneStart(this._sectionStarts[t]),i=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[i]):0)-n},Qe.prototype._updateScrollbarHeight=function(t,e,n){if(!this._vscrollbar.isEnabled())return!1;let i=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,i=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),n=this._vscrollbar.getParent();n?n!==e&&n.firstElementChild&&(n=n.firstElementChild):(n=t,this._vscrollbar.setParent(n));let i=this._getVScrollStart(),o=this._getFooterSize();n!==t&&(i+=t.clientTop),this._vscrollbar.resetPaneSize();let r=n.clientHeight-(i+o)*this._zoomFactor;this._vscrollbar.setTop(i*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return n||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(i),s},Qe.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),i=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(i)-this._layoutX.getLaneStart(i-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(n+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Qe.prototype._hitTestY=function(t,e){let n;if(e.sectionSettings)n=e.sectionSettings;else{let i;i="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=i>=0?i:~i,r=_t.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,n=this._settings[r],!n)return!1;n.extendEventArg(e)}let i=n.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=i.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+i.getRowOffset(),!0},Qe.prototype._syncLayoutToColumns=function(t,e,n){if(this._frozenLayout)return;let i=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=i,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let n=0;n<r;++n)s=this._syncLayoutToSectionColumns(this._settings[n].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this.updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||n)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},Qe.prototype._syncLayoutToSectionColumns=function(t,e,n){null==e&&(e=0),null==n&&(n=this._layoutX.getLaneCount());let i=0;for(let o=e;o<n;++o)i|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!i||this._frozenLayout)&&(t._updateColumnLayout(),!0)},Qe.prototype._toDataColumnName=function(t){return _t.isNumber(t)?this.getDataColumnName(t):t},Qe.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let e=this._settings.length,n=this._settings[0]||null;n!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=n,this._firstSettings&&this._firstSettings.getSection().addClass("first"));let i=this._settings[e-1]||null;i!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=i,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let n=t;n<e;++n){let t=this._settings[n].getSection();t.setIndex(n),t.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+t.getRowCount()}return this._sectionStarts[t]},Qe.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t){this._settings[t].getSection().updateLayout()}this._updateColumnSeparators()},Qe.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Qe._proto=Qe.prototype;let Ze={chainIcon:""};Ze.styles=function(t){if(t){let e="";if(Array.isArray(t)){e=t.map(F).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {")}else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,P)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),Ze.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,z(Ze.styles,t.getElement()))};var $e=Ze;let tn=function(){this._counter={},this._session={},this._referers={}};tn.prototype._counter=null,tn.prototype._session=null,tn.prototype._referers=null,tn.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},tn.prototype.newSession=function(){this._session={}},tn.prototype.getAllReferences=function(){return Object.keys(this._counter)},tn.prototype.hasReference=function(){for(const t in this._counter)return!0;return!1},tn.prototype.getAllReferers=function(){return Object.keys(this._referers)},tn.prototype.getAllReferrers=tn.prototype.getAllReferers,tn.prototype.getSession=function(){let t=[],e=[];for(let n in this._session){let i=this._session[n];i>0?t.push(n):i<0&&e.push(n)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},tn.prototype.addReference=function(t,e){if(t){if(e){let n=this._referers[e];if(n){if(n[t])return!1}else n=this._referers[e]={};n[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},tn.prototype.addRef=tn.prototype.addReference,tn.prototype.removeReference=function(t,e,n){if(!t)return!1;let i=this._counter[t];if(!i)return!1;if(null==n)n=1;else if(n<0)n=i;else if(!n)return!1;if(e){let n=this._referers[e];if(!n)return!1;if(!n[t])return!1;delete n[t]}return i-=n,!i||i<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=i,!1)},tn.prototype.release=tn.prototype.removeReference,tn.prototype.addReferences=function(t,e){if(!t)return 0;let n=0;if(Array.isArray(t)){let i=t.length;for(let o=0;o<i;++o)this.addReference(t[o],e)&&++n}else if("string"==typeof t)this.addReference(t,e)&&++n;else for(let i in t)this.addReference(i,e)&&++n;return n},tn.prototype.removeReferer=function(t){let e=0;if(t){let n=this._referers[t];if(n){for(let i in n)this.removeReference(i,t)&&++e;delete this._referers[t]}}return e},tn.prototype.removeReferrer=tn.prototype.removeReferer,tn.prototype.log=function(){console.log(this._counter)};var en=tn;let nn=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new r(0,t._commitFieldsChanges),t._ricChangedConflator=new r(0,t._commitRicsChanges),t._fields=new en,t._rics=new en,t._rowDefMap={}};s.inherits(nn,a),nn.prototype._fieldChangedConflator=null,nn.prototype._ricChangedConflator=null,nn.prototype._rowDefMap=null,nn.prototype._rics=null,nn.prototype._fields=null,nn.prototype.getAllRics=function(){return this._rics.getAllReferences()},nn.prototype.hasRic=function(){return this._rics.hasReference()},nn.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},nn.prototype.getAllFields=function(){return this._fields.getAllReferences()},nn.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},nn.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let n=this._rowDefMap,i=n[e];i?i.indexOf(t)<0&&i.push(t):i=n[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},nn.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let n=this._rowDefMap[e];if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},nn.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},nn.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"ricRemoved",removedRics:n}),i.length&&this._doDispatch({type:"ricAdded",addedRics:i}),t.newSession()},nn.prototype.addFields=function(t,e){if(!t)return;let n=this._fields;t instanceof jt?n.addReferences(t.getAllFields(),t.getId()):n.addReferences(t,e),this._commitFieldsChanges()},nn.prototype.removeFields=function(t,e){t&&(t instanceof jt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},nn.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},nn.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},nn.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"fieldRemoved",removedFields:n}),i.length&&this._doDispatch({type:"fieldAdded",addedFields:i}),t.newSession()},nn.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},nn.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var on=nn;let rn=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},sn=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};sn.prototype._globalContext,sn.prototype._sortParams,sn.prototype._ctxCaches,sn.prototype._primaryParams,sn.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},sn.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:sn._noSorting},sn.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},sn.prototype.setContext=function(t,e){this._globalContext[t]=e},sn.prototype.addColumnContext=function(t,e,n,i,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=A(this._globalContext));let a=0;"a"===i?a=1:"d"===i&&(a=-1);let u=[t,"function"==typeof e?e:null,l,n,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},sn._noSorting=function(t,e,n){return 0},sn.prototype._defaultSorter=function(t,e,n){let i=this._primaryParams[0];return rn(t.getData(i),e.getData(i),n)},sn.prototype._dataSorter=function(t,e,n){let i=this._primaryParams,o=i[0];return(0,i[1])(t.getData(o),e.getData(o),n,i[2])},sn.prototype._rowDefSorter=function(t,e,n){let i=this._primaryParams;return(0,i[1])(t,e,n,i[2])},sn.prototype._multiColumnsSorter=function(t,e,n){let i=this._sortParams,o=i.length;for(let n=0;n<o;++n){let o=i[n],r=o[0],s=o[1],l=o[2],a=o[3],u=o[4],h=0;if(h=s?a?s(t,e,u,l):s(t.getData(r),e.getData(r),u,l):rn(t.getData(r),e.getData(r),u),h)return h}return 0};var ln=sn;let an=function(t){let e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};l.inherits(an,mt),an.prototype._hosts=null,an.prototype._sortStates,an.prototype._maxCount=1,an.prototype._dataSorting=!0,an.prototype._dblClickAllowed=!1,an.prototype._clickTimer=0,an.prototype._delayInterval=0,an.prototype._lastMouseDown=0,an.prototype._initialSort=null,an.prototype._mode="",an.prototype._sortableColumns=!0,an.prototype._sortableIndicator=!1,an.prototype._solarTheme=!1,an.prototype._sortLogic,an.prototype._userManagedLogic=!1,an.prototype._disabled=!1,an.prototype._frozenIndicator=!1,an.prototype._rowDefMode=!1,an._icons={},an.prototype._sortingSequence,an.prototype._sortingSequenceMap=null;an.prototype.getName=function(){return"SortableTitlePlugin"},an.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},an.prototype.unload=function(t){let e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},an.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},an.prototype.config=function(t){if(!t)return;let e=this,n=t.icons;null!=n&&n.sorting&&(an._icons=n.sorting);let i=t.themeName;!i||i.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},an.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i=this._hosts[0];if(!i)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=n[e],o||(o=n[e]={}),o.sortOrder=t.sortOrder}for(s=i.getColumnCount(),r=0;r<s;++r)o=n[r],o||(o=n[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),L(e.sorting)&&delete e.sorting,e},an.prototype.getColumnMenu=function(t,e){e||(e={});let n=e.menus;n||(n=e.menus=[]);let i=n[0];i||(i=n[0]={menuItems:[]});let o=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return i.menuItems.push(r),e},an.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,n=e.colIndex,i=e.sortOrder;this.sortColumn(n,i)},an.prototype.getIcons=function(){return an._icons},an.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let n=e.getDataSource();for(let e in t)this._setSortLogic(n,e,t[e])}}},an.prototype.setSortLogic=function(t,e){if("string"==typeof t){let n=this._hosts[0];if(n){let i=n.getDataSource();this._setSortLogic(i,t,e)}}},an.prototype._setSortLogic=function(t,e,n){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(n):t.setColumnSortingLogic(e,n))},an.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,n=this._sortStates[e];return(n?n.sortOrder:"")||"n"},an.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},an.prototype.getSortPriority=function(t,e){let n=this._hosts[0];if(n){let i,o=this._sortStates.length;if(t>=0){let e=n.getColumnId(t);if(e)for(i=0;i<o;++i)if(this._sortStates[i].colId===e)return i}else if(e)for(i=0;i<o;++i){let t=this._sortStates[i];if(t.colId===e)return i;if(t.field===e)return i}}return-1},an.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},an.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let n=0;n<t;++n){let t=this.getSortedColumnIndex(n),i=this._sortStates[n],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=i.field||"";s&&(o.field=s),o.sortOrder=i.sortOrder||"n",e[n]=o}return e},an.prototype.isSorting=function(){return!!this._sortStates.length},an.prototype.sortColumn=function(t,e,n){let i=this._prepareSorting(t,e);if(this._sortColumn(i,n),n&&n.isUserAction){let t={};t.colIndex=i.colIndex,t.sortOrder=this.getSortOrder(i.colIndex),t.dataColumnName=this.getColumnSortingField(i.colIndex),this._dispatch("clicked",t)}},an.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let n=t.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=this._prepareSorting(t[e]);this._sortColumn(i,e)}},an.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},an.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},an.prototype.restoreUserActions=an.prototype.refresh,an.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},an.prototype.getSortingStates=function(){return this._sortStates},an.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},an.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let n=t.getColumnCount();for(let t=0;t<n;++t)e[t]=this.getColumnSortingField(t)}return e},an.prototype.getDataColumnNames=an.prototype.getDataColumnMap,an.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},an.prototype.setDataColumnNames=an.prototype.setDataColumnMap,an.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),n=e?e.field:null;if(null==n&&!this._rowDefMode){let i=this._hosts[0];i&&(n=i.getColumnField(t),n||(n=i.getDataColumnName(t)),n&&e&&(e.field=n))}return n||""},an.prototype.setColumnSortingField=function(t,e,n,i){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==n||this._userManagedLogic||o.sortLogic!==n&&(o.sortLogic=n||null,i&&n&&(n.rowSorting=!0))}};let un=function(t){return t.field||""};an.prototype.getColumnSortingFields=function(){return this._sortStates.map(un)},an.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?an._toSortOrder(e):"a")&&"d"!==e&&(e="a");let n=null;n=Array.isArray(t)?t:[t];let i=n.length;for(let t=0;t<i;++t){let i=n[t],o=this.getSortingSequence(i).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,i)}},an.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},an.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},an.prototype.disableSortSymbols=function(t){},an.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},an.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},an.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},an.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let n=t.length;for(let i=0;i<n;++i)this._disableColumnSorting(t[i]||0,e)}},an.prototype._disableColumnSorting=function(t,e){let n=this._newSortOptions(t);n.disabled!==e&&(n.disabled=e)},an.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},an.prototype._initialSortByColumnField=function(t){let e=t.columns,n=e?e.length:0;for(let t=0;t<n;t++){let n=e[t].defaultSort;if(n)return{colIndex:t,sortOrder:n}}return null},an.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},an.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},an.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let n=this._getPlugin("CellEditingPlugin");if(n&&n.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let i=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,i,r)},an.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let n=t.grid;n&&n.focus&&n.focus()}},an.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},an.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},an.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},an.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let n=t.getRelativePosition(e);if(!n.hit)return;let i=this._getPlugin("ColumnSelectionPlugin");if(i&&i.isEnabled()){let t=n.colIndex;if(!i.isSelectedColumn(t))return}n.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,n),this._delayInterval)):this._proceedSorting(n)},an.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let n=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),n=!0;return this._sortStates.length=t,this._sortDataView(e),n},an._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},an.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},an.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let n;if(null!=e&&("string"==typeof e?n=e:"number"==typeof e&&(n=this.getColumnSortingField(e))),t){let e=t.map(an._toSortOrder);n?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[n]=e):this._sortingSequence=e}else n?this._sortingSequenceMap&&delete this._sortingSequenceMap[n]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},an.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},an.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{let t=e.getSortingLogics(),n=[],i=[],o=this._sortStates.length,r=an._toRowDefField();for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?r:e.field;n.push(e.sortOrder),i.push(o)}e.sortSeparators(t,n,i)}},an.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let n=this._hosts[0];if(!n)return null;let i=-1,o="";"number"==typeof t?i=t:"string"==typeof t?(o=t,i=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?i=this._getColumnIndex(o):"number"==typeof t.colIndex&&(i=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(i>=0){r=this.getColumnSortingField(i);let t=this._getSortOptions(i);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(i,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=an._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(i<0&&!r)return null;if(!a){a={};let t=n.getColumnId(i);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:i,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},an.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let n=null;if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i){let e=t[i];e&&(n?(n.colIndices||(n.colIndices=[],n.sortedFields=[],n.sortOrders=[],n.prevOrders=[]),n.colIndices.push(e.colIndex),n.sortedFields.push(e.sortedField),n.sortOrders.push(e.sortOrder),n.prevOrders.push(e.prevOrder)):n=e)}n=t[0]}else n=t;this._dispatch("columnSorted",n)},an.prototype._onColumnAdded=function(t){let e=this,n=t.colIndex,i=t.context||{},o=!!e._sortableColumns,r=i.field,s=i.sortBy;null!=s&&(o=!!s,r=s),null!=i.sortable&&(o=!!i.sortable);let l=i.sortLogic||i.sortingLogic||i.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=i.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(n,r,l,i.rowSorting):e.disableColumnSorting(n,!0);let u=i.sortOrder||i.sort;null!=u&&(u=an._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(n,u)))},an.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let n=t.colId;if(n)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===n){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},an._toRowDefField=function(t){return"ROW_DEF"},an.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let n=null,i=null,o=null;if(e){n=new Array(e),i=new Array(e);for(let t=0;t<e;++t)n[t]=this._sortStates[t].sortOrder,i[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(an._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,n,i,e)}}},an.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let n=null;for(let t=e.length;--t>=0;){let i,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==n&&(i=o.getSection())&&(n=i.getColumnIndex(o.getParent()))}return e.length=0,n},an.prototype._updateSortableIndicator=function(t){let e=this,n=e._hosts[t];if(!n||this._frozenIndicator)return;let i=n.getSection("title");if(null!=i)for(let n=i.getColumnCount();--n>=0;){let o=i.getRowCount();for(let r=0;r<o;r++){let s=i.getCell(n,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(i,n,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(n),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=an._icons.ascending):(t="▼",a=an._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=an._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},an.prototype._createIconElem=function(t,e){let n;return t&&"string"==typeof t?(n=document.createElement("ef-icon"),n.setAttribute("icon",t)):(n=document.createElement("span"),n.textContent=e),n},an.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},an.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},an.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},an.prototype._newSortOptions=function(t){let e=this._hosts[0],n=null;if(e&&t>=0){let i=e.getColumnData(t);n=i.sortableTitle,n||(n=i.sortableTitle={})}return n||{}},an.prototype._isCellSortable=function(t,e,n){let i=this._getSortOptions(e);if(i){if(i.disabled)return!1;let t=i.field;if(null!=t&&!t)return!1}let o=t.getCell(e,n,!0);return!o.hasClass("no-sort")&&(o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed"))},an._proto=an.prototype;let hn=function(t){return t?t.getRowData():null},pn=function(t){return!t.isAutoGenerated()},dn=function(t){return!t.autoGenerated},cn=function(t,e,n,i){return(t.getData(i)-e.getData(i))*n},_n=function(t,e,n){let i=t.getParent();if(!i)return 0;let o=e.getParent();if(!o)return 0;if(i!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*n},fn=function(t){return t?t.getName():""},gn=function(t,e){return t.getField()===e||t.getId()===e},yn=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},mn=function(t){t&&t.preventDefault()},Cn=function(t){return t&&clearTimeout(t),0},Sn=function(t,e){let n=this;if(n._onDataChanged=n._onDataChanged.bind(n),n._onQuote2PostUpdate=n._onQuote2PostUpdate.bind(n),n._onQ2DataChanged=n._onQ2DataChanged.bind(n),n._onDataComposed=n._onDataComposed.bind(n),n._onSubSegmentChanged=n._onSubSegmentChanged.bind(n),n._recalculateFormulas=n._recalculateFormulas.bind(n),n.updateColumnTitle=n.updateColumnTitle.bind(n),n._populateTimeSeriesChildren=n._populateTimeSeriesChildren.bind(n),n._onPostSectionDataBinding=n._onPostSectionDataBinding.bind(n),n._asyncClearDataUpdates=n._asyncClearDataUpdates.bind(n),n._clearDataUpdates=n._clearDataUpdates.bind(n),n._onPreDataSorting=n._onPreDataSorting.bind(n),n._mainSorter=n._mainSorter.bind(n),n._updateRowData=n._updateRowData.bind(n),n._onFormulaDataChanged=n._onFormulaDataChanged.bind(n),n._onFormulaDataRequired=n._onFormulaDataRequired.bind(n),n._registerConstituents=n._registerConstituents.bind(n),n._onColumnAdded=n._onColumnAdded.bind(n),n._onRowExpansionBinding=n._onRowExpansionBinding.bind(n),n._onColumnHeaderBinding=n._onColumnHeaderBinding.bind(n),n._getRowId=n._getRowId.bind(n),n._onFieldLoadedError=n._onFieldLoadedError.bind(n),n._snapshotFillerDataChanged=n._snapshotFillerDataChanged.bind(n),n._onPollingInterval=n._onPollingInterval.bind(n),n._onTabNavigation=n._onTabNavigation.bind(n),n._requestScroll=n._requestScroll.bind(n),n._onVScroll=n._onVScroll.bind(n),n._selfScrollToRow=n._selfScrollToRow.bind(n),n._dcConflator=new r(50,n._onDataChanged),n._formulaConflator=new r(300,n._onFormulaDataChanged),n._chainConflator=new r(100,n._registerConstituents),n._columnTitleConflator=new r(0,n.updateColumnTitle),n._timeSeriesChildConflator=new r(0,n._populateTimeSeriesChildren),n._defaultColumnOptions={},n._topNode=t||o.div(),n._topNode.classList.add("rt-grid"),n._grid=new Qe,n._grid._wrapper=this,n._sorter=new ln,n._sorter.setContext("grid",this),n._sorter.setContext("core",n._grid),n._dateTimeUtil=$,n._grid.listen("columnAdded",n._onColumnAdded),e){if(e.dataView){n._sharedDataSource=!0,n._dv=e.dataView,n._dt=n._dv.getDataTable(),n._mainGrid=e.grid;let t=n._mainGrid.getCoreGrid();n._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(n._stp=e.SortableTitle),!1===e.topSection&&(n._topSection=!1)}n._sharedDataSource||(n._dc=new Ct,n._dc.listen("dataChanged",n._onDataChanged),n._dc.listen("dataComposed",n._onDataComposed),n._dt=new It,n._dt.setSortingLogic(n._mainSorter),n._dt.setClassificationSource(n._dc),n._dt.listen("subSegmentChanged",n._onSubSegmentChanged),n._dv=new Ve(n._dt),n._dv.listen("pageIndexChanged",n._dispatch.bind(n,"pageIndexChanged")),n._dv.listen("pageCountChanged",n._dispatch.bind(n,"pageCountChanged"))),n._grid.setDataSource(n._dv),n._stp?(n._sharedSorter=!0,n._stp.listen("preDataSorting",n._onPreDataSorting),n._grid.loadPlugin(n._stp)):(n._stp=new an({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),n._stp.listen("preDataSorting",n._onPreDataSorting),n._grid.loadPlugin(n._stp,e)),n._grid.listen("beforeContentBinding",n._dispatch.bind(n,"beforeContentBinding")),n._grid.listen("preSectionRender",n._onColumnHeaderBinding),n._grid.listen("postSectionDataBinding",n._onPostSectionDataBinding),n._grid.listen("firstRendered",n._dispatch.bind(n,"firstRendered")),n._grid.listen("afterContentBinding",n._dispatch.bind(n,"afterContentBinding")),n._grid.listen("tabNavigation",n._onTabNavigation),n._grid.getVScrollbar().listen("scroll",n._onVScroll),n._grid.enableRowHighlighting(!0),n._addGridSections(),n._grid.setParent(n._topNode),n._snapshot=new Jt,n._snapshot.addEventListener("adcDataReceived",n._dispatch.bind(n,"adcDataReceived")),n._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),n._connector=new on,n._connector.addEventListener("ricAdded",n._onRicAdded.bind(n)),n._connector.addEventListener("ricRemoved",n._onRicRemoved.bind(n)),n._connector.addEventListener("fieldAdded",n._onFieldAdded.bind(n)),n._connector.addEventListener("fieldRemoved",n._onFieldRemoved.bind(n)),n.initialize(e),$e.applyStyle(n._grid)};s.inherits(Sn,a),Sn.prototype._topNode=null,Sn.prototype._mainGrid=null,Sn.prototype._grid=null,Sn.prototype._dc=null,Sn.prototype._dt=null,Sn.prototype._dv=null,Sn.prototype._sharedDataSource=!1,Sn.prototype._sharedSorter=!1,Sn.prototype._subs=null,Sn.prototype._stp=null,Sn.prototype._columnSorter=null,Sn.prototype._dcConflator=null,Sn.prototype._snapshot=null,Sn.prototype._connector=null,Sn.prototype._sorter=null,Sn.prototype._fnEngine=null,Sn.prototype._formulaConflator=null,Sn.prototype._chainConflator=null,Sn.prototype._constituentMap=null,Sn.prototype._clientWidth=NaN,Sn.prototype._autoLayoutTimer=0,Sn.prototype._defaultColumnOptions=null,Sn.prototype._RTK=null,Sn.prototype._ADCOptions=null,Sn.prototype._synapse=null,Sn.prototype._autoDateConversion=!1,Sn.prototype._textSelect=!1,Sn.prototype._lang=null,Sn.prototype._dateTimeUtil=null,Sn.prototype._initializing=!1,Sn.prototype._pollingInterval=0,Sn.prototype._pollingTimerId=0,Sn.prototype._lastPollingRequest=0,Sn.prototype._pollingEnabled=!0,Sn.prototype._fieldCaching=!1,Sn.prototype._timeSeriesExpansion=!0,Sn.prototype._childDataField="",Sn.prototype._topSection=!0,Sn.prototype._focusingArgs=null,Sn.prototype._unlinking=!1,Sn.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId=Cn(this._pollingTimerId),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._subs&&(this._subs.removeEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.removeEventListener("dataChanged",this._onQ2DataChanged),this._subs.dispose()),this._dc&&this._dc.dispose(),this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dc=this._dt=this._dv=this._subs=null,this._focusingArgs&&(Cn(this._focusingArgs.id),Cn(this._focusingArgs.timeoutId),this._focusingArgs=null)},Sn.prototype.getElement=function(){return this._topNode},Sn.prototype.removeEventListeners=Sn.prototype.removeAllEventListeners,Sn.prototype.listen=Sn.prototype.addEventListener,Sn.prototype.initSubscription=function(){if(this._subs)return;if(this._sharedDataSource)return void(this._subs=this._mainGrid._subs);let t,e,n;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(n=e.create(),this._RTK&&this._RTK.prefetchWorkaround&&n.addRic("DUMMY.WORKAROUND","DUMMY.WORKAROUND")),!n)return;n.filter&&n.filter(-2,-1),this._subs=n,this._subs.start(),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.addEventListener("dataChanged",this._onQ2DataChanged);let i=this._getAllRowDefinitions(),o=i.length;for(let t=0;t<o;++t){let e=i[t];e&&e.subscribeForUpdates(n)}},Sn.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},Sn.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},Sn.prototype.updateRowData=Sn.prototype._updateRowData,Sn.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let n=this._grid.getSectionSettings("content");n.setAutoSyncRowCount(!0),n.setParent(e)},Sn.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),n=this._grid.addSectionAt(e.length,"title",t);if(n){n.setRowCount(1),this._grid.getSectionSettings(n).disableDataBinding()}return n},Sn.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},Sn.prototype.setParent=function(t){o.appendChild(t,this._topNode),this.updateLayout()},Sn.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},Sn.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},Sn.prototype.getCoreGrid=function(){return this._grid},Sn.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let n=e._grid;n.resetInternalState();let i=(t=n.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(i,"beforeInit",[n.getElement(),t]),t.textSelect&&(e._textSelect=!0,n.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Wt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Wt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&($e.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new dt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&n.toggleBorders(r);let s=t.gridlines;null!=s&&n.toggleGridlines(s);let l=t.verticalLines;null!=l&&n.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&n.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&n.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&n.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&n.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&n.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(n.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),this.addListener(t,"tabNavigation"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&n.setRowScrollingStep(1),t.linearWheelScrolling&&n.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&n.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let f=t.adcPollingInterval;null!=f&&(e._pollingInterval=f?+f:0),e.setColumns(o);let g=!0;null!=t.rowVirtualRendering&&(g=t.rowVirtualRendering),null!=t.rowVirtualization&&(g=t.rowVirtualization),n.enableRowVirtualization(!!g);let y=!1;null!=t.columnVirtualRendering&&(y=t.columnVirtualRendering),null!=t.columnVirtualization&&(y=t.columnVirtualization),n.enableColumnVirtualization(!!y),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(n.freezeSection(null),e._topNode.style.overflow="");let m=t.topFreezingCount;if("number"==typeof m){m=m>0?m:0;let t=m-1;n.freezeSection(t)}else!1===m&&n.freezeSection(null);let C=t.bottomFreezingCount;if("number"==typeof C&&(C=C>0?C:0,n.freezeFooter(C)),e.addDataFields(t.dataFields),t[xt]=!0,Array.isArray(i)){for(let o=0;o<i.length;++o){let r=i[o],s=null;if(r){let e=r.name;s=e?n.loadPlugin(e,r):n.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let S=t.lang;null!=S&&(e._lang=S,e._dateTimeUtil.setLocale(S)),null!=t.childDataField&&(this._childDataField=zt._childDataField=t.childDataField);let w=t.rows;w||(w=t.rics||null);let b=t.bodies;if(!b&&(b=[],t.body&&b.push(t.body),w)){for(let t=0;t<w.length;t++)"string"==typeof w[t]&&(w[t]={ric:w[t]});b.push({rows:w})}let R=t.staticDataRows||t.dataModel;if(w&&R){let t,n,i=R.data?R.data:R,o=R.fields||e.getColumnFields(),r=w.length;for(let e=0;e<r;e++)w[e].values?(t=T(w[e].values,o),n=T(i[e],o),w[e].values=x(t,n)):w[e].values=i[e];i=i.slice(r,i.length),R.data?R.data=i:R=i}for(let t=0;t<b.length;++t)e.insertRows(b[t].rows);e.addStaticDataRows(R),t.contentBottomPadding&&n.setBottomPaddingSection(t.contentBottomPadding);let v=t.contentRightPadding;v&&("number"!=typeof v&&(v=6),n.reserveRightSpace(v));let I=t.dataConflationRate;null!=I&&n.setDataConflationRate(I);let D=n.getPluginList().map(n.getPlugin.bind(n));e._processExtension(D,"afterInit"),e.initSubscription()},Sn.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),i=0;i<o;++i){let t=n[i];t||(t=n[i]={});let e=this.getColumnDefinition(i);e.getConfigObject(t);let o=Wt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=n=n.filter(dn),""===this._topNode.style.overflow&&(e.scrollbar=!1);let l=this._dv.getPageSize();l>0&&(e.pageSize=l),l=s.getDefaultRowHeight(),28!==l&&(e.rowHeight=l),l=s.getSection("title").getDefaultRowHeight(),28!==l&&(e.headerRowHeight=l),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),l=L(this._defaultColumnOptions),l||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let a,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,i=0;i<o;i++)a=h[i],u=a.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,i=0;i<o;i++)a=h[i],c=p[i],d.getRowConfigObject(c,a.getRowId());return e},Sn.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},Sn.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},Sn.prototype._defaultColumnSetup=function(t,e){let n=e.length;for(let i=0;i<n;i++){let n=e[i];if("object"==typeof n)for(let e in t)null==n[e]&&(n[e]=t[e])}},Sn.prototype._processExtension=function(t,e,n){if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i][e]&&t[i][e].apply(t[i],n)},Sn.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let n=e.length;for(let t=0;t<n;++t){let n=e[t],i=this._connector.getRowDefByRic(n),o=i?i.length:0;for(let t=0;t<o;++t){i[t].getSymbol()===n&&this._snapshot.addRic(n)}}this._dispatch(t.type,t)},Sn.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},Sn.prototype._onFieldAdded=function(t){let e=t.rowDefs,n=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(n),this._subs){let t=n.filter(Wt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},Sn.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},Sn.prototype.insertColumn=function(t,e){let n=this.getColumnCount();(null==e||e>n)&&(e=n);let i=this._initializing?{}:A(this._defaultColumnOptions);if("string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];this._fnEngine&&(i.formulaEngine=this._fnEngine);let o=new qt(i,this);i.COL_DEF=o,this._grid.insertColumn(e,i)},Sn.prototype._updateTimeSeriesFields=function(t){let e,n,i,o,r,s,l=t.data,a={};for(let t in l){for(e in l[t])a[e]=!0;this.setRicData(t,l[t])}let u={};for(i in a)n=t.childrenFieldToParent[i],u[n]?u[n].push(i):u[n]=[i];for(n in u){let t,i,l=u[n];for(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),i=l.length,t=0;t<i;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Wt.addTimeSeriesChild(n,e));this.removeColumn(n)}},Sn.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,n,i,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let l=t.getField(),a=Wt.getTimeSeriesChildren(l);if(!a)return;if(i=a.length,i<1)return;for(n=0;n<i;n++)r=this.getColumnIndex(t),o=a[n],this._cloneTimeSeriesColumn(t,o,r)}},Sn.prototype._cloneTimeSeriesColumn=function(t,e,n){let i,o;i=t.getConfigObject(),o=A(i),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,n++)},Sn.prototype.replaceColumn=function(t,e){let n=this.getColumnIndex(e);if(n<0)return;let i={},o=this._grid,r=o._getColumnDef(n),s=o.getColumnScalability(n);if(i.scalable=s,s=o.getColumnCustomLaneSize(n),i.width=s,s=o.getMinimumColumnWidth(n),s>0&&(i.minWidth=s),s=o.getColumnVisibility(n,0),s||(i.hidden=!0),s=r.stationary,s&&(i.stationary=s),s=r.leftPinned,s&&(i.leftPinned=s),s=r.rightPinned,s&&(i.rightPinned=s),"string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];t.width&&!t.scalable&&(i.scalable=!1),t.scalable&&!t.width&&(i.width=1);let l=this.getColumnDefinition(n);l&&null==i.id&&(i.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(n),this.insertColumn(i,n),this._grid.stopBatch("reset")},Sn.prototype._onFieldLoadedSuccess=function(t,e,n){if(n&&n.id){let i=n;e&&e.getField()===t&&e.isDefaultName()&&i.name&&(e.setName(i.name),this.updateColumnTitle())}},Sn.prototype._onFieldLoadedError=function(t){},Sn.prototype._onFieldLoaded=function(t,e){if(Wt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},Sn.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},Sn.prototype.getFieldInfo=function(t){return Wt.getFieldInfo(t)},Sn.prototype.loadFieldInfo=function(t){return Wt.loadFieldInfo(t)},Sn.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Wt.hasFieldInfo(t),!e&&(e=Wt.isAdc(t)||Wt.isRealTimeField(t),!!e)))},Sn.prototype.setColumns=function(t){let e=this._grid,n=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),n>0){let i=!1;n>1&&(i=e.freezeLayout(!0));for(let e=0;e<n;++e)this.insertColumn(t[e],e);n>1&&e.freezeLayout(i)}e.stopBatch("reset")},Sn.prototype.restoreColumns=function(t,e){let n=this._grid;n.startBatch("reset");let i,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?yn:M,h=[],p=[],d=[];for(i=0;i<l;i++){for(r=!1,o=0;o<a;o++)if(u(s[i],t[o])){p.push(s[i]),r=!0;break}r||h.push(i)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),i=0;i<a;i++){for(r=!1,o=0;o<c;o++)if(u(t[i],p[o])){r=!0;let e=this.getColumnIndex(t[i].id||t[i].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[i],i),d.push(this.getColumnId(i)))}a>1&&this._grid.freezeLayout(_),n.reorderColumns(d),n.stopBatch("reset")},Sn.prototype.setFields=Sn.prototype.setColumns,Sn.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let n=t.colIndex,i=this._grid._getColumnDef(n);e._setCoreColumnDef(i);let o=this._grid.getColumnData(n);o||(o=this._grid.setColumnData(n,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(n,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(n,s,t)}else this._grid.setColumnWidth(n,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(n,s),s=r.hidden,s&&this._grid.hideColumn(n,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(n,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(n,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(n,a[l]);let u=e.getField();this._grid.setDataColumnName(n,xt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(l=0;l<g;l++)h=_[l],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():qt.getDataType(h),d=Wt.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},Sn.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let n=this.getColumnDefinition(e);this._grid.removeColumnAt(e),this._connector.removeFields(n),n.dispose()},Sn.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),n=e.length;if(n<=1)return void(1===n&&this.removeColumn(e[0]));e.sort(Sn._descendingOrder);let i=this._grid.freezeLayout();for(let t=0;t<n;++t){let n=e[t],i=this.getColumnDefinition(n);i.dispose(),this._grid.removeColumnAt(n),this._connector.removeFields(i)}this._grid.freezeLayout(i)},Sn.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0)}},Sn.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},Sn.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},Sn.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},Sn.prototype.hideColumn=function(t,e){let n=this.getColumnIndex(t);n<0||this._grid.hideColumn(n,e)},Sn.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},Sn.prototype.showAllColumns=function(){this._grid.showAllColumns()},Sn._descendingOrder=function(t,e){return e-t},Sn.prototype.addDataFields=function(t,e){if(!t)return!1;let n,i,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(n=0;n<a;n++)i=l[n],this._shouldLoadFieldInfo(i)?(o=qt.getDataType(i),r=Wt.loadFieldInfo(i).catch(this._onFieldLoadedError),o?this._connector.addFields(i,e||"grid"):(s=this._onFieldLoaded.bind(this,i,e),r=r.then(s).catch(s))):this._connector.addFields(i,e||"grid");return!0},Sn.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},Sn.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},Sn.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let n=this.getColumnIndex(t);n<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(n,e)},Sn.prototype.setColumnName=function(t,e){let n=this.getColumnDefinition(t);n&&(n.setName(e),this.updateColumnTitle())},Sn.prototype.getColumnBackgroundColor=function(t){let e=this.getColumnDefinition(t);return e?e.getBackgroundColor():""},Sn.prototype.setColumnBackgroundColor=function(t,e){let n=this.getColumnDefinition(t);n&&n.setBackgroundColor(e)},Sn.prototype.setColumnRenderer=function(t,e){let n=this.getColumnIndex(t);this.setColumnFormatter(n,e)},Sn.prototype.activateColumnRenderer=function(t,e,n){let i=this.getColumnIndex(t);if(null==i)return;let o=this.getColumnDefinition(i);o&&(o.activateRenderer(e,n),this._grid.setColumnDataBindingHandler(i,o.getRenderer()),this._grid.requestRowRefresh())},Sn.prototype.setColumnFormatter=function(t,e){if(null==t)return;let n=this.getColumnDefinition(t);if(!n)return;let i=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(n.getConfigObject(),this._grid),i=e.binding):i=e,"function"!=typeof i&&(i=null)),i!==n.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),n.setRenderer(i),this._grid.setColumnDataBindingHandler(t,n.getRenderer()),this._grid.requestRowRefresh()}},Sn.prototype.setColumnSorter=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnDefinition(n);if(i){i.setSorter(e),this.getSortedColumnIndex()===n&&this._stp.refresh()}},Sn.prototype._initDuplicateRicData=function(t){if(!t)return;let e=this._connector.getRowDefByRic(t.getSymbol());if(e&&e.length>0){let n=e[0];if(t.copyRowData(n),t.isChain()){let e=n.getChildren();e&&e.length>0&&setTimeout(this._cloneChain.bind(this,t),0)}}},Sn.prototype._cloneChain=function(t){let e=this._connector.getRowDefByRic(t.getSymbol()),n=e?e[0]:null,i=n?n.getChildren():null,o=i?i.length:0;if(o<0)return;let r=t.getSubId();if(!r)return;let s={subId:r};for(let t=0;t<o;t++){let e=i[t];s.ric=e.getRic(),s.values=e.cloneRowData(),s.values.SUB_ID=r,this._onQ2DataChanged(s)}},Sn.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let n=new zt(t);return n.registerToView(this._dv,this._getRowId(e)),n.setDataSource(this._dc,this._subs),this._initDuplicateRicData(n),t&&t.hidden&&this._dv.hideRow(n.getRowId()),this._connector.addRic(n),n},Sn.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},Sn.prototype.insertRows=function(t,e,n){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let i=this._dt.freeze(),o=n||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let n=t[e];n&&("string"==typeof n&&(n={ric:n}),n.fields=o),this.insertRow(n,r)}this._dt.freeze(i)},Sn.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let n=t;t=null,n&&(n.fields&&!e&&(e=n.fields),Array.isArray(n.data)&&(t=n.data))}t&&this.insertRows(t.map(Sn._dataToRowOptions),null,e)}},Sn.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let n,i,o,r,s=t.length,l={},a=this.getAllRowDefinitions(),u=a.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)n=a[r],n&&(i=n.getRowData()[e],i||0===i?l[i]=n:this.removeRow(n));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],i=o[e],n=l[i],d[i]=o,o.ROW_ORDER=r,p[i]||(p[i]=!0,n?n.setRowData(o):this.insertRow({values:o}));for(let t in l)l[t]&&!d[t]&&this.removeRow(l[t]);this._dt.sortOnce(xt,"a",cn,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?l[r]=a[r]:this.removeRow(a[r]);for(r=0;r<s;r++)o=t[r],n=l[r],n?n.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},Sn._dataToRowOptions=function(t){return{values:t}},Sn.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},Sn.prototype.removeRows=function(t){let e,n;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let i=[],o=t.length;for(n=0;n<o;++n)e=this._getRowDefinitionByRef(t[n]),e&&(e.isAutoGenerated()||i.push(e));o=i.length;let r=!1;for(o>1&&(r=this._dt.freeze()),n=0;n<o;++n)this._removeRow(i[n]);return o>1&&this._dt.freeze(r),i},Sn.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates(),t.forEach(zt.dispose),this._dcConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._constituentMap=null,this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},Sn.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=t.getDescendants();e&&this._removeConstituentRows(e),this._connector.removeRic(t),this._dt.removeRow(t.getRowId()),t.dispose()},Sn.prototype._removeConstituentRows=function(t){let e=this._connector,n=[];for(let i=0;i<t.length;i++){let o=t[i];n.push(o.getRowId()),e.removeRic(o),o.dispose()}this._dt.removeRows(n)},Sn.prototype.hideRow=function(t,e){let n=this._getRowId(t);(this._mainGrid||this._grid).hideRow(n,e)},Sn.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let n=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(n,e)},Sn.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},Sn.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},Sn.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},Sn.prototype.setRic=function(t,e,n){if(this._mainGrid)return this._mainGrid.setRic(this._toRowId(t),e,n);let i=this._getRowDefinitionByRef(t);if(i){let t=n||{};"string"==typeof e?t.ric=e:(e&&!n&&(t=e),e=t.ric?t.ric:"");let o=zt.extractRowOptions(t),r=i.getSymbol();i.setContent(e,o)&&(this._connector.removeRic(i,r),this._initDuplicateRicData(i),this._connector.addRic(i));let s=t.values;null!=s&&i.setStaticRowData(s,t.fields)}return i},Sn.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);if(!e)return;if(!e.isChain())return;this._unlinking=!0;let n=e.getDescendants();if(n)if(e.isChainExpanded())for(let t=0;t<n.length;t++)n[t].toRealTimeRow();else this._removeConstituentRows(n);e.unlinkChain(),this._unlinking=!1},Sn.prototype.setRowContent=Sn.prototype.setRic,Sn.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},Sn.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},Sn.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},Sn.prototype.getRowCount=function(){return this._dv.getRowCount()},Sn.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},Sn.prototype.getDataRowCount=function(){return this._dt.getRowCount()},Sn.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Sn.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},Sn.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},Sn.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;n++)e[n]=this.getColumnDefinition(n);return e},Sn.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},Sn.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let n,i,o=new Array(e);for(n=0;n<e;n++)i=t[n],o[n]=this.getColumnDefinitionById(i);return o}return null},Sn.prototype._getColumnDefinition=function(t){if(t instanceof qt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let n=0;n<e;++n){let e=this.getColumnDefinition(n);if(gn(e,t))return e}}return null},Sn.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},Sn.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},Sn.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,xt)||null},Sn.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,xt)||null},Sn.prototype._getRowDefinitionByRef=function(t){return t instanceof zt&&t.getRowId()?t:this.getRowDefinition(t)},Sn.prototype.getRowDefinitions=function(){return this._dv.getColumnData(xt,!0)},Sn.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(xt)},Sn.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(xt).filter(pn)},Sn.prototype.getRowData=function(t){return hn(this._getRowDefinitionByIndex(t))},Sn.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let n=t,i=n.length,o=new Array(i);e=this.getRowDefinitions();for(let t=0;t<i;++t){let i=n[t];"number"==typeof i?o[t]=hn(e[i]):i&&i.getRowData&&(o[t]=hn(i))}return o}return e=t&&t.getColumnData?t.getColumnData(xt,!1):this.getRowDefinitions(),e.map(hn)},Sn.prototype.setRicData=function(t,e){let n=this._connector.getRowDefByRic(t),i=n?n.length:0;for(let o=0;o<i;++o){let i=n[o];i&&i.getSymbol()===t&&i.setRowData(e)}},Sn.prototype.getAllRics=function(){return this._connector.getAllRics()},Sn.prototype.hasRic=function(){return this._connector.hasRic()},Sn.prototype.setRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setRowData(e)},Sn.prototype.setStaticRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setStaticRowData(e)},Sn.prototype.setStaticData=function(t,e,n){let i=this._getRowDefinitionByRef(t);i&&i.setStaticData(e,n)},Sn.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof zt?t.getRowId():""},Sn.prototype.getColumnIndex=function(t){if(t&&t instanceof qt){let e=this.getColumnCount();for(let n=0;n<e;++n){if(this.getColumnDefinition(n)===t)return n}return-1}return this._grid.getColumnIndex(t)},Sn.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Sn.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},Sn.prototype.getColumnIds=function(){return this._grid.getColumnIds()},Sn.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},Sn.prototype.getColumnFields=function(){return this._grid.getColumnFields()},Sn.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(fn)},Sn.prototype.getAllFields=function(){return this._connector.getAllFields()},Sn.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},Sn.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=n.length,o=0;for(let t=0;t<i;++t)o|=this._pinColumn(n[t],e);return!!o}return this._pinColumn(t,e)},Sn.prototype._pinColumn=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnCount();if(n<0||n>i)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(n>=t)return!1;if(s>=0&&n<=s)return!1;this.moveColumnById(n,t),r+=1,o-=1}else{if(n<o)return!1;o||s>=0&&(o=s,n>s&&o++),this.moveColumnById(n,o)}return this._grid.freezeColumn(o,r),!0},Sn.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=0;for(let t=n.length;--t>=0;)i|=this._unpinColumn(n[t],e);return!!i}return this._unpinColumn(t,e)},Sn.prototype._unpinColumn=function(t,e){let n=this.getColumnIndex(t);if(n<0)return!1;let i=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(n>=i&&n<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(n)}let a=this._grid.getStationaryColumnIndex();return n<i?(n>a&&this.moveColumnById(n,i),this._grid.freezeColumn(i-2,o)):n>=r&&(n>a&&this.moveColumnById(n,r),this._grid.freezeColumn(i-1,o-1)),n>a&&null!=l&&this.moveColumnById(s,l),!0},Sn.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},Sn.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,n=t.toColIndex;for(;e<n;)this._renderColumnHeader(e++,t)},Sn.prototype._renderColumnHeader=function(t,e){let n=this.getColumnDefinition(t);if(!n)return;let i=n.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=n;let s=n.getName(),l=n.getTooltip(),a=n.getHeaderAlignment(),u=n.getTooltipValue();for(let n=0;n<r;++n){let r=o.getCell(t,n,!1);r.setContent(s),r.setTooltipInfo("columnDefault",u),r.setTooltipInfo("columnTooltip",l),r.updateTooltip(),r.setStyle("textAlign",a),i&&(e.rowIndex=n,e.cell=r,i(e))}},Sn.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},Sn.prototype.isSorting=function(){return this._stp.isSorting()},Sn.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},Sn.prototype.getSortOrder=function(){return this._stp.getSortOrder()},Sn.prototype.clearSort=function(){this._stp.clearSortState()},Sn.prototype.getSortingStates=function(){let t=[],e=this._stp.getSortingStates(),n=e.length;for(let i=0;i<n;i++){let n=e[i],o=this._stp.getSortedColumnIndex(i);t.push({colId:this.getColumnId(o),colIndex:o,order:n.sortOrder})}return t},Sn.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",_n))},Sn.prototype._onQ2DataChanged=function(t){let e=this._getRowDefinitionById(t.subId);if(!e)return;let n=t.ric,i=t.values;if(i){let t=null;if(e.verifyConstituent(n)){let i=e,o=i.getConstituent(n);if(o)e=o;else{if(e=o=i.addConstituent(n),!o)return;t=this._connector.getRowDefByRic(n),this._connector.addRic(o),this._constituentMap||(this._constituentMap={}),this._constituentMap[o.getRowId()]=o,this._registerConstituents(o)}}if(t&&t.length){t[0].cloneRowData(i,i)}e.setRowData(i)}else{let t=e.getConstituent(n);t&&(t.setParent(null),this._removeRow(t))}},Sn.prototype._registerConstituents=function(t){if(this._chainConflator.conflate(t))return;this._constituentMap=null;let e=this._dv,n=e?e.getDataSource():null;if(!n)return;let i,o=this._chainConflator.popAllData(),r=o?o.length:0,s=[],l={};for(i=0;i<r;++i){let t=o[i],e=t.getParent();if(!e)break;let n=e.getRowId(),r=l[n];null==r&&(r=l[n]=e.countChildInView()),s.push(t)}if(r=s.length,!r)return;let a=!1;for(r>1&&(a=this._dt.freeze()),i=0;i<r;++i){let t=s[i],o=t.getParent().getRowId(),r=l[o];e.addSegmentChild(o,t.getRowId());let a=n.getRowIndex(o)+1,u=t.getData("CHILD_ORDER");a+=null!=u&&u<r?u:r;let h=n.getRowId(a);t.registerToView(e,h),l[o]=r+1}r>1&&this._dt.freeze(a)},Sn.prototype._onDataChanged=function(t){if(this._dt&&t&&t.rid&&t.changes){let e=this._getRowDefinitionById(t.rid);e&&e.addUpdate(t.changes)&&(this._dt._hasNewUpdates=!0)}this._dcConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},Sn.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let n=0;n<t;++n){let t=e[n],i=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(i=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(i,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},Sn.prototype._mainSorter=function(t,e,n){return this._columnSorter(t,e,n)},Sn.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},Sn.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},Sn.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[xt].resetUpdates()}},Sn.prototype.getDataView=function(){return this._dv},Sn.prototype.setPage=function(t){return this._dv.setPage(t)},Sn.prototype.setPageSize=function(t){this._dv.setPageSize(t)},Sn.prototype.getPageIndex=function(){return this._dv.getPageIndex()},Sn.prototype.getPageSize=function(){return this._dv.getPageSize()},Sn.prototype.getPageCount=function(){return this._dv.getPageCount()},Sn.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},Sn.prototype.setClassification=function(t,e){let n=this._getRowDefinitionByRef(t);return!!n&&this._dt.setSegmentClassification(n.getRowId(),e)},Sn.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},Sn.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},Sn.prototype.focus=function(){this._grid.focus()},Sn.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},Sn.prototype.updateLayout=function(){this._grid.updateLayout()},Sn.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},Sn.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},Sn.prototype._onFormulaDataRequired=function(t){},Sn.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;if(!t.rowData)return;let n=t.rid,i=this._getRowDefinitionById(n);if(!i){if(i=this._constituentMap?this._constituentMap[n]:null,!i)return;if(i.isDisposed())return void(this._constituentMap[n]=null)}if(this._autoDateConversion){let t,n,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():qt.getDataType(t),"datetime"===o&&(n=e[t],i.setData(t+"_RAW",n),n=$.toDateObject(n),i.setData(t,n))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=i,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)},Sn.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=t.removedRows,r=i.length,s=null;for(e=0;e<r;e++){let t=o[i[e]];t&&(s=t[xt],s&&(s.dispose(),t[xt]=null))}let l=n.length;for(e=0;e<l;e++){let t=n[e].getId();s=new zt({segmentId:t}),s.registerToView(this._dv),s.setDataSource(this._dc)}},Sn.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let n=0;n<e;++n)this._fnEngine.calculate(t[n])}},Sn.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},Sn.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},Sn.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},Sn.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},Sn.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},Sn.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},Sn.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},Sn.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},Sn.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let n=Ct.constructTable(t.map(hn),e);console.table(n)},Sn.prototype.replaceRow=function(t,e){let n=this._getRowId(t),i=this._getRowDefinitionById(n);if(i){if(i.isAutoGenerated())return null;let t=i.getConfigObject();if(i.getRowId()===e.rowId)return null;if(M(t,e))return null}let o=this.insertRow(e,n);return i&&this.removeRow(n),o},Sn.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},Sn.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},Sn.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},Sn.prototype.getScrollTop=function(){return this._grid.getScrollTop()},Sn.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},Sn.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},Sn.prototype.scrollRight=function(t){this._grid.scrollRight(t)},Sn.prototype.scrollDown=function(t){this._grid.scrollDown(t)},Sn.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},Sn.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},Sn.prototype.getVScrollView=function(){return this._grid.getVScrollView()},Sn.prototype._focusCell=function(t,e){if(t){let n=t.getContent();if(n){let i=null;if(this.hasListener("tabNavigation")){let o={shiftKey:e.shiftKey,activeElement:e.activeElement,cellContent:n,cell:t,colIndex:e.colIndex,rowIndex:e.rowIndex,field:e.fields?e.fields[e.colIndex]:""};this._dispatch("tabNavigation",o),i=o.nextFocusableElement}else"SPAN"!==n.tagName&&(i=n);if(i&&i!==e.activeElement&&!i.disabled)return i.focus(),!0}}return!1},Sn.prototype._onVScroll=function(){let t=this._focusingArgs;if(t){t.timeoutId=Cn(t.timeoutId),this._focusingArgs=null;let e=this._grid.getCell("content",t.colIndex,t.rowIndex);this._focusCell(e,t)||(t.shiftKey?this._focusPrevCellContent(t):this._focusNextCellContent(t))}},Sn.prototype._onScrollTimeout=function(){this._focusingArgs=null},Sn.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},Sn.prototype._requestScroll=function(t){this._focusingArgs||(this._focusingArgs=t,t.event=null,t.id=setTimeout(this._selfScrollToRow,0),t.timeoutId=setTimeout(this._onScrollTimeout,100))},Sn.prototype._focusNextCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=0;if(e>=0)for(i=1;i<r&&!(e<o[i]);i++)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().lastFullRow,h=this.getRowCount();t.fields=l.getColumnFields();for(let e=n;e<h;e++){for(t.rowIndex=e,i=s;i<r;i++){let n=o[i];if(t.colIndex=n,e>u)return mn(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void mn(t.event)}}s=0}this._grid.getHiddenInput().focus()},Sn.prototype._focusPrevCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=r-1;if(e>=0)for(i=r-1;--i>=0&&!(e>o[i]);)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().firstFullRow;t.fields=this.getColumnFields();for(let e=n;e>=0;e--){for(t.rowIndex=e,i=s;i>=0;i--){let n=o[i];if(t.colIndex=n,e<u)return mn(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void mn(t.event)}}s=r-1}this._grid.getHiddenInput(!0).focus()},Sn.prototype._onTabNavigation=function(t){if(this._focusingArgs)return;let e=this.getColumnDefinitions(),n=e.length,i=[];for(let t=0;t<n;t++)e[t].isFocusable()&&i.push(t);if(!i.length)return;let o=t.event,r=this.getRelativePosition(o),s=r.rowIndex;if(t.onTheEdge){let t=this._grid.getVerticalViewInfo();s=o.shiftKey?t.lastFullRow:t.firstFullRow}let l={event:o,shiftKey:o.shiftKey,colIndex:r.colIndex,rowIndex:s,focusableColIndices:i,activeElement:t.activeElement};o.shiftKey?this._focusPrevCellContent(l):this._focusNextCellContent(l)},Sn.prototype._getEventHandlers=function(){return{tabNavigation:this._onTabNavigation,q2DataChanged:this._onQ2DataChanged}};let wn={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};wn.words=wn.texts.join(" ").split(" ").filter((function(t){return t.length>1})),wn.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],wn.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],wn.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],wn.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var bn=wn;let Rn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],vn={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?Fn(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:bn.companyName},industry:{type:"set",members:bn.industry},market:{type:"set",members:bn.market},country:{type:"set",members:bn.country}},In=function(t,e){if(t){let n=e;"function"==typeof e&&(n={type:"function",generate:e}),vn[t]=n}},Dn=function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()},xn=function(t,e,n,i){t||(t=0),null==e&&(e=100);let o=(e-t)*Dn(i)+t;if(n>0){let t=Rn[n];return Math.floor(o*t)/t}return null!=n?Math.floor(o):o},An=function(t,e,n){return xn(t,e+1,0,n)},Ln=function(t,e,n){return xn(t,e,0,n)},Tn=function(t,e){return Ln(0,t,e)},En=function(t){return 0===An(0,1,t)},Mn=function(t,e){if(t){return t[Tn(t.length,e)]}return String.fromCharCode(An(65,90,e))},Fn=function(t,e,n){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let i=An(0,(e-t)/1e3,n);return new Date(t+1e3*i)},Pn=function(t,e,n){let i=t<e?Ln(t,e,n):t,o=new Array(i);for(let t=0;t<i;++t){null!=n&&(n*=1.17*(t+1));let e=Tn(bn.words.length,n);o[t]=bn.words[e]}return o.join(" ")},zn=function(t,e,n){let i=kn(t,e,n),o=i.value+"";return i.prefix&&("string"==typeof i.prefix?o=i.prefix+o:e.prefix&&(o=e.prefix+" "+o)),i.suffix&&(o+=i.suffix),"string"===i.type&&(i.value=o),i.formattedValue=o,i},Vn=function(t,e,n){let i={},o=0;e&&("number"==typeof e?o=i.numRows=e:(i=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(n=e.seed)&&(n=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let i=0;i<o;++i){let i=[];for(let o=0;o<r;++o){let r=t[o];i.push(kn(r,e,n).value)}null!=n&&++n,s.push(i)}return{data:s,seed:n,fields:t}},kn=function(t,e,n){let i,o=function(t){return vn[t]||{}}(t);if(o.type||(o.type="number",In(t,o)),o.fixedValue)return o.value=i,o;null!=n&&(null==o.hash&&(o.hash=function(t){let e=0,n=t?t.length:0;for(;--n>=0;)e+=t.charCodeAt(n)*(n+.9879);return e}(t)),n+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)i=null!=o.min||null!=o.max?Pn(r,s,n):e&&e.text||"";else if("set"===o.type)i=Mn(o.members,n);else if("date"===o.type)i=Fn(r,s,n);else if("isoDate"===o.type){i=Fn(r,s,n).toISOString().slice(0,10)}else if("isoDateObject"===o.type)i=Fn(r,s,n),i=new Date(i.toISOString().slice(0,10));else if("boolean"===o.type)i=En(n);else if("function"===o.type)o.field=t,i=o.generate(o,n);else{let t=null!=o.prec?o.prec:0;i=xn(r,s,t,n)}return o.value=i,o},Nn=function(t){this._seed=null!=t?t:null};Nn.prototype._seed=null,Nn.prototype.generate=function(t,e){let n=Vn(t,e,this._seed);return this._seed=n.seed,n.data},Nn.prototype.generateRecords=function(t,e){let n=Vn(t,e,this._seed);this._seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e){r[t[e]]=n[e]}o[e]=r}return o},Nn.prototype.generateQuoteData=function(t,e){let n=zn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.getSeed=function(){return this._seed},Nn.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},Nn.prototype.randBetween=function(t,e){let n=Ln(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randInt=function(t,e){let n=An(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randIndex=function(t){let e=Tn(t,this._seed);return null!=this._seed&&++this._seed,e},Nn.prototype.randNumber=function(t,e,n){let i=xn(t,e,n,this._seed);return null!=this._seed&&++this._seed,i},Nn.prototype.randBoolean=function(){let t=En(this._seed);return null!=this._seed&&++this._seed,t},Nn.prototype.randMember=function(t){let e=Mn(t,this._seed);return null!=this._seed&&++this._seed,e},Nn.prototype.randDate=function(t,e){let n=Fn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.prototype.randString=function(t,e){let n=Pn(t,e,this._seed);return null!=this._seed&&++this._seed,n},Nn.seed=null,Nn.generate=function(t,e){let n=Vn(t,e,Nn.seed);return Nn.seed=n.seed,n.data},Nn.generateRecord=function(t,e,n){Array.isArray(t)||(t=[t+""]);let i={};null!=e&&("number"==typeof e?n=e:e&&(i=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=kn(o,i,n).value}return r},Nn.generateRecords=function(t,e){let n=Vn(t,e,Nn.seed);Nn.seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e){r[t[e]]=n[e]}o[e]=r}return o},Nn.addFieldInfo=In,Nn.randNumber=xn,Nn.randInt=An,Nn.randBetween=Ln,Nn.randIndex=Tn,Nn.randBoolean=En,Nn.randMember=Mn,Nn.randDate=Fn,Nn.randString=Pn,Nn.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let n=i[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let i=r[t];if(void 0!==i){let o=e[t];o||0===o||(o=t+""),n[o]=i}}}return i};let On=function(){};On.prototype.create=function(t){return new Hn(t)};let Hn=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Hn._runningId++};Hn.prototype._rics=null,Hn.prototype._isChain=!1,Hn.prototype._fieldMap=null,Hn.prototype._prevData=null,Hn.prototype._updateHandler=null,Hn.prototype._updateTimerId=0,Hn.prototype._updateInterval=1e3,Hn._runningId=0,Hn.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Hn.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Hn.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Hn.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Hn.prototype.start=function(){return this._onRowUpdated(),this},Hn.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Hn.prototype.onNewRow=function(t){return this},Hn.prototype.onUpdate=function(t){return this._updateHandler=t,this},Hn.prototype.onRemoveRow=function(t){return this},Hn.prototype._onRowUpdated=function(){if(!this._updateHandler)return;let t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(let n=0;n<e;++n)Tn(3)||(t=this._rics[n],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Hn.prototype._getUpdateData=function(t){let e={id:this.id},n={text:t};for(let t in this._fieldMap){let i=zn(t,n),o=i.value,r=i.formattedValue;i.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let Bn=function(){this._dict={}};Bn.prototype._dict,Bn.prototype._count=0,Bn.prototype.addItem=function(t,e){if(t&&null!=e){let n=this._dict[t];return n?n.push(e):this._dict[t]=[e],++this._count,!0}return!1},Bn.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let n=e?e.length:0;if(n){let i=this._dict[t];return i||(i=this._dict[t]=[]),Array.prototype.push.apply(i,e),this._count+=n,!0}}return!1},Bn.prototype.removeItem=function(t,e){let n=this._dict[t];if(n){let i=n.indexOf(e);if(i>=0)return n.length>1?n.splice(i,1):delete this._dict[t],--this._count,!0}return!1},Bn.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},Bn.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},Bn.prototype.getItems=function(t){return this._dict[t]||null},Bn.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let n in e)Array.prototype.push.apply(t,e[n]);return t}return null},Bn.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},Bn.prototype.getAllKeys=function(){return Object.keys(this._dict)};let Gn=function(t,e){return t.ric+"_"+e.ric},Wn=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Un=function(t){let e,n,i,o=t;for(e=o.length-1;e>0;e--)n=Math.floor(Math.random()*(e+1)),i=o[e],o[e]=o[n],o[n]=i;return o.forEach(Yn),o=o.sort(Xn),o},Yn=function(t,e){t.CHILD_ORDER=e},Xn=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},qn=function(){};qn.prototype._lastSub=null,qn.prototype._configObj=null,qn.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},qn.prototype.create=function(t){return this._lastSub=new jn(t||this._configObj),this._lastSub},qn.prototype.isSkipHeaderSupported=function(){return!0},qn.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},qn.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let jn=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new Bn,this._fields={},this._events={},this._dataGen=new Nn,this.config(t)};jn.prototype._minInterval=750,jn.prototype._maxInterval=850,jn.prototype._percentageDataUpdate=.1,jn.prototype._constituentCache=!1,jn.prototype.config=function(t){if(!t)return;let e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),e=t.maxInterval,"number"==typeof e&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),e=t.percentageDataUpdate,"number"==typeof e&&(this._percentageDataUpdate=e/100);let n=t.constituentCache;null!=n&&(this._constituentCache=n)},jn.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},jn.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},jn.prototype.setSeed=function(t){this._dataGen.setSeed(t)},jn.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},jn.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},jn.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n)this._fields[t[n]]=!0},jn.prototype.removeSubscription=function(t){let e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){let t=e.children,n=t.length;for(let i=0;i<n;++i){let n=t[i];this._dataMap.removeItem(Gn(e,n),n),n.parent=null}e.children=null,e.ricList=null}},jn.prototype.removeRic=jn.prototype.removeSubscription,jn.prototype.removeChain=jn.prototype.removeSubscription,jn.prototype.removeAllSubscriptions=function(){let t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){let t=[];for(let e in this._subMap)t.push(this._subMap[e]);t.length>0&&this._dispatch("subscriptionRemoved",{subs:t})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},jn.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n){let e=t[n];this._fields[e]&&delete this._fields[e]}},jn.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},jn.prototype.start=function(){this._working=!0,this._connect()},jn.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},jn.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},jn.prototype.addEventListener=function(t,e){if(!e)return;let n=this._events[t];n?n.indexOf(e)<0&&n.push(e):this._events[t]=[e]},jn.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(!n)return;let i=n.indexOf(e);i>=0&&n.splice(i,1)},jn.prototype.removeAllEventListeners=function(){this._events={}},jn.prototype.getSubscription=function(t){return this._subMap[t]||null},jn.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},jn.prototype.getAllFields=function(){return this._fields},jn.prototype.hasField=function(t){return this._fields[t]||!1},jn.prototype.filter=function(t,e){return this};let Kn=function(t,e){for(let n in t)e[n]=t[n];return e};jn.prototype._addSymbol=function(t,e,n){if(!t)return null;if(n||0===n)n+="";else do{n="_"+this._runningSubId+++"_"}while(this._subMap[n]);if(this._subMap[n])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let i={};i.ric=t,i.chain=e,i.id=n,i.dataId=n+t,this._subMap[n]=i,this._dataMap.addItem(t,i);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[i]});let s,l=null,a=0;if(e)if(1===r)for(i.children=[],a=jn.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=n,l.dataId=n+l.ric,l.parent=i,i.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(Gn(i,l),l);else{let t=o[0].children;for(a=t.length,i.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=n,l.dataId=n+l.ric,l.parent=i,i.children[s]=l,this._dataMap.addItem(Gn(i,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),n},jn.simpleDigest=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n+=t.charCodeAt(i);return n},jn.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},jn.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let n=(this._percentageDataUpdate-.02)*e;n=n>0?n:1;let i=(this._percentageDataUpdate+.02)*e;i=i<e?i:e;let o=this._dataGen.randInt(n,i),r=this._fields;for(let n=0;n<o;n++){let n,i,o,s=t[this._dataGen.randIndex(e)],l=this._dataMap.getItems(s),a=l[0],u=a.parent,h=this._dataGen.randBoolean();if(Wn(s)&&u&&h){let t=u.children;t=Un(t);let e=t.length,s=t.indexOf(a);for(a.CHILD_ORDER=s,n=this._generateQuoteData(a,r),o=l.length,i=0;i<o;++i){for(let o=0;o<e;o++){let e=t[o];if(l[i]===e)n.CHILD_ORDER=e.CHILD_ORDER,this._dispatchDataChanged(l[i],n);else{let t=e.CHILD_ORDER;this._dispatchDataChanged(e,{X_RIC_NAME:e.ric,CHILD_ORDER:t})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(n=this._generateQuoteData(a,r),o=l.length,i=0;i<o;++i){let t=l[i].CHILD_ORDER;null!=t&&(n.CHILD_ORDER=t),this._dispatchDataChanged(l[i],n)}}this._connect()},jn.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},jn.prototype._generateQuoteData=function(t,e){let n=t.ric,i=t.prevData,o={},r={text:n,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r),n=t+"_FORMATTED";if(i){if(e.changeOnly&&i[t]===e.value)continue;i[t]=e.value,i[n]=e.formattedValue}o[t]=e.value,o[n]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},jn.prototype._getChildSubByRic=function(t,e){let n=t.children;if(n){let t=n.length;for(let i=0;i<t;++i){let t=n[i];if(t.ric===e)return t}}return null},jn.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let n=e.length;if(n<2)return;let i,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(i=1;i<n;++i){let t=e[i];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;if(!this._constituentCache)return;let l=o.ricList;if(!l)return;let a=l.length;for(i=1;i<n;++i){let t=e[i],n=t.ricList;for(let e=n?n.length:0;e<a;++e){let n=l[e],i=this._getChildSubByRic(o,n),r=this._getChildSubByRic(t,n);i&&r&&i.prevData&&this._dispatchDataChanged(r,i.prevData)}}},jn.prototype._dispatchDataChanged=function(t,e){let n=Kn(e,{}),i={};i.ric=t.ric,i.values=n,i.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,i.type="statusUpdated",n.STATUS=1,n.STATUS_FORMATTED=this._statusMap[1],n.SUB_ID=t.id,Kn(n,o);let e=t.parent;if(e){let n=e.ricList;n||(n=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",i)},jn.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},jn.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},jn.prototype._dispatch=function(t,e){let n=this._events[t];if(!n)return;let i=n.length;for(let t=0;t<i;++t)n[t](e)},jn.prototype._subMap=null,jn.prototype._fields=null,jn.prototype._events=null,jn.prototype._working=!1,jn.prototype._timerId=0,jn.prototype._runningSubId=0,jn.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};let Jn=function(){this._data={}};Jn.prototype._data=null,Jn.prototype.clear=function(){this._data={}},Jn.prototype.put=function(t,e){t&&(this._data[t]=e)},Jn.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Jn.prototype.getAllKeys=function(){return Object.keys(this._data)},Jn.prototype.save=function(){},Jn.prototype.filter=function(t){let e=[];if(t)for(let n in this._data){let i=this._data[n];t(i)&&e.push(i)}return e};let Qn={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};let Zn=new Nn,$n={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s,l,a,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(l=t.identifiers,a=t.formula.trim().split(/(?=,TR.)/),u=[],h=Qn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);let e=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(let t=0;t<e;t++){let e,i=u[t],o=/TR.(.*)(?=\()/,r=i.match(o)[0].replace("TR.",""),a=i.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:$.format(new Date,"YYYY-MM-DD"),g=_[1];f>g&&(e=f,f=g,g=e);let y=(+new Date(g)-+new Date(f))/864e5;for(n=0;n<=y;n++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+n)),i={h:!0,v:$.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(i)}let m=l;for(n=0;n<m.length;n++){let t=[m[n],r];for(s=1;s<=y+1;s++){let e=Nn.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=$n.splitFields(t.formula),u=[],h=Qn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],n=0;n<u.length;n++)i=u[n],p[0].push({h:!0,r:i.toUpperCase().trim()});let e={};o=l.length;let s=Zn.generate(u,o);for(n=0;n<o;++n){let t=l[n];r=e[t],r||(r=e[t]=s[n],r.unshift(t)),p.push(r)}if(p.length>0){if(Zn.randInt(1,10)<=3){let t=Zn.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";p.splice(t+1,0,e)}}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];let e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()})),e}},ti=new Nn,ei={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s=t.instruments,l=t.fields,a=Qn;for(l=[],n=0;n<t.fields.length;n++)i=t.fields[n],a[i.name]||l.push(i);let u={};o=s.length;let h=[],p=ti.generate(l,o);for(n=0;n<o;++n){let t=s[n];r=u[t],r||(r=u[t]=p[n],r.unshift(t)),h.push(r)}if(h.length>0){if(ti.randInt(1,10)<=3){let t=ti.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";h.splice(t+1,0,e)}}let d=[{displayName:"Instrument"}];for(n=0;n<l.length;n++)i=l[n],d.push({displayName:i.name,field:i.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},ni=function(t){return"datagrid"===t?Promise.resolve(ei):"adc"===t?Promise.resolve($n):Promise.reject(t+" is not supported.")};ni.setInvalidFields=function(t){if(t&&"string"==typeof t)Qn[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Qn[t[e]]=!0};let ii=function(t){this.Quotes=new On,this.Quotes2=new qn,this.Archive=new Jn,this.ContainerDescription=!0,this.Data=ni,t&&this.Quotes2.config(t)};ii.prototype.init=function(t){return t&&this.Quotes2.config(t),this},ii.prototype.onLoad=function(t){return setTimeout(t,2e3),this},ii.prototype.navigate=function(t){return this},ii.prototype.appHit=function(t,e,n){},ii.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},ii.prototype.contextChange=function(t){};let oi={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},ri={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1};let si={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},li={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},ai={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},ui=function(t,e,n,i){let o={value:e,type:n};return i&&(o.dataType=i),"operator"===n?o.precedence=si[e]:"parenthesis"===n&&(o.precedence=0),t.push(o),t.length-1},hi={_tokens:[],_withString:function(t){return" #"+ui(hi._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+ui(hi._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return hi._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;if(e==e){return" #"+ui(hi._tokens,e,"literal","number")+"#"}return""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:hi._withNegativeNumber(t)},_withOperator:function(t){if(si[t]){return"="!=t&&"==="!=t||(t="=="),"#"+ui(hi._tokens,t,"operator")+"#"}return""},_withParenthesis:function(t){return"#"+ui(hi._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,n=e.length,i=0,o=0;for(let t=0;t<n;++t){let n=e[t];if("literal"!==n.type){let t=ai[n.value];if(!(i>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;i-=t}i++,i>o&&(o=i)}return 1!==i||(t._stackSize=o,!1)},_filter:function(t,e){let n,i=t._rpn,o=new Array(t._stackSize),r=i.length,s=0;for(let t=0;t<r;++t){let r=i[t],l=r.value;"literal"===r.type?n="variable"!==r.dataType?l:e?e[l]:null:1===ai[l]?(n=li[l](o[s-1]),s-=1):(n=li[l](o[s-2],o[s-1]),s-=2),o[s++]=n}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;let e=t.trim();if(!e)return null;hi._tokens.length=0,e=e.replace(/".+?"/g,hi._withString),e=e.replace(/'.+?'/g,hi._withString),e=e.replace(/\[.+?\]/g,hi._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,hi._withNegativeNumber),e=e.replace(/[0-9.#]+/g,hi._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,hi._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,hi._withOperator),e=e.replace(/[()]/g,hi._withParenthesis);let n=hi._tokens,i=n.length;if(!i)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<i;++o){let t=a[o];if(r=n[+t.substring(1,t.length-1)],s=r.type,"literal"===s){let t=l[l.length-1];if(t&&"literal"===t.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;ui(l,"-","operator"),r.value*=-1}}l.push(r)}hi._tokens.length=0,i=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<i;++o)if(r=l[o],s=r.type,"literal"===s)u.push(r);else if("parenthesis"===s)if("("===r.value)h.push(r);else{for(d=!1;h.length;){if(p=h.pop(),"("===p.value&&"parenthesis"===p.type){d=!0;break}u.push(p)}d||console.warn("No left parenthesis paired with the right one")}else{for(;h.length&&!(r.precedence>h[h.length-1].precedence);)u.push(h.pop());h.push(r)}for(d=!1;h.length;)p=h.pop(),"("===p.value&&"parenthesis"===p.type?d=!0:u.push(p);if(d&&console.warn("No right parenthesis paired with the left one"),!u.length)return null;let c={_rpn:u};return hi._tester(c)?null:hi._filter.bind(null,c)}};let pi=function(){this._conditions=[],this._scopes=[],pi._painters.push(this)};pi.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},pi.prototype._coloringType=0,pi.prototype._conditions=null,pi.prototype._effectiveStyles=null,pi.prototype._blinkCondition=null,pi.prototype._scopes,pi.prototype._columnStats=null,pi.prototype._blinkingDuration=250,pi._runningBlinkId=0,pi._painters=[],pi._emptyAry=[],pi._emptyObj={},pi._bgObj={backgroundColor:"",color:""},pi._colorObj={color:""},pi.bgStyles=["backgroundColor","color"],pi.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],pi.supportedStyles=pi.bgStyles.concat(pi.nonBgStyles),pi.themeReady=null,pi._contrastColors={},pi.parse=hi.parse,pi.prototype.dispose=function(){let t=pi._painters.indexOf(this);t>=0&&pi._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},pi.prototype.reset=function(){this._setColoringType(0);let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];pi._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}this._blinkCondition=null},pi.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},pi.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},pi.prototype.clearBlinking=function(){this._blinkCondition=null;let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];pi._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}},pi.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},pi.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},pi.prototype.applyThemeColor=function(){let t=G.getColors();if(this._coloringType===pi.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let n=t.up,i=t.down,o=t.level===t.baseText?"":t.level;pi._setUpDownColors(e,n,i,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&pi._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},pi.prototype.getConditions=function(){return this._conditions},pi.prototype.getColoringType=function(){return this._coloringType},pi.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},pi.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},pi.prototype.getEffectiveStyles=function(){return this._effectiveStyles},pi.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(pi.ColoringTypes.CONDITIONAL);let e=t.length;for(let n=0;n<e;n++)this._addCondition(t[n])},pi.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},pi.prototype.getColumnStats=function(){return this._columnStats},pi.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=hi.parse(e.text||e),this._conditions.push(t))},pi.prototype.addHeatmap=function(t,e,n,i,o,r){this._setColoringType(pi.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=pi._heatMapCondition.bind(s),s.midPoint=e,pi._setUpDownColors(s,n,i),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},pi.prototype.addHeatmapWithTheme=function(t,e,n){let i=G.themeColors,o=this.addHeatmap(t,e,i.up,i.down,i.baseGrid,n);return!0!==n&&"text"!==n||(o.baseColor=i.baseText),o.useThemeColor=!0,o},pi.prototype._addColorText=function(t,e,n,i,o){this._setColoringType(pi.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=n,r.downClass=i,r.levelClass=o,this._addCondition(r),r},pi.prototype.addColorText=function(t,e,n,i){return this._addColorText(ri[t]?pi._tickColorTextCondition:pi._colorTextCondition,t,e,n,i)},pi.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},pi.prototype.addTickColorText=function(t,e,n){return this.addColorText("CF_TICK",t,e,n)},pi.prototype.addTickColorTextWithTheme=function(){let t=G.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},pi.prototype.addTickBlink=function(t,e,n,i){return this.addBlink("CF_TICK",t,e,n,i)},pi.prototype.addTickBlinkWithTheme=function(t){let e=G.themeColors,n=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return n.useThemeColor=!0,n},pi.prototype.addBlink=function(t,e,n,i,o){return this._addBlink(ri[t]?pi._tickBlinkCondition:pi._fieldBlinkCondition,t,e,n,i,o)},pi.prototype.addBlinkWithTheme=function(t,e){let n=G.themeColors,i=this.addBlink(t,n.up,n.down,n.level,e);return i.useThemeColor=!0,i},pi.prototype._addBlink=function(t,e,n,i,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=pi._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),pi._setUpDownColors(s,n,i,o,!0),s},pi.prototype.renderForPrinting=function(t,e,n,i){if(!t)return;let o=this._getStyles(e,n,i),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},pi._colorTextCondition=function(t,e){let n=e[t];if(n||0===n){if(n>0)return 1;if(n<0)return-1}return"u"},pi._tickColorTextCondition=function(t,e){return oi[e[t]]},pi._heatMapCondition=function(t,e,n){let i,o=t[this.field],r=o||0===o?o-this.midPoint:NaN;if(0===r||r!=r)return 0;let s=1;return r>0?(s=n-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=n-this.midPoint)),s<0&&(s=-s),i=r/s,i},pi._tickBlinkCondition=function(t){return oi[t]},pi._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},pi._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},pi._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let n=t.rowData,i=NaN,o=NaN;if(this._coloringType===pi.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(i=t.getMin(),o=t.getMax())}let r=this._getStyles(n,i,o),s=r.cssClass;null!=s?(e._coloringCssClass&&e._coloringCssClass!==s&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},pi.prototype._getStyles=function(t,e,n){if(!t)return pi._emptyObj;let i=this._conditions.length;for(let o=0;o<i;++o){let i,r=this._conditions[o],s=r._fn;try{i=s&&s(t,e,n)}catch(t){}if(i){if(this._coloringType===pi.ColoringTypes.HEATMAP){let t;return t=i>0?D(r.baseColor,r.upColor,i):D(r.baseColor,r.downColor,-i),r.textMode?(pi._colorObj.color=m(t),pi._colorObj):(pi._bgObj.backgroundColor=m(t),pi._bgObj.color=I(t),pi._bgObj)}return this._coloringType===pi.ColoringTypes.TEXT?(r.cssClass=i>0?r.upClass:i<0?r.downClass:r.levelClass,r.cssClass=r.cssClass||"",r):r}}return pi._emptyObj},pi.blendColor=D,pi.blackAndWhite=I,pi.rgb2Hex=y,pi.num2Hex=m,pi.num2Rgb=C,pi.hex2Num=S,pi.hex2Rgb=w,pi.themeChanged=function(){},pi.setThemeColors=function(){},pi._onThemeChanged=function(){let t=pi._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},pi.loadThemeColors=function(){return pi.themeReady||(pi.themeReady=G.getThemeColors(pi._onThemeChanged).then(pi._onThemeChanged).catch(pi._onThemeChanged)),pi.themeReady},pi.reloadThemeColors=function(){return pi.themeReady=G.reloadThemeColors().then(pi._onThemeChanged).catch(pi._onThemeChanged),pi.themeReady},pi.clearCellStyle=function(t,e){let n=t.getElement();if(!n)return;let i=t.blinking;if(i&&(pi._clearBlinkTimer(i),delete t.blinking,i.cell=null),n._coloringCssClass&&n.classList.remove(n._coloringCssClass),e||(e=pi.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)n.style[e[t]]="";else for(let t in e)n.style[t]=""},pi._setUpDownColors=function(t,e,n,i,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=pi.getOppositeColor(e)),t.downColor=n,null!=n&&o&&(t.contrastDownColor=pi.getOppositeColor(n)),t.levelColor=i,null!=i&&o&&(t.contrastLevelColor=pi.getOppositeColor(i))},pi._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},pi.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=pi._contrastColors[t];if(!e){let n=S(t);e=pi._contrastColors[t]=I(n)}return e}}else if(Array.isArray(t))return I(t);return""},pi.prototype.render=function(t,e,n,i,o){null!=n&&n==n?this._paintCell(t,e,n,i):this._conditions.length&&this._coloringType===pi.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},pi.prototype.renderHeatMap=function(t,e,n,i){this._paintCell(t,e,n,i)},pi.prototype.renderColoring=function(t,e){this._paintCell(t,e)},pi.prototype._paintCell=function(t,e,n,i){if(!t)return;let o=t.getElement();if(!o)return;let r,s=this._blinkCondition;if(s&&(r=t.blinking,r&&r.blinkTimer&&!s.border))return;let l=this._getStyles(e,n,i),a=o.style,u=l.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(l.backgroundColor?a.backgroundColor=l.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(a.backgroundColor=""),l.color?a.color=l.color:this._effectiveStyles&&!this._effectiveStyles.color||(a.color=""))},pi.prototype._prepareScope=function(t){let e=t.blinking;e||(e={},e.cell=t,t.blinking=e,this._scopes.push(e));let n=this._blinkCondition;if(e.blinkId!==n.blinkId){e.blinkId=n.blinkId,e.field=n.field;let t=n.border?pi._borderRestorer:pi._cellRestorer;e._restorer=t.bind(this,e)}return e},pi.prototype.blink=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=this._prepareScope(t);return l.rowData=n,e>0?(r=o.upColor,s=o.contrastUpColor):e<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor),this._blink(l,i,r,s)},pi.prototype.flash=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;if(!this._blinkCondition)return!1;let o=this._prepareScope(t);return o.rowData=n,"string"!=typeof e&&(e=G.themeColors.level),this._blink(o,i,e,pi.getOppositeColor(e))},pi.prototype._blink=function(t,e,n,i){let o=!0;return this._blinkCondition.border?(e.style.border="1px solid "+n,o=!1):(e.style.backgroundColor=n,e.style.color=i),pi._clearBlinkTimer(t),t.blinkTimer=setTimeout(t._restorer,this._blinkingDuration),o},pi.prototype.blinkCell=function(t,e,n,i){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,n);return this.blink(t,o,i)},pi.prototype.calcBlinkSignal=function(t,e){return this._blinkCondition?this._blinkCondition._fn(t,e):0},pi.prototype.verifyBlinking=function(t,e){let n=t.blinking;n&&n.blinkTimer&&n.rowData!==e&&(n.rowData=e,pi._clearBlinkTimer(n)&&n._restorer())},pi.prototype.disableLevelColor=function(t){},pi.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var di=window.tr;di||(di=window.tr={});var ci=di.rt;ci||(ci=di.rt={});var _i=di.grid;_i||(_i=di.grid={}),di.MockJET||(di.MockJET=ii),di.closestElement||(di.closestElement=o.closestElement),di.CellPainter||(di.CellPainter=pi),ci.Grid||(ci.Grid=Sn),_i.CellPainter||(_i.CellPainter=pi)}e.default=Sn}]);